|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[211,5,6,7,8,13],{"+NIl":function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){"use strict";N.defineMode("stex",function(v,C){"use strict";function k(i,o){i.cmdState.push(o)}function y(i){return i.cmdState.length>0?i.cmdState[i.cmdState.length-1]:null}function m(i){var o=i.cmdState.pop();o&&o.closeBracket()}function S(i){for(var o=i.cmdState,s=o.length-1;s>=0;s--){var c=o[s];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function b(i,o,s){return function(){this.name=i,this.bracketNo=0,this.style=o,this.styles=s,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var p={};p.importmodule=b("importmodule","tag",["string","builtin"]),p.documentclass=b("documentclass","tag",["","atom"]),p.usepackage=b("usepackage","tag",["atom"]),p.begin=b("begin","tag",["atom"]),p.end=b("end","tag",["atom"]),p.label=b("label","tag",["atom"]),p.ref=b("ref","tag",["atom"]),p.eqref=b("eqref","tag",["atom"]),p.cite=b("cite","tag",["atom"]),p.bibitem=b("bibitem","tag",["atom"]),p.Bibitem=b("Bibitem","tag",["atom"]),p.RBibitem=b("RBibitem","tag",["atom"]),p.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function d(i,o){i.f=o}function t(i,o){var s;if(i.match(/^\\[a-zA-Z@]+/)){var c=i.current().slice(1);return s=p.hasOwnProperty(c)?p[c]:p.DEFAULT,s=new s,k(o,s),d(o,r),s.style}if(i.match(/^\\[$&%#{}_]/))return"tag";if(i.match(/^\\[,;!\/\\]/))return"tag";if(i.match("\\["))return d(o,function(u,f){return l(u,f,"\\]")}),"keyword";if(i.match("\\("))return d(o,function(u,f){return l(u,f,"\\)")}),"keyword";if(i.match("$$"))return d(o,function(u,f){return l(u,f,"$$")}),"keyword";if(i.match("$"))return d(o,function(u,f){return l(u,f,"$")}),"keyword";var a=i.next();if(a=="%")return i.skipToEnd(),"comment";if(a=="}"||a=="]"){if(s=y(o),s)s.closeBracket(a),d(o,r);else return"error";return"bracket"}else return a=="{"||a=="["?(s=p.DEFAULT,s=new s,k(o,s),"bracket"):/\d/.test(a)?(i.eatWhile(/[\w.%]/),"atom"):(i.eatWhile(/[\w\-_]/),s=S(o),s.name=="begin"&&(s.argument=i.current()),s.styleIdentifier())}function l(i,o,s){if(i.eatSpace())return null;if(s&&i.match(s))return d(o,t),"keyword";if(i.match(/^\\[a-zA-Z@]+/))return"tag";if(i.match(/^[a-zA-Z]+/))return"variable-2";if(i.match(/^\\[$&%#{}_]/))return"tag";if(i.match(/^\\[,;!\/]/))return"tag";if(i.match(/^[\^_&]/))return"tag";if(i.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(i.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=i.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(i.skipToEnd(),"comment"):"error"}function r(i,o){var s=i.peek(),c;return s=="{"||s=="["?(c=y(o),c.openBracket(s),i.eat(s),d(o,t),"bracket"):/[ \t\r]/.test(s)?(i.eat(s),null):(d(o,t),m(o),t(i,o))}return{startState:function(){var i=C.inMathMode?function(o,s){return l(o,s)}:t;return{cmdState:[],f:i}},copyState:function(i){return{cmdState:i.cmdState.slice(),f:i.f}},token:function(i,o){return o.f(i,o)},blankLine:function(i){i.f=t,i.cmdState.length=0},lineComment:"%"}}),N.defineMIME("text/x-stex","stex"),N.defineMIME("text/x-latex","stex")})},"+ua5":function(F,Q,j){},"19Vz":function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){N.defineOption("placeholder","",function(b,p,d){var t=d&&d!=N.Init;if(p&&!t)b.on("blur",y),b.on("change",m),b.on("swapDoc",m),N.on(b.getInputField(),"compositionupdate",b.state.placeholderCompose=function(){k(b)}),m(b);else if(!p&&t){b.off("blur",y),b.off("change",m),b.off("swapDoc",m),N.off(b.getInputField(),"compositionupdate",b.state.placeholderCompose),v(b);var l=b.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}p&&!b.hasFocus()&&y(b)});function v(b){b.state.placeholder&&(b.state.placeholder.parentNode.removeChild(b.state.placeholder),b.state.placeholder=null)}function C(b){v(b);var p=b.state.placeholder=document.createElement("pre");p.style.cssText="height: 0; overflow: visible",p.style.direction=b.getOption("direction"),p.className="CodeMirror-placeholder CodeMirror-line-like";var d=b.getOption("placeholder");typeof d=="string"&&(d=document.createTextNode(d)),p.appendChild(d),b.display.lineSpace.insertBefore(p,b.display.lineSpace.firstChild)}function k(b){setTimeout(function(){var p=!1,d=b.getInputField();d.nodeName=="TEXTAREA"?p=!d.value:b.lineCount()==1&&(p=!/[^\u200b]/.test(d.querySelector(".CodeMirror-line").textContent)),p?C(b):v(b)},20)}function y(b){S(b)&&C(b)}function m(b){var p=b.getWrapperElement(),d=S(b);p.className=p.className.replace(" CodeMirror-empty","")+(d?" CodeMirror-empty":""),d?C(b):v(b)}function S(b){return b.lineCount()===1&&b.getLine(0)===""}})},"1T2W":function(F,Q,j){F.exports={"code-panel-container":"code-panel-container___1BMQ9","action-oj-bar":"action-oj-bar___1PRBr",active:"active___2710v"}},"1eCo":function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){"use strict";var v={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},C={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};N.defineMode("xml",function(k,y){var m=k.indentUnit,S={},b=y.htmlMode?v:C;for(var p in b)S[p]=b[p];for(var p in y)S[p]=y[p];var d,t;function l(T,M){function L(z){return M.tokenize=z,z(T,M)}var A=T.next();if(A=="<")return T.eat("!")?T.eat("[")?T.match("CDATA[")?L(o("atom","]]>")):null:T.match("--")?L(o("comment","-->")):T.match("DOCTYPE",!0,!0)?(T.eatWhile(/[\w\._\-]/),L(s(1))):null:T.eat("?")?(T.eatWhile(/[\w\._\-]/),M.tokenize=o("meta","?>"),"meta"):(d=T.eat("/")?"closeTag":"openTag",M.tokenize=r,"tag bracket");if(A=="&"){var V;return T.eat("#")?T.eat("x")?V=T.eatWhile(/[a-fA-F\d]/)&&T.eat(";"):V=T.eatWhile(/[\d]/)&&T.eat(";"):V=T.eatWhile(/[\w\.\-:]/)&&T.eat(";"),V?"atom":"error"}else return T.eatWhile(/[^&<]/),null}l.isInText=!0;function r(T,M){var L=T.next();if(L==">"||L=="/"&&T.eat(">"))return M.tokenize=l,d=L==">"?"endTag":"selfcloseTag","tag bracket";if(L=="=")return d="equals",null;if(L=="<"){M.tokenize=l,M.state=f,M.tagName=M.tagStart=null;var A=M.tokenize(T,M);return A?A+" tag error":"tag error"}else return/[\'\"]/.test(L)?(M.tokenize=i(L),M.stringStartCol=T.column(),M.tokenize(T,M)):(T.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function i(T){var M=function(L,A){for(;!L.eol();)if(L.next()==T){A.tokenize=r;break}return"string"};return M.isInAttribute=!0,M}function o(T,M){return function(L,A){for(;!L.eol();){if(L.match(M)){A.tokenize=l;break}L.next()}return T}}function s(T){return function(M,L){for(var A;(A=M.next())!=null;){if(A=="<")return L.tokenize=s(T+1),L.tokenize(M,L);if(A==">")if(T==1){L.tokenize=l;break}else return L.tokenize=s(T-1),L.tokenize(M,L)}return"meta"}}function c(T,M,L){this.prev=T.context,this.tagName=M,this.indent=T.indented,this.startOfLine=L,(S.doNotIndent.hasOwnProperty(M)||T.context&&T.context.noIndent)&&(this.noIndent=!0)}function a(T){T.context&&(T.context=T.context.prev)}function u(T,M){for(var L;;){if(!T.context)return;if(L=T.context.tagName,!S.contextGrabbers.hasOwnProperty(L)||!S.contextGrabbers[L].hasOwnProperty(M))return;a(T)}}function f(T,M,L){return T=="openTag"?(L.tagStart=M.column(),w):T=="closeTag"?_:f}function w(T,M,L){return T=="word"?(L.tagName=M.current(),t="tag",O):S.allowMissingTagName&&T=="endTag"?(t="tag bracket",O(T,M,L)):(t="error",w)}function _(T,M,L){if(T=="word"){var A=M.current();return L.context&&L.context.tagName!=A&&S.implicitlyClosed.hasOwnProperty(L.context.tagName)&&a(L),L.context&&L.context.tagName==A||S.matchClosing===!1?(t="tag",h):(t="tag error",R)}else return S.allowMissingTagName&&T=="endTag"?(t="tag bracket",h(T,M,L)):(t="error",R)}function h(T,M,L){return T!="endTag"?(t="error",h):(a(L),f)}function R(T,M,L){return t="error",h(T,M,L)}function O(T,M,L){if(T=="word")return t="attribute",g;if(T=="endTag"||T=="selfcloseTag"){var A=L.tagName,V=L.tagStart;return L.tagName=L.tagStart=null,T=="selfcloseTag"||S.autoSelfClosers.hasOwnProperty(A)?u(L,A):(u(L,A),L.context=new c(L,A,V==L.indented)),f}return t="error",O}function g(T,M,L){return T=="equals"?x:(S.allowMissing||(t="error"),O(T,M,L))}function x(T,M,L){return T=="string"?E:T=="word"&&S.allowUnquoted?(t="string",O):(t="error",O(T,M,L))}function E(T,M,L){return T=="string"?E:O(T,M,L)}return{startState:function(T){var M={tokenize:l,state:f,indented:T||0,tagName:null,tagStart:null,context:null};return T!=null&&(M.baseIndent=T),M},token:function(T,M){if(!M.tagName&&T.sol()&&(M.indented=T.indentation()),T.eatSpace())return null;d=null;var L=M.tokenize(T,M);return(L||d)&&L!="comment"&&(t=null,M.state=M.state(d||L,T,M),t&&(L=t=="error"?L+" error":t)),L},indent:function(T,M,L){var A=T.context;if(T.tokenize.isInAttribute)return T.tagStart==T.indented?T.stringStartCol+1:T.indented+m;if(A&&A.noIndent)return N.Pass;if(T.tokenize!=r&&T.tokenize!=l)return L?L.match(/^(\s*)/)[0].length:0;if(T.tagName)return S.multilineTagIndentPastTag!==!1?T.tagStart+T.tagName.length+2:T.tagStart+m*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/<!\[CDATA\[/.test(M))return 0;var V=M&&/^<(\/)?([\w_:\.-]*)/.exec(M);if(V&&V[1])for(;A;)if(A.tagName==V[2]){A=A.prev;break}else if(S.implicitlyClosed.hasOwnProperty(A.tagName))A=A.prev;else break;else if(V)for(;A;){var z=S.contextGrabbers[A.tagName];if(z&&z.hasOwnProperty(V[2]))A=A.prev;else break}for(;A&&A.prev&&!A.startOfLine;)A=A.prev;return A?A.indent+m:T.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(T){T.state==x&&(T.state=O)},xmlCurrentTag:function(T){return T.tagName?{name:T.tagName,close:T.type=="closeTag"}:null},xmlCurrentContext:function(T){for(var M=[],L=T.context;L;L=L.prev)L.tagName&&M.push(L.tagName);return M.reverse()}}}),N.defineMIME("text/xml","xml"),N.defineMIME("application/xml","xml"),N.mimeModes.hasOwnProperty("text/html")||N.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1uat":function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("MlIO"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.Hasher,y=v.x64,m=y.Word,S=y.WordArray,b=v.algo;function p(){return m.create.apply(m,arguments)}var d=[p(1116352408,3609767458),p(1899447441,602891725),p(3049323471,3964484399),p(3921009573,2173295548),p(961987163,4081628472),p(1508970993,3053834265),p(2453635748,2937671579),p(2870763221,3664609560),p(3624381080,2734883394),p(310598401,1164996542),p(607225278,1323610764),p(1426881987,3590304994),p(1925078388,4068182383),p(2162078206,991336113),p(2614888103,633803317),p(3248222580,3479774868),p(3835390401,2666613458),p(4022224774,944711139),p(264347078,2341262773),p(604807628,2007800933),p(770255983,1495990901),p(1249150122,1856431235),p(1555081692,3175218132),p(1996064986,2198950837),p(2554220882,3999719339),p(2821834349,766784016),p(2952996808,2566594879),p(3210313671,3203337956),p(3336571891,1034457026),p(3584528711,2466948901),p(113926993,3758326383),p(338241895,168717936),p(666307205,1188179964),p(773529912,1546045734),p(1294757372,1522805485),p(1396182291,2643833823),p(1695183700,2343527390),p(1986661051,1014477480),p(2177026350,1206759142),p(2456956037,344077627),p(2730485921,1290863460),p(2820302411,3158454273),p(3259730800,3505952657),p(3345764771,106217008),p(3516065817,3606008344),p(3600352804,1432725776),p(4094571909,1467031594),p(275423344,851169720),p(430227734,3100823752),p(506948616,1363258195),p(659060556,3750685593),p(883997877,3785050280),p(958139571,3318307427),p(1322822218,3812723403),p(1537002063,2003034995),p(1747873779,3602036899),p(1955562222,1575990012),p(2024104815,1125592928),p(2227730452,2716904306),p(2361852424,442776044),p(2428436474,593698344),p(2756734187,3733110249),p(3204031479,2999351573),p(3329325298,3815920427),p(3391569614,3928383900),p(3515267271,566280711),p(3940187606,3454069534),p(4118630271,4000239992),p(116418474,1914138554),p(174292421,2731055270),p(289380356,3203993006),p(460393269,320620315),p(685471733,587496836),p(852142971,1086792851),p(1017036298,365543100),p(1126000580,2618297676),p(1288033470,3409855158),p(1501505948,4234509866),p(1607167915,987167468),p(1816402316,1246189591)],t=[];(function(){for(var r=0;r<80;r++)t[r]=p()})();var l=b.SHA512=k.extend({_doReset:function(){this._hash=new S.init([new m.init(1779033703,4089235720),new m.init(3144134277,2227873595),new m.init(1013904242,4271175723),new m.init(2773480762,1595750129),new m.init(1359893119,2917565137),new m.init(2600822924,725511199),new m.init(528734635,4215389547),new m.init(1541459225,327033209)])},_doProcessBlock:function(r,i){for(var o=this._hash.words,s=o[0],c=o[1],a=o[2],u=o[3],f=o[4],w=o[5],_=o[6],h=o[7],R=s.high,O=s.low,g=c.high,x=c.low,E=a.high,T=a.low,M=u.high,L=u.low,A=f.high,V=f.low,z=w.high,W=w.low,G=_.high,U=_.low,P=h.high,H=h.low,$=R,re=O,te=g,ge=x,ve=E,de=T,De=M,Te=L,he=A,ue=V,ie=z,Se=W,ne=G,ce=U,Oe=P,oe=H,q=0;q<80;q++){var Y,Z,ye=t[q];if(q<16)Z=ye.high=r[i+q*2]|0,Y=ye.low=r[i+q*2+1]|0;else{var be=t[q-15],Re=be.high,Qe=be.low,rt=(Re>>>1|Qe<<31)^(Re>>>8|Qe<<24)^Re>>>7,at=(Qe>>>1|Re<<31)^(Qe>>>8|Re<<24)^(Qe>>>7|Re<<25),qe=t[q-2],st=qe.high,lt=qe.low,je=(st>>>19|lt<<13)^(st<<3|lt>>>29)^st>>>6,Ie=(lt>>>19|st<<13)^(lt<<3|st>>>29)^(lt>>>6|st<<26),tt=t[q-7],ot=tt.high,ze=tt.low,Ze=t[q-16],Ne=Ze.high,Ae=Ze.low;Y=at+ze,Z=rt+ot+(Y>>>0<at>>>0?1:0),Y=Y+Ie,Z=Z+je+(Y>>>0<Ie>>>0?1:0),Y=Y+Ae,Z=Z+Ne+(Y>>>0<Ae>>>0?1:0),ye.high=Z,ye.low=Y}var Me=he&ie^~he&ne,Ee=ue&Se^~ue&ce,Ce=$&te^$&ve^te&ve,ke=re&ge^re&de^ge&de,Fe=($>>>28|re<<4)^($<<30|re>>>2)^($<<25|re>>>7),Be=(re>>>28|$<<4)^(re<<30|$>>>2)^(re<<25|$>>>7),et=(he>>>14|ue<<18)^(he>>>18|ue<<14)^(he<<23|ue>>>9),ct=(ue>>>14|he<<18)^(ue>>>18|he<<14)^(ue<<23|he>>>9),yt=d[q],ft=yt.high,mt=yt.low,It=oe+ct,At=Oe+et+(It>>>0<oe>>>0?1:0),It=It+Ee,At=At+Me+(It>>>0<Ee>>>0?1:0),It=It+mt,At=At+ft+(It>>>0<mt>>>0?1:0),It=It+Y,At=At+Z+(It>>>0<Y>>>0?1:0),_t=Be+ke,Vt=Fe+Ce+(_t>>>0<Be>>>0?1:0);Oe=ne,oe=ce,ne=ie,ce=Se,ie=he,Se=ue,ue=Te+It|0,he=De+At+(ue>>>0<Te>>>0?1:0)|0,De=ve,Te=de,ve=te,de=ge,te=$,ge=re,re=It+_t|0,$=At+Vt+(re>>>0<It>>>0?1:0)|0}O=s.low=O+re,s.high=R+$+(O>>>0<re>>>0?1:0),x=c.low=x+ge,c.high=g+te+(x>>>0<ge>>>0?1:0),T=a.low=T+de,a.high=E+ve+(T>>>0<de>>>0?1:0),L=u.low=L+Te,u.high=M+De+(L>>>0<Te>>>0?1:0),V=f.low=V+ue,f.high=A+he+(V>>>0<ue>>>0?1:0),W=w.low=W+Se,w.high=z+ie+(W>>>0<Se>>>0?1:0),U=_.low=U+ce,_.high=G+ne+(U>>>0<ce>>>0?1:0),H=h.low=H+oe,h.high=P+Oe+(H>>>0<oe>>>0?1:0)},_doFinalize:function(){var r=this._data,i=r.words,o=this._nDataBytes*8,s=r.sigBytes*8;i[s>>>5]|=128<<24-s%32,i[(s+128>>>10<<5)+30]=Math.floor(o/4294967296),i[(s+128>>>10<<5)+31]=o,r.sigBytes=i.length*4,this._process();var c=this._hash.toX32();return c},clone:function(){var r=k.clone.call(this);return r._hash=this._hash.clone(),r},blockSize:1024/32});v.SHA512=k._createHelper(l),v.HmacSHA512=k._createHmacHelper(l)}(),N.SHA512})},"3y9D":function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.WordArray,y=C.Hasher,m=v.algo,S=[],b=m.SHA1=y.extend({_doReset:function(){this._hash=new k.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(p,d){for(var t=this._hash.words,l=t[0],r=t[1],i=t[2],o=t[3],s=t[4],c=0;c<80;c++){if(c<16)S[c]=p[d+c]|0;else{var a=S[c-3]^S[c-8]^S[c-14]^S[c-16];S[c]=a<<1|a>>>31}var u=(l<<5|l>>>27)+s+S[c];c<20?u+=(r&i|~r&o)+1518500249:c<40?u+=(r^i^o)+1859775393:c<60?u+=(r&i|r&o|i&o)-1894007588:u+=(r^i^o)-899497514,s=o,o=i,i=r<<30|r>>>2,r=l,l=u}t[0]=t[0]+l|0,t[1]=t[1]+r|0,t[2]=t[2]+i|0,t[3]=t[3]+o|0,t[4]=t[4]+s|0},_doFinalize:function(){var p=this._data,d=p.words,t=this._nDataBytes*8,l=p.sigBytes*8;return d[l>>>5]|=128<<24-l%32,d[(l+64>>>9<<4)+14]=Math.floor(t/4294967296),d[(l+64>>>9<<4)+15]=t,p.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var p=y.clone.call(this);return p._hash=this._hash.clone(),p}});v.SHA1=y._createHelper(b),v.HmacSHA1=y._createHmacHelper(b)}(),N.SHA1})},4:function(F,Q){},"5VLF":function(F,Q,j){"use strict";var N,v;function C(k,y,m){var S=function(b,p){return k.js_beautify(b,p)};return S.js=k.js_beautify,S.css=y.css_beautify,S.html=m.html_beautify,S.js_beautify=k.js_beautify,S.css_beautify=y.css_beautify,S.html_beautify=m.html_beautify,S}!(N=[j("6UM0"),j("TXwP"),j("psGv")],v=function(k,y,m){return C(k,y,m)}.apply(Q,N),v!==void 0&&(F.exports=v))},"5hvy":function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("MlIO"))})(this,function(N){return function(v){var C=N,k=C.lib,y=k.WordArray,m=k.Hasher,S=C.x64,b=S.Word,p=C.algo,d=[],t=[],l=[];(function(){for(var o=1,s=0,c=0;c<24;c++){d[o+5*s]=(c+1)*(c+2)/2%64;var a=s%5,u=(2*o+3*s)%5;o=a,s=u}for(var o=0;o<5;o++)for(var s=0;s<5;s++)t[o+5*s]=s+(2*o+3*s)%5*5;for(var f=1,w=0;w<24;w++){for(var _=0,h=0,R=0;R<7;R++){if(f&1){var O=(1<<R)-1;O<32?h^=1<<O:_^=1<<O-32}f&128?f=f<<1^113:f<<=1}l[w]=b.create(_,h)}})();var r=[];(function(){for(var o=0;o<25;o++)r[o]=b.create()})();var i=p.SHA3=m.extend({cfg:m.cfg.extend({outputLength:512}),_doReset:function(){for(var o=this._state=[],s=0;s<25;s++)o[s]=new b.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(o,s){for(var c=this._state,a=this.blockSize/2,u=0;u<a;u++){var f=o[s+2*u],w=o[s+2*u+1];f=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360;var _=c[u];_.high^=w,_.low^=f}for(var h=0;h<24;h++){for(var R=0;R<5;R++){for(var O=0,g=0,x=0;x<5;x++){var _=c[R+5*x];O^=_.high,g^=_.low}var E=r[R];E.high=O,E.low=g}for(var R=0;R<5;R++)for(var T=r[(R+4)%5],M=r[(R+1)%5],L=M.high,A=M.low,O=T.high^(L<<1|A>>>31),g=T.low^(A<<1|L>>>31),x=0;x<5;x++){var _=c[R+5*x];_.high^=O,_.low^=g}for(var V=1;V<25;V++){var O,g,_=c[V],z=_.high,W=_.low,G=d[V];G<32?(O=z<<G|W>>>32-G,g=W<<G|z>>>32-G):(O=W<<G-32|z>>>64-G,g=z<<G-32|W>>>64-G);var U=r[t[V]];U.high=O,U.low=g}var P=r[0],H=c[0];P.high=H.high,P.low=H.low;for(var R=0;R<5;R++)for(var x=0;x<5;x++){var V=R+5*x,_=c[V],$=r[V],re=r[(R+1)%5+5*x],te=r[(R+2)%5+5*x];_.high=$.high^~re.high&te.high,_.low=$.low^~re.low&te.low}var _=c[0],ge=l[h];_.high^=ge.high,_.low^=ge.low}},_doFinalize:function(){var o=this._data,s=o.words,c=this._nDataBytes*8,a=o.sigBytes*8,u=this.blockSize*32;s[a>>>5]|=1<<24-a%32,s[(v.ceil((a+1)/u)*u>>>5)-1]|=128,o.sigBytes=s.length*4,this._process();for(var f=this._state,w=this.cfg.outputLength/8,_=w/8,h=[],R=0;R<_;R++){var O=f[R],g=O.high,x=O.low;g=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,x=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,h.push(x),h.push(g)}return new y.init(h,w)},clone:function(){for(var o=m.clone.call(this),s=o._state=this._state.slice(0),c=0;c<25;c++)s[c]=s[c].clone();return o}});C.SHA3=m._createHelper(i),C.HmacSHA3=m._createHmacHelper(i)}(Math),N.SHA3})},"5nXd":function(F,Q,j){var N=j("MFOe"),v=N.slice,C=N.pluck,k=N.each,y=N.bind,m=N.create,S=N.isList,b=N.isFunction,p=N.isObject;F.exports={createStore:l};var d={version:"2.0.12",enabled:!1,get:function(r,i){var o=this.storage.read(this._namespacePrefix+r);return this._deserialize(o,i)},set:function(r,i){return i===void 0?this.remove(r):(this.storage.write(this._namespacePrefix+r,this._serialize(i)),i)},remove:function(r){this.storage.remove(this._namespacePrefix+r)},each:function(r){var i=this;this.storage.each(function(o,s){r.call(i,i._deserialize(o),(s||"").replace(i._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(r){return this._namespacePrefix=="__storejs_"+r+"_"},createStore:function(){return l.apply(this,arguments)},addPlugin:function(r){this._addPlugin(r)},namespace:function(r){return l(this.storage,this.plugins,r)}};function t(){var r=typeof console=="undefined"?null:console;if(!r)return;var i=r.warn?r.warn:r.log;i.apply(r,arguments)}function l(r,i,o){o||(o=""),r&&!S(r)&&(r=[r]),i&&!S(i)&&(i=[i]);var s=o?"__storejs_"+o+"_":"",c=o?new RegExp("^"+s):null,a=/^[a-zA-Z0-9_\-]*$/;if(!a.test(o))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var u={_namespacePrefix:s,_namespaceRegexp:c,_testStorage:function(w){try{var _="__storejs__test__";w.write(_,_);var h=w.read(_)===_;return w.remove(_),h}catch(R){return!1}},_assignPluginFnProp:function(w,_){var h=this[_];this[_]=function(){var O=v(arguments,0),g=this;function x(){return h?(k(arguments,function(T,M){O[M]=T}),h.apply(g,O)):void 0}var E=[x].concat(O);return w.apply(g,E)}},_serialize:function(w){return JSON.stringify(w)},_deserialize:function(w,_){if(!w)return _;var h="";try{h=JSON.parse(w)}catch(R){h=w}return h!==void 0?h:_},_addStorage:function(w){if(this.enabled)return;this._testStorage(w)&&(this.storage=w,this.enabled=!0)},_addPlugin:function(w){var _=this;if(S(w)){k(w,function(O){_._addPlugin(O)});return}var h=C(this.plugins,function(O){return w===O});if(h)return;if(this.plugins.push(w),!b(w))throw new Error("Plugins must be function values that return objects");var R=w.call(this);if(!p(R))throw new Error("Plugins must return an object of function properties");k(R,function(O,g){if(!b(O))throw new Error("Bad plugin property: "+g+" from plugin "+w.name+". Plugins should only return functions.");_._assignPluginFnProp(O,g)})},addStorage:function(w){t("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(w)}},f=m(u,d,{plugins:[]});return f.raw={},k(f,function(w,_){b(w)&&(f.raw[_]=y(f,w))}),k(r,function(w){f._addStorage(w)}),k(i,function(w){f._addPlugin(w)}),f}},"6+eU":function(F,Q,j){"use strict";j.d(Q,"a",function(){return h});var N=j("wx14"),v=j("rePB"),C=j("VTBJ"),k=j("1OyB"),y=j("vuIU"),m=j("Ji7U"),S=j("LK+K"),b=j("cDcd"),p=j.n(b),d=j("TSYQ"),t=j.n(d),l=function(O){var g,x="".concat(O.rootPrefixCls,"-item"),E=t()(x,"".concat(x,"-").concat(O.page),(g={},Object(v.a)(g,"".concat(x,"-active"),O.active),Object(v.a)(g,O.className,!!O.className),Object(v.a)(g,"".concat(x,"-disabled"),!O.page),g)),T=function(){O.onClick(O.page)},M=function(A){O.onKeyPress(A,O.onClick,O.page)};return p.a.createElement("li",{title:O.showTitle?O.page:null,className:E,onClick:T,onKeyPress:M,tabIndex:"0"},O.itemRender(O.page,"page",p.a.createElement("a",{rel:"nofollow"},O.page)))},r=l,i={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},o=function(R){Object(m.a)(g,R);var O=Object(S.a)(g);function g(){var x;Object(k.a)(this,g);for(var E=arguments.length,T=new Array(E),M=0;M<E;M++)T[M]=arguments[M];return x=O.call.apply(O,[this].concat(T)),x.state={goInputText:""},x.buildOptionText=function(L){return"".concat(L," ").concat(x.props.locale.items_per_page)},x.changeSize=function(L){x.props.changeSize(Number(L))},x.handleChange=function(L){x.setState({goInputText:L.target.value})},x.handleBlur=function(L){var A=x.props,V=A.goButton,z=A.quickGo,W=A.rootPrefixCls,G=x.state.goInputText;if(V||G==="")return;if(L.relatedTarget&&(L.relatedTarget.className.indexOf("".concat(W,"-prev"))>=0||L.relatedTarget.className.indexOf("".concat(W,"-next"))>=0))return;x.setState({goInputText:""}),z(x.getValidValue())},x.go=function(L){var A=x.state.goInputText;if(A==="")return;(L.keyCode===i.ENTER||L.type==="click")&&(x.setState({goInputText:""}),x.props.quickGo(x.getValidValue()))},x}return Object(y.a)(g,[{key:"getValidValue",value:function(){var E=this.state,T=E.goInputText,M=E.current;return!T||isNaN(T)?M:Number(T)}},{key:"getPageSizeOptions",value:function(){var E=this.props,T=E.pageSize,M=E.pageSizeOptions;return M.some(function(L){return L.toString()===T.toString()})?M:M.concat([T.toString()]).sort(function(L,A){var V=isNaN(Number(L))?0:Number(L),z=isNaN(Number(A))?0:Number(A);return V-z})}},{key:"render",value:function(){var E=this,T=this.props,M=T.pageSize,L=T.locale,A=T.rootPrefixCls,V=T.changeSize,z=T.quickGo,W=T.goButton,G=T.selectComponentClass,U=T.buildOptionText,P=T.selectPrefixCls,H=T.disabled,$=this.state.goInputText,re="".concat(A,"-options"),te=G,ge=null,ve=null,de=null;if(!V&&!z)return null;var De=this.getPageSizeOptions();if(V&&te){var Te=De.map(function(he,ue){return p.a.createElement(te.Option,{key:ue,value:he.toString()},(U||E.buildOptionText)(he))});ge=p.a.createElement(te,{disabled:H,prefixCls:P,showSearch:!1,className:"".concat(re,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(M||De[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},Te)}return z&&(W&&(de=typeof W=="boolean"?p.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(re,"-quick-jumper-button")},L.jump_to_confirm):p.a.createElement("span",{onClick:this.go,onKeyUp:this.go},W)),ve=p.a.createElement("div",{className:"".concat(re,"-quick-jumper")},L.jump_to,p.a.createElement("input",{disabled:H,type:"text",value:$,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),L.page,de)),p.a.createElement("li",{className:"".concat(re)},ge,ve)}}]),g}(p.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var s=o,c=j("N2Kk");function a(){}function u(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function f(R,O,g){return g}function w(R,O,g){var x=typeof R=="undefined"?O.pageSize:R;return Math.floor((g.total-1)/x)+1}var _=function(R){Object(m.a)(g,R);var O=Object(S.a)(g);function g(x){var E;Object(k.a)(this,g),E=O.call(this,x),E.getJumpPrevPage=function(){return Math.max(1,E.state.current-(E.props.showLessItems?3:5))},E.getJumpNextPage=function(){return Math.min(w(void 0,E.state,E.props),E.state.current+(E.props.showLessItems?3:5))},E.getItemIcon=function(V,z){var W=E.props.prefixCls,G=V||p.a.createElement("button",{type:"button","aria-label":z,className:"".concat(W,"-item-link")});return typeof V=="function"&&(G=p.a.createElement(V,Object(C.a)({},E.props))),G},E.savePaginationNode=function(V){E.paginationNode=V},E.isValid=function(V){return u(V)&&V!==E.state.current},E.shouldDisplayQuickJumper=function(){var V=E.props,z=V.showQuickJumper,W=V.pageSize,G=V.total;return G<=W?!1:z},E.handleKeyDown=function(V){(V.keyCode===i.ARROW_UP||V.keyCode===i.ARROW_DOWN)&&V.preventDefault()},E.handleKeyUp=function(V){var z=E.getValidValue(V),W=E.state.currentInputValue;z!==W&&E.setState({currentInputValue:z}),V.keyCode===i.ENTER?E.handleChange(z):V.keyCode===i.ARROW_UP?E.handleChange(z-1):V.keyCode===i.ARROW_DOWN&&E.handleChange(z+1)},E.changePageSize=function(V){var z=E.state.current,W=w(V,E.state,E.props);z=z>W?W:z,W===0&&(z=E.state.current),typeof V=="number"&&("pageSize"in E.props||E.setState({pageSize:V}),"current"in E.props||E.setState({current:z,currentInputValue:z})),E.props.onShowSizeChange(z,V),"onChange"in E.props&&E.props.onChange&&E.props.onChange(z,V)},E.handleChange=function(V){var z=E.props.disabled,W=V;if(E.isValid(W)&&!z){var G=w(void 0,E.state,E.props);W>G?W=G:W<1&&(W=1),"current"in E.props||E.setState({current:W,currentInputValue:W});var U=E.state.pageSize;return E.props.onChange(W,U),W}return E.state.current},E.prev=function(){E.hasPrev()&&E.handleChange(E.state.current-1)},E.next=function(){E.hasNext()&&E.handleChange(E.state.current+1)},E.jumpPrev=function(){E.handleChange(E.getJumpPrevPage())},E.jumpNext=function(){E.handleChange(E.getJumpNextPage())},E.hasPrev=function(){return E.state.current>1},E.hasNext=function(){return E.state.current<w(void 0,E.state,E.props)},E.runIfEnter=function(V,z){if(V.key==="Enter"||V.charCode===13){for(var W=arguments.length,G=new Array(W>2?W-2:0),U=2;U<W;U++)G[U-2]=arguments[U];z.apply(void 0,G)}},E.runIfEnterPrev=function(V){E.runIfEnter(V,E.prev)},E.runIfEnterNext=function(V){E.runIfEnter(V,E.next)},E.runIfEnterJumpPrev=function(V){E.runIfEnter(V,E.jumpPrev)},E.runIfEnterJumpNext=function(V){E.runIfEnter(V,E.jumpNext)},E.handleGoTO=function(V){(V.keyCode===i.ENTER||V.type==="click")&&E.handleChange(E.state.currentInputValue)};var T=x.onChange!==a,M="current"in x;M&&!T&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var L=x.defaultCurrent;"current"in x&&(L=x.current);var A=x.defaultPageSize;return"pageSize"in x&&(A=x.pageSize),L=Math.min(L,w(A,void 0,x)),E.state={current:L,currentInputValue:L,pageSize:A},E}return Object(y.a)(g,[{key:"componentDidUpdate",value:function(E,T){var M=this.props.prefixCls;if(T.current!==this.state.current&&this.paginationNode){var L=this.paginationNode.querySelector(".".concat(M,"-item-").concat(T.current));L&&document.activeElement===L&&L.blur()}}},{key:"getValidValue",value:function(E){var T=E.target.value,M=w(void 0,this.state,this.props),L=this.state.currentInputValue,A;return T===""?A=T:isNaN(Number(T))?A=L:T>=M?A=M:A=Number(T),A}},{key:"getShowSizeChanger",value:function(){var E=this.props,T=E.showSizeChanger,M=E.total,L=E.totalBoundaryShowSizeChanger;return typeof T!="undefined"?T:M>L}},{key:"renderPrev",value:function(E){var T=this.props,M=T.prevIcon,L=T.itemRender,A=L(E,"prev",this.getItemIcon(M,"prev page")),V=!this.hasPrev();return Object(b.isValidElement)(A)?Object(b.cloneElement)(A,{disabled:V}):A}},{key:"renderNext",value:function(E){var T=this.props,M=T.nextIcon,L=T.itemRender,A=L(E,"next",this.getItemIcon(M,"next page")),V=!this.hasNext();return Object(b.isValidElement)(A)?Object(b.cloneElement)(A,{disabled:V}):A}},{key:"render",value:function(){var E=this,T=this.props,M=T.prefixCls,L=T.className,A=T.style,V=T.disabled,z=T.hideOnSinglePage,W=T.total,G=T.locale,U=T.showQuickJumper,P=T.showLessItems,H=T.showTitle,$=T.showTotal,re=T.simple,te=T.itemRender,ge=T.showPrevNextJumpers,ve=T.jumpPrevIcon,de=T.jumpNextIcon,De=T.selectComponentClass,Te=T.selectPrefixCls,he=T.pageSizeOptions,ue=this.state,ie=ue.current,Se=ue.pageSize,ne=ue.currentInputValue;if(z===!0&&W<=Se)return null;var ce=w(void 0,this.state,this.props),Oe=[],oe=null,q=null,Y=null,Z=null,ye=null,be=U&&U.goButton,Re=P?1:2,Qe=ie-1>0?ie-1:0,rt=ie+1<ce?ie+1:ce,at=Object.keys(this.props).reduce(function(Ee,Ce){return(Ce.substr(0,5)==="data-"||Ce.substr(0,5)==="aria-"||Ce==="role")&&(Ee[Ce]=E.props[Ce]),Ee},{});if(re)return be&&(typeof be=="boolean"?ye=p.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},G.jump_to_confirm):ye=p.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},be),ye=p.a.createElement("li",{title:H?"".concat(G.jump_to).concat(ie,"/").concat(ce):null,className:"".concat(M,"-simple-pager")},ye)),p.a.createElement("ul",Object(N.a)({className:t()(M,"".concat(M,"-simple"),Object(v.a)({},"".concat(M,"-disabled"),V),L),style:A,ref:this.savePaginationNode},at),p.a.createElement("li",{title:H?G.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:t()("".concat(M,"-prev"),Object(v.a)({},"".concat(M,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Qe)),p.a.createElement("li",{title:H?"".concat(ie,"/").concat(ce):null,className:"".concat(M,"-simple-pager")},p.a.createElement("input",{type:"text",value:ne,disabled:V,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),p.a.createElement("span",{className:"".concat(M,"-slash")},"/"),ce),p.a.createElement("li",{title:H?G.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:t()("".concat(M,"-next"),Object(v.a)({},"".concat(M,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(rt)),ye);if(ce<=3+Re*2){var qe={locale:G,rootPrefixCls:M,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:te};ce||Oe.push(p.a.createElement(r,Object(N.a)({},qe,{key:"noPager",page:ce,className:"".concat(M,"-disabled")})));for(var st=1;st<=ce;st+=1){var lt=ie===st;Oe.push(p.a.createElement(r,Object(N.a)({},qe,{key:st,page:st,active:lt})))}}else{var je=P?G.prev_3:G.prev_5,Ie=P?G.next_3:G.next_5;ge&&(oe=p.a.createElement("li",{title:H?je:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:t()("".concat(M,"-jump-prev"),Object(v.a)({},"".concat(M,"-jump-prev-custom-icon"),!!ve))},te(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(ve,"prev page"))),q=p.a.createElement("li",{title:H?Ie:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:t()("".concat(M,"-jump-next"),Object(v.a)({},"".concat(M,"-jump-next-custom-icon"),!!de))},te(this.getJumpNextPage(),"jump-next",this.getItemIcon(de,"next page")))),Z=p.a.createElement(r,{locale:G,last:!0,rootPrefixCls:M,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ce,page:ce,active:!1,showTitle:H,itemRender:te}),Y=p.a.createElement(r,{locale:G,rootPrefixCls:M,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:te});var tt=Math.max(1,ie-Re),ot=Math.min(ie+Re,ce);ie-1<=Re&&(ot=1+Re*2),ce-ie<=Re&&(tt=ce-Re*2);for(var ze=tt;ze<=ot;ze+=1){var Ze=ie===ze;Oe.push(p.a.createElement(r,{locale:G,rootPrefixCls:M,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ze,page:ze,active:Ze,showTitle:H,itemRender:te}))}ie-1>=Re*2&&ie!==1+2&&(Oe[0]=Object(b.cloneElement)(Oe[0],{className:"".concat(M,"-item-after-jump-prev")}),Oe.unshift(oe)),ce-ie>=Re*2&&ie!==ce-2&&(Oe[Oe.length-1]=Object(b.cloneElement)(Oe[Oe.length-1],{className:"".concat(M,"-item-before-jump-next")}),Oe.push(q)),tt!==1&&Oe.unshift(Y),ot!==ce&&Oe.push(Z)}var Ne=null;$&&(Ne=p.a.createElement("li",{className:"".concat(M,"-total-text")},$(W,[W===0?0:(ie-1)*Se+1,ie*Se>W?W:ie*Se])));var Ae=!this.hasPrev()||!ce,Me=!this.hasNext()||!ce;return p.a.createElement("ul",Object(N.a)({className:t()(M,L,Object(v.a)({},"".concat(M,"-disabled"),V)),style:A,unselectable:"unselectable",ref:this.savePaginationNode},at),Ne,p.a.createElement("li",{title:H?G.prev_page:null,onClick:this.prev,tabIndex:Ae?null:0,onKeyPress:this.runIfEnterPrev,className:t()("".concat(M,"-prev"),Object(v.a)({},"".concat(M,"-disabled"),Ae)),"aria-disabled":Ae},this.renderPrev(Qe)),Oe,p.a.createElement("li",{title:H?G.next_page:null,onClick:this.next,tabIndex:Me?null:0,onKeyPress:this.runIfEnterNext,className:t()("".concat(M,"-next"),Object(v.a)({},"".concat(M,"-disabled"),Me)),"aria-disabled":Me},this.renderNext(rt)),p.a.createElement(s,{disabled:V,locale:G,rootPrefixCls:M,selectComponentClass:De,selectPrefixCls:Te,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ie,pageSize:Se,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:be}))}}],[{key:"getDerivedStateFromProps",value:function(E,T){var M={};if("current"in E&&(M.current=E.current,E.current!==T.current&&(M.currentInputValue=M.current)),"pageSize"in E&&E.pageSize!==T.pageSize){var L=T.current,A=w(E.pageSize,T,E);L=L>A?A:L,"current"in E||(M.current=L,M.currentInputValue=L),M.pageSize=E.pageSize}return M}}]),g}(p.a.Component);_.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:c.a,style:{},itemRender:f,totalBoundaryShowSizeChanger:50};var h=_},"6RRn":function(F,Q,j){"use strict";var N=j("wCXF"),v=j("n6Qo");j.d(Q,"b",function(){return v.a});var C=j("IBYe"),k=j("6eGT"),y=j("hW8S");j.d(Q,"a",function(){return y.a}),Q.c=N.b},"6UM0":function(F,Q,j){var N,v;(function(){var C;(function(){"use strict";var y=[function(p,d,t){var l=t(1).Beautifier,r=t(5).Options;function i(o,s){var c=new l(o,s);return c.beautify()}p.exports=i,p.exports.defaultOptions=function(){return new r}},function(p,d,t){var l=t(2).Output,r=t(3).Token,i=t(4),o=t(5).Options,s=t(7).Tokenizer,c=t(7).line_starters,a=t(7).positionable_operators,u=t(7).TOKEN;function f(P,H){return H.indexOf(P)!==-1}function w(P){return P.replace(/^\s+/g,"")}function _(P){for(var H={},$=0;$<P.length;$++)H[P[$].replace(/-/g,"_")]=P[$];return H}function h(P,H){return P&&P.type===u.RESERVED&&P.text===H}function R(P,H){return P&&P.type===u.RESERVED&&f(P.text,H)}var O=["case","return","do","if","throw","else","await","break","continue","async"],g=["before-newline","after-newline","preserve-newline"],x=_(g),E=[x.before_newline,x.preserve_newline],T={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function M(P,H){if(H.multiline_frame||H.mode===T.ForInitializer||H.mode===T.Conditional)return;P.remove_indent(H.start_line_index)}function L(P){P=P.replace(i.allLineBreaks,`
|
|
|
`);for(var H=[],$=P.indexOf(`
|
|
|
`);$!==-1;)H.push(P.substring(0,$)),P=P.substring($+1),$=P.indexOf(`
|
|
|
`);return P.length&&H.push(P),H}function A(P){return P===T.ArrayLiteral}function V(P){return f(P,[T.Expression,T.ForInitializer,T.Conditional])}function z(P,H){for(var $=0;$<P.length;$++){var re=P[$].trim();if(re.charAt(0)!==H)return!1}return!0}function W(P,H){for(var $=0,re=P.length,te;$<re;$++)if(te=P[$],te&&te.indexOf(H)!==0)return!1;return!0}function G(P,H){H=H||{},this._source_text=P||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(H)}G.prototype.create_flags=function(P,H){var $=0;P&&($=P.indentation_level,!this._output.just_added_newline()&&P.line_indent_level>$&&($=P.line_indent_level));var re={mode:H,parent:P,last_token:P?P.last_token:new r(u.START_BLOCK,""),last_word:P?P.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:P?P.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return re},G.prototype._reset=function(P){var H=P.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new l(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(T.BlockStatement);var $=new s(P,this._options);return this._tokens=$.tokenize(),P},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var P,H=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
|
|
|
`,H&&i.lineBreak.test(H||"")&&($=H.match(i.lineBreak)[0]));for(var re=this._tokens.next();re;)this.handle_token(re),this._last_last_text=this._flags.last_token.text,this._flags.last_token=re,re=this._tokens.next();return P=this._output.get_code($),P},G.prototype.handle_token=function(P,H){P.type===u.START_EXPR?this.handle_start_expr(P):P.type===u.END_EXPR?this.handle_end_expr(P):P.type===u.START_BLOCK?this.handle_start_block(P):P.type===u.END_BLOCK?this.handle_end_block(P):P.type===u.WORD?this.handle_word(P):P.type===u.RESERVED?this.handle_word(P):P.type===u.SEMICOLON?this.handle_semicolon(P):P.type===u.STRING?this.handle_string(P):P.type===u.EQUALS?this.handle_equals(P):P.type===u.OPERATOR?this.handle_operator(P):P.type===u.COMMA?this.handle_comma(P):P.type===u.BLOCK_COMMENT?this.handle_block_comment(P,H):P.type===u.COMMENT?this.handle_comment(P,H):P.type===u.DOT?this.handle_dot(P):P.type===u.EOF?this.handle_eof(P):P.type===u.UNKNOWN?this.handle_unknown(P,H):this.handle_unknown(P,H)},G.prototype.handle_whitespace_and_comments=function(P,H){var $=P.newlines,re=this._options.keep_array_indentation&&A(this._flags.mode);if(P.comments_before)for(var te=P.comments_before.next();te;)this.handle_whitespace_and_comments(te,H),this.handle_token(te,H),te=P.comments_before.next();if(re)for(var ge=0;ge<$;ge+=1)this.print_newline(ge>0,H);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,H);for(var ve=1;ve<$;ve+=1)this.print_newline(!0,H)}};var U=["async","break","continue","return","throw","yield"];G.prototype.allow_wrap_or_preserved_newline=function(P,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&P.newlines||H,re=f(this._flags.last_token.text,a)||f(P.text,a);if(re){var te=f(this._flags.last_token.text,a)&&f(this._options.operator_position,E)||f(P.text,a);$=$&&te}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,U))return;this._output.set_wrap_point()}},G.prototype.print_newline=function(P,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===T.Statement&&!(this._flags.if_block&&h($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(P)&&(this._flags.multiline_frame=!0)},G.prototype.print_token_line_indentation=function(P){this._output.just_added_newline()&&(this._options.keep_array_indentation&&P.newlines&&(P.text==="["||A(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(P.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},G.prototype.print_token=function(P){if(this._output.raw){this._output.add_raw_token(P);return}if(this._options.comma_first&&P.previous&&P.previous.type===u.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(P),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(P),this._output.non_breaking_space=!0,this._output.add_token(P.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},G.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.set_mode=function(P){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,P),this._flags=this.create_flags(this._previous_flags,P),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===T.Statement&&M(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.start_of_object_property=function(){return this._flags.parent.mode===T.ObjectLiteral&&this._flags.mode===T.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(P){var H=!1;return H=H||R(this._flags.last_token,["var","let","const"])&&P.type===u.WORD,H=H||h(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===T.ObjectLiteral&&this._flags.mode===T.Statement)&&R(this._flags.last_token,U)&&!P.newlines,H=H||h(this._flags.last_token,"else")&&!(h(P,"if")&&!P.comments_before),H=H||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===T.ForInitializer||this._previous_flags.mode===T.Conditional),H=H||this._flags.last_token.type===u.WORD&&this._flags.mode===T.BlockStatement&&!this._flags.in_case&&!(P.text==="--"||P.text==="++")&&this._last_last_text!=="function"&&P.type!==u.WORD&&P.type!==u.RESERVED,H=H||this._flags.mode===T.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),H?(this.set_mode(T.Statement),this.indent(),this.handle_whitespace_and_comments(P,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P,R(P,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(P){this.start_of_statement(P)||this.handle_whitespace_and_comments(P);var H=T.Expression;if(P.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,c)&&(this._output.space_before_token=!0),this.print_token(P),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=T.ArrayLiteral,A(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),f(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=T.ForInitializer):f(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=T.Conditional):f(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&P.whitespace_before===""?this._output.space_before_token=!1:(f(this._flags.last_token.text,c)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var re=this._tokens.peek(-4);R($,["async","function"])||$.text==="*"&&R(re,["async","function"])?this._output.space_before_token=!0:this._flags.mode===T.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(re.text==="{"||re.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(P);(this._flags.last_token.type===u.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===T.ObjectLiteral&&f(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===u.START_BLOCK?this.print_newline():(this._flags.last_token.type===u.END_EXPR||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===u.COMMA)&&this.allow_wrap_or_preserved_newline(P,P.newlines),this.print_token(P),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(P){for(;this._flags.mode===T.Statement;)this.restore_mode();this.handle_whitespace_and_comments(P),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(P,P.text==="]"&&A(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===u.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(P),this.restore_mode(),M(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===T.Conditional&&(this._previous_flags.mode=T.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(P){this.handle_whitespace_and_comments(P);var H=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(T.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(T.BlockStatement):$&&(f($.text,[":",","])&&f(H.type,[u.STRING,u.WORD,u.RESERVED])||f(H.text,["get","set","..."])&&f($.type,[u.WORD,u.RESERVED]))?f(this._last_last_text,["class","interface"])&&!f($.text,[":",","])?this.set_mode(T.BlockStatement):this.set_mode(T.ObjectLiteral):this._flags.last_token.type===u.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(T.BlockStatement):f(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(T.ObjectLiteral):this.set_mode(T.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var re=!H.comments_before&&H.text==="}",te=re&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var ge=0,ve=null;this._flags.inline_frame=!0;do if(ge+=1,ve=this._tokens.peek(ge-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==u.EOF&&!(ve.type===u.END_BLOCK&&ve.opened===P))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&P.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(te||this._flags.last_token.type===u.EQUALS||R(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(A(this._previous_flags.mode)&&(this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.COMMA)&&((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(P),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(this._flags.last_token.type===u.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(P),this.indent(),!re&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(P){for(this.handle_whitespace_and_comments(P);this._flags.mode===T.Statement;)this.restore_mode();var H=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(A(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(P)},G.prototype.handle_word=function(P){if(P.type===u.RESERVED){if(f(P.text,["set","get"])&&this._flags.mode!==T.ObjectLiteral)P.type=u.WORD;else if(P.text==="import"&&f(this._tokens.peek().text,["(","."]))P.type=u.WORD;else if(f(P.text,["as","from"])&&!this._flags.import_block)P.type=u.WORD;else if(this._flags.mode===T.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(P.type=u.WORD)}}if(this.start_of_statement(P)?R(this._flags.last_token,["var","let","const"])&&P.type===u.WORD&&(this._flags.declaration_statement=!0):P.newlines&&!V(this._flags.mode)&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==u.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(P),this.print_newline()):this.handle_whitespace_and_comments(P),this._flags.do_block&&!this._flags.do_while)if(h(P,"while")){this._output.space_before_token=!0,this.print_token(P),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&h(P,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===T.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(P,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(P),this._flags.in_case=!0;return}if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P)),h(P,"function")){(f(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(f(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===u.OPERATOR))&&(!this._output.just_added_blankline()&&!P.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,U)?this._output.space_before_token=!0:h(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===u.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(V(this._flags.mode)||A(this._flags.mode))||this.print_newline(),this.print_token(P),this._flags.last_word=P.text;return}var $="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":R(P,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&P.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===T.BlockStatement?$="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&V(this._flags.mode)?$="SPACE":this._flags.last_token.type===u.STRING?$="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===T.ObjectLiteral&&f(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),R(P,c)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),R(P,["else","catch","finally"]))if((!(this._flags.last_token.type===u.END_BLOCK&&this._previous_flags.mode===T.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&P.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var re=this._output.current_line;re.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?R(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(P,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?(this._flags.last_token.type!==u.START_EXPR||!R(P,["var","let","const"]))&&this._flags.last_token.text!==":"&&(h(P,"if")&&h(P.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(P,c)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&A(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);P.previous&&(P.previous.type===u.WORD||P.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(P),this._flags.last_word=P.text,P.type===u.RESERVED&&(P.text==="do"?this._flags.do_block=!0:P.text==="if"?this._flags.if_block=!0:P.text==="import"?this._flags.import_block=!0:this._flags.import_block&&h(P,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(P){this.start_of_statement(P)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(P);for(var H=this._tokens.peek();this._flags.mode===T.Statement&&!(this._flags.if_block&&h(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(P)},G.prototype.handle_string=function(P){P.text.startsWith("`")&&P.newlines===0&&P.whitespace_before===""&&(P.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(P)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(P),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P):P.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(P.previous.text==="]"||P.previous.text===")")&&P.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(P)},G.prototype.handle_equals=function(P){this.start_of_statement(P)||this.handle_whitespace_and_comments(P),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(P),this._output.space_before_token=!0},G.prototype.handle_comma=function(P){this.handle_whitespace_and_comments(P,!0),this.print_token(P),this._output.space_before_token=!0,this._flags.declaration_statement?(V(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(P)):this._flags.mode===T.ObjectLiteral||this._flags.mode===T.Statement&&this._flags.parent.mode===T.ObjectLiteral?(this._flags.mode===T.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(P)},G.prototype.handle_operator=function(P){var H=P.text==="*"&&(R(this._flags.last_token,["function","yield"])||f(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),$=f(P.text,["-","+"])&&(f(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||f(this._flags.last_token.text,c)||this._flags.last_token.text===",");if(!this.start_of_statement(P)){var re=!H;this.handle_whitespace_and_comments(P,re)}if(P.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(P);return}if(P.text==="::"){this.print_token(P);return}if(this._flags.last_token.type===u.OPERATOR&&f(this._options.operator_position,E)&&this.allow_wrap_or_preserved_newline(P),P.text===":"&&this._flags.in_case){this.print_token(P),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==u.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var te=!0,ge=!0,ve=!1;if(P.text===":"?this._flags.ternary_depth===0?te=!1:(this._flags.ternary_depth-=1,ve=!0):P.text==="?"&&(this._flags.ternary_depth+=1),!$&&!H&&this._options.preserve_newlines&&f(P.text,a)){var de=P.text===":",De=de&&ve,Te=de&&!ve;switch(this._options.operator_position){case x.before_newline:this._output.space_before_token=!Te,this.print_token(P),(!de||De)&&this.allow_wrap_or_preserved_newline(P),this._output.space_before_token=!0;return;case x.after_newline:this._output.space_before_token=!0,!de||De?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(P):this._output.space_before_token=!1,this.print_token(P),this._output.space_before_token=!0;return;case x.preserve_newline:Te||this.allow_wrap_or_preserved_newline(P),te=!(this._output.just_added_newline()||Te),this._output.space_before_token=te,this.print_token(P),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(P),te=!1;var he=this._tokens.peek();ge=he&&f(he.type,[u.WORD,u.RESERVED])}else if(P.text==="...")this.allow_wrap_or_preserved_newline(P),te=this._flags.last_token.type===u.START_BLOCK,ge=!1;else if(f(P.text,["--","++","!","~"])||$){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(P),te=!1,ge=!1,P.newlines&&(P.text==="--"||P.text==="++"||P.text==="~")){var ue=R(this._flags.last_token,O)&&P.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&V(this._flags.mode)&&(te=!0),this._flags.last_token.type===u.RESERVED?te=!0:this._flags.last_token.type===u.END_EXPR?te=!(this._flags.last_token.text==="]"&&(P.text==="--"||P.text==="++")):this._flags.last_token.type===u.OPERATOR&&(te=f(P.text,["--","-","++","+"])&&f(this._flags.last_token.text,["--","-","++","+"]),f(P.text,["+","-"])&&f(this._flags.last_token.text,["--","++"])&&(ge=!0)),(this._flags.mode===T.BlockStatement&&!this._flags.inline_frame||this._flags.mode===T.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||te,this.print_token(P),this._output.space_before_token=ge},G.prototype.handle_block_comment=function(P,H){if(this._output.raw){this._output.add_raw_token(P),P.directives&&P.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(P.directives){this.print_newline(!1,H),this.print_token(P),P.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!i.newline.test(P.text)&&!P.newlines){this._output.space_before_token=!0,this.print_token(P),this._output.space_before_token=!0;return}else this.print_block_commment(P,H)},G.prototype.print_block_commment=function(P,H){var $=L(P.text),re,te=!1,ge=!1,ve=P.whitespace_before,de=ve.length;if(this.print_newline(!1,H),this.print_token_line_indentation(P),this._output.add_token($[0]),this.print_newline(!1,H),$.length>1){for($=$.slice(1),te=z($,"*"),ge=W($,ve),te&&(this._flags.alignment=1),re=0;re<$.length;re++)te?(this.print_token_line_indentation(P),this._output.add_token(w($[re]))):ge&&$[re]?(this.print_token_line_indentation(P),this._output.add_token($[re].substring(de))):(this._output.current_line.set_indent(-1),this._output.add_token($[re])),this.print_newline(!1,H);this._flags.alignment=0}},G.prototype.handle_comment=function(P,H){P.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(P),this.print_newline(!1,H)},G.prototype.handle_dot=function(P){this.start_of_statement(P)||this.handle_whitespace_and_comments(P,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(P,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(P)},G.prototype.handle_unknown=function(P,H){this.print_token(P),P.text[P.text.length-1]===`
|
|
|
`&&this.print_newline(!1,H)},G.prototype.handle_eof=function(P){for(;this._flags.mode===T.Statement;)this.restore_mode();this.handle_whitespace_and_comments(P)},p.exports.Beautifier=G},function(p){function d(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}d.prototype.clone_empty=function(){var r=new d(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},d.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},d.prototype.has_match=function(r){for(var i=this.__items.length-1;i>=0;i--)if(this.__items[i].match(r))return!0;return!1},d.prototype.set_indent=function(r,i){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=i||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},d.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(r){this.__items.push(r);var i=r.lastIndexOf(`
|
|
|
`);i!==-1?this.__character_count=r.length-i:this.__character_count+=r.length},d.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function t(r,i){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),i=i||"",r.indent_level>0&&(i=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=i,this.__base_string_length=i.length}t.prototype.get_indent_size=function(r,i){var o=this.__base_string_length;return i=i||0,r<0&&(o=0),o+=r*this.__indent_size,o+=i,o},t.prototype.get_indent_string=function(r,i){var o=this.__base_string;return i=i||0,r<0&&(r=0,o=""),i+=r*this.__indent_size,this.__ensure_cache(i),o+=this.__cache[i],o},t.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var r=this.__cache.length,i=0,o="";this.__indent_size&&r>=this.__indent_size&&(i=Math.floor(r/this.__indent_size),r-=i*this.__indent_size,o=new Array(i+1).join(this.__indent_string)),r&&(o+=new Array(r+1).join(" ")),this.__cache.push(o)};function l(r,i){this.__indent_cache=new t(r,i),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(r,i){return this.__indent_cache.get_indent_string(r,i)},l.prototype.get_indent_size=function(r,i){return this.__indent_cache.get_indent_size(r,i)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(r){this.trim(!0);var i=this.current_line.pop();i&&(i[i.length-1]===`
|
|
|
`&&(i=i.replace(/\n+$/g,"")),this.current_line.push(i)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
|
`);return r!==`
|
|
|
`&&(o=o.replace(/[\n]/g,r)),o},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(r,i){return r=r||0,i=i||0,this.next_line.set_indent(r,i),this.__lines.length>1?(this.current_line.set_indent(r,i),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(r){for(var i=0;i<r.newlines;i++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},l.prototype.remove_indent=function(r){for(var i=this.__lines.length;r<i;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(r,i){for(var o=this.__lines.length-2;o>=0;){var s=this.__lines[o];if(s.is_empty())break;if(s.item(0).indexOf(r)!==0&&s.item(-1)!==i){this.__lines.splice(o+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},p.exports.Output=l},function(p){function d(t,l,r,i){this.type=t,this.text=l,this.comments_before=null,this.newlines=r||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}p.exports.Token=d},function(p,d){var t="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",l="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",i="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+t+r+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+l+r+i+"])*";d.identifier=new RegExp(o+s,"g"),d.identifierStart=new RegExp(o),d.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+l+r+i+"])+");var c=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;d.newline=/[\n\r\u2028\u2029]/,d.lineBreak=new RegExp(`\r
|
|
|
|`+d.newline.source),d.allLineBreaks=new RegExp(d.lineBreak.source,"g")},function(p,d,t){var l=t(6).Options,r=["before-newline","after-newline","preserve-newline"];function i(o){l.call(this,o,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var c=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<c.length;a++)c[a]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=c[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",r),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}i.prototype=new l,p.exports.Options=i},function(p){function d(r,i){this.raw_options=t(r,i),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}d.prototype._get_array=function(r,i){var o=this.raw_options[r],s=i||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(s=o.concat()):typeof o=="string"&&(s=o.split(/[^a-zA-Z0-9_\/\-]+/)),s},d.prototype._get_boolean=function(r,i){var o=this.raw_options[r],s=o===void 0?!!i:!!o;return s},d.prototype._get_characters=function(r,i){var o=this.raw_options[r],s=i||"";return typeof o=="string"&&(s=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),s},d.prototype._get_number=function(r,i){var o=this.raw_options[r];i=parseInt(i,10),isNaN(i)&&(i=0);var s=parseInt(o,10);return isNaN(s)&&(s=i),s},d.prototype._get_selection=function(r,i,o){var s=this._get_selection_list(r,i,o);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
|
|
|
`+i+`
|
|
|
You passed in: '`+this.raw_options[r]+"'");return s[0]},d.prototype._get_selection_list=function(r,i,o){if(!i||i.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[i[0]],!this._is_valid_selection(o,i))throw new Error("Invalid Default Value!");var s=this._get_array(r,o);if(!this._is_valid_selection(s,i))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
|
|
|
`+i+`
|
|
|
You passed in: '`+this.raw_options[r]+"'");return s},d.prototype._is_valid_selection=function(r,i){return r.length&&i.length&&!r.some(function(o){return i.indexOf(o)===-1})};function t(r,i){var o={};r=l(r);var s;for(s in r)s!==i&&(o[s]=r[s]);if(i&&r[i])for(s in r[i])o[s]=r[i][s];return o}function l(r){var i={},o;for(o in r){var s=o.replace(/-/g,"_");i[s]=r[o]}return i}p.exports.Options=d,p.exports.normalizeOpts=l,p.exports.mergeOpts=t},function(p,d,t){var l=t(8).InputScanner,r=t(9).Tokenizer,i=t(9).TOKEN,o=t(13).Directives,s=t(4),c=t(12).Pattern,a=t(14).TemplatablePattern;function u(z,W){return W.indexOf(z)!==-1}var f={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:i.START,RAW:i.RAW,EOF:i.EOF},w=new o(/\/\*/,/\*\//),_=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,h=/[0-9]/,R=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),g="\\?\\.(?!\\d) "+g,g=g.replace(/ /g,"|");var x=new RegExp(g),E="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),T=E.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),M=new RegExp("^(?:"+T.join("|")+")$"),L,A=function(z,W){r.call(this,z,W),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new c(this._input),U=new a(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(s.identifier).matching(s.identifierMatch),number:G.matching(_),punct:G.matching(x),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(/<!--/),html_comment_end:G.matching(/-->/),include:G.starting_with(/#include/).until_after(s.lineBreak),shebang:G.starting_with(/#!/).until_after(s.lineBreak),xml:G.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};A.prototype=new r,A.prototype._is_comment=function(z){return z.type===f.COMMENT||z.type===f.BLOCK_COMMENT||z.type===f.UNKNOWN},A.prototype._is_opening=function(z){return z.type===f.START_BLOCK||z.type===f.START_EXPR},A.prototype._is_closing=function(z,W){return(z.type===f.END_BLOCK||z.type===f.END_EXPR)&&W&&(z.text==="]"&&W.text==="["||z.text===")"&&W.text==="("||z.text==="}"&&W.text==="{")},A.prototype._reset=function(){L=!1},A.prototype._get_next_token=function(z,W){var G=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(f.EOF,""):(G=G||this._read_non_javascript(U),G=G||this._read_string(U),G=G||this._read_word(z),G=G||this._read_singles(U),G=G||this._read_comment(U),G=G||this._read_regexp(U,z),G=G||this._read_xml(U,z),G=G||this._read_punctuation(),G=G||this._create_token(f.UNKNOWN,this._input.next()),G)},A.prototype._read_word=function(z){var W;if(W=this.__patterns.identifier.read(),W!=="")return W=W.replace(s.allLineBreaks,`
|
|
|
`),!(z.type===f.DOT||z.type===f.RESERVED&&(z.text==="set"||z.text==="get"))&&M.test(W)?(W==="in"||W==="of")&&(z.type===f.WORD||z.type===f.STRING)?this._create_token(f.OPERATOR,W):this._create_token(f.RESERVED,W):this._create_token(f.WORD,W);if(W=this.__patterns.number.read(),W!=="")return this._create_token(f.WORD,W)},A.prototype._read_singles=function(z){var W=null;return z==="("||z==="["?W=this._create_token(f.START_EXPR,z):z===")"||z==="]"?W=this._create_token(f.END_EXPR,z):z==="{"?W=this._create_token(f.START_BLOCK,z):z==="}"?W=this._create_token(f.END_BLOCK,z):z===";"?W=this._create_token(f.SEMICOLON,z):z==="."&&R.test(this._input.peek(1))?W=this._create_token(f.DOT,z):z===","&&(W=this._create_token(f.COMMA,z)),W&&this._input.next(),W},A.prototype._read_punctuation=function(){var z=this.__patterns.punct.read();if(z!=="")return z==="="?this._create_token(f.EQUALS,z):z==="?."?this._create_token(f.DOT,z):this._create_token(f.OPERATOR,z)},A.prototype._read_non_javascript=function(z){var W="";if(z==="#"){if(this._is_first_token()&&(W=this.__patterns.shebang.read(),W))return this._create_token(f.UNKNOWN,W.trim()+`
|
|
|
`);if(W=this.__patterns.include.read(),W)return this._create_token(f.UNKNOWN,W.trim()+`
|
|
|
`);z=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(h)){do z=this._input.next(),G+=z;while(this._input.hasNext()&&z!=="#"&&z!=="=");return z==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(f.WORD,G)}this._input.back()}else if(z==="<"&&this._is_first_token()){if(W=this.__patterns.html_comment_start.read(),W){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)W+=this._input.next();return L=!0,this._create_token(f.COMMENT,W)}}else if(L&&z==="-"&&(W=this.__patterns.html_comment_end.read(),W))return L=!1,this._create_token(f.COMMENT,W);return null},A.prototype._read_comment=function(z){var W=null;if(z==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var U=w.get_directives(G);U&&U.ignore==="start"&&(G+=w.readIgnored(this._input)),G=G.replace(s.allLineBreaks,`
|
|
|
`),W=this._create_token(f.BLOCK_COMMENT,G),W.directives=U}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),W=this._create_token(f.COMMENT,G))}return W},A.prototype._read_string=function(z){if(z==="`"||z==="'"||z==='"'){var W=this._input.next();return this.has_char_escapes=!1,z==="`"?W+=this._read_string_recursive("`",!0,"${"):W+=this._read_string_recursive(z),this.has_char_escapes&&this._options.unescape_strings&&(W=V(W)),this._input.peek()===z&&(W+=this._input.next()),W=W.replace(s.allLineBreaks,`
|
|
|
`),this._create_token(f.STRING,W)}return null},A.prototype._allow_regexp_or_xml=function(z){return z.type===f.RESERVED&&u(z.text,["return","case","throw","else","do","typeof","yield"])||z.type===f.END_EXPR&&z.text===")"&&z.opened.previous.type===f.RESERVED&&u(z.opened.previous.text,["if","while","for"])||u(z.type,[f.COMMENT,f.START_EXPR,f.START_BLOCK,f.START,f.END_BLOCK,f.OPERATOR,f.EQUALS,f.EOF,f.SEMICOLON,f.COMMA])},A.prototype._read_regexp=function(z,W){if(z==="/"&&this._allow_regexp_or_xml(W)){for(var G=this._input.next(),U=!1,P=!1;this._input.hasNext()&&(U||P||this._input.peek()!==z)&&!this._input.testChar(s.newline);)G+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?P=!0:this._input.peek()==="]"&&(P=!1)),this._input.next();return this._input.peek()===z&&(G+=this._input.next(),G+=this._input.read(s.identifier)),this._create_token(f.STRING,G)}return null},A.prototype._read_xml=function(z,W){if(this._options.e4x&&z==="<"&&this._allow_regexp_or_xml(W)){var G="",U=this.__patterns.xml.read_match();if(U){for(var P=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=P.indexOf("{")===0,$=0;U;){var re=!!U[1],te=U[2],ge=!!U[U.length-1]||te.slice(0,8)==="![CDATA[";if(!ge&&(te===P||H&&te.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(re?--$:++$),G+=U[0],$<=0)break;U=this.__patterns.xml.read_match()}return U||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(s.allLineBreaks,`
|
|
|
`),this._create_token(f.STRING,G)}}return null};function V(z){for(var W="",G=0,U=new l(z),P=null;U.hasNext();)if(P=U.match(/([\s]|[^\\]|\\\\)+/g),P&&(W+=P[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")P=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")P=U.match(/u([0-9A-Fa-f]{4})/g);else{W+="\\",U.hasNext()&&(W+=U.next());continue}if(!P)return z;if(G=parseInt(P[1],16),G>126&&G<=255&&P[0].indexOf("x")===0)return z;if(G>=0&&G<32){W+="\\"+P[0];continue}else G===34||G===39||G===92?W+="\\"+String.fromCharCode(G):W+=String.fromCharCode(G)}return W}A.prototype._read_string_recursive=function(z,W,G){var U,P;z==="'"?P=this.__patterns.single_quote:z==='"'?P=this.__patterns.double_quote:z==="`"?P=this.__patterns.template_text:z==="}"&&(P=this.__patterns.template_expression);for(var H=P.read(),$="";this._input.hasNext();){if($=this._input.next(),$===z||!W&&s.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
|
|
|
`&&this._input.next(),$+=this._input.next()):G&&(G==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),G===$&&(z==="`"?$+=this._read_string_recursive("}",W,"`"):$+=this._read_string_recursive("`",W,"${"),this._input.hasNext()&&($+=this._input.next())));$+=P.read(),H+=$}return H},p.exports.Tokenizer=A,p.exports.TOKEN=f,p.exports.positionable_operators=O.slice(),p.exports.line_starters=E.slice()},function(p){var d=RegExp.prototype.hasOwnProperty("sticky");function t(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position<this.__input_length},t.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},t.prototype.peek=function(l){var r=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(r=this.__input.charAt(l)),r},t.prototype.__match=function(l,r){l.lastIndex=r;var i=l.exec(this.__input);return i&&!(d&&l.sticky)&&(i.index!==r&&(i=null)),i},t.prototype.test=function(l,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(l,r):!1},t.prototype.testChar=function(l,r){var i=this.peek(r);return l.lastIndex=0,i!==null&&l.test(i)},t.prototype.match=function(l){var r=this.__match(l,this.__position);return r?this.__position+=r[0].length:r=null,r},t.prototype.read=function(l,r,i){var o="",s;return l&&(s=this.match(l),s&&(o+=s[0])),r&&(s||!l)&&(o+=this.readUntil(r,i)),o},t.prototype.readUntil=function(l,r){var i="",o=this.__position;l.lastIndex=this.__position;var s=l.exec(this.__input);return s?(o=s.index,r&&(o+=s[0].length)):o=this.__input_length,i=this.__input.substring(this.__position,o),this.__position=o,i},t.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},t.prototype.get_regexp=function(l,r){var i=null,o="g";return r&&d&&(o="y"),typeof l=="string"&&l!==""?i=new RegExp(l,o):l&&(i=new RegExp(l.source,o)),i},t.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},t.prototype.peekUntilAfter=function(l){var r=this.__position,i=this.readUntilAfter(l);return this.__position=r,i},t.prototype.lookBack=function(l){var r=this.__position-1;return r>=l.length&&this.__input.substring(r-l.length,r).toLowerCase()===l},p.exports.InputScanner=t},function(p,d,t){var l=t(8).InputScanner,r=t(3).Token,i=t(10).TokenStream,o=t(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(a,u){this._input=new l(a),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new i,this._reset();for(var a,u=new r(s.START,""),f=null,w=[],_=new i;u.type!==s.EOF;){for(a=this._get_next_token(u,f);this._is_comment(a);)_.add(a),a=this._get_next_token(u,f);_.isEmpty()||(a.comments_before=_,_=new i),a.parent=f,this._is_opening(a)?(w.push(f),f=a):f&&this._is_closing(a,f)&&(a.opened=f,f.closed=a,f=w.pop(),a.parent=f),a.previous=u,u.next=a,this.__tokens.add(a),u=a}return this.__tokens},c.prototype._is_first_token=function(){return this.__tokens.isEmpty()},c.prototype._reset=function(){},c.prototype._get_next_token=function(a,u){this._readWhitespace();var f=this._input.read(/.+/g);return f?this._create_token(s.RAW,f):this._create_token(s.EOF,"")},c.prototype._is_comment=function(a){return!1},c.prototype._is_opening=function(a){return!1},c.prototype._is_closing=function(a,u){return!1},c.prototype._create_token=function(a,u){var f=new r(a,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return f},c.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},p.exports.Tokenizer=c,p.exports.TOKEN=s},function(p){function d(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position<this.__tokens_length},d.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},d.prototype.peek=function(t){var l=null;return t=t||0,t+=this.__position,t>=0&&t<this.__tokens_length&&(l=this.__tokens[t]),l},d.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},p.exports.TokenStream=d},function(p,d,t){var l=t(12).Pattern;function r(i,o){l.call(this,i,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new l,r.prototype.__set_whitespace_patterns=function(i,o){i+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+i+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var i=this._input.read(this._match_pattern);if(i===" ")this.whitespace_before_token=" ";else if(i){var o=this.__split(this._newline_regexp,i);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return i},r.prototype.matching=function(i,o){var s=this._create();return s.__set_whitespace_patterns(i,o),s._update(),s},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(i,o){i.lastIndex=0;for(var s=0,c=[],a=i.exec(o);a;)c.push(o.substring(s,a.index)),s=a.index+a[0].length,a=i.exec(o);return s<o.length?c.push(o.substring(s,o.length)):c.push(""),c},p.exports.WhitespacePattern=r},function(p){function d(t,l){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,l&&(this._starting_pattern=this._input.get_regexp(l._starting_pattern,!0),this._match_pattern=this._input.get_regexp(l._match_pattern,!0),this._until_pattern=this._input.get_regexp(l._until_pattern),this._until_after=l._until_after)}d.prototype.read=function(){var t=this._input.read(this._starting_pattern);return(!this._starting_pattern||t)&&(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(t){var l=this._create();return l._until_after=!0,l._until_pattern=this._input.get_regexp(t),l._update(),l},d.prototype.until=function(t){var l=this._create();return l._until_after=!1,l._until_pattern=this._input.get_regexp(t),l._update(),l},d.prototype.starting_with=function(t){var l=this._create();return l._starting_pattern=this._input.get_regexp(t,!0),l._update(),l},d.prototype.matching=function(t){var l=this._create();return l._match_pattern=this._input.get_regexp(t,!0),l._update(),l},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},p.exports.Pattern=d},function(p){function d(t,l){t=typeof t=="string"?t:t.source,l=typeof l=="string"?l:l.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+l,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+l,"g")}d.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var l={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(t);r;)l[r[1]]=r[2],r=this.__directive_pattern.exec(t);return l},d.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},p.exports.Directives=d},function(p,d,t){var l=t(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function i(o,s){l.call(this,o,s),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var c=new l(o);this.__patterns={handlebars_comment:c.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:c.starting_with(/{{{/).until_after(/}}}/),handlebars:c.starting_with(/{{/).until_after(/}}/),php:c.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:c.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:c.starting_with(/{%/).until_after(/%}/),django_value:c.starting_with(/{{/).until_after(/}}/),django_comment:c.starting_with(/{#/).until_after(/#}/),smarty:c.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:c.starting_with(/{\*/).until_after(/\*}/),smarty_literal:c.starting_with(/{literal}/).until_after(/{\/literal}/)}}i.prototype=new l,i.prototype._create=function(){return new i(this._input,this)},i.prototype._update=function(){this.__set_templated_pattern()},i.prototype.disable=function(o){var s=this._create();return s._disabled[o]=!0,s._update(),s},i.prototype.read_options=function(o){var s=this._create();for(var c in r)s._disabled[c]=o.templating.indexOf(c)===-1;return s._update(),s},i.prototype.exclude=function(o){var s=this._create();return s._excluded[o]=!0,s._update(),s},i.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),o+=s,s=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},i.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},i.prototype._read_template=function(){var o="",s=this._input.peek();if(s==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(o=o||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},p.exports.TemplatablePattern=i}],m={};function S(p){var d=m[p];if(d!==void 0)return d.exports;var t=m[p]={exports:{}};return y[p](t,t.exports,S),t.exports}var b=S(0);C=b})();var k=C;!(N=[],v=function(){return{js_beautify:k}}.apply(Q,N),v!==void 0&&(F.exports=v))})()},"6eGT":function(F,Q,j){"use strict";function N(v){return null}Q.a=N},"7Cbv":function(F,Q,j){"use strict";var N=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),v=new Uint8Array(16);function C(){if(!N)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return N(v)}var k=/^(?:[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 y(r){return typeof r=="string"&&k.test(r)}for(var m=y,S=[],b=0;b<256;++b)S.push((b+256).toString(16).substr(1));function p(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(S[r[i+0]]+S[r[i+1]]+S[r[i+2]]+S[r[i+3]]+"-"+S[r[i+4]]+S[r[i+5]]+"-"+S[r[i+6]]+S[r[i+7]]+"-"+S[r[i+8]]+S[r[i+9]]+"-"+S[r[i+10]]+S[r[i+11]]+S[r[i+12]]+S[r[i+13]]+S[r[i+14]]+S[r[i+15]]).toLowerCase();if(!m(o))throw TypeError("Stringified UUID is invalid");return o}var d=p;function t(r,i,o){r=r||{};var s=r.random||(r.rng||C)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,i){o=o||0;for(var c=0;c<16;++c)i[o+c]=s[c];return i}return d(s)}var l=Q.a=t},"7ahc":function(F,Q,j){"use strict";j.d(Q,"a",function(){return w});var N=j("k1fw"),v=j("0Owb"),C=j("+L6B"),k=j("2/Rp"),y=j("y8nQ"),m=j("Vl3Y"),S=j("tJVT"),b=j("OaEy"),p=j("2fM7"),d=j("cDcd"),t=j.n(d),l=j("VrN/"),r=j.n(l),i=j("p77/"),o=j.n(i),s=j("c5Ni"),c=j.n(s),a=p.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},f={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Q.b=function(_){var h=_.callback,R=_.onCancel,O=Object(d.useState)("python"),g=Object(S.a)(O,2),x=g[0],E=g[1];function T(L){E(f[L][1])}function M(L){h(L)}return t.a.createElement(m.a,Object(v.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:M}),t.a.createElement(m.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},t.a.createElement(p.a,{onChange:T},Object.keys(f).map(function(L){return t.a.createElement(a,{key:L,value:L},f[L][0])}))),t.a.createElement(m.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},t.a.createElement(w,{mode:x})),t.a.createElement("div",{className:"flex-container flex-end"},t.a.createElement(k.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),t.a.createElement(k.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function w(_){var h=_.value,R=_.onChange,O=_.mode,g=_.options,x=g===void 0?{}:g,E=Object(d.useRef)(),T=Object(d.useState)(),M=Object(S.a)(T,2),L=M[0],A=M[1];return Object(d.useEffect)(function(){if(L){function V(z){var W=z.getValue();R&&R(W)}return L.on("change",V),function(){L.off("change",V)}}},[L,R]),Object(d.useEffect)(function(){L&&L.setOption("mode",O)},[L,O]),Object(d.useEffect)(function(){L&&((h!==L.getValue()||h==="")&&setTimeout(function(){L.setValue(h||" ")},300))},[L,h]),Object(d.useEffect)(function(){if(E.current&&!L){var V=r.a.fromTextArea(E.current,Object(N.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},x));A(V)}},[E.current,L]),t.a.createElement("div",{className:"my-codemirror-container"},t.a.createElement("textarea",{ref:E}))}},"815F":function(F,Q,j){"use strict";j.d(Q,"e",function(){return S}),j.d(Q,"c",function(){return p}),j.d(Q,"d",function(){return d}),j.d(Q,"a",function(){return l}),j.d(Q,"f",function(){return r}),j.d(Q,"b",function(){return i});var N=j("KQm4"),v=j("VTBJ"),C=j("Ff2n"),k=j("Zm9Q"),y=j("Kwbf"),m=j("OZM5");function S(o,s){return o!=null?o:s}function b(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function c(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(f){var w=f.key,_=f.children;Object(y.a)(w!=null,"Tree node must have a certain key: [".concat(u).concat(w,"]"));var h=String(w);Object(y.a)(!s.has(h)||w===null||w===void 0,"Same 'key' exist in the Tree: ".concat(h)),s.set(h,!0),c(_,"".concat(u).concat(h," > "))})}c(o)}function p(o){function s(c){var a=Object(k.a)(c);return a.map(function(u){if(!Object(m.i)(u))return Object(y.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var f=u.key,w=u.props,_=w.children,h=Object(C.a)(w,["children"]),R=Object(v.a)({key:f},h),O=s(_);return O.length&&(R.children=O),R}).filter(function(u){return u})}return s(o)}function d(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=new Set(s===!0?[]:s),a=[];function u(f){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return f.map(function(_,h){var R=Object(m.h)(w?w.pos:"0",h),O=S(_.key,R),g=Object(v.a)(Object(v.a)({},_),{},{parent:w,pos:R,children:null,data:_,isStart:[].concat(Object(N.a)(w?w.isStart:[]),[h===0]),isEnd:[].concat(Object(N.a)(w?w.isEnd:[]),[h===f.length-1])});return a.push(g),s===!0||c.has(O)?g.children=u(_.children||[],g):g.children=[],g})}return u(o),a}function t(o,s,c){var a;c?typeof c=="string"?a=function(w){return w[c]}:typeof c=="function"&&(a=function(w){return c(w)}):a=function(w,_){return S(w.key,_)};function u(f,w,_){var h=f?f.children:o,R=f?Object(m.h)(_.pos,w):"0";if(f){var O=a(f,R),g={node:f,index:w,pos:R,key:O,parentPos:_.node?_.pos:null,level:_.level+1};s(g)}h&&h.forEach(function(x,E){u(x,E,{node:f,pos:R,level:_?_.level+1:-1})})}u(null)}function l(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=s.initWrapper,a=s.processEntity,u=s.onProcessFinished,f=arguments.length>2?arguments[2]:void 0,w={},_={},h={posEntities:w,keyEntities:_};return c&&(h=c(h)||h),t(o,function(R){var O=R.node,g=R.index,x=R.pos,E=R.key,T=R.parentPos,M=R.level,L={node:O,index:g,key:E,pos:x,level:M},A=S(E,x);w[x]=L,_[A]=L,L.parent=w[T],L.parent&&(L.parent.children=L.parent.children||[],L.parent.children.push(L)),a&&a(L,h)},f),u&&u(h),h}function r(o,s){var c=s.expandedKeys,a=s.selectedKeys,u=s.loadedKeys,f=s.loadingKeys,w=s.checkedKeys,_=s.halfCheckedKeys,h=s.dragOverNodeKey,R=s.dropPosition,O=s.keyEntities,g=O[o],x={eventKey:o,expanded:c.indexOf(o)!==-1,selected:a.indexOf(o)!==-1,loaded:u.indexOf(o)!==-1,loading:f.indexOf(o)!==-1,checked:w.indexOf(o)!==-1,halfChecked:_.indexOf(o)!==-1,pos:String(g?g.pos:""),dragOver:h===o&&R===0,dragOverGapTop:h===o&&R===-1,dragOverGapBottom:h===o&&R===1};return x}function i(o){var s=o.data,c=o.expanded,a=o.selected,u=o.checked,f=o.loaded,w=o.loading,_=o.halfChecked,h=o.dragOver,R=o.dragOverGapTop,O=o.dragOverGapBottom,g=o.pos,x=o.active,E=Object(v.a)(Object(v.a)({},s),{},{expanded:c,selected:a,checked:u,loaded:f,loading:w,halfChecked:_,dragOver:h,dragOverGapTop:R,dragOverGapBottom:O,pos:g,active:x});return"props"in E||Object.defineProperty(E,"props",{get:function(){return Object(y.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),E}},"8EBN":function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){"use strict";N.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 v=0;v<N.modeInfo.length;v++){var C=N.modeInfo[v];C.mimes&&(C.mime=C.mimes[0])}N.findModeByMIME=function(k){k=k.toLowerCase();for(var y=0;y<N.modeInfo.length;y++){var m=N.modeInfo[y];if(m.mime==k)return m;if(m.mimes){for(var S=0;S<m.mimes.length;S++)if(m.mimes[S]==k)return m}}if(/\+xml$/.test(k))return N.findModeByMIME("application/xml");if(/\+json$/.test(k))return N.findModeByMIME("application/json")},N.findModeByExtension=function(k){k=k.toLowerCase();for(var y=0;y<N.modeInfo.length;y++){var m=N.modeInfo[y];if(m.ext){for(var S=0;S<m.ext.length;S++)if(m.ext[S]==k)return m}}},N.findModeByFileName=function(k){for(var y=0;y<N.modeInfo.length;y++){var m=N.modeInfo[y];if(m.file&&m.file.test(k))return m}var S=k.lastIndexOf("."),b=S>-1&&k.substring(S+1,k.length);if(b)return N.findModeByExtension(b)},N.findModeByName=function(k){k=k.toLowerCase();for(var y=0;y<N.modeInfo.length;y++){var m=N.modeInfo[y];if(m.name.toLowerCase()==k)return m;if(m.alias){for(var S=0;S<m.alias.length;S++)if(m.alias[S].toLowerCase()==k)return m}}}})},"8hTe":function(F,Q,j){F.exports={button:"button___1wy9m"}},"9Bee":function(F,Q,j){"use strict";var N=j("DYRE"),v=j("zeV3"),C=j("+L6B"),k=j("2/Rp"),y=j("k1fw"),m=j("9og8"),S=j("tJVT"),b=j("WmNS"),p=j.n(b),d=j("cDcd"),t=j.n(d),l=j("vg9a"),r=j("DlQD"),i=j.n(r),o=j("rUJ1");function s(le,K){var X=le.match(/^(\s+)(?:```)/);if(X===null)return K;var ee=X[1];return K.split(`
|
|
|
`).map(function(me){var ae=me.match(/^\s+/);if(ae===null)return me;var Ke=Object(S.a)(ae,1),pt=Ke[0];return pt.length>=ee.length?me.slice(ee.length):me}).join(`
|
|
|
`)}var c=[],a=["<ul>"],u=new i.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){c.length=0,a=["<ul>"]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function h(le,K,X,ee){if(K>=le.length||le[K].level<=X)return K;var me=le[K];ee.push("<li><a href='#"+me.anchor+"'>"+me.text+"</a>"),K++;var ae=[];return K=h(le,K,me.level,ae),ae.length>0&&(ee.push("<ul>"),ae.forEach(function(Ke){ee.push(Ke)}),ee.push("</ul>")),ee.push("</li>"),K=h(le,K,X,ee),K}function R(){return h(c,0,0,a),a.push("</ul>"),a.join("")}var O={heading:function(K){var X=f.exec(K);if(X)return{type:"heading",raw:X[0],depth:X[1].length,text:X[2]}},fences:function(K){var X=this.rules.block.fences.exec(K);if(X){var ee=X[0],me=s(ee,X[3]||""),ae=X[2]?X[2].trim():X[2];if(["latex","katex","math"].indexOf(ae)>=0){var Ke=E(),pt=me;me=Ke,T[Ke]={type:"block",expression:pt}}return{type:"code",raw:ee,lang:ae,text:me}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,E=function(){return"__special_katext_id_".concat(x++,"__")},T={};function M(){return T}function L(){x=0,T={}}function A(le){return le=le.replace(g,function(K,X){var ee=E();return T[ee]={type:"inline",expression:X},ee}),le}var V=u.listitem;u.listitem=function(le){return V(A(le))};var z=u.paragraph;u.paragraph=function(le){return z(A(le))};var W=u.tablecell;u.tablecell=function(le,K){return W(A(le),K)},u.code=function(le,K,X){var ee=(K||"").match(/\S*/)[0];return ee?["latex","katex","math"].indexOf(ee)>=0?"<p class='editormd-tex'>".concat(le,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(K,'">').concat(X?le:Object(o.escape)(le,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(X?le:Object(o.escape)(le,!0))+"</code></pre>"},u.heading=function(le,K,X){var ee=this.options.headerPrefix+X.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:ee,level:K,text:le}),"<h"+K+' id="'+ee+'">'+le+"</h"+K+">"},i.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),i.a.use({tokenizer:O,renderer:u});var G=i.a,U=j("SJMd"),P=j("ulZh"),H=j.n(P),$=j("m3rI"),re=j("Oy/b"),te=j("p5ED"),ge=j("ErOA");/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var ve=function(le,K){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ee){X.__proto__=ee}||function(X,ee){for(var me in ee)Object.prototype.hasOwnProperty.call(ee,me)&&(X[me]=ee[me])})(le,K)};function de(le,K){function X(){this.constructor=le}ve(le,K),le.prototype=K===null?Object.create(K):(X.prototype=K.prototype,new X)}function De(le,K,X,ee){return new(X||(X=Promise))(function(me,ae){function Ke(Ht){try{Ot(ee.next(Ht))}catch(vt){ae(vt)}}function pt(Ht){try{Ot(ee.throw(Ht))}catch(vt){ae(vt)}}function Ot(Ht){var vt;Ht.done?me(Ht.value):(vt=Ht.value,vt instanceof X?vt:new X(function(Xt){Xt(vt)})).then(Ke,pt)}Ot((ee=ee.apply(le,K||[])).next())})}function Te(le,K){var X,ee,me,ae,Ke={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return ae={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(ae[Symbol.iterator]=function(){return this}),ae;function pt(Ot){return function(Ht){return function(vt){if(X)throw new TypeError("Generator is already executing.");for(;Ke;)try{if(X=1,ee&&(me=2&vt[0]?ee.return:vt[0]?ee.throw||((me=ee.return)&&me.call(ee),0):ee.next)&&!(me=me.call(ee,vt[1])).done)return me;switch(ee=0,me&&(vt=[2&vt[0],me.value]),vt[0]){case 0:case 1:me=vt;break;case 4:return Ke.label++,{value:vt[1],done:!1};case 5:Ke.label++,ee=vt[1],vt=[0];continue;case 7:vt=Ke.ops.pop(),Ke.trys.pop();continue;default:if(!(me=Ke.trys,(me=me.length>0&&me[me.length-1])||vt[0]!==6&&vt[0]!==2)){Ke=0;continue}if(vt[0]===3&&(!me||vt[1]>me[0]&&vt[1]<me[3])){Ke.label=vt[1];break}if(vt[0]===6&&Ke.label<me[1]){Ke.label=me[1],me=vt;break}if(me&&Ke.label<me[2]){Ke.label=me[2],Ke.ops.push(vt);break}me[2]&&Ke.ops.pop(),Ke.trys.pop();continue}vt=K.call(le,Ke)}catch(Xt){vt=[6,Xt],ee=0}finally{X=me=0}if(5&vt[0])throw vt[1];return{value:vt[0]?vt[1]:void 0,done:!0}}([Ot,Ht])}}}function he(){for(var le=0,K=0,X=arguments.length;K<X;K++)le+=arguments[K].length;var ee=Array(le),me=0;for(K=0;K<X;K++)for(var ae=arguments[K],Ke=0,pt=ae.length;Ke<pt;Ke++,me++)ee[me]=ae[Ke];return ee}var ue=function(){function le(){}return le.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},le.setAttributes=function(K,X){for(var ee=0,me=X;ee<me.length;ee++){var ae=me[ee],Ke=ae[0],pt=ae[1];K.setAttribute(Ke,pt)}},le.createRect=function(K,X,ee){var me=document.createElementNS("http://www.w3.org/2000/svg","rect");return me.setAttribute("width",K.toString()),me.setAttribute("height",X.toString()),ee&&le.setAttributes(me,ee),me},le.createLine=function(K,X,ee,me,ae){var Ke=document.createElementNS("http://www.w3.org/2000/svg","line");return Ke.setAttribute("x1",K.toString()),Ke.setAttribute("y1",X.toString()),Ke.setAttribute("x2",ee.toString()),Ke.setAttribute("y2",me.toString()),ae&&le.setAttributes(Ke,ae),Ke},le.createPolygon=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ee.setAttribute("points",K),X&&le.setAttributes(ee,X),ee},le.createCircle=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","circle");return ee.setAttribute("cx",(K/2).toString()),ee.setAttribute("cy",(K/2).toString()),ee.setAttribute("r",K.toString()),X&&le.setAttributes(ee,X),ee},le.createEllipse=function(K,X,ee){var me=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return me.setAttribute("cx",(K/2).toString()),me.setAttribute("cy",(X/2).toString()),me.setAttribute("rx",(K/2).toString()),me.setAttribute("ry",(X/2).toString()),ee&&le.setAttributes(me,ee),me},le.createGroup=function(K){var X=document.createElementNS("http://www.w3.org/2000/svg","g");return K&&le.setAttributes(X,K),X},le.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},le.createMarker=function(K,X,ee,me,ae,Ke,pt){var Ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return le.setAttributes(Ot,[["id",K],["orient",X],["markerWidth",ee.toString()],["markerHeight",me.toString()],["refX",ae.toString()],["refY",Ke.toString()]]),Ot.appendChild(pt),Ot},le.createText=function(K){var X=document.createElementNS("http://www.w3.org/2000/svg","text");return X.setAttribute("x","0"),X.setAttribute("y","0"),K&&le.setAttributes(X,K),X},le.createTSpan=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ee.textContent=K,X&&le.setAttributes(ee,X),ee},le.createImage=function(K){var X=document.createElementNS("http://www.w3.org/2000/svg","image");return K&&le.setAttributes(X,K),X},le.createPoint=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ee.x=K,ee.y=X,ee},le.createPath=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","path");return ee.setAttribute("d",K),X&&le.setAttributes(ee,X),ee},le}(),ie=function(){function le(){}return le.addKey=function(K){le.key=K},Object.defineProperty(le,"isLicensed",{get:function(){return!!le.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(le.key)},enumerable:!1,configurable:!0}),le}(),Se=function(){function le(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return le.prototype.rasterize=function(K,X,ee){var me=this;return new Promise(function(ae){var Ke=ee!==void 0?ee:document.createElement("canvas");K===null&&(me.markersOnly=!0,me.naturalSize=!1);var pt=document.createElementNS("http://www.w3.org/2000/svg","svg");pt.setAttribute("xmlns","http://www.w3.org/2000/svg"),pt.setAttribute("width",X.width.baseVal.valueAsString),pt.setAttribute("height",X.height.baseVal.valueAsString),pt.setAttribute("viewBox","0 0 "+X.viewBox.baseVal.width.toString()+" "+X.viewBox.baseVal.height.toString()),pt.innerHTML=X.innerHTML,me.naturalSize===!0?(pt.width.baseVal.value=K.naturalWidth,pt.height.baseVal.value=K.naturalHeight):me.width!==void 0&&me.height!==void 0&&(pt.width.baseVal.value=me.width,pt.height.baseVal.value=me.height),Ke.width=pt.width.baseVal.value,Ke.height=pt.height.baseVal.value;var Ot=pt.outerHTML,Ht=Ke.getContext("2d");me.markersOnly!==!0&&Ht.drawImage(K,0,0,Ke.width,Ke.height);var vt=window.URL,Xt=new Image(Ke.width,Ke.height);Xt.setAttribute("crossOrigin","anonymous");var qt=new Blob([Ot],{type:"image/svg+xml"}),Hr=vt.createObjectURL(qt);Xt.onload=function(){Ht.drawImage(Xt,0,0),vt.revokeObjectURL(Hr);var nn=Ke.toDataURL(me.imageType,me.imageQuality);ae(nn)},Xt.src=Hr})},le}(),ne=function(){},ce=function(){function le(K){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+K+"_"}return Object.defineProperty(le.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(le.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(le.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),le.prototype.addClass=function(K){return this.styleSheet===void 0&&this.addStyleSheet(),K.name=""+this.classNamePrefix+K.localName,this.classes.push(K),this.styleSheet.sheet.insertRule("."+K.name+" {"+K.style+"}",this.styleSheet.sheet.cssRules.length),K},le.prototype.addRule=function(K){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(K),this.styleSheet.sheet.insertRule(K.selector+" {"+K.style+"}",this.styleSheet.sheet.cssRules.length)},le.prototype.addStyleSheet=function(){var K;this.styleSheet=document.createElement("style"),((K=this.styleSheetRoot)!==null&&K!==void 0?K:document.head).appendChild(this.styleSheet),this.addRule(new Oe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Oe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Oe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new oe("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new oe("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},le.prototype.removeStyleSheet=function(){var K;this.styleSheet&&(((K=this.styleSheetRoot)!==null&&K!==void 0?K:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},le}(),Oe=function(le,K){this.selector=le,this.style=K},oe=function(le,K){this.localName=le,this.style=K},q=function(){function le(K,X,ee,me,ae){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=K,this.displayMode=X,this.markerItems=ee,this.uiStyleSettings=me,this.styles=ae,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return le.prototype.show=function(K){var X=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=K,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<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(ee,'<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(ee,'<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(ee,'<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(ee,'<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(ee,'<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(ee,'<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(ee,'<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(ae){var Ke=document.createElement("div");Ke.className=""+X.toolbarButtonStyleClass.name,Ke.setAttribute("data-type-name",ae.typeName),Ke.innerHTML=ae.icon,Ke.addEventListener("click",function(){X.markerToolbarButtonClicked(Ke,ae)}),X.buttons.push(Ke),X.markerButtons.push(Ke)}),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 me=document.createElement("div");me.className=this.toolbarBlockStyleClass.name,me.style.whiteSpace="nowrap",me.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(me),this.addActionButton(me,'<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(me,'<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()},le.prototype.addButtonClickListener=function(K){this.buttonClickListeners.push(K)},le.prototype.removeButtonClickListener=function(K){this.buttonClickListeners.indexOf(K)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(K),1)},le.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},le.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var K=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var X=0;X<this.markerButtons.length;X++)X<K||X===K&&this.markerButtons.length-1===K?this.markerButtonBlock.appendChild(this.markerButtons[X]):(X===K&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[X]))}},le.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")},le.prototype.resetButtonStyles=function(){var K=this;this.buttons.forEach(function(X){X.className=X.className.replace(K.uiStyleSettings.toolbarButtonStyleColorsClassName?K.uiStyleSettings.toolbarButtonStyleColorsClassName:K.toolbarButtonStyleColorsClass.name,"").trim(),X.className=X.className.replace(K.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?K.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:K.toolbarActiveButtonStyleColorsClass.name,"").trim(),X.className+=" "+(K.uiStyleSettings.toolbarButtonStyleColorsClassName?K.uiStyleSettings.toolbarButtonStyleColorsClassName:K.toolbarButtonStyleColorsClass.name)})},le.prototype.addActionButton=function(K,X,ee){var me=this,ae=document.createElement("div");switch(ae.className=""+this.toolbarButtonStyleClass.name,ae.innerHTML=X,ae.setAttribute("data-action",ee),ae.addEventListener("click",function(){me.actionToolbarButtonClicked(ae,ee)}),ee){case"select":ae.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":ae.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":ae.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":ae.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":ae.style.fill=this.uiStyleSettings.closeButtonColor}K.appendChild(ae),this.buttons.push(ae)},le.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new oe("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 oe("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new oe("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new oe("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 oe("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var K=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new oe("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*K)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*K)+`px;
|
|
|
padding: `+K+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},le.prototype.markerToolbarButtonClicked=function(K,X){this.setActiveButton(K),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("marker",X)}),this.markerButtonOverflowBlock.style.display="none"},le.prototype.actionToolbarButtonClicked=function(K,X){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("action",X)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},le.prototype.setActiveButton=function(K){this.resetButtonStyles(),K.className=K.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),K.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},le.prototype.setActiveMarkerButton=function(K){var X=this.markerButtons.find(function(ee){return ee.getAttribute("data-type-name")===K});X&&this.setActiveButton(X)},le.prototype.setCurrentMarker=function(K){var X=this;this.currentMarker=K,this.buttons.filter(function(ee){return/delete|notes/.test(ee.getAttribute("data-action"))}).forEach(function(ee){X.currentMarker===void 0?(ee.style.fillOpacity="0.4",ee.style.pointerEvents="none"):(ee.style.fillOpacity="1",ee.style.pointerEvents="all")})},le}(),Y=function(){function le(K,X,ee,me){this.panels=[],this.panelButtons=[],this.markerjsContainer=K,this.displayMode=X,this.uiStyleSettings=ee,this.styles=me,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return le.prototype.addStyles=function(){var K;this.toolboxStyleClass=this.styles.addClass(new oe("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 oe("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var X=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new oe("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new oe("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new oe("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 oe("toolbox-panel-row_colors",`
|
|
|
background-color: `+((K=this.uiStyleSettings.toolboxBackgroundColor)!==null&&K!==void 0?K:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new oe("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px;
|
|
|
padding: `+X+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},le.prototype.show=function(K){var X;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=K,this.uiContainer.className=this.toolboxStyleClass.name+" "+((X=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},le.prototype.setPanelButtons=function(K){var X,ee,me=this;this.panels=K,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ee=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ee!==void 0?ee:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(ae){var Ke;ae.uiStyleSettings=me.uiStyleSettings;var pt=document.createElement("div");pt.className=me.toolboxButtonStyleClass.name+" "+((Ke=me.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:me.toolboxButtonStyleColorsClass.name),pt.innerHTML=ae.icon,pt.title=ae.title,pt.addEventListener("click",function(){me.panelButtonClick(ae)}),me.panelButtons.push(pt),me.buttonRow.appendChild(pt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},le.prototype.panelButtonClick=function(K){var X=this,ee=-1;if(K!==this.activePanel){ee=this.panels.indexOf(K),this.panelRow.innerHTML="";var me=K.getUi();me.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(me),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=K}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){X.displayMode==="inline"?X.panelRow.style.display="none":X.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(ae,Ke){var pt,Ot;ae.className=X.toolboxButtonStyleClass.name+" "+(Ke===ee?""+((pt=X.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&pt!==void 0?pt:X.toolboxActiveButtonStyleColorsClass.name):""+((Ot=X.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ot!==void 0?Ot:X.toolboxButtonStyleColorsClass.name))})},le}(),Z=function(le,K){this.title=le,this.icon=K},ye=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'<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 Ke.colors=[],Ke.addTransparent=!1,Ke.colorBoxes=[],Ke.colors=ee,Ke.currentColor=me,Ke.setCurrentColor=Ke.setCurrentColor.bind(Ke),Ke.getColorBox=Ke.getColorBox.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.whiteSpace="nowrap",this.colors.forEach(function(me){var ae=X.getColorBox(me);ee.appendChild(ae),X.colorBoxes.push(ae)}),ee},K.prototype.getColorBox=function(X){var ee=this,me=this.uiStyleSettings.toolbarHeight/4,ae=this.uiStyleSettings.toolbarHeight-me,Ke=document.createElement("div");Ke.style.display="inline-block",Ke.style.boxSizing="content-box",Ke.style.width=ae-2+"px",Ke.style.height=ae-2+"px",Ke.style.padding="1px",Ke.style.marginRight="2px",Ke.style.marginBottom="2px",Ke.style.borderWidth="2px",Ke.style.borderStyle="solid",Ke.style.borderRadius=(ae+2)/2+"px",Ke.style.borderColor=X===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ke.addEventListener("click",function(){ee.setCurrentColor(X,Ke)});var pt=document.createElement("div");return pt.style.display="inline-block",pt.style.width=ae-2+"px",pt.style.height=ae-2+"px",pt.style.backgroundColor=X,pt.style.borderRadius=ae/2+"px",X==="transparent"&&(pt.style.fill=this.uiStyleSettings.toolboxAccentColor,pt.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>`),Ke.appendChild(pt),Ke},K.prototype.setCurrentColor=function(X,ee){var me=this;this.currentColor=X,this.colorBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(X)},K}(Z),be=function(){function le(K,X,ee){this._state="new",this._isSelected=!1,this._container=K,this._overlayContainer=X,this.globalSettings=ee,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(le.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),le.prototype.ownsTarget=function(K){return!1},Object.defineProperty(le.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),le.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},le.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},le.prototype.pointerDown=function(K,X){},le.prototype.dblClick=function(K,X){},le.prototype.manipulate=function(K){},le.prototype.pointerUp=function(K){this.stateChanged()},le.prototype.dispose=function(){},le.prototype.addMarkerVisualToContainer=function(K){this.container.childNodes.length>0?this.container.insertBefore(K,this.container.childNodes[0]):this.container.appendChild(K)},le.prototype.getState=function(){return{typeName:le.typeName,state:this.state,notes:this.notes}},le.prototype.restoreState=function(K){this._state=K.state,this.notes=K.notes},le.prototype.scale=function(K,X){},le.prototype.colorChanged=function(K){this.onColorChanged&&this.onColorChanged(K),this.stateChanged()},le.prototype.fillColorChanged=function(K){this.onFillColorChanged&&this.onFillColorChanged(K),this.stateChanged()},le.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var K=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),K.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(K)&&this.onStateChanged(this)}},le.typeName="MarkerBase",le}(),Re=function(){function le(){this.findGripByVisual=this.findGripByVisual.bind(this)}return le.prototype.findGripByVisual=function(K){return this.topLeft.ownsTarget(K)?this.topLeft:this.topCenter.ownsTarget(K)?this.topCenter:this.topRight.ownsTarget(K)?this.topRight:this.centerLeft.ownsTarget(K)?this.centerLeft:this.centerRight.ownsTarget(K)?this.centerRight:this.bottomLeft.ownsTarget(K)?this.bottomLeft:this.bottomCenter.ownsTarget(K)?this.bottomCenter:this.bottomRight.ownsTarget(K)?this.bottomRight:void 0},le}(),Qe=function(){function le(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return le.prototype.ownsTarget=function(K){return K===this.visual||K===this.visual.childNodes[0]||K===this.visual.childNodes[1]},le}(),rt=function(){function le(){}return le.toITransformMatrix=function(K){return{a:K.a,b:K.b,c:K.c,d:K.d,e:K.e,f:K.f}},le.toSVGMatrix=function(K,X){return K.a=X.a,K.b=X.b,K.c=X.c,K.d=X.d,K.e=X.e,K.f=X.f,K},le}(),at=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.left=0,ae.top=0,ae.width=0,ae.height=0,ae.defaultSize={x:50,y:20},ae.offsetX=0,ae.offsetY=0,ae.rotationAngle=0,ae.CB_DISTANCE=10,ae._suppressMarkerCreateEvent=!1,ae.container.transform.baseVal.appendItem(ue.createTransform()),ae.setupControlBox(),ae}return de(K,le),Object.defineProperty(K.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"visual",{get:function(){return this._visual},set:function(X){this._visual=X;var ee=ue.createTransform();this._visual.transform.baseVal.appendItem(ee)},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(X){return!!le.prototype.ownsTarget.call(this,X)||!!(this.controlGrips.findGripByVisual(X)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X))},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="new"&&(this.left=X.x,this.top=X.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var me=this.unrotatePoint(X);if(this.manipulationStartX=me.x,this.manipulationStartY=me.y,this.offsetX=me.x-this.left,this.offsetY=me.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ee),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ee)){this.activeGrip=this.rotatorGrip;var ae=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=ae.x-this.width/2,this.top=ae.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ke=this.container.transform.baseVal.getItem(0);Ke.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ke,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},K.prototype.pointerUp=function(X){var ee=this.state;le.prototype.pointerUp.call(this,X),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(X),this._state="select",ee==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},K.prototype.moveVisual=function(X){this.visual.style.transform="translate("+X.x+"px, "+X.y+"px)"},K.prototype.manipulate=function(X){var ee=this.unrotatePoint(X);this.state==="creating"?this.resize(X):this.state==="move"?(this.left=this.manipulationStartLeft+(ee.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ee.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ee):this.state==="rotate"&&this.rotate(X)},K.prototype.resize=function(X){var ee=this.manipulationStartLeft,me=this.manipulationStartWidth,ae=this.manipulationStartTop,Ke=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ee=this.manipulationStartLeft+X.x-this.manipulationStartX,me=this.manipulationStartWidth+this.manipulationStartLeft-ee;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:me=this.manipulationStartWidth+X.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:ae=this.manipulationStartTop+X.y-this.manipulationStartY,Ke=this.manipulationStartHeight+this.manipulationStartTop-ae;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ke=this.manipulationStartHeight+X.y-this.manipulationStartY}me>=0?(this.left=ee,this.width=me):(this.left=ee+me,this.width=-me),Ke>=0?(this.top=ae,this.height=Ke):(this.top=ae+Ke,this.height=-Ke),this.setSize()},K.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},K.prototype.rotate=function(X){if(Math.abs(X.x-this.centerX)>.1){var ee=Math.sign(X.x-this.centerX);this.rotationAngle=180*Math.atan((X.y-this.centerY)/(X.x-this.centerX))/Math.PI+90*ee,this.applyRotation()}},K.prototype.applyRotation=function(){var X=this.container.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(X,0)},K.prototype.rotatePoint=function(X){if(this.rotationAngle===0)return X;var ee=this.container.getCTM(),me=ue.createPoint(X.x,X.y);return{x:(me=me.matrixTransform(ee)).x,y:me.y}},K.prototype.unrotatePoint=function(X){if(this.rotationAngle===0)return X;var ee=this.container.getCTM();ee=ee.inverse();var me=ue.createPoint(X.x,X.y);return{x:(me=me.matrixTransform(ee)).x,y:me.y}},K.prototype.select=function(){le.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},K.prototype.deselect=function(){le.prototype.deselect.call(this),this.controlBox.style.display="none"},K.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var X=ue.createTransform();X.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(X),this.container.appendChild(this.controlBox),this.controlRect=ue.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=ue.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 Re,this.addControlGrips(),this.controlBox.style.display="none"},K.prototype.adjustControlBox=function(){var X=this.controlBox.transform.baseVal.getItem(0);X.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(X,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()},K.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()},K.prototype.createGrip=function(){var X=new Qe;return X.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(X.visual),X},K.prototype.positionGrips=function(){var X=this.controlGrips.topLeft.GRIP_SIZE,ee=-X/2,me=ee,ae=(this.width+this.CB_DISTANCE)/2-X/2,Ke=(this.height+this.CB_DISTANCE)/2-X/2,pt=this.height+this.CB_DISTANCE-X/2,Ot=this.width+this.CB_DISTANCE-X/2;this.positionGrip(this.controlGrips.topLeft.visual,ee,me),this.positionGrip(this.controlGrips.topCenter.visual,ae,me),this.positionGrip(this.controlGrips.topRight.visual,Ot,me),this.positionGrip(this.controlGrips.centerLeft.visual,ee,Ke),this.positionGrip(this.controlGrips.centerRight.visual,Ot,Ke),this.positionGrip(this.controlGrips.bottomLeft.visual,ee,pt),this.positionGrip(this.controlGrips.bottomCenter.visual,ae,pt),this.positionGrip(this.controlGrips.bottomRight.visual,Ot,pt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,ae,me-3*this.CB_DISTANCE)},K.prototype.positionGrip=function(X,ee,me){var ae=X.transform.baseVal.getItem(0);ae.setTranslate(ee,me),X.transform.baseVal.replaceItem(ae,0)},K.prototype.hideControlBox=function(){this.controlBox.style.display="none"},K.prototype.showControlBox=function(){this.controlBox.style.display=""},K.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:rt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:rt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},le.prototype.getState.call(this))},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.left=ee.left,this.top=ee.top,this.width=ee.width,this.height=ee.height,this.rotationAngle=ee.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ee.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ee.containerTransformMatrix))},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee);var me=this.rotatePoint({x:this.left,y:this.top}),ae=this.unrotatePoint({x:me.x*X,y:me.y*ee});this.left=ae.x,this.top=ae.y,this.width=this.width*X,this.height=this.height*ee,this.adjustControlBox()},K}(be),qe=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.fillColor="transparent",ae.strokeColor="transparent",ae.strokeWidth=0,ae.strokeDasharray="",ae.opacity=1,ae.setStrokeColor=ae.setStrokeColor.bind(ae),ae.setFillColor=ae.setFillColor.bind(ae),ae.setStrokeWidth=ae.setStrokeWidth.bind(ae),ae.setStrokeDasharray=ae.setStrokeDasharray.bind(ae),ae.createVisual=ae.createVisual.bind(ae),ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual)},K.prototype.createVisual=function(){this.visual=ue.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)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},K.prototype.manipulate=function(X){le.prototype.manipulate.call(this,X)},K.prototype.resize=function(X){le.prototype.resize.call(this,X),this.setSize()},K.prototype.setSize=function(){le.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},K.prototype.pointerUp=function(X){le.prototype.pointerUp.call(this,X),this.setSize()},K.prototype.setStrokeColor=function(X){this.strokeColor=X,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(X),this.stateChanged()},K.prototype.setFillColor=function(X){this.fillColor=X,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},K.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},K.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},K.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},le.prototype.getState.call(this))},K.prototype.restoreState=function(X){var ee=X;this.fillColor=ee.fillColor,this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.opacity=ee.opacity,this.createVisual(),le.prototype.restoreState.call(this,X),this.setSize()},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.setSize()},K.title="Rectangle marker",K}(at),st=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ke.widths=[],Ke.widthBoxes=[],Ke.widths=ee,Ke.currentWidth=me,Ke.setCurrentWidth=Ke.setCurrentWidth.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.widths.forEach(function(me){var ae=document.createElement("div");ae.style.display="flex",ae.style.flexGrow="2",ae.style.alignItems="center",ae.style.justifyContent="space-between",ae.style.padding="5px",ae.style.borderWidth="2px",ae.style.borderStyle="solid",ae.style.borderColor=me===X.currentWidth?X.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){X.setCurrentWidth(me,ae)}),ee.appendChild(ae);var Ke=document.createElement("div");Ke.innerText=me.toString(),Ke.style.marginRight="5px",ae.appendChild(Ke);var pt=document.createElement("div");pt.style.minHeight="20px",pt.style.flexGrow="2",pt.style.display="flex",pt.style.alignItems="center";var Ot=document.createElement("hr");Ot.style.minWidth="20px",Ot.style.border="0px",Ot.style.borderTop=me+"px solid "+X.uiStyleSettings.toolboxColor,Ot.style.flexGrow="2",pt.appendChild(Ot),ae.appendChild(pt),X.widthBoxes.push(ae)}),ee},K.prototype.setCurrentWidth=function(X,ee){var me=this;this.currentWidth=X,this.widthBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},K}(Z),lt=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'<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 Ke.styles=[],Ke.styleBoxes=[],Ke.styles=ee,Ke.currentStyle=me,Ke.setCurrentStyle=Ke.setCurrentStyle.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.styles.forEach(function(me){var ae=document.createElement("div");ae.style.display="flex",ae.style.alignItems="center",ae.style.justifyContent="space-between",ae.style.padding="5px",ae.style.borderWidth="2px",ae.style.borderStyle="solid",ae.style.overflow="hidden",ae.style.maxWidth=100/X.styles.length-5+"%",ae.style.borderColor=me===X.currentStyle?X.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){X.setCurrentStyle(me,ae)}),ee.appendChild(ae);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.overflow="hidden";var pt=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+X.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(me!==""?'stroke-dasharray="'+me+'"':"")+` />
|
|
|
</svg>`;Ke.innerHTML=pt,ae.appendChild(Ke),X.styleBoxes.push(ae)}),ee},K.prototype.setCurrentStyle=function(X,ee){var me=this;this.currentStyle=X,this.styleBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},K}(Z),je=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.strokeColor=me.defaultColor,ae.strokeWidth=me.defaultStrokeWidth,ae.strokeDasharray=me.defaultStrokeDasharray,ae.strokePanel=new ye("Line color",me.defaultColorSet,me.defaultColor),ae.strokePanel.onColorChanged=ae.setStrokeColor,ae.strokeWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.strokeWidthPanel.onWidthChanged=ae.setStrokeWidth,ae.strokeStylePanel=new lt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ae.strokeStylePanel.onStyleChanged=ae.setStrokeDasharray,ae}return de(K,le),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.typeName="FrameMarker",K.title="Frame marker",K.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',K}(qe),Ie=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},tt=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.x1=0,ae.y1=0,ae.x2=0,ae.y2=0,ae.defaultLength=50,ae.manipulationStartX=0,ae.manipulationStartY=0,ae.manipulationStartX1=0,ae.manipulationStartY1=0,ae.manipulationStartX2=0,ae.manipulationStartY2=0,ae.setupControlBox(),ae}return de(K,le),K.prototype.ownsTarget=function(X){return!!le.prototype.ownsTarget.call(this,X)||!(!this.grip1.ownsTarget(X)&&!this.grip2.ownsTarget(X))},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.manipulationStartX=X.x,this.manipulationStartY=X.y,this.state==="new"&&(this.x1=X.x,this.y1=X.y,this.x2=X.x,this.y2=X.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(ee)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ee)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},K.prototype.pointerUp=function(X){var ee=this.state;le.prototype.pointerUp.call(this,X),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(X),this._state="select",ee==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},K.prototype.adjustVisual=function(){},K.prototype.manipulate=function(X){this.state==="creating"?this.resize(X):this.state==="move"?(this.x1=this.manipulationStartX1+X.x-this.manipulationStartX,this.y1=this.manipulationStartY1+X.y-this.manipulationStartY,this.x2=this.manipulationStartX2+X.x-this.manipulationStartX,this.y2=this.manipulationStartY2+X.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(X)},K.prototype.resize=function(X){switch(this.activeGrip){case this.grip1:this.x1=X.x,this.y1=X.y;break;case this.grip2:case void 0:this.x2=X.x,this.y2=X.y}this.adjustVisual(),this.adjustControlBox()},K.prototype.select=function(){le.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},K.prototype.deselect=function(){le.prototype.deselect.call(this),this.controlBox.style.display="none"},K.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},K.prototype.adjustControlBox=function(){this.positionGrips()},K.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},K.prototype.createGrip=function(){var X=new Qe;return X.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(X.visual),X},K.prototype.positionGrips=function(){var X=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-X/2,this.y1-X/2),this.positionGrip(this.grip2.visual,this.x2-X/2,this.y2-X/2)},K.prototype.positionGrip=function(X,ee,me){var ae=X.transform.baseVal.getItem(0);ae.setTranslate(ee,me),X.transform.baseVal.replaceItem(ae,0)},K.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},le.prototype.getState.call(this))},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.x1=ee.x1,this.y1=ee.y1,this.x2=ee.x2,this.y2=ee.y2},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.x1=this.x1*X,this.y1=this.y1*ee,this.x2=this.x2*X,this.y2=this.y2*ee,this.adjustVisual(),this.adjustControlBox()},K}(be),ot=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.strokeColor="transparent",ae.strokeWidth=0,ae.strokeDasharray="",ae.setStrokeColor=ae.setStrokeColor.bind(ae),ae.setStrokeWidth=ae.setStrokeWidth.bind(ae),ae.setStrokeDasharray=ae.setStrokeDasharray.bind(ae),ae.strokeColor=me.defaultColor,ae.strokeWidth=me.defaultStrokeWidth,ae.strokeDasharray=me.defaultStrokeDasharray,ae.strokePanel=new ye("Line color",me.defaultColorSet,me.defaultColor),ae.strokePanel.onColorChanged=ae.setStrokeColor,ae.strokeWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.strokeWidthPanel.onWidthChanged=ae.setStrokeWidth,ae.strokeStylePanel=new lt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ae.strokeStylePanel.onStyleChanged=ae.setStrokeDasharray,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorLine&&X!==this.visibleLine)},K.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.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)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},K.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()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},K.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},K.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},K.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.createVisual(),this.adjustVisual()},K.typeName="LineMarker",K.title="Line marker",K.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',K}(tt),ze=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'<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 Ke.fonts=[],Ke.fontBoxes=[],Ke.fonts=ee,Ke.currentFont=me,Ke.setCurrentFont=Ke.setCurrentFont.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.flexGrow="2",this.fonts.forEach(function(me){var ae=document.createElement("div");ae.style.display="inline-block",ae.style.alignItems="center",ae.style.justifyContent="space-between",ae.style.padding="5px",ae.style.borderWidth="2px",ae.style.borderStyle="solid",ae.style.overflow="hidden",ae.style.maxWidth=100/X.fonts.length-5+"%",ae.style.borderColor=me===X.currentFont?X.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){X.setCurrentFont(me,ae)}),ee.appendChild(ae);var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.fontFamily=me,Ke.style.overflow="hidden";var pt=document.createElement("div");pt.style.whiteSpace="nowrap",pt.style.overflow="hidden",pt.style.textOverflow="ellipsis",pt.innerHTML="The quick brown fox jumps over the lazy dog",Ke.appendChild(pt),ae.appendChild(Ke),X.fontBoxes.push(ae)}),ee},K.prototype.setCurrentFont=function(X,ee){var me=this;this.currentFont=X,this.fontBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},K}(Z),Ze=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.color="transparent",ae.padding=5,ae.DEFAULT_TEXT="your text here",ae.text=ae.DEFAULT_TEXT,ae.isMoved=!1,ae.color=me.defaultColor,ae.fontFamily=me.defaultFontFamily,ae.defaultSize={x:100,y:30},ae.setColor=ae.setColor.bind(ae),ae.setFont=ae.setFont.bind(ae),ae.renderText=ae.renderText.bind(ae),ae.sizeText=ae.sizeText.bind(ae),ae.textEditDivClicked=ae.textEditDivClicked.bind(ae),ae.showTextEditor=ae.showTextEditor.bind(ae),ae.setSize=ae.setSize.bind(ae),ae.positionTextEditor=ae.positionTextEditor.bind(ae),ae.colorPanel=new ye("Color",me.defaultColorSet,me.defaultColor),ae.colorPanel.onColorChanged=ae.setColor,ae.fontFamilyPanel=new ze("Font",me.defaultFontFamilies,me.defaultFontFamily),ae.fontFamilyPanel.onFontChanged=ae.setFont,ae}return de(K,le),K.prototype.ownsTarget=function(X){if(le.prototype.ownsTarget.call(this,X)||X===this.visual||X===this.textElement||X===this.bgRectangle)return!0;var ee=!1;return this.textElement.childNodes.forEach(function(me){me===X&&(ee=!0)}),ee},K.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.isMoved=!1,this.pointerDownPoint=X,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},K.prototype.renderText=function(){var X=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(ee){X.textElement.appendChild(ue.createTSpan(ee.trim()===""?" ":ee.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},K.prototype.getTextScale=function(){var X=this.textElement.getBBox(),ee=1;if(X.width>0&&X.height>0){var me=(1*this.width-this.width*this.padding*2/100)/X.width,ae=(1*this.height-this.height*this.padding*2/100)/X.height;ee=Math.min(me,ae)}return ee},K.prototype.getTextPosition=function(X){var ee=this.textElement.getBBox(),me=0,ae=0;return ee.width>0&&ee.height>0&&(me=(this.width-ee.width*X)/2,ae=this.height/2-ee.height*X/2),{x:me,y:ae}},K.prototype.sizeText=function(){var X=this.textElement.getBBox(),ee=this.getTextScale(),me=this.getTextPosition(ee);me.y-=X.y*ee,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+me.x+"px, "+me.y+"px) scale("+ee+", "+ee+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(me.x,me.y),this.textElement.transform.baseVal.getItem(1).setScale(ee,ee))},K.prototype.manipulate=function(X){le.prototype.manipulate.call(this,X),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(X.x-this.pointerDownPoint.x)>5||Math.abs(X.y-this.pointerDownPoint.y)>5)},K.prototype.resize=function(X){le.prototype.resize.call(this,X),this.isMoved=!0,this.setSize(),this.sizeText()},K.prototype.setSize=function(){le.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},K.prototype.pointerUp=function(X){var ee=this.state;ee==="creating"&&(this._suppressMarkerCreateEvent=!0),le.prototype.pointerUp.call(this,X),this.setSize(),(ee==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},K.prototype.showTextEditor=function(){var X=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(ee){ee.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ee=Number.parseFloat(X.textEditor.style.fontSize);X.textEditor.clientWidth>=Number.parseInt(X.textEditor.style.maxWidth)&&ee>.9;)ee-=.1,X.textEditor.style.fontSize=Math.max(ee,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ee){ee.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ee){if(ee.clipboardData){var me=ee.clipboardData.getData("text"),ae=window.getSelection();if(!ae.rangeCount)return!1;ae.deleteFromDocument(),ae.getRangeAt(0).insertNode(document.createTextNode(me)),ee.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){X.textEditDivClicked(X.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},K.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var X=this.getTextScale(),ee=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),me=this.textElement.getBBox(),ae={x:me.width*X,y:me.height*X};ee.x-=ae.x/2,ee.y-=ae.y/2,this.textEditor.style.top=ee.y+"px",this.textEditor.style.left=ee.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ee.x+"px",this.textEditor.style.fontSize=Math.max(16*X,12)+"px",this.textElement.style.display="none"}},K.prototype.textEditDivClicked=function(X){this.text=X.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},K.prototype.select=function(){le.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},K.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),le.prototype.deselect.call(this)},K.prototype.dblClick=function(X,ee){le.prototype.dblClick.call(this,X,ee),this.showTextEditor()},K.prototype.setColor=function(X){this.textElement&&ue.setAttributes(this.textElement,[["fill",X]]),this.color=X,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(X)},K.prototype.setFont=function(X){this.textElement&&ue.setAttributes(this.textElement,[["font-family",X]]),this.fontFamily=X,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},K.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},K.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){var ee=X;this.color=ee.color,this.fontFamily=ee.fontFamily,this.padding=ee.padding,this.text=ee.text,this.createVisual(),le.prototype.restoreState.call(this,X),this.setSize()},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.setSize(),this.sizeText(),this.positionTextEditor()},K.typeName="TextMarker",K.title="Text marker",K.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>',K}(at),Ne=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.color="transparent",ae.lineWidth=3,ae.drawing=!1,ae.pixelRatio=1,ae.color=me.defaultColor,ae.lineWidth=me.defaultStrokeWidth,ae.pixelRatio=me.freehandPixelRatio,ae.setColor=ae.setColor.bind(ae),ae.addCanvas=ae.addCanvas.bind(ae),ae.finishCreation=ae.finishCreation.bind(ae),ae.setLineWidth=ae.setLineWidth.bind(ae),ae.colorPanel=new ye("Color",me.defaultColorSet,me.defaultColor),ae.colorPanel.onColorChanged=ae.setColor,ae.lineWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.lineWidthPanel.onWidthChanged=ae.setLineWidth,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.drawingImage)},K.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var X=ue.createTransform();this.visual.transform.baseVal.appendItem(X),this.addMarkerVisualToContainer(this.visual)},K.prototype.pointerDown=function(X,ee){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(X.x,X.y),this.drawing=!0):le.prototype.pointerDown.call(this,X,ee)},K.prototype.manipulate=function(X){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(X.x,X.y),this.canvasContext.stroke()):le.prototype.manipulate.call(this,X)},K.prototype.resize=function(X){le.prototype.resize.call(this,X),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},K.prototype.pointerUp=function(X){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):le.prototype.pointerUp.call(this,X)},K.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)},K.prototype.select=function(){this.state==="creating"&&this.finishCreation(),le.prototype.select.call(this)},K.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),le.prototype.deselect.call(this)},K.prototype.finishCreation=function(){for(var X=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ee=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],me=ee[0],ae=ee[1],Ke=ee[2],pt=ee[3],Ot=!1,Ht=0;Ht<this.canvasElement.height;Ht++)for(var vt=0;vt<this.canvasElement.width;vt++)X.data[Ht*this.canvasElement.width*4+4*vt+3]>0&&(Ot=!0,Ht<ae&&(ae=Ht),vt<me&&(me=vt),Ht>pt&&(pt=Ht),vt>Ke&&(Ke=vt));if(Ot){this.left=me/this.pixelRatio,this.top=ae/this.pixelRatio,this.width=(Ke-me)/this.pixelRatio,this.height=(pt-ae)/this.pixelRatio;var Xt=document.createElement("canvas");Xt.width=Ke-me,Xt.height=pt-ae,Xt.getContext("2d").putImageData(this.canvasContext.getImageData(me,ae,Ke-me,pt-ae),0,0),this.drawingImgUrl=Xt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},K.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},K.prototype.setColor=function(X){this.color=X,this.colorChanged(X)},K.prototype.setLineWidth=function(X){this.lineWidth=X},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({drawingImgUrl:this.drawingImgUrl},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){this.createVisual(),le.prototype.restoreState.call(this,X),this.drawingImgUrl=X.drawingImgUrl,this.setDrawingImage()},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.setDrawingImage()},K.typeName="FreehandMarker",K.title="Freehand marker",K.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>',K}(at),Ae=function(le){function K(X,ee,me){var ae=le.call(this,X,me||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return ae.typeBoxes=[],ae.currentType=ee,ae.setCurrentType=ae.setCurrentType.bind(ae),ae}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2";for(var me=function(pt){var Ot="both";switch(pt){case 0:Ot="both";break;case 1:Ot="start";break;case 2:Ot="end";break;case 3:Ot="none"}var Ht=document.createElement("div");if(Ht.style.display="flex",Ht.style.flexGrow="2",Ht.style.alignItems="center",Ht.style.justifyContent="space-between",Ht.style.padding="5px",Ht.style.borderWidth="2px",Ht.style.borderStyle="solid",Ht.style.borderColor=Ot===ae.currentType?ae.uiStyleSettings.toolboxAccentColor:"transparent",Ht.addEventListener("click",function(){X.setCurrentType(Ot,Ht)}),ee.appendChild(Ht),Ot==="both"||Ot==="start"){var vt=document.createElement("div");vt.style.display="flex",vt.style.alignItems="center",vt.style.minHeight="20px",vt.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="`+(ae.uiStyleSettings!==void 0?ae.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,vt.style.marginLeft="5px",Ht.appendChild(vt)}var Xt=document.createElement("div");Xt.style.display="flex",Xt.style.alignItems="center",Xt.style.minHeight="20px",Xt.style.flexGrow="2";var qt=document.createElement("hr");if(qt.style.minWidth="20px",qt.style.border="0px",qt.style.borderTop="3px solid "+(ae.uiStyleSettings!==void 0?ae.uiStyleSettings.toolboxColor:"#eeeeee"),qt.style.flexGrow="2",Xt.appendChild(qt),Ht.appendChild(Xt),Ot==="both"||Ot==="end"){var Hr=document.createElement("div");Hr.style.display="flex",Hr.style.alignItems="center",Hr.style.minHeight="20px",Hr.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="`+(ae.uiStyleSettings!==void 0?ae.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,Hr.style.marginRight="5px",Ht.appendChild(Hr)}ae.typeBoxes.push(Ht)},ae=this,Ke=0;Ke<4;Ke++)me(Ke);return ee},K.prototype.setCurrentType=function(X,ee){var me=this;this.currentType=X,this.typeBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings!==void 0?me.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},K}(Z),Me=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.arrowType="end",ae.arrowBaseHeight=10,ae.arrowBaseWidth=10,ae.getArrowPoints=ae.getArrowPoints.bind(ae),ae.setArrowType=ae.setArrowType.bind(ae),ae.arrowTypePanel=new Ae("Arrow type","end"),ae.arrowTypePanel.onArrowTypeChanged=ae.setArrowType,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.arrow1&&X!==this.arrow2)},K.prototype.getArrowPoints=function(X,ee){var me=this.arrowBaseWidth+2*this.strokeWidth,ae=this.arrowBaseHeight+2*this.strokeWidth;return X-me/2+","+(ee+ae/2)+" "+X+","+(ee-ae/2)+" "+(X+me/2)+","+(ee+ae/2)},K.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="creating"&&this.createTips()},K.prototype.adjustVisual=function(){if(le.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",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ee=this.arrow1.transform.baseVal.getItem(0);ee.setRotate(X,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ee,0);var me=this.arrow2.transform.baseVal.getItem(0);me.setRotate(X+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(me,0)}},K.prototype.setArrowType=function(X){this.arrowType=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({arrowType:this.arrowType},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.arrowType=ee.arrowType,this.createTips(),this.adjustVisual()},K.typeName="ArrowMarker",K.title="Arrow marker",K.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',K}(ot),Ee=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.fillColor=me.defaultFillColor,ae.strokeWidth=0,ae.fillPanel=new ye("Color",me.defaultColorSet,me.defaultFillColor),ae.fillPanel.onColorChanged=ae.setFillColor,ae}return de(K,le),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.typeName="CoverMarker",K.title="Cover marker",K.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',K}(qe),Ce=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'<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 Ke.opacities=[],Ke.opacityBoxes=[],Ke.opacities=ee,Ke.currentOpacity=me,Ke.setCurrentOpacity=Ke.setCurrentOpacity.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",ee.style.justifyContent="space-between",this.opacities.forEach(function(me){var ae=document.createElement("div");ae.style.display="flex",ae.style.alignItems="center",ae.style.justifyContent="center",ae.style.padding="5px",ae.style.borderWidth="2px",ae.style.borderStyle="solid",ae.style.borderColor=me===X.currentOpacity?X.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){X.setCurrentOpacity(me,ae)}),ee.appendChild(ae);var Ke=document.createElement("div");Ke.innerText=100*me+"%",ae.appendChild(Ke),X.opacityBoxes.push(ae)}),ee},K.prototype.setCurrentOpacity=function(X,ee){var me=this;this.currentOpacity=X,this.opacityBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},K}(Z),ke=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.setOpacity=ae.setOpacity.bind(ae),ae.fillColor=me.defaultHighlightColor,ae.strokeWidth=0,ae.opacity=me.defaultHighlightOpacity,ae.fillPanel=new ye("Color",me.defaultColorSet,ae.fillColor),ae.fillPanel.onColorChanged=ae.setFillColor,ae.opacityPanel=new Ce("Opacity",me.defaultOpacitySteps,ae.opacity),ae.opacityPanel.onOpacityChanged=ae.setOpacity,ae}return de(K,le),K.prototype.setOpacity=function(X){this.opacity=X,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.typeName="HighlightMarker",K.title="Highlight marker",K.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>',K}(Ee),Fe='<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>',Be=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.bgColor="transparent",ae.tipPosition={x:0,y:0},ae.tipBase1Position={x:0,y:0},ae.tipBase2Position={x:0,y:0},ae.tipMoving=!1,ae.color=me.defaultStrokeColor,ae.bgColor=me.defaultFillColor,ae.fontFamily=me.defaultFontFamily,ae.defaultSize={x:100,y:30},ae.setBgColor=ae.setBgColor.bind(ae),ae.getTipPoints=ae.getTipPoints.bind(ae),ae.positionTip=ae.positionTip.bind(ae),ae.setTipPoints=ae.setTipPoints.bind(ae),ae.colorPanel=new ye("Text color",me.defaultColorSet,ae.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>'),ae.colorPanel.onColorChanged=ae.setColor,ae.bgColorPanel=new ye("Fill color",me.defaultColorSet,ae.bgColor,Fe),ae.bgColorPanel.onColorChanged=ae.setBgColor,ae.fontFamilyPanel=new ze("Font",me.defaultFontFamilies,me.defaultFontFamily),ae.fontFamilyPanel.onFontChanged=ae.setFont,ae.tipGrip=new Qe,ae.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),ae.controlBox.appendChild(ae.tipGrip.visual),ae}return de(K,le),K.prototype.ownsTarget=function(X){return le.prototype.ownsTarget.call(this,X)||this.tipGrip.ownsTarget(X)||this.tip===X},K.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},K.prototype.pointerDown=function(X,ee){this.state==="new"&&le.prototype.pointerDown.call(this,X,ee),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ee)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):le.prototype.pointerDown.call(this,X,ee)},K.prototype.pointerUp=function(X){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,le.prototype.pointerUp.call(this,X);else{var ee=this.state==="creating";le.prototype.pointerUp.call(this,X),this.setTipPoints(ee),this.positionTip()}},K.prototype.manipulate=function(X){if(this.tipMoving){var ee=this.unrotatePoint(X);this.tipPosition={x:ee.x-this.manipulationStartLeft,y:ee.y-this.manipulationStartTop},this.positionTip()}else le.prototype.manipulate.call(this,X)},K.prototype.setBgColor=function(X){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",X]]),ue.setAttributes(this.tip,[["fill",X]])),this.bgColor=X,this.fillColorChanged(X)},K.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},K.prototype.setTipPoints=function(X){X===void 0&&(X=!1);var ee=Math.min(this.height/2,15),me=this.height/5;X&&(this.tipPosition={x:ee+me/2,y:this.height+20});var ae=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?ae<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(me=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:ee,y:0},this.tipBase2Position={x:ee+me,y:0}):(this.tipBase1Position={x:0,y:ee},this.tipBase2Position={x:0,y:ee+me}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?ae<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(me=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ee-me,y:0},this.tipBase2Position={x:this.width-ee,y:0}):(this.tipBase1Position={x:this.width,y:ee},this.tipBase2Position={x:this.width,y:ee+me}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?ae<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(me=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ee-me,y:this.height},this.tipBase2Position={x:this.width-ee,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ee-me},this.tipBase2Position={x:this.width,y:this.height-ee}):ae<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(me=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:ee,y:this.height},this.tipBase2Position={x:ee+me,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ee},this.tipBase2Position={x:0,y:this.height-ee-me})},K.prototype.resize=function(X){le.prototype.resize.call(this,X),this.positionTip()},K.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var X=this.tipGrip.visual.transform.baseVal.getItem(0);X.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(X,0)},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),K.prototype.select=function(){this.positionTip(),le.prototype.select.call(this)},K.prototype.getState=function(){var X=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){var ee=X;this.bgColor=ee.bgColor,this.tipPosition=ee.tipPosition,le.prototype.restoreState.call(this,X),this.createTip(),this.setTipPoints()},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.tipPosition={x:this.tipPosition.x*X,y:this.tipPosition.y*ee},this.positionTip()},K.typeName="CalloutMarker",K.title="Callout marker",K.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>',K}(Ze),et=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.fillColor="transparent",ae.strokeColor="transparent",ae.strokeWidth=0,ae.strokeDasharray="",ae.opacity=1,ae.strokeColor=me.defaultColor,ae.strokeWidth=me.defaultStrokeWidth,ae.strokeDasharray=me.defaultStrokeDasharray,ae.fillColor=me.defaultFillColor,ae.setStrokeColor=ae.setStrokeColor.bind(ae),ae.setFillColor=ae.setFillColor.bind(ae),ae.setStrokeWidth=ae.setStrokeWidth.bind(ae),ae.setStrokeDasharray=ae.setStrokeDasharray.bind(ae),ae.setOpacity=ae.setOpacity.bind(ae),ae.createVisual=ae.createVisual.bind(ae),ae.strokePanel=new ye("Line color",he(me.defaultColorSet,["transparent"]),me.defaultColor),ae.strokePanel.onColorChanged=ae.setStrokeColor,ae.fillPanel=new ye("Fill color",he(me.defaultColorSet,["transparent"]),ae.fillColor,Fe),ae.fillPanel.onColorChanged=ae.setFillColor,ae.strokeWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.strokeWidthPanel.onWidthChanged=ae.setStrokeWidth,ae.strokeStylePanel=new lt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ae.strokeStylePanel.onStyleChanged=ae.setStrokeDasharray,ae.opacityPanel=new Ce("Opacity",me.defaultOpacitySteps,ae.opacity),ae.opacityPanel.onOpacityChanged=ae.setOpacity,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual)},K.prototype.createVisual=function(){this.visual=ue.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)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},K.prototype.manipulate=function(X){le.prototype.manipulate.call(this,X)},K.prototype.resize=function(X){le.prototype.resize.call(this,X),this.setSize()},K.prototype.setSize=function(){le.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},K.prototype.pointerUp=function(X){le.prototype.pointerUp.call(this,X),this.setSize()},K.prototype.setStrokeColor=function(X){this.strokeColor=X,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(X),this.stateChanged()},K.prototype.setFillColor=function(X){this.fillColor=X,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(X),this.stateChanged()},K.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},K.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},K.prototype.setOpacity=function(X){this.opacity=X,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){var ee=X;this.fillColor=ee.fillColor,this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.opacity=ee.opacity,this.createVisual(),le.prototype.restoreState.call(this,X),this.setSize()},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.setSize()},K.typeName="EllipseMarker",K.title="Ellipse marker",K.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>',K}(at),ct=function(le){function K(X,ee,me){return le.call(this,X,ee,me)||this}return de(K,le),Object.defineProperty(K.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.tip1&&X!==this.tip2)},K.prototype.createTips=function(){this.tip1=ue.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(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.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(ue.createTransform()),this.visual.appendChild(this.tip2)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="creating"&&this.createTips()},K.prototype.adjustVisual=function(){if(le.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.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()]]),ue.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 X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ee=this.tip1.transform.baseVal.getItem(0);ee.setRotate(X,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ee,0);var me=this.tip2.transform.baseVal.getItem(0);me.setRotate(X+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(me,0)}},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X),this.createTips(),this.adjustVisual()},K.typeName="MeasurementMarker",K.title="Measurement marker",K.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>',K}(ot),yt=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.strokePanel.colors=me.defaultColorSet,ae.fillColor="transparent",ae}return de(K,le),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.typeName="EllipseFrameMarker",K.title="Ellipse frame marker",K.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>',K}(et),ft=function(){function le(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(le.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),le.prototype.addUndoStep=function(K){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(K)||(this.undoStack.push(K),JSON.stringify(this.lastRedoStep)!==JSON.stringify(K)&&this.redoStack.splice(0,this.redoStack.length))},le.prototype.replaceLastUndoStep=function(K){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=K)},le.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},le.prototype.undo=function(){if(this.undoStack.length>1){var K=this.undoStack.pop();return K!==void 0&&this.redoStack.push(K),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},le.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},le}(),mt=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.strokeColor="transparent",ae.strokeWidth=0,ae.strokeDasharray="",ae.curveX=0,ae.curveY=0,ae.manipulationStartCurveX=0,ae.manipulationStartCurveY=0,ae.setStrokeColor=ae.setStrokeColor.bind(ae),ae.setStrokeWidth=ae.setStrokeWidth.bind(ae),ae.setStrokeDasharray=ae.setStrokeDasharray.bind(ae),ae.positionGrips=ae.positionGrips.bind(ae),ae.addControlGrips=ae.addControlGrips.bind(ae),ae.adjustVisual=ae.adjustVisual.bind(ae),ae.setupControlBox=ae.setupControlBox.bind(ae),ae.resize=ae.resize.bind(ae),ae.strokeColor=me.defaultColor,ae.strokeWidth=me.defaultStrokeWidth,ae.strokeDasharray=me.defaultStrokeDasharray,ae.strokePanel=new ye("Line color",me.defaultColorSet,me.defaultColor),ae.strokePanel.onColorChanged=ae.setStrokeColor,ae.strokeWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.strokeWidthPanel.onWidthChanged=ae.setStrokeWidth,ae.strokeStylePanel=new lt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ae.strokeStylePanel.onStyleChanged=ae.setStrokeDasharray,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorCurve&&X!==this.visibleCurve&&!this.curveGrip.ownsTarget(X))},K.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},K.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.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)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=X.x,this.curveY=X.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ee)&&(this.activeGrip=this.curveGrip,this._state="resize")},K.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},K.prototype.setupControlBox=function(){le.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.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)},K.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,le.prototype.addControlGrips.call(this)},K.prototype.positionGrips=function(){le.prototype.positionGrips.call(this);var X=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-X/2,this.curveY-X/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()))},K.prototype.manipulate=function(X){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+X.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+X.y-this.manipulationStartY),le.prototype.manipulate.call(this,X)},K.prototype.resize=function(X){this.activeGrip===this.curveGrip&&(this.curveX=X.x,this.curveY=X.y),le.prototype.resize.call(this,X),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},K.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},K.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},K.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual()},K.prototype.scale=function(X,ee){this.curveX=this.curveX*X,this.curveY=this.curveY*ee,le.prototype.scale.call(this,X,ee)},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.curveX=ee.curveX,this.curveY=ee.curveY,this.createVisual(),this.adjustVisual()},K.typeName="CurveMarker",K.title="Curve marker",K.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>',K}(tt),It=function(){function le(K,X){X===void 0&&(X=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=K,this.cancelable=X}return Object.defineProperty(le.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),le.prototype.preventDefault=function(){this._defaultPrevented=!0},le}(),At=function(le){function K(X,ee,me){var ae=le.call(this,X,!1)||this;return ae.dataUrl=ee,ae.state=me,ae}return de(K,le),K}(It),_t=function(le){function K(X,ee,me){me===void 0&&(me=!1);var ae=le.call(this,X,me)||this;return ae.marker=ee,ae}return de(K,le),K}(It),Vt=function(){function le(){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 le.prototype.addEventListener=function(K,X){this[K].push(X)},le.prototype.removeEventListener=function(K,X){var ee=this[K].indexOf(X);ee>-1&&this[K].splice(ee,1)},le}(),Kt=function(){function le(K){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ie,this._isOpen=!1,this.undoRedoManager=new ft,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 Vt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=le.instanceCounter++,this.styles=new ce(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=K,this.targetRoot=document.body,this.width=K.clientWidth,this.height=K.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(le.prototype,"ALL_MARKER_TYPES",{get:function(){return[je,Ne,Me,Ze,yt,et,ke,Be,ct,Ee,ot,mt]},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[je,Ne,Me,Ze,et,ke,Be]},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"BASIC_MARKER_TYPES",{get:function(){return[je,Ne,Me,Ze,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(K){var X=this;this._availableMarkerTypes.splice(0),K.forEach(function(ee){if(typeof ee=="string"){var me=X.ALL_MARKER_TYPES.find(function(ae){return ae.typeName===ee});me!==void 0&&X._availableMarkerTypes.push(me)}else X._availableMarkerTypes.push(ee)})},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(K){this._zoomLevel=K,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(le.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),le.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ie.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},le.prototype.show=function(){var K=this;this.styles.styleSheetRoot===void 0&&ne.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ne.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(X){return X(new It(K))})},le.prototype.render=function(){return De(this,void 0,void 0,function(){var K;return Te(this,function(X){switch(X.label){case 0:return this.setCurrentMarker(),(K=new Se).naturalSize=this.renderAtNaturalSize,K.imageType=this.renderImageType,K.imageQuality=this.renderImageQuality,K.markersOnly=this.renderMarkersOnly,K.width=this.renderWidth,K.height=this.renderHeight,[4,K.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return X.sent(),[4,K.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,X.sent()]}})})},le.prototype.close=function(K){var X=this;if(K===void 0&&(K=!1),this.isOpen){var ee=!1;K||this.eventListeners.beforeclose.forEach(function(me){var ae=new It(X,!0);me(ae),ae.defaultPrevented&&(ee=!0)}),ee||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(me){return me(new It(X))}),this.detachEvents(),this._isOpen=!1)}},le.prototype.addMarkersToToolbar=function(){for(var K,X=[],ee=0;ee<arguments.length;ee++)X[ee]=arguments[ee];(K=this._availableMarkerTypes).push.apply(K,X)},le.prototype.addRenderEventListener=function(K){this.addEventListener("render",function(X){K(X.dataUrl,X.state)})},le.prototype.removeRenderEventListener=function(K){},le.prototype.addCloseEventListener=function(K){this.addEventListener("close",function(){K()})},le.prototype.removeCloseEventListener=function(K){},le.prototype.setupResizeObserver=function(){var K=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){K.resize(K.target.clientWidth,K.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return K.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},le.prototype.onPopupTargetResize=function(){var K=1*this.target.clientWidth/this.target.clientHeight,X=this.editorCanvas.clientWidth/K>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*K:this.editorCanvas.clientWidth,ee=X<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/K;this.resize(X,ee)},le.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},le.prototype.resize=function(K,X){this._isResizing=!0;var ee=K/this.imageWidth,me=X/this.imageHeight;this.imageWidth=Math.round(K),this.imageHeight=Math.round(X),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(ee,me),this._isResizing=!1},le.prototype.scaleMarkers=function(K,X){var ee,me=this;this._currentMarker&&this._currentMarker instanceof Ze?this._currentMarker.scale(K,X):(ee=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(ae){ae!==me._currentMarker&&ae.scale(K,X)}),ee!==void 0&&this.setCurrentMarker(ee)},le.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"},le.prototype.setTopLeft=function(){var K=this.editingTarget.getBoundingClientRect(),X=this.editorCanvas.getBoundingClientRect();this.left=K.left-X.left,this.top=K.top-X.top},le.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)},le.prototype.addDefs=function(){for(var K,X=[],ee=0;ee<arguments.length;ee++)X[ee]=arguments[ee];this.defs=ue.createDefs(),this.addDefsToImage(),(K=this.defs).append.apply(K,X)},le.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},le.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)},le.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},le.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},le.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)},le.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},le.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)},le.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 K=document.createElement("a");K.href="https://markerjs.com/",K.target="_blank",K.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>',K.title="Powered by marker.js",K.style.display="grid",K.style.alignItems="center",K.style.justifyItems="center",K.style.padding="3px",K.style.width="20px",K.style.height="20px",this.logoUI.appendChild(K),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},le.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")},le.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"},le.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},le.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 K=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=K+"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 q(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 Y(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},le.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},le.prototype.removeMarker=function(K){this.markerImage.removeChild(K.container),this.markers.indexOf(K)>-1&&this.markers.splice(this.markers.indexOf(K),1),K.dispose()},le.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())},le.prototype.toolbarButtonClicked=function(K,X){if(K==="marker"&&X!==void 0)this.createNewMarker(X);else if(K==="action")switch(X){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()}},le.prototype.deleteSelectedMarker=function(){var K=this;if(this._currentMarker!==void 0){var X=!1;if(this.eventListeners.markerbeforedelete.forEach(function(me){var ae=new _t(K,K._currentMarker,!0);me(ae),ae.defaultPrevented&&(X=!0)}),!X){var ee=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(me){return me(new _t(K,ee))})}}},le.prototype.clear=function(){var K=this,X=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ke){var pt=new _t(K,void 0,!0);Ke(pt),pt.defaultPrevented&&(X=!0)}),!X)){this.setCurrentMarker();for(var ee=function(Ke){var pt=me.markers[Ke];me.setCurrentMarker(me.markers[Ke]),me._currentMarker.dispose(),me.markerImage.removeChild(me._currentMarker.container),me.markers.splice(me.markers.indexOf(me._currentMarker),1),me.eventListeners.markerdelete.forEach(function(Ot){return Ot(new _t(K,pt))})},me=this,ae=this.markers.length-1;ae>=0;ae--)ee(ae);this.addUndoStep()}},Object.defineProperty(le.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),le.prototype.showNotesEditor=function(){var K;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=(K=this._currentMarker.notes)!==null&&K!==void 0?K:"",this.overlayContainer.appendChild(this.notesArea))},le.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)},le.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},le.prototype.addUndoStep=function(){var K=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var X=this.getState(),ee=this.undoRedoManager.getLastUndoStep();if(!ee||ee.width===X.width&&ee.height===X.height){var me=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(X),me<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(ae){return ae(new It(K))})}else this.undoRedoManager.replaceLastUndoStep(X),this.eventListeners.statechange.forEach(function(ae){return ae(new It(K))})}},le.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},le.prototype.undoStep=function(){var K=this,X=this.undoRedoManager.undo();X!==void 0&&(this.restoreState(X),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ee){return ee(new It(K))}))},le.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},le.prototype.redoStep=function(){var K=this,X=this.undoRedoManager.redo();X!==void 0&&(this.restoreState(X),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ee){return ee(new It(K))}))},le.prototype.stepZoom=function(){var K=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=K<this.zoomSteps.length-1?this.zoomSteps[K+1]:this.zoomSteps[0]},le.prototype.panTo=function(K){this.contentDiv.scrollBy({left:this.prevPanPoint.x-K.x,top:this.prevPanPoint.y-K.y}),this.prevPanPoint=K},le.prototype.startRenderAndClose=function(){return De(this,void 0,void 0,function(){var K,X,ee=this;return Te(this,function(me){switch(me.label){case 0:return[4,this.render()];case 1:return K=me.sent(),X=this.getState(),this.eventListeners.render.forEach(function(ae){return ae(new At(ee,K,X))}),this.close(!0),[2]}})})},le.prototype.getState=function(K){K===!0&&this.setCurrentMarker();var X={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ee){return X.markers.push(ee.getState())}),X},le.prototype.restoreState=function(K){var X=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);K.markers.forEach(function(ee){var me=X._availableMarkerTypes.find(function(Ke){return Ke.typeName===ee.typeName});if(me!==void 0){var ae=X.addNewMarker(me);ae.restoreState(ee),X.markers.push(ae)}}),K.width&&K.height&&(K.width!==this.imageWidth||K.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/K.width,this.imageHeight/K.height),this.eventListeners.restorestate.forEach(function(ee){return ee(new It(X))})},le.prototype.addNewMarker=function(K){var X=ue.createGroup();return this.markerImage.appendChild(X),new K(X,this.overlayContainer,this.settings)},le.prototype.createNewMarker=function(K){var X,ee=this;(X=typeof K=="string"?this._availableMarkerTypes.find(function(me){return me.typeName===K}):K)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(X),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(X.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(me){return me(new _t(ee,ee._currentMarker))}))},le.prototype.markerCreated=function(K){var X=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(K),this.setCurrentMarker(K),K instanceof Ne&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ne):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ee){return ee(new _t(X,X._currentMarker))})},le.prototype.colorChanged=function(K){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=K,this.settings.defaultStrokeColor=K)},le.prototype.fillColorChanged=function(K){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=K)},le.prototype.markerStateChanged=function(K){var X=this;this.eventListeners.markerchange.forEach(function(ee){return ee(new _t(X,K))})},le.prototype.setCurrentMarker=function(K){var X=this;this._currentMarker!==K&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ee){return ee(new _t(X,X._currentMarker))})),this._currentMarker=K,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(ee){return ee(new _t(X,X._currentMarker))}))},le.prototype.onPointerDown=function(K){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||K.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var X=this.markers.find(function(ee){return ee.ownsTarget(K.target)});X!==void 0?(this.setCurrentMarker(X),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(K.clientX,K.clientY),K.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:K.clientX,y:K.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(K.clientX,K.clientY))},le.prototype.onDblClick=function(K){if(this._isFocused||this.focus(),this.mode==="select"){var X=this.markers.find(function(ee){return ee.ownsTarget(K.target)});X!==void 0&&X!==this._currentMarker&&this.setCurrentMarker(X),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(K.clientX,K.clientY),K.target):this.setCurrentMarker()}},le.prototype.onPointerMove=function(K){this.touchPoints!==1&&K.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||K.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(K.clientX,K.clientY)):this.zoomLevel>1&&this.panTo({x:K.clientX,y:K.clientY}))},le.prototype.onPointerUp=function(K){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(K.clientX,K.clientY)),this.isDragging=!1,this.addUndoStep()},le.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},le.prototype.onKeyUp=function(K){this._currentMarker===void 0||this.notesArea!==void 0||K.key!=="Delete"&&K.key!=="Backspace"||this.deleteSelectedMarker()},le.prototype.clientToLocalCoordinates=function(K,X){var ee=this.markerImage.getBoundingClientRect();return{x:(K-ee.left)/this.zoomLevel,y:(X-ee.top)/this.zoomLevel}},le.prototype.onWindowResize=function(){this.positionUI()},le.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var K=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=K+"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()},le.prototype.addLicenseKey=function(K){ie.addKey(K)},le.prototype.addEventListener=function(K,X){this.eventListeners.addEventListener(K,X)},le.prototype.removeEventListener=function(K,X){this.eventListeners.removeEventListener(K,X)},le.prototype.renderState=function(K){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(K),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(le.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),le.prototype.focus=function(){var K=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(X){return X(new It(K))}))},le.prototype.blur=function(){var K=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(X){return X(new It(K))}))},le.instanceCounter=0,le}();/* **********************************
|
|
|
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 tr=function(le,K){return(tr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ee){X.__proto__=ee}||function(X,ee){for(var me in ee)Object.prototype.hasOwnProperty.call(ee,me)&&(X[me]=ee[me])})(le,K)};function rr(le,K){if(typeof K!="function"&&K!==null)throw new TypeError("Class extends value "+String(K)+" is not a constructor or null");function X(){this.constructor=le}tr(le,K),le.prototype=K===null?Object.create(K):(X.prototype=K.prototype,new X)}function Wt(le,K,X,ee){return new(X||(X=Promise))(function(me,ae){function Ke(Ht){try{Ot(ee.next(Ht))}catch(vt){ae(vt)}}function pt(Ht){try{Ot(ee.throw(Ht))}catch(vt){ae(vt)}}function Ot(Ht){var vt;Ht.done?me(Ht.value):(vt=Ht.value,vt instanceof X?vt:new X(function(Xt){Xt(vt)})).then(Ke,pt)}Ot((ee=ee.apply(le,K||[])).next())})}function Lt(le,K){var X,ee,me,ae,Ke={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return ae={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(ae[Symbol.iterator]=function(){return this}),ae;function pt(Ot){return function(Ht){return function(vt){if(X)throw new TypeError("Generator is already executing.");for(;Ke;)try{if(X=1,ee&&(me=2&vt[0]?ee.return:vt[0]?ee.throw||((me=ee.return)&&me.call(ee),0):ee.next)&&!(me=me.call(ee,vt[1])).done)return me;switch(ee=0,me&&(vt=[2&vt[0],me.value]),vt[0]){case 0:case 1:me=vt;break;case 4:return Ke.label++,{value:vt[1],done:!1};case 5:Ke.label++,ee=vt[1],vt=[0];continue;case 7:vt=Ke.ops.pop(),Ke.trys.pop();continue;default:if(!(me=Ke.trys,(me=me.length>0&&me[me.length-1])||vt[0]!==6&&vt[0]!==2)){Ke=0;continue}if(vt[0]===3&&(!me||vt[1]>me[0]&&vt[1]<me[3])){Ke.label=vt[1];break}if(vt[0]===6&&Ke.label<me[1]){Ke.label=me[1],me=vt;break}if(me&&Ke.label<me[2]){Ke.label=me[2],Ke.ops.push(vt);break}me[2]&&Ke.ops.pop(),Ke.trys.pop();continue}vt=K.call(le,Ke)}catch(Xt){vt=[6,Xt],ee=0}finally{X=me=0}if(5&vt[0])throw vt[1];return{value:vt[0]?vt[1]:void 0,done:!0}}([Ot,Ht])}}}var nr=function(){function le(){}return le.addKey=function(K){le.key=K},Object.defineProperty(le,"isLicensed",{get:function(){return!!le.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(le.key)},enumerable:!1,configurable:!0}),le}(),dt=function(){function le(){}return le.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},le.setAttributes=function(K,X){for(var ee=0,me=X;ee<me.length;ee++){var ae=me[ee],Ke=ae[0],pt=ae[1];K.setAttribute(Ke,pt)}},le.createRect=function(K,X,ee){var me=document.createElementNS("http://www.w3.org/2000/svg","rect");return me.setAttribute("width",K.toString()),me.setAttribute("height",X.toString()),ee&&le.setAttributes(me,ee),me},le.createLine=function(K,X,ee,me,ae){var Ke=document.createElementNS("http://www.w3.org/2000/svg","line");return Ke.setAttribute("x1",K.toString()),Ke.setAttribute("y1",X.toString()),Ke.setAttribute("x2",ee.toString()),Ke.setAttribute("y2",me.toString()),ae&&le.setAttributes(Ke,ae),Ke},le.createPolygon=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ee.setAttribute("points",K),X&&le.setAttributes(ee,X),ee},le.createCircle=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","circle");return ee.setAttribute("cx",(K/2).toString()),ee.setAttribute("cy",(K/2).toString()),ee.setAttribute("r",K.toString()),X&&le.setAttributes(ee,X),ee},le.createEllipse=function(K,X,ee){var me=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return me.setAttribute("cx",(K/2).toString()),me.setAttribute("cy",(X/2).toString()),me.setAttribute("rx",(K/2).toString()),me.setAttribute("ry",(X/2).toString()),ee&&le.setAttributes(me,ee),me},le.createGroup=function(K){var X=document.createElementNS("http://www.w3.org/2000/svg","g");return K&&le.setAttributes(X,K),X},le.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},le.createMarker=function(K,X,ee,me,ae,Ke,pt){var Ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return le.setAttributes(Ot,[["id",K],["orient",X],["markerWidth",ee.toString()],["markerHeight",me.toString()],["refX",ae.toString()],["refY",Ke.toString()]]),Ot.appendChild(pt),Ot},le.createText=function(K){var X=document.createElementNS("http://www.w3.org/2000/svg","text");return X.setAttribute("x","0"),X.setAttribute("y","0"),K&&le.setAttributes(X,K),X},le.createTSpan=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ee.textContent=K,X&&le.setAttributes(ee,X),ee},le.createImage=function(K){var X=document.createElementNS("http://www.w3.org/2000/svg","image");return K&&le.setAttributes(X,K),X},le.createPoint=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ee.x=K,ee.y=X,ee},le.createPath=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","path");return ee.setAttribute("d",K),X&&le.setAttributes(ee,X),ee},le.createElement=function(K,X){var ee=document.createElementNS("http://www.w3.org/2000/svg",K);return X&&le.setAttributes(ee,X),ee},le.getHollowRectanglePath=function(K,X,ee,me,ae,Ke,pt,Ot){return"M"+K+","+X+"V"+(X+me)+"H"+(K+ee)+"V"+X+"H"+ae+"V"+Ke+"H"+(ae+pt)+"V"+(Ke+Ot)+"H"+ae+"V"+X+"Z"},le}(),Et=function(){function le(K){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+K+"_"}return Object.defineProperty(le.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(le.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(le.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),le.prototype.addClass=function(K){return this.styleSheet===void 0&&this.addStyleSheet(),K.name=""+this.classNamePrefix+K.localName,this.classes.push(K),this.styleSheet.sheet.insertRule("."+K.name+" {"+K.style+"}",this.styleSheet.sheet.cssRules.length),K},le.prototype.addRule=function(K){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(K),this.styleSheet.sheet.insertRule(K.selector+" {"+K.style+"}",this.styleSheet.sheet.cssRules.length)},le.prototype.addStyleSheet=function(){var K;this.styleSheet=document.createElement("style"),((K=this.styleSheetRoot)!==null&&K!==void 0?K:document.head).appendChild(this.styleSheet),this.addRule(new jt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new jt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new jt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new kt("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new kt("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},le.prototype.removeStyleSheet=function(){var K;this.styleSheet&&(((K=this.styleSheetRoot)!==null&&K!==void 0?K:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},le}(),jt=function(le,K){this.selector=le,this.style=K},kt=function(le,K){this.localName=le,this.style=K},hr=function(){function le(){this.blocks=[],this.display=""}return le.prototype.addButtonBlock=function(K){K.className=this.blockClassName,K.buttonClassName=this.buttonClassName,K.buttonColorsClassName=this.buttonColorsClassName,K.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(K)},le.prototype.addElementBlock=function(K){K.className===void 0&&(K.className=this.blockClassName),this.blocks.push(K)},le.prototype.getUI=function(){var K=document.createElement("div");return K.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,K.style.display=this.display,this.blocks.forEach(function(X){return K.appendChild(X.getUI())}),K},le}(),Nn=function(){function le(){}return le.prototype.getUI=function(){var K=document.createElement("div");if(K.className=this.className,this.minWidth!==void 0&&(K.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":K.style.justifyContent="flex-start";break;case"center":K.style.justifyContent="center";break;case"end":K.style.justifyContent="flex-end"}return K.style.whiteSpace="nowrap",K},le}(),Ct=function(le){function K(){var X=le!==null&&le.apply(this,arguments)||this;return X.buttons=[],X}return rr(K,le),K.prototype.addButton=function(X){X.className=this.buttonClassName,X.colorsClassName=this.buttonColorsClassName,X.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(X)},K.prototype.getUI=function(){var X=le.prototype.getUI.call(this);return this.buttons.forEach(function(ee){return X.appendChild(ee.getUI())}),X},K}(Nn),Dt=function(){function le(K,X){this._isActive=!1,this._isHidden=!1,this._icon=K,this.title=X,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(le.prototype,"icon",{get:function(){return this._icon},set:function(K){this._icon=K,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isActive",{get:function(){return this._isActive},set:function(K){this._isActive=K,this.adjustClassName()},enumerable:!1,configurable:!0}),le.prototype.getUI=function(){var K=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 K.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},le.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,"")))},le.prototype.hide=function(){this._isHidden=!0},le}(),wt=function(le){function K(){var X=le!==null&&le.apply(this,arguments)||this;return X.elements=[],X}return rr(K,le),K.prototype.addElement=function(X){this.elements.push(X)},K.prototype.getUI=function(){var X=le.prototype.getUI.call(this);return this.elements.forEach(function(ee){return X.appendChild(ee)}),X},K}(Nn),wr=function(){function le(K,X){this.horizontal=K,this.vertical=X}return Object.defineProperty(le.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),le.prototype.getVerticalLength=function(K){return K/this.ratio},le.prototype.getHorizontalLength=function(K){return K*this.ratio},le}(),Cr=function(){function le(){}return le.getIcon=function(K,X){if(K>0&&X>0){var ee=new wr(K,X),me=ee.ratio>=1?20:ee.getHorizontalLength(20),ae=ee.ratio<1?20:ee.getVerticalLength(20),Ke=document.createElementNS("http://www.w3.org/2000/svg","svg");Ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ke.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ke);var pt=dt.createDefs();Ke.appendChild(pt);var Ot=dt.createElement("clipPath",[["id","text-bg-clip"]]);pt.appendChild(Ot);var Ht=dt.createPath(dt.getHollowRectanglePath((24-me)/2,(24-ae)/2,me,ae,(24-me)/2+2,(24-ae)/2+2,me-4,ae-4));Ke.appendChild(Ht);var vt=dt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);vt.appendChild(dt.createTSpan(K+":"+X)),Ke.appendChild(vt);var Xt=vt.getBBox();dt.setAttributes(vt,[["x",((24-Xt.width)/2).toString()],["y",((24-Xt.height)/2-Xt.y).toString()]]);var qt=dt.createPath(dt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Xt.width))/2,(24-Math.ceil(Xt.height))/2,Math.ceil(Xt.width),Math.ceil(Xt.height)));return Ot.appendChild(qt),dt.setAttributes(Ht,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ke),Ke.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>'},le}(),Jt=function(le){function K(X,ee,me){var ae=le.call(this,X,ee)||this;return ae.isDropdownOpen=!1,ae.onClick=ae.dropdownButtonClicked,ae.dropdownButtons=me,ae}return rr(K,le),K.prototype.setupDropdown=function(){var X=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ee){ee.className=X.className,ee.colorsClassName=X.colorsClassName,X.dropdownBlock.appendChild(ee.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},K.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},K.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},K.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},K.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},K.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},K}(Dt),Ut=function(){function le(K,X){this.GRIP_SIZE=10,this.color=K,this.fillColor=X,this.visual=dt.createGroup(),this.visual.appendChild(dt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(dt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return le.prototype.ownsTarget=function(K){return K===this.visual||K===this.visual.childNodes[0]||K===this.visual.childNodes[1]},le.prototype.setCenter=function(K,X){this.visual.childNodes.forEach(function(ee){return dt.setAttributes(ee,[["cx",K.toString()],["cy",X.toString()]])})},le}(),Or=function(){function le(K,X,ee,me){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=K,this.canvasHeight=X,this.margin=ee,this.container=me,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(le.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(K){this._aspectRatio=K,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(K){this._isGridVisible=K,this.gridContainer&&dt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(K){this._zoomFactor=K,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),le.prototype.open=function(){var K=this;this.cropShadeElement=dt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=dt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var X=0;X<this.numberOfGridLines;X++)this.horizontalGridLines.push(dt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(dt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ee){return K.gridContainer.appendChild(ee)}),this.verticalGridLines.forEach(function(ee){return K.gridContainer.appendChild(ee)}),this.cropRectElement=dt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ut(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},le.prototype.setCropRectangle=function(K){this.cropRect=K;var X=Object.assign({},this.cropRect);this.zoomFactor!==1&&(X.width=this.cropRect.width*this.zoomFactor,X.height=this.cropRect.height*this.zoomFactor,X.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-X.width/2,X.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-X.height/2),dt.setAttributes(this.cropRectElement,[["x",X.x.toString()],["y",X.y.toString()],["width",X.width.toString()],["height",X.height.toString()]]);var ee=X.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ae,Ke){var pt=X.y+ee*(Ke+1);dt.setAttributes(ae,[["x1",""+X.x],["y1",""+pt],["x2",""+(X.x+X.width)],["y2",""+pt]])});var me=X.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ae,Ke){var pt=X.x+me*(Ke+1);dt.setAttributes(ae,[["x1",""+pt],["y1",""+X.y],["x2",""+pt],["y2",""+(X.y+X.height)]])}),dt.setAttributes(this.cropShadeElement,[["d",dt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,X.x,X.y,X.width,X.height)]]),this.topLeftGrip.setCenter(X.x,X.y),this.topRightGrip.setCenter(X.x+X.width,X.y),this.bottomLeftGrip.setCenter(X.x,X.y+X.height),this.bottomRightGrip.setCenter(X.x+X.width,X.y+X.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},le.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)},le.prototype.clientToLocalCoordinates=function(K,X){var ee=this.container.getBoundingClientRect();return{x:K-ee.left+this.margin,y:X-ee.top+this.margin}},le.prototype.onPointerDown=function(K){this.container.setPointerCapture(K.pointerId),this.previousPoint=this.clientToLocalCoordinates(K.clientX,K.clientY),this.cropRectElement===K.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(K.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(K.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(K.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(K.target)&&(this.activeGrip=this.bottomRightGrip)},le.prototype.onPointerMove=function(K){if(this.isMoving)this.move(this.clientToLocalCoordinates(K.clientX,K.clientY));else if(this.activeGrip){var X=this.clientToLocalCoordinates(K.clientX,K.clientY);this.resize(X)}K.preventDefault()},le.prototype.onPointerUp=function(K){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(K.pointerId)},le.prototype.move=function(K){var X=K.x-this.previousPoint.x,ee=K.y-this.previousPoint.y;this.zoomFactor!==1&&(X=-X/this.zoomFactor,ee=-ee/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+X),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ee),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=K},le.prototype.resize=function(K){var X=Object.assign({},this.cropRect),ee=K.x-this.previousPoint.x,me=K.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:X.x+ee<this.margin&&(ee=this.margin-X.x),X.x+=ee,X.width=this.cropRect.x+this.cropRect.width-X.x;break;case this.bottomRightGrip:case this.topRightGrip:X.width+ee>this.canvasWidth*this.zoomFactor&&(ee=this.canvasWidth*this.zoomFactor-X.width),X.width+=ee}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(X.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ee),X.height=this.aspectRatio.getVerticalLength(X.width)):(X.y+=me,X.height=this.cropRect.y+this.cropRect.height-X.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?X.height=this.aspectRatio.getVerticalLength(X.width):X.height+=me}X.width<10&&(X.x=this.cropRect.x,X.width=10),X.height<10&&(X.y=this.cropRect.y,X.height=10),this.previousPoint=K,X.x>=this.margin&&X.y>=this.margin&&X.x-this.margin+X.width<=this.canvasWidth&&X.y-this.margin+X.height<=this.canvasHeight&&(this.cropRect=X,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},le.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var K=this.cropRect.x+this.cropRect.width/2,X=this.cropRect.y+this.cropRect.height/2,ee=this.aspectRatio.getHorizontalLength(this.cropRect.height),me=this.aspectRatio.getVerticalLength(this.cropRect.width);ee/this.canvasWidth<me/this.canvasHeight?this.cropRect.width=ee:this.cropRect.height=me,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=K-this.cropRect.width/2,this.cropRect.y=X-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)}},le.prototype.getRescaledRect=function(K,X,ee,me,ae,Ke){var pt=ee/K,Ot=me/X;return{x:(ae.x-Ke)*pt+Ke,y:(ae.y-Ke)*Ot+Ke,width:ae.width*pt,height:ae.height*Ot}},le.prototype.scaleCanvas=function(K,X){var ee=this.getRescaledRect(this.canvasWidth,this.canvasHeight,K,X,this.cropRect,this.margin);this.canvasWidth=K,this.canvasHeight=X,this.onCropChange&&this.onCropChange(ee),this.setCropRectangle(ee)},le}(),un=function(){function le(K){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=K,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(le.prototype,"angle",{get:function(){return this._angle},set:function(K){this._angle=K,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),le.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},le.prototype.onPointerDown=function(K){this.controlContainer.setPointerCapture(K.pointerId),this.isDragging=!0,this.previousPoint={x:K.clientX,y:K.clientY}},le.prototype.onPointerMove=function(K){this.isDragging&&(this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.previousPoint.x=K.clientX)},le.prototype.onPointerUp=function(K){this.isDragging&&this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(K.pointerId)},le.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var K=this.angleLabelText.getBBox();dt.setAttributes(this.angleLabelElement,[["x",((this.width-K.width)/2).toString()],["y",(this.height/2).toString()]])}},le.prototype.positionScaleShape=function(){if(this.scaleShape){var K=this.scaleShape.transform.baseVal.getItem(0);K.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(K,0)}},le.prototype.getVisual=function(){var K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("xmlns","http://www.w3.org/2000/svg"),K.setAttribute("width",this.width+"px"),K.setAttribute("height",this.height+"px"),K.setAttribute("viewBox","0 0 "+this.width+" "+this.height),K.style.flexShrink="0",document.body.appendChild(K);for(var X="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ee=1;ee<=this.width/5+10;ee++){var me=ee%5==0?this.height/3:this.height/6;X+="h4v"+-me+"h1v"+me}X+="v1H0Z",this.scaleShape=dt.createPath(X);var ae=dt.createTransform();this.scaleShape.transform.baseVal.appendItem(ae),K.appendChild(this.scaleShape),this.angleLabelElement=dt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=dt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ke=dt.createTSpan("");return Ke.innerHTML="°",this.angleLabelElement.appendChild(Ke),K.appendChild(this.angleLabelElement),document.body.removeChild(K),K},le}(),Nr=function(){function le(){this.naturalSize=!1,this.imageType="image/png"}return le.prototype.rasterize=function(K,X,ee,me,ae,Ke,pt){var Ot=this;return new Promise(function(Ht){var vt=document.createElement("canvas");vt.width=K.width.baseVal.value-2*me,vt.height=K.height.baseVal.value-2*me;var Xt=1,qt=1;Ot.naturalSize===!0?(Xt=X.naturalWidth/(K.width.baseVal.value-2*me)/Ke,qt=X.naturalHeight/(K.height.baseVal.value-2*me)/pt,vt.width=X.naturalWidth/Ke,vt.height=X.naturalHeight/pt):Ot.width!==void 0&&Ot.height!==void 0&&(Xt=Ot.width/ee.width,qt=Ot.height/ee.height,vt.width*=Xt,vt.height*=qt);var Hr=vt.getContext("2d");Hr.translate(vt.width/2,vt.height/2),Hr.rotate(ae*Math.PI/180),Hr.scale(Ke,pt),Hr.translate(-vt.width/2,-vt.height/2),Hr.drawImage(X,0,0,vt.width,vt.height);var nn=document.createElement("canvas");nn.width=ee.width*Xt,nn.height=ee.height*qt,nn.getContext("2d").putImageData(Hr.getImageData((ee.x-me)*Xt,(ee.y-me)*qt,ee.width*Xt,ee.height*qt),0,0),Ht(nn.toDataURL(Ot.imageType,Ot.imageQuality))})},le}(),bt=function(){function le(K){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=le.instanceCounter++,this.styles=new Et(this.instanceNo),this.target=K,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(le.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(K){this._zoomToCropEnabled=K,K?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(K){this._isGridVisible=K,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"gridLines",{get:function(){return this._gridLines},set:function(K){this._gridLines=K,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(K){this._rotationAngle=K,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"aspectRatio",{get:function(){var K;return(K=this._aspectRatio)!==null&&K!==void 0?K:this.aspectRatios[0]},set:function(K){this._aspectRatio=K},enumerable:!1,configurable:!0}),le.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},le.prototype.show=function(){this.showUI(),this.open()},le.prototype.close=function(K){K===void 0&&(K=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),K||this.closeEventListeners.forEach(function(X){return X()}),this._isOpen=!1)},le.prototype.addRenderEventListener=function(K){this.renderEventListeners.push(K)},le.prototype.removeRenderEventListener=function(K){this.renderEventListeners.indexOf(K)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(K),1)},le.prototype.addCloseEventListener=function(K){this.closeEventListeners.push(K)},le.prototype.removeCloseEventListener=function(K){this.closeEventListeners.indexOf(K)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(K),1)},le.prototype.setupResizeObserver=function(){var K=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){K.resize(K.target.clientWidth,K.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))},le.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var K=1*this.target.clientWidth/this.target.clientHeight,X=this.contentDiv.clientWidth/K>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*K:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ee=X+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/K;this.resize(X,ee)}},le.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},le.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",dt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},le.prototype.resize=function(K,X){this.imageWidth=Math.round(K),this.imageHeight=Math.round(X),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()},le.prototype.setEditingTarget=function(){var K=document.createElement("canvas");K.width=this.target.naturalWidth,K.height=this.target.naturalHeight,K.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var X=K.toDataURL();dt.setAttributes(this.editingTarget,[["href",X]]),this.setEditingTargetSize()},le.prototype.setTopLeft=function(){var K=this.target.getBoundingClientRect(),X=this.editorCanvas.getBoundingClientRect();this.left=K.left-X.left-this.CANVAS_MARGIN,this.top=K.top-X.top-this.CANVAS_MARGIN},le.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=dt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=dt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=dt.createGroup(),this.editingTargetRotationScaleContainer=dt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var K=dt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(K);var X=dt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(X),this.editingTargetContainer=dt.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)},le.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},le.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=dt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Or(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()},le.prototype.zoomToCrop=function(){if(this.cropRect){var K=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,X=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=K+"px "+X+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-K+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-X+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},le.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)},le.prototype.cropRectChanged=function(K){this.cropRect=K,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},le.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},le.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"},le.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},le.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 K=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,X=this.target.offsetTop>K+this.CANVAS_MARGIN?this.target.offsetTop-(K+this.CANVAS_MARGIN):0;this.coverDiv.style.top=X+"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},le.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},le.prototype.addTopToolbar=function(){var K=this;this.topToolbar=new hr,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 X=new Ct;X.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(X);var ee=[];this.aspectRatios.forEach(function(qt){var Hr=new Dt(Cr.getIcon(qt.horizontal,qt.vertical),qt.horizontal===0&&qt.vertical===0?"FREE":qt.horizontal+":"+qt.vertical);Hr.onClick=function(){return K.ratioButtonClicked(qt)},ee.push(Hr)}),this.aspectRatioButton=new Jt(Cr.getIcon(0,0),"Aspect ratio",ee),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,X.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var me=new Dt('<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");me.isActive=this.isGridVisible,me.onClick=function(){K.isGridVisible=!K.isGridVisible,me.isActive=K.isGridVisible},X.addButton(me);var ae=new Dt('<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(ae.isActive=this.zoomToCropEnabled,ae.onClick=function(){K.zoomToCropEnabled=!K.zoomToCropEnabled,ae.isActive=K.zoomToCropEnabled},X.addButton(ae),!nr.isLicensed){var Ke=new wt;this.topToolbar.addElementBlock(Ke);var pt=document.createElement("div");pt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ot=document.createElement("a");Ot.style.color="currentColor",Ot.href="https://markerjs.com/products/cropro",Ot.target="_blank",Ot.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>',pt.appendChild(Ot),Ke.addElement(pt)}var Ht=new Ct;Ht.minWidth=3*this.toolbarHeight+"px",Ht.contentAlign="end",this.topToolbar.addButtonBlock(Ht);var vt=new Dt('<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");vt.onClick=this.startRenderAndClose,Ht.addButton(vt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(vt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Xt=new Dt('<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");Xt.onClick=this.close,Ht.addButton(Xt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Xt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},le.prototype.addBottomToolbar=function(){var K=this;this.bottomToolbar=new hr,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 X=new Ct;X.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(X);var ee=new Dt('<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");ee.onClick=this.rotateLeftButtonClicked,X.addButton(ee);var me=new Dt('<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");me.onClick=this.rotateRightButtonClicked,X.addButton(me);var ae=new wt;ae.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ae),this.straightener=new un("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(Ht){K.rotateBy(Ht),K.straightener.angle=K.rotationAngle},ae.addElement(this.straightener.getUI());var Ke=new Ct;Ke.minWidth=2*this.toolbarHeight+"px",Ke.contentAlign="end",this.bottomToolbar.addButtonBlock(Ke);var pt=new Dt('<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");pt.onClick=this.flipHorizontallyButtonClicked,Ke.addButton(pt);var Ot=new Dt('<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");Ot.onClick=this.flipVerticallyButtonClicked,Ke.addButton(Ot)},le.prototype.ratioButtonClicked=function(K){this.aspectRatio=K,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},le.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Cr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},le.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new wr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},le.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},le.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},le.prototype.restoreState=function(K){if(K){var X=this.cropLayer.getRescaledRect(K.width,K.height,this.imageWidth,this.imageHeight,K.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(X),this.cropRectChanged(X),this.flippedHorizontally=K.flippedHorizontally,this.flippedVertically=K.flippedVertically,this.applyFlip(),this.rotationAngle=K.rotationAngle,this.applyRotation()}},le.prototype.clientToLocalCoordinates=function(K,X){var ee=this.cropImage.getBoundingClientRect();return{x:K-ee.left,y:X-ee.top}},le.prototype.onWindowResize=function(){this.positionUI()},le.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var K=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=K+"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()},le.prototype.rotateLeftButtonClicked=function(){var K=this.rotationAngle-90;this.rotationAngle%90!=0&&(K+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(K)},le.prototype.rotateRightButtonClicked=function(){var K=this.rotationAngle+90;this.rotationAngle%90!=0&&(K-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(K)},le.prototype.rotateTo=function(K){K=(K=K>180?K-360:K)<=-180?K+360:K,this.rotationAngle=K,this.applyRotation()},le.prototype.rotateBy=function(K){this.rotateTo((this.rotationAngle+K)%360)},le.prototype.applyRotation=function(){var K=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var X=this.editingTargetRotationContainer.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(X,0);var ee=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ee.width,this.imageHeight/ee.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=K},le.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},le.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},le.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},le.prototype.startRenderAndClose=function(){return Wt(this,void 0,void 0,function(){var K,X;return Lt(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return K=ee.sent(),X=this.getState(),this.renderEventListeners.forEach(function(me){return me(K,X)}),this.close(!0),[2]}})})},le.prototype.render=function(){return Wt(this,void 0,void 0,function(){var K;return Lt(this,function(X){switch(X.label){case 0:return(K=new Nr).naturalSize=this.renderAtNaturalSize,K.imageType=this.renderImageType,K.imageQuality=this.renderImageQuality,K.width=this.renderWidth,K.height=this.renderHeight,this.unzoomFromCrop(),dt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,K.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 X.sent(),[4,K.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,X.sent()]}})})},le.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new kt("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 kt("toolbar_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new kt("toolbar-block",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
box-sizing: content-box;
|
|
|
`));var K=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new kt("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.toolbarHeight-2*K)+`px;
|
|
|
height: `+(this.toolbarHeight-2*K)+`px;
|
|
|
padding: `+K+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new kt("toolbar_button_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new kt("toolbar_active_button",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
|
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new kt("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 kt("toolbar_dropdown_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new kt("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 kt("toolbar_straightener",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
height: `+(this.toolbarHeight-2*K)+`px;
|
|
|
padding: `+K+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new kt("toolbar_straightener_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`))},le.instanceCounter=0,le}(),Bt=j("8hTe"),Jr=j.n(Bt),on=/<pre[^>]*>/g;function Ln(le){var K=document.createElement("div");return K.innerHTML=le,K.childNodes.length===0?"":K.childNodes[0].nodeValue}var Sn=Q.a=function(le){var K=le.value,X=K===void 0?"":K,ee=le.edit,me=ee===void 0?!1:ee,ae=le.className,Ke=le.showTextOnly,pt=le.showLines,Ot=le.replaces,Ht=le.zoomImg,vt=le.hasMask,Xt=le.style,qt=Xt===void 0?{}:Xt,Hr=le.stylesPrev,nn=Hr===void 0?{}:Hr,zr=String(X),or=Object(d.useRef)(),Qr=Object(d.useRef)(),Cn=Object(d.useState)(""),zt=Object(S.a)(Cn,2),pr=zt[0],fr=zt[1],jr=Object(d.useState)("office"),Er=Object(S.a)(jr,2),li=Er[0],On=Er[1],Ui=function(){var cr=new bt(Qr.current);cr.displayMode="popup",cr.addRenderEventListener(function(){var tn=Object(m.a)(p.a.mark(function br(hn){var Fr;return p.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return or.current.style.display="none",_n.next=3,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hn}});case 3:Fr=_n.sent,Fr!=null&&Fr.id&&Ot(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Fr==null?void 0:Fr.id,"?type=").concat(Fr.content_type));case 5:case"end":return _n.stop()}},br)}));return function(br){return tn.apply(this,arguments)}}()),cr.show()},Bi=function(){var cr=new Kt(Qr.current);cr.settings.displayMode="popup",cr.addEventListener("render",function(){var tn=Object(m.a)(p.a.mark(function br(hn){var Fr;return p.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:if(or.current.style.display="none",!Qr.current){_n.next=6;break}return _n.next=4,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hn.dataUrl}});case 4:Fr=_n.sent,Fr!=null&&Fr.id&&Ot(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Fr==null?void 0:Fr.id,"?type=").concat(Fr.content_type));case 6:case"end":return _n.stop()}},br)}));return function(br){return tn.apply(this,arguments)}}()),cr.show(),window.markerArea=cr},qn=Object(d.useMemo)(function(){or.current&&(or.current.style.zIndex=-1);try{var Zr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,cr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,tn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;zr=zr.replace(Zr,"("+$.a.API_SERVER+"/api/attachments/").replace(cr,'"'+$.a.API_SERVER+"/api/attachments/").replace(tn,'"'+$.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(mi){}var br=G(zr),hn=M();if(zr.match(/\[TOC\]/)&&(br=br.replace("<p>[TOC]</p>",R()),w()),br=br.replace(/(__special_katext_id_\d+__)/g,function(mi,_n){var Un=hn[_n],Di=Un.type,ui=Un.expression;return Object(re.renderToString)(Ln(ui)||"",{displayMode:Di==="block",throwOnError:!1,output:"html"})}),br=br.replace(/▁/g,"\u2581\u2581\u2581"),L(),Ke){var Fr=document.createElement("div");return Fr.innerHTML=br,Fr.innerText}return setTimeout(function(){return dn()},500),br},[zr]),sn=Object(d.useRef)();_.WebkitLineClamp=pt,pt&&(qt=Object(y.a)(Object(y.a)({},qt),_));function Si(Zr){var cr=Zr.target;if(cr.tagName.toUpperCase()==="IMG"){if(Ht){var tn=cr.getAttribute("src");fr(tn),On("image")}}else if(cr.tagName.toUpperCase()==="A"){var br=cr.getAttribute("href");if(br.indexOf("office")>-1)Zr.preventDefault(),fr(br),On("office");else if(br.indexOf("application/pdf")>-1)Zr.preventDefault(),fr(br),On("pdf");else if(br.indexOf("text/html")>-1)Zr.preventDefault(),fr(br),On("html");else if(br.startsWith("#")){Zr.preventDefault();var hn=document.getElementById(br.replace("#",""));hn&&hn.scrollIntoView(!0)}}}var dn=function(){var cr,tn=(cr=sn.current)===null||cr===void 0?void 0:cr.querySelectorAll("video");tn==null||tn.forEach(function(br){if(br.oncontextmenu=function(){return!1},br.src.indexOf(".m3u8")>-1&&!br.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var hn=new H.a;hn.loadSource(br.src),hn.attachMedia(br)}}})};Object(d.useEffect)(function(){if(sn.current&&qn&&(qn.match(on)&&window.PR.prettyPrint()),sn.current)return sn.current.addEventListener("click",Si),function(){sn.current.removeEventListener("click",Si),L(),w()}},[qn,sn.current,Si]);var Yn=function(cr){if(!me)return;cr.target.nodeName==="IMG"?(or.current.style.zIndex=1,or.current.style.display="flex",or.current.style.width=cr.target.clientWidth+"px",or.current.style.height=cr.target.clientHeight+"px",or.current.style.top=cr.target.offsetTop+"px",or.current.style.left=cr.target.offsetLeft+"px",Qr.current.src=cr.target.getAttribute("src")):or.current.style.display="none"};return t.a.createElement("div",{style:{position:"relative"}},t.a.createElement("div",{ref:sn,style:Object(y.a)({},qt),className:"".concat(ae||""," markdown-body ").concat(Jr.a.mdBody),onMouseOver:Yn,dangerouslySetInnerHTML:{__html:qn}}),t.a.createElement("div",{ref:or,className:Jr.a.button},t.a.createElement(v.a,null,t.a.createElement(k.a,{onClick:function(){return Ui()}},"\u88C1\u526A"),t.a.createElement(k.a,{onClick:function(){return Bi()}},"\u7F16\u8F91"))),t.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),t.a.createElement(te.a,{close:!0,data:pr,type:pr!=null&&pr.length?li:"",style:Object(y.a)({},nn),onClose:function(){return fr("")}}))}},"9OqN":function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.mode.CTR=function(){var v=N.lib.BlockCipherMode.extend(),C=v.Encryptor=v.extend({processBlock:function(k,y){var m=this._cipher,S=m.blockSize,b=this._iv,p=this._counter;b&&(p=this._counter=b.slice(0),this._iv=void 0);var d=p.slice(0);m.encryptBlock(d,0),p[S-1]=p[S-1]+1|0;for(var t=0;t<S;t++)k[y+t]^=d[t]}});return v.Decryptor=C,v}(),N.mode.CTR})},"9VGf":function(F,Q,j){"use strict";j.d(Q,"a",function(){return C});var N=j("cDcd"),v=j.n(N);function C(k,y){var m=Object(N.useRef)();Object(N.useEffect)(function(){m.current=k}),Object(N.useEffect)(function(){function S(){m.current()}if(y!==null){var b=setInterval(S,y);return function(){return clearInterval(b)}}},[y])}},ALsQ:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.mode.CFB=function(){var v=N.lib.BlockCipherMode.extend();v.Encryptor=v.extend({processBlock:function(k,y){var m=this._cipher,S=m.blockSize;C.call(this,k,y,S,m),this._prevBlock=k.slice(y,y+S)}}),v.Decryptor=v.extend({processBlock:function(k,y){var m=this._cipher,S=m.blockSize,b=k.slice(y,y+S);C.call(this,k,y,S,m),this._prevBlock=b}});function C(k,y,m,S){var b,p=this._iv;p?(b=p.slice(0),this._iv=void 0):b=this._prevBlock,S.encryptBlock(b,0);for(var d=0;d<m;d++)k[y+d]^=b[d]}return v}(),N.mode.CFB})},B7Ph:function(F,Q,j){"use strict";j.d(Q,"a",function(){return re});var N=j("5NDa"),v=j("5rEg"),C=j("sRBo"),k=j("kaz8"),y=j("5Dmo"),m=j("3S7+"),S=j("14J3"),b=j("BMrR"),p=j("7Kak"),d=j("9yH6"),t=j("+L6B"),l=j("2/Rp"),r=j("2qtc"),i=j("kLXV"),o=j("miYZ"),s=j("tsqr"),c=j("k1fw"),a=j("9og8"),u=j("tJVT"),f=j("oBTY"),w=j("DZo9"),_=j("8z0m"),h=j("WmNS"),R=j.n(h),O=j("cDcd"),g=j.n(O),x=j("Bvq2"),E=j.n(x),T=j("nj2k"),M=j.n(T),L=j("mxV5"),A=j.n(L),V=j("KhGG"),z=j("ErOA"),W=j("7Cbv"),G=j("1vsH"),U=j("p5ED"),P=_.a.Dragger,H=function(ge){for(var ve=function(Oe){return Oe&&Oe.substring(0,Oe.lastIndexOf("."))},de=Object(f.a)(ge),De=0,Te=[],he=0;he<de.length;he++){for(var ue="",ie=0;ie<Te.length;ie++)if(ve(Te[ie][0].name)==ve(de[he].name)){De=1,ue=ie;break}if(De==1)Te[ue].push(de[he]),De=0;else if(De==0){var Se=new Array;Se.push(de[he]),Te.push(Se)}}var ne=Te.map(function(ce){if(ce[0].name.includes(".in"))return ce.length===2?ce:[ce[0],{}];if(ce[0].name.includes(".out"))return ce.length===2?ce.reverse():[{},ce[0]]});return ne},$=function(ge){var ve=ge.onClose,de=ge.onOK,De=ge.visible,Te=ge.wrapClassName,he=ge.rootIdentifier,ue=ge.multiple,ie=ue===void 0?!1:ue,Se=ge.defaultMultipleValue,ne=Se===void 0?!0:Se,ce=Object(O.useState)([]),Oe=Object(u.a)(ce,2),oe=Oe[0],q=Oe[1],Y=Object(O.useState)({}),Z=Object(u.a)(Y,2),ye=Z[0],be=Z[1],Re=Object(O.useState)(!1),Qe=Object(u.a)(Re,2),rt=Qe[0],at=Qe[1],qe=Object(O.useState)(!0),st=Object(u.a)(qe,2),lt=st[0],je=st[1],Ie=Object(O.useState)(null),tt=Object(u.a)(Ie,2),ot=tt[0],ze=tt[1],Ze=Object(O.useRef)([]),Ne=Object(O.useRef)(0),Ae=function(){ve()};Object(O.useEffect)(function(){Me()},[]),Object(O.useEffect)(function(){De&&(Ze.current=[],Ne.current=0,q([]),je(ne))},[De]);var Me=function(){var yt=Object(a.a)(R.a.mark(function ft(){var mt,It;return R.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.prev=0,_t.next=3,Object(z.a)("/api/buckets/get_upload_token_for_big_files",{method:"get"});case 3:mt=_t.sent,(mt==null?void 0:mt.status)===0&&(mt!=null&&mt.is_oss?(It=JSON.parse(Object(V.a)(mt.data)),be(It),ze(!1)):ze(!0)),_t.next=9;break;case 7:_t.prev=7,_t.t0=_t.catch(0);case 9:case"end":return _t.stop()}},ft,null,[[0,7]])}));return function(){return yt.apply(this,arguments)}}(),Ee=function(ft){return ft&&ft.substring(0,ft.lastIndexOf("."))},Ce=function(ft){var mt,It,At=Ee((mt=ft[0])===null||mt===void 0?void 0:mt.name)||Ee((It=ft[1])===null||It===void 0?void 0:It.name),_t=oe.filter(function(Vt){return Ee(Vt.name)!==At});Ze.current=Object(f.a)(_t),q(Object(f.a)(_t))},ke=function(ft){if(!lt){var mt=new FormData;mt.append("file",ft.file);var It=Object(z.a)("/api/attachments/get_file_content.json",{method:"post",body:mt},!0);It.then(function(Lt){if(Lt.status===0){Ne.current=Ne.current+1;var nr=Ze.current.map(function(Et){if(Et.name===ft.name){var jt,kt=Object(c.a)({},Et);return ft!=null&&(jt=ft.name)!==null&&jt!==void 0&&jt.includes(".in")?kt.input=Lt==null?void 0:Lt.content:kt.output=Lt==null?void 0:Lt.content,kt}return Et});if(Ze.current=Object(f.a)(nr),q(Object(f.a)(nr)),Ne.current>0&&Ne.current===oe.length){at(!1);var dt=H(nr);dt=dt.filter(function(Et){var jt,kt;return!!((jt=Et[0])!==null&&jt!==void 0&&jt.name&&(kt=Et[1])!==null&&kt!==void 0&&kt.name)}),dt=dt.map(function(Et){return Object(c.a)(Object(c.a)(Object(c.a)({},Et[0]),Et[1]),{},{is_file:!1})}),de(dt),ve()}}else at(!1),ve()});return}if(ot){var At=new FormData;At.append("file",ft.file),At.append("identifier",he);var _t=Object(z.a)("/api/attachments.json",{method:"post",body:At},!0);_t.then(function(Lt){if(Lt.filename){Ne.current=Ne.current+1;var nr=Ze.current.map(function(Et){if(Et.name===(Lt==null?void 0:Lt.filename)){var jt,kt=Object(c.a)(Object(c.a)({},Et),{},{is_oss:!ot});return Lt!=null&&(jt=Lt.filename)!==null&&jt!==void 0&&jt.includes(".in")?(kt.in_object_key=Lt==null?void 0:Lt.object,kt.in_object_size=Lt==null?void 0:Lt.size,kt.input=Lt==null?void 0:Lt.filename,kt.in_file=ft):(kt.out_object_key=Lt==null?void 0:Lt.object,kt.out_object_size=Lt==null?void 0:Lt.size,kt.output=Lt==null?void 0:Lt.filename,kt.out_file=ft),kt}return Et});if(Ze.current=Object(f.a)(nr),q(Object(f.a)(nr)),Ne.current>0&&Ne.current===oe.length){at(!1);var dt=H(nr);dt=dt.filter(function(Et){var jt,kt;return!!((jt=Et[0])!==null&&jt!==void 0&&jt.name&&(kt=Et[1])!==null&&kt!==void 0&&kt.name)}),dt=dt.map(function(Et){return Object(c.a)(Object(c.a)(Object(c.a)({},Et[0]),Et[1]),{},{is_file:!0})}),de(dt),ve()}}else at(!1),ve()});return}var Vt=new A.a({endpoint:ye.end_point,region:ye.region,accessKeyId:ye.access_key_id,accessKeySecret:ye.access_key_secret,bucket:ye.bucket,stsToken:ye.security_token}),Kt=ft.name,tr={container_type:"TestSet",file_name:Kt},rr=Object(W.a)(),Wt="testsets/".concat(he,"/").concat(rr).concat(Kt.indexOf(".")>-1?"."+Kt.split(".").pop():"");he===null&&(Wt="testsets/".concat(rr).concat(Kt.indexOf(".")>-1?"."+Kt.split(".").pop():"")),Vt.multipartUpload(Wt,new Blob([ft.file],{type:ft.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:Kt+""},url:ye==null?void 0:ye.callback_url,host:ye==null?void 0:ye.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(z.e)(tr)}}).then(function(Lt){if(Lt.data.status===0){Ne.current=Ne.current+1;var nr=Ze.current.map(function(Et){var jt,kt;if(Et.name===((jt=Lt.data)===null||jt===void 0||((kt=jt.data)===null||kt===void 0)?void 0:kt.file_name)){var hr,Nn,Ct,Dt=Object(c.a)(Object(c.a)({},Et),{},{is_oss:!ot});if((hr=Lt.data)!==null&&hr!==void 0&&(Nn=hr.data)!==null&&Nn!==void 0&&(Ct=Nn.file_name)!==null&&Ct!==void 0&&Ct.includes(".in")){var wt,wr,Cr,Jt,Ut,Or;Dt.in_object_key=(wt=Lt.data)===null||wt===void 0||((wr=wt.data)===null||wr===void 0)?void 0:wr.object,Dt.in_object_size=(Cr=Lt.data)===null||Cr===void 0||((Jt=Cr.data)===null||Jt===void 0)?void 0:Jt.size,Dt.input=(Ut=Lt.data)===null||Ut===void 0||((Or=Ut.data)===null||Or===void 0)?void 0:Or.file_name,Dt.in_file=ft}else{var un,Nr,bt,Bt,Jr,on;Dt.out_object_key=(un=Lt.data)===null||un===void 0||((Nr=un.data)===null||Nr===void 0)?void 0:Nr.object,Dt.out_object_size=(bt=Lt.data)===null||bt===void 0||((Bt=bt.data)===null||Bt===void 0)?void 0:Bt.size,Dt.output=(Jr=Lt.data)===null||Jr===void 0||((on=Jr.data)===null||on===void 0)?void 0:on.file_name,Dt.out_file=ft}return Dt}return Et});if(Ze.current=Object(f.a)(nr),q(Object(f.a)(nr)),Ne.current>0&&Ne.current===oe.length){at(!1);var dt=H(nr);dt=dt.filter(function(Et){var jt,kt;return!!((jt=Et[0])!==null&&jt!==void 0&&jt.name&&(kt=Et[1])!==null&&kt!==void 0&&kt.name)}),dt=dt.map(function(Et){return Object(c.a)(Object(c.a)(Object(c.a)({},Et[0]),Et[1]),{},{is_file:!0})}),de(dt),ve()}}})},Fe=function(ft){return new Promise(function(mt,It){for(var At=0,_t=[],Vt=function(rr){ft[rr].file.slice(0,1).arrayBuffer().then(function(){At++,At===ft.length&&(_t.length?(s.b.warn("".concat(_t.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),It()):mt(ft))}).catch(function(Wt){console.log("\u9519\u8BEF\u4FE1\u606F\uFF1A",Wt),At++,_t.push(ft[rr].name),At===ft.length&&(_t.length?(s.b.warn("".concat(_t.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),It()):mt(ft))})},Kt=0;Kt<ft.length;Kt++)Vt(Kt)})},Be=function(){var yt=Object(a.a)(R.a.mark(function ft(){var mt;return R.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(oe.length===0)){At.next=3;break}return s.b.warn("\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6"),At.abrupt("return");case 3:return At.next=5,Fe(oe);case 5:if(at(!0),mt=H(oe),!mt.some(function(_t){var Vt,Kt;return!((Vt=_t[0])!==null&&Vt!==void 0&&Vt.name&&(Kt=_t[1])!==null&&Kt!==void 0&&Kt.name)})){At.next=10;break}return i.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 _t=Object(a.a)(R.a.mark(function Kt(){return R.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:oe.map(function(){var Wt=Object(a.a)(R.a.mark(function Lt(nr){return R.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:ke(nr);case 1:case"end":return Et.stop()}},Lt)}));return function(Lt){return Wt.apply(this,arguments)}}());case 1:case"end":return rr.stop()}},Kt)}));function Vt(){return _t.apply(this,arguments)}return Vt}(),onCancel:function(){at(!1)}}),At.abrupt("return");case 10:oe.map(function(){var _t=Object(a.a)(R.a.mark(function Vt(Kt){return R.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:ke(Kt);case 1:case"end":return rr.stop()}},Vt)}));return function(Vt){return _t.apply(this,arguments)}}());case 11:case"end":return At.stop()}},ft)}));return function(){return yt.apply(this,arguments)}}(),et={name:"file",fileList:oe,multiple:!0,accept:".in, .out",showUploadList:!1,beforeUpload:function(ft){if(oe!=null&&oe.some(function(It){return It.name===ft.name}))return s.b.info("".concat(ft.name,"\u6587\u4EF6\u5DF2\u5B58\u5728")),!1;if(ft.size/1024/1024>100)return s.b.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(ft.name))return s.b.warn("\u8F93\u5165\u6587\u4EF6\u53EA\u80FD\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6"),!1;var mt={name:ft.name,uid:ft.uid,file:ft,percent:0};return oe.push(mt),Ze.current=Object(f.a)(oe),q(Object(f.a)(oe)),!1}},ct=H(oe);return console.log(oe,ct,"fileList"),g.a.createElement(i.a,{visible:De,wrapClassName:Te,onOk:Be,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:rt},onCancel:Ae,width:"1000px",title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},g.a.createElement("div",{className:E.a.wrap},oe.length?g.a.createElement("div",null,g.a.createElement(b.a,{justify:"space-between",align:"middle",className:"mb20"},g.a.createElement("div",{style:{visibility:ie?"visible":"hidden"}},"\u6D4B\u8BD5\u7528\u4F8B\u7C7B\u578B\uFF1A",g.a.createElement(d.a.Group,{className:"ml10",value:lt,onChange:function(ft){return je(ft.target.value)}},g.a.createElement(d.a,{value:!1},"\u6587\u672C"),g.a.createElement(d.a,{value:!0},"\u6587\u4EF6"))),g.a.createElement(_.a,et,g.a.createElement(l.a,{className:E.a.btnS},"\u4E0A\u4F20\u6587\u4EF6"))),g.a.createElement(re,{data:ct,onRemove:Ce})):g.a.createElement("div",{className:E.a.noData},g.a.createElement("img",{src:M.a,alt:""}),g.a.createElement(_.a,et,g.a.createElement(l.a,{className:E.a.btn},"\u4E0A\u4F20\u6587\u4EF6"))),g.a.createElement("div",{className:E.a.text},"\u4E0A\u4F20\u9650\u5236\uFF1A",g.a.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",g.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",g.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",g.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",g.a.createElement("br",null))))},re=function(ge){var ve=ge.data,de=ve===void 0?[]:ve,De=ge.onRemove,Te=ge.width,he=Te===void 0?"auto":Te,ue=ge.showScore,ie=ue===void 0?!1:ue,Se=ge.disabled,ne=Se===void 0?!1:Se,ce=ge.inputChange,Oe=ge.onEvaluatingChange,oe=ge.showEvaluatingSetting,q=oe===void 0?!1:oe,Y={value:"",filename:"",dataUrl:""},Z=Object(O.useState)(Object(c.a)({},Y)),ye=Object(u.a)(Z,2),be=ye[0],Re=ye[1],Qe=function(st){var lt=document.createElement("a");document.body.appendChild(lt);var je=URL.createObjectURL(st.file);lt.href=je,lt.download=st.name,lt.click(),URL.revokeObjectURL(je),document.body.removeChild(lt)},rt=function(st,lt){Object(G.y)(st,lt)},at=function(st,lt){i.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:g.a.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:function(){De(st,lt)},onCancel:function(){}})};return de.length?g.a.createElement("div",{style:{width:he}},g.a.createElement("div",{className:E.a.head},q&&g.a.createElement("div",{style:{width:"10%"}},"\u9690\u85CF",g.a.createElement(m.a,{title:'\u9690\u85CF\u6D4B\u8BD5\u96C6\u53EF\u4EE5\u9632\u6B62\u5B66\u751F\u901A\u8FC7"print"\u7B49\u624B\u6BB5\u76F4\u63A5\u901A\u5173'},g.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),g.a.createElement("div",{style:{width:"20%"}},"\u7528\u4F8B"),g.a.createElement("div",{style:{width:ie?"25%":"35%",padding:"0 12px"}},"\u8F93\u5165"),g.a.createElement("div",{style:{width:ie?"25%":"35%",padding:"0 12px"}},"\u8F93\u51FA"),ie&&g.a.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),q&&g.a.createElement("div",{style:{width:"20%"}},"\u9884\u671F\u8F93\u51FA",g.a.createElement(m.a,{title:"\u52FE\u9009\u540E\uFF0C\u9884\u671F\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"},g.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),q&&g.a.createElement("div",{style:{width:"20%"}},"\u7279\u6B8A\u5224\u5B9A",g.a.createElement(m.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"},g.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),g.a.createElement("div",{style:{width:"10%"}},"\u64CD\u4F5C")),de.map(function(qe,st){var lt,je,Ie,tt;return g.a.createElement("div",{key:st,className:E.a.list},q&&g.a.createElement("div",{style:{width:"10%"}},g.a.createElement(k.a,{checked:!!qe.hidden,onChange:function(ze){Oe(ze.target.checked?1:0,st,"hidden")}})),g.a.createElement("div",{style:{width:"20%"}},"\u6D4B\u8BD5\u7528\u4F8B",st+1),g.a.createElement("div",{className:E.a.info,style:{width:ie?"25%":"35%"}},g.a.createElement("span",{title:qe.input||((lt=qe[0])===null||lt===void 0?void 0:lt.name),onClick:Object(a.a)(R.a.mark(function ot(){var ze,Ze;return R.a.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:if(qe.input?qe.input_file_url?ze=qe.input_file_url:ze=qe.in_file:ze=qe[0],!(typeof ze=="string")){Ae.next=14;break}return Ae.next=4,fetch(ze,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return Ze=Ae.sent,Ae.t0=Re,Ae.next=8,Ze.text();case 8:Ae.t1=Ae.sent,Ae.t2=ze,Ae.t3={value:Ae.t1,filename:"",dataUrl:Ae.t2},(0,Ae.t0)(Ae.t3),Ae.next=18;break;case 14:return Ae.next=16,Object(G.H)(ze.file);case 16:Ze=Ae.sent,Re({value:Ze.text,filename:ze.name,dataUrl:Ze.link});case 18:case"end":return Ae.stop()}},ot)}))},qe.input||((je=qe[0])===null||je===void 0?void 0:je.name))),g.a.createElement("div",{className:E.a.info,style:{width:ie?"25%":"35%"}},g.a.createElement("span",{title:qe.output||((Ie=qe[1])===null||Ie===void 0?void 0:Ie.name),onClick:Object(a.a)(R.a.mark(function ot(){var ze,Ze;return R.a.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:if(qe.input?qe.output_file_url?ze=qe.output_file_url:ze=qe.out_file:ze=qe[1],!(typeof ze=="string")){Ae.next=14;break}return Ae.next=4,fetch(ze,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return Ze=Ae.sent,Ae.t0=Re,Ae.next=8,Ze.text();case 8:Ae.t1=Ae.sent,Ae.t2=ze,Ae.t3={value:Ae.t1,filename:"",dataUrl:Ae.t2},(0,Ae.t0)(Ae.t3),Ae.next=18;break;case 14:return Ae.next=16,Object(G.H)(ze.file);case 16:Ze=Ae.sent,Re({value:Ze.text,filename:ze.name,dataUrl:Ze.link});case 18:case"end":return Ae.stop()}},ot)}))},qe.output||((tt=qe[1])===null||tt===void 0?void 0:tt.name))),ie&&g.a.createElement("div",{style:{width:"20%"}},g.a.createElement(v.a,{disabled:ne,style:{width:"70%"},onChange:function(ze){return ce(ze,st)},value:qe.score}),g.a.createElement("span",null,"\xA0%")),q&&g.a.createElement("div",{style:{width:"20%"}},g.a.createElement(k.a,{checked:qe.is_invisible||!1,onChange:function(ze){Oe(ze.target.checked,st,"is_invisible")},className:"font14"},"\u5BF9\u5B66\u5458\u4E0D\u53EF\u89C1")),q&&g.a.createElement("div",{style:{width:"20%"}},g.a.createElement(k.a,{checked:qe.last_match_rule||!1,onChange:function(ze){Oe(ze.target.checked,st,"last_match_rule")},className:"font14"},"\u672B\u5C3E\u5339\u914D")),g.a.createElement("div",{onClick:function(){return at(qe,st)},style:{width:"10%"}},g.a.createElement("span",{className:E.a.del},"\u5220\u9664")))}),g.a.createElement(U.a,{close:!0,data:be.dataUrl,filename:be.filename,type:be.dataUrl.length?"txt":"",onClose:function(){return Re(Object(c.a)({},Y))},monacoEditor:{value:be.value,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}})):g.a.createElement(g.a.Fragment,null)};Q.b=$},BU3w:function(F,Q,j){"use strict";j.d(Q,"a",function(){return m});var N=j("MNnm"),v="rc-util-key";function C(S){if(S.attachTo)return S.attachTo;var b=document.querySelector("head");return b||document.body}function k(S){var b,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(N.a)())return null;var d=document.createElement("style");if((b=p.csp)===null||b===void 0?void 0:b.nonce){var t;d.nonce=(t=p.csp)===null||t===void 0?void 0:t.nonce}d.innerHTML=S;var l=C(p),r=l.firstChild;return p.prepend&&l.prepend?l.prepend(d):p.prepend&&r?l.insertBefore(d,r):l.appendChild(d),d}var y=new Map;function m(S,b){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=C(p);if(!y.has(d)){var t=k("",p),l=t.parentNode;y.set(d,l),l.removeChild(t)}var r=Array.from(y.get(d).children).find(function(a){return a.tagName==="STYLE"&&a[v]===b});if(r){var i,o;if(((i=p.csp)===null||i===void 0?void 0:i.nonce)&&r.nonce!==((o=p.csp)===null||o===void 0?void 0:o.nonce)){var s;r.nonce=(s=p.csp)===null||s===void 0?void 0:s.nonce}return r.innerHTML!==S&&(r.innerHTML=S),r}var c=k(S,p);return c[v]=b,c}},Bd2K:function(F,Q,j){(function(N){N(j("VrN/"),j("osHv"))})(function(N){N.defineOption("autoCloseTags",!1,function(p,d,t){if(t!=N.Init&&t&&p.removeKeyMap("autoCloseTags"),!d)return;var l={name:"autoCloseTags"};(typeof d!="object"||d.whenClosing!==!1)&&(l["'/'"]=function(r){return m(r)}),(typeof d!="object"||d.whenOpening!==!1)&&(l["'>'"]=function(r){return k(r)}),p.addKeyMap(l)});var v=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],C=["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 k(p){if(p.getOption("disableInput"))return N.Pass;for(var d=p.listSelections(),t=[],l=p.getOption("autoCloseTags"),r=0;r<d.length;r++){if(!d[r].empty())return N.Pass;var i=d[r].head,o=p.getTokenAt(i),s=N.innerMode(p.getMode(),o.state),c=s.state,a=s.mode.xmlCurrentTag&&s.mode.xmlCurrentTag(c),u=a&&a.name;if(!u)return N.Pass;var f=s.mode.configuration=="html",w=typeof l=="object"&&l.dontCloseTags||f&&v,_=typeof l=="object"&&l.indentTags||f&&C;o.end>i.ch&&(u=u.slice(0,u.length-o.end+i.ch));var h=u.toLowerCase();if(!u||o.type=="string"&&(o.end!=i.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&a.close||o.string.indexOf("/")==i.ch-o.start-1||w&&S(w,h)>-1||b(p,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(c)||[],u,i,!0))return N.Pass;var R=typeof l=="object"&&l.emptyTags;if(R&&S(R,u)>-1){t[r]={text:"/>",newPos:N.Pos(i.line,i.ch+2)};continue}var O=_&&S(_,h)>-1;t[r]={indent:O,text:">"+(O?`
|
|
|
|
|
|
`:"")+"</"+u+">",newPos:O?N.Pos(i.line+1,0):N.Pos(i.line,i.ch+1)}}for(var g=typeof l=="object"&&l.dontIndentOnAutoClose,r=d.length-1;r>=0;r--){var x=t[r];p.replaceRange(x.text,d[r].head,d[r].anchor,"+insert");var E=p.listSelections().slice(0);E[r]={head:x.newPos,anchor:x.newPos},p.setSelections(E),!g&&x.indent&&(p.indentLine(x.newPos.line,null,!0),p.indentLine(x.newPos.line+1,null,!0))}}function y(p,d){for(var t=p.listSelections(),l=[],r=d?"/":"</",i=p.getOption("autoCloseTags"),o=typeof i=="object"&&i.dontIndentOnSlash,s=0;s<t.length;s++){if(!t[s].empty())return N.Pass;var c=t[s].head,a=p.getTokenAt(c),u=N.innerMode(p.getMode(),a.state),f=u.state;if(d&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=c.ch-1))return N.Pass;var w,_=u.mode.name!="xml"&&p.getMode().name=="htmlmixed";if(_&&u.mode.name=="javascript")w=r+"script";else if(_&&u.mode.name=="css")w=r+"style";else{var h=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(f);if(!h||h.length&&b(p,h,h[h.length-1],c))return N.Pass;w=r+h[h.length-1]}p.getLine(c.line).charAt(a.end)!=">"&&(w+=">"),l[s]=w}if(p.replaceSelections(l),t=p.listSelections(),!o)for(var s=0;s<t.length;s++)(s==t.length-1||t[s].head.line<t[s+1].head.line)&&p.indentLine(t[s].head.line)}function m(p){return p.getOption("disableInput")?N.Pass:y(p,!0)}N.commands.closeTag=function(p){return y(p)};function S(p,d){if(p.indexOf)return p.indexOf(d);for(var t=0,l=p.length;t<l;++t)if(p[t]==d)return t;return-1}function b(p,d,t,l,r){if(!N.scanForClosingTag)return!1;var i=Math.min(p.lastLine()+1,l.line+500),o=N.scanForClosingTag(p,l,null,i);if(!o||o.tag!=t)return!1;for(var s=r?1:0,c=d.length-1;c>=0&&d[c]==t;c--)++s;l=o.to;for(var c=1;c<s;c++){var a=N.scanForClosingTag(p,l,null,i);if(!a||a.tag!=t)return!1;l=a.to}return!0}})},BjJ7:function(F,Q,j){"use strict";j.d(Q,"d",function(){return v}),j.d(Q,"c",function(){return C}),j.d(Q,"e",function(){return k}),j.d(Q,"b",function(){return y}),j.d(Q,"a",function(){return S});var N=j("m3rI");function v(b){var p=!0;if(b.length>0){for(var d=0;d<b.length;d++)if(b[d].compile_success==0||!b[d].compile_success){p=!1;break}}else p=!1;return p}function C(b){for(var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",d=[],t=0;t<b.length;t++){var l=b[t],r=p?"".concat(p,"/").concat(l.name):"".concat(l.name);d.push({title:l.name,isLeaf:!(l.type==="tree"),key:r})}return d}function k(b,p,d){for(var t=0;t<b.length;t++){var l=b[t];if(l.key===p){l.children=d;break}l.children&&k(l.children,p,d)}return b}function y(b,p,d){var t;return function(){var l=this,r=arguments,i=function(){t=null,d||b.apply(l,r)},o=d&&!t;clearTimeout(t),t=setTimeout(i,p),o&&b.apply(l,r)}}var m=!0,S=N.a.API_SERVER},Bvq2:function(F,Q,j){F.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(F,Q,j){},CrYA:function(F,Q,j){var N=j("MFOe"),v=N.Global;F.exports={name:"sessionStorage",read:k,write:y,each:m,remove:S,clearAll:b};function C(){return v.sessionStorage}function k(p){return C().getItem(p)}function y(p,d){return C().setItem(p,d)}function m(p){for(var d=C().length-1;d>=0;d--){var t=C().key(d);p(k(t),t)}}function S(p){return C().removeItem(p)}function b(){return C().clear()}},DlQD:function(F,Q,j){(function(N,v){F.exports=v()})(this,function(){"use strict";function N(Ne,Ae){for(var Me=0;Me<Ae.length;Me++){var Ee=Ae[Me];Ee.enumerable=Ee.enumerable||!1,Ee.configurable=!0,"value"in Ee&&(Ee.writable=!0),Object.defineProperty(Ne,Ee.key,Ee)}}function v(Ne,Ae,Me){return Ae&&N(Ne.prototype,Ae),Me&&N(Ne,Me),Ne}function C(Ne,Ae){if(!Ne)return;if(typeof Ne=="string")return k(Ne,Ae);var Me=Object.prototype.toString.call(Ne).slice(8,-1);if(Me==="Object"&&Ne.constructor&&(Me=Ne.constructor.name),Me==="Map"||Me==="Set")return Array.from(Ne);if(Me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Me))return k(Ne,Ae)}function k(Ne,Ae){(Ae==null||Ae>Ne.length)&&(Ae=Ne.length);for(var Me=0,Ee=new Array(Ae);Me<Ae;Me++)Ee[Me]=Ne[Me];return Ee}function y(Ne,Ae){var Me;if(typeof Symbol=="undefined"||Ne[Symbol.iterator]==null){if(Array.isArray(Ne)||(Me=C(Ne))||Ae&&Ne&&typeof Ne.length=="number"){Me&&(Ne=Me);var Ee=0;return function(){return Ee>=Ne.length?{done:!0}:{done:!1,value:Ne[Ee++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Me=Ne[Symbol.iterator](),Me.next.bind(Me)}function m(Ne,Ae){return Ae={exports:{}},Ne(Ae,Ae.exports),Ae.exports}var S=m(function(Ne){function Ae(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Me(Ee){Ne.exports.defaults=Ee}Ne.exports={defaults:Ae(),getDefaults:Ae,changeDefaults:Me}}),b=S.defaults,p=S.getDefaults,d=S.changeDefaults,t=/[&<>"']/,l=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,i=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},s=function(Ae){return o[Ae]};function c(Ne,Ae){if(Ae){if(t.test(Ne))return Ne.replace(l,s)}else if(r.test(Ne))return Ne.replace(i,s);return Ne}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(Ne){return Ne.replace(a,function(Ae,Me){return Me=Me.toLowerCase(),Me==="colon"?":":Me.charAt(0)==="#"?Me.charAt(1)==="x"?String.fromCharCode(parseInt(Me.substring(2),16)):String.fromCharCode(+Me.substring(1)):""})}var f=/(^|[^\[])\^/g;function w(Ne,Ae){Ne=Ne.source||Ne,Ae=Ae||"";var Me={replace:function(Ce,ke){return ke=ke.source||ke,ke=ke.replace(f,"$1"),Ne=Ne.replace(Ce,ke),Me},getRegex:function(){return new RegExp(Ne,Ae)}};return Me}var _=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ne,Ae,Me){if(Ne){var Ee;try{Ee=decodeURIComponent(u(Me)).replace(_,"").toLowerCase()}catch(Ce){return null}if(Ee.indexOf("javascript:")===0||Ee.indexOf("vbscript:")===0||Ee.indexOf("data:")===0)return null}Ae&&!h.test(Me)&&(Me=T(Ae,Me));try{Me=encodeURI(Me).replace(/%25/g,"%")}catch(Ce){return null}return Me}var O={},g=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,E=/^([^:]+:\/*[^/]*)[\s\S]*$/;function T(Ne,Ae){O[" "+Ne]||(g.test(Ne)?O[" "+Ne]=Ne+"/":O[" "+Ne]=V(Ne,"/",!0)),Ne=O[" "+Ne];var Me=Ne.indexOf(":")===-1;return Ae.substring(0,2)==="//"?Me?Ae:Ne.replace(x,"$1")+Ae:Ae.charAt(0)==="/"?Me?Ae:Ne.replace(E,"$1")+Ae:Ne+Ae}var M={exec:function(){}};function L(Ne){for(var Ae=1,Me,Ee;Ae<arguments.length;Ae++){Me=arguments[Ae];for(Ee in Me)Object.prototype.hasOwnProperty.call(Me,Ee)&&(Ne[Ee]=Me[Ee])}return Ne}function A(Ne,Ae){var Me=Ne.replace(/\|/g,function(ke,Fe,Be){for(var et=!1,ct=Fe;--ct>=0&&Be[ct]==="\\";)et=!et;return et?"|":" |"}),Ee=Me.split(/ \|/),Ce=0;if(Ee.length>Ae)Ee.splice(Ae);else for(;Ee.length<Ae;)Ee.push("");for(;Ce<Ee.length;Ce++)Ee[Ce]=Ee[Ce].trim().replace(/\\\|/g,"|");return Ee}function V(Ne,Ae,Me){var Ee=Ne.length;if(Ee===0)return"";for(var Ce=0;Ce<Ee;){var ke=Ne.charAt(Ee-Ce-1);if(ke===Ae&&!Me)Ce++;else if(ke!==Ae&&Me)Ce++;else break}return Ne.substr(0,Ee-Ce)}function z(Ne,Ae){if(Ne.indexOf(Ae[1])===-1)return-1;for(var Me=Ne.length,Ee=0,Ce=0;Ce<Me;Ce++)if(Ne[Ce]==="\\")Ce++;else if(Ne[Ce]===Ae[0])Ee++;else if(Ne[Ce]===Ae[1]&&(Ee--,Ee<0))return Ce;return-1}function W(Ne){Ne&&Ne.sanitize&&!Ne.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var G={escape:c,unescape:u,edit:w,cleanUrl:R,resolveUrl:T,noopTest:M,merge:L,splitCells:A,rtrim:V,findClosingBracket:z,checkSanitizeDeprecation:W},U=S.defaults,P=G.rtrim,H=G.splitCells,$=G.escape,re=G.findClosingBracket;function te(Ne,Ae,Me){var Ee=Ae.href,Ce=Ae.title?$(Ae.title):null,ke=Ne[1].replace(/\\([\[\]])/g,"$1");return Ne[0].charAt(0)!=="!"?{type:"link",raw:Me,href:Ee,title:Ce,text:ke}:{type:"image",raw:Me,href:Ee,title:Ce,text:$(ke)}}function ge(Ne,Ae){var Me=Ne.match(/^(\s+)(?:```)/);if(Me===null)return Ae;var Ee=Me[1];return Ae.split(`
|
|
|
`).map(function(Ce){var ke=Ce.match(/^\s+/);if(ke===null)return Ce;var Fe=ke[0];return Fe.length>=Ee.length?Ce.slice(Ee.length):Ce}).join(`
|
|
|
`)}var ve=function(){function Ne(Me){this.options=Me||U}var Ae=Ne.prototype;return Ae.space=function(Ee){var Ce=this.rules.block.newline.exec(Ee);if(Ce)return Ce[0].length>1?{type:"space",raw:Ce[0]}:{raw:`
|
|
|
`}},Ae.code=function(Ee,Ce){var ke=this.rules.block.code.exec(Ee);if(ke){var Fe=Ce[Ce.length-1];if(Fe&&Fe.type==="paragraph")return{raw:ke[0],text:ke[0].trimRight()};var Be=ke[0].replace(/^ {4}/gm,"");return{type:"code",raw:ke[0],codeBlockStyle:"indented",text:this.options.pedantic?Be:P(Be,`
|
|
|
`)}}},Ae.fences=function(Ee){var Ce=this.rules.block.fences.exec(Ee);if(Ce){var ke=Ce[0],Fe=ge(ke,Ce[3]||"");return{type:"code",raw:ke,lang:Ce[2]?Ce[2].trim():Ce[2],text:Fe}}},Ae.heading=function(Ee){var Ce=this.rules.block.heading.exec(Ee);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[1].length,text:Ce[2]}},Ae.nptable=function(Ee){var Ce=this.rules.block.nptable.exec(Ee);if(Ce){var ke={type:"table",header:H(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:Ce[0]};if(ke.header.length===ke.align.length){var Fe=ke.align.length,Be;for(Be=0;Be<Fe;Be++)/^ *-+: *$/.test(ke.align[Be])?ke.align[Be]="right":/^ *:-+: *$/.test(ke.align[Be])?ke.align[Be]="center":/^ *:-+ *$/.test(ke.align[Be])?ke.align[Be]="left":ke.align[Be]=null;for(Fe=ke.cells.length,Be=0;Be<Fe;Be++)ke.cells[Be]=H(ke.cells[Be],ke.header.length);return ke}}},Ae.hr=function(Ee){var Ce=this.rules.block.hr.exec(Ee);if(Ce)return{type:"hr",raw:Ce[0]}},Ae.blockquote=function(Ee){var Ce=this.rules.block.blockquote.exec(Ee);if(Ce){var ke=Ce[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Ce[0],text:ke}}},Ae.list=function(Ee){var Ce=this.rules.block.list.exec(Ee);if(Ce){for(var ke=Ce[0],Fe=Ce[2],Be=Fe.length>1,et=Fe[Fe.length-1]===")",ct={type:"list",raw:ke,ordered:Be,start:Be?+Fe.slice(0,-1):"",loose:!1,items:[]},yt=Ce[0].match(this.rules.block.item),ft=!1,mt,It,At,_t,Vt,Kt,tr,rr=yt.length,Wt=0;Wt<rr;Wt++)mt=yt[Wt],ke=mt,It=mt.length,mt=mt.replace(/^ *([*+-]|\d+[.)]) */,""),~mt.indexOf(`
|
|
|
`)&&(It-=mt.length,mt=this.options.pedantic?mt.replace(/^ {1,4}/gm,""):mt.replace(new RegExp("^ {1,"+It+"}","gm"),"")),Wt!==rr-1&&(At=this.rules.block.bullet.exec(yt[Wt+1])[0],(Be?At.length===1||!et&&At[At.length-1]===")":At.length>1||this.options.smartLists&&At!==Fe)&&(_t=yt.slice(Wt+1).join(`
|
|
|
`),ct.raw=ct.raw.substring(0,ct.raw.length-_t.length),Wt=rr-1)),Vt=ft||/\n\n(?!\s*$)/.test(mt),Wt!==rr-1&&(ft=mt.charAt(mt.length-1)===`
|
|
|
`,Vt||(Vt=ft)),Vt&&(ct.loose=!0),Kt=/^\[[ xX]\] /.test(mt),tr=void 0,Kt&&(tr=mt[1]!==" ",mt=mt.replace(/^\[[ xX]\] +/,"")),ct.items.push({type:"list_item",raw:ke,task:Kt,checked:tr,loose:Vt,text:mt});return ct}},Ae.html=function(Ee){var Ce=this.rules.block.html.exec(Ee);if(Ce)return{type:this.options.sanitize?"paragraph":"html",raw:Ce[0],pre:!this.options.sanitizer&&(Ce[1]==="pre"||Ce[1]==="script"||Ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):$(Ce[0]):Ce[0]}},Ae.def=function(Ee){var Ce=this.rules.block.def.exec(Ee);if(Ce){Ce[3]&&(Ce[3]=Ce[3].substring(1,Ce[3].length-1));var ke=Ce[1].toLowerCase().replace(/\s+/g," ");return{tag:ke,raw:Ce[0],href:Ce[2],title:Ce[3]}}},Ae.table=function(Ee){var Ce=this.rules.block.table.exec(Ee);if(Ce){var ke={type:"table",header:H(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(ke.header.length===ke.align.length){ke.raw=Ce[0];var Fe=ke.align.length,Be;for(Be=0;Be<Fe;Be++)/^ *-+: *$/.test(ke.align[Be])?ke.align[Be]="right":/^ *:-+: *$/.test(ke.align[Be])?ke.align[Be]="center":/^ *:-+ *$/.test(ke.align[Be])?ke.align[Be]="left":ke.align[Be]=null;for(Fe=ke.cells.length,Be=0;Be<Fe;Be++)ke.cells[Be]=H(ke.cells[Be].replace(/^ *\| *| *\| *$/g,""),ke.header.length);return ke}}},Ae.lheading=function(Ee){var Ce=this.rules.block.lheading.exec(Ee);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[2].charAt(0)==="="?1:2,text:Ce[1]}},Ae.paragraph=function(Ee){var Ce=this.rules.block.paragraph.exec(Ee);if(Ce)return{type:"paragraph",raw:Ce[0],text:Ce[1].charAt(Ce[1].length-1)===`
|
|
|
`?Ce[1].slice(0,-1):Ce[1]}},Ae.text=function(Ee,Ce){var ke=this.rules.block.text.exec(Ee);if(ke){var Fe=Ce[Ce.length-1];return Fe&&Fe.type==="text"?{raw:ke[0],text:ke[0]}:{type:"text",raw:ke[0],text:ke[0]}}},Ae.escape=function(Ee){var Ce=this.rules.inline.escape.exec(Ee);if(Ce)return{type:"escape",raw:Ce[0],text:$(Ce[1])}},Ae.tag=function(Ee,Ce,ke){var Fe=this.rules.inline.tag.exec(Ee);if(Fe)return!Ce&&/^<a /i.test(Fe[0])?Ce=!0:Ce&&/^<\/a>/i.test(Fe[0])&&(Ce=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(Fe[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Fe[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:Fe[0],inLink:Ce,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Fe[0]):$(Fe[0]):Fe[0]}},Ae.link=function(Ee){var Ce=this.rules.inline.link.exec(Ee);if(Ce){var ke=re(Ce[2],"()");if(ke>-1){var Fe=Ce[0].indexOf("!")===0?5:4,Be=Fe+Ce[1].length+ke;Ce[2]=Ce[2].substring(0,ke),Ce[0]=Ce[0].substring(0,Be).trim(),Ce[3]=""}var et=Ce[2],ct="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(et);yt?(et=yt[1],ct=yt[3]):ct=""}else ct=Ce[3]?Ce[3].slice(1,-1):"";et=et.trim().replace(/^<([\s\S]*)>$/,"$1");var ft=te(Ce,{href:et&&et.replace(this.rules.inline._escapes,"$1"),title:ct&&ct.replace(this.rules.inline._escapes,"$1")},Ce[0]);return ft}},Ae.reflink=function(Ee,Ce){var ke;if((ke=this.rules.inline.reflink.exec(Ee))||(ke=this.rules.inline.nolink.exec(Ee))){var Fe=(ke[2]||ke[1]).replace(/\s+/g," ");if(Fe=Ce[Fe.toLowerCase()],!Fe||!Fe.href){var Be=ke[0].charAt(0);return{type:"text",raw:Be,text:Be}}var et=te(ke,Fe,ke[0]);return et}},Ae.strong=function(Ee,Ce,ke){ke===void 0&&(ke="");var Fe=this.rules.inline.strong.start.exec(Ee);if(Fe&&(!Fe[1]||Fe[1]&&(ke===""||this.rules.inline.punctuation.exec(ke)))){Ce=Ce.slice(-1*Ee.length);var Be=Fe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Be.lastIndex=0;for(var et;(Fe=Be.exec(Ce))!=null;)if(et=this.rules.inline.strong.middle.exec(Ce.slice(0,Fe.index+3)),et)return{type:"strong",raw:Ee.slice(0,et[0].length),text:Ee.slice(2,et[0].length-2)}}},Ae.em=function(Ee,Ce,ke){ke===void 0&&(ke="");var Fe=this.rules.inline.em.start.exec(Ee);if(Fe&&(!Fe[1]||Fe[1]&&(ke===""||this.rules.inline.punctuation.exec(ke)))){Ce=Ce.slice(-1*Ee.length);var Be=Fe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Be.lastIndex=0;for(var et;(Fe=Be.exec(Ce))!=null;)if(et=this.rules.inline.em.middle.exec(Ce.slice(0,Fe.index+2)),et)return{type:"em",raw:Ee.slice(0,et[0].length),text:Ee.slice(1,et[0].length-1)}}},Ae.codespan=function(Ee){var Ce=this.rules.inline.code.exec(Ee);if(Ce){var ke=Ce[2].replace(/\n/g," "),Fe=/[^ ]/.test(ke),Be=ke.startsWith(" ")&&ke.endsWith(" ");return Fe&&Be&&(ke=ke.substring(1,ke.length-1)),ke=$(ke,!0),{type:"codespan",raw:Ce[0],text:ke}}},Ae.br=function(Ee){var Ce=this.rules.inline.br.exec(Ee);if(Ce)return{type:"br",raw:Ce[0]}},Ae.del=function(Ee){var Ce=this.rules.inline.del.exec(Ee);if(Ce)return{type:"del",raw:Ce[0],text:Ce[1]}},Ae.autolink=function(Ee,Ce){var ke=this.rules.inline.autolink.exec(Ee);if(ke){var Fe,Be;return ke[2]==="@"?(Fe=$(this.options.mangle?Ce(ke[1]):ke[1]),Be="mailto:"+Fe):(Fe=$(ke[1]),Be=Fe),{type:"link",raw:ke[0],text:Fe,href:Be,tokens:[{type:"text",raw:Fe,text:Fe}]}}},Ae.url=function(Ee,Ce){var ke;if(ke=this.rules.inline.url.exec(Ee)){var Fe,Be;if(ke[2]==="@")Fe=$(this.options.mangle?Ce(ke[0]):ke[0]),Be="mailto:"+Fe;else{var et;do et=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0];while(et!==ke[0]);Fe=$(ke[0]),ke[1]==="www."?Be="http://"+Fe:Be=Fe}return{type:"link",raw:ke[0],text:Fe,href:Be,tokens:[{type:"text",raw:Fe,text:Fe}]}}},Ae.inlineText=function(Ee,Ce,ke){var Fe=this.rules.inline.text.exec(Ee);if(Fe){var Be;return Ce?Be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Fe[0]):$(Fe[0]):Fe[0]:Be=$(this.options.smartypants?ke(Fe[0]):Fe[0]),{type:"text",raw:Fe[0],text:Be}}},Ne}(),de=G.noopTest,De=G.edit,Te=G.merge,he={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:de,table:de,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=De(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=De(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=De(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=/<!--(?!-?>)[\s\S]*?-->/,he.html=De(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=De(he._paragraph).replace("hr",he.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",he._tag).getRegex(),he.blockquote=De(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=Te({},he),he.gfm=Te({},he.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*|$)"}),he.gfm.nptable=De(he.gfm.nptable).replace("hr",he.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",he._tag).getRegex(),he.gfm.table=De(he.gfm.table).replace("hr",he.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",he._tag).getRegex(),he.pedantic=Te({},he.normal,{html:De(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._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:de,paragraph:De(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:de,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:de,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=De(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=De(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=De(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=De(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=De(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=De(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=De(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=De(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=De(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=De(ue._blockSkip,"g").getRegex(),ue.overlapSkip=De(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=De(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=De(ue.tag).replace("comment",he._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=De(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=De(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=De(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=Te({},ue),ue.pedantic=Te({},ue.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:De(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:De(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=Te({},ue.normal,{escape:De(ue.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=De(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=Te({},ue.gfm,{br:De(ue.br).replace("{2,}","*").getRegex(),text:De(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ie={block:he,inline:ue},Se=S.defaults,ne=ie.block,ce=ie.inline;function Oe(Ne){return Ne.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 oe(Ne){var Ae="",Me,Ee,Ce=Ne.length;for(Me=0;Me<Ce;Me++)Ee=Ne.charCodeAt(Me),Math.random()>.5&&(Ee="x"+Ee.toString(16)),Ae+="&#"+Ee+";";return Ae}var q=function(){function Ne(Me){this.tokens=[],this.tokens.links=Object.create(null),this.options=Me||Se,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Ee={block:ne.normal,inline:ce.normal};this.options.pedantic?(Ee.block=ne.pedantic,Ee.inline=ce.pedantic):this.options.gfm&&(Ee.block=ne.gfm,this.options.breaks?Ee.inline=ce.breaks:Ee.inline=ce.gfm),this.tokenizer.rules=Ee}Ne.lex=function(Ee,Ce){var ke=new Ne(Ce);return ke.lex(Ee)};var Ae=Ne.prototype;return Ae.lex=function(Ee){return Ee=Ee.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(Ee,this.tokens,!0),this.inline(this.tokens),this.tokens},Ae.blockTokens=function(Ee,Ce,ke){Ce===void 0&&(Ce=[]),ke===void 0&&(ke=!0),Ee=Ee.replace(/^ +$/gm,"");for(var Fe,Be,et,ct;Ee;){if(Fe=this.tokenizer.space(Ee)){Ee=Ee.substring(Fe.raw.length),Fe.type&&Ce.push(Fe);continue}if(Fe=this.tokenizer.code(Ee,Ce)){Ee=Ee.substring(Fe.raw.length),Fe.type?Ce.push(Fe):(ct=Ce[Ce.length-1],ct.raw+=`
|
|
|
`+Fe.raw,ct.text+=`
|
|
|
`+Fe.text);continue}if(Fe=this.tokenizer.fences(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.heading(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.nptable(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.hr(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.blockquote(Ee)){Ee=Ee.substring(Fe.raw.length),Fe.tokens=this.blockTokens(Fe.text,[],ke),Ce.push(Fe);continue}if(Fe=this.tokenizer.list(Ee)){for(Ee=Ee.substring(Fe.raw.length),et=Fe.items.length,Be=0;Be<et;Be++)Fe.items[Be].tokens=this.blockTokens(Fe.items[Be].text,[],!1);Ce.push(Fe);continue}if(Fe=this.tokenizer.html(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(ke&&(Fe=this.tokenizer.def(Ee))){Ee=Ee.substring(Fe.raw.length),this.tokens.links[Fe.tag]||(this.tokens.links[Fe.tag]={href:Fe.href,title:Fe.title});continue}if(Fe=this.tokenizer.table(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.lheading(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(ke&&(Fe=this.tokenizer.paragraph(Ee))){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.text(Ee,Ce)){Ee=Ee.substring(Fe.raw.length),Fe.type?Ce.push(Fe):(ct=Ce[Ce.length-1],ct.raw+=`
|
|
|
`+Fe.raw,ct.text+=`
|
|
|
`+Fe.text);continue}if(Ee){var yt="Infinite loop on byte: "+Ee.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return Ce},Ae.inline=function(Ee){var Ce,ke,Fe,Be,et,ct,yt=Ee.length;for(Ce=0;Ce<yt;Ce++){ct=Ee[Ce];switch(ct.type){case"paragraph":case"text":case"heading":{ct.tokens=[],this.inlineTokens(ct.text,ct.tokens);break}case"table":{for(ct.tokens={header:[],cells:[]},Be=ct.header.length,ke=0;ke<Be;ke++)ct.tokens.header[ke]=[],this.inlineTokens(ct.header[ke],ct.tokens.header[ke]);for(Be=ct.cells.length,ke=0;ke<Be;ke++)for(et=ct.cells[ke],ct.tokens.cells[ke]=[],Fe=0;Fe<et.length;Fe++)ct.tokens.cells[ke][Fe]=[],this.inlineTokens(et[Fe],ct.tokens.cells[ke][Fe]);break}case"blockquote":{this.inline(ct.tokens);break}case"list":{for(Be=ct.items.length,ke=0;ke<Be;ke++)this.inline(ct.items[ke].tokens);break}}}return Ee},Ae.inlineTokens=function(Ee,Ce,ke,Fe,Be){Ce===void 0&&(Ce=[]),ke===void 0&&(ke=!1),Fe===void 0&&(Fe=!1),Be===void 0&&(Be="");var et,ct=Ee,yt;if(this.tokens.links){var ft=Object.keys(this.tokens.links);if(ft.length>0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(ct))!=null;)ft.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(ct=ct.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(ct))!=null;)ct=ct.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Ee;){if(et=this.tokenizer.escape(Ee)){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(et=this.tokenizer.tag(Ee,ke,Fe)){Ee=Ee.substring(et.raw.length),ke=et.inLink,Fe=et.inRawBlock,Ce.push(et);continue}if(et=this.tokenizer.link(Ee)){Ee=Ee.substring(et.raw.length),et.type==="link"&&(et.tokens=this.inlineTokens(et.text,[],!0,Fe)),Ce.push(et);continue}if(et=this.tokenizer.reflink(Ee,this.tokens.links)){Ee=Ee.substring(et.raw.length),et.type==="link"&&(et.tokens=this.inlineTokens(et.text,[],!0,Fe)),Ce.push(et);continue}if(et=this.tokenizer.strong(Ee,ct,Be)){Ee=Ee.substring(et.raw.length),et.tokens=this.inlineTokens(et.text,[],ke,Fe),Ce.push(et);continue}if(et=this.tokenizer.em(Ee,ct,Be)){Ee=Ee.substring(et.raw.length),et.tokens=this.inlineTokens(et.text,[],ke,Fe),Ce.push(et);continue}if(et=this.tokenizer.codespan(Ee)){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(et=this.tokenizer.br(Ee)){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(et=this.tokenizer.del(Ee)){Ee=Ee.substring(et.raw.length),et.tokens=this.inlineTokens(et.text,[],ke,Fe),Ce.push(et);continue}if(et=this.tokenizer.autolink(Ee,oe)){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(!ke&&(et=this.tokenizer.url(Ee,oe))){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(et=this.tokenizer.inlineText(Ee,Fe,Oe)){Ee=Ee.substring(et.raw.length),Be=et.raw.slice(-1),Ce.push(et);continue}if(Ee){var mt="Infinite loop on byte: "+Ee.charCodeAt(0);if(this.options.silent){console.error(mt);break}else throw new Error(mt)}}return Ce},v(Ne,null,[{key:"rules",get:function(){return{block:ne,inline:ce}}}]),Ne}(),Y=S.defaults,Z=G.cleanUrl,ye=G.escape,be=function(){function Ne(Me){this.options=Me||Y}var Ae=Ne.prototype;return Ae.code=function(Ee,Ce,ke){var Fe=(Ce||"").match(/\S*/)[0];if(this.options.highlight){var Be=this.options.highlight(Ee,Fe);Be!=null&&Be!==Ee&&(ke=!0,Ee=Be)}return Fe?'<pre><code class="'+this.options.langPrefix+ye(Fe,!0)+'">'+(ke?Ee:ye(Ee,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(ke?Ee:ye(Ee,!0))+`</code></pre>
|
|
|
`},Ae.blockquote=function(Ee){return`<blockquote>
|
|
|
`+Ee+`</blockquote>
|
|
|
`},Ae.html=function(Ee){return Ee},Ae.heading=function(Ee,Ce,ke,Fe){return this.options.headerIds?"<h"+Ce+' id="'+this.options.headerPrefix+Fe.slug(ke)+'">'+Ee+"</h"+Ce+`>
|
|
|
`:"<h"+Ce+">"+Ee+"</h"+Ce+`>
|
|
|
`},Ae.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},Ae.list=function(Ee,Ce,ke){var Fe=Ce?"ol":"ul",Be=Ce&&ke!==1?' start="'+ke+'"':"";return"<"+Fe+Be+`>
|
|
|
`+Ee+"</"+Fe+`>
|
|
|
`},Ae.listitem=function(Ee){return"<li>"+Ee+`</li>
|
|
|
`},Ae.checkbox=function(Ee){return"<input "+(Ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ae.paragraph=function(Ee){return"<p>"+Ee+`</p>
|
|
|
`},Ae.table=function(Ee,Ce){return Ce&&(Ce="<tbody>"+Ce+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+Ee+`</thead>
|
|
|
`+Ce+`</table>
|
|
|
`},Ae.tablerow=function(Ee){return`<tr>
|
|
|
`+Ee+`</tr>
|
|
|
`},Ae.tablecell=function(Ee,Ce){var ke=Ce.header?"th":"td",Fe=Ce.align?"<"+ke+' align="'+Ce.align+'">':"<"+ke+">";return Fe+Ee+"</"+ke+`>
|
|
|
`},Ae.strong=function(Ee){return"<strong>"+Ee+"</strong>"},Ae.em=function(Ee){return"<em>"+Ee+"</em>"},Ae.codespan=function(Ee){return"<code>"+Ee+"</code>"},Ae.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ae.del=function(Ee){return"<del>"+Ee+"</del>"},Ae.link=function(Ee,Ce,ke){if(Ee=Z(this.options.sanitize,this.options.baseUrl,Ee),Ee===null)return ke;var Fe='<a href="'+ye(Ee)+'"';return Ce&&(Fe+=' title="'+Ce+'"'),Fe+=">"+ke+"</a>",Fe},Ae.image=function(Ee,Ce,ke){if(Ee=Z(this.options.sanitize,this.options.baseUrl,Ee),Ee===null)return ke;var Fe='<img src="'+Ee+'" alt="'+ke+'"';return Ce&&(Fe+=' title="'+Ce+'"'),Fe+=this.options.xhtml?"/>":">",Fe},Ae.text=function(Ee){return Ee},Ne}(),Re=function(){function Ne(){}var Ae=Ne.prototype;return Ae.strong=function(Ee){return Ee},Ae.em=function(Ee){return Ee},Ae.codespan=function(Ee){return Ee},Ae.del=function(Ee){return Ee},Ae.html=function(Ee){return Ee},Ae.text=function(Ee){return Ee},Ae.link=function(Ee,Ce,ke){return""+ke},Ae.image=function(Ee,Ce,ke){return""+ke},Ae.br=function(){return""},Ne}(),Qe=function(){function Ne(){this.seen={}}var Ae=Ne.prototype;return Ae.slug=function(Ee){var Ce=Ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ce)){var ke=Ce;do this.seen[ke]++,Ce=ke+"-"+this.seen[ke];while(this.seen.hasOwnProperty(Ce))}return this.seen[Ce]=0,Ce},Ne}(),rt=S.defaults,at=G.unescape,qe=function(){function Ne(Me){this.options=Me||rt,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Re,this.slugger=new Qe}Ne.parse=function(Ee,Ce){var ke=new Ne(Ce);return ke.parse(Ee)};var Ae=Ne.prototype;return Ae.parse=function(Ee,Ce){Ce===void 0&&(Ce=!0);var ke="",Fe,Be,et,ct,yt,ft,mt,It,At,_t,Vt,Kt,tr,rr,Wt,Lt,nr,dt,Et=Ee.length;for(Fe=0;Fe<Et;Fe++){_t=Ee[Fe];switch(_t.type){case"space":continue;case"hr":{ke+=this.renderer.hr();continue}case"heading":{ke+=this.renderer.heading(this.parseInline(_t.tokens),_t.depth,at(this.parseInline(_t.tokens,this.textRenderer)),this.slugger);continue}case"code":{ke+=this.renderer.code(_t.text,_t.lang,_t.escaped);continue}case"table":{for(It="",mt="",ct=_t.header.length,Be=0;Be<ct;Be++)mt+=this.renderer.tablecell(this.parseInline(_t.tokens.header[Be]),{header:!0,align:_t.align[Be]});for(It+=this.renderer.tablerow(mt),At="",ct=_t.cells.length,Be=0;Be<ct;Be++){for(ft=_t.tokens.cells[Be],mt="",yt=ft.length,et=0;et<yt;et++)mt+=this.renderer.tablecell(this.parseInline(ft[et]),{header:!1,align:_t.align[et]});At+=this.renderer.tablerow(mt)}ke+=this.renderer.table(It,At);continue}case"blockquote":{At=this.parse(_t.tokens),ke+=this.renderer.blockquote(At);continue}case"list":{for(Vt=_t.ordered,Kt=_t.start,tr=_t.loose,ct=_t.items.length,At="",Be=0;Be<ct;Be++)Wt=_t.items[Be],Lt=Wt.checked,nr=Wt.task,rr="",Wt.task&&(dt=this.renderer.checkbox(Lt),tr?Wt.tokens.length>0&&Wt.tokens[0].type==="text"?(Wt.tokens[0].text=dt+" "+Wt.tokens[0].text,Wt.tokens[0].tokens&&Wt.tokens[0].tokens.length>0&&Wt.tokens[0].tokens[0].type==="text"&&(Wt.tokens[0].tokens[0].text=dt+" "+Wt.tokens[0].tokens[0].text)):Wt.tokens.unshift({type:"text",text:dt}):rr+=dt),rr+=this.parse(Wt.tokens,tr),At+=this.renderer.listitem(rr,nr,Lt);ke+=this.renderer.list(At,Vt,Kt);continue}case"html":{ke+=this.renderer.html(_t.text);continue}case"paragraph":{ke+=this.renderer.paragraph(this.parseInline(_t.tokens));continue}case"text":{for(At=_t.tokens?this.parseInline(_t.tokens):_t.text;Fe+1<Et&&Ee[Fe+1].type==="text";)_t=Ee[++Fe],At+=`
|
|
|
`+(_t.tokens?this.parseInline(_t.tokens):_t.text);ke+=Ce?this.renderer.paragraph(At):At;continue}default:{var jt='Token with "'+_t.type+'" type was not found.';if(this.options.silent){console.error(jt);return}else throw new Error(jt)}}}return ke},Ae.parseInline=function(Ee,Ce){Ce=Ce||this.renderer;var ke="",Fe,Be,et=Ee.length;for(Fe=0;Fe<et;Fe++){Be=Ee[Fe];switch(Be.type){case"escape":{ke+=Ce.text(Be.text);break}case"html":{ke+=Ce.html(Be.text);break}case"link":{ke+=Ce.link(Be.href,Be.title,this.parseInline(Be.tokens,Ce));break}case"image":{ke+=Ce.image(Be.href,Be.title,Be.text);break}case"strong":{ke+=Ce.strong(this.parseInline(Be.tokens,Ce));break}case"em":{ke+=Ce.em(this.parseInline(Be.tokens,Ce));break}case"codespan":{ke+=Ce.codespan(Be.text);break}case"br":{ke+=Ce.br();break}case"del":{ke+=Ce.del(this.parseInline(Be.tokens,Ce));break}case"text":{ke+=Ce.text(Be.text);break}default:{var ct='Token with "'+Be.type+'" type was not found.';if(this.options.silent){console.error(ct);return}else throw new Error(ct)}}}return ke},Ne}(),st=G.merge,lt=G.checkSanitizeDeprecation,je=G.escape,Ie=S.getDefaults,tt=S.changeDefaults,ot=S.defaults;function ze(Ne,Ae,Me){if(typeof Ne=="undefined"||Ne===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ne!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ne)+", string expected");if(typeof Ae=="function"&&(Me=Ae,Ae=null),Ae=st({},ze.defaults,Ae||{}),lt(Ae),Me){var Ee=Ae.highlight,Ce;try{Ce=q.lex(Ne,Ae)}catch(et){return Me(et)}var ke=function(ct){var yt;if(!ct)try{yt=qe.parse(Ce,Ae)}catch(ft){ct=ft}return Ae.highlight=Ee,ct?Me(ct):Me(null,yt)};if(!Ee||Ee.length<3)return ke();if(delete Ae.highlight,!Ce.length)return ke();var Fe=0;ze.walkTokens(Ce,function(et){et.type==="code"&&(Fe++,setTimeout(function(){Ee(et.text,et.lang,function(ct,yt){if(ct)return ke(ct);yt!=null&&yt!==et.text&&(et.text=yt,et.escaped=!0),Fe--,Fe===0&&ke()})},0))}),Fe===0&&ke();return}try{var Be=q.lex(Ne,Ae);return Ae.walkTokens&&ze.walkTokens(Be,Ae.walkTokens),qe.parse(Be,Ae)}catch(et){if(et.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Ae.silent)return"<p>An error occurred:</p><pre>"+je(et.message+"",!0)+"</pre>";throw et}}ze.options=ze.setOptions=function(Ne){return st(ze.defaults,Ne),tt(ze.defaults),ze},ze.getDefaults=Ie,ze.defaults=ot,ze.use=function(Ne){var Ae=st({},Ne);if(Ne.renderer&&function(){var Ee=ze.defaults.renderer||new be,Ce=function(Be){var et=Ee[Be];Ee[Be]=function(){for(var ct=arguments.length,yt=new Array(ct),ft=0;ft<ct;ft++)yt[ft]=arguments[ft];var mt=Ne.renderer[Be].apply(Ee,yt);return mt===!1&&(mt=et.apply(Ee,yt)),mt}};for(var ke in Ne.renderer)Ce(ke);Ae.renderer=Ee}(),Ne.tokenizer&&function(){var Ee=ze.defaults.tokenizer||new ve,Ce=function(Be){var et=Ee[Be];Ee[Be]=function(){for(var ct=arguments.length,yt=new Array(ct),ft=0;ft<ct;ft++)yt[ft]=arguments[ft];var mt=Ne.tokenizer[Be].apply(Ee,yt);return mt===!1&&(mt=et.apply(Ee,yt)),mt}};for(var ke in Ne.tokenizer)Ce(ke);Ae.tokenizer=Ee}(),Ne.walkTokens){var Me=ze.defaults.walkTokens;Ae.walkTokens=function(Ee){Ne.walkTokens(Ee),Me&&Me(Ee)}}ze.setOptions(Ae)},ze.walkTokens=function(Ne,Ae){for(var Me=y(Ne),Ee;!(Ee=Me()).done;){var Ce=Ee.value;Ae(Ce);switch(Ce.type){case"table":{for(var ke=y(Ce.tokens.header),Fe;!(Fe=ke()).done;){var Be=Fe.value;ze.walkTokens(Be,Ae)}for(var et=y(Ce.tokens.cells),ct;!(ct=et()).done;)for(var yt=ct.value,ft=y(yt),mt;!(mt=ft()).done;){var It=mt.value;ze.walkTokens(It,Ae)}break}case"list":{ze.walkTokens(Ce.items,Ae);break}default:Ce.tokens&&ze.walkTokens(Ce.tokens,Ae)}}},ze.Parser=qe,ze.parser=qe.parse,ze.Renderer=be,ze.TextRenderer=Re,ze.Lexer=q,ze.lexer=q.lex,ze.Tokenizer=ve,ze.Slugger=Qe,ze.parse=ze;var Ze=ze;return Ze})},"DlR+":function(F,Q,j){var N=j("MFOe"),v=N.Global,C=N.trim;F.exports={name:"cookieStorage",read:y,write:S,each:m,remove:b,clearAll:p};var k=v.document;function y(t){if(!t||!d(t))return null;var l="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(k.cookie.replace(new RegExp(l),"$1"))}function m(t){for(var l=k.cookie.split(/; ?/g),r=l.length-1;r>=0;r--){if(!C(l[r]))continue;var i=l[r].split("="),o=unescape(i[0]),s=unescape(i[1]);t(s,o)}}function S(t,l){if(!t)return;k.cookie=escape(t)+"="+escape(l)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function b(t){if(!t||!d(t))return;k.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function p(){m(function(t,l){b(l)})}function d(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(k.cookie)}},E4JC:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("ETIr"),j("cv67"),j("K3mO"),j("OLod"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.StreamCipher,y=v.algo,m=[],S=[],b=[],p=y.Rabbit=k.extend({_doReset:function(){for(var t=this._key.words,l=this.cfg.iv,r=0;r<4;r++)t[r]=(t[r]<<8|t[r]>>>24)&16711935|(t[r]<<24|t[r]>>>8)&4278255360;var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],o=this._C=[t[2]<<16|t[2]>>>16,t[0]&4294901760|t[1]&65535,t[3]<<16|t[3]>>>16,t[1]&4294901760|t[2]&65535,t[0]<<16|t[0]>>>16,t[2]&4294901760|t[3]&65535,t[1]<<16|t[1]>>>16,t[3]&4294901760|t[0]&65535];this._b=0;for(var r=0;r<4;r++)d.call(this);for(var r=0;r<8;r++)o[r]^=i[r+4&7];if(l){var s=l.words,c=s[0],a=s[1],u=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,f=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,w=u>>>16|f&4294901760,_=f<<16|u&65535;o[0]^=u,o[1]^=w,o[2]^=f,o[3]^=_,o[4]^=u,o[5]^=w,o[6]^=f,o[7]^=_;for(var r=0;r<4;r++)d.call(this)}},_doProcessBlock:function(t,l){var r=this._X;d.call(this),m[0]=r[0]^r[5]>>>16^r[3]<<16,m[1]=r[2]^r[7]>>>16^r[5]<<16,m[2]=r[4]^r[1]>>>16^r[7]<<16,m[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)m[i]=(m[i]<<8|m[i]>>>24)&16711935|(m[i]<<24|m[i]>>>8)&4278255360,t[l+i]^=m[i]},blockSize:128/32,ivSize:64/32});function d(){for(var t=this._X,l=this._C,r=0;r<8;r++)S[r]=l[r];l[0]=l[0]+1295307597+this._b|0,l[1]=l[1]+3545052371+(l[0]>>>0<S[0]>>>0?1:0)|0,l[2]=l[2]+886263092+(l[1]>>>0<S[1]>>>0?1:0)|0,l[3]=l[3]+1295307597+(l[2]>>>0<S[2]>>>0?1:0)|0,l[4]=l[4]+3545052371+(l[3]>>>0<S[3]>>>0?1:0)|0,l[5]=l[5]+886263092+(l[4]>>>0<S[4]>>>0?1:0)|0,l[6]=l[6]+1295307597+(l[5]>>>0<S[5]>>>0?1:0)|0,l[7]=l[7]+3545052371+(l[6]>>>0<S[6]>>>0?1:0)|0,this._b=l[7]>>>0<S[7]>>>0?1:0;for(var r=0;r<8;r++){var i=t[r]+l[r],o=i&65535,s=i>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,a=((i&4294901760)*i|0)+((i&65535)*i|0);b[r]=c^a}t[0]=b[0]+(b[7]<<16|b[7]>>>16)+(b[6]<<16|b[6]>>>16)|0,t[1]=b[1]+(b[0]<<8|b[0]>>>24)+b[7]|0,t[2]=b[2]+(b[1]<<16|b[1]>>>16)+(b[0]<<16|b[0]>>>16)|0,t[3]=b[3]+(b[2]<<8|b[2]>>>24)+b[1]|0,t[4]=b[4]+(b[3]<<16|b[3]>>>16)+(b[2]<<16|b[2]>>>16)|0,t[5]=b[5]+(b[4]<<8|b[4]>>>24)+b[3]|0,t[6]=b[6]+(b[5]<<16|b[5]>>>16)+(b[4]<<16|b[4]>>>16)|0,t[7]=b[7]+(b[6]<<8|b[6]>>>24)+b[5]|0}v.Rabbit=k._createHelper(p)}(),N.Rabbit})},ELLl:function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){var v={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},C=N.Pos;N.defineOption("autoCloseBrackets",!1,function(o,s,c){c&&c!=N.Init&&(o.removeKeyMap(y),o.state.closeBrackets=null),s&&(m(k(s,"pairs")),o.state.closeBrackets=s,o.addKeyMap(y))});function k(o,s){return s=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[s]!=null?o[s]:v[s]}var y={Backspace:p,Enter:d};function m(o){for(var s=0;s<o.length;s++){var c=o.charAt(s),a="'"+c+"'";y[a]||(y[a]=S(c))}}m(v.pairs+"`");function S(o){return function(s){return l(s,o)}}function b(o){var s=o.state.closeBrackets;if(!s||s.override)return s;var c=o.getModeAt(o.getCursor());return c.closeBrackets||s}function p(o){var s=b(o);if(!s||o.getOption("disableInput"))return N.Pass;for(var c=k(s,"pairs"),a=o.listSelections(),u=0;u<a.length;u++){if(!a[u].empty())return N.Pass;var f=r(o,a[u].head);if(!f||c.indexOf(f)%2!=0)return N.Pass}for(var u=a.length-1;u>=0;u--){var w=a[u].head;o.replaceRange("",C(w.line,w.ch-1),C(w.line,w.ch+1),"+delete")}}function d(o){var s=b(o),c=s&&k(s,"explode");if(!c||o.getOption("disableInput"))return N.Pass;for(var a=o.listSelections(),u=0;u<a.length;u++){if(!a[u].empty())return N.Pass;var f=r(o,a[u].head);if(!f||c.indexOf(f)%2!=0)return N.Pass}o.operation(function(){var w=o.lineSeparator()||`
|
|
|
`;o.replaceSelection(w+w,null),o.execCommand("goCharLeft"),a=o.listSelections();for(var _=0;_<a.length;_++){var h=a[_].head.line;o.indentLine(h,null,!0),o.indentLine(h+1,null,!0)}})}function t(o){var s=N.cmpPos(o.anchor,o.head)>0;return{anchor:new C(o.anchor.line,o.anchor.ch+(s?-1:1)),head:new C(o.head.line,o.head.ch+(s?1:-1))}}function l(o,s){var c=b(o);if(!c||o.getOption("disableInput"))return N.Pass;var a=k(c,"pairs"),u=a.indexOf(s);if(u==-1)return N.Pass;for(var f=k(c,"closeBefore"),w=k(c,"triples"),_=a.charAt(u+1)==s,h=o.listSelections(),R=u%2==0,O,g=0;g<h.length;g++){var x=h[g],E=x.head,T,M=o.getRange(E,C(E.line,E.ch+1));if(R&&!x.empty())T="surround";else if((_||!R)&&M==s)_&&i(o,E)?T="both":w.indexOf(s)>=0&&o.getRange(E,C(E.line,E.ch+3))==s+s+s?T="skipThree":T="skip";else if(_&&E.ch>1&&w.indexOf(s)>=0&&o.getRange(C(E.line,E.ch-2),E)==s+s){if(E.ch>2&&/\bstring/.test(o.getTokenTypeAt(C(E.line,E.ch-2))))return N.Pass;T="addFour"}else if(_){var L=E.ch==0?" ":o.getRange(C(E.line,E.ch-1),E);if(!N.isWordChar(M)&&L!=s&&!N.isWordChar(L))T="both";else return N.Pass}else if(R&&(M.length===0||/\s/.test(M)||f.indexOf(M)>-1))T="both";else return N.Pass;if(!O)O=T;else if(O!=T)return N.Pass}var A=u%2?a.charAt(u-1):s,V=u%2?s:a.charAt(u+1);o.operation(function(){if(O=="skip")o.execCommand("goCharRight");else if(O=="skipThree")for(var z=0;z<3;z++)o.execCommand("goCharRight");else if(O=="surround"){for(var W=o.getSelections(),z=0;z<W.length;z++)W[z]=A+W[z]+V;o.replaceSelections(W,"around"),W=o.listSelections().slice();for(var z=0;z<W.length;z++)W[z]=t(W[z]);o.setSelections(W)}else O=="both"?(o.replaceSelection(A+V,null),o.triggerElectric(A+V),o.execCommand("goCharLeft")):O=="addFour"&&(o.replaceSelection(A+A+A+A,"before"),o.execCommand("goCharRight"))})}function r(o,s){var c=o.getRange(C(s.line,s.ch-1),C(s.line,s.ch+1));return c.length==2?c:null}function i(o,s){var c=o.getTokenAt(C(s.line,s.ch+1));return/\bstring/.test(c.type)&&c.start==s.ch&&(s.ch==0||!/\bstring/.test(o.getTokenTypeAt(s)))}})},ELcG:function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){/** @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(v){var C=N,k=C.lib,y=k.WordArray,m=k.Hasher,S=C.algo,b=y.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]),p=y.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]),d=y.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]),t=y.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]),l=y.create([0,1518500249,1859775393,2400959708,2840853838]),r=y.create([1352829926,1548603684,1836072691,2053994217,0]),i=S.RIPEMD160=m.extend({_doReset:function(){this._hash=y.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(w,_){for(var h=0;h<16;h++){var R=_+h,O=w[R];w[R]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}var g=this._hash.words,x=l.words,E=r.words,T=b.words,M=p.words,L=d.words,A=t.words,V,z,W,G,U,P,H,$,re,te;P=V=g[0],H=z=g[1],$=W=g[2],re=G=g[3],te=U=g[4];for(var ge,h=0;h<80;h+=1)ge=V+w[_+T[h]]|0,h<16?ge+=o(z,W,G)+x[0]:h<32?ge+=s(z,W,G)+x[1]:h<48?ge+=c(z,W,G)+x[2]:h<64?ge+=a(z,W,G)+x[3]:ge+=u(z,W,G)+x[4],ge=ge|0,ge=f(ge,L[h]),ge=ge+U|0,V=U,U=G,G=f(W,10),W=z,z=ge,ge=P+w[_+M[h]]|0,h<16?ge+=u(H,$,re)+E[0]:h<32?ge+=a(H,$,re)+E[1]:h<48?ge+=c(H,$,re)+E[2]:h<64?ge+=s(H,$,re)+E[3]:ge+=o(H,$,re)+E[4],ge=ge|0,ge=f(ge,A[h]),ge=ge+te|0,P=te,te=re,re=f($,10),$=H,H=ge;ge=g[1]+W+re|0,g[1]=g[2]+G+te|0,g[2]=g[3]+U+P|0,g[3]=g[4]+V+H|0,g[4]=g[0]+z+$|0,g[0]=ge},_doFinalize:function(){var w=this._data,_=w.words,h=this._nDataBytes*8,R=w.sigBytes*8;_[R>>>5]|=128<<24-R%32,_[(R+64>>>9<<4)+14]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,w.sigBytes=(_.length+1)*4,this._process();for(var O=this._hash,g=O.words,x=0;x<5;x++){var E=g[x];g[x]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}return O},clone:function(){var w=m.clone.call(this);return w._hash=this._hash.clone(),w}});function o(w,_,h){return w^_^h}function s(w,_,h){return w&_|~w&h}function c(w,_,h){return(w|~_)^h}function a(w,_,h){return w&h|_&~h}function u(w,_,h){return w^(_|~h)}function f(w,_){return w<<_|w>>>32-_}C.RIPEMD160=m._createHelper(i),C.HmacRIPEMD160=m._createHmacHelper(i)}(Math),N.RIPEMD160})},ETIr:function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.WordArray,y=v.enc,m=y.Base64={stringify:function(b){var p=b.words,d=b.sigBytes,t=this._map;b.clamp();for(var l=[],r=0;r<d;r+=3)for(var i=p[r>>>2]>>>24-r%4*8&255,o=p[r+1>>>2]>>>24-(r+1)%4*8&255,s=p[r+2>>>2]>>>24-(r+2)%4*8&255,c=i<<16|o<<8|s,a=0;a<4&&r+a*.75<d;a++)l.push(t.charAt(c>>>6*(3-a)&63));var u=t.charAt(64);if(u)for(;l.length%4;)l.push(u);return l.join("")},parse:function(b){var p=b.length,d=this._map,t=this._reverseMap;if(!t){t=this._reverseMap=[];for(var l=0;l<d.length;l++)t[d.charCodeAt(l)]=l}var r=d.charAt(64);if(r){var i=b.indexOf(r);i!==-1&&(p=i)}return S(b,p,t)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function S(b,p,d){for(var t=[],l=0,r=0;r<p;r++)if(r%4){var i=d[b.charCodeAt(r-1)]<<r%4*2,o=d[b.charCodeAt(r)]>>>6-r%4*2,s=i|o;t[l>>>2]|=s<<24-l%4*8,l++}return k.create(t,l)}}(),N.enc.Base64})},"F+F2":function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(){if(typeof ArrayBuffer!="function")return;var v=N,C=v.lib,k=C.WordArray,y=k.init,m=k.init=function(S){if(S instanceof ArrayBuffer&&(S=new Uint8Array(S)),(S instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&S instanceof Uint8ClampedArray||S instanceof Int16Array||S instanceof Uint16Array||S instanceof Int32Array||S instanceof Uint32Array||S instanceof Float32Array||S instanceof Float64Array)&&(S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength)),S instanceof Uint8Array){for(var b=S.byteLength,p=[],d=0;d<b;d++)p[d>>>2]|=S[d]<<24-d%4*8;y.call(this,p,b)}else y.apply(this,arguments)};m.prototype=k}(),N.lib.WordArray})},GRuw:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("lPiR"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.WordArray,y=v.algo,m=y.SHA256,S=y.SHA224=m.extend({_doReset:function(){this._hash=new k.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var b=m._doFinalize.call(this);return b.sigBytes-=4,b}});v.SHA224=m._createHelper(S),v.HmacSHA224=m._createHmacHelper(S)}(),N.SHA224})},GfqC:function(F,Q,j){"use strict";var N=j("cDcd"),v=j.n(N),C=j("TSYQ"),k=j.n(C);function y(G,U){var P="cannot "+G.method+" "+G.action+" "+U.status+"'",H=new Error(P);return H.status=U.status,H.method=G.method,H.url=G.action,H}function m(G){var U=G.responseText||G.response;if(!U)return U;try{return JSON.parse(U)}catch(P){return U}}function S(G){var U=new XMLHttpRequest;G.onProgress&&U.upload&&(U.upload.onprogress=function(re){re.total>0&&(re.percent=re.loaded/re.total*100),G.onProgress(re)});var P=new FormData;G.data&&Object.keys(G.data).forEach(function($){var re=G.data[$];if(Array.isArray(re)){re.forEach(function(te){P.append($+"[]",te)});return}P.append($,G.data[$])}),G.file instanceof Blob?P.append(G.filename,G.file,G.file.name):P.append(G.filename,G.file),U.onerror=function(re){G.onError(re)},U.onload=function(){return U.status<200||U.status>=300?G.onError(y(G,U),m(U)):G.onSuccess(m(U),U)},U.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in U&&(U.withCredentials=!0);var H=G.headers||{};return H["X-Requested-With"]!==null&&U.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function($){H[$]!==null&&U.setRequestHeader($,H[$])}),U.send(P),{abort:function(){U.abort()}}}var b=+new Date,p=0;function d(){return"rc-upload-"+b+"-"+ ++p}function t(G,U){return G.indexOf(U,G.length-U.length)!==-1}var l=function(G,U){if(G&&U){var P=Array.isArray(U)?U:U.split(","),H=G.name||"",$=G.type||"",re=$.replace(/\/.*$/,"");return P.some(function(te){var ge=te.trim();return ge.charAt(0)==="."?t(H.toLowerCase(),ge.toLowerCase()):/\/\*$/.test(ge)?re===ge.replace(/\/.*$/,""):$===ge})}return!0};function r(G,U){var P=G.createReader(),H=[];function $(){P.readEntries(function(re){var te=Array.prototype.slice.apply(re);H=H.concat(te);var ge=!te.length;ge?U(H):$()})}$()}var i=function(U,P,H){var $=function re(te,ge){ge=ge||"",te.isFile?te.file(function(ve){H(ve)&&(te.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=te.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),P([ve]))}):te.isDirectory&&r(te,function(ve){ve.forEach(function(de){re(de,""+ge+te.name+"/")})})};U.forEach(function(re){$(re.webkitGetAsEntry())})},o=i,s=Object.assign||function(G){for(var U=1;U<arguments.length;U++){var P=arguments[U];for(var H in P)Object.prototype.hasOwnProperty.call(P,H)&&(G[H]=P[H])}return G},c=function(){function G(U,P){var H=[],$=!0,re=!1,te=void 0;try{for(var ge=U[Symbol.iterator](),ve;!($=(ve=ge.next()).done)&&!(H.push(ve.value),P&&H.length===P);$=!0);}catch(de){re=!0,te=de}finally{try{!$&&ge.return&&ge.return()}finally{if(re)throw te}}return H}return function(U,P){if(Array.isArray(U))return U;if(Symbol.iterator in Object(U))return G(U,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function G(U,P){for(var H=0;H<P.length;H++){var $=P[H];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(U,$.key,$)}}return function(U,P,H){return P&&G(U.prototype,P),H&&G(U,H),U}}();function u(G,U,P){return U in G?Object.defineProperty(G,U,{value:P,enumerable:!0,configurable:!0,writable:!0}):G[U]=P,G}function f(G,U){var P={};for(var H in G){if(U.indexOf(H)>=0)continue;if(!Object.prototype.hasOwnProperty.call(G,H))continue;P[H]=G[H]}return P}function w(G,U){if(!(G instanceof U))throw new TypeError("Cannot call a class as a function")}function _(G,U){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:G}function h(G,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);G.prototype=Object.create(U&&U.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(G,U):G.__proto__=U)}var R=function(U){return Object.keys(U).reduce(function(P,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(P[H]=U[H]),P},{})},O=function(G){h(U,G);function U(){var P,H,$,re;w(this,U);for(var te=arguments.length,ge=Array(te),ve=0;ve<te;ve++)ge[ve]=arguments[ve];return re=(H=($=_(this,(P=U.__proto__||Object.getPrototypeOf(U)).call.apply(P,[this].concat(ge))),$),$.state={uid:d()},$.reqs={},$.onChange=function(de){var De=de.target.files;$.uploadFiles(De),$.reset()},$.onClick=function(de){var De=$.fileInput;if(!De)return;var Te=$.props,he=Te.children,ue=Te.onClick;he&&he.type==="button"&&(De.parentNode.focus(),De.parentNode.querySelector("button").blur()),De.click(),ue&&ue(de)},$.onKeyDown=function(de){de.key==="Enter"&&$.onClick()},$.onFileDrop=function(de){var De=$.props.multiple;if(de.preventDefault(),de.type==="dragover")return;if($.props.directory)o(Array.prototype.slice.call(de.dataTransfer.items),$.uploadFiles,function(he){return l(he,$.props.accept)});else{var Te=Array.prototype.slice.call(de.dataTransfer.files).filter(function(he){return l(he,$.props.accept)});De===!1&&(Te=Te.slice(0,1)),$.uploadFiles(Te)}},$.uploadFiles=function(de){var De=Array.prototype.slice.call(de);De.map(function(Te){return Te.uid=d(),Te}).forEach(function(Te){$.upload(Te,De)})},$.saveFileInput=function(de){$.fileInput=de},H),_($,re)}return a(U,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(H,$){var re=this,te=this.props;if(!te.beforeUpload)return setTimeout(function(){return re.post(H)},0);var ge=te.beforeUpload(H,$);ge&&ge.then?ge.then(function(ve){var de=Object.prototype.toString.call(ve);return de==="[object File]"||de==="[object Blob]"?re.post(ve):re.post(H)}).catch(function(ve){console.log(ve)}):ge!==!1&&setTimeout(function(){return re.post(H)},0);return}},{key:"post",value:function(H){var $=this;if(!this._isMounted)return;var re=this.props,te=re.onStart,ge=re.onProgress,ve=re.transformFile,de=ve===void 0?function(De){return De}:ve;new Promise(function(De){var Te=re.action;return typeof Te=="function"&&(Te=Te(H)),De(Te)}).then(function(De){var Te=H.uid,he=re.customRequest||S,ue=Promise.resolve(de(H)).then(function(ie){var Se=re.data;return typeof Se=="function"&&(Se=Se(ie)),Promise.all([ie,Se])}).catch(function(ie){console.error(ie)});ue.then(function(ie){var Se=c(ie,2),ne=Se[0],ce=Se[1],Oe={action:De,filename:re.name,data:ce,file:ne,headers:re.headers,withCredentials:re.withCredentials,method:re.method||"post",onProgress:ge?function(oe){ge(oe,H)}:null,onSuccess:function(q,Y){delete $.reqs[Te],re.onSuccess(q,H,Y)},onError:function(q,Y){delete $.reqs[Te],re.onError(q,Y,H)}};te(H),$.reqs[Te]=he(Oe)})})}},{key:"reset",value:function(){this.setState({uid:d()})}},{key:"abort",value:function(H){var $=this.reqs;if(H){var re=H;H&&H.uid&&(re=H.uid),$[re]&&$[re].abort&&$[re].abort(),delete $[re]}else Object.keys($).forEach(function(te){$[te]&&$[te].abort&&$[te].abort(),delete $[te]})}},{key:"render",value:function(){var H,$=this.props,re=$.component,te=$.prefixCls,ge=$.className,ve=$.disabled,de=$.id,De=$.style,Te=$.multiple,he=$.accept,ue=$.children,ie=$.directory,Se=$.openFileDialogOnClick,ne=$.onMouseEnter,ce=$.onMouseLeave,Oe=f($,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),oe=k()((H={},u(H,te,!0),u(H,te+"-disabled",ve),u(H,ge,ge),H)),q=ve?{}:{onClick:Se?this.onClick:function(){},onKeyDown:Se?this.onKeyDown:function(){},onMouseEnter:ne,onMouseLeave:ce,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return v.a.createElement(re,s({},q,{className:oe,role:"button",style:De}),v.a.createElement("input",s({},R(Oe),{id:de,type:"file",ref:this.saveFileInput,onClick:function(Z){return Z.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:he,directory:ie?"directory":null,webkitdirectory:ie?"webkitdirectory":null,multiple:Te,onChange:this.onChange})),ue)}}]),U}(N.Component),g=O,x=Object.assign||function(G){for(var U=1;U<arguments.length;U++){var P=arguments[U];for(var H in P)Object.prototype.hasOwnProperty.call(P,H)&&(G[H]=P[H])}return G},E=function(){function G(U,P){for(var H=0;H<P.length;H++){var $=P[H];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(U,$.key,$)}}return function(U,P,H){return P&&G(U.prototype,P),H&&G(U,H),U}}();function T(G,U){if(!(G instanceof U))throw new TypeError("Cannot call a class as a function")}function M(G,U){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:G}function L(G,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);G.prototype=Object.create(U&&U.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(G,U):G.__proto__=U)}function A(){}var V=function(G){L(U,G);function U(){var P,H,$,re;T(this,U);for(var te=arguments.length,ge=Array(te),ve=0;ve<te;ve++)ge[ve]=arguments[ve];return re=(H=($=M(this,(P=U.__proto__||Object.getPrototypeOf(U)).call.apply(P,[this].concat(ge))),$),$.saveUploader=function(de){$.uploader=de},H),M($,re)}return E(U,[{key:"abort",value:function(H){this.uploader.abort(H)}},{key:"render",value:function(){return v.a.createElement(g,x({},this.props,{ref:this.saveUploader}))}}]),U}(N.Component);V.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:A,onError:A,onSuccess:A,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var z=V,W=Q.a=z},HmJG:function(F,Q,j){},IBYe:function(F,Q,j){"use strict";function N(v){return null}Q.a=N},Ib8C:function(F,Q,j){(function(N){(function(v,C){F.exports=Q=C()})(this,function(){var v=v||function(C,k){var y;if(typeof window!="undefined"&&window.crypto&&(y=window.crypto),typeof self!="undefined"&&self.crypto&&(y=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(y=globalThis.crypto),!y&&typeof window!="undefined"&&window.msCrypto&&(y=window.msCrypto),!y&&typeof N!="undefined"&&N.crypto&&(y=N.crypto),!y&&!0)try{y=j(4)}catch(u){}var m=function(){if(y){if(typeof y.getRandomValues=="function")try{return y.getRandomValues(new Uint32Array(1))[0]}catch(u){}if(typeof y.randomBytes=="function")try{return y.randomBytes(4).readInt32LE()}catch(u){}}throw new Error("Native crypto module could not be used to get secure random number.")},S=Object.create||function(){function u(){}return function(f){var w;return u.prototype=f,w=new u,u.prototype=null,w}}(),b={},p=b.lib={},d=p.Base=function(){return{extend:function(u){var f=S(this);return u&&f.mixIn(u),(!f.hasOwnProperty("init")||this.init===f.init)&&(f.init=function(){f.$super.init.apply(this,arguments)}),f.init.prototype=f,f.$super=this,f},create:function(){var u=this.extend();return u.init.apply(u,arguments),u},init:function(){},mixIn:function(u){for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);u.hasOwnProperty("toString")&&(this.toString=u.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),t=p.WordArray=d.extend({init:function(u,f){u=this.words=u||[],f!=k?this.sigBytes=f:this.sigBytes=u.length*4},toString:function(u){return(u||r).stringify(this)},concat:function(u){var f=this.words,w=u.words,_=this.sigBytes,h=u.sigBytes;if(this.clamp(),_%4)for(var R=0;R<h;R++){var O=w[R>>>2]>>>24-R%4*8&255;f[_+R>>>2]|=O<<24-(_+R)%4*8}else for(var g=0;g<h;g+=4)f[_+g>>>2]=w[g>>>2];return this.sigBytes+=h,this},clamp:function(){var u=this.words,f=this.sigBytes;u[f>>>2]&=4294967295<<32-f%4*8,u.length=C.ceil(f/4)},clone:function(){var u=d.clone.call(this);return u.words=this.words.slice(0),u},random:function(u){for(var f=[],w=0;w<u;w+=4)f.push(m());return new t.init(f,u)}}),l=b.enc={},r=l.Hex={stringify:function(u){for(var f=u.words,w=u.sigBytes,_=[],h=0;h<w;h++){var R=f[h>>>2]>>>24-h%4*8&255;_.push((R>>>4).toString(16)),_.push((R&15).toString(16))}return _.join("")},parse:function(u){for(var f=u.length,w=[],_=0;_<f;_+=2)w[_>>>3]|=parseInt(u.substr(_,2),16)<<24-_%8*4;return new t.init(w,f/2)}},i=l.Latin1={stringify:function(u){for(var f=u.words,w=u.sigBytes,_=[],h=0;h<w;h++){var R=f[h>>>2]>>>24-h%4*8&255;_.push(String.fromCharCode(R))}return _.join("")},parse:function(u){for(var f=u.length,w=[],_=0;_<f;_++)w[_>>>2]|=(u.charCodeAt(_)&255)<<24-_%4*8;return new t.init(w,f)}},o=l.Utf8={stringify:function(u){try{return decodeURIComponent(escape(i.stringify(u)))}catch(f){throw new Error("Malformed UTF-8 data")}},parse:function(u){return i.parse(unescape(encodeURIComponent(u)))}},s=p.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new t.init,this._nDataBytes=0},_append:function(u){typeof u=="string"&&(u=o.parse(u)),this._data.concat(u),this._nDataBytes+=u.sigBytes},_process:function(u){var f,w=this._data,_=w.words,h=w.sigBytes,R=this.blockSize,O=R*4,g=h/O;u?g=C.ceil(g):g=C.max((g|0)-this._minBufferSize,0);var x=g*R,E=C.min(x*4,h);if(x){for(var T=0;T<x;T+=R)this._doProcessBlock(_,T);f=_.splice(0,x),w.sigBytes-=E}return new t.init(f,E)},clone:function(){var u=d.clone.call(this);return u._data=this._data.clone(),u},_minBufferSize:0}),c=p.Hasher=s.extend({cfg:d.extend(),init:function(u){this.cfg=this.cfg.extend(u),this.reset()},reset:function(){s.reset.call(this),this._doReset()},update:function(u){return this._append(u),this._process(),this},finalize:function(u){u&&this._append(u);var f=this._doFinalize();return f},blockSize:512/32,_createHelper:function(u){return function(f,w){return new u.init(w).finalize(f)}},_createHmacHelper:function(u){return function(f,w){return new a.HMAC.init(u,w).finalize(f)}}}),a=b.algo={};return b}(Math);return v})}).call(this,j("IyRk"))},J66h:function(F,Q,j){(function(N){var v,C;(function(k,y){F.exports=y(k)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof N!="undefined"?N:this,function(k){"use strict";k=k||{};var y=k.Base64,m="2.6.4",S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=function(A){for(var V={},z=0,W=A.length;z<W;z++)V[A.charAt(z)]=z;return V}(S),p=String.fromCharCode,d=function(A){if(A.length<2){var V=A.charCodeAt(0);return V<128?A:V<2048?p(192|V>>>6)+p(128|V&63):p(224|V>>>12&15)+p(128|V>>>6&63)+p(128|V&63)}else{var V=65536+(A.charCodeAt(0)-55296)*1024+(A.charCodeAt(1)-56320);return p(240|V>>>18&7)+p(128|V>>>12&63)+p(128|V>>>6&63)+p(128|V&63)}},t=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,l=function(A){return A.replace(t,d)},r=function(A){var V=[0,2,1][A.length%3],z=A.charCodeAt(0)<<16|(A.length>1?A.charCodeAt(1):0)<<8|(A.length>2?A.charCodeAt(2):0),W=[S.charAt(z>>>18),S.charAt(z>>>12&63),V>=2?"=":S.charAt(z>>>6&63),V>=1?"=":S.charAt(z&63)];return W.join("")},i=k.btoa&&typeof k.btoa=="function"?function(A){return k.btoa(A)}:function(A){if(A.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return A.replace(/[\s\S]{1,3}/g,r)},o=function(A){return i(l(String(A)))},s=function(A){return A.replace(/[+\/]/g,function(V){return V=="+"?"-":"_"}).replace(/=/g,"")},c=function(A,V){return V?s(o(A)):o(A)},a=function(A){return c(A,!0)},u;k.Uint8Array&&(u=function(A,V){for(var z="",W=0,G=A.length;W<G;W+=3){var U=A[W],P=A[W+1],H=A[W+2],$=U<<16|P<<8|H;z+=S.charAt($>>>18)+S.charAt($>>>12&63)+(typeof P!="undefined"?S.charAt($>>>6&63):"=")+(typeof H!="undefined"?S.charAt($&63):"=")}return V?s(z):z});var f=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(A){switch(A.length){case 4:var V=(7&A.charCodeAt(0))<<18|(63&A.charCodeAt(1))<<12|(63&A.charCodeAt(2))<<6|63&A.charCodeAt(3),z=V-65536;return p((z>>>10)+55296)+p((z&1023)+56320);case 3:return p((15&A.charCodeAt(0))<<12|(63&A.charCodeAt(1))<<6|63&A.charCodeAt(2));default:return p((31&A.charCodeAt(0))<<6|63&A.charCodeAt(1))}},_=function(A){return A.replace(f,w)},h=function(A){var V=A.length,z=V%4,W=(V>0?b[A.charAt(0)]<<18:0)|(V>1?b[A.charAt(1)]<<12:0)|(V>2?b[A.charAt(2)]<<6:0)|(V>3?b[A.charAt(3)]:0),G=[p(W>>>16),p(W>>>8&255),p(W&255)];return G.length-=[0,0,2,1][z],G.join("")},R=k.atob&&typeof k.atob=="function"?function(A){return k.atob(A)}:function(A){return A.replace(/\S{1,4}/g,h)},O=function(A){return R(String(A).replace(/[^A-Za-z0-9\+\/]/g,""))},g=function(A){return _(R(A))},x=function(A){return String(A).replace(/[-_]/g,function(V){return V=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},E=function(A){return g(x(A))},T;k.Uint8Array&&(T=function(A){return Uint8Array.from(O(x(A)),function(V){return V.charCodeAt(0)})});var M=function(){var A=k.Base64;return k.Base64=y,A};if(k.Base64={VERSION:m,atob:O,btoa:i,fromBase64:E,toBase64:c,utob:l,encode:c,encodeURI:a,btou:_,decode:E,noConflict:M,fromUint8Array:u,toUint8Array:T},typeof Object.defineProperty=="function"){var L=function(A){return{value:A,enumerable:!1,writable:!0,configurable:!0}};k.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",L(function(){return E(this)})),Object.defineProperty(String.prototype,"toBase64",L(function(A){return c(this,A)})),Object.defineProperty(String.prototype,"toBase64URI",L(function(){return c(this,!0)}))}}return k.Meteor&&(Base64=k.Base64),F.exports?F.exports.Base64=k.Base64:!(v=[],C=function(){return k.Base64}.apply(Q,v),C!==void 0&&(F.exports=C)),{Base64:k.Base64}})}).call(this,j("IyRk"))},K3mO:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("3y9D"),j("WYAk"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.Base,y=C.WordArray,m=v.algo,S=m.MD5,b=m.EvpKDF=k.extend({cfg:k.extend({keySize:128/32,hasher:S,iterations:1}),init:function(p){this.cfg=this.cfg.extend(p)},compute:function(p,d){for(var t,l=this.cfg,r=l.hasher.create(),i=y.create(),o=i.words,s=l.keySize,c=l.iterations;o.length<s;){t&&r.update(t),t=r.update(p).finalize(d),r.reset();for(var a=1;a<c;a++)t=r.finalize(t),r.reset();i.concat(t)}return i.sigBytes=s*4,i}});v.EvpKDF=function(p,d,t){return b.create(t).compute(p,d)}}(),N.EvpKDF})},KhGG:function(F,Q,j){"use strict";j.d(Q,"a",function(){return h}),j.d(Q,"c",function(){return g});var N=j("0Owb"),v=j("miYZ"),C=j("tsqr"),k=j("oBTY"),y=j("tJVT"),m=j("PpiC"),S=j("k1fw"),b=j("9og8"),p=j("DZo9"),d=j("8z0m"),t=j("WmNS"),l=j.n(t),r=j("cDcd"),i=j.n(r),o=j("ErOA"),s=j("NFKh"),c=j.n(s),a=j("7Cbv"),u=j("9kvl"),f=j("mxV5"),w=j.n(f),_=d.a.Dragger,h=function(T){var M="bf3c199c2470cb477d907b1e0917c17b",L="5183666c72eec9e4",A=c.a.enc.Utf8.parse(M),V=c.a.enc.Utf8.parse(L),z=c.a.AES.decrypt(T,A,{iv:V,mode:c.a.mode.CBC});return z.toString(c.a.enc.Utf8)},R,O=function(){var E=Object(b.a)(l.a.mark(function T(M){var L,A,V,z,W,G,U,P,H,$,re;return l.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return U=M.identifier,P=M.oldFilename,H=M.newFilename,ge.next=3,Object(o.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 3:return $=ge.sent,$.data=JSON.parse(h($.data)),re=new w.a({endpoint:$==null||((L=$.data)===null||L===void 0)?void 0:L.end_point,region:$==null||((A=$.data)===null||A===void 0)?void 0:A.region,accessKeyId:$==null||((V=$.data)===null||V===void 0)?void 0:V.access_key_id,accessKeySecret:$==null||((z=$.data)===null||z===void 0)?void 0:z.access_key_secret,bucket:$==null||((W=$.data)===null||W===void 0)?void 0:W.bucket,stsToken:$==null||((G=$.data)===null||G===void 0)?void 0:G.security_token}),ge.abrupt("return",new Promise(function(ve,de){console.log(11111,"".concat(U,"/").concat(P),"".concat(U,"/").concat(H),$.data),re.copy("/".concat(U,"/").concat(P),"/".concat(U,"/").concat(H)).then(function(De){console.log("\u62F7\u8D1D\u6210\u529F",De)}).catch(function(De){console.log(De);debugger})}));case 7:case"end":return ge.stop()}},T)}));return function(M){return E.apply(this,arguments)}}(),g=function(){var E=Object(b.a)(l.a.mark(function T(M,L,A){var V,z,W,G,U,P,H,$,re,te;return l.a.wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:return L.file_name=M.name,ve.next=3,Object(o.a)("/api/buckets/get_upload_token.json",{method:"get"});case 3:return H=ve.sent,console.log("decrypt(res.data):",h(H.data)),H.data=JSON.parse(h(H.data)),$=M.name.split("."),$.pop(),re=L.realFileName?$:Object(a.a)(),te=new w.a({endpoint:H==null||((V=H.data)===null||V===void 0)?void 0:V.end_point,region:H==null||((z=H.data)===null||z===void 0)?void 0:z.region,accessKeyId:H==null||((W=H.data)===null||W===void 0)?void 0:W.access_key_id,accessKeySecret:H==null||((G=H.data)===null||G===void 0)?void 0:G.access_key_secret,bucket:H==null||((U=H.data)===null||U===void 0)?void 0:U.bucket,stsToken:H==null||((P=H.data)===null||P===void 0)?void 0:P.security_token}),ve.abrupt("return",new Promise(function(de,De){var Te;te.multipartUpload("".concat(re),new Blob([M],{type:M.type}),Object(S.a)(Object(S.a)({timeout:200*1e3,partSize:102400},A),{},{callback:{url:H==null||((Te=H.data)===null||Te===void 0)?void 0:Te.callback_url,host:H==null?void 0:H.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(o.e)(L)}})).then(function(he){var ue;M.response=(ue=he.data)===null||ue===void 0?void 0:ue.data,de(he==null?void 0:he.data)}).catch(function(he){De(he),console.log("err:",he)})}));case 11:case"end":return ve.stop()}},T)}));return function(M,L,A){return E.apply(this,arguments)}}(),x=function(T){var M=T.user,L=T.cancelUpload,A=Object(m.a)(T,["user","cancelUpload"]),V=Object(r.useState)([]),z=Object(y.a)(V,2),W=z[0],G=z[1],U=Object(r.useState)(),P=Object(y.a)(U,2),H=P[0],$=P[1],re={onRemove:function(ve){G(Object(k.a)(W.filter(function(de){return de.name!==ve.name}))),A.onChange(W.filter(function(de){return de.name!==ve.name}))},disabled:A.disabled,multiple:!0,fileList:W==null?void 0:W.map(function(ge){return ge.file}),customRequest:function(){},beforeUpload:function(){var ge=Object(b.a)(l.a.mark(function de(De){var Te;return l.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:if(Te=A.maxSize||1024*1024*1024*1,!W.filter(function(ie){return ie.name===De.name}).length){ue.next=4;break}return C.b.info("".concat(De.name,"\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9")),ue.abrupt("return");case 4:if(!((De==null?void 0:De.size)>Te)){ue.next=7;break}return C.b.info("\u6587\u4EF6\u8D85\u8FC7".concat(Te/1024/1024/1024,"GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42")),ue.abrupt("return",!1);case 7:return W.push({name:De.name,file:De}),G(Object(k.a)(W)),A.onChange(W),ue.abrupt("return",!1);case 11:case"end":return ue.stop()}},de)}));function ve(de){return ge.apply(this,arguments)}return ve}()},te=function(){var ge=Object(b.a)(l.a.mark(function ve(de,De){var Te,he,ue,ie,Se,ne,ce,Oe,oe,q;return l.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return De.file_name=de.name,ce=de.name,Z.next=4,Object(o.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 4:if(Oe=Z.sent,Oe.data=JSON.parse(h(Oe.data)),!((Oe==null?void 0:Oe.status)!==0)){Z.next=12;break}return W[W.findIndex(function(ye){return ye.name===ce})].status="error",W[W.findIndex(function(ye){return ye.name===ce})].file.status="error",A.onChange(W),C.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),Z.abrupt("return");case 12:return H=new w.a({endpoint:Oe==null||((Te=Oe.data)===null||Te===void 0)?void 0:Te.end_point,region:Oe==null||((he=Oe.data)===null||he===void 0)?void 0:he.region,accessKeyId:Oe==null||((ue=Oe.data)===null||ue===void 0)?void 0:ue.access_key_id,accessKeySecret:Oe==null||((ie=Oe.data)===null||ie===void 0)?void 0:ie.access_key_secret,bucket:Oe==null||((Se=Oe.data)===null||Se===void 0)?void 0:Se.bucket,stsToken:Oe==null||((ne=Oe.data)===null||ne===void 0)?void 0:ne.security_token}),console.log(de,"file"),$(H),oe=de.name.split("."),oe.pop(),q=De.realFileName?oe:Object(a.a)(),Z.abrupt("return",new Promise(function(ye,be){try{var Re;H.multipartUpload("".concat(A.identifier,"/").concat(q).concat(ce.indexOf(".")>-1?"."+ce.split(".").pop():""),new Blob([de.file],{type:de.file.type}),{timeout:3600*1e3,partSize:1002400,progress:function(rt,at,qe){try{console.log("\u8FDB\u5EA6",rt,at,qe);var st=W.findIndex(function(lt){return lt.name===ce});W[st].file.percent=rt*100,W[st].tempCheckpoint=at,G(Object(k.a)(W))}catch(lt){}},checkpoint:W[W.findIndex(function(Qe){return Qe.name===ce})].tempCheckpoint,callback:{customValue:{id:ce+""},url:Oe==null||((Re=Oe.data)===null||Re===void 0)?void 0:Re.callback_url,host:Oe==null?void 0:Oe.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(o.e)(De)}}).then(function(Qe){var rt,at=W.findIndex(function(Ie){return Ie.name===ce}),qe="done";if(((rt=Qe.data)===null||rt===void 0?void 0:rt.status)===0){var st;de.response=(st=Qe.data)===null||st===void 0?void 0:st.data;var lt=W.findIndex(function(Ie){return Ie.name===ce});W[lt].status="done",W[lt].file.status="done"}else{var je;C.b.warn((je=Qe.data)===null||je===void 0?void 0:je.message),qe="error"}W[at].status=qe,W[at].file.status=qe,A.onChange(W),ye(Qe==null?void 0:Qe.data)}).catch(function(Qe){W[W.findIndex(function(rt){return rt.name===ce})].status="error",W[W.findIndex(function(rt){return rt.name===ce})].file.status="error",C.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),G(Object(k.a)(W)),A.onChange(W),be(Qe),console.log("err:",Qe)})}catch(Qe){}}));case 19:case"end":return Z.stop()}},ve)}));return function(de,De){return ge.apply(this,arguments)}}();return Object(r.useEffect)(function(){W.every(function(ge){return ge==="done"||ge==="error"})&&A.onComplete(W)},[W]),Object(r.useEffect)(function(){if(L){var ge;(ge=H)===null||ge===void 0||ge.cancel()}},[L]),Object(r.useEffect)(function(){A.uploading&&W.map(function(){var ge=Object(b.a)(l.a.mark(function ve(de){var De,Te;return l.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:if(!((!de.status||de.status==="error")&&!L)){ue.next=6;break}return de.status="uploading",de.file.status="uploading",ue.next=5,te(de,{login:M==null||((De=M.userInfo)===null||De===void 0)?void 0:De.login,container_type:A.container_type,container_id:A.container_id,description:A.description,realFileName:A.realFileName});case 5:Te=ue.sent;case 6:case"end":return ue.stop()}},ve)}));return function(ve){return ge.apply(this,arguments)}}())},[A.uploading]),i.a.createElement(_,Object(N.a)({},re,{height:A.height,className:A.className}),i.a.createElement("p",{className:"ant-upload-hint"},A.text||"\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))};Q.b=Object(u.a)(function(E){var T=E.loading,M=E.globalSetting,L=E.user;return{globalSetting:M,loading:T.models.competitions,user:L}})(x)},KmYQ:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.pad.ZeroPadding={pad:function(v,C){var k=C*4;v.clamp(),v.sigBytes+=k-(v.sigBytes%k||k)},unpad:function(v){for(var C=v.words,k=v.sigBytes-1,k=v.sigBytes-1;k>=0;k--)if(C[k>>>2]>>>24-k%4*8&255){v.sigBytes=k+1;break}}},N.pad.ZeroPadding})},L9qf:function(F,Q,j){F.exports={flex_box_center:"flex_box_center___3J7Qj",flex_space_between:"flex_space_between___3P3xx",flex_box_vertical_center:"flex_box_vertical_center___3QrMz",flex_box_center_end:"flex_box_center_end___37g4V",flex_box_column:"flex_box_column___2PxMN",wrap:"wrap___1xDeN",in:"in___364z1",btns:"btns___8vHXH",customModal:"customModal___2Vkln"}},LdHM:function(F,Q,j){"use strict";j.d(Q,"b",function(){return f}),j.d(Q,"a",function(){return _});var N=j("1OyB"),v=j("vuIU"),C=j("Ji7U"),k=j("LK+K"),y=j("cDcd"),m=j("rePB"),S=j("Ff2n"),b=j("ODXe"),p=j("4IlW"),d=j("bX4T"),t=j("YrtM"),l=j("TSYQ"),r=j.n(l),i=j("+nKL"),o=j("8OUc"),s=function(H,$){var re=H.prefixCls,te=H.id,ge=H.flattenOptions,ve=H.childrenAsData,de=H.values,De=H.searchValue,Te=H.multiple,he=H.defaultActiveFirstOption,ue=H.height,ie=H.itemHeight,Se=H.notFoundContent,ne=H.open,ce=H.menuItemSelectedIcon,Oe=H.virtual,oe=H.onSelect,q=H.onToggleOpen,Y=H.onActiveValue,Z=H.onScroll,ye=H.onMouseEnter,be="".concat(re,"-item"),Re=Object(t.a)(function(){return ge},[ne,ge],function(Ze,Ne){return Ne[0]&&Ze[1]!==Ne[1]}),Qe=y.useRef(null),rt=function(Ne){Ne.preventDefault()},at=function(Ne){Qe.current&&Qe.current.scrollTo({index:Ne})},qe=function(Ne){for(var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Me=Re.length,Ee=0;Ee<Me;Ee+=1){var Ce=(Ne+Ee*Ae+Me)%Me,ke=Re[Ce],Fe=ke.group,Be=ke.data;if(!Fe&&!Be.disabled)return Ce}return-1},st=y.useState(function(){return qe(0)}),lt=Object(b.a)(st,2),je=lt[0],Ie=lt[1],tt=function(Ne){Ie(Ne);var Ae=Re[Ne];if(!Ae){Y(null,-1);return}Y(Ae.data.value,Ne)};y.useEffect(function(){tt(he!==!1?qe(0):-1)},[Re.length,De]),y.useEffect(function(){var Ze=setTimeout(function(){if(!Te&&ne&&de.size===1){var Ne=Array.from(de)[0],Ae=Re.findIndex(function(Me){var Ee=Me.data;return Ee.value===Ne});tt(Ae),at(Ae)}});return function(){return clearTimeout(Ze)}},[ne]);var ot=function(Ne){Ne!==void 0&&oe(Ne,{selected:!de.has(Ne)}),Te||q(!1)};if(y.useImperativeHandle($,function(){return{onKeyDown:function(Ne){var Ae=Ne.which;switch(Ae){case p.a.UP:case p.a.DOWN:{var Me=0;if(Ae===p.a.UP?Me=-1:Ae===p.a.DOWN&&(Me=1),Me!==0){var Ee=qe(je+Me,Me);at(Ee),tt(Ee)}break}case p.a.ENTER:{var Ce=Re[je];Ce&&!Ce.data.disabled?ot(Ce.data.value):ot(void 0),ne&&Ne.preventDefault();break}case p.a.ESC:q(!1)}},onKeyUp:function(){},scrollTo:function(Ne){at(Ne)}}}),Re.length===0)return y.createElement("div",{role:"listbox",id:"".concat(te,"_list"),className:"".concat(be,"-empty"),onMouseDown:rt},Se);function ze(Ze){var Ne=Re[Ze];if(!Ne)return null;var Ae=Ne.data||{},Me=Ae.value,Ee=Ae.label,Ce=Ae.children,ke=Object(d.a)(Ae,!0),Fe=ve?Ce:Ee;return Ne?y.createElement("div",Object.assign({"aria-label":typeof Fe=="string"?Fe:null},ke,{key:Ze,role:"option",id:"".concat(te,"_list_").concat(Ze),"aria-selected":de.has(Me)}),Me):null}return y.createElement(y.Fragment,null,y.createElement("div",{role:"listbox",id:"".concat(te,"_list"),style:{height:0,width:0,overflow:"hidden"}},ze(je-1),ze(je),ze(je+1)),y.createElement(i.a,{itemKey:"key",ref:Qe,data:Re,height:ue,itemHeight:ie,fullHeight:!1,onMouseDown:rt,onScroll:Z,virtual:Oe,onMouseEnter:ye},function(Ze,Ne){var Ae,Me=Ze.group,Ee=Ze.groupOption,Ce=Ze.data,ke=Ce.label,Fe=Ce.key;if(Me)return y.createElement("div",{className:r()(be,"".concat(be,"-group"))},ke!==void 0?ke:Fe);var Be=Ce.disabled,et=Ce.value,ct=Ce.title,yt=Ce.children,ft=Ce.style,mt=Ce.className,It=Object(S.a)(Ce,["disabled","value","title","children","style","className"]),At=de.has(et),_t="".concat(be,"-option"),Vt=r()(be,_t,mt,(Ae={},Object(m.a)(Ae,"".concat(_t,"-grouped"),Ee),Object(m.a)(Ae,"".concat(_t,"-active"),je===Ne&&!Be),Object(m.a)(Ae,"".concat(_t,"-disabled"),Be),Object(m.a)(Ae,"".concat(_t,"-selected"),At),Ae)),Kt=ve?yt:ke,tr=!ce||typeof ce=="function"||At;return y.createElement("div",Object.assign({},It,{"aria-selected":At,className:Vt,title:ct,onMouseMove:function(){if(je===Ne||Be)return;tt(Ne)},onClick:function(){Be||ot(et)},style:ft}),y.createElement("div",{className:"".concat(_t,"-content")},Kt||et),y.isValidElement(ce)||At,tr&&y.createElement(o.a,{className:"".concat(be,"-option-state"),customizeIcon:ce,customizeIconProps:{isSelected:At}},At?"\u2713":null))}))},c=y.forwardRef(s);c.displayName="OptionList";var a=c,u=function(){return null};u.isSelectOption=!0;var f=u,w=function(){return null};w.isSelectOptGroup=!0;var _=w,h=j("VTBJ"),R=j("Zm9Q");function O(P){var H=P.key,$=P.props,re=$.children,te=$.value,ge=Object(S.a)($,["children","value"]);return Object(h.a)({key:H,value:te!==void 0?te:H,children:re},ge)}function g(P){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(P).map(function($,re){if(!y.isValidElement($)||!$.type)return null;var te=$.type.isSelectOptGroup,ge=$.key,ve=$.props,de=ve.children,De=Object(S.a)(ve,["children"]);return H||!te?O($):Object(h.a)(Object(h.a)({key:"__RC_SELECT_GRP__".concat(ge===null?re:ge,"__"),label:ge},De),{},{options:g(de)})}).filter(function($){return $})}var x=j("2Qr1"),E=j("qNPg"),T=j("U8pU"),M=j("Kwbf"),L=j("WKfj");function A(P){var H=P.mode,$=P.options,re=P.children,te=P.backfill,ge=P.allowClear,ve=P.placeholder,de=P.getInputElement,De=P.showSearch,Te=P.onSearch,he=P.defaultOpen,ue=P.autoFocus,ie=P.labelInValue,Se=P.value,ne=P.inputValue,ce=P.optionLabelProp,Oe=H==="multiple"||H==="tags",oe=De!==void 0?De:Oe||H==="combobox",q=$||g(re);if(Object(M.a)(H!=="tags"||q.every(function(be){return!be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var Y=q.some(function(be){return be.options?be.options.some(function(Re){return typeof("value"in Re?Re.value:Re.key)=="number"}):typeof("value"in be?be.value:be.key)=="number"});Object(M.a)(!Y,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(M.a)(H!=="combobox"||!ce,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(M.a)(H==="combobox"||!te,"`backfill` only works with `combobox` mode."),Object(M.a)(H==="combobox"||!de,"`getInputElement` only work with `combobox` mode."),Object(M.b)(H!=="combobox"||!de||!ge||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Te&&!oe&&H!=="combobox"&&H!=="tags"&&Object(M.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(M.b)(!he||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Se!=null){var Z=Object(L.d)(Se);Object(M.a)(!ie||Z.every(function(be){return Object(T.a)(be)==="object"&&("key"in be||"value"in be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(M.a)(!Oe||Array.isArray(Se),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var ye=null;Object(R.a)(re).some(function(be){if(!y.isValidElement(be)||!be.type)return!1;var Re=be.type;if(Re.isSelectOption)return!1;if(Re.isSelectOptGroup){var Qe=Object(R.a)(be.props.children).every(function(rt){return!y.isValidElement(rt)||!be.type||rt.type.isSelectOption?!0:(ye=rt.type,!1)});return!Qe}return ye=Re,!0}),ye&&Object(M.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ye.displayName||ye.name||ye,"`.")),Object(M.a)(ne===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var V=A,z=Object(E.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:g,flattenOptions:x.d,getLabeledValue:x.e,filterOptions:x.b,isValueDisabled:x.g,findValueOption:x.c,warningProps:V,fillOptionsWithMissingValue:x.a}),W=function(P){Object(C.a)($,P);var H=Object(k.a)($);function $(){var re;return Object(N.a)(this,$),re=H.apply(this,arguments),re.selectRef=y.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(v.a)($,[{key:"render",value:function(){return y.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),$}(y.Component);W.Option=f,W.OptGroup=_;var G=W,U=Q.c=G},M8RZ:function(F,Q,j){"use strict";j.d(Q,"a",function(){return p});var N=j("fWQN"),v=j("mtLc"),C=j("yKVA"),k=j("879j"),y=j("cDcd"),m=j.n(y),S=j("faye"),b=j.n(S),p=function(d){Object(C.a)(l,d);var t=Object(k.a)(l);function l(r){var i;Object(N.a)(this,l),i=t.call(this,r);var o=window.document;return i.node=o.createElement("div"),o.body.appendChild(i.node),i}return Object(v.a)(l,[{key:"render",value:function(){var i=this.props.children;return Object(S.createPortal)(i,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),l}(m.a.Component)},MFOe:function(F,Q,j){(function(N){var v=m(),C=S(),k=b(),y=typeof window!="undefined"?window:N;F.exports={assign:v,create:C,trim:k,bind:p,slice:d,each:t,map:l,pluck:r,isList:i,isFunction:o,isObject:s,Global:y};function m(){return Object.assign?Object.assign:function(a,u,f,w){for(var _=1;_<arguments.length;_++)t(Object(arguments[_]),function(h,R){a[R]=h});return a}}function S(){if(Object.create)return function(u,f,w,_){var h=d(arguments,1);return v.apply(this,[Object.create(u)].concat(h))};{function c(){}return function(u,f,w,_){var h=d(arguments,1);return c.prototype=u,v.apply(this,[new c].concat(h))}}}function b(){return String.prototype.trim?function(a){return String.prototype.trim.call(a)}:function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function p(c,a){return function(){return a.apply(c,Array.prototype.slice.call(arguments,0))}}function d(c,a){return Array.prototype.slice.call(c,a||0)}function t(c,a){r(c,function(u,f){return a(u,f),!1})}function l(c,a){var u=i(c)?[]:{};return r(c,function(f,w){return u[w]=a(f,w),!1}),u}function r(c,a){if(i(c)){for(var u=0;u<c.length;u++)if(a(c[u],u))return c[u]}else for(var f in c)if(c.hasOwnProperty(f)&&a(c[f],f))return c[f]}function i(c){return c!=null&&typeof c!="function"&&typeof c.length=="number"}function o(c){return c&&{}.toString.call(c)==="[object Function]"}function s(c){return c&&{}.toString.call(c)==="[object Object]"}}).call(this,j("IyRk"))},MlIO:function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(v){var C=N,k=C.lib,y=k.Base,m=k.WordArray,S=C.x64={},b=S.Word=y.extend({init:function(d,t){this.high=d,this.low=t}}),p=S.WordArray=y.extend({init:function(d,t){d=this.words=d||[],t!=v?this.sigBytes=t:this.sigBytes=d.length*8},toX32:function(){for(var d=this.words,t=d.length,l=[],r=0;r<t;r++){var i=d[r];l.push(i.high),l.push(i.low)}return m.create(l,this.sigBytes)},clone:function(){for(var d=y.clone.call(this),t=d.words=this.words.slice(0),l=t.length,r=0;r<l;r++)t[r]=t[r].clone();return d}})}(),N})},NFKh:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("MlIO"),j("F+F2"),j("qM6L"),j("ETIr"),j("wbyO"),j("cv67"),j("3y9D"),j("lPiR"),j("GRuw"),j("1uat"),j("uGsb"),j("5hvy"),j("ELcG"),j("WYAk"),j("e7zE"),j("K3mO"),j("OLod"),j("ALsQ"),j("9OqN"),j("qu8F"),j("S6kV"),j("gb/T"),j("qBft"),j("oRuE"),j("jO9C"),j("KmYQ"),j("uGxW"),j("bQjk"),j("wZgz"),j("pA7S"),j("w7YG"),j("E4JC"),j("PVpz"))})(this,function(N){return N})},NvD2:function(F,Q,j){"use strict";j.d(Q,"a",function(){return m});var N=j("Kwbf");function v(S,b){var p=new Set;return S.forEach(function(d){b.has(d)||p.add(d)}),p}function C(S){var b=S||{},p=b.disabled,d=b.disableCheckbox,t=b.checkable;return!!(p||d)||t===!1}function k(S,b,p,d){for(var t=new Set(S),l=new Set,r=0;r<=p;r+=1){var i=b.get(r)||new Set;i.forEach(function(a){var u=a.key,f=a.node,w=a.children,_=w===void 0?[]:w;t.has(u)&&!d(f)&&_.filter(function(h){return!d(h.node)}).forEach(function(h){t.add(h.key)})})}for(var o=new Set,s=p;s>=0;s-=1){var c=b.get(s)||new Set;c.forEach(function(a){var u=a.parent,f=a.node;if(d(f)||!a.parent||o.has(a.parent.key))return;if(d(a.parent.node)){o.add(u.key);return}var w=!0,_=!1;(u.children||[]).filter(function(h){return!d(h.node)}).forEach(function(h){var R=h.key,O=t.has(R);w&&!O&&(w=!1),!_&&(O||l.has(R))&&(_=!0)}),w&&t.add(u.key),_&&l.add(u.key),o.add(u.key)})}return{checkedKeys:Array.from(t),halfCheckedKeys:Array.from(v(l,t))}}function y(S,b,p,d,t){for(var l=new Set(S),r=new Set(b),i=0;i<=d;i+=1){var o=p.get(i)||new Set;o.forEach(function(u){var f=u.key,w=u.node,_=u.children,h=_===void 0?[]:_;!l.has(f)&&!r.has(f)&&!t(w)&&h.filter(function(R){return!t(R.node)}).forEach(function(R){l.delete(R.key)})})}r=new Set;for(var s=new Set,c=d;c>=0;c-=1){var a=p.get(c)||new Set;a.forEach(function(u){var f=u.parent,w=u.node;if(t(w)||!u.parent||s.has(u.parent.key))return;if(t(u.parent.node)){s.add(f.key);return}var _=!0,h=!1;(f.children||[]).filter(function(R){return!t(R.node)}).forEach(function(R){var O=R.key,g=l.has(O);_&&!g&&(_=!1),!h&&(g||r.has(O))&&(h=!0)}),_||l.delete(f.key),h&&r.add(f.key),s.add(f.key)})}return{checkedKeys:Array.from(l),halfCheckedKeys:Array.from(v(r,l))}}function m(S,b,p,d){var t=[],l;d?l=d:l=C;var r=new Set(S.filter(function(c){var a=!!p[c];return a||t.push(c),a})),i=new Map,o=0;Object.keys(p).forEach(function(c){var a=p[c],u=a.level,f=i.get(u);f||(f=new Set,i.set(u,f)),f.add(a),o=Math.max(o,u)}),Object(N.a)(!t.length,"Tree missing follow keys: ".concat(t.slice(0,100).map(function(c){return"'".concat(c,"'")}).join(", ")));var s;return b===!0?s=k(r,i,o,l):s=y(r,b.halfCheckedKeys,i,o,l),s}},OLod:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("K3mO"))})(this,function(N){N.lib.Cipher||function(v){var C=N,k=C.lib,y=k.Base,m=k.WordArray,S=k.BufferedBlockAlgorithm,b=C.enc,p=b.Utf8,d=b.Base64,t=C.algo,l=t.EvpKDF,r=k.Cipher=S.extend({cfg:y.extend(),createEncryptor:function(E,T){return this.create(this._ENC_XFORM_MODE,E,T)},createDecryptor:function(E,T){return this.create(this._DEC_XFORM_MODE,E,T)},init:function(E,T,M){this.cfg=this.cfg.extend(M),this._xformMode=E,this._key=T,this.reset()},reset:function(){S.reset.call(this),this._doReset()},process:function(E){return this._append(E),this._process()},finalize:function(E){E&&this._append(E);var T=this._doFinalize();return T},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function E(T){return typeof T=="string"?x:R}return function(T){return{encrypt:function(M,L,A){return E(L).encrypt(T,M,L,A)},decrypt:function(M,L,A){return E(L).decrypt(T,M,L,A)}}}}()}),i=k.StreamCipher=r.extend({_doFinalize:function(){var E=this._process(!0);return E},blockSize:1}),o=C.mode={},s=k.BlockCipherMode=y.extend({createEncryptor:function(E,T){return this.Encryptor.create(E,T)},createDecryptor:function(E,T){return this.Decryptor.create(E,T)},init:function(E,T){this._cipher=E,this._iv=T}}),c=o.CBC=function(){var E=s.extend();E.Encryptor=E.extend({processBlock:function(M,L){var A=this._cipher,V=A.blockSize;T.call(this,M,L,V),A.encryptBlock(M,L),this._prevBlock=M.slice(L,L+V)}}),E.Decryptor=E.extend({processBlock:function(M,L){var A=this._cipher,V=A.blockSize,z=M.slice(L,L+V);A.decryptBlock(M,L),T.call(this,M,L,V),this._prevBlock=z}});function T(M,L,A){var V,z=this._iv;z?(V=z,this._iv=v):V=this._prevBlock;for(var W=0;W<A;W++)M[L+W]^=V[W]}return E}(),a=C.pad={},u=a.Pkcs7={pad:function(E,T){for(var M=T*4,L=M-E.sigBytes%M,A=L<<24|L<<16|L<<8|L,V=[],z=0;z<L;z+=4)V.push(A);var W=m.create(V,L);E.concat(W)},unpad:function(E){var T=E.words[E.sigBytes-1>>>2]&255;E.sigBytes-=T}},f=k.BlockCipher=r.extend({cfg:r.cfg.extend({mode:c,padding:u}),reset:function(){var E;r.reset.call(this);var T=this.cfg,M=T.iv,L=T.mode;this._xformMode==this._ENC_XFORM_MODE?E=L.createEncryptor:(E=L.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==E?this._mode.init(this,M&&M.words):(this._mode=E.call(L,this,M&&M.words),this._mode.__creator=E)},_doProcessBlock:function(E,T){this._mode.processBlock(E,T)},_doFinalize:function(){var E,T=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(T.pad(this._data,this.blockSize),E=this._process(!0)):(E=this._process(!0),T.unpad(E)),E},blockSize:128/32}),w=k.CipherParams=y.extend({init:function(E){this.mixIn(E)},toString:function(E){return(E||this.formatter).stringify(this)}}),_=C.format={},h=_.OpenSSL={stringify:function(E){var T,M=E.ciphertext,L=E.salt;return L?T=m.create([1398893684,1701076831]).concat(L).concat(M):T=M,T.toString(d)},parse:function(E){var T,M=d.parse(E),L=M.words;return L[0]==1398893684&&L[1]==1701076831&&(T=m.create(L.slice(2,4)),L.splice(0,4),M.sigBytes-=16),w.create({ciphertext:M,salt:T})}},R=k.SerializableCipher=y.extend({cfg:y.extend({format:h}),encrypt:function(E,T,M,L){L=this.cfg.extend(L);var A=E.createEncryptor(M,L),V=A.finalize(T),z=A.cfg;return w.create({ciphertext:V,key:M,iv:z.iv,algorithm:E,mode:z.mode,padding:z.padding,blockSize:E.blockSize,formatter:L.format})},decrypt:function(E,T,M,L){L=this.cfg.extend(L),T=this._parse(T,L.format);var A=E.createDecryptor(M,L).finalize(T.ciphertext);return A},_parse:function(E,T){return typeof E=="string"?T.parse(E,this):E}}),O=C.kdf={},g=O.OpenSSL={execute:function(E,T,M,L){L||(L=m.random(64/8));var A=l.create({keySize:T+M}).compute(E,L),V=m.create(A.words.slice(T),M*4);return A.sigBytes=T*4,w.create({key:A,iv:V,salt:L})}},x=k.PasswordBasedCipher=R.extend({cfg:R.cfg.extend({kdf:g}),encrypt:function(E,T,M,L){L=this.cfg.extend(L);var A=L.kdf.execute(M,E.keySize,E.ivSize);L.iv=A.iv;var V=R.encrypt.call(this,E,T,A.key,L);return V.mixIn(A),V},decrypt:function(E,T,M,L){L=this.cfg.extend(L),T=this._parse(T,L.format);var A=L.kdf.execute(M,E.keySize,E.ivSize,T.salt);L.iv=A.iv;var V=R.decrypt.call(this,E,T,A.key,L);return V}})}()})},OZM5:function(F,Q,j){"use strict";j.d(Q,"b",function(){return d}),j.d(Q,"a",function(){return t}),j.d(Q,"k",function(){return l}),j.d(Q,"h",function(){return r}),j.d(Q,"i",function(){return i}),j.d(Q,"g",function(){return o}),j.d(Q,"c",function(){return s}),j.d(Q,"d",function(){return c}),j.d(Q,"j",function(){return f}),j.d(Q,"e",function(){return w}),j.d(Q,"f",function(){return _});var N=j("KQm4"),v=j("U8pU"),C=j("Ff2n"),k=j("cDcd"),y=j.n(k),m=j("Kwbf"),S=j("WaYH"),b=.25,p=2;function d(h,R){var O=h.slice(),g=O.indexOf(R);return g>=0&&O.splice(g,1),O}function t(h,R){var O=h.slice();return O.indexOf(R)===-1&&O.push(R),O}function l(h){return h.split("-")}function r(h,R){return"".concat(h,"-").concat(R)}function i(h){return h&&h.type&&h.type.isTreeNode}function o(h,R){var O=[h],g=R[h];function x(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];E.forEach(function(T){var M=T.key,L=T.children;O.push(M),x(L)})}return x(g.children),O}function s(h,R){var O=h.clientY,g=R.selectHandle.getBoundingClientRect(),x=g.top,E=g.bottom,T=g.height,M=Math.max(T*b,p);return O<=x+M?-1:O>=E-M?1:0}function c(h,R){if(!h)return;var O=R.multiple;return O?h.slice():h.length?[h[0]]:h}var a=function(R){return R};function u(h,R){if(!h)return[];var O=R||{},g=O.processProps,x=g===void 0?a:g,E=Array.isArray(h)?h:[h];return E.map(function(T){var M=T.children,L=Object(C.a)(T,["children"]),A=u(M,R);return y.a.createElement(S.a,Object.assign({},x(L)),A)})}function f(h){if(!h)return null;var R;if(Array.isArray(h))R={checkedKeys:h,halfCheckedKeys:void 0};else if(Object(v.a)(h)==="object")R={checkedKeys:h.checked||void 0,halfCheckedKeys:h.halfChecked||void 0};else return Object(m.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function w(h,R){var O=new Set;function g(x){if(O.has(x))return;var E=R[x];if(!E)return;O.add(x);var T=E.parent,M=E.node;if(M.disabled)return;T&&g(T.key)}return(h||[]).forEach(function(x){g(x)}),Object(N.a)(O)}function _(h){var R={};return Object.keys(h).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(R[O]=h[O])}),R}},Ot1p:function(F,Q,j){"use strict";var N=j("2qtc"),v=j("kLXV"),C=j("rAM+"),k=j("miYZ"),y=j("tsqr"),m=j("9og8"),S=j("tJVT"),b=j("jrin"),p=j("WmNS"),d=j.n(p),t=j("cDcd"),l=j.n(t),r=j("VrN/"),i=j.n(r),o=j("bdgK"),s=j("p77/"),c=j("Bd2K"),a=j("ELLl"),u=j("19Vz"),f=j("lZu9"),w=j("+NIl"),_=j("kSUc"),h=j("9Bee"),R=function(Be){var et=Be.value,ct=et===void 0?"":et,yt=Be.className,ft=Be.showTextOnly,mt=Be.showLines,It=Be.style,At=It===void 0?{}:It,_t=Object(t.useMemo)(function(){return""},[ct]);return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{dangerouslySetInnerHTML:{__html:_t}}))},O=j("0Owb"),g=j("dejd"),x=j("C+DQ"),E=j("1vsH"),T=j("m3rI"),M=[{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 L(Be){var et=Be.onActionCallback,ct=Be.title,yt=Be.icon,ft=Be.actionName,mt=Be.className,It=mt===void 0?"":mt,At=Be.children;function _t(){et(ft)}return l.a.createElement("a",{title:ct,className:It,onClick:_t},l.a.createElement("i",{className:"md-iconfont ".concat(yt)}),At)}var A=function(Be){var et=Be.watch,ct=Be.showNullButton,yt=Be.onActionCallback,ft=Be.fullScreen,mt=Be.insertTemp,It=Be.hidetoolBar,At=Be.uuid,_t=Be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(E.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(E.G)("_educoder_session"),"&key=").concat(At,"&api=").concat(encodeURIComponent(T.a.PROXY_SERVER)));var Vt=[].concat(M,[{title:"".concat(et?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(et?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return l.a.createElement("ul",{className:"markdown-toolbar-container"},!It&&Vt.map(function(Kt,tr){return l.a.createElement("li",{key:tr},Kt.actionName?l.a.createElement(L,Object(O.a)({},Kt,{onActionCallback:yt})):l.a.createElement("span",{className:"v-line"}))}),ct?l.a.createElement("li",null,l.a.createElement(L,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:yt},l.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,mt&&l.a.createElement("li",null,l.a.createElement(L,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(mt),onActionCallback:yt},l.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),l.a.createElement("li",{className:"btn-full-screen"},l.a.createElement(L,{icon:"".concat(ft?"icon-shrink":"icon-enlarge"),title:ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:yt})))},V=j("M8RZ"),z=j("+L6B"),W=j("2/Rp"),G=j("y8nQ"),U=j("Vl3Y"),P=j("5NDa"),H=j("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},re=function(Be){var et=Be.callback,ct=Be.onCancel;function yt(ft){et(ft)}return l.a.createElement(U.a,Object(O.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:yt}),l.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},l.a.createElement(H.a,null)),l.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},l.a.createElement(H.a,null)),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(W.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},te=j("7ahc"),ge=j("HmJG"),ve=j("BjJ7"),de=U.a.useForm,De={width:280,marginRight:10},Te={labelCol:{span:5},wrapperCol:{span:19}},he=function(Be){var et=Be.callback,ct=Be.onCancel,yt=de(),ft=Object(S.a)(yt,1),mt=ft[0];function It(Vt){et(Vt)}function At(Vt,Kt){if(Vt.status===-1){y.b.error(Vt.message);return}mt.setFieldsValue({src:"/api/attachments/".concat(Vt.id),type:Kt.type})}function _t(Vt){var Kt=Vt.target.files[0];ie(Kt,At)}return l.a.createElement(U.a,Object(O.a)({form:mt},Te,{className:"upload-image-panel",onFinish:It}),l.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},l.a.createElement("div",{className:"flex-container"},l.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},l.a.createElement(H.a,{style:De})),l.a.createElement(ue,{onFileChange:_t}))),l.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},l.a.createElement(H.a,{style:{width:264}})),l.a.createElement(U.a.Item,{style:{textAlign:"right"}},l.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(W.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))};function ue(Be){var et=Be.onFileChange;return l.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",l.a.createElement("input",{type:"file",onChange:et}))}function ie(Be,et){if(!Be)throw new String("\u6CA1\u6709\u6587\u4EF6");var ct=new FormData;ct.append("editormd-image-file",Be),ct.append("file_param_name","editormd-image-file"),ct.append("byxhr","true");var yt=new window.XMLHttpRequest;yt.withCredentials=!0,yt.addEventListener("load",function(ft){et(JSON.parse(ft.target.responseText),Be)},!1),yt.addEventListener("error",function(ft){console.error(ft)},!1),yt.open("POST","".concat(ve.a,"/api/attachments.json")),yt.send(ct)}var Se=j("giR+"),ne=j("fyUT"),ce=j("7Kak"),Oe=j("9yH6"),oe=Oe.a.Group,q={margin:"0 8px"},Y=function(Be){var et=Be.callback,ct=Be.onCancel;function yt(ft){et(ft)}return l.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:yt},l.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},l.a.createElement("span",{style:q},"\u5355\u5143\u683C\u6570\uFF1A"),l.a.createElement("span",{style:q},"\u884C\u6570"),l.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},l.a.createElement(ne.a,null)),l.a.createElement("span",{style:q},"\u5217\u6570"),l.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},l.a.createElement(ne.a,null))),l.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},l.a.createElement("span",{style:q},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),l.a.createElement(U.a.Item,{name:"align"},l.a.createElement(oe,null,l.a.createElement(Oe.a,{value:"default"},l.a.createElement("i",{className:"fa fa-align-justify"})),l.a.createElement(Oe.a,{value:"left"},l.a.createElement("i",{className:"fa fa-align-left"})),l.a.createElement(Oe.a,{value:"center"},l.a.createElement("i",{className:"fa fa-align-center"})),l.a.createElement(Oe.a,{value:"right"},l.a.createElement("i",{className:"fa fa-align-right"}))))),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(W.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},Z=j("ErOA"),ye=j("7Cbv"),be="link",Re="upload-image",Qe="code-block",rt="add-table",at="------------",qe={default:at,left:":".concat(at),center:":".concat(at,":"),right:"".concat(at,":")},st=j("9VGf"),lt,je;function Ie(){}var tt=0,ot=1e4,ze="\u2581",Ze=`
|
|
|
**\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 Ne(Be){return/^\d+$/.test(Be)?"".concat(Be,"px"):Be}var Ae=navigator.platform.toUpperCase().indexOf("MAC")>=0,Me=Ae?"Cmd":"Ctrl",Ee=["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"],Ce=(lt={},Object(b.a)(lt,Me+"-B","bold"),Object(b.a)(lt,Me+"-I","italic"),lt),ke=(je={},Object(b.a)(je,be,"\u6DFB\u52A0\u94FE\u63A5"),Object(b.a)(je,Qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(b.a)(je,Re,"\u6DFB\u52A0\u6587\u4EF6"),Object(b.a)(je,rt,"\u6DFB\u52A0\u8868\u683C"),je),Fe=Q.a=function(Be){var et=Be.defaultValue,ct=et===void 0?"":et,yt=Be.onChange,ft=Be.width,mt=ft===void 0?"100%":ft,It=Be.height,At=It===void 0?400:It,_t=Be.miniToolbar,Vt=_t===void 0?!1:_t,Kt=Be.isFocus,tr=Kt===void 0?!1:Kt,rr=Be.watch,Wt=Be.insertTemp,Lt=Be.mode,nr=Lt===void 0?"markdown":Lt,dt=Be.id,Et=dt===void 0?"markdown-editor-id":dt,jt=Be.showResizeBar,kt=jt===void 0?!1:jt,hr=Be.noStorage,Nn=hr===void 0?!1:hr,Ct=Be.showNullButton,Dt=Ct===void 0?!1:Ct,wt=Be.hidetoolBar,wr=wt===void 0?!1:wt,Cr=Be.fullScreen,Jt=Cr===void 0?!1:Cr,Ut=Be.onBlur,Or=Be.onCMBeforeChange,un=Be.onFullScreen,Nr=Be.className,bt=Nr===void 0?"":Nr,Bt=Be.disablePaste,Jr=Bt===void 0?!1:Bt,on=Be.placeholder,Ln=on===void 0?"":on,Sn=Be.values,le=Sn===void 0?"":Sn,K=Object(t.useState)(null),X=Object(S.a)(K,2),ee=X[0],me=X[1],ae=Object(t.useState)(ct),Ke=Object(S.a)(ae,2),pt=Ke[0],Ot=Ke[1],Ht=Object(t.useState)(rr),vt=Object(S.a)(Ht,2),Xt=vt[0],qt=vt[1],Hr=Object(t.useState)(Jt),nn=Object(S.a)(Hr,2),zr=nn[0],or=nn[1],Qr=Object(t.useState)(""),Cn=Object(S.a)(Qr,2),zt=Cn[0],pr=Cn[1],fr=Object(t.useState)(0),jr=Object(S.a)(fr,2),Er=jr[0],li=jr[1],On=Object(t.useState)(At),Ui=Object(S.a)(On,2),Bi=Ui[0],qn=Ui[1],sn=Object(t.useState)(!1),Si=Object(S.a)(sn,2),dn=Si[0],Yn=Si[1],Zr=Object(t.useRef)(Object(ye.a)()),cr=Object(t.useRef)(!1),tn=Object(t.useRef)(),br=Object(t.useRef)(),hn=Object(t.useRef)(),Fr=Object(t.useRef)(),mi=Object(t.useRef)(),_n=function(){var Yt=Object(m.a)(d.a.mark(function sr(){var Qt,gr;return d.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:return Kr.next=2,Object(Z.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Zr.current}});case 2:gr=Kr.sent,gr!=null&&(Qt=gr.attachments)!==null&&Qt!==void 0&&Qt.length&&(console.log("cm:",ee,br),gr.attachments.map(function(Ar){Ar.content_type.indexOf("image")>-1?ee.replaceSelection(".concat(Ar.content_type,")")):Ar.content_type.indexOf("video")>-1?ee.replaceSelection('<video width="100%" controls src="'.concat(T.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ar.content_type.indexOf("pdf")>-1?ee.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Ar.id,"?type=").concat(Ar.content_type,'&disposition=inline" target="_blank">').concat(Ar.name,"</a>")):ee.replaceSelection("[".concat(Ar.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(Ar.id,"?type=").concat(Ar.content_type,")"))}));case 4:case"end":return Kr.stop()}},sr)}));return function(){return Yt.apply(this,arguments)}}();Object(t.useEffect)(function(){Ot(le),ee==null||ee.setValue(le)},[le]),Object(t.useEffect)(function(){un==null||un(zr)},[zr]),Object(t.useEffect)(function(){if(br.current){var Yt=i.a.fromTextArea(br.current,{mode:nr,lineNumbers:!Vt,lineWrapping:!0,value:ct,autoCloseTags:!0,autoCloseBrackets:!0});tr&&Yt.focus();function sr(Qt,gr){if(Jr){gr.preventDefault();return}var Lr=gr.clipboardData;if(Lr){var Kr=Lr.types.toString(),Ar=Lr.items;if(Kr==="Files"||Lr.types.indexOf("Files")>-1){if(gr.preventDefault(),nr=="stex")return;try{var gn,$n=Ar[1];((gn=Ar[0])===null||gn===void 0?void 0:gn.kind)==="file"&&($n=Ar[0]);var xr=$n.getAsFile(),Ei=xr.name.split(".").pop();ie(xr,function(Vr){if(Vr.id){var jn,Bn,gi;(xr==null||((jn=xr.type)===null||jn===void 0)?void 0:jn.indexOf("image"))>-1?Yt.replaceSelection(".concat(Vr.content_type,")")):(xr==null||((Bn=xr.type)===null||Bn===void 0)?void 0:Bn.indexOf("video"))>-1?Yt.replaceSelection('<video width="100%" controls src="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,'"></video>')):(xr==null||((gi=xr.type)===null||gi===void 0)?void 0:gi.indexOf("pdf"))>-1?Yt.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,"?type=").concat(xr.type,'&disposition=inline" target="_blank">').concat(xr.name,"</a>")):Ee.includes(Ei)?Yt.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,'?type=office&disposition=inline" target="_blank">').concat(xr.name,"</a>")):Yt.replaceSelection("[".concat(xr.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,"?type=").concat(Vr.content_type,")"))}else(Vr==null?void 0:Vr.status)===401&&(document.location.href="/user/login")})}catch(Vr){y.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Yt.on("paste",sr),Yt.on("dragleave",function(Qt,gr){hn.current.classList.remove("mouse-hover-md")}),Yt.on("dragover",function(Qt,gr){hn.current.classList.add("mouse-hover-md")}),Yt.on("drop",function(Qt,gr){hn.current.classList.add("mouse-hover-md");var Lr;if(Lr=gr.dataTransfer.files,Lr.length>0){gr.preventDefault(),gr.stopPropagation();for(var Kr=function($n){var xr=Lr[$n],Ei=xr.name.split(".").pop();ie(xr,function(Vr){if(Vr.id){var jn,Bn,gi;(xr==null||((jn=xr.type)===null||jn===void 0)?void 0:jn.indexOf("image"))>-1?Yt.replaceSelection(".concat(Vr.content_type,")")):(xr==null||((Bn=xr.type)===null||Bn===void 0)?void 0:Bn.indexOf("video"))>-1?Yt.replaceSelection('<video width="100%" controls src="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,'"></video>')):(xr==null||((gi=xr.type)===null||gi===void 0)?void 0:gi.indexOf("pdf"))>-1?Yt.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,"?type=").concat(xr.type,'&disposition=inline" target="_blank">').concat(xr.name,"</a>")):Ee.includes(Ei)?Yt.replaceSelection('<a href="'.concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,'?type=office&disposition=inline" target="_blank">').concat(xr.name,"</a>")):Yt.replaceSelection("[".concat(xr.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,"?type=").concat(Vr.content_type,")"))}else(Vr==null?void 0:Vr.status)===401&&(document.location.href="/user/login")})},Ar=0;Ar<Lr.length;Ar++)Kr(Ar)}}),me(Yt),function(){Yt.off("paste",sr)}}},[]);var Un=Object(t.useCallback)(function(){if(hn.current)try{}catch(Yt){console.log(Yt,"---- to set md editor body height")}},[Bi,hn,zr]);Object(t.useEffect)(function(){function Yt(){var Qt=new o.default(function(gr){var Lr=Object(C.a)(gr),Kr;try{for(Lr.s();!(Kr=Lr.n()).done;){var Ar=Kr.value;(Ar.target.offsetHeight>0||Ar.target.offsetWidth>0)&&(Un(),ee.setSize("100%","100%"),ee.refresh())}}catch(gn){Lr.e(gn)}finally{Lr.f()}});return Qt.observe(br.current.parentElement),Qt}if(ee){var sr=Yt();return function(){sr.unobserve(br.current.parentElement)}}},[ee,Un]),Object(t.useEffect)(function(){if(ee){for(var Yt=[],sr=function(){var Ar=gr[Qt];Lr=Object(S.a)(Ar,2);var gn=Lr[0],$n=Lr[1],xr=Object(b.a)({},gn,function(){Di($n)});Yt.push(xr),ee.addKeyMap(xr)},Qt=0,gr=Object.entries(Ce);Qt<gr.length;Qt++){var Lr;sr()}return tn.current=setInterval(function(){cr.current&&_n()},4e3),function(){clearInterval(tn.current);var Kr=Object(C.a)(Yt),Ar;try{for(Kr.s();!(Ar=Kr.n()).done;){var gn=Ar.value;ee.removeKeyMap(gn)}}catch($n){Kr.e($n)}finally{Kr.f()}}}},[ee]),Object(t.useEffect)(function(){Jt!==zr&&or(Jt)},[Jt]),Object(st.a)(function(){if(!Nn&&Er>0){var Yt=new Date().getTime(),sr=window.sessionStorage.getItem(Et);Yt>=Er+ot&&(!sr||sr!==pt)&&(window.sessionStorage.setItem(Et,pt),Yn(!0))}},ot),Object(t.useEffect)(function(){qt(rr)},[ee,rr]),Object(t.useEffect)(function(){ee&&(tr&&ee.focus())},[ee,tr]),Object(t.useEffect)(function(){if(Xt&&ee){var Yt=ee.getScrollerElement();function sr(Qt){var gr=Qt.target;if(mi.current){var Lr=gr.scrollTop/gr.scrollHeight;mi.current.scrollTop=mi.current.scrollHeight*Lr}}return Yt.addEventListener("scroll",sr),function(){Yt.removeEventListener("scroll",sr)}}},[ee,Xt]),Object(t.useEffect)(function(){if(ee&&Or){function Yt(sr,Qt){Or(sr,Qt)}return ee.on("beforeChange",Yt),function(){ee.off("beforeChange",Yt)}}},[ee,Or]),Object(t.useEffect)(function(){if(ee&&Ut){function Yt(){Ut(ee.getValue())}return ee.on("blur",Yt),function(){ee.off("blur",Yt)}}},[ee,Ut]),Object(t.useEffect)(function(){if(ee){function Yt(sr){var Qt=sr.getValue();Ot(Qt),li(new Date().getTime()),sr.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),yt&&yt(Qt)}return ee.on("change",Yt),function(){ee.off("change",Yt)}}},[ee,yt]),Object(t.useEffect)(function(){ee&&(ct==null?(ee.setValue(""),Ot("")):ct!==ee.getValue()&&(ee.setValue(ct),Ot(ct),ee.setCursor(ee.lineCount(),0)))},[ee,ct]);var Di=Object(t.useCallback)(function(Yt){var sr=ee.getCursor(),Qt=ee.getSelection(),gr=Qt.split(`
|
|
|
`);switch(Yt){case"bold":return ee.replaceSelection("**"+Qt+"**"),Qt===""&&ee.setCursor(sr.line,sr.ch+2),ee.focus();case"italic":return ee.replaceSelection("*"+Qt+"*"),Qt===""&&ee.setCursor(sr.line,sr.ch+1),ee.focus();case"code":return ee.replaceSelection("`"+Qt+"`"),Qt===""&&ee.setCursor(sr.line,sr.ch+1),ee.focus();case"inline-latex":return ee.replaceSelection("`$$"+Qt+"$$`"),Qt===""&&ee.setCursor(sr.line,sr.ch+3),ee.focus();case"latex":return ee.replaceSelection("```latex\n"+Qt+"\n```"),ee.setCursor(sr.line+1,Qt.length+1),ee.focus();case"line-break":return ee.replaceSelection(`<br/>
|
|
|
`),ee.focus();case"list-ul":return Qt===""?ee.replaceSelection("- "+Qt):ee.replaceSelection(gr.map(function(Lr){return Lr===""?"":"- ".concat(Lr)}).join(`
|
|
|
`)),ee.focus();case"list-ol":return Qt===""?ee.replaceSelection("1. "+Qt):ee.replaceSelection(gr.map(function(Lr,Kr){return Lr===""?"":"".concat(Kr+1,". ").concat(Lr)}).join(`
|
|
|
`)),ee.focus();case"add-null-ch":return Qt===""&&ee.setCursor(sr.line,sr.ch+1),ee.replaceSelection(ze),ee.focus();case"inster-template-1":return Qt===""&&ee.setCursor(sr.line,sr.ch),ee.replaceSelection(Ze),ee.focus();case"eraser":return ee.setValue(""),ee.focus();case"trigger-watch":return qt(!Xt),ee.focus();case"trigger-full-screen":return or(!zr),ee.focus();case be:pr(be);return;case Qe:pr(Qe);return;case Re:pr(Re);return;case rt:pr(rt);return;default:throw new Error}},[ee,Xt,zr]),ui=Object(t.useCallback)(function(Yt){pr("");switch(zt){case be:var sr=Yt.title,Qt=Yt.link;return ee.replaceSelection("[".concat(sr,"](").concat(Qt,")")),ee.focus();case Qe:var gr=Yt.language,Lr=Yt.content;return ee.replaceSelection(["```"+gr,Lr,"```"].join(`
|
|
|
`)),ee.focus();case Re:var Kr=Yt.src,Ar=Yt.alt;return Ar?ee.replaceSelection(".concat(Kr,' "').concat(Ar,'" )')):ee.replaceSelection("")),ee.focus();case rt:for(var gn=Yt.row,$n=Yt.col,xr=Yt.align,Ei=`
|
|
|
`,Vr=0;Vr<gn;Vr++){for(var jn=[],Bn=[],gi=0;gi<$n;gi++)Vr===1&&Bn.push(qe[xr]),jn.push(" ");Vr===1&&(Ei+="| ".concat(Bn.join(" | "),` |
|
|
|
`)),Ei+="| ".concat(jn.join($n===1?"":" | "),` |
|
|
|
`)}return ee.replaceSelection(Ei+`
|
|
|
`),ee.focus();default:throw new Error}},[ee,zt]),bi=Object(t.useMemo)(function(){switch(zt){case be:return l.a.createElement(re,{callback:ui,onCancel:ei});case Qe:return l.a.createElement(te.b,{callback:ui,onCancel:ei});case Re:return l.a.createElement(he,{callback:ui,onCancel:ei});case rt:return l.a.createElement(Y,{callback:ui,onCancel:ei});default:return null}},[zt]);function ei(){pr("")}Object(t.useEffect)(function(){if(Fr.current){var Yt=Fr.current,sr=!1,Qt=0;function gr(Ar){sr=!0,Qt=Ar.pageY}function Lr(){sr=!1}function Kr(Ar){if(sr){var gn=Ar.pageY-Qt;gn<0&&(gn=0),gn>300&&(gn=300);var $n=At+gn+"px";qn($n)}}return Yt.addEventListener("mousedown",gr),document.addEventListener("mousemove",Kr),document.addEventListener("mouseup",Lr),function(){Yt.removeEventListener("mousedown",gr),document.removeEventListener("mousemove",Kr),document.removeEventListener("mouseup",Lr)}}},[ee,Fr]),Object(t.useEffect)(function(){qn(At)},[At]);var ti=Ne(mt),ji=Ne(Bi),ci={width:ti,height:ji},_i=Object(t.useMemo)(function(){if(Er){var Yt=new Date(Er),sr=Yt.getHours(),Qt=Yt.getMinutes(),gr=Yt.getSeconds();return sr=sr<10?"0"+sr:sr,Qt=Qt<10?"0"+Qt:Qt,gr=gr<10?"0"+gr:gr,"".concat(sr,":").concat(Qt,":").concat(gr)}return 0},[Er]);function Hi(){window.sessionStorage.removeItem(Et),Yn(!1),li(0)}function di(){Yn(!1),li(0),ee.setValue(window.sessionStorage.getItem(Et))}function qr(Yt,sr){var Qt=ee.getValue();Qt=Qt.replace(Yt,sr),Ot(Qt),ee==null||ee.setValue(Qt)}return l.a.createElement(t.Fragment,null,l.a.createElement("div",{className:"markdown-editor-wrapper",ref:hn},l.a.createElement("div",{className:"markdown-editor-container ".concat(bt," ").concat(Xt?"on-preview":""," ").concat(Vt?"mini":""," ").concat(zr?"full-screen":""),style:ci},l.a.createElement(A,{insertTemp:Wt,watch:Xt,fullScreen:zr,showNullButton:Dt,onActionCallback:Di,hidetoolBar:wr,uuid:Zr.current,setOpenPhones:function(){cr.current=!0}}),l.a.createElement("div",{className:"markdown-editor-body"},l.a.createElement("div",{className:"codemirror-container"},l.a.createElement("textarea",{ref:br,placeholder:Ln})),Xt?l.a.createElement("div",{ref:mi,className:"preview-container"},nr==="stex"&&l.a.createElement(R,{value:pt}),nr!=="stex"&&l.a.createElement(h.a,{edit:!0,value:pt,replaces:qr})):null))),kt?l.a.createElement("a",{ref:Fr,className:"editor-resize"}):null,l.a.createElement(V.a,null,ke[zt]?l.a.createElement(v.a,{centered:!0,title:ke[zt],visible:!0,onCancel:ei,footer:null,className:"markdown-popup-form"},bi):null))}},PD8m:function(F,Q){F.exports={name:"memoryStorage",read:N,write:v,each:C,remove:k,clearAll:y};var j={};function N(m){return j[m]}function v(m,S){j[m]=S}function C(m){for(var S in j)j.hasOwnProperty(S)&&m(j[S],S)}function k(m){delete j[m]}function y(m){j={}}},PVpz:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("ETIr"),j("cv67"),j("K3mO"),j("OLod"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.StreamCipher,y=v.algo,m=[],S=[],b=[],p=y.RabbitLegacy=k.extend({_doReset:function(){var t=this._key.words,l=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,t[0]&4294901760|t[1]&65535,t[3]<<16|t[3]>>>16,t[1]&4294901760|t[2]&65535,t[0]<<16|t[0]>>>16,t[2]&4294901760|t[3]&65535,t[1]<<16|t[1]>>>16,t[3]&4294901760|t[0]&65535];this._b=0;for(var o=0;o<4;o++)d.call(this);for(var o=0;o<8;o++)i[o]^=r[o+4&7];if(l){var s=l.words,c=s[0],a=s[1],u=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,f=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,w=u>>>16|f&4294901760,_=f<<16|u&65535;i[0]^=u,i[1]^=w,i[2]^=f,i[3]^=_,i[4]^=u,i[5]^=w,i[6]^=f,i[7]^=_;for(var o=0;o<4;o++)d.call(this)}},_doProcessBlock:function(t,l){var r=this._X;d.call(this),m[0]=r[0]^r[5]>>>16^r[3]<<16,m[1]=r[2]^r[7]>>>16^r[5]<<16,m[2]=r[4]^r[1]>>>16^r[7]<<16,m[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)m[i]=(m[i]<<8|m[i]>>>24)&16711935|(m[i]<<24|m[i]>>>8)&4278255360,t[l+i]^=m[i]},blockSize:128/32,ivSize:64/32});function d(){for(var t=this._X,l=this._C,r=0;r<8;r++)S[r]=l[r];l[0]=l[0]+1295307597+this._b|0,l[1]=l[1]+3545052371+(l[0]>>>0<S[0]>>>0?1:0)|0,l[2]=l[2]+886263092+(l[1]>>>0<S[1]>>>0?1:0)|0,l[3]=l[3]+1295307597+(l[2]>>>0<S[2]>>>0?1:0)|0,l[4]=l[4]+3545052371+(l[3]>>>0<S[3]>>>0?1:0)|0,l[5]=l[5]+886263092+(l[4]>>>0<S[4]>>>0?1:0)|0,l[6]=l[6]+1295307597+(l[5]>>>0<S[5]>>>0?1:0)|0,l[7]=l[7]+3545052371+(l[6]>>>0<S[6]>>>0?1:0)|0,this._b=l[7]>>>0<S[7]>>>0?1:0;for(var r=0;r<8;r++){var i=t[r]+l[r],o=i&65535,s=i>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,a=((i&4294901760)*i|0)+((i&65535)*i|0);b[r]=c^a}t[0]=b[0]+(b[7]<<16|b[7]>>>16)+(b[6]<<16|b[6]>>>16)|0,t[1]=b[1]+(b[0]<<8|b[0]>>>24)+b[7]|0,t[2]=b[2]+(b[1]<<16|b[1]>>>16)+(b[0]<<16|b[0]>>>16)|0,t[3]=b[3]+(b[2]<<8|b[2]>>>24)+b[1]|0,t[4]=b[4]+(b[3]<<16|b[3]>>>16)+(b[2]<<16|b[2]>>>16)|0,t[5]=b[5]+(b[4]<<8|b[4]>>>24)+b[3]|0,t[6]=b[6]+(b[5]<<16|b[5]>>>16)+(b[4]<<16|b[4]>>>16)|0,t[7]=b[7]+(b[6]<<8|b[6]>>>24)+b[5]|0}v.RabbitLegacy=k._createHelper(p)}(),N.RabbitLegacy})},RELg:function(F,Q,j){var N=j("MFOe"),v=N.Global;F.exports={name:"oldIE-userDataStorage",write:S,read:b,each:p,remove:d,clearAll:t};var C="storejs",k=v.document,y=i(),m=(v.navigator?v.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function S(o,s){if(m)return;var c=r(o);y(function(a){a.setAttribute(c,s),a.save(C)})}function b(o){if(m)return;var s=r(o),c=null;return y(function(a){c=a.getAttribute(s)}),c}function p(o){y(function(s){for(var c=s.XMLDocument.documentElement.attributes,a=c.length-1;a>=0;a--){var u=c[a];o(s.getAttribute(u.name),u.name)}})}function d(o){var s=r(o);y(function(c){c.removeAttribute(s),c.save(C)})}function t(){y(function(o){var s=o.XMLDocument.documentElement.attributes;o.load(C);for(var c=s.length-1;c>=0;c--)o.removeAttribute(s[c].name);o.save(C)})}var l=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function r(o){return o.replace(/^\d/,"___$&").replace(l,"___")}function i(){if(!k||!k.documentElement||!k.documentElement.addBehavior)return null;var o="script",s,c,a;try{c=new ActiveXObject("htmlfile"),c.open(),c.write("<"+o+">document.w=window</"+o+'><iframe src="/favicon.ico"></iframe>'),c.close(),s=c.w.frames[0].document,a=s.createElement("div")}catch(u){a=k.createElement("div"),s=k.body}return function(u){var f=[].slice.call(arguments,0);f.unshift(a),s.appendChild(a),a.addBehavior("#default#userData"),a.load(C),u.apply(this,f),s.removeChild(a);return}}},S6kV:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.mode.OFB=function(){var v=N.lib.BlockCipherMode.extend(),C=v.Encryptor=v.extend({processBlock:function(k,y){var m=this._cipher,S=m.blockSize,b=this._iv,p=this._keystream;b&&(p=this._keystream=b.slice(0),this._iv=void 0),m.encryptBlock(p,0);for(var d=0;d<S;d++)k[y+d]^=p[d]}});return v.Decryptor=C,v}(),N.mode.OFB})},"SA+Z":function(F,Q,j){var N=j("wTVA"),v=j("EbDI"),C=j("ZhPi"),k=j("wkBT");function y(m){return N(m)||v(m)||C(m)||k()}F.exports=y,F.exports.__esModule=!0,F.exports.default=F.exports},SJMd:function(F,Q){/**
|
|
|
* @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 j,N,v,C=!1,k,y;window.PR_SHOULD_USE_CONTINUATION=!0;var m,S;(function(){var b=window,p=["break,continue,do,else,for,if,return,while"],d=[p,"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"],t=[d,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],l=[t,"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"],r=[t,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],i=[t,"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"],o="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",s=[t,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],c="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",a=[p,"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"],u=[p,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],f=[p,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[l,i,r,s,c,a,u,f],_=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,h="str",R="kwd",O="com",g="typ",x="lit",E="pun",T="pln",M="tag",L="dec",A="src",V="atn",z="atv",W="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(oe){for(var q=0,Y=!1,Z=!1,ye=0,be=oe.length;ye<be;++ye){var Re=oe[ye];if(Re.ignoreCase)Z=!0;else if(/[a-z]/i.test(Re.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Y=!0,Z=!1;break}}var Qe={b:8,t:9,n:10,v:11,f:12,r:13};function rt(je){var Ie=je.charCodeAt(0);if(Ie!==92)return Ie;var tt=je.charAt(1);return Ie=Qe[tt],Ie||("0"<=tt&&tt<="7"?parseInt(je.substring(1),8):tt==="u"||tt==="x"?parseInt(je.substring(2),16):je.charCodeAt(1))}function at(je){if(je<32)return(je<16?"\\x0":"\\x")+je.toString(16);var Ie=String.fromCharCode(je);return Ie==="\\"||Ie==="-"||Ie==="]"||Ie==="^"?"\\"+Ie:Ie}function qe(je){var Ie=je.substring(1,je.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),tt=[],ot=Ie[0]==="^",ze=["["];ot&&ze.push("^");for(var Ze=ot?1:0,Ne=Ie.length;Ze<Ne;++Ze){var Ae=Ie[Ze];if(/\\[bdsw]/i.test(Ae))ze.push(Ae);else{var Me=rt(Ae),Ee;Ze+2<Ne&&Ie[Ze+1]==="-"?(Ee=rt(Ie[Ze+2]),Ze+=2):Ee=Me,tt.push([Me,Ee]),Ee<65||Me>122||(Ee<65||Me>90||tt.push([Math.max(65,Me)|32,Math.min(Ee,90)|32]),Ee<97||Me>122||tt.push([Math.max(97,Me)&~32,Math.min(Ee,122)&~32]))}}tt.sort(function(Be,et){return Be[0]-et[0]||et[1]-Be[1]});for(var Ce=[],ke=[],Ze=0;Ze<tt.length;++Ze){var Fe=tt[Ze];Fe[0]<=ke[1]+1?ke[1]=Math.max(ke[1],Fe[1]):Ce.push(ke=Fe)}for(var Ze=0;Ze<Ce.length;++Ze){var Fe=Ce[Ze];ze.push(at(Fe[0])),Fe[1]>Fe[0]&&(Fe[1]+1>Fe[0]&&ze.push("-"),ze.push(at(Fe[1])))}return ze.push("]"),ze.join("")}function st(je){for(var Ie=je.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),tt=Ie.length,ot=[],ze=0,Ze=0;ze<tt;++ze){var Ne=Ie[ze];if(Ne==="(")++Ze;else if(Ne.charAt(0)==="\\"){var Ae=+Ne.substring(1);Ae&&(Ae<=Ze?ot[Ae]=-1:Ie[ze]=at(Ae))}}for(var ze=1;ze<ot.length;++ze)ot[ze]===-1&&(ot[ze]=++q);for(var ze=0,Ze=0;ze<tt;++ze){var Ne=Ie[ze];if(Ne==="(")++Ze,ot[Ze]||(Ie[ze]="(?:");else if(Ne.charAt(0)==="\\"){var Ae=+Ne.substring(1);Ae&&Ae<=Ze&&(Ie[ze]="\\"+ot[Ae])}}for(var ze=0;ze<tt;++ze)Ie[ze]==="^"&&Ie[ze+1]!=="^"&&(Ie[ze]="");if(je.ignoreCase&&Y)for(var ze=0;ze<tt;++ze){var Ne=Ie[ze],Me=Ne.charAt(0);Ne.length>=2&&Me==="["?Ie[ze]=qe(Ne):Me!=="\\"&&(Ie[ze]=Ne.replace(/[a-zA-Z]/g,function(ke){var Fe=ke.charCodeAt(0);return"["+String.fromCharCode(Fe&~32,Fe|32)+"]"}))}return Ie.join("")}for(var lt=[],ye=0,be=oe.length;ye<be;++ye){var Re=oe[ye];if(Re.global||Re.multiline)throw new Error(""+Re);lt.push("(?:"+st(Re)+")")}return new RegExp(lt.join("|"),Z?"gi":"g")}function P(oe,q){var Y=/(?:^|\s)nocode(?:\s|$)/,Z=[],ye=0,be=[],Re=0;function Qe(rt){var at=rt.nodeType;if(at==1){if(Y.test(rt.className))return;for(var qe=rt.firstChild;qe;qe=qe.nextSibling)Qe(qe);var st=rt.nodeName.toLowerCase();(st==="br"||st==="li")&&(Z[Re]=`
|
|
|
`,be[Re<<1]=ye++,be[Re++<<1|1]=rt)}else if(at==3||at==4){var lt=rt.nodeValue;lt.length&&(q?lt=lt.replace(/\r\n?/g,`
|
|
|
`):lt=lt.replace(/[ \t\r\n]+/g," "),Z[Re]=lt,be[Re<<1]=ye,ye+=lt.length,be[Re++<<1|1]=rt)}}return Qe(oe),{sourceCode:Z.join("").replace(/\n$/,""),spans:be}}function H(oe,q,Y,Z,ye){if(!Y)return;var be={sourceNode:oe,pre:1,langExtension:null,numberLines:null,sourceCode:Y,spans:null,basePos:q,decorations:null};Z(be),ye.push.apply(ye,be.decorations)}var $=/\S/;function re(oe){for(var q=void 0,Y=oe.firstChild;Y;Y=Y.nextSibling){var Z=Y.nodeType;q=Z===1?q?oe:Y:Z===3&&$.test(Y.nodeValue)?oe:q}return q===oe?void 0:q}function te(oe,q){var Y={},Z;(function(){for(var Re=oe.concat(q),Qe=[],rt={},at=0,qe=Re.length;at<qe;++at){var st=Re[at],lt=st[3];if(lt)for(var je=lt.length;--je>=0;)Y[lt.charAt(je)]=st;var Ie=st[1],tt=""+Ie;rt.hasOwnProperty(tt)||(Qe.push(Ie),rt[tt]=null)}Qe.push(/[\0-\uffff]/),Z=U(Qe)})();var ye=q.length,be=function(Re){for(var Qe=Re.sourceCode,rt=Re.basePos,at=Re.sourceNode,qe=[rt,T],st=0,lt=Qe.match(Z)||[],je={},Ie=0,tt=lt.length;Ie<tt;++Ie){var ot=lt[Ie],ze=je[ot],Ze=void 0,Ne;if(typeof ze=="string")Ne=!1;else{var Ae=Y[ot.charAt(0)];if(Ae)Ze=ot.match(Ae[1]),ze=Ae[0];else{for(var Me=0;Me<ye;++Me)if(Ae=q[Me],Ze=ot.match(Ae[1]),Ze){ze=Ae[0];break}Ze||(ze=T)}Ne=ze.length>=5&&ze.substring(0,5)==="lang-",Ne&&!(Ze&&typeof Ze[1]=="string")&&(Ne=!1,ze=A),Ne||(je[ot]=ze)}var Ee=st;if(st+=ot.length,!Ne)qe.push(rt+Ee,ze);else{var Ce=Ze[1],ke=ot.indexOf(Ce),Fe=ke+Ce.length;Ze[2]&&(Fe=ot.length-Ze[2].length,ke=Fe-Ce.length);var Be=ze.substring(5);H(at,rt+Ee,ot.substring(0,ke),be,qe),H(at,rt+Ee+ke,Ce,ue(Be,Ce),qe),H(at,rt+Ee+Fe,ot.substring(Fe),be,qe)}}Re.decorations=qe};return be}function ge(oe){var q=[],Y=[];oe.tripleQuotedStrings?q.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):oe.multiLineStrings?q.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):q.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),oe.verbatimStrings&&Y.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Z=oe.hashComments;Z&&(oe.cStyleComments?(Z>1?q.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):q.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Y.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):q.push([O,/^#[^\r\n]*/,null,"#"])),oe.cStyleComments&&(Y.push([O,/^\/\/[^\r\n]*/,null]),Y.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ye=oe.regexLiterals;if(ye){var be=ye>1?"":`
|
|
|
\r`,Re=be?".":"[\\S\\s]",Qe="/(?=[^/*"+be+"])(?:[^/\\x5B\\x5C"+be+"]|\\x5C"+Re+"|\\x5B(?:[^\\x5C\\x5D"+be+"]|\\x5C"+Re+")*(?:\\x5D|$))+/";Y.push(["lang-regex",RegExp("^"+G+"("+Qe+")")])}var rt=oe.types;rt&&Y.push([g,rt]);var at=(""+oe.keywords).replace(/^ | $/g,"");at.length&&Y.push([R,new RegExp("^(?:"+at.replace(/[\s,]+/g,"|")+")\\b"),null]),q.push([T,/^\s+/,null,` \r
|
|
|
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return oe.regexLiterals&&(qe+="(?!s*/)"),Y.push([x,/^@[a-z_$][a-z_$@0-9]*/i,null],[g,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[T,/^[a-z_$][a-z_$@0-9]*/i,null],[x,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[T,/^\\[\s\S]?/,null],[E,new RegExp(qe),null]),te(q,Y)}var ve=ge({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function de(oe,q,Y){for(var Z=/(?:^|\s)nocode(?:\s|$)/,ye=/\r\n?|\n/,be=oe.ownerDocument,Re=be.createElement("li");oe.firstChild;)Re.appendChild(oe.firstChild);var Qe=[Re];function rt(Ie){var tt=Ie.nodeType;if(tt==1&&!Z.test(Ie.className))if(Ie.nodeName==="br")at(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var ot=Ie.firstChild;ot;ot=ot.nextSibling)rt(ot);else if((tt==3||tt==4)&&Y){var ze=Ie.nodeValue,Ze=ze.match(ye);if(Ze){var Ne=ze.substring(0,Ze.index);Ie.nodeValue=Ne;var Ae=ze.substring(Ze.index+Ze[0].length);if(Ae){var Me=Ie.parentNode;Me.insertBefore(be.createTextNode(Ae),Ie.nextSibling)}at(Ie),Ne||Ie.parentNode.removeChild(Ie)}}}function at(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function tt(Ze,Ne){var Ae=Ne?Ze.cloneNode(!1):Ze,Me=Ze.parentNode;if(Me){var Ee=tt(Me,1),Ce=Ze.nextSibling;Ee.appendChild(Ae);for(var ke=Ce;ke;ke=Ce)Ce=ke.nextSibling,Ee.appendChild(ke)}return Ae}for(var ot=tt(Ie.nextSibling,0),ze;(ze=ot.parentNode)&&ze.nodeType===1;)ot=ze;Qe.push(ot)}for(var qe=0;qe<Qe.length;++qe)rt(Qe[qe]);q===(q|0)&&Qe[0].setAttribute("value",q);var st=be.createElement("ol");st.className="linenums";for(var lt=Math.max(0,q-1|0)||0,qe=0,je=Qe.length;qe<je;++qe)Re=Qe[qe],Re.className="L"+(qe+lt)%10,Re.firstChild||Re.appendChild(be.createTextNode("\xA0")),st.appendChild(Re);oe.appendChild(st)}function De(oe){var q=/\bMSIE\s(\d+)/.exec(navigator.userAgent);q=q&&+q[1]<=8;var Y=/\n/g,Z=oe.sourceCode,ye=Z.length,be=0,Re=oe.spans,Qe=Re.length,rt=0,at=oe.decorations,qe=at.length,st=0;at[qe]=ye;var lt,je;for(je=lt=0;je<qe;)at[je]!==at[je+2]?(at[lt++]=at[je++],at[lt++]=at[je++]):je+=2;for(qe=lt,je=lt=0;je<qe;){for(var Ie=at[je],tt=at[je+1],ot=je+2;ot+2<=qe&&at[ot+1]===tt;)ot+=2;at[lt++]=Ie,at[lt++]=tt,je=ot}qe=at.length=lt;var ze=oe.sourceNode,Ze="";ze&&(Ze=ze.style.display,ze.style.display="none");try{for(var Ne=null;rt<Qe;){var Ae=Re[rt],Me=Re[rt+2]||ye,Ee=at[st+2]||ye,ot=Math.min(Me,Ee),Ce=Re[rt+1],ke;if(Ce.nodeType!==1&&(ke=Z.substring(be,ot))){q&&(ke=ke.replace(Y,"\r")),Ce.nodeValue=ke;var Fe=Ce.ownerDocument,Be=Fe.createElement("span");Be.className=at[st+1];var et=Ce.parentNode;et.replaceChild(Be,Ce),Be.appendChild(Ce),be<Me&&(Re[rt+1]=Ce=Fe.createTextNode(Z.substring(ot,Me)),et.insertBefore(Ce,Be.nextSibling))}be=ot,be>=Me&&(rt+=2),be>=Ee&&(st+=2)}}finally{ze&&(ze.style.display=Ze)}}var Te={};function he(oe,q){for(var Y=q.length;--Y>=0;){var Z=q[Y];Te.hasOwnProperty(Z)?b.console&&console.warn("cannot override language handler %s",Z):Te[Z]=oe}}function ue(oe,q){return oe&&Te.hasOwnProperty(oe)||(oe=/^\s*</.test(q)?"default-markup":"default-code"),Te[oe]}he(ve,["default-code"]),he(te([],[[T,/^[^<?]+/],[L,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["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"]),he(te([[T,/^[\s]+/,null,` \r
|
|
|
`],[z,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[M,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[V,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[E,/^[=<>\/]+/],["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"]),he(te([],[[z,/^[\s\S]+/]]),["uq.val"]),he(ge({keywords:l,hashComments:!0,cStyleComments:!0,types:_}),["c","cc","cpp","cxx","cyc","m"]),he(ge({keywords:"null,true,false"}),["json"]),he(ge({keywords:i,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_}),["cs"]),he(ge({keywords:r,cStyleComments:!0}),["java"]),he(ge({keywords:f,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(ge({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(ge({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(ge({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(ge({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(ge({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(te([],[[h,/^[\s\S]+/]]),["regex"]);function ie(oe){var q=oe.langExtension;try{var Y=P(oe.sourceNode,oe.pre),Z=Y.sourceCode;oe.sourceCode=Z,oe.spans=Y.spans,oe.basePos=0,ue(q,Z)(oe),De(oe)}catch(ye){b.console&&console.log(ye&&ye.stack||ye)}}function Se(oe,q,Y){var Z=Y||!1,ye=q||null,be=document.createElement("div");be.innerHTML="<pre>"+oe+"</pre>",be=be.firstChild,Z&&de(be,Z,!0);var Re={langExtension:ye,numberLines:Z,sourceNode:be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ie(Re),be.innerHTML}function ne(oe,q){var Y=q||document.body,Z=Y.ownerDocument||document;function ye(Ae){return Y.getElementsByTagName(Ae)}for(var be=[ye("pre"),ye("code"),ye("xmp")],Re=[],Qe=0;Qe<be.length;++Qe)for(var rt=0,at=be[Qe].length;rt<at;++rt)Re.push(be[Qe][rt]);be=null;var qe=Date;qe.now||(qe={now:function(){return+new Date}});var st=0,lt=/\blang(?:uage)?-([\w.]+)(?!\S)/,je=/\bprettyprint\b/,Ie=/\bprettyprinted\b/,tt=/pre|xmp/i,ot=/^code$/i,ze=/^(?:pre|code|xmp)$/i,Ze={};function Ne(){for(var Ae=b.PR_SHOULD_USE_CONTINUATION?qe.now()+250:Infinity;st<Re.length&&qe.now()<Ae;st++){for(var Me=Re[st],Ee=Ze,Ce=Me;Ce=Ce.previousSibling;){var ke=Ce.nodeType,Fe=(ke===7||ke===8)&&Ce.nodeValue;if(Fe?!/^\??prettify\b/.test(Fe):ke!==3||/\S/.test(Ce.nodeValue))break;if(Fe){Ee={},Fe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(rr,Wt,Lt){Ee[Wt]=Lt});break}}var Be=Me.className;if((Ee!==Ze||je.test(Be))&&!Ie.test(Be)){for(var et=!1,ct=Me.parentNode;ct;ct=ct.parentNode){var yt=ct.tagName;if(ze.test(yt)&&ct.className&&je.test(ct.className)){et=!0;break}}if(!et){Me.className+=" prettyprinted";var ft=Ee.lang;if(!ft){ft=Be.match(lt);var mt;!ft&&(mt=re(Me))&&ot.test(mt.tagName)&&(ft=mt.className.match(lt)),ft&&(ft=ft[1])}var It;if(tt.test(Me.tagName))It=1;else{var At=Me.currentStyle,_t=Z.defaultView,Vt=At?At.whiteSpace:_t&&_t.getComputedStyle?_t.getComputedStyle(Me,null).getPropertyValue("white-space"):0;It=Vt&&Vt.substring(0,3)==="pre"}var Kt=Ee.linenums;(Kt=Kt==="true"||+Kt)||(Kt=Be.match(/\blinenums\b(?::(\d+))?/),Kt=Kt?Kt[1]&&Kt[1].length?+Kt[1]:!0:!1),Kt&&de(Me,Kt,It);var tr={langExtension:ft,sourceNode:Me,numberLines:Kt,pre:It,sourceCode:null,basePos:null,spans:null,decorations:null};ie(tr)}}}st<Re.length?b.setTimeout(Ne,250):typeof oe=="function"&&oe()}Ne()}var ce=b.PR={createSimpleLexer:te,registerLangHandler:he,sourceDecorator:ge,PR_ATTRIB_NAME:V,PR_ATTRIB_VALUE:z,PR_COMMENT:O,PR_DECLARATION:L,PR_KEYWORD:R,PR_LITERAL:x,PR_NOCODE:W,PR_PLAIN:T,PR_PUNCTUATION:E,PR_SOURCE:A,PR_STRING:h,PR_TAG:M,PR_TYPE:g,prettyPrintOne:C?b.prettyPrintOne=Se:m=Se,prettyPrint:S=C?b.prettyPrint=ne:S=ne},Oe=b.define;typeof Oe=="function"&&Oe.amd&&Oe("google-code-prettify",[],function(){return ce})})()},TXwP:function(F,Q,j){var N,v;(function(){var C;(function(){"use strict";var y=[,,function(p){function d(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}d.prototype.clone_empty=function(){var r=new d(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},d.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},d.prototype.has_match=function(r){for(var i=this.__items.length-1;i>=0;i--)if(this.__items[i].match(r))return!0;return!1},d.prototype.set_indent=function(r,i){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=i||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},d.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(r){this.__items.push(r);var i=r.lastIndexOf(`
|
|
|
`);i!==-1?this.__character_count=r.length-i:this.__character_count+=r.length},d.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function t(r,i){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),i=i||"",r.indent_level>0&&(i=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=i,this.__base_string_length=i.length}t.prototype.get_indent_size=function(r,i){var o=this.__base_string_length;return i=i||0,r<0&&(o=0),o+=r*this.__indent_size,o+=i,o},t.prototype.get_indent_string=function(r,i){var o=this.__base_string;return i=i||0,r<0&&(r=0,o=""),i+=r*this.__indent_size,this.__ensure_cache(i),o+=this.__cache[i],o},t.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var r=this.__cache.length,i=0,o="";this.__indent_size&&r>=this.__indent_size&&(i=Math.floor(r/this.__indent_size),r-=i*this.__indent_size,o=new Array(i+1).join(this.__indent_string)),r&&(o+=new Array(r+1).join(" ")),this.__cache.push(o)};function l(r,i){this.__indent_cache=new t(r,i),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(r,i){return this.__indent_cache.get_indent_string(r,i)},l.prototype.get_indent_size=function(r,i){return this.__indent_cache.get_indent_size(r,i)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(r){this.trim(!0);var i=this.current_line.pop();i&&(i[i.length-1]===`
|
|
|
`&&(i=i.replace(/\n+$/g,"")),this.current_line.push(i)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
|
`);return r!==`
|
|
|
`&&(o=o.replace(/[\n]/g,r)),o},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(r,i){return r=r||0,i=i||0,this.next_line.set_indent(r,i),this.__lines.length>1?(this.current_line.set_indent(r,i),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(r){for(var i=0;i<r.newlines;i++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},l.prototype.remove_indent=function(r){for(var i=this.__lines.length;r<i;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(r,i){for(var o=this.__lines.length-2;o>=0;){var s=this.__lines[o];if(s.is_empty())break;if(s.item(0).indexOf(r)!==0&&s.item(-1)!==i){this.__lines.splice(o+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},p.exports.Output=l},,,,function(p){function d(r,i){this.raw_options=t(r,i),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}d.prototype._get_array=function(r,i){var o=this.raw_options[r],s=i||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(s=o.concat()):typeof o=="string"&&(s=o.split(/[^a-zA-Z0-9_\/\-]+/)),s},d.prototype._get_boolean=function(r,i){var o=this.raw_options[r],s=o===void 0?!!i:!!o;return s},d.prototype._get_characters=function(r,i){var o=this.raw_options[r],s=i||"";return typeof o=="string"&&(s=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),s},d.prototype._get_number=function(r,i){var o=this.raw_options[r];i=parseInt(i,10),isNaN(i)&&(i=0);var s=parseInt(o,10);return isNaN(s)&&(s=i),s},d.prototype._get_selection=function(r,i,o){var s=this._get_selection_list(r,i,o);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
|
|
|
`+i+`
|
|
|
You passed in: '`+this.raw_options[r]+"'");return s[0]},d.prototype._get_selection_list=function(r,i,o){if(!i||i.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[i[0]],!this._is_valid_selection(o,i))throw new Error("Invalid Default Value!");var s=this._get_array(r,o);if(!this._is_valid_selection(s,i))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
|
|
|
`+i+`
|
|
|
You passed in: '`+this.raw_options[r]+"'");return s},d.prototype._is_valid_selection=function(r,i){return r.length&&i.length&&!r.some(function(o){return i.indexOf(o)===-1})};function t(r,i){var o={};r=l(r);var s;for(s in r)s!==i&&(o[s]=r[s]);if(i&&r[i])for(s in r[i])o[s]=r[i][s];return o}function l(r){var i={},o;for(o in r){var s=o.replace(/-/g,"_");i[s]=r[o]}return i}p.exports.Options=d,p.exports.normalizeOpts=l,p.exports.mergeOpts=t},,function(p){var d=RegExp.prototype.hasOwnProperty("sticky");function t(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position<this.__input_length},t.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},t.prototype.peek=function(l){var r=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(r=this.__input.charAt(l)),r},t.prototype.__match=function(l,r){l.lastIndex=r;var i=l.exec(this.__input);return i&&!(d&&l.sticky)&&(i.index!==r&&(i=null)),i},t.prototype.test=function(l,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(l,r):!1},t.prototype.testChar=function(l,r){var i=this.peek(r);return l.lastIndex=0,i!==null&&l.test(i)},t.prototype.match=function(l){var r=this.__match(l,this.__position);return r?this.__position+=r[0].length:r=null,r},t.prototype.read=function(l,r,i){var o="",s;return l&&(s=this.match(l),s&&(o+=s[0])),r&&(s||!l)&&(o+=this.readUntil(r,i)),o},t.prototype.readUntil=function(l,r){var i="",o=this.__position;l.lastIndex=this.__position;var s=l.exec(this.__input);return s?(o=s.index,r&&(o+=s[0].length)):o=this.__input_length,i=this.__input.substring(this.__position,o),this.__position=o,i},t.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},t.prototype.get_regexp=function(l,r){var i=null,o="g";return r&&d&&(o="y"),typeof l=="string"&&l!==""?i=new RegExp(l,o):l&&(i=new RegExp(l.source,o)),i},t.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},t.prototype.peekUntilAfter=function(l){var r=this.__position,i=this.readUntilAfter(l);return this.__position=r,i},t.prototype.lookBack=function(l){var r=this.__position-1;return r>=l.length&&this.__input.substring(r-l.length,r).toLowerCase()===l},p.exports.InputScanner=t},,,,,function(p){function d(t,l){t=typeof t=="string"?t:t.source,l=typeof l=="string"?l:l.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+l,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+l,"g")}d.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var l={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(t);r;)l[r[1]]=r[2],r=this.__directive_pattern.exec(t);return l},d.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},p.exports.Directives=d},,function(p,d,t){var l=t(16).Beautifier,r=t(17).Options;function i(o,s){var c=new l(o,s);return c.beautify()}p.exports=i,p.exports.defaultOptions=function(){return new r}},function(p,d,t){var l=t(17).Options,r=t(2).Output,i=t(8).InputScanner,o=t(13).Directives,s=new o(/\/\*/,/\*\//),c=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,u=/\s/,f=/(?:\s|\n)+/g,w=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function h(R,O){this._source_text=R||"",this._options=new l(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}h.prototype.eatString=function(R){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
|
|
|
`)break;this._ch=this._input.next()}return O},h.prototype.eatWhitespace=function(R){for(var O=u.test(this._input.peek()),g=0;u.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
|
|
|
`&&((g===0||g<this._options.max_preserve_newlines)&&(g++,this._output.add_new_line(!0)));return O},h.prototype.foundNestedPseudoClass=function(){for(var R=0,O=1,g=this._input.peek(O);g;){if(g==="{")return!0;if(g==="(")R+=1;else if(g===")"){if(R===0)return!1;R-=1}else if(g===";"||g==="}")return!1;O++,g=this._input.peek(O)}return!1},h.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},h.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},h.prototype.indent=function(){this._indentLevel++},h.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},h.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,O=this._options.eol;O==="auto"&&(O=`
|
|
|
`,R&&c.test(R||"")&&(O=R.match(c)[0])),R=R.replace(a,`
|
|
|
`);var g=R.match(/^[\t ]*/)[0];this._output=new r(this._options,g),this._input=new i(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var x=0,E=!1,T=!1,M=!1,L=!1,A=!1,V=!1,z=this._ch,W=!1,G,U,P;G=this._input.read(f),U=G!=="",P=z,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),z=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(w),$=s.get_directives(H);$&&$.ignore==="start"&&(H+=s.readIgnored(this._input)),this.print_string(H),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(_)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var re=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);re.match(/[ :]$/)&&(re=this.eatString(": ").replace(/\s$/,""),this.print_string(re),this._output.space_before_token=!0),re=re.replace(/\s$/,""),re==="extend"?L=!0:re==="import"&&(A=!0),re in this.NESTED_AT_RULE?(this._nestedLevel+=1,re in this.CONDITIONAL_GROUP_RULE&&(M=!0)):!E&&x===0&&re.indexOf(":")!==-1&&(T=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")T&&(T=!1,this.outdent()),M?(M=!1,E=this._indentLevel>=this._nestedLevel):E=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&E&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(P==="("?this._output.space_before_token=!1:P!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),P==="{"&&this._output.trim(!0),A=!1,L=!1,T&&(this.outdent(),T=!1),this.print_string(this._ch),E=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var te=0;te<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;te++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[te])){W=!0;break}(E||M)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!L&&x===0?(this.print_string(":"),T||(T=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ge=P==='"'||P==="'";this.preserveSingleSpace(ge||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")W=!1,x===0?(T&&(this.outdent(),T=!1),L=!1,A=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),x++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),x&&(x--,this.outdent()));else{var ve=!1;this._input.lookBack("with")&&(ve=!0),this.preserveSingleSpace(U||ve),this.print_string(this._ch),T&&P==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),V=!0):(this.eatWhitespace(),x++,this.indent())}else if(this._ch===")")x&&(x--,this.outdent()),V&&this._input.peek()===";"&&this._options.selector_separator_newline&&(V=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!T||V)&&x===0&&!A&&!L?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!T&&x===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&u.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),u.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var de=P==='"'||P==="'";this.preserveSingleSpace(de||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
|
`&&W&&this._output.add_new_line()}var De=this._output.get_code(O);return De},p.exports.Beautifier=h},function(p,d,t){var l=t(6).Options;function r(i){l.call(this,i,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var c=0;c<s.length;c++)s[c]!=="expand"?this.brace_style="collapse":this.brace_style=s[c]}r.prototype=new l,p.exports.Options=r}],m={};function S(p){var d=m[p];if(d!==void 0)return d.exports;var t=m[p]={exports:{}};return y[p](t,t.exports,S),t.exports}var b=S(15);C=b})();var k=C;!(N=[],v=function(){return{css_beautify:k}}.apply(Q,N),v!==void 0&&(F.exports=v))})()},"VrN/":function(F,Q,j){(function(N,v){F.exports=v()})(this,function(){"use strict";var N=navigator.userAgent,v=navigator.platform,C=/gecko\/\d/i.test(N),k=/MSIE \d/.test(N),y=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(N),m=/Edge\/(\d+)/.exec(N),S=k||y||m,b=S&&(k?document.documentMode||6:+(m||y)[1]),p=!m&&/WebKit\//.test(N),d=p&&/Qt\/\d+\.\d+/.test(N),t=!m&&/Chrome\//.test(N),l=/Opera\//.test(N),r=/Apple Computer/.test(navigator.vendor),i=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(N),o=/PhantomJS/.test(N),s=!m&&/AppleWebKit/.test(N)&&/Mobile\/\w+/.test(N),c=/Android/.test(N),a=s||c||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(N),u=s||/Mac/.test(v),f=/\bCrOS\b/.test(N),w=/win/i.test(v),_=l&&N.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(l=!1,p=!0);var h=u&&(d||l&&(_==null||_<12.11)),R=C||S&&b>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var g=function(e,n){var D=e.className,I=O(n).exec(D);if(I){var B=D.slice(I.index+I[0].length);e.className=D.slice(0,I.index)+(B?I[1]+B:"")}};function x(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function E(e,n){return x(e).appendChild(n)}function T(e,n,D,I){var B=document.createElement(e);if(D&&(B.className=D),I&&(B.style.cssText=I),typeof n=="string")B.appendChild(document.createTextNode(n));else if(n)for(var J=0;J<n.length;++J)B.appendChild(n[J]);return B}function M(e,n,D,I){var B=T(e,n,D,I);return B.setAttribute("role","presentation"),B}var L;document.createRange?L=function(e,n,D,I){var B=document.createRange();return B.setEnd(I||e,D),B.setStart(e,n),B}:L=function(e,n,D){var I=document.body.createTextRange();try{I.moveToElementText(e.parentNode)}catch(B){return I}return I.collapse(!0),I.moveEnd("character",D),I.moveStart("character",n),I};function A(e,n){if(n.nodeType==3&&(n=n.parentNode),e.contains)return e.contains(n);do if(n.nodeType==11&&(n=n.host),n==e)return!0;while(n=n.parentNode)}function V(){var e;try{e=document.activeElement}catch(n){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function z(e,n){var D=e.className;O(n).test(D)||(e.className+=(D?" ":"")+n)}function W(e,n){for(var D=e.split(" "),I=0;I<D.length;I++)D[I]&&!O(D[I]).test(n)&&(n+=" "+D[I]);return n}var G=function(e){e.select()};s?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:S&&(G=function(e){try{e.select()}catch(n){}});function U(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function P(e,n,D){n||(n={});for(var I in e)e.hasOwnProperty(I)&&(D!==!1||!n.hasOwnProperty(I))&&(n[I]=e[I]);return n}function H(e,n,D,I,B){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var J=I||0,se=B||0;;){var fe=e.indexOf(" ",J);if(fe<0||fe>=n)return se+(n-J);se+=fe-J,se+=D-se%D,J=fe+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,n){this.f=n;var D=+new Date+e;(!this.id||D<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=D)};function re(e,n){for(var D=0;D<e.length;++D)if(e[D]==n)return D;return-1}var te=50,ge={toString:function(){return"CodeMirror.Pass"}},ve={scroll:!1},de={origin:"*mouse"},De={origin:"+move"};function Te(e,n,D){for(var I=0,B=0;;){var J=e.indexOf(" ",I);J==-1&&(J=e.length);var se=J-I;if(J==e.length||B+se>=n)return I+Math.min(se,n-B);if(B+=J-I,B+=D-B%D,I=J+1,B>=n)return I}}var he=[""];function ue(e){for(;he.length<=e;)he.push(ie(he)+" ");return he[e]}function ie(e){return e[e.length-1]}function Se(e,n){for(var D=[],I=0;I<e.length;I++)D[I]=n(e[I],I);return D}function ne(e,n,D){for(var I=0,B=D(n);I<e.length&&D(e[I])<=B;)I++;e.splice(I,0,n)}function ce(){}function Oe(e,n){var D;return Object.create?D=Object.create(e):(ce.prototype=e,D=new ce),n&&P(n,D),D}var oe=/[\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()||oe.test(e))}function Y(e,n){return n?n.source.indexOf("\\w")>-1&&q(e)?!0:n.test(e):q(e)}function Z(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var ye=/[\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 be(e){return e.charCodeAt(0)>=768&&ye.test(e)}function Re(e,n,D){for(;(D<0?n>0:n<e.length)&&be(e.charAt(n));)n+=D;return n}function Qe(e,n,D){for(var I=n>D?-1:1;;){if(n==D)return n;var B=(n+D)/2,J=I<0?Math.ceil(B):Math.floor(B);if(J==n)return e(J)?n:D;e(J)?D=J:n=J+I}}function rt(e,n,D,I){if(!e)return I(n,D,"ltr",0);for(var B=!1,J=0;J<e.length;++J){var se=e[J];(se.from<D&&se.to>n||n==D&&se.to==n)&&(I(Math.max(se.from,n),Math.min(se.to,D),se.level==1?"rtl":"ltr",J),B=!0)}B||I(n,D,"ltr")}var at=null;function qe(e,n,D){var I;at=null;for(var B=0;B<e.length;++B){var J=e[B];if(J.from<n&&J.to>n)return B;J.to==n&&(J.from!=J.to&&D=="before"?I=B:at=B),J.from==n&&(J.from!=J.to&&D!="before"?I=B:at=B)}return I!=null?I:at}var st=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function D(xe){return xe<=247?e.charAt(xe):1424<=xe&&xe<=1524?"R":1536<=xe&&xe<=1785?n.charAt(xe-1536):1774<=xe&&xe<=2220?"r":8192<=xe&&xe<=8203?"w":xe==8204?"b":"L"}var I=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,B=/[stwN]/,J=/[LRr]/,se=/[Lb1n]/,fe=/[1n]/;function pe(xe,We,Ve){this.level=xe,this.from=We,this.to=Ve}return function(xe,We){var Ve=We=="ltr"?"L":"R";if(xe.length==0||We=="ltr"&&!I.test(xe))return!1;for(var ut=xe.length,it=[],gt=0;gt<ut;++gt)it.push(D(xe.charCodeAt(gt)));for(var xt=0,Rt=Ve;xt<ut;++xt){var Pt=it[xt];Pt=="m"?it[xt]=Rt:Rt=Pt}for(var Gt=0,Nt=Ve;Gt<ut;++Gt){var $t=it[Gt];$t=="1"&&Nt=="r"?it[Gt]="n":J.test($t)&&(Nt=$t,$t=="r"&&(it[Gt]="R"))}for(var dr=1,ar=it[0];dr<ut-1;++dr){var Pr=it[dr];Pr=="+"&&ar=="1"&&it[dr+1]=="1"?it[dr]="1":Pr==","&&ar==it[dr+1]&&(ar=="1"||ar=="n")&&(it[dr]=ar),ar=Pr}for(var Tn=0;Tn<ut;++Tn){var fi=it[Tn];if(fi==",")it[Tn]="N";else if(fi=="%"){var Fn=void 0;for(Fn=Tn+1;Fn<ut&&it[Fn]=="%";++Fn);for(var Fi=Tn&&it[Tn-1]=="!"||Fn<ut&&it[Fn]=="1"?"1":"N",Mi=Tn;Mi<Fn;++Mi)it[Mi]=Fi;Tn=Fn-1}}for(var Qn=0,Pi=Ve;Qn<ut;++Qn){var yi=it[Qn];Pi=="L"&&yi=="1"?it[Qn]="L":J.test(yi)&&(Pi=yi)}for(var si=0;si<ut;++si)if(B.test(it[si])){var Zn=void 0;for(Zn=si+1;Zn<ut&&B.test(it[Zn]);++Zn);for(var zn=(si?it[si-1]:Ve)=="L",Ni=(Zn<ut?it[Zn]:Ve)=="L",Za=zn==Ni?zn?"L":"R":Ve,Ca=si;Ca<Zn;++Ca)it[Ca]=Za;si=Zn-1}for(var Ti=[],la,pi=0;pi<ut;)if(se.test(it[pi])){var ps=pi;for(++pi;pi<ut&&se.test(it[pi]);++pi);Ti.push(new pe(0,ps,pi))}else{var ga=pi,La=Ti.length,ka=We=="rtl"?1:0;for(++pi;pi<ut&&it[pi]!="L";++pi);for(var Ii=ga;Ii<pi;)if(fe.test(it[Ii])){ga<Ii&&(Ti.splice(La,0,new pe(1,ga,Ii)),La+=ka);var qa=Ii;for(++Ii;Ii<pi&&fe.test(it[Ii]);++Ii);Ti.splice(La,0,new pe(2,qa,Ii)),La+=ka,ga=Ii}else++Ii;ga<pi&&Ti.splice(La,0,new pe(1,ga,pi))}return We=="ltr"&&(Ti[0].level==1&&(la=xe.match(/^\s+/))&&(Ti[0].from=la[0].length,Ti.unshift(new pe(0,0,la[0].length))),ie(Ti).level==1&&(la=xe.match(/\s+$/))&&(ie(Ti).to-=la[0].length,Ti.push(new pe(0,ut-la[0].length,ut)))),We=="rtl"?Ti.reverse():Ti}}();function lt(e,n){var D=e.order;return D==null&&(D=e.order=st(e.text,n)),D}var je=[],Ie=function(e,n,D){if(e.addEventListener)e.addEventListener(n,D,!1);else if(e.attachEvent)e.attachEvent("on"+n,D);else{var I=e._handlers||(e._handlers={});I[n]=(I[n]||je).concat(D)}};function tt(e,n){return e._handlers&&e._handlers[n]||je}function ot(e,n,D){if(e.removeEventListener)e.removeEventListener(n,D,!1);else if(e.detachEvent)e.detachEvent("on"+n,D);else{var I=e._handlers,B=I&&I[n];if(B){var J=re(B,D);J>-1&&(I[n]=B.slice(0,J).concat(B.slice(J+1)))}}}function ze(e,n){var D=tt(e,n);if(!D.length)return;for(var I=Array.prototype.slice.call(arguments,2),B=0;B<D.length;++B)D[B].apply(null,I)}function Ze(e,n,D){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),ze(e,D||n.type,e,n),ke(n)||n.codemirrorIgnore}function Ne(e){var n=e._handlers&&e._handlers.cursorActivity;if(!n)return;for(var D=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),I=0;I<n.length;++I)re(D,n[I])==-1&&D.push(n[I])}function Ae(e,n){return tt(e,n).length>0}function Me(e){e.prototype.on=function(n,D){Ie(this,n,D)},e.prototype.off=function(n,D){ot(this,n,D)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Fe(e){Ee(e),Ce(e)}function Be(e){return e.target||e.srcElement}function et(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),u&&e.ctrlKey&&n==1&&(n=3),n}var ct=function(){if(S&&b<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}(),yt;function ft(e){if(yt==null){var n=T("span","\u200B");E(e,T("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=n.offsetWidth<=1&&n.offsetHeight>2&&!(S&&b<8))}var D=yt?T("span","\u200B"):T("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return D.setAttribute("cm-text",""),D}var mt;function It(e){if(mt!=null)return mt;var n=E(e,document.createTextNode("A\u062EA")),D=L(n,0,1).getBoundingClientRect(),I=L(n,1,2).getBoundingClientRect();return x(e),!D||D.left==D.right?!1:mt=I.right-D.right<3}var At=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var n=0,D=[],I=e.length;n<=I;){var B=e.indexOf(`
|
|
|
`,n);B==-1&&(B=e.length);var J=e.slice(n,e.charAt(B-1)=="\r"?B-1:B),se=J.indexOf("\r");se!=-1?(D.push(J.slice(0,se)),n+=se+1):(D.push(J),n=B+1)}return D}:function(e){return e.split(/\r\n?|\n/)},_t=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(D){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},Vt=function(){var e=T("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Kt=null;function tr(e){if(Kt!=null)return Kt;var n=E(e,T("span","x")),D=n.getBoundingClientRect(),I=L(n,0,1).getBoundingClientRect();return Kt=Math.abs(D.left-I.left)>1}var rr={},Wt={};function Lt(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),rr[e]=n}function nr(e,n){Wt[e]=n}function dt(e){if(typeof e=="string"&&Wt.hasOwnProperty(e))e=Wt[e];else if(e&&typeof e.name=="string"&&Wt.hasOwnProperty(e.name)){var n=Wt[e.name];typeof n=="string"&&(n={name:n}),e=Oe(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return dt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return dt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Et(e,n){n=dt(n);var D=rr[n.name];if(!D)return Et(e,"text/plain");var I=D(e,n);if(jt.hasOwnProperty(n.name)){var B=jt[n.name];for(var J in B){if(!B.hasOwnProperty(J))continue;I.hasOwnProperty(J)&&(I["_"+J]=I[J]),I[J]=B[J]}}if(I.name=n.name,n.helperType&&(I.helperType=n.helperType),n.modeProps)for(var se in n.modeProps)I[se]=n.modeProps[se];return I}var jt={};function kt(e,n){var D=jt.hasOwnProperty(e)?jt[e]:jt[e]={};P(n,D)}function hr(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var D={};for(var I in n){var B=n[I];B instanceof Array&&(B=B.concat([])),D[I]=B}return D}function Nn(e,n){for(var D;e.innerMode&&!(D=e.innerMode(n),!D||D.mode==e);)n=D.state,e=D.mode;return D||{mode:e,state:n}}function Ct(e,n,D){return e.startState?e.startState(n,D):!0}var Dt=function(e,n,D){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=D};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Dt.prototype.eat=function(e){var n=this.string.charAt(this.pos),D;if(typeof e=="string"?D=n==e:D=n&&(e.test?e.test(n):e(n)),D)return++this.pos,n},Dt.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.match=function(e,n,D){if(typeof e=="string"){var I=function(se){return D?se.toLowerCase():se},B=this.string.substr(this.pos,e.length);if(I(B)==I(e))return n!==!1&&(this.pos+=e.length),!0}else{var J=this.string.slice(this.pos).match(e);return J&&J.index>0?null:(J&&n!==!1&&(this.pos+=J[0].length),J)}},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function wt(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var D=e;!D.lines;)for(var I=0;;++I){var B=D.children[I],J=B.chunkSize();if(n<J){D=B;break}n-=J}return D.lines[n]}function wr(e,n,D){var I=[],B=n.line;return e.iter(n.line,D.line+1,function(J){var se=J.text;B==D.line&&(se=se.slice(0,D.ch)),B==n.line&&(se=se.slice(n.ch)),I.push(se),++B}),I}function Cr(e,n,D){var I=[];return e.iter(n,D,function(B){I.push(B.text)}),I}function Jt(e,n){var D=n-e.height;if(D)for(var I=e;I;I=I.parent)I.height+=D}function Ut(e){if(e.parent==null)return null;for(var n=e.parent,D=re(n.lines,e),I=n.parent;I;n=I,I=I.parent)for(var B=0;!(I.children[B]==n);++B)D+=I.children[B].chunkSize();return D+n.first}function Or(e,n){var D=e.first;e:do{for(var I=0;I<e.children.length;++I){var B=e.children[I],J=B.height;if(n<J){e=B;continue e}n-=J,D+=B.chunkSize()}return D}while(!e.lines);for(var se=0;se<e.lines.length;++se){var fe=e.lines[se],pe=fe.height;if(n<pe)break;n-=pe}return D+se}function un(e,n){return n>=e.first&&n<e.first+e.size}function Nr(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function bt(e,n,D){if(D===void 0&&(D=null),!(this instanceof bt))return new bt(e,n,D);this.line=e,this.ch=n,this.sticky=D}function Bt(e,n){return e.line-n.line||e.ch-n.ch}function Jr(e,n){return e.sticky==n.sticky&&Bt(e,n)==0}function on(e){return bt(e.line,e.ch)}function Ln(e,n){return Bt(e,n)<0?n:e}function Sn(e,n){return Bt(e,n)<0?e:n}function le(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function K(e,n){if(n.line<e.first)return bt(e.first,0);var D=e.first+e.size-1;return n.line>D?bt(D,wt(e,D).text.length):X(n,wt(e,n.line).text.length)}function X(e,n){var D=e.ch;return D==null||D>n?bt(e.line,n):D<0?bt(e.line,0):e}function ee(e,n){for(var D=[],I=0;I<n.length;I++)D[I]=K(e,n[I]);return D}var me=function(e,n){this.state=e,this.lookAhead=n},ae=function(e,n,D,I){this.state=n,this.doc=e,this.line=D,this.maxLookAhead=I||0,this.baseTokens=null,this.baseTokenPos=1};ae.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},ae.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ae.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ae.fromSaved=function(e,n,D){return n instanceof me?new ae(e,hr(e.mode,n.state),D,n.lookAhead):new ae(e,hr(e.mode,n),D)},ae.prototype.save=function(e){var n=e!==!1?hr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new me(n,this.maxLookAhead):n};function Ke(e,n,D,I){var B=[e.state.modeGen],J={};zr(e,n.text,e.doc.mode,D,function(xe,We){return B.push(xe,We)},J,I);for(var se=D.state,fe=function(xe){D.baseTokens=B;var We=e.state.overlays[xe],Ve=1,ut=0;D.state=!0,zr(e,n.text,We.mode,D,function(it,gt){for(var xt=Ve;ut<it;){var Rt=B[Ve];Rt>it&&B.splice(Ve,1,it,B[Ve+1],Rt),Ve+=2,ut=Math.min(it,Rt)}if(!gt)return;if(We.opaque)B.splice(xt,Ve-xt,it,"overlay "+gt),Ve=xt+2;else for(;xt<Ve;xt+=2){var Pt=B[xt+1];B[xt+1]=(Pt?Pt+" ":"")+"overlay "+gt}},J),D.state=se,D.baseTokens=null,D.baseTokenPos=1},pe=0;pe<e.state.overlays.length;++pe)fe(pe);return{styles:B,classes:J.bgClass||J.textClass?J:null}}function pt(e,n,D){if(!n.styles||n.styles[0]!=e.state.modeGen){var I=Ot(e,Ut(n)),B=n.text.length>e.options.maxHighlightLength&&hr(e.doc.mode,I.state),J=Ke(e,n,I);B&&(I.state=B),n.stateAfter=I.save(!B),n.styles=J.styles,J.classes?n.styleClasses=J.classes:n.styleClasses&&(n.styleClasses=null),D===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function Ot(e,n,D){var I=e.doc,B=e.display;if(!I.mode.startState)return new ae(I,!0,n);var J=or(e,n,D),se=J>I.first&&wt(I,J-1).stateAfter,fe=se?ae.fromSaved(I,se,J):new ae(I,Ct(I.mode),J);return I.iter(J,n,function(pe){Ht(e,pe.text,fe);var xe=fe.line;pe.stateAfter=xe==n-1||xe%5==0||xe>=B.viewFrom&&xe<B.viewTo?fe.save():null,fe.nextLine()}),D&&(I.modeFrontier=fe.line),fe}function Ht(e,n,D,I){var B=e.doc.mode,J=new Dt(n,e.options.tabSize,D);for(J.start=J.pos=I||0,n==""&&vt(B,D.state);!J.eol();)Xt(B,J,D.state),J.start=J.pos}function vt(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var D=Nn(e,n);if(D.mode.blankLine)return D.mode.blankLine(D.state)}function Xt(e,n,D,I){for(var B=0;B<10;B++){I&&(I[0]=Nn(e,D).mode);var J=e.token(n,D);if(n.pos>n.start)return J}throw new Error("Mode "+e.name+" failed to advance stream.")}var qt=function(e,n,D){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=D};function Hr(e,n,D,I){var B=e.doc,J=B.mode,se;n=K(B,n);var fe=wt(B,n.line),pe=Ot(e,n.line,D),xe=new Dt(fe.text,e.options.tabSize,pe),We;for(I&&(We=[]);(I||xe.pos<n.ch)&&!xe.eol();)xe.start=xe.pos,se=Xt(J,xe,pe.state),I&&We.push(new qt(xe,se,hr(B.mode,pe.state)));return I?We:new qt(xe,se,pe.state)}function nn(e,n){if(e)for(;;){var D=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!D)break;e=e.slice(0,D.index)+e.slice(D.index+D[0].length);var I=D[1]?"bgClass":"textClass";n[I]==null?n[I]=D[2]:new RegExp("(?:^|\\s)"+D[2]+"(?:$|\\s)").test(n[I])||(n[I]+=" "+D[2])}return e}function zr(e,n,D,I,B,J,se){var fe=D.flattenSpans;fe==null&&(fe=e.options.flattenSpans);var pe=0,xe=null,We=new Dt(n,e.options.tabSize,I),Ve,ut=e.options.addModeClass&&[null];for(n==""&&nn(vt(D,I.state),J);!We.eol();){if(We.pos>e.options.maxHighlightLength?(fe=!1,se&&Ht(e,n,I,We.pos),We.pos=n.length,Ve=null):Ve=nn(Xt(D,We,I.state,ut),J),ut){var it=ut[0].name;it&&(Ve="m-"+(Ve?it+" "+Ve:it))}if(!fe||xe!=Ve){for(;pe<We.start;)pe=Math.min(We.start,pe+5e3),B(pe,xe);xe=Ve}We.start=We.pos}for(;pe<We.pos;){var gt=Math.min(We.pos,pe+5e3);B(gt,xe),pe=gt}}function or(e,n,D){for(var I,B,J=e.doc,se=D?-1:n-(e.doc.mode.innerMode?1e3:100),fe=n;fe>se;--fe){if(fe<=J.first)return J.first;var pe=wt(J,fe-1),xe=pe.stateAfter;if(xe&&(!D||fe+(xe instanceof me?xe.lookAhead:0)<=J.modeFrontier))return fe;var We=H(pe.text,null,e.options.tabSize);(B==null||I>We)&&(B=fe-1,I=We)}return B}function Qr(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),e.highlightFrontier<n-10)return;for(var D=e.first,I=n-1;I>D;I--){var B=wt(e,I).stateAfter;if(B&&(!(B instanceof me)||I+B.lookAhead<n)){D=I+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,D)}var Cn=!1,zt=!1;function pr(){Cn=!0}function fr(){zt=!0}function jr(e,n,D){this.marker=e,this.from=n,this.to=D}function Er(e,n){if(e)for(var D=0;D<e.length;++D){var I=e[D];if(I.marker==n)return I}}function li(e,n){for(var D,I=0;I<e.length;++I)e[I]!=n&&(D||(D=[])).push(e[I]);return D}function On(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function Ui(e,n,D){var I;if(e)for(var B=0;B<e.length;++B){var J=e[B],se=J.marker,fe=J.from==null||(se.inclusiveLeft?J.from<=n:J.from<n);if(fe||J.from==n&&se.type=="bookmark"&&(!D||!J.marker.insertLeft)){var pe=J.to==null||(se.inclusiveRight?J.to>=n:J.to>n);(I||(I=[])).push(new jr(se,J.from,pe?null:J.to))}}return I}function Bi(e,n,D){var I;if(e)for(var B=0;B<e.length;++B){var J=e[B],se=J.marker,fe=J.to==null||(se.inclusiveRight?J.to>=n:J.to>n);if(fe||J.from==n&&se.type=="bookmark"&&(!D||J.marker.insertLeft)){var pe=J.from==null||(se.inclusiveLeft?J.from<=n:J.from<n);(I||(I=[])).push(new jr(se,pe?null:J.from-n,J.to==null?null:J.to-n))}}return I}function qn(e,n){if(n.full)return null;var D=un(e,n.from.line)&&wt(e,n.from.line).markedSpans,I=un(e,n.to.line)&&wt(e,n.to.line).markedSpans;if(!D&&!I)return null;var B=n.from.ch,J=n.to.ch,se=Bt(n.from,n.to)==0,fe=Ui(D,B,se),pe=Bi(I,J,se),xe=n.text.length==1,We=ie(n.text).length+(xe?B:0);if(fe)for(var Ve=0;Ve<fe.length;++Ve){var ut=fe[Ve];if(ut.to==null){var it=Er(pe,ut.marker);it?xe&&(ut.to=it.to==null?null:it.to+We):ut.to=B}}if(pe)for(var gt=0;gt<pe.length;++gt){var xt=pe[gt];if(xt.to!=null&&(xt.to+=We),xt.from==null){var Rt=Er(fe,xt.marker);Rt||(xt.from=We,xe&&(fe||(fe=[])).push(xt))}else xt.from+=We,xe&&(fe||(fe=[])).push(xt)}fe&&(fe=sn(fe)),pe&&pe!=fe&&(pe=sn(pe));var Pt=[fe];if(!xe){var Gt=n.text.length-2,Nt;if(Gt>0&&fe)for(var $t=0;$t<fe.length;++$t)fe[$t].to==null&&(Nt||(Nt=[])).push(new jr(fe[$t].marker,null,null));for(var dr=0;dr<Gt;++dr)Pt.push(Nt);Pt.push(pe)}return Pt}function sn(e){for(var n=0;n<e.length;++n){var D=e[n];D.from!=null&&D.from==D.to&&D.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Si(e,n,D){var I=null;if(e.iter(n.line,D.line+1,function(it){if(it.markedSpans)for(var gt=0;gt<it.markedSpans.length;++gt){var xt=it.markedSpans[gt].marker;xt.readOnly&&(!I||re(I,xt)==-1)&&(I||(I=[])).push(xt)}}),!I)return null;for(var B=[{from:n,to:D}],J=0;J<I.length;++J)for(var se=I[J],fe=se.find(0),pe=0;pe<B.length;++pe){var xe=B[pe];if(Bt(xe.to,fe.from)<0||Bt(xe.from,fe.to)>0)continue;var We=[pe,1],Ve=Bt(xe.from,fe.from),ut=Bt(xe.to,fe.to);(Ve<0||!se.inclusiveLeft&&!Ve)&&We.push({from:xe.from,to:fe.from}),(ut>0||!se.inclusiveRight&&!ut)&&We.push({from:fe.to,to:xe.to}),B.splice.apply(B,We),pe+=We.length-3}return B}function dn(e){var n=e.markedSpans;if(!n)return;for(var D=0;D<n.length;++D)n[D].marker.detachLine(e);e.markedSpans=null}function Yn(e,n){if(!n)return;for(var D=0;D<n.length;++D)n[D].marker.attachLine(e);e.markedSpans=n}function Zr(e){return e.inclusiveLeft?-1:0}function cr(e){return e.inclusiveRight?1:0}function tn(e,n){var D=e.lines.length-n.lines.length;if(D!=0)return D;var I=e.find(),B=n.find(),J=Bt(I.from,B.from)||Zr(e)-Zr(n);if(J)return-J;var se=Bt(I.to,B.to)||cr(e)-cr(n);return se||n.id-e.id}function br(e,n){var D=zt&&e.markedSpans,I;if(D)for(var B=void 0,J=0;J<D.length;++J)B=D[J],B.marker.collapsed&&(n?B.from:B.to)==null&&(!I||tn(I,B.marker)<0)&&(I=B.marker);return I}function hn(e){return br(e,!0)}function Fr(e){return br(e,!1)}function mi(e,n){var D=zt&&e.markedSpans,I;if(D)for(var B=0;B<D.length;++B){var J=D[B];J.marker.collapsed&&(J.from==null||J.from<n)&&(J.to==null||J.to>n)&&(!I||tn(I,J.marker)<0)&&(I=J.marker)}return I}function _n(e,n,D,I,B){var J=wt(e,n),se=zt&&J.markedSpans;if(se)for(var fe=0;fe<se.length;++fe){var pe=se[fe];if(!pe.marker.collapsed)continue;var xe=pe.marker.find(0),We=Bt(xe.from,D)||Zr(pe.marker)-Zr(B),Ve=Bt(xe.to,I)||cr(pe.marker)-cr(B);if(We>=0&&Ve<=0||We<=0&&Ve>=0)continue;if(We<=0&&(pe.marker.inclusiveRight&&B.inclusiveLeft?Bt(xe.to,D)>=0:Bt(xe.to,D)>0)||We>=0&&(pe.marker.inclusiveRight&&B.inclusiveLeft?Bt(xe.from,I)<=0:Bt(xe.from,I)<0))return!0}}function Un(e){for(var n;n=hn(e);)e=n.find(-1,!0).line;return e}function Di(e){for(var n;n=Fr(e);)e=n.find(1,!0).line;return e}function ui(e){for(var n,D;n=Fr(e);)e=n.find(1,!0).line,(D||(D=[])).push(e);return D}function bi(e,n){var D=wt(e,n),I=Un(D);return D==I?n:Ut(I)}function ei(e,n){if(n>e.lastLine())return n;var D=wt(e,n),I;if(!ti(e,D))return n;for(;I=Fr(D);)D=I.find(1,!0).line;return Ut(D)+1}function ti(e,n){var D=zt&&n.markedSpans;if(D)for(var I=void 0,B=0;B<D.length;++B){if(I=D[B],!I.marker.collapsed)continue;if(I.from==null)return!0;if(I.marker.widgetNode)continue;if(I.from==0&&I.marker.inclusiveLeft&&ji(e,n,I))return!0}}function ji(e,n,D){if(D.to==null){var I=D.marker.find(1,!0);return ji(e,I.line,Er(I.line.markedSpans,D.marker))}if(D.marker.inclusiveRight&&D.to==n.text.length)return!0;for(var B=void 0,J=0;J<n.markedSpans.length;++J)if(B=n.markedSpans[J],B.marker.collapsed&&!B.marker.widgetNode&&B.from==D.to&&(B.to==null||B.to!=D.from)&&(B.marker.inclusiveLeft||D.marker.inclusiveRight)&&ji(e,n,B))return!0}function ci(e){e=Un(e);for(var n=0,D=e.parent,I=0;I<D.lines.length;++I){var B=D.lines[I];if(B==e)break;n+=B.height}for(var J=D.parent;J;D=J,J=D.parent)for(var se=0;se<J.children.length;++se){var fe=J.children[se];if(fe==D)break;n+=fe.height}return n}function _i(e){if(e.height==0)return 0;for(var n=e.text.length,D,I=e;D=hn(I);){var B=D.find(0,!0);I=B.from.line,n+=B.from.ch-B.to.ch}for(I=e;D=Fr(I);){var J=D.find(0,!0);n-=I.text.length-J.from.ch,I=J.to.line,n+=I.text.length-J.to.ch}return n}function Hi(e){var n=e.display,D=e.doc;n.maxLine=wt(D,D.first),n.maxLineLength=_i(n.maxLine),n.maxLineChanged=!0,D.iter(function(I){var B=_i(I);B>n.maxLineLength&&(n.maxLineLength=B,n.maxLine=I)})}var di=function(e,n,D){this.text=e,Yn(this,n),this.height=D?D(this):1};di.prototype.lineNo=function(){return Ut(this)},Me(di);function qr(e,n,D,I){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dn(e),Yn(e,D);var B=I?I(e):1;B!=e.height&&Jt(e,B)}function Yt(e){e.parent=null,dn(e)}var sr={},Qt={};function gr(e,n){if(!e||/^\s*$/.test(e))return null;var D=n.addModeClass?Qt:sr;return D[e]||(D[e]=e.replace(/\S+/g,"cm-$&"))}function Lr(e,n){var D=M("span",null,null,p?"padding-right: .1px":null),I={pre:M("pre",[D],"CodeMirror-line"),content:D,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var B=0;B<=(n.rest?n.rest.length:0);B++){var J=B?n.rest[B-1]:n.line,se=void 0;I.pos=0,I.addToken=Ar,It(e.display.measure)&&(se=lt(J,e.doc.direction))&&(I.addToken=$n(I.addToken,se)),I.map=[];var fe=n!=e.display.externalMeasured&&Ut(J);Ei(J,I,pt(e,J,fe)),J.styleClasses&&(J.styleClasses.bgClass&&(I.bgClass=W(J.styleClasses.bgClass,I.bgClass||"")),J.styleClasses.textClass&&(I.textClass=W(J.styleClasses.textClass,I.textClass||""))),I.map.length==0&&I.map.push(0,0,I.content.appendChild(ft(e.display.measure))),B==0?(n.measure.map=I.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(I.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(p){var pe=I.content.lastChild;(/\bcm-tab\b/.test(pe.className)||pe.querySelector&&pe.querySelector(".cm-tab"))&&(I.content.className="cm-tab-wrap-hack")}return ze(e,"renderLine",e,n.line,I.pre),I.pre.className&&(I.textClass=W(I.pre.className,I.textClass||"")),I}function Kr(e){var n=T("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function Ar(e,n,D,I,B,J,se){if(!n)return;var fe=e.splitSpaces?gn(n,e.trailingSpace):n,pe=e.cm.state.specialChars,xe=!1,We;if(!pe.test(n))e.col+=n.length,We=document.createTextNode(fe),e.map.push(e.pos,e.pos+n.length,We),S&&b<9&&(xe=!0),e.pos+=n.length;else{We=document.createDocumentFragment();for(var Ve=0;;){pe.lastIndex=Ve;var ut=pe.exec(n),it=ut?ut.index-Ve:n.length-Ve;if(it){var gt=document.createTextNode(fe.slice(Ve,Ve+it));S&&b<9?We.appendChild(T("span",[gt])):We.appendChild(gt),e.map.push(e.pos,e.pos+it,gt),e.col+=it,e.pos+=it}if(!ut)break;Ve+=it+1;var xt=void 0;if(ut[0]==" "){var Rt=e.cm.options.tabSize,Pt=Rt-e.col%Rt;xt=We.appendChild(T("span",ue(Pt),"cm-tab")),xt.setAttribute("role","presentation"),xt.setAttribute("cm-text"," "),e.col+=Pt}else ut[0]=="\r"||ut[0]==`
|
|
|
`?(xt=We.appendChild(T("span",ut[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),xt.setAttribute("cm-text",ut[0]),e.col+=1):(xt=e.cm.options.specialCharPlaceholder(ut[0]),xt.setAttribute("cm-text",ut[0]),S&&b<9?We.appendChild(T("span",[xt])):We.appendChild(xt),e.col+=1);e.map.push(e.pos,e.pos+1,xt),e.pos++}}if(e.trailingSpace=fe.charCodeAt(n.length-1)==32,D||I||B||xe||J||se){var Gt=D||"";I&&(Gt+=I),B&&(Gt+=B);var Nt=T("span",[We],Gt,J);if(se)for(var $t in se)se.hasOwnProperty($t)&&$t!="style"&&$t!="class"&&Nt.setAttribute($t,se[$t]);return e.content.appendChild(Nt)}e.content.appendChild(We)}function gn(e,n){if(e.length>1&&!/ /.test(e))return e;for(var D=n,I="",B=0;B<e.length;B++){var J=e.charAt(B);J==" "&&D&&(B==e.length-1||e.charCodeAt(B+1)==32)&&(J="\xA0"),I+=J,D=J==" "}return I}function $n(e,n){return function(D,I,B,J,se,fe,pe){B=B?B+" cm-force-border":"cm-force-border";for(var xe=D.pos,We=xe+I.length;;){for(var Ve=void 0,ut=0;ut<n.length&&!(Ve=n[ut],Ve.to>xe&&Ve.from<=xe);ut++);if(Ve.to>=We)return e(D,I,B,J,se,fe,pe);e(D,I.slice(0,Ve.to-xe),B,J,null,fe,pe),J=null,I=I.slice(Ve.to-xe),xe=Ve.to}}}function xr(e,n,D,I){var B=!I&&D.widgetNode;B&&e.map.push(e.pos,e.pos+n,B),!I&&e.cm.display.input.needsContentAttribute&&(B||(B=e.content.appendChild(document.createElement("span"))),B.setAttribute("cm-marker",D.id)),B&&(e.cm.display.input.setUneditable(B),e.content.appendChild(B)),e.pos+=n,e.trailingSpace=!1}function Ei(e,n,D){var I=e.markedSpans,B=e.text,J=0;if(!I){for(var se=1;se<D.length;se+=2)n.addToken(n,B.slice(J,J=D[se]),gr(D[se+1],n.cm.options));return}for(var fe=B.length,pe=0,xe=1,We="",Ve,ut,it=0,gt,xt,Rt,Pt,Gt;;){if(it==pe){gt=xt=Rt=ut="",Gt=null,Pt=null,it=Infinity;for(var Nt=[],$t=void 0,dr=0;dr<I.length;++dr){var ar=I[dr],Pr=ar.marker;if(Pr.type=="bookmark"&&ar.from==pe&&Pr.widgetNode)Nt.push(Pr);else if(ar.from<=pe&&(ar.to==null||ar.to>pe||Pr.collapsed&&ar.to==pe&&ar.from==pe)){if(ar.to!=null&&ar.to!=pe&&it>ar.to&&(it=ar.to,xt=""),Pr.className&&(gt+=" "+Pr.className),Pr.css&&(ut=(ut?ut+";":"")+Pr.css),Pr.startStyle&&ar.from==pe&&(Rt+=" "+Pr.startStyle),Pr.endStyle&&ar.to==it&&($t||($t=[])).push(Pr.endStyle,ar.to),Pr.title&&((Gt||(Gt={})).title=Pr.title),Pr.attributes)for(var Tn in Pr.attributes)(Gt||(Gt={}))[Tn]=Pr.attributes[Tn];Pr.collapsed&&(!Pt||tn(Pt.marker,Pr)<0)&&(Pt=ar)}else ar.from>pe&&it>ar.from&&(it=ar.from)}if($t)for(var fi=0;fi<$t.length;fi+=2)$t[fi+1]==it&&(xt+=" "+$t[fi]);if(!Pt||Pt.from==pe)for(var Fn=0;Fn<Nt.length;++Fn)xr(n,0,Nt[Fn]);if(Pt&&(Pt.from||0)==pe){if(xr(n,(Pt.to==null?fe+1:Pt.to)-pe,Pt.marker,Pt.from==null),Pt.to==null)return;Pt.to==pe&&(Pt=!1)}}if(pe>=fe)break;for(var Fi=Math.min(fe,it);;){if(We){var Mi=pe+We.length;if(!Pt){var Qn=Mi>Fi?We.slice(0,Fi-pe):We;n.addToken(n,Qn,Ve?Ve+gt:gt,Rt,pe+Qn.length==it?xt:"",ut,Gt)}if(Mi>=Fi){We=We.slice(Fi-pe),pe=Fi;break}pe=Mi,Rt=""}We=B.slice(J,J=D[xe++]),Ve=gr(D[xe++],n.cm.options)}}}function Vr(e,n,D){this.line=n,this.rest=ui(n),this.size=this.rest?Ut(ie(this.rest))-D+1:1,this.node=this.text=null,this.hidden=ti(e,n)}function jn(e,n,D){for(var I=[],B,J=n;J<D;J=B){var se=new Vr(e.doc,wt(e.doc,J),J);B=J+se.size,I.push(se)}return I}var Bn=null;function gi(e){Bn?Bn.ops.push(e):e.ownsGroup=Bn={ops:[e],delayedCallbacks:[]}}function ua(e){var n=e.delayedCallbacks,D=0;do{for(;D<n.length;D++)n[D].call(null);for(var I=0;I<e.ops.length;I++){var B=e.ops[I];if(B.cursorActivityHandlers)for(;B.cursorActivityCalled<B.cursorActivityHandlers.length;)B.cursorActivityHandlers[B.cursorActivityCalled++].call(null,B.cm)}}while(D<n.length)}function Xr(e,n){var D=e.ownsGroup;if(!D)return;try{ua(D)}finally{Bn=null,n(D)}}var Mr=null;function Rr(e,n){var D=tt(e,n);if(!D.length)return;var I=Array.prototype.slice.call(arguments,2),B;Bn?B=Bn.delayedCallbacks:Mr?B=Mr:(B=Mr=[],setTimeout(hi,0));for(var J=function(fe){B.push(function(){return D[fe].apply(null,I)})},se=0;se<D.length;++se)J(se)}function hi(){var e=Mr;Mr=null;for(var n=0;n<e.length;++n)e[n]()}function Xi(e,n,D,I){for(var B=0;B<n.changes.length;B++){var J=n.changes[B];J=="text"?mr(e,n):J=="gutter"?rn(e,n,D,I):J=="class"?vr(e,n):J=="widget"&&Ir(e,n,I)}n.changes=null}function Yi(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),S&&b<8&&(e.node.style.zIndex=2)),e.node}function lr(e,n){var D=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(D&&(D+=" CodeMirror-linebackground"),n.background)D?n.background.className=D:(n.background.parentNode.removeChild(n.background),n.background=null);else if(D){var I=Yi(n);n.background=I.insertBefore(T("div",null,D),I.firstChild),e.display.input.setUneditable(n.background)}}function Ft(e,n){var D=e.display.externalMeasured;return D&&D.line==n.line?(e.display.externalMeasured=null,n.measure=D.measure,D.built):Lr(e,n)}function mr(e,n){var D=n.text.className,I=Ft(e,n);n.text==n.node&&(n.node=I.pre),n.text.parentNode.replaceChild(I.pre,n.text),n.text=I.pre,I.bgClass!=n.bgClass||I.textClass!=n.textClass?(n.bgClass=I.bgClass,n.textClass=I.textClass,vr(e,n)):D&&(n.text.className=D)}function vr(e,n){lr(e,n),n.line.wrapClass?Yi(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var D=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=D||""}function rn(e,n,D,I){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var B=Yi(n);n.gutterBackground=T("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?I.fixedPos:-I.gutterTotalWidth)+"px; width: "+I.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),B.insertBefore(n.gutterBackground,n.text)}var J=n.line.gutterMarkers;if(e.options.lineNumbers||J){var se=Yi(n),fe=n.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?I.fixedPos:-I.gutterTotalWidth)+"px");if(e.display.input.setUneditable(fe),se.insertBefore(fe,n.text),n.line.gutterClass&&(fe.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!J||!J["CodeMirror-linenumbers"])&&(n.lineNumber=fe.appendChild(T("div",Nr(e.options,D),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+I.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),J)for(var pe=0;pe<e.display.gutterSpecs.length;++pe){var xe=e.display.gutterSpecs[pe].className,We=J.hasOwnProperty(xe)&&J[xe];We&&fe.appendChild(T("div",[We],"CodeMirror-gutter-elt","left: "+I.gutterLeft[xe]+"px; width: "+I.gutterWidth[xe]+"px"))}}}function Ir(e,n,D){n.alignable&&(n.alignable=null);for(var I=O("CodeMirror-linewidget"),B=n.node.firstChild,J=void 0;B;B=J)J=B.nextSibling,I.test(B.className)&&n.node.removeChild(B);En(e,n,D)}function An(e,n,D,I){var B=Ft(e,n);return n.text=n.node=B.pre,B.bgClass&&(n.bgClass=B.bgClass),B.textClass&&(n.textClass=B.textClass),vr(e,n),rn(e,n,D,I),En(e,n,I),n.node}function En(e,n,D){if(Li(e,n.line,n,D,!0),n.rest)for(var I=0;I<n.rest.length;I++)Li(e,n.rest[I],n,D,!1)}function Li(e,n,D,I,B){if(!n.widgets)return;for(var J=Yi(D),se=0,fe=n.widgets;se<fe.length;++se){var pe=fe[se],xe=T("div",[pe.node],"CodeMirror-linewidget"+(pe.className?" "+pe.className:""));pe.handleMouseEvents||xe.setAttribute("cm-ignore-events","true"),Hn(pe,xe,D,I),e.display.input.setUneditable(xe),B&&pe.above?J.insertBefore(xe,D.gutter||D.text):J.appendChild(xe),Rr(pe,"redraw")}}function Hn(e,n,D,I){if(e.noHScroll){(D.alignable||(D.alignable=[])).push(n);var B=I.wrapperWidth;n.style.left=I.fixedPos+"px",e.coverGutter||(B-=I.gutterTotalWidth,n.style.paddingLeft=I.gutterTotalWidth+"px"),n.style.width=B+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-I.gutterTotalWidth+"px"))}function Gn(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!A(document.body,e.node)){var D="position: relative;";e.coverGutter&&(D+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(D+="width: "+n.display.wrapper.clientWidth+"px;"),E(n.display.measure,T("div",[e.node],null,D))}return e.height=e.node.parentNode.offsetHeight}function Jn(e,n){for(var D=Be(n);D!=e.wrapper;D=D.parentNode)if(!D||D.nodeType==1&&D.getAttribute("cm-ignore-events")=="true"||D.parentNode==e.sizer&&D!=e.mover)return!0}function $i(e){return e.lineSpace.offsetTop}function Pe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Xe(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=E(e.measure,T("pre","x","CodeMirror-line-like")),D=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,I={left:parseInt(D.paddingLeft),right:parseInt(D.paddingRight)};return!isNaN(I.left)&&!isNaN(I.right)&&(e.cachedPaddingH=I),I}function Je(e){return te-e.display.nativeBarWidth}function Ue(e){return e.display.scroller.clientWidth-Je(e)-e.display.barWidth}function _e(e){return e.display.scroller.clientHeight-Je(e)-e.display.barHeight}function Le(e,n,D){var I=e.options.lineWrapping,B=I&&Ue(e);if(!n.measure.heights||I&&n.measure.width!=B){var J=n.measure.heights=[];if(I){n.measure.width=B;for(var se=n.text.firstChild.getClientRects(),fe=0;fe<se.length-1;fe++){var pe=se[fe],xe=se[fe+1];Math.abs(pe.bottom-xe.bottom)>2&&J.push((pe.bottom+xe.top)/2-D.top)}}J.push(D.bottom-D.top)}}function we(e,n,D){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};for(var I=0;I<e.rest.length;I++)if(e.rest[I]==n)return{map:e.measure.maps[I],cache:e.measure.caches[I]};for(var B=0;B<e.rest.length;B++)if(Ut(e.rest[B])>D)return{map:e.measure.maps[B],cache:e.measure.caches[B],before:!0}}function He(e,n){n=Un(n);var D=Ut(n),I=e.display.externalMeasured=new Vr(e.doc,n,D);I.lineN=D;var B=I.built=Lr(e,I);return I.text=B.pre,E(e.display.lineMeasure,B.pre),I}function Ge(e,n,D,I){return nt(e,Ye(e,n),D,I)}function $e(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[wn(e,n)];var D=e.display.externalMeasured;if(D&&n>=D.lineN&&n<D.lineN+D.size)return D}function Ye(e,n){var D=Ut(n),I=$e(e,D);I&&!I.text?I=null:I&&I.changes&&(Xi(e,I,D,kn(e)),e.curOp.forceUpdate=!0),I||(I=He(e,n));var B=we(I,n,D);return{line:n,view:I,rect:null,map:B.map,cache:B.cache,before:B.before,hasHeights:!1}}function nt(e,n,D,I,B){n.before&&(D=-1);var J=D+(I||""),se;return n.cache.hasOwnProperty(J)?se=n.cache[J]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Le(e,n.view,n.rect),n.hasHeights=!0),se=Mt(e,n,D,I),se.bogus||(n.cache[J]=se)),{left:se.left,right:se.right,top:B?se.rtop:se.top,bottom:B?se.rbottom:se.bottom}}var ht={left:0,right:0,top:0,bottom:0};function St(e,n,D){for(var I,B,J,se,fe,pe,xe=0;xe<e.length;xe+=3)if(fe=e[xe],pe=e[xe+1],n<fe?(B=0,J=1,se="left"):n<pe?(B=n-fe,J=B+1):(xe==e.length-3||n==pe&&e[xe+3]>n)&&(J=pe-fe,B=J-1,n>=pe&&(se="right")),B!=null){if(I=e[xe+2],fe==pe&&D==(I.insertLeft?"left":"right")&&(se=D),D=="left"&&B==0)for(;xe&&e[xe-2]==e[xe-3]&&e[xe-1].insertLeft;)I=e[(xe-=3)+2],se="left";if(D=="right"&&B==pe-fe)for(;xe<e.length-3&&e[xe+3]==e[xe+4]&&!e[xe+5].insertLeft;)I=e[(xe+=3)+2],se="right";break}return{node:I,start:B,end:J,collapse:se,coverStart:fe,coverEnd:pe}}function Tt(e,n){var D=ht;if(n=="left")for(var I=0;I<e.length&&!((D=e[I]).left!=D.right);I++);else for(var B=e.length-1;B>=0&&!((D=e[B]).left!=D.right);B--);return D}function Mt(e,n,D,I){var B=St(n.map,D,I),J=B.node,se=B.start,fe=B.end,pe=B.collapse,xe;if(J.nodeType==3){for(var We=0;We<4;We++){for(;se&&be(n.line.text.charAt(B.coverStart+se));)--se;for(;B.coverStart+fe<B.coverEnd&&be(n.line.text.charAt(B.coverStart+fe));)++fe;if(S&&b<9&&se==0&&fe==B.coverEnd-B.coverStart?xe=J.parentNode.getBoundingClientRect():xe=Tt(L(J,se,fe).getClientRects(),I),xe.left||xe.right||se==0)break;fe=se,se=se-1,pe="right"}S&&b<11&&(xe=er(e.display.measure,xe))}else{se>0&&(pe=I="right");var Ve;e.options.lineWrapping&&(Ve=J.getClientRects()).length>1?xe=Ve[I=="right"?Ve.length-1:0]:xe=J.getBoundingClientRect()}if(S&&b<9&&!se&&(!xe||!xe.left&&!xe.right)){var ut=J.parentNode.getClientRects()[0];ut?xe={left:ut.left,right:ut.left+ri(e.display),top:ut.top,bottom:ut.bottom}:xe=ht}for(var it=xe.top-n.rect.top,gt=xe.bottom-n.rect.top,xt=(it+gt)/2,Rt=n.view.measure.heights,Pt=0;Pt<Rt.length-1&&!(xt<Rt[Pt]);Pt++);var Gt=Pt?Rt[Pt-1]:0,Nt=Rt[Pt],$t={left:(pe=="right"?xe.right:xe.left)-n.rect.left,right:(pe=="left"?xe.left:xe.right)-n.rect.left,top:Gt,bottom:Nt};return!xe.left&&!xe.right&&($t.bogus=!0),e.options.singleCursorHeightPerLine||($t.rtop=it,$t.rbottom=gt),$t}function er(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!tr(e))return n;var D=screen.logicalXDPI/screen.deviceXDPI,I=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*D,right:n.right*D,top:n.top*I,bottom:n.bottom*I}}function yr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function _r(e){e.display.externalMeasure=null,x(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)yr(e.display.view[n])}function Tr(e){_r(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function kr(){return t&&c?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Dr(){return t&&c?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Sr(e){var n=0;if(e.widgets)for(var D=0;D<e.widgets.length;++D)e.widgets[D].above&&(n+=Gn(e.widgets[D]));return n}function Yr(e,n,D,I,B){if(!B){var J=Sr(n);D.top+=J,D.bottom+=J}if(I=="line")return D;I||(I="local");var se=ci(n);if(I=="local"?se+=$i(e.display):se-=e.display.viewOffset,I=="page"||I=="window"){var fe=e.display.lineSpace.getBoundingClientRect();se+=fe.top+(I=="window"?0:Dr());var pe=fe.left+(I=="window"?0:kr());D.left+=pe,D.right+=pe}return D.top+=se,D.bottom+=se,D}function Ur(e,n,D){if(D=="div")return n;var I=n.left,B=n.top;if(D=="page")I-=kr(),B-=Dr();else if(D=="local"||!D){var J=e.display.sizer.getBoundingClientRect();I+=J.left,B+=J.top}var se=e.display.lineSpace.getBoundingClientRect();return{left:I-se.left,top:B-se.top}}function Rn(e,n,D,I,B){return I||(I=wt(e.doc,n.line)),Yr(e,I,Ge(e,I,n.ch,B),D)}function Br(e,n,D,I,B,J){I=I||wt(e.doc,n.line),B||(B=Ye(e,I));function se(gt,xt){var Rt=nt(e,B,gt,xt?"right":"left",J);return xt?Rt.left=Rt.right:Rt.right=Rt.left,Yr(e,I,Rt,D)}var fe=lt(I,e.doc.direction),pe=n.ch,xe=n.sticky;if(pe>=I.text.length?(pe=I.text.length,xe="before"):pe<=0&&(pe=0,xe="after"),!fe)return se(xe=="before"?pe-1:pe,xe=="before");function We(gt,xt,Rt){var Pt=fe[xt],Gt=Pt.level==1;return se(Rt?gt-1:gt,Gt!=Rt)}var Ve=qe(fe,pe,xe),ut=at,it=We(pe,Ve,xe=="before");return ut!=null&&(it.other=We(pe,ut,xe!="before")),it}function ur(e,n){var D=0;n=K(e.doc,n),e.options.lineWrapping||(D=ri(e.display)*n.ch);var I=wt(e.doc,n.line),B=ci(I)+$i(e.display);return{left:D,right:D,top:B,bottom:B+I.height}}function ir(e,n,D,I,B){var J=bt(e,n,D);return J.xRel=B,I&&(J.outside=I),J}function Wr(e,n,D){var I=e.doc;if(D+=e.display.viewOffset,D<0)return ir(I.first,0,null,-1,-1);var B=Or(I,D),J=I.first+I.size-1;if(B>J)return ir(I.first+I.size-1,wt(I,J).text.length,null,1,1);n<0&&(n=0);for(var se=wt(I,B);;){var fe=In(e,se,B,n,D),pe=mi(se,fe.ch+(fe.xRel>0||fe.outside>0?1:0));if(!pe)return fe;var xe=pe.find(1);if(xe.line==B)return xe;se=wt(I,B=xe.line)}}function $r(e,n,D,I){I-=Sr(n);var B=n.text.length,J=Qe(function(se){return nt(e,D,se-1).bottom<=I},B,0);return B=Qe(function(se){return nt(e,D,se).top>I},J,B),{begin:J,end:B}}function Zt(e,n,D,I){D||(D=Ye(e,n));var B=Yr(e,n,nt(e,D,I),"line").top;return $r(e,n,D,B)}function en(e,n,D,I){return e.bottom<=D?!1:e.top>D?!0:(I?e.left:e.right)>n}function In(e,n,D,I,B){B-=ci(n);var J=Ye(e,n),se=Sr(n),fe=0,pe=n.text.length,xe=!0,We=lt(n,e.doc.direction);if(We){var Ve=(e.options.lineWrapping?vn:an)(e,n,D,J,We,I,B);xe=Ve.level!=1,fe=xe?Ve.from:Ve.to-1,pe=xe?Ve.to:Ve.from-1}var ut=null,it=null,gt=Qe(function(dr){var ar=nt(e,J,dr);return ar.top+=se,ar.bottom+=se,en(ar,I,B,!1)?(ar.top<=B&&ar.left<=I&&(ut=dr,it=ar),!0):!1},fe,pe),xt,Rt,Pt=!1;if(it){var Gt=I-it.left<it.right-I,Nt=Gt==xe;gt=ut+(Nt?0:1),Rt=Nt?"after":"before",xt=Gt?it.left:it.right}else{!xe&&(gt==pe||gt==fe)&>++,Rt=gt==0?"after":gt==n.text.length?"before":nt(e,J,gt-(xe?1:0)).bottom+se<=B==xe?"after":"before";var $t=Br(e,bt(D,gt,Rt),"line",n,J);xt=$t.left,Pt=B<$t.top?-1:B>=$t.bottom?1:0}return gt=Re(n.text,gt,1),ir(D,gt,Rt,Pt,I-xt)}function an(e,n,D,I,B,J,se){var fe=Qe(function(Ve){var ut=B[Ve],it=ut.level!=1;return en(Br(e,bt(D,it?ut.to:ut.from,it?"before":"after"),"line",n,I),J,se,!0)},0,B.length-1),pe=B[fe];if(fe>0){var xe=pe.level!=1,We=Br(e,bt(D,xe?pe.from:pe.to,xe?"after":"before"),"line",n,I);en(We,J,se,!0)&&We.top>se&&(pe=B[fe-1])}return pe}function vn(e,n,D,I,B,J,se){var fe=$r(e,n,I,se),pe=fe.begin,xe=fe.end;/\s/.test(n.text.charAt(xe-1))&&xe--;for(var We=null,Ve=null,ut=0;ut<B.length;ut++){var it=B[ut];if(it.from>=xe||it.to<=pe)continue;var gt=it.level!=1,xt=nt(e,I,gt?Math.min(xe,it.to)-1:Math.max(pe,it.from)).right,Rt=xt<J?J-xt+1e9:xt-J;(!We||Ve>Rt)&&(We=it,Ve=Rt)}return We||(We=B[B.length-1]),We.from<pe&&(We={from:pe,to:We.to,level:We.level}),We.to>xe&&(We={from:We.from,to:xe,level:We.level}),We}var pn;function Wn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(pn==null){pn=T("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)pn.appendChild(document.createTextNode("x")),pn.appendChild(T("br"));pn.appendChild(document.createTextNode("x"))}E(e.measure,pn);var D=pn.offsetHeight/50;return D>3&&(e.cachedTextHeight=D),x(e.measure),D||1}function ri(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=T("span","xxxxxxxxxx"),D=T("pre",[n],"CodeMirror-line-like");E(e.measure,D);var I=n.getBoundingClientRect(),B=(I.right-I.left)/10;return B>2&&(e.cachedCharWidth=B),B||10}function kn(e){for(var n=e.display,D={},I={},B=n.gutters.clientLeft,J=n.gutters.firstChild,se=0;J;J=J.nextSibling,++se){var fe=e.display.gutterSpecs[se].className;D[fe]=J.offsetLeft+J.clientLeft+B,I[fe]=J.clientWidth}return{fixedPos:xi(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:D,gutterWidth:I,wrapperWidth:n.wrapper.clientWidth}}function xi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Wi(e){var n=Wn(e.display),D=e.options.lineWrapping,I=D&&Math.max(5,e.display.scroller.clientWidth/ri(e.display)-3);return function(B){if(ti(e.doc,B))return 0;var J=0;if(B.widgets)for(var se=0;se<B.widgets.length;se++)B.widgets[se].height&&(J+=B.widgets[se].height);return D?J+(Math.ceil(B.text.length/I)||1)*n:J+n}}function Ci(e){var n=e.doc,D=Wi(e);n.iter(function(I){var B=D(I);B!=I.height&&Jt(I,B)})}function ni(e,n,D,I){var B=e.display;if(!D&&Be(n).getAttribute("cm-not-content")=="true")return null;var J,se,fe=B.lineSpace.getBoundingClientRect();try{J=n.clientX-fe.left,se=n.clientY-fe.top}catch(Ve){return null}var pe=Wr(e,J,se),xe;if(I&&pe.xRel>0&&(xe=wt(e.doc,pe.line).text).length==pe.ch){var We=H(xe,xe.length,e.options.tabSize)-xe.length;pe=bt(pe.line,Math.max(0,Math.round((J-Xe(e.display).left)/ri(e.display))-We))}return pe}function wn(e,n){if(n>=e.display.viewTo)return null;if(n-=e.display.viewFrom,n<0)return null;for(var D=e.display.view,I=0;I<D.length;I++)if(n-=D[I].size,n<0)return I}function yn(e,n,D,I){n==null&&(n=e.doc.first),D==null&&(D=e.doc.first+e.doc.size),I||(I=0);var B=e.display;if(I&&D<B.viewTo&&(B.updateLineNumbers==null||B.updateLineNumbers>n)&&(B.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=B.viewTo)zt&&bi(e.doc,n)<B.viewTo&&Dn(e);else if(D<=B.viewFrom)zt&&ei(e.doc,D+I)>B.viewFrom?Dn(e):(B.viewFrom+=I,B.viewTo+=I);else if(n<=B.viewFrom&&D>=B.viewTo)Dn(e);else if(n<=B.viewFrom){var J=zi(e,D,D+I,1);J?(B.view=B.view.slice(J.index),B.viewFrom=J.lineN,B.viewTo+=I):Dn(e)}else if(D>=B.viewTo){var se=zi(e,n,n,-1);se?(B.view=B.view.slice(0,se.index),B.viewTo=se.lineN):Dn(e)}else{var fe=zi(e,n,n,-1),pe=zi(e,D,D+I,1);fe&&pe?(B.view=B.view.slice(0,fe.index).concat(jn(e,fe.lineN,pe.lineN)).concat(B.view.slice(pe.index)),B.viewTo+=I):Dn(e)}var xe=B.externalMeasured;xe&&(D<xe.lineN?xe.lineN+=I:n<xe.lineN+xe.size&&(B.externalMeasured=null))}function Mn(e,n,D){e.curOp.viewChanged=!0;var I=e.display,B=e.display.externalMeasured;if(B&&n>=B.lineN&&n<B.lineN+B.size&&(I.externalMeasured=null),n<I.viewFrom||n>=I.viewTo)return;var J=I.view[wn(e,n)];if(J.node==null)return;var se=J.changes||(J.changes=[]);re(se,D)==-1&&se.push(D)}function Dn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zi(e,n,D,I){var B=wn(e,n),J,se=e.display.view;if(!zt||D==e.doc.first+e.doc.size)return{index:B,lineN:D};for(var fe=e.display.viewFrom,pe=0;pe<B;pe++)fe+=se[pe].size;if(fe!=n){if(I>0){if(B==se.length-1)return null;J=fe+se[B].size-n,B++}else J=fe-n;n+=J,D+=J}for(;bi(e.doc,D)!=D;){if(B==(I<0?0:se.length-1))return null;D+=I*se[B-(I<0?1:0)].size,B+=I}return{index:B,lineN:D}}function ta(e,n,D){var I=e.display,B=I.view;B.length==0||n>=I.viewTo||D<=I.viewFrom?(I.view=jn(e,n,D),I.viewFrom=n):(I.viewFrom>n?I.view=jn(e,n,I.viewFrom).concat(I.view):I.viewFrom<n&&(I.view=I.view.slice(wn(e,n))),I.viewFrom=n,I.viewTo<D?I.view=I.view.concat(jn(e,I.viewTo,D)):I.viewTo>D&&(I.view=I.view.slice(0,wn(e,D)))),I.viewTo=D}function ra(e){for(var n=e.display.view,D=0,I=0;I<n.length;I++){var B=n[I];!B.hidden&&(!B.node||B.changes)&&++D}return D}function mn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ji(e,n){n===void 0&&(n=!0);for(var D=e.doc,I={},B=I.cursors=document.createDocumentFragment(),J=I.selection=document.createDocumentFragment(),se=0;se<D.sel.ranges.length;se++){if(!n&&se==D.sel.primIndex)continue;var fe=D.sel.ranges[se];if(fe.from().line>=e.display.viewTo||fe.to().line<e.display.viewFrom)continue;var pe=fe.empty();(pe||e.options.showCursorWhenSelecting)&&na(e,fe.head,B),pe||fn(e,fe,J)}return I}function na(e,n,D){var I=Br(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),B=D.appendChild(T("div","\xA0","CodeMirror-cursor"));if(B.style.left=I.left+"px",B.style.top=I.top+"px",B.style.height=Math.max(0,I.bottom-I.top)*e.options.cursorHeight+"px",I.other){var J=D.appendChild(T("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));J.style.display="",J.style.left=I.other.left+"px",J.style.top=I.other.top+"px",J.style.height=(I.other.bottom-I.other.top)*.85+"px"}}function xn(e,n){return e.top-n.top||e.left-n.left}function fn(e,n,D){var I=e.display,B=e.doc,J=document.createDocumentFragment(),se=Xe(e.display),fe=se.left,pe=Math.max(I.sizerWidth,Ue(e)-I.sizer.offsetLeft)-se.right,xe=B.direction=="ltr";function We(Nt,$t,dr,ar){$t<0&&($t=0),$t=Math.round($t),ar=Math.round(ar),J.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+Nt+`px;
|
|
|
top: `+$t+"px; width: "+(dr==null?pe-Nt:dr)+`px;
|
|
|
height: `+(ar-$t)+"px"))}function Ve(Nt,$t,dr){var ar=wt(B,Nt),Pr=ar.text.length,Tn,fi;function Fn(Qn,Pi){return Rn(e,bt(Nt,Qn),"div",ar,Pi)}function Fi(Qn,Pi,yi){var si=Zt(e,ar,null,Qn),Zn=Pi=="ltr"==(yi=="after")?"left":"right",zn=yi=="after"?si.begin:si.end-(/\s/.test(ar.text.charAt(si.end-1))?2:1);return Fn(zn,Zn)[Zn]}var Mi=lt(ar,B.direction);return rt(Mi,$t||0,dr==null?Pr:dr,function(Qn,Pi,yi,si){var Zn=yi=="ltr",zn=Fn(Qn,Zn?"left":"right"),Ni=Fn(Pi-1,Zn?"right":"left"),Za=$t==null&&Qn==0,Ca=dr==null&&Pi==Pr,Ti=si==0,la=!Mi||si==Mi.length-1;if(Ni.top-zn.top<=3){var pi=(xe?Za:Ca)&&Ti,ps=(xe?Ca:Za)&&la,ga=pi?fe:(Zn?zn:Ni).left,La=ps?pe:(Zn?Ni:zn).right;We(ga,zn.top,La-ga,zn.bottom)}else{var ka,Ii,qa,ms;Zn?(ka=xe&&Za&&Ti?fe:zn.left,Ii=xe?pe:Fi(Qn,yi,"before"),qa=xe?fe:Fi(Pi,yi,"after"),ms=xe&&Ca&&la?pe:Ni.right):(ka=xe?Fi(Qn,yi,"before"):fe,Ii=!xe&&Za&&Ti?pe:zn.right,qa=!xe&&Ca&&la?fe:Ni.left,ms=xe?Fi(Pi,yi,"after"):pe),We(ka,zn.top,Ii-ka,zn.bottom),zn.bottom<Ni.top&&We(fe,zn.bottom,null,Ni.top),We(qa,Ni.top,ms-qa,Ni.bottom)}(!Tn||xn(zn,Tn)<0)&&(Tn=zn),xn(Ni,Tn)<0&&(Tn=Ni),(!fi||xn(zn,fi)<0)&&(fi=zn),xn(Ni,fi)<0&&(fi=Ni)}),{start:Tn,end:fi}}var ut=n.from(),it=n.to();if(ut.line==it.line)Ve(ut.line,ut.ch,it.ch);else{var gt=wt(B,ut.line),xt=wt(B,it.line),Rt=Un(gt)==Un(xt),Pt=Ve(ut.line,ut.ch,Rt?gt.text.length+1:null).end,Gt=Ve(it.line,Rt?0:null,it.ch).start;Rt&&(Pt.top<Gt.top-2?(We(Pt.right,Pt.top,null,Pt.bottom),We(fe,Gt.top,Gt.left,Gt.bottom)):We(Pt.right,Pt.top,Gt.left-Pt.right,Pt.bottom)),Pt.bottom<Gt.top&&We(fe,Pt.bottom,null,Gt.top)}D.appendChild(J)}function ii(e){if(!e.state.focused)return;var n=e.display;clearInterval(n.blinker);var D=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||va(e),n.cursorDiv.style.visibility=(D=!D)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}function So(e){e.state.focused||(e.display.input.focus(),ia(e))}function eo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,va(e))},100)}function ia(e,n){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ze(e,"focus",e,n),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),p&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ii(e)}function va(e,n){if(e.state.delayingBlurEvent)return;e.state.focused&&(ze(e,"blur",e,n),e.state.focused=!1,g(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ma(e){for(var n=e.display,D=n.lineDiv.offsetTop,I=0;I<n.view.length;I++){var B=n.view[I],J=e.options.lineWrapping,se=void 0,fe=0;if(B.hidden)continue;if(S&&b<8){var pe=B.node.offsetTop+B.node.offsetHeight;se=pe-D,D=pe}else{var xe=B.node.getBoundingClientRect();se=xe.bottom-xe.top,!J&&B.text.firstChild&&(fe=B.text.firstChild.getBoundingClientRect().right-xe.left-1)}var We=B.line.height-se;if((We>.005||We<-.005)&&(Jt(B.line,se),to(B.line),B.rest))for(var Ve=0;Ve<B.rest.length;Ve++)to(B.rest[Ve]);if(fe>e.display.sizerWidth){var ut=Math.ceil(fe/ri(e.display));ut>e.display.maxLineLength&&(e.display.maxLineLength=ut,e.display.maxLine=B.line,e.display.maxLineChanged=!0)}}}function to(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var D=e.widgets[n],I=D.node.parentNode;I&&(D.height=I.offsetHeight)}}function Pa(e,n,D){var I=D&&D.top!=null?Math.max(0,D.top):e.scroller.scrollTop;I=Math.floor(I-$i(e));var B=D&&D.bottom!=null?D.bottom:I+e.wrapper.clientHeight,J=Or(n,I),se=Or(n,B);if(D&&D.ensure){var fe=D.ensure.from.line,pe=D.ensure.to.line;fe<J?(J=fe,se=Or(n,ci(wt(n,fe))+e.wrapper.clientHeight)):Math.min(pe,n.lastLine())>=se&&(J=Or(n,ci(wt(n,pe))-e.wrapper.clientHeight),se=pe)}return{from:J,to:Math.max(se,J+1)}}function Xo(e,n){if(Ze(e,"scrollCursorIntoView"))return;var D=e.display,I=D.sizer.getBoundingClientRect(),B=null;if(n.top+I.top<0?B=!0:n.bottom+I.top>(window.innerHeight||document.documentElement.clientHeight)&&(B=!1),B!=null&&!o){var J=T("div","\u200B",null,`position: absolute;
|
|
|
top: `+(n.top-D.viewOffset-$i(e.display))+`px;
|
|
|
height: `+(n.bottom-n.top+Je(e)+D.barHeight)+`px;
|
|
|
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(J),J.scrollIntoView(B),e.display.lineSpace.removeChild(J)}}function Yo(e,n,D,I){I==null&&(I=0);var B;!e.options.lineWrapping&&n==D&&(n=n.ch?bt(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,D=n.sticky=="before"?bt(n.line,n.ch+1,"before"):n);for(var J=0;J<5;J++){var se=!1,fe=Br(e,n),pe=!D||D==n?fe:Br(e,D);B={left:Math.min(fe.left,pe.left),top:Math.min(fe.top,pe.top)-I,right:Math.max(fe.left,pe.left),bottom:Math.max(fe.bottom,pe.bottom)+I};var xe=ro(e,B),We=e.doc.scrollTop,Ve=e.doc.scrollLeft;if(xe.scrollTop!=null&&(_a(e,xe.scrollTop),Math.abs(e.doc.scrollTop-We)>1&&(se=!0)),xe.scrollLeft!=null&&(Gi(e,xe.scrollLeft),Math.abs(e.doc.scrollLeft-Ve)>1&&(se=!0)),!se)break}return B}function Co(e,n){var D=ro(e,n);D.scrollTop!=null&&_a(e,D.scrollTop),D.scrollLeft!=null&&Gi(e,D.scrollLeft)}function ro(e,n){var D=e.display,I=Wn(e.display);n.top<0&&(n.top=0);var B=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:D.scroller.scrollTop,J=_e(e),se={};n.bottom-n.top>J&&(n.bottom=n.top+J);var fe=e.doc.height+Pe(D),pe=n.top<I,xe=n.bottom>fe-I;if(n.top<B)se.scrollTop=pe?0:n.top;else if(n.bottom>B+J){var We=Math.min(n.top,(xe?fe:n.bottom)-J);We!=B&&(se.scrollTop=We)}var Ve=e.options.fixedGutter?0:D.gutters.offsetWidth,ut=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:D.scroller.scrollLeft-Ve,it=Ue(e)-D.gutters.offsetWidth,gt=n.right-n.left>it;return gt&&(n.right=n.left+it),n.left<10?se.scrollLeft=0:n.left<ut?se.scrollLeft=Math.max(0,n.left+Ve-(gt?0:10)):n.right>it+ut-3&&(se.scrollLeft=n.right+(gt?0:10)-it),se}function no(e,n){if(n==null)return;Na(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n}function ya(e){Na(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ba(e,n,D){(n!=null||D!=null)&&Na(e),n!=null&&(e.curOp.scrollLeft=n),D!=null&&(e.curOp.scrollTop=D)}function $o(e,n){Na(e),e.curOp.scrollToPos=n}function Na(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var D=ur(e,n.from),I=ur(e,n.to);Oa(e,D,I,n.margin)}}function Oa(e,n,D,I){var B=ro(e,{left:Math.min(n.left,D.left),top:Math.min(n.top,D.top)-I,right:Math.max(n.right,D.right),bottom:Math.max(n.bottom,D.bottom)+I});ba(e,B.scrollLeft,B.scrollTop)}function _a(e,n){if(Math.abs(e.doc.scrollTop-n)<2)return;C||Ia(e,{top:n}),Ea(e,n,!0),C&&Ia(e),Ra(e,100)}function Ea(e,n,D){if(n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),e.display.scroller.scrollTop==n&&!D)return;e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n)}function Gi(e,n,D,I){if(n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(D?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!I)return;e.doc.scrollLeft=n,Gr(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n)}function ca(e){var n=e.display,D=n.gutters.offsetWidth,I=Math.round(e.doc.height+Pe(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?D:0,docHeight:I,scrollHeight:I+Je(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:D}}var aa=function(e,n,D){this.cm=D;var I=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),B=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");I.tabIndex=B.tabIndex=-1,e(I),e(B),Ie(I,"scroll",function(){I.clientHeight&&n(I.scrollTop,"vertical")}),Ie(B,"scroll",function(){B.clientWidth&&n(B.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,S&&b<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};aa.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,D=e.scrollHeight>e.clientHeight+1,I=e.nativeBarWidth;if(D){this.vert.style.display="block",this.vert.style.bottom=n?I+"px":"0";var B=e.viewHeight-(n?I:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+B)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=D?I+"px":"0",this.horiz.style.left=e.barLeft+"px";var J=e.viewWidth-e.barLeft-(D?I:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+J)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(I==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:D?I:0,bottom:n?I:0}},aa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},aa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},aa.prototype.zeroWidthHack=function(){var e=u&&!i?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},aa.prototype.enableZeroWidthBar=function(e,n,D){e.style.pointerEvents="auto";function I(){var B=e.getBoundingClientRect(),J=D=="vert"?document.elementFromPoint(B.right-1,(B.top+B.bottom)/2):document.elementFromPoint((B.right+B.left)/2,B.bottom-1);J!=e?e.style.pointerEvents="none":n.set(1e3,I)}n.set(1e3,I)},aa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Aa=function(){};Aa.prototype.update=function(){return{bottom:0,right:0}},Aa.prototype.setScrollLeft=function(){},Aa.prototype.setScrollTop=function(){},Aa.prototype.clear=function(){};function da(e,n){n||(n=ca(e));var D=e.display.barWidth,I=e.display.barHeight;ja(e,n);for(var B=0;B<4&&D!=e.display.barWidth||I!=e.display.barHeight;B++)D!=e.display.barWidth&&e.options.lineWrapping&&Ma(e),ja(e,ca(e)),D=e.display.barWidth,I=e.display.barHeight}function ja(e,n){var D=e.display,I=D.scrollbars.update(n);D.sizer.style.paddingRight=(D.barWidth=I.right)+"px",D.sizer.style.paddingBottom=(D.barHeight=I.bottom)+"px",D.heightForcer.style.borderBottom=I.bottom+"px solid transparent",I.right&&I.bottom?(D.scrollbarFiller.style.display="block",D.scrollbarFiller.style.height=I.bottom+"px",D.scrollbarFiller.style.width=I.right+"px"):D.scrollbarFiller.style.display="",I.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(D.gutterFiller.style.display="block",D.gutterFiller.style.height=I.bottom+"px",D.gutterFiller.style.width=n.gutterWidth+"px"):D.gutterFiller.style.display=""}var io={native:aa,null:Aa};function Fa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&g(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new io[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),Ie(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,D){D=="horizontal"?Gi(e,n):_a(e,n)},e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var ao=0;function oa(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:++ao},gi(e.curOp)}function ha(e){var n=e.curOp;n&&Xr(n,function(D){for(var I=0;I<D.ops.length;I++)D.ops[I].cm.curOp=null;Oo(D)})}function Oo(e){for(var n=e.ops,D=0;D<n.length;D++)Jo(n[D]);for(var I=0;I<n.length;I++)Qo(n[I]);for(var B=0;B<n.length;B++)Zo(n[B]);for(var J=0;J<n.length;J++)oo(n[J]);for(var se=0;se<n.length;se++)qo(n[se])}function Jo(e){var n=e.cm,D=n.display;Ao(n),e.updateMaxLine&&Hi(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<D.viewFrom||e.scrollToPos.to.line>=D.viewTo)||D.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new Ki(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qo(e){e.updatedDisplay=e.mustUpdate&&fa(e.cm,e.update)}function Zo(e){var n=e.cm,D=n.display;e.updatedDisplay&&Ma(n),e.barMeasure=ca(n),D.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Ge(n,D.maxLine,D.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(D.scroller.clientWidth,D.sizer.offsetLeft+e.adjustWidthTo+Je(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,D.sizer.offsetLeft+e.adjustWidthTo-Ue(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=D.input.prepareSelection())}function oo(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Gi(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var D=e.focus&&e.focus==V();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,D),(e.updatedDisplay||e.startHeight!=n.doc.height)&&da(n,e.barMeasure),e.updatedDisplay&&cn(n,e.barMeasure),e.selectionChanged&&ii(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),D&&So(e.cm)}function qo(e){var n=e.cm,D=n.display,I=n.doc;if(e.updatedDisplay&&Ua(n,e.update),D.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(D.wheelStartX=D.wheelStartY=null),e.scrollTop!=null&&Ea(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Gi(n,e.scrollLeft,!0,!0),e.scrollToPos){var B=Yo(n,K(I,e.scrollToPos.from),K(I,e.scrollToPos.to),e.scrollToPos.margin);Xo(n,B)}var J=e.maybeHiddenMarkers,se=e.maybeUnhiddenMarkers;if(J)for(var fe=0;fe<J.length;++fe)J[fe].lines.length||ze(J[fe],"hide");if(se)for(var pe=0;pe<se.length;++pe)se[pe].lines.length&&ze(se[pe],"unhide");D.wrapper.offsetHeight&&(I.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&ze(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function Oi(e,n){if(e.curOp)return n();oa(e);try{return n()}finally{ha(e)}}function Kn(e,n){return function(){if(e.curOp)return n.apply(e,arguments);oa(e);try{return n.apply(e,arguments)}finally{ha(e)}}}function vi(e){return function(){if(this.curOp)return e.apply(this,arguments);oa(this);try{return e.apply(this,arguments)}finally{ha(this)}}}function Vn(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);oa(n);try{return e.apply(this,arguments)}finally{ha(n)}}}function Ra(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,U(es,e))}function es(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var D=+new Date+e.options.workTime,I=Ot(e,n.highlightFrontier),B=[];n.iter(I.line,Math.min(n.first+n.size,e.display.viewTo+500),function(J){if(I.line>=e.display.viewFrom){var se=J.styles,fe=J.text.length>e.options.maxHighlightLength?hr(n.mode,I.state):null,pe=Ke(e,J,I,!0);fe&&(I.state=fe),J.styles=pe.styles;var xe=J.styleClasses,We=pe.classes;We?J.styleClasses=We:xe&&(J.styleClasses=null);for(var Ve=!se||se.length!=J.styles.length||xe!=We&&(!xe||!We||xe.bgClass!=We.bgClass||xe.textClass!=We.textClass),ut=0;!Ve&&ut<se.length;++ut)Ve=se[ut]!=J.styles[ut];Ve&&B.push(I.line),J.stateAfter=I.save(),I.nextLine()}else J.text.length<=e.options.maxHighlightLength&&Ht(e,J.text,I),J.stateAfter=I.line%5==0?I.save():null,I.nextLine();if(+new Date>D)return Ra(e,e.options.workDelay),!0}),n.highlightFrontier=I.line,n.modeFrontier=Math.max(n.modeFrontier,I.line),B.length&&Oi(e,function(){for(var J=0;J<B.length;J++)Mn(e,B[J],"text")})}var Ki=function(e,n,D){var I=e.display;this.viewport=n,this.visible=Pa(I,e.doc,n),this.editorIsHidden=!I.wrapper.offsetWidth,this.wrapperHeight=I.wrapper.clientHeight,this.wrapperWidth=I.wrapper.clientWidth,this.oldDisplayWidth=Ue(e),this.force=D,this.dims=kn(e),this.events=[]};Ki.prototype.signal=function(e,n){Ae(e,n)&&this.events.push(arguments)},Ki.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ze.apply(null,this.events[e])};function Ao(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=Je(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=Je(e)+"px",n.scrollbarsClipped=!0)}function Ro(e){if(e.hasFocus())return null;var n=V();if(!n||!A(e.display.lineDiv,n))return null;var D={activeElt:n};if(window.getSelection){var I=window.getSelection();I.anchorNode&&I.extend&&A(e.display.lineDiv,I.anchorNode)&&(D.anchorNode=I.anchorNode,D.anchorOffset=I.anchorOffset,D.focusNode=I.focusNode,D.focusOffset=I.focusOffset)}return D}function Io(e){if(!e||!e.activeElt||e.activeElt==V())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode)){var n=window.getSelection(),D=document.createRange();D.setEnd(e.anchorNode,e.anchorOffset),D.collapse(!1),n.removeAllRanges(),n.addRange(D),n.extend(e.focusNode,e.focusOffset)}}function fa(e,n){var D=e.display,I=e.doc;if(n.editorIsHidden)return Dn(e),!1;if(!n.force&&n.visible.from>=D.viewFrom&&n.visible.to<=D.viewTo&&(D.updateLineNumbers==null||D.updateLineNumbers>=D.viewTo)&&D.renderedView==D.view&&ra(e)==0)return!1;ai(e)&&(Dn(e),n.dims=kn(e));var B=I.first+I.size,J=Math.max(n.visible.from-e.options.viewportMargin,I.first),se=Math.min(B,n.visible.to+e.options.viewportMargin);D.viewFrom<J&&J-D.viewFrom<20&&(J=Math.max(I.first,D.viewFrom)),D.viewTo>se&&D.viewTo-se<20&&(se=Math.min(B,D.viewTo)),zt&&(J=bi(e.doc,J),se=ei(e.doc,se));var fe=J!=D.viewFrom||se!=D.viewTo||D.lastWrapHeight!=n.wrapperHeight||D.lastWrapWidth!=n.wrapperWidth;ta(e,J,se),D.viewOffset=ci(wt(e.doc,D.viewFrom)),e.display.mover.style.top=D.viewOffset+"px";var pe=ra(e);if(!fe&&pe==0&&!n.force&&D.renderedView==D.view&&(D.updateLineNumbers==null||D.updateLineNumbers>=D.viewTo))return!1;var xe=Ro(e);return pe>4&&(D.lineDiv.style.display="none"),Do(e,D.updateLineNumbers,n.dims),pe>4&&(D.lineDiv.style.display=""),D.renderedView=D.view,Io(xe),x(D.cursorDiv),x(D.selectionDiv),D.gutters.style.height=D.sizer.style.minHeight=0,fe&&(D.lastWrapHeight=n.wrapperHeight,D.lastWrapWidth=n.wrapperWidth,Ra(e,400)),D.updateLineNumbers=null,!0}function Ua(e,n){for(var D=n.viewport,I=!0;;I=!1){if(!I||!e.options.lineWrapping||n.oldDisplayWidth==Ue(e)){if(D&&D.top!=null&&(D={top:Math.min(e.doc.height+Pe(e.display)-_e(e),D.top)}),n.visible=Pa(e.display,e.doc,D),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else I&&(n.visible=Pa(e.display,e.doc,D));if(!fa(e,n))break;Ma(e);var B=ca(e);mn(e),da(e,B),cn(e,B),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ia(e,n){var D=new Ki(e,n);if(fa(e,D)){Ma(e),Ua(e,D);var I=ca(e);mn(e),da(e,I),cn(e,I),D.finish()}}function Do(e,n,D){var I=e.display,B=e.options.lineNumbers,J=I.lineDiv,se=J.firstChild;function fe(gt){var xt=gt.nextSibling;return p&&u&&e.display.currentWheelTarget==gt?gt.style.display="none":gt.parentNode.removeChild(gt),xt}for(var pe=I.view,xe=I.viewFrom,We=0;We<pe.length;We++){var Ve=pe[We];if(!Ve.hidden)if(!Ve.node||Ve.node.parentNode!=J){var ut=An(e,Ve,xe,D);J.insertBefore(ut,se)}else{for(;se!=Ve.node;)se=fe(se);var it=B&&n!=null&&n<=xe&&Ve.lineNumber;Ve.changes&&(re(Ve.changes,"gutter")>-1&&(it=!1),Xi(e,Ve,xe,D)),it&&(x(Ve.lineNumber),Ve.lineNumber.appendChild(document.createTextNode(Nr(e.options,xe)))),se=Ve.node.nextSibling}xe+=Ve.size}for(;se;)se=fe(se)}function Ba(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px"}function cn(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+Je(e)+"px"}function Gr(e){var n=e.display,D=n.view;if(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))return;for(var I=xi(n)-n.scroller.scrollLeft+e.doc.scrollLeft,B=n.gutters.offsetWidth,J=I+"px",se=0;se<D.length;se++)if(!D[se].hidden){e.options.fixedGutter&&(D[se].gutter&&(D[se].gutter.style.left=J),D[se].gutterBackground&&(D[se].gutterBackground.style.left=J));var fe=D[se].alignable;if(fe)for(var pe=0;pe<fe.length;pe++)fe[pe].style.left=J}e.options.fixedGutter&&(n.gutters.style.left=I+B+"px")}function ai(e){if(!e.options.lineNumbers)return!1;var n=e.doc,D=Nr(e.options,n.first+n.size-1),I=e.display;if(D.length!=I.lineNumChars){var B=I.measure.appendChild(T("div",[T("div",D)],"CodeMirror-linenumber CodeMirror-gutter-elt")),J=B.firstChild.offsetWidth,se=B.offsetWidth-J;return I.lineGutter.style.width="",I.lineNumInnerWidth=Math.max(J,I.lineGutter.offsetWidth-se)+1,I.lineNumWidth=I.lineNumInnerWidth+se,I.lineNumChars=I.lineNumInnerWidth?D.length:-1,I.lineGutter.style.width=I.lineNumWidth+"px",Ba(e.display),!0}return!1}function Ai(e,n){for(var D=[],I=!1,B=0;B<e.length;B++){var J=e[B],se=null;if(typeof J!="string"&&(se=J.style,J=J.className),J=="CodeMirror-linenumbers")if(n)I=!0;else continue;D.push({className:J,style:se})}return n&&!I&&D.push({className:"CodeMirror-linenumbers",style:null}),D}function xa(e){var n=e.gutters,D=e.gutterSpecs;x(n),e.lineGutter=null;for(var I=0;I<D.length;++I){var B=D[I],J=B.className,se=B.style,fe=n.appendChild(T("div",null,"CodeMirror-gutter "+J));se&&(fe.style.cssText=se),J=="CodeMirror-linenumbers"&&(e.lineGutter=fe,fe.style.width=(e.lineNumWidth||1)+"px")}n.style.display=D.length?"":"none",Ba(e)}function Qi(e){xa(e.display),yn(e),Gr(e)}function Da(e,n,D,I){var B=this;this.input=D,B.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),B.scrollbarFiller.setAttribute("cm-not-content","true"),B.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),B.gutterFiller.setAttribute("cm-not-content","true"),B.lineDiv=M("div",null,"CodeMirror-code"),B.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),B.cursorDiv=T("div",null,"CodeMirror-cursors"),B.measure=T("div",null,"CodeMirror-measure"),B.lineMeasure=T("div",null,"CodeMirror-measure"),B.lineSpace=M("div",[B.measure,B.lineMeasure,B.selectionDiv,B.cursorDiv,B.lineDiv],null,"position: relative; outline: none");var J=M("div",[B.lineSpace],"CodeMirror-lines");B.mover=T("div",[J],null,"position: relative"),B.sizer=T("div",[B.mover],"CodeMirror-sizer"),B.sizerWidth=null,B.heightForcer=T("div",null,null,"position: absolute; height: "+te+"px; width: 1px;"),B.gutters=T("div",null,"CodeMirror-gutters"),B.lineGutter=null,B.scroller=T("div",[B.sizer,B.heightForcer,B.gutters],"CodeMirror-scroll"),B.scroller.setAttribute("tabIndex","-1"),B.wrapper=T("div",[B.scrollbarFiller,B.gutterFiller,B.scroller],"CodeMirror"),S&&b<8&&(B.gutters.style.zIndex=-1,B.scroller.style.paddingRight=0),!p&&!(C&&a)&&(B.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(B.wrapper):e(B.wrapper)),B.viewFrom=B.viewTo=n.first,B.reportedViewFrom=B.reportedViewTo=n.first,B.view=[],B.renderedView=null,B.externalMeasured=null,B.viewOffset=0,B.lastWrapHeight=B.lastWrapWidth=0,B.updateLineNumbers=null,B.nativeBarWidth=B.barHeight=B.barWidth=0,B.scrollbarsClipped=!1,B.lineNumWidth=B.lineNumInnerWidth=B.lineNumChars=null,B.alignWidgets=!1,B.cachedCharWidth=B.cachedTextHeight=B.cachedPaddingH=null,B.maxLine=null,B.maxLineLength=0,B.maxLineChanged=!1,B.wheelDX=B.wheelDY=B.wheelStartX=B.wheelStartY=null,B.shift=!1,B.selForContextMenu=null,B.activeTouch=null,B.gutterSpecs=Ai(I.gutters,I.lineNumbers),xa(B),D.init(B)}var sa=0,oi=null;S?oi=-.53:C?oi=15:t?oi=-.7:r&&(oi=-1/3);function Ha(e){var n=e.wheelDeltaX,D=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),D==null&&e.detail&&e.axis==e.VERTICAL_AXIS?D=e.detail:D==null&&(D=e.wheelDelta),{x:n,y:D}}function so(e){var n=Ha(e);return n.x*=oi,n.y*=oi,n}function lo(e,n){var D=Ha(n),I=D.x,B=D.y,J=e.display,se=J.scroller,fe=se.scrollWidth>se.clientWidth,pe=se.scrollHeight>se.clientHeight;if(!(I&&fe||B&&pe))return;if(B&&u&&p){e:for(var xe=n.target,We=J.view;xe!=se;xe=xe.parentNode)for(var Ve=0;Ve<We.length;Ve++)if(We[Ve].node==xe){e.display.currentWheelTarget=xe;break e}}if(I&&!C&&!l&&oi!=null){B&&pe&&_a(e,Math.max(0,se.scrollTop+B*oi)),Gi(e,Math.max(0,se.scrollLeft+I*oi)),(!B||B&&pe)&&Ee(n),J.wheelStartX=null;return}if(B&&oi!=null){var ut=B*oi,it=e.doc.scrollTop,gt=it+J.wrapper.clientHeight;ut<0?it=Math.max(0,it+ut-50):gt=Math.min(e.doc.height,gt+ut+50),Ia(e,{top:it,bottom:gt})}sa<20&&(J.wheelStartX==null?(J.wheelStartX=se.scrollLeft,J.wheelStartY=se.scrollTop,J.wheelDX=I,J.wheelDY=B,setTimeout(function(){if(J.wheelStartX==null)return;var xt=se.scrollLeft-J.wheelStartX,Rt=se.scrollTop-J.wheelStartY,Pt=Rt&&J.wheelDY&&Rt/J.wheelDY||xt&&J.wheelDX&&xt/J.wheelDX;if(J.wheelStartX=J.wheelStartY=null,!Pt)return;oi=(oi*sa+Pt)/(sa+1),++sa},200)):(J.wheelDX+=I,J.wheelDY+=B))}var Ri=function(e,n){this.ranges=e,this.primIndex=n};Ri.prototype.primary=function(){return this.ranges[this.primIndex]},Ri.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var D=this.ranges[n],I=e.ranges[n];if(!Jr(D.anchor,I.anchor)||!Jr(D.head,I.head))return!1}return!0},Ri.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new ln(on(this.ranges[n].anchor),on(this.ranges[n].head));return new Ri(e,this.primIndex)},Ri.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ri.prototype.contains=function(e,n){n||(n=e);for(var D=0;D<this.ranges.length;D++){var I=this.ranges[D];if(Bt(n,I.from())>=0&&Bt(e,I.to())<=0)return D}return-1};var ln=function(e,n){this.anchor=e,this.head=n};ln.prototype.from=function(){return Sn(this.anchor,this.head)},ln.prototype.to=function(){return Ln(this.anchor,this.head)},ln.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Vi(e,n,D){var I=e&&e.options.selectionsMayTouch,B=n[D];n.sort(function(ut,it){return Bt(ut.from(),it.from())}),D=re(n,B);for(var J=1;J<n.length;J++){var se=n[J],fe=n[J-1],pe=Bt(fe.to(),se.from());if(I&&!se.empty()?pe>0:pe>=0){var xe=Sn(fe.from(),se.from()),We=Ln(fe.to(),se.to()),Ve=fe.empty()?se.from()==se.head:fe.from()==fe.head;J<=D&&--D,n.splice(--J,2,new ln(Ve?We:xe,Ve?xe:We))}}return new Ri(n,D)}function Zi(e,n){return new Ri([new ln(e,n||e)],0)}function qi(e){return e.text?bt(e.from.line+e.text.length-1,ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function uo(e,n){if(Bt(e,n.from)<0)return e;if(Bt(e,n.to)<=0)return qi(n);var D=e.line+n.text.length-(n.to.line-n.from.line)-1,I=e.ch;return e.line==n.to.line&&(I+=qi(n).ch-n.to.ch),bt(D,I)}function Wa(e,n){for(var D=[],I=0;I<e.sel.ranges.length;I++){var B=e.sel.ranges[I];D.push(new ln(uo(B.anchor,n),uo(B.head,n)))}return Vi(e.cm,D,e.sel.primIndex)}function Lo(e,n,D){return e.line==n.line?bt(D.line,e.ch-n.ch+D.ch):bt(D.line+(e.line-n.line),e.ch)}function ko(e,n,D){for(var I=[],B=bt(e.first,0),J=B,se=0;se<n.length;se++){var fe=n[se],pe=Lo(fe.from,B,J),xe=Lo(qi(fe),B,J);if(B=fe.to,J=xe,D=="around"){var We=e.sel.ranges[se],Ve=Bt(We.head,We.anchor)<0;I[se]=new ln(Ve?xe:pe,Ve?pe:xe)}else I[se]=new ln(pe,pe)}return new Ri(I,e.sel.primIndex)}function pa(e){e.doc.mode=Et(e.options,e.doc.modeOption),co(e)}function co(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ra(e,100),e.state.modeGen++,e.curOp&&yn(e)}function gs(e,n){return n.from.ch==0&&n.to.ch==0&&ie(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,n,D,I){function B(Gt){return D?D[Gt]:null}function J(Gt,Nt,$t){qr(Gt,Nt,$t,I),Rr(Gt,"change",Gt,n)}function se(Gt,Nt){for(var $t=[],dr=Gt;dr<Nt;++dr)$t.push(new di(xe[dr],B(dr),I));return $t}var fe=n.from,pe=n.to,xe=n.text,We=wt(e,fe.line),Ve=wt(e,pe.line),ut=ie(xe),it=B(xe.length-1),gt=pe.line-fe.line;if(n.full)e.insert(0,se(0,xe.length)),e.remove(xe.length,e.size-xe.length);else if(gs(e,n)){var xt=se(0,xe.length-1);J(Ve,Ve.text,it),gt&&e.remove(fe.line,gt),xt.length&&e.insert(fe.line,xt)}else if(We==Ve)if(xe.length==1)J(We,We.text.slice(0,fe.ch)+ut+We.text.slice(pe.ch),it);else{var Rt=se(1,xe.length-1);Rt.push(new di(ut+We.text.slice(pe.ch),it,I)),J(We,We.text.slice(0,fe.ch)+xe[0],B(0)),e.insert(fe.line+1,Rt)}else if(xe.length==1)J(We,We.text.slice(0,fe.ch)+xe[0]+Ve.text.slice(pe.ch),B(0)),e.remove(fe.line+1,gt);else{J(We,We.text.slice(0,fe.ch)+xe[0],B(0)),J(Ve,ut+Ve.text.slice(pe.ch),it);var Pt=se(1,xe.length-1);gt>1&&e.remove(fe.line+1,gt-1),e.insert(fe.line+1,Pt)}Rr(e,"change",e,n)}function wa(e,n,D){function I(B,J,se){if(B.linked)for(var fe=0;fe<B.linked.length;++fe){var pe=B.linked[fe];if(pe.doc==J)continue;var xe=se&&pe.sharedHist;if(D&&!xe)continue;n(pe.doc,xe),I(pe.doc,B,xe)}}I(e,null,!0)}function vs(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,Ci(e),pa(e),ys(e),e.options.lineWrapping||Hi(e),e.options.mode=n.modeOption,yn(e)}function ys(e){(e.doc.direction=="rtl"?z:g)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){Oi(e,function(){ys(e),yn(e)})}function Mo(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 rs(e,n){var D={from:on(n.from),to:qi(n),text:wr(e,n.from,n.to)};return Es(e,D,n.from.line,n.to.line+1),wa(e,function(I){return Es(I,D,n.from.line,n.to.line+1)},!0),D}function bs(e){for(;e.length;){var n=ie(e);if(n.ranges)e.pop();else break}}function ml(e,n){if(n)return bs(e.done),ie(e.done);if(e.done.length&&!ie(e.done).ranges)return ie(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ie(e.done)}function _s(e,n,D,I){var B=e.history;B.undone.length=0;var J=+new Date,se,fe;if((B.lastOp==I||B.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&B.lastModTime>J-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(se=ml(B,B.lastOp==I)))fe=ie(se.changes),Bt(n.from,n.to)==0&&Bt(n.from,fe.to)==0?fe.to=qi(n):se.changes.push(rs(e,n));else{var pe=ie(B.done);for((!pe||!pe.ranges)&&Po(e.sel,B.done),se={changes:[rs(e,n)],generation:B.generation},B.done.push(se);B.done.length>B.undoDepth;)B.done.shift(),B.done[0].ranges||B.done.shift()}B.done.push(D),B.generation=++B.maxGeneration,B.lastModTime=B.lastSelTime=J,B.lastOp=B.lastSelOp=I,B.lastOrigin=B.lastSelOrigin=n.origin,fe||ze(e,"historyAdded")}function gl(e,n,D,I){var B=n.charAt(0);return B=="*"||B=="+"&&D.ranges.length==I.ranges.length&&D.somethingSelected()==I.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,n,D,I){var B=e.history,J=I&&I.origin;D==B.lastSelOp||J&&B.lastSelOrigin==J&&(B.lastModTime==B.lastSelTime&&B.lastOrigin==J||gl(e,J,ie(B.done),n))?B.done[B.done.length-1]=n:Po(n,B.done),B.lastSelTime=+new Date,B.lastSelOrigin=J,B.lastSelOp=D,I&&I.clearRedo!==!1&&bs(B.undone)}function Po(e,n){var D=ie(n);D&&D.ranges&&D.equals(e)||n.push(e)}function Es(e,n,D,I){var B=n["spans_"+e.id],J=0;e.iter(Math.max(e.first,D),Math.min(e.first+e.size,I),function(se){se.markedSpans&&((B||(B=n["spans_"+e.id]={}))[J]=se.markedSpans),++J})}function yl(e){if(!e)return null;for(var n,D=0;D<e.length;++D)e[D].marker.explicitlyCleared?n||(n=e.slice(0,D)):n&&n.push(e[D]);return n?n.length?n:null:e}function bl(e,n){var D=n["spans_"+e.id];if(!D)return null;for(var I=[],B=0;B<n.text.length;++B)I.push(yl(D[B]));return I}function xs(e,n){var D=bl(e,n),I=qn(e,n);if(!D)return I;if(!I)return D;for(var B=0;B<D.length;++B){var J=D[B],se=I[B];if(J&&se){e:for(var fe=0;fe<se.length;++fe){for(var pe=se[fe],xe=0;xe<J.length;++xe)if(J[xe].marker==pe.marker)continue e;J.push(pe)}}else se&&(D[B]=se)}return D}function za(e,n,D){for(var I=[],B=0;B<e.length;++B){var J=e[B];if(J.ranges){I.push(D?Ri.prototype.deepCopy.call(J):J);continue}var se=J.changes,fe=[];I.push({changes:fe});for(var pe=0;pe<se.length;++pe){var xe=se[pe],We=void 0;if(fe.push({from:xe.from,to:xe.to,text:xe.text}),n)for(var Ve in xe)(We=Ve.match(/^spans_(\d+)$/))&&(re(n,Number(We[1]))>-1&&(ie(fe)[Ve]=xe[Ve],delete xe[Ve]))}}return I}function ns(e,n,D,I){if(I){var B=e.anchor;if(D){var J=Bt(n,B)<0;J!=Bt(D,B)<0?(B=n,n=D):J!=Bt(n,D)<0&&(n=D)}return new ln(B,n)}else return new ln(D||n,n)}function No(e,n,D,I,B){B==null&&(B=e.cm&&(e.cm.display.shift||e.extend)),wi(e,new Ri([ns(e.sel.primary(),n,D,B)],0),I)}function ws(e,n,D){for(var I=[],B=e.cm&&(e.cm.display.shift||e.extend),J=0;J<e.sel.ranges.length;J++)I[J]=ns(e.sel.ranges[J],n[J],null,B);var se=Vi(e.cm,I,e.sel.primIndex);wi(e,se,D)}function is(e,n,D,I){var B=e.sel.ranges.slice(0);B[n]=D,wi(e,Vi(e.cm,B,e.sel.primIndex),I)}function Ts(e,n,D,I){wi(e,Zi(n,D),I)}function _l(e,n,D){var I={ranges:n.ranges,update:function(B){this.ranges=[];for(var J=0;J<B.length;J++)this.ranges[J]=new ln(K(e,B[J].anchor),K(e,B[J].head))},origin:D&&D.origin};return ze(e,"beforeSelectionChange",e,I),e.cm&&ze(e.cm,"beforeSelectionChange",e.cm,I),I.ranges!=n.ranges?Vi(e.cm,I.ranges,I.ranges.length-1):n}function Ss(e,n,D){var I=e.history.done,B=ie(I);B&&B.ranges?(I[I.length-1]=n,jo(e,n,D)):wi(e,n,D)}function wi(e,n,D){jo(e,n,D),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,D)}function jo(e,n,D){(Ae(e,"beforeSelectionChange")||e.cm&&Ae(e.cm,"beforeSelectionChange"))&&(n=_l(e,n,D));var I=D&&D.bias||(Bt(n.primary().head,e.sel.primary().head)<0?-1:1);Cs(e,As(e,n,I,!0)),!(D&&D.scroll===!1)&&e.cm&&ya(e.cm)}function Cs(e,n){if(n.equals(e.sel))return;e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ne(e.cm)),Rr(e,"cursorActivity",e)}function Os(e){Cs(e,As(e,e.sel,null,!1))}function As(e,n,D,I){for(var B,J=0;J<n.ranges.length;J++){var se=n.ranges[J],fe=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[J],pe=Fo(e,se.anchor,fe&&fe.anchor,D,I),xe=Fo(e,se.head,fe&&fe.head,D,I);(B||pe!=se.anchor||xe!=se.head)&&(B||(B=n.ranges.slice(0,J)),B[J]=new ln(pe,xe))}return B?Vi(e.cm,B,n.primIndex):n}function Ga(e,n,D,I,B){var J=wt(e,n.line);if(J.markedSpans)for(var se=0;se<J.markedSpans.length;++se){var fe=J.markedSpans[se],pe=fe.marker,xe="selectLeft"in pe?!pe.selectLeft:pe.inclusiveLeft,We="selectRight"in pe?!pe.selectRight:pe.inclusiveRight;if((fe.from==null||(xe?fe.from<=n.ch:fe.from<n.ch))&&(fe.to==null||(We?fe.to>=n.ch:fe.to>n.ch))){if(B&&(ze(pe,"beforeCursorEnter"),pe.explicitlyCleared))if(J.markedSpans){--se;continue}else break;if(!pe.atomic)continue;if(D){var Ve=pe.find(I<0?1:-1),ut=void 0;if((I<0?We:xe)&&(Ve=Rs(e,Ve,-I,Ve&&Ve.line==n.line?J:null)),Ve&&Ve.line==n.line&&(ut=Bt(Ve,D))&&(I<0?ut<0:ut>0))return Ga(e,Ve,n,I,B)}var it=pe.find(I<0?-1:1);return(I<0?xe:We)&&(it=Rs(e,it,I,it.line==n.line?J:null)),it?Ga(e,it,n,I,B):null}}return n}function Fo(e,n,D,I,B){var J=I||1,se=Ga(e,n,D,J,B)||!B&&Ga(e,n,D,J,!0)||Ga(e,n,D,-J,B)||!B&&Ga(e,n,D,-J,!0);return se||(e.cantEdit=!0,bt(e.first,0))}function Rs(e,n,D,I){return D<0&&n.ch==0?n.line>e.first?K(e,bt(n.line-1)):null:D>0&&n.ch==(I||wt(e,n.line)).text.length?n.line<e.first+e.size-1?bt(n.line+1,0):null:new bt(n.line,n.ch+D)}function Is(e){e.setSelection(bt(e.firstLine(),0),bt(e.lastLine()),ve)}function Ds(e,n,D){var I={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return I.canceled=!0}};return D&&(I.update=function(B,J,se,fe){B&&(I.from=K(e,B)),J&&(I.to=K(e,J)),se&&(I.text=se),fe!==void 0&&(I.origin=fe)}),ze(e,"beforeChange",e,I),e.cm&&ze(e.cm,"beforeChange",e.cm,I),I.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:I.from,to:I.to,text:I.text,origin:I.origin}}function Ka(e,n,D){if(e.cm){if(!e.cm.curOp)return Kn(e.cm,Ka)(e,n,D);if(e.cm.state.suppressEdits)return}if((Ae(e,"beforeChange")||e.cm&&Ae(e.cm,"beforeChange"))&&(n=Ds(e,n,!0),!n))return;var I=Cn&&!D&&Si(e,n.from,n.to);if(I)for(var B=I.length-1;B>=0;--B)Ls(e,{from:I[B].from,to:I[B].to,text:B?[""]:n.text,origin:n.origin});else Ls(e,n)}function Ls(e,n){if(n.text.length==1&&n.text[0]==""&&Bt(n.from,n.to)==0)return;var D=Wa(e,n);_s(e,n,D,e.cm?e.cm.curOp.id:NaN),ho(e,n,D,qn(e,n));var I=[];wa(e,function(B,J){!J&&re(I,B.history)==-1&&(Ns(B.history,n),I.push(B.history)),ho(B,n,null,qn(B,n))})}function Uo(e,n,D){var I=e.cm&&e.cm.state.suppressEdits;if(I&&!D)return;for(var B=e.history,J,se=e.sel,fe=n=="undo"?B.done:B.undone,pe=n=="undo"?B.undone:B.done,xe=0;xe<fe.length&&!(J=fe[xe],D?J.ranges&&!J.equals(e.sel):!J.ranges);xe++);if(xe==fe.length)return;for(B.lastOrigin=B.lastSelOrigin=null;;)if(J=fe.pop(),J.ranges){if(Po(J,pe),D&&!J.equals(e.sel)){wi(e,J,{clearRedo:!1});return}se=J}else if(I){fe.push(J);return}else break;var We=[];Po(se,pe),pe.push({changes:We,generation:B.generation}),B.generation=J.generation||++B.maxGeneration;for(var Ve=Ae(e,"beforeChange")||e.cm&&Ae(e.cm,"beforeChange"),ut=function(xt){var Rt=J.changes[xt];if(Rt.origin=n,Ve&&!Ds(e,Rt,!1))return fe.length=0,{};We.push(rs(e,Rt));var Pt=xt?Wa(e,Rt):ie(fe);ho(e,Rt,Pt,xs(e,Rt)),!xt&&e.cm&&e.cm.scrollIntoView({from:Rt.from,to:qi(Rt)});var Gt=[];wa(e,function(Nt,$t){!$t&&re(Gt,Nt.history)==-1&&(Ns(Nt.history,Rt),Gt.push(Nt.history)),ho(Nt,Rt,null,xs(Nt,Rt))})},it=J.changes.length-1;it>=0;--it){var gt=ut(it);if(gt)return gt.v}}function ks(e,n){if(n==0)return;if(e.first+=n,e.sel=new Ri(Se(e.sel.ranges,function(B){return new ln(bt(B.anchor.line+n,B.anchor.ch),bt(B.head.line+n,B.head.ch))}),e.sel.primIndex),e.cm){yn(e.cm,e.first,e.first-n,n);for(var D=e.cm.display,I=D.viewFrom;I<D.viewTo;I++)Mn(e.cm,I,"gutter")}}function ho(e,n,D,I){if(e.cm&&!e.cm.curOp)return Kn(e.cm,ho)(e,n,D,I);if(n.to.line<e.first){ks(e,n.text.length-1-(n.to.line-n.from.line));return}if(n.from.line>e.lastLine())return;if(n.from.line<e.first){var B=n.text.length-1-(e.first-n.from.line);ks(e,B),n={from:bt(e.first,0),to:bt(n.to.line+B,n.to.ch),text:[ie(n.text)],origin:n.origin}}var J=e.lastLine();n.to.line>J&&(n={from:n.from,to:bt(J,wt(e,J).text.length),text:[n.text[0]],origin:n.origin}),n.removed=wr(e,n.from,n.to),D||(D=Wa(e,n)),e.cm?El(e.cm,n,I):ts(e,n,I),jo(e,D,ve),e.cantEdit&&Fo(e,bt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,n,D){var I=e.doc,B=e.display,J=n.from,se=n.to,fe=!1,pe=J.line;e.options.lineWrapping||(pe=Ut(Un(wt(I,J.line))),I.iter(pe,se.line+1,function(it){if(it==B.maxLine)return fe=!0,!0})),I.sel.contains(n.from,n.to)>-1&&Ne(e),ts(I,n,D,Wi(e)),e.options.lineWrapping||(I.iter(pe,J.line+n.text.length,function(it){var gt=_i(it);gt>B.maxLineLength&&(B.maxLine=it,B.maxLineLength=gt,B.maxLineChanged=!0,fe=!1)}),fe&&(e.curOp.updateMaxLine=!0)),Qr(I,J.line),Ra(e,400);var xe=n.text.length-(se.line-J.line)-1;n.full?yn(e):J.line==se.line&&n.text.length==1&&!gs(e.doc,n)?Mn(e,J.line,"text"):yn(e,J.line,se.line+1,xe);var We=Ae(e,"changes"),Ve=Ae(e,"change");if(Ve||We){var ut={from:J,to:se,text:n.text,removed:n.removed,origin:n.origin};Ve&&Rr(e,"change",e,ut),We&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ut)}e.display.selForContextMenu=null}function Va(e,n,D,I,B){var J;I||(I=D),Bt(I,D)<0&&(J=[I,D],D=J[0],I=J[1]),typeof n=="string"&&(n=e.splitLines(n)),Ka(e,{from:D,to:I,text:n,origin:B})}function Ms(e,n,D,I){D<e.line?e.line+=I:n<e.line&&(e.line=n,e.ch=0)}function Ps(e,n,D,I){for(var B=0;B<e.length;++B){var J=e[B],se=!0;if(J.ranges){J.copied||(J=e[B]=J.deepCopy(),J.copied=!0);for(var fe=0;fe<J.ranges.length;fe++)Ms(J.ranges[fe].anchor,n,D,I),Ms(J.ranges[fe].head,n,D,I);continue}for(var pe=0;pe<J.changes.length;++pe){var xe=J.changes[pe];if(D<xe.from.line)xe.from=bt(xe.from.line+I,xe.from.ch),xe.to=bt(xe.to.line+I,xe.to.ch);else if(n<=xe.to.line){se=!1;break}}se||(e.splice(0,B+1),B=0)}}function Ns(e,n){var D=n.from.line,I=n.to.line,B=n.text.length-(I-D)-1;Ps(e.done,D,I,B),Ps(e.undone,D,I,B)}function fo(e,n,D,I){var B=n,J=n;return typeof n=="number"?J=wt(e,le(e,n)):B=Ut(n),B==null?null:(I(J,B)&&e.cm&&Mn(e.cm,B,D),J)}function po(e){this.lines=e,this.parent=null;for(var n=0,D=0;D<e.length;++D)e[D].parent=this,n+=e[D].height;this.height=n}po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var D=e,I=e+n;D<I;++D){var B=this.lines[D];this.height-=B.height,Yt(B),Rr(B,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,D){this.height+=D,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var I=0;I<n.length;++I)n[I].parent=this},iterN:function(e,n,D){for(var I=e+n;e<I;++e)if(D(this.lines[e]))return!0}};function mo(e){this.children=e;for(var n=0,D=0,I=0;I<e.length;++I){var B=e[I];n+=B.chunkSize(),D+=B.height,B.parent=this}this.size=n,this.height=D,this.parent=null}mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var D=0;D<this.children.length;++D){var I=this.children[D],B=I.chunkSize();if(e<B){var J=Math.min(n,B-e),se=I.height;if(I.removeInner(e,J),this.height-=se-I.height,B==J&&(this.children.splice(D--,1),I.parent=null),(n-=J)==0)break;e=0}else e-=B}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof po))){var fe=[];this.collapse(fe),this.children=[new po(fe)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,D){this.size+=n.length,this.height+=D;for(var I=0;I<this.children.length;++I){var B=this.children[I],J=B.chunkSize();if(e<=J){if(B.insertInner(e,n,D),B.lines&&B.lines.length>50){for(var se=B.lines.length%25+25,fe=se;fe<B.lines.length;){var pe=new po(B.lines.slice(fe,fe+=25));B.height-=pe.height,this.children.splice(++I,0,pe),pe.parent=this}B.lines=B.lines.slice(0,se),this.maybeSpill()}break}e-=J}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var n=e.children.splice(e.children.length-5,5),D=new mo(n);if(e.parent){e.size-=D.size,e.height-=D.height;var B=re(e.parent.children,e);e.parent.children.splice(B+1,0,D)}else{var I=new mo(e.children);I.parent=e,e.children=[I,D],e=I}D.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,n,D){for(var I=0;I<this.children.length;++I){var B=this.children[I],J=B.chunkSize();if(e<J){var se=Math.min(n,J-e);if(B.iterN(e,se,D))return!0;if((n-=se)==0)break;e=0}else e-=J}}};var go=function(e,n,D){if(D)for(var I in D)D.hasOwnProperty(I)&&(this[I]=D[I]);this.doc=e,this.node=n};go.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,D=this.line,I=Ut(D);if(I==null||!n)return;for(var B=0;B<n.length;++B)n[B]==this&&n.splice(B--,1);n.length||(D.widgets=null);var J=Gn(this);Jt(D,Math.max(0,D.height-J)),e&&(Oi(e,function(){js(e,D,-J),Mn(e,I,"widget")}),Rr(e,"lineWidgetCleared",e,this,I))},go.prototype.changed=function(){var e=this,n=this.height,D=this.doc.cm,I=this.line;this.height=null;var B=Gn(this)-n;if(!B)return;ti(this.doc,I)||Jt(I,I.height+B),D&&Oi(D,function(){D.curOp.forceUpdate=!0,js(D,I,B),Rr(D,"lineWidgetChanged",D,e,Ut(I))})},Me(go);function js(e,n,D){ci(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&no(e,D)}function xl(e,n,D,I){var B=new go(e,D,I),J=e.cm;return J&&B.noHScroll&&(J.display.alignWidgets=!0),fo(e,n,"widget",function(se){var fe=se.widgets||(se.widgets=[]);if(B.insertAt==null?fe.push(B):fe.splice(Math.min(fe.length-1,Math.max(0,B.insertAt)),0,B),B.line=se,J&&!ti(e,se)){var pe=ci(se)<e.scrollTop;Jt(se,se.height+Gn(B)),pe&&no(J,B.height),J.curOp.forceUpdate=!0}return!0}),J&&Rr(J,"lineWidgetAdded",J,B,typeof n=="number"?n:Ut(n)),B}var Fs=0,Ta=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++Fs};Ta.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,n=e&&!e.curOp;if(n&&oa(e),Ae(this,"clear")){var D=this.find();D&&Rr(this,"clear",D.from,D.to)}for(var I=null,B=null,J=0;J<this.lines.length;++J){var se=this.lines[J],fe=Er(se.markedSpans,this);e&&!this.collapsed?Mn(e,Ut(se),"text"):e&&(fe.to!=null&&(B=Ut(se)),fe.from!=null&&(I=Ut(se))),se.markedSpans=li(se.markedSpans,fe),fe.from==null&&this.collapsed&&!ti(this.doc,se)&&e&&Jt(se,Wn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var pe=0;pe<this.lines.length;++pe){var xe=Un(this.lines[pe]),We=_i(xe);We>e.display.maxLineLength&&(e.display.maxLine=xe,e.display.maxLineLength=We,e.display.maxLineChanged=!0)}I!=null&&e&&this.collapsed&&yn(e,I,B+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Rr(e,"markerCleared",e,this,I,B),n&&ha(e),this.parent&&this.parent.clear()},Ta.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var D,I,B=0;B<this.lines.length;++B){var J=this.lines[B],se=Er(J.markedSpans,this);if(se.from!=null&&(D=bt(n?J:Ut(J),se.from),e==-1))return D;if(se.to!=null&&(I=bt(n?J:Ut(J),se.to),e==1))return I}return D&&{from:D,to:I}},Ta.prototype.changed=function(){var e=this,n=this.find(-1,!0),D=this,I=this.doc.cm;if(!n||!I)return;Oi(I,function(){var B=n.line,J=Ut(n.line),se=$e(I,J);if(se&&(yr(se),I.curOp.selectionChanged=I.curOp.forceUpdate=!0),I.curOp.updateMaxLine=!0,!ti(D.doc,B)&&D.height!=null){var fe=D.height;D.height=null;var pe=Gn(D)-fe;pe&&Jt(B,B.height+pe)}Rr(I,"markerChanged",I,e)})},Ta.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||re(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ta.prototype.detachLine=function(e){if(this.lines.splice(re(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Me(Ta);function Xa(e,n,D,I,B){if(I&&I.shared)return wl(e,n,D,I,B);if(e.cm&&!e.cm.curOp)return Kn(e.cm,Xa)(e,n,D,I,B);var J=new Ta(e,B),se=Bt(n,D);if(I&&P(I,J,!1),se>0||se==0&&J.clearWhenEmpty!==!1)return J;if(J.replacedWith&&(J.collapsed=!0,J.widgetNode=M("span",[J.replacedWith],"CodeMirror-widget"),I.handleMouseEvents||J.widgetNode.setAttribute("cm-ignore-events","true"),I.insertLeft&&(J.widgetNode.insertLeft=!0)),J.collapsed){if(_n(e,n.line,n,D,J)||n.line!=D.line&&_n(e,D.line,n,D,J))throw new Error("Inserting collapsed marker partially overlapping an existing one");fr()}J.addToHistory&&_s(e,{from:n,to:D,origin:"markText"},e.sel,NaN);var fe=n.line,pe=e.cm,xe;if(e.iter(fe,D.line+1,function(Ve){pe&&J.collapsed&&!pe.options.lineWrapping&&Un(Ve)==pe.display.maxLine&&(xe=!0),J.collapsed&&fe!=n.line&&Jt(Ve,0),On(Ve,new jr(J,fe==n.line?n.ch:null,fe==D.line?D.ch:null)),++fe}),J.collapsed&&e.iter(n.line,D.line+1,function(Ve){ti(e,Ve)&&Jt(Ve,0)}),J.clearOnEnter&&Ie(J,"beforeCursorEnter",function(){return J.clear()}),J.readOnly&&(pr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),J.collapsed&&(J.id=++Fs,J.atomic=!0),pe){if(xe&&(pe.curOp.updateMaxLine=!0),J.collapsed)yn(pe,n.line,D.line+1);else if(J.className||J.startStyle||J.endStyle||J.css||J.attributes||J.title)for(var We=n.line;We<=D.line;We++)Mn(pe,We,"text");J.atomic&&Os(pe.doc),Rr(pe,"markerAdded",pe,J)}return J}var vo=function(e,n){this.markers=e,this.primary=n;for(var D=0;D<e.length;++D)e[D].parent=this};vo.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Rr(this,"clear")},vo.prototype.find=function(e,n){return this.primary.find(e,n)},Me(vo);function wl(e,n,D,I,B){I=P(I),I.shared=!1;var J=[Xa(e,n,D,I,B)],se=J[0],fe=I.widgetNode;return wa(e,function(pe){fe&&(I.widgetNode=fe.cloneNode(!0)),J.push(Xa(pe,K(pe,n),K(pe,D),I,B));for(var xe=0;xe<pe.linked.length;++xe)if(pe.linked[xe].isParent)return;se=ie(J)}),new vo(J,se)}function Us(e){return e.findMarks(bt(e.first,0),e.clipPos(bt(e.lastLine())),function(n){return n.parent})}function Tl(e,n){for(var D=0;D<n.length;D++){var I=n[D],B=I.find(),J=e.clipPos(B.from),se=e.clipPos(B.to);if(Bt(J,se)){var fe=Xa(e,J,se,I.primary,I.primary.type);I.markers.push(fe),fe.parent=I}}}function Sl(e){for(var n=function(I){var B=e[I],J=[B.primary.doc];wa(B.primary.doc,function(pe){return J.push(pe)});for(var se=0;se<B.markers.length;se++){var fe=B.markers[se];re(J,fe.doc)==-1&&(fe.parent=null,B.markers.splice(se--,1))}},D=0;D<e.length;D++)n(D)}var Cl=0,ki=function(e,n,D,I,B){if(!(this instanceof ki))return new ki(e,n,D,I,B);D==null&&(D=0),mo.call(this,[new po([new di("",null)])]),this.first=D,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=D;var J=bt(D,0);this.sel=Zi(J),this.history=new Mo(null),this.id=++Cl,this.modeOption=n,this.lineSep=I,this.direction=B=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:J,to:J,text:e}),wi(this,Zi(J),ve)};ki.prototype=Oe(mo.prototype,{constructor:ki,iter:function(e,n,D){D?this.iterN(e-this.first,n-e,D):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var D=0,I=0;I<n.length;++I)D+=n[I].height;this.insertInner(e-this.first,n,D)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=Cr(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Vn(function(e){var n=bt(this.first,0),D=this.first+this.size-1;Ka(this,{from:n,to:bt(D,wt(this,D).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ba(this.cm,0,0),wi(this,Zi(n),ve)}),replaceRange:function(e,n,D,I){n=K(this,n),D=D?K(this,D):n,Va(this,e,n,D,I)},getRange:function(e,n,D){var I=wr(this,K(this,e),K(this,n));return D===!1?I:I.join(D||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(un(this,e))return wt(this,e)},getLineNumber:function(e){return Ut(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=wt(this,e)),Un(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return K(this,e)},getCursor:function(e){var n=this.sel.primary(),D;return e==null||e=="head"?D=n.head:e=="anchor"?D=n.anchor:e=="end"||e=="to"||e===!1?D=n.to():D=n.from(),D},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Vn(function(e,n,D){Ts(this,K(this,typeof e=="number"?bt(e,n||0):e),null,D)}),setSelection:Vn(function(e,n,D){Ts(this,K(this,e),K(this,n||e),D)}),extendSelection:Vn(function(e,n,D){No(this,K(this,e),n&&K(this,n),D)}),extendSelections:Vn(function(e,n){ws(this,ee(this,e),n)}),extendSelectionsBy:Vn(function(e,n){var D=Se(this.sel.ranges,e);ws(this,ee(this,D),n)}),setSelections:Vn(function(e,n,D){if(!e.length)return;for(var I=[],B=0;B<e.length;B++)I[B]=new ln(K(this,e[B].anchor),K(this,e[B].head));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),wi(this,Vi(this.cm,I,n),D)}),addSelection:Vn(function(e,n,D){var I=this.sel.ranges.slice(0);I.push(new ln(K(this,e),K(this,n||e))),wi(this,Vi(this.cm,I,I.length-1),D)}),getSelection:function(e){for(var n=this.sel.ranges,D,I=0;I<n.length;I++){var B=wr(this,n[I].from(),n[I].to());D=D?D.concat(B):B}return e===!1?D:D.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],D=this.sel.ranges,I=0;I<D.length;I++){var B=wr(this,D[I].from(),D[I].to());e!==!1&&(B=B.join(e||this.lineSeparator())),n[I]=B}return n},replaceSelection:function(e,n,D){for(var I=[],B=0;B<this.sel.ranges.length;B++)I[B]=e;this.replaceSelections(I,n,D||"+input")},replaceSelections:Vn(function(e,n,D){for(var I=[],B=this.sel,J=0;J<B.ranges.length;J++){var se=B.ranges[J];I[J]={from:se.from(),to:se.to(),text:this.splitLines(e[J]),origin:D}}for(var fe=n&&n!="end"&&ko(this,I,n),pe=I.length-1;pe>=0;pe--)Ka(this,I[pe]);fe?Ss(this,fe):this.cm&&ya(this.cm)}),undo:Vn(function(){Uo(this,"undo")}),redo:Vn(function(){Uo(this,"redo")}),undoSelection:Vn(function(){Uo(this,"undo",!0)}),redoSelection:Vn(function(){Uo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,D=0,I=0;I<e.done.length;I++)e.done[I].ranges||++n;for(var B=0;B<e.undone.length;B++)e.undone[B].ranges||++D;return{undo:n,redo:D}},clearHistory:function(){var e=this;this.history=new Mo(this.history.maxGeneration),wa(this,function(n){return n.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:za(this.history.done),undone:za(this.history.undone)}},setHistory:function(e){var n=this.history=new Mo(this.history.maxGeneration);n.done=za(e.done.slice(0),null,!0),n.undone=za(e.undone.slice(0),null,!0)},setGutterMarker:Vn(function(e,n,D){return fo(this,e,"gutter",function(I){var B=I.gutterMarkers||(I.gutterMarkers={});return B[n]=D,!D&&Z(B)&&(I.gutterMarkers=null),!0})}),clearGutter:Vn(function(e){var n=this;this.iter(function(D){D.gutterMarkers&&D.gutterMarkers[e]&&fo(n,D,"gutter",function(){return D.gutterMarkers[e]=null,Z(D.gutterMarkers)&&(D.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!un(this,e))return null;if(n=e,e=wt(this,e),!e)return null}else if(n=Ut(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Vn(function(e,n,D){return fo(this,e,n=="gutter"?"gutter":"class",function(I){var B=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!I[B])I[B]=D;else{if(O(D).test(I[B]))return!1;I[B]+=" "+D}return!0})}),removeLineClass:Vn(function(e,n,D){return fo(this,e,n=="gutter"?"gutter":"class",function(I){var B=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",J=I[B];if(J)if(D==null)I[B]=null;else{var se=J.match(O(D));if(!se)return!1;var fe=se.index+se[0].length;I[B]=J.slice(0,se.index)+(!se.index||fe==J.length?"":" ")+J.slice(fe)||null}else return!1;return!0})}),addLineWidget:Vn(function(e,n,D){return xl(this,e,n,D)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,D){return Xa(this,K(this,e),K(this,n),D,D&&D.type||"range")},setBookmark:function(e,n){var D={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=K(this,e),Xa(this,e,e,D,"bookmark")},findMarksAt:function(e){e=K(this,e);var n=[],D=wt(this,e.line).markedSpans;if(D)for(var I=0;I<D.length;++I){var B=D[I];(B.from==null||B.from<=e.ch)&&(B.to==null||B.to>=e.ch)&&n.push(B.marker.parent||B.marker)}return n},findMarks:function(e,n,D){e=K(this,e),n=K(this,n);var I=[],B=e.line;return this.iter(e.line,n.line+1,function(J){var se=J.markedSpans;if(se)for(var fe=0;fe<se.length;fe++){var pe=se[fe];!(pe.to!=null&&B==e.line&&e.ch>=pe.to||pe.from==null&&B!=e.line||pe.from!=null&&B==n.line&&pe.from>=n.ch)&&(!D||D(pe.marker))&&I.push(pe.marker.parent||pe.marker)}++B}),I},getAllMarks:function(){var e=[];return this.iter(function(n){var D=n.markedSpans;if(D)for(var I=0;I<D.length;++I)D[I].from!=null&&e.push(D[I].marker)}),e},posFromIndex:function(e){var n,D=this.first,I=this.lineSeparator().length;return this.iter(function(B){var J=B.text.length+I;if(J>e)return n=e,!0;e-=J,++D}),K(this,bt(D,n))},indexFromPos:function(e){e=K(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var D=this.lineSeparator().length;return this.iter(this.first,e.line,function(I){n+=I.text.length+D}),n},copy:function(e){var n=new ki(Cr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,D=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<D&&(D=e.to);var I=new ki(Cr(this,n,D),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(I.history=this.history),(this.linked||(this.linked=[])).push({doc:I,sharedHist:e.sharedHist}),I.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(I,Us(this)),I},unlinkDoc:function(e){if(e instanceof Pn&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var D=this.linked[n];if(D.doc!=e)continue;this.linked.splice(n,1),e.unlinkDoc(this),Sl(Us(this));break}if(e.history==this.history){var I=[e.id];wa(e,function(B){return I.push(B.id)},!0),e.history=new Mo(null),e.history.done=za(this.history.done,I),e.history.undone=za(this.history.undone,I)}},iterLinkedDocs:function(e){wa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):At(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:Vn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&pl(this.cm)})}),ki.prototype.eachLine=ki.prototype.iter;var Bs=0;function Ol(e){var n=this;if(Hs(n),Ze(n,e)||Jn(n.display,e))return;Ee(e),S&&(Bs=+new Date);var D=ni(n,e,!0),I=e.dataTransfer.files;if(!D||n.isReadOnly())return;if(I&&I.length&&window.FileReader&&window.File)for(var B=I.length,J=Array(B),se=0,fe=function(){++se==B&&Kn(n,function(){D=K(n.doc,D);var it={from:D,to:D,text:n.doc.splitLines(J.filter(function(gt){return gt!=null}).join(n.doc.lineSeparator())),origin:"paste"};Ka(n.doc,it),Ss(n.doc,Zi(K(n.doc,D),K(n.doc,qi(it))))})()},pe=function(it,gt){if(n.options.allowDropFileTypes&&re(n.options.allowDropFileTypes,it.type)==-1){fe();return}var xt=new FileReader;xt.onerror=function(){return fe()},xt.onload=function(){var Rt=xt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Rt)){fe();return}J[gt]=Rt,fe()},xt.readAsText(it)},xe=0;xe<I.length;xe++)pe(I[xe],xe);else{if(n.state.draggingText&&n.doc.sel.contains(D)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var We=e.dataTransfer.getData("Text");if(We){var Ve;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ve=n.listSelections()),jo(n.doc,Zi(D,D)),Ve)for(var ut=0;ut<Ve.length;++ut)Va(n.doc,"",Ve[ut].anchor,Ve[ut].head,"drag");n.replaceSelection(We,"around","paste"),n.display.input.focus()}}catch(it){}}}function Al(e,n){if(S&&(!e.state.draggingText||+new Date-Bs<100)){Fe(n);return}if(Ze(e,n)||Jn(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!r){var D=T("img",null,null,"position: fixed; left: 0; top: 0;");D.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",l&&(D.width=D.height=1,e.display.wrapper.appendChild(D),D._top=D.offsetTop),n.dataTransfer.setDragImage(D,0,0),l&&D.parentNode.removeChild(D)}}function Rl(e,n){var D=ni(e,n);if(!D)return;var I=document.createDocumentFragment();na(e,D,I),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),E(e.display.dragCursor,I)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var n=document.getElementsByClassName("CodeMirror"),D=[],I=0;I<n.length;I++){var B=n[I].CodeMirror;B&&D.push(B)}D.length&&D[0].operation(function(){for(var J=0;J<D.length;J++)e(D[J])})}var zs=!1;function Il(){if(zs)return;Dl(),zs=!0}function Dl(){var e;Ie(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Ll)},100))}),Ie(window,"blur",function(){return Ws(va)})}function Ll(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var Sa={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"},yo=0;yo<10;yo++)Sa[yo+48]=Sa[yo+96]=String(yo);for(var Bo=65;Bo<=90;Bo++)Sa[Bo]=String.fromCharCode(Bo);for(var bo=1;bo<=12;bo++)Sa[bo+111]=Sa[bo+63235]="F"+bo;var ma={};ma.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"},ma.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"},ma.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"},ma.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"]},ma.default=u?ma.macDefault:ma.pcDefault;function kl(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var D,I,B,J,se=0;se<n.length-1;se++){var fe=n[se];if(/^(cmd|meta|m)$/i.test(fe))J=!0;else if(/^a(lt)?$/i.test(fe))D=!0;else if(/^(c|ctrl|control)$/i.test(fe))I=!0;else if(/^s(hift)?$/i.test(fe))B=!0;else throw new Error("Unrecognized modifier name: "+fe)}return D&&(e="Alt-"+e),I&&(e="Ctrl-"+e),J&&(e="Cmd-"+e),B&&(e="Shift-"+e),e}function Ml(e){var n={};for(var D in e)if(e.hasOwnProperty(D)){var I=e[D];if(/^(name|fallthrough|(de|at)tach)$/.test(D))continue;if(I=="..."){delete e[D];continue}for(var B=Se(D.split(" "),kl),J=0;J<B.length;J++){var se=void 0,fe=void 0;J==B.length-1?(fe=B.join(" "),se=I):(fe=B.slice(0,J+1).join(" "),se="...");var pe=n[fe];if(!pe)n[fe]=se;else if(pe!=se)throw new Error("Inconsistent bindings for "+fe)}delete e[D]}for(var xe in n)e[xe]=n[xe];return e}function Ya(e,n,D,I){n=Ho(n);var B=n.call?n.call(e,I):n[e];if(B===!1)return"nothing";if(B==="...")return"multi";if(B!=null&&D(B))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return Ya(e,n.fallthrough,D,I);for(var J=0;J<n.fallthrough.length;J++){var se=Ya(e,n.fallthrough[J],D,I);if(se)return se}}}function Gs(e){var n=typeof e=="string"?e:Sa[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function Ks(e,n,D){var I=e;return n.altKey&&I!="Alt"&&(e="Alt-"+e),(h?n.metaKey:n.ctrlKey)&&I!="Ctrl"&&(e="Ctrl-"+e),(h?n.ctrlKey:n.metaKey)&&I!="Mod"&&(e="Cmd-"+e),!D&&n.shiftKey&&I!="Shift"&&(e="Shift-"+e),e}function Vs(e,n){if(l&&e.keyCode==34&&e.char)return!1;var D=Sa[e.keyCode];return D==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(D=e.code),Ks(D,e,n))}function Ho(e){return typeof e=="string"?ma[e]:e}function $a(e,n){for(var D=e.doc.sel.ranges,I=[],B=0;B<D.length;B++){for(var J=n(D[B]);I.length&&Bt(J.from,ie(I).to)<=0;){var se=I.pop();if(Bt(se.from,J.from)<0){J.from=se.from;break}}I.push(J)}Oi(e,function(){for(var fe=I.length-1;fe>=0;fe--)Va(e.doc,"",I[fe].from,I[fe].to,"+delete");ya(e)})}function as(e,n,D){var I=Re(e.text,n+D,D);return I<0||I>e.text.length?null:I}function os(e,n,D){var I=as(e,n.ch,D);return I==null?null:new bt(n.line,I,D<0?"after":"before")}function ss(e,n,D,I,B){if(e){n.doc.direction=="rtl"&&(B=-B);var J=lt(D,n.doc.direction);if(J){var se=B<0?ie(J):J[0],fe=B<0==(se.level==1),pe=fe?"after":"before",xe;if(se.level>0||n.doc.direction=="rtl"){var We=Ye(n,D);xe=B<0?D.text.length-1:0;var Ve=nt(n,We,xe).top;xe=Qe(function(ut){return nt(n,We,ut).top==Ve},B<0==(se.level==1)?se.from:se.to-1,xe),pe=="before"&&(xe=as(D,xe,1))}else xe=B<0?se.to:se.from;return new bt(I,xe,pe)}}return new bt(I,B<0?D.text.length:0,B<0?"before":"after")}function Pl(e,n,D,I){var B=lt(n,e.doc.direction);if(!B)return os(n,D,I);D.ch>=n.text.length?(D.ch=n.text.length,D.sticky="before"):D.ch<=0&&(D.ch=0,D.sticky="after");var J=qe(B,D.ch,D.sticky),se=B[J];if(e.doc.direction=="ltr"&&se.level%2==0&&(I>0?se.to>D.ch:se.from<D.ch))return os(n,D,I);var fe=function(Pt,Gt){return as(n,Pt instanceof bt?Pt.ch:Pt,Gt)},pe,xe=function(Pt){return e.options.lineWrapping?(pe=pe||Ye(e,n),Zt(e,n,pe,Pt)):{begin:0,end:n.text.length}},We=xe(D.sticky=="before"?fe(D,-1):D.ch);if(e.doc.direction=="rtl"||se.level==1){var Ve=se.level==1==I<0,ut=fe(D,Ve?1:-1);if(ut!=null&&(Ve?ut<=se.to&&ut<=We.end:ut>=se.from&&ut>=We.begin)){var it=Ve?"before":"after";return new bt(D.line,ut,it)}}var gt=function(Pt,Gt,Nt){for(var $t=function(Tn,fi){return fi?new bt(D.line,fe(Tn,1),"before"):new bt(D.line,Tn,"after")};Pt>=0&&Pt<B.length;Pt+=Gt){var dr=B[Pt],ar=Gt>0==(dr.level!=1),Pr=ar?Nt.begin:fe(Nt.end,-1);if(dr.from<=Pr&&Pr<dr.to)return $t(Pr,ar);if(Pr=ar?dr.from:fe(dr.to,-1),Nt.begin<=Pr&&Pr<Nt.end)return $t(Pr,ar)}},xt=gt(J+I,I,We);if(xt)return xt;var Rt=I>0?We.end:fe(We.begin,-1);return Rt!=null&&!(I>0&&Rt==n.text.length)&&(xt=gt(I>0?0:B.length-1,I,xe(Rt)),xt)?xt:null}var _o={selectAll:Is,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ve)},killLine:function(e){return $a(e,function(n){if(n.empty()){var D=wt(e.doc,n.head.line).text.length;return n.head.ch==D&&n.head.line<e.lastLine()?{from:n.head,to:bt(n.head.line+1,0)}:{from:n.head,to:bt(n.head.line,D)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return $a(e,function(n){return{from:bt(n.from().line,0),to:K(e.doc,bt(n.to().line+1,0))}})},delLineLeft:function(e){return $a(e,function(n){return{from:bt(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return $a(e,function(n){var D=e.charCoords(n.head,"div").top+5,I=e.coordsChar({left:0,top:D},"div");return{from:I,to:n.from()}})},delWrappedLineRight:function(e){return $a(e,function(n){var D=e.charCoords(n.head,"div").top+5,I=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:D},"div");return{from:n.from(),to:I}})},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(bt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(bt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Xs(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Ys(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return Nl(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var D=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:D},"div")},De)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var D=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:D},"div")},De)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var D=e.cursorCoords(n.head,"div").top+5,I=e.coordsChar({left:0,top:D},"div");return I.ch<e.getLine(I.line).search(/\S/)?Ys(e,n.head):I},De)},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 n=[],D=e.listSelections(),I=e.options.tabSize,B=0;B<D.length;B++){var J=D[B].from(),se=H(e.getLine(J.line),J.ch,I);n.push(ue(I-se%I))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Oi(e,function(){for(var n=e.listSelections(),D=[],I=0;I<n.length;I++){if(!n[I].empty())continue;var B=n[I].head,J=wt(e.doc,B.line).text;if(J){if(B.ch==J.length&&(B=new bt(B.line,B.ch-1)),B.ch>0)B=new bt(B.line,B.ch+1),e.replaceRange(J.charAt(B.ch-1)+J.charAt(B.ch-2),bt(B.line,B.ch-2),B,"+transpose");else if(B.line>e.doc.first){var se=wt(e.doc,B.line-1).text;se&&(B=new bt(B.line,1),e.replaceRange(J.charAt(0)+e.doc.lineSeparator()+se.charAt(se.length-1),bt(B.line-1,se.length-1),B,"+transpose"))}}D.push(new ln(B,B))}e.setSelections(D)})},newlineAndIndent:function(e){return Oi(e,function(){for(var n=e.listSelections(),D=n.length-1;D>=0;D--)e.replaceRange(e.doc.lineSeparator(),n[D].anchor,n[D].head,"+input");n=e.listSelections();for(var I=0;I<n.length;I++)e.indentLine(n[I].from().line,null,!0);ya(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,n){var D=wt(e.doc,n),I=Un(D);return I!=D&&(n=Ut(I)),ss(!0,e,I,n,1)}function Nl(e,n){var D=wt(e.doc,n),I=Di(D);return I!=D&&(n=Ut(I)),ss(!0,e,D,n,-1)}function Ys(e,n){var D=Xs(e,n.line),I=wt(e.doc,D.line),B=lt(I,e.doc.direction);if(!B||B[0].level==0){var J=Math.max(D.ch,I.text.search(/\S/)),se=n.line==D.line&&n.ch<=J&&n.ch;return bt(D.line,se?0:J,D.sticky)}return D}function Wo(e,n,D){if(typeof n=="string"&&(n=_o[n],!n))return!1;e.display.input.ensurePolled();var I=e.display.shift,B=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),D&&(e.display.shift=!1),B=n(e)!=ge}finally{e.display.shift=I,e.state.suppressEdits=!1}return B}function jl(e,n,D){for(var I=0;I<e.state.keyMaps.length;I++){var B=Ya(n,e.state.keyMaps[I],D,e);if(B)return B}return e.options.extraKeys&&Ya(n,e.options.extraKeys,D,e)||Ya(n,e.options.keyMap,D,e)}var Fl=new $;function Eo(e,n,D,I){var B=e.state.keySeq;if(B){if(Gs(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==B&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,B+" "+n,D,I))return!0}return $s(e,n,D,I)}function $s(e,n,D,I){var B=jl(e,n,I);return B=="multi"&&(e.state.keySeq=n),B=="handled"&&Rr(e,"keyHandled",e,n,D),(B=="handled"||B=="multi")&&(Ee(D),ii(e)),!!B}function Js(e,n){var D=Vs(n,!0);return D?n.shiftKey&&!e.state.keySeq?Eo(e,"Shift-"+D,n,function(I){return Wo(e,I,!0)})||Eo(e,D,n,function(I){if(typeof I=="string"?/^go[A-Z]/.test(I):I.motion)return Wo(e,I)}):Eo(e,D,n,function(I){return Wo(e,I)}):!1}function Ul(e,n,D){return Eo(e,"'"+D+"'",n,function(I){return Wo(e,I,!0)})}var ls=null;function Qs(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(n.curOp.focus=V(),Ze(n,e))return;S&&b<11&&e.keyCode==27&&(e.returnValue=!1);var D=e.keyCode;n.display.shift=D==16||e.shiftKey;var I=Js(n,e);l&&(ls=I?D:null,!I&&D==88&&!Vt&&(u?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),C&&!u&&!I&&D==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),D==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Bl(n)}function Bl(e){var n=e.display.lineDiv;z(n,"CodeMirror-crosshair");function D(I){(I.keyCode==18||!I.altKey)&&(g(n,"CodeMirror-crosshair"),ot(document,"keyup",D),ot(document,"mouseover",D))}Ie(document,"keyup",D),Ie(document,"mouseover",D)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ze(this,e)}function el(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(Jn(n.display,e)||Ze(n,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var D=e.keyCode,I=e.charCode;if(l&&D==ls){ls=null,Ee(e);return}if(l&&(!e.which||e.which<10)&&Js(n,e))return;var B=String.fromCharCode(I==null?D:I);if(B=="\b")return;if(Ul(n,e,B))return;n.display.input.onKeyPress(e)}var Hl=400,us=function(e,n,D){this.time=e,this.pos=n,this.button=D};us.prototype.compare=function(e,n,D){return this.time+Hl>e&&Bt(n,this.pos)==0&&D==this.button};var xo,wo;function Wl(e,n){var D=+new Date;return wo&&wo.compare(D,e,n)?(xo=wo=null,"triple"):xo&&xo.compare(D,e,n)?(wo=new us(D,e,n),xo=null,"double"):(xo=new us(D,e,n),wo=null,"single")}function tl(e){var n=this,D=n.display;if(Ze(n,e)||D.activeTouch&&D.input.supportsTouch())return;if(D.input.ensurePolled(),D.shift=e.shiftKey,Jn(D,e)){p||(D.scroller.draggable=!1,setTimeout(function(){return D.scroller.draggable=!0},100));return}if(cs(n,e))return;var I=ni(n,e),B=et(e),J=I?Wl(I,B):"single";if(window.focus(),B==1&&n.state.selectingText&&n.state.selectingText(e),I&&zl(n,B,I,J,e))return;B==1?I?Kl(n,I,J,e):Be(e)==D.scroller&&Ee(e):B==2?(I&&No(n.doc,I),setTimeout(function(){return D.input.focus()},20)):B==3&&(R?n.display.input.onContextMenu(e):eo(n))}function zl(e,n,D,I,B){var J="Click";return I=="double"?J="Double"+J:I=="triple"&&(J="Triple"+J),J=(n==1?"Left":n==2?"Middle":"Right")+J,Eo(e,Ks(J,B),B,function(se){if(typeof se=="string"&&(se=_o[se]),!se)return!1;var fe=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),fe=se(e,D)!=ge}finally{e.state.suppressEdits=!1}return fe})}function Gl(e,n,D){var I=e.getOption("configureMouse"),B=I?I(e,n,D):{};if(B.unit==null){var J=f?D.shiftKey&&D.metaKey:D.altKey;B.unit=J?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(B.extend==null||e.doc.extend)&&(B.extend=e.doc.extend||D.shiftKey),B.addNew==null&&(B.addNew=u?D.metaKey:D.ctrlKey),B.moveOnDrag==null&&(B.moveOnDrag=!(u?D.altKey:D.ctrlKey)),B}function Kl(e,n,D,I){S?setTimeout(U(So,e),0):e.curOp.focus=V();var B=Gl(e,D,I),J=e.doc.sel,se;e.options.dragDrop&&ct&&!e.isReadOnly()&&D=="single"&&(se=J.contains(n))>-1&&(Bt((se=J.ranges[se]).from(),n)<0||n.xRel>0)&&(Bt(se.to(),n)>0||n.xRel<0)?Vl(e,I,n,B):Xl(e,I,n,B)}function Vl(e,n,D,I){var B=e.display,J=!1,se=Kn(e,function(xe){p&&(B.scroller.draggable=!1),e.state.draggingText=!1,ot(B.wrapper.ownerDocument,"mouseup",se),ot(B.wrapper.ownerDocument,"mousemove",fe),ot(B.scroller,"dragstart",pe),ot(B.scroller,"drop",se),J||(Ee(xe),I.addNew||No(e.doc,D,null,null,I.extend),p&&!r||S&&b==9?setTimeout(function(){B.wrapper.ownerDocument.body.focus({preventScroll:!0}),B.input.focus()},20):B.input.focus())}),fe=function(xe){J=J||Math.abs(n.clientX-xe.clientX)+Math.abs(n.clientY-xe.clientY)>=10},pe=function(){return J=!0};p&&(B.scroller.draggable=!0),e.state.draggingText=se,se.copy=!I.moveOnDrag,B.scroller.dragDrop&&B.scroller.dragDrop(),Ie(B.wrapper.ownerDocument,"mouseup",se),Ie(B.wrapper.ownerDocument,"mousemove",fe),Ie(B.scroller,"dragstart",pe),Ie(B.scroller,"drop",se),eo(e),setTimeout(function(){return B.input.focus()},20)}function rl(e,n,D){if(D=="char")return new ln(n,n);if(D=="word")return e.findWordAt(n);if(D=="line")return new ln(bt(n.line,0),K(e.doc,bt(n.line+1,0)));var I=D(e,n);return new ln(I.from,I.to)}function Xl(e,n,D,I){var B=e.display,J=e.doc;Ee(n);var se,fe,pe=J.sel,xe=pe.ranges;if(I.addNew&&!I.extend?(fe=J.sel.contains(D),fe>-1?se=xe[fe]:se=new ln(D,D)):(se=J.sel.primary(),fe=J.sel.primIndex),I.unit=="rectangle")I.addNew||(se=new ln(D,D)),D=ni(e,n,!0,!0),fe=-1;else{var We=rl(e,D,I.unit);I.extend?se=ns(se,We.anchor,We.head,I.extend):se=We}I.addNew?fe==-1?(fe=xe.length,wi(J,Vi(e,xe.concat([se]),fe),{scroll:!1,origin:"*mouse"})):xe.length>1&&xe[fe].empty()&&I.unit=="char"&&!I.extend?(wi(J,Vi(e,xe.slice(0,fe).concat(xe.slice(fe+1)),0),{scroll:!1,origin:"*mouse"}),pe=J.sel):is(J,fe,se,de):(fe=0,wi(J,new Ri([se],0),de),pe=J.sel);var Ve=D;function ut(Nt){if(Bt(Ve,Nt)==0)return;if(Ve=Nt,I.unit=="rectangle"){for(var $t=[],dr=e.options.tabSize,ar=H(wt(J,D.line).text,D.ch,dr),Pr=H(wt(J,Nt.line).text,Nt.ch,dr),Tn=Math.min(ar,Pr),fi=Math.max(ar,Pr),Fn=Math.min(D.line,Nt.line),Fi=Math.min(e.lastLine(),Math.max(D.line,Nt.line));Fn<=Fi;Fn++){var Mi=wt(J,Fn).text,Qn=Te(Mi,Tn,dr);Tn==fi?$t.push(new ln(bt(Fn,Qn),bt(Fn,Qn))):Mi.length>Qn&&$t.push(new ln(bt(Fn,Qn),bt(Fn,Te(Mi,fi,dr))))}$t.length||$t.push(new ln(D,D)),wi(J,Vi(e,pe.ranges.slice(0,fe).concat($t),fe),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Nt)}else{var Pi=se,yi=rl(e,Nt,I.unit),si=Pi.anchor,Zn;Bt(yi.anchor,si)>0?(Zn=yi.head,si=Sn(Pi.from(),yi.anchor)):(Zn=yi.anchor,si=Ln(Pi.to(),yi.head));var zn=pe.ranges.slice(0);zn[fe]=Yl(e,new ln(K(J,si),Zn)),wi(J,Vi(e,zn,fe),de)}}var it=B.wrapper.getBoundingClientRect(),gt=0;function xt(Nt){var $t=++gt,dr=ni(e,Nt,!0,I.unit=="rectangle");if(!dr)return;if(Bt(dr,Ve)!=0){e.curOp.focus=V(),ut(dr);var ar=Pa(B,J);(dr.line>=ar.to||dr.line<ar.from)&&setTimeout(Kn(e,function(){gt==$t&&xt(Nt)}),150)}else{var Pr=Nt.clientY<it.top?-20:Nt.clientY>it.bottom?20:0;Pr&&setTimeout(Kn(e,function(){if(gt!=$t)return;B.scroller.scrollTop+=Pr,xt(Nt)}),50)}}function Rt(Nt){e.state.selectingText=!1,gt=Infinity,Nt&&(Ee(Nt),B.input.focus()),ot(B.wrapper.ownerDocument,"mousemove",Pt),ot(B.wrapper.ownerDocument,"mouseup",Gt),J.history.lastSelOrigin=null}var Pt=Kn(e,function(Nt){Nt.buttons===0||!et(Nt)?Rt(Nt):xt(Nt)}),Gt=Kn(e,Rt);e.state.selectingText=Gt,Ie(B.wrapper.ownerDocument,"mousemove",Pt),Ie(B.wrapper.ownerDocument,"mouseup",Gt)}function Yl(e,n){var D=n.anchor,I=n.head,B=wt(e.doc,D.line);if(Bt(D,I)==0&&D.sticky==I.sticky)return n;var J=lt(B);if(!J)return n;var se=qe(J,D.ch,D.sticky),fe=J[se];if(fe.from!=D.ch&&fe.to!=D.ch)return n;var pe=se+(fe.from==D.ch==(fe.level!=1)?0:1);if(pe==0||pe==J.length)return n;var xe;if(I.line!=D.line)xe=(I.line-D.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var We=qe(J,I.ch,I.sticky),Ve=We-se||(I.ch-D.ch)*(fe.level==1?-1:1);We==pe-1||We==pe?xe=Ve<0:xe=Ve>0}var ut=J[pe+(xe?-1:0)],it=xe==(ut.level==1),gt=it?ut.from:ut.to,xt=it?"after":"before";return D.ch==gt&&D.sticky==xt?n:new ln(new bt(D.line,gt,xt),I)}function nl(e,n,D,I){var B,J;if(n.touches)B=n.touches[0].clientX,J=n.touches[0].clientY;else try{B=n.clientX,J=n.clientY}catch(ut){return!1}if(B>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;I&&Ee(n);var se=e.display,fe=se.lineDiv.getBoundingClientRect();if(J>fe.bottom||!Ae(e,D))return ke(n);J-=fe.top-se.viewOffset;for(var pe=0;pe<e.display.gutterSpecs.length;++pe){var xe=se.gutters.childNodes[pe];if(xe&&xe.getBoundingClientRect().right>=B){var We=Or(e.doc,J),Ve=e.display.gutterSpecs[pe];return ze(e,D,e,We,Ve.className,n),ke(n)}}}function cs(e,n){return nl(e,n,"gutterClick",!0)}function il(e,n){if(Jn(e.display,n)||$l(e,n))return;if(Ze(e,n,"contextmenu"))return;R||e.display.input.onContextMenu(n)}function $l(e,n){return Ae(e,"gutterContextMenu")?nl(e,n,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Tr(e)}var Ja={toString:function(){return"CodeMirror.Init"}},ol={},zo={};function Jl(e){var n=e.optionHandlers;function D(I,B,J,se){e.defaults[I]=B,J&&(n[I]=se?function(fe,pe,xe){xe!=Ja&&J(fe,pe,xe)}:J)}e.defineOption=D,e.Init=Ja,D("value","",function(I,B){return I.setValue(B)},!0),D("mode",null,function(I,B){I.doc.modeOption=B,pa(I)},!0),D("indentUnit",2,pa,!0),D("indentWithTabs",!1),D("smartIndent",!0),D("tabSize",4,function(I){co(I),Tr(I),yn(I)},!0),D("lineSeparator",null,function(I,B){if(I.doc.lineSep=B,!B)return;var J=[],se=I.doc.first;I.doc.iter(function(pe){for(var xe=0;;){var We=pe.text.indexOf(B,xe);if(We==-1)break;xe=We+B.length,J.push(bt(se,We))}se++});for(var fe=J.length-1;fe>=0;fe--)Va(I.doc,B,J[fe],bt(J[fe].line,J[fe].ch+B.length))}),D("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(I,B,J){I.state.specialChars=new RegExp(B.source+(B.test(" ")?"":"| "),"g"),J!=Ja&&I.refresh()}),D("specialCharPlaceholder",Kr,function(I){return I.refresh()},!0),D("electricChars",!0),D("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),D("spellcheck",!1,function(I,B){return I.getInputField().spellcheck=B},!0),D("autocorrect",!1,function(I,B){return I.getInputField().autocorrect=B},!0),D("autocapitalize",!1,function(I,B){return I.getInputField().autocapitalize=B},!0),D("rtlMoveVisually",!w),D("wholeLineUpdateBefore",!0),D("theme","default",function(I){al(I),Qi(I)},!0),D("keyMap","default",function(I,B,J){var se=Ho(B),fe=J!=Ja&&Ho(J);fe&&fe.detach&&fe.detach(I,se),se.attach&&se.attach(I,fe||null)}),D("extraKeys",null),D("configureMouse",null),D("lineWrapping",!1,Zl,!0),D("gutters",[],function(I,B){I.display.gutterSpecs=Ai(B,I.options.lineNumbers),Qi(I)},!0),D("fixedGutter",!0,function(I,B){I.display.gutters.style.left=B?xi(I.display)+"px":"0",I.refresh()},!0),D("coverGutterNextToScrollbar",!1,function(I){return da(I)},!0),D("scrollbarStyle","native",function(I){Fa(I),da(I),I.display.scrollbars.setScrollTop(I.doc.scrollTop),I.display.scrollbars.setScrollLeft(I.doc.scrollLeft)},!0),D("lineNumbers",!1,function(I,B){I.display.gutterSpecs=Ai(I.options.gutters,B),Qi(I)},!0),D("firstLineNumber",1,Qi,!0),D("lineNumberFormatter",function(I){return I},Qi,!0),D("showCursorWhenSelecting",!1,mn,!0),D("resetSelectionOnContextMenu",!0),D("lineWiseCopyCut",!0),D("pasteLinesPerSelection",!0),D("selectionsMayTouch",!1),D("readOnly",!1,function(I,B){B=="nocursor"&&(va(I),I.display.input.blur()),I.display.input.readOnlyChanged(B)}),D("screenReaderLabel",null,function(I,B){B=B===""?null:B,I.display.input.screenReaderLabelChanged(B)}),D("disableInput",!1,function(I,B){B||I.display.input.reset()},!0),D("dragDrop",!0,Ql),D("allowDropFileTypes",null),D("cursorBlinkRate",530),D("cursorScrollMargin",0),D("cursorHeight",1,mn,!0),D("singleCursorHeightPerLine",!0,mn,!0),D("workTime",100),D("workDelay",100),D("flattenSpans",!0,co,!0),D("addModeClass",!1,co,!0),D("pollInterval",100),D("undoDepth",200,function(I,B){return I.doc.history.undoDepth=B}),D("historyEventDelay",1250),D("viewportMargin",10,function(I){return I.refresh()},!0),D("maxHighlightLength",1e4,co,!0),D("moveInputWithCursor",!0,function(I,B){B||I.display.input.resetPosition()}),D("tabindex",null,function(I,B){return I.display.input.getField().tabIndex=B||""}),D("autofocus",null),D("direction","ltr",function(I,B){return I.doc.setDirection(B)},!0),D("phrases",null)}function Ql(e,n,D){var I=D&&D!=Ja;if(!n!=!I){var B=e.display.dragFunctions,J=n?Ie:ot;J(e.display.scroller,"dragstart",B.start),J(e.display.scroller,"dragenter",B.enter),J(e.display.scroller,"dragover",B.over),J(e.display.scroller,"dragleave",B.leave),J(e.display.scroller,"drop",B.drop)}}function Zl(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(g(e.display.wrapper,"CodeMirror-wrap"),Hi(e)),Ci(e),yn(e),Tr(e),setTimeout(function(){return da(e)},100)}function Pn(e,n){var D=this;if(!(this instanceof Pn))return new Pn(e,n);this.options=n=n?P(n):{},P(ol,n,!1);var I=n.value;typeof I=="string"?I=new ki(I,n.mode,null,n.lineSeparator,n.direction):n.mode&&(I.modeOption=n.mode),this.doc=I;var B=new Pn.inputStyles[n.inputStyle](this),J=this.display=new Da(e,I,B,n);J.wrapper.CodeMirror=this,al(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fa(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 $,keySeq:null,specialChars:null},n.autofocus&&!a&&J.input.focus(),S&&b<11&&setTimeout(function(){return D.display.input.reset(!0)},20),ql(this),Il(),oa(this),this.curOp.forceUpdate=!0,vs(this,I),n.autofocus&&!a||this.hasFocus()?setTimeout(function(){D.hasFocus()&&!D.state.focused&&ia(D)},20):va(this);for(var se in zo)zo.hasOwnProperty(se)&&zo[se](this,n[se],Ja);ai(this),n.finishInit&&n.finishInit(this);for(var fe=0;fe<ds.length;++fe)ds[fe](this);ha(this),p&&n.lineWrapping&&getComputedStyle(J.lineDiv).textRendering=="optimizelegibility"&&(J.lineDiv.style.textRendering="auto")}Pn.defaults=ol,Pn.optionHandlers=zo;function ql(e){var n=e.display;Ie(n.scroller,"mousedown",Kn(e,tl)),S&&b<11?Ie(n.scroller,"dblclick",Kn(e,function(pe){if(Ze(e,pe))return;var xe=ni(e,pe);if(!xe||cs(e,pe)||Jn(e.display,pe))return;Ee(pe);var We=e.findWordAt(xe);No(e.doc,We.anchor,We.head)})):Ie(n.scroller,"dblclick",function(pe){return Ze(e,pe)||Ee(pe)}),Ie(n.scroller,"contextmenu",function(pe){return il(e,pe)}),Ie(n.input.getField(),"contextmenu",function(pe){n.scroller.contains(pe.target)||il(e,pe)});var D,I={end:0};function B(){n.activeTouch&&(D=setTimeout(function(){return n.activeTouch=null},1e3),I=n.activeTouch,I.end=+new Date)}function J(pe){if(pe.touches.length!=1)return!1;var xe=pe.touches[0];return xe.radiusX<=1&&xe.radiusY<=1}function se(pe,xe){if(xe.left==null)return!0;var We=xe.left-pe.left,Ve=xe.top-pe.top;return We*We+Ve*Ve>20*20}Ie(n.scroller,"touchstart",function(pe){if(!Ze(e,pe)&&!J(pe)&&!cs(e,pe)){n.input.ensurePolled(),clearTimeout(D);var xe=+new Date;n.activeTouch={start:xe,moved:!1,prev:xe-I.end<=300?I:null},pe.touches.length==1&&(n.activeTouch.left=pe.touches[0].pageX,n.activeTouch.top=pe.touches[0].pageY)}}),Ie(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),Ie(n.scroller,"touchend",function(pe){var xe=n.activeTouch;if(xe&&!Jn(n,pe)&&xe.left!=null&&!xe.moved&&new Date-xe.start<300){var We=e.coordsChar(n.activeTouch,"page"),Ve;!xe.prev||se(xe,xe.prev)?Ve=new ln(We,We):!xe.prev.prev||se(xe,xe.prev.prev)?Ve=e.findWordAt(We):Ve=new ln(bt(We.line,0),K(e.doc,bt(We.line+1,0))),e.setSelection(Ve.anchor,Ve.head),e.focus(),Ee(pe)}B()}),Ie(n.scroller,"touchcancel",B),Ie(n.scroller,"scroll",function(){n.scroller.clientHeight&&(_a(e,n.scroller.scrollTop),Gi(e,n.scroller.scrollLeft,!0),ze(e,"scroll",e))}),Ie(n.scroller,"mousewheel",function(pe){return lo(e,pe)}),Ie(n.scroller,"DOMMouseScroll",function(pe){return lo(e,pe)}),Ie(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(pe){Ze(e,pe)||Fe(pe)},over:function(pe){Ze(e,pe)||(Rl(e,pe),Fe(pe))},start:function(pe){return Al(e,pe)},drop:Kn(e,Ol),leave:function(pe){Ze(e,pe)||Hs(e)}};var fe=n.input.getField();Ie(fe,"keyup",function(pe){return Zs.call(e,pe)}),Ie(fe,"keydown",Kn(e,Qs)),Ie(fe,"keypress",Kn(e,el)),Ie(fe,"focus",function(pe){return ia(e,pe)}),Ie(fe,"blur",function(pe){return va(e,pe)})}var ds=[];Pn.defineInitHook=function(e){return ds.push(e)};function To(e,n,D,I){var B=e.doc,J;D==null&&(D="add"),D=="smart"&&(B.mode.indent?J=Ot(e,n).state:D="prev");var se=e.options.tabSize,fe=wt(B,n),pe=H(fe.text,null,se);fe.stateAfter&&(fe.stateAfter=null);var xe=fe.text.match(/^\s*/)[0],We;if(!I&&!/\S/.test(fe.text))We=0,D="not";else if(D=="smart"&&(We=B.mode.indent(J,fe.text.slice(xe.length),fe.text),We==ge||We>150)){if(!I)return;D="prev"}D=="prev"?n>B.first?We=H(wt(B,n-1).text,null,se):We=0:D=="add"?We=pe+e.options.indentUnit:D=="subtract"?We=pe-e.options.indentUnit:typeof D=="number"&&(We=pe+D),We=Math.max(0,We);var Ve="",ut=0;if(e.options.indentWithTabs)for(var it=Math.floor(We/se);it;--it)ut+=se,Ve+=" ";if(ut<We&&(Ve+=ue(We-ut)),Ve!=xe)return Va(B,Ve,bt(n,0),bt(n,xe.length),"+input"),fe.stateAfter=null,!0;for(var gt=0;gt<B.sel.ranges.length;gt++){var xt=B.sel.ranges[gt];if(xt.head.line==n&&xt.head.ch<xe.length){var Rt=bt(n,xe.length);is(B,gt,new ln(Rt,Rt));break}}}var ea=null;function Go(e){ea=e}function hs(e,n,D,I,B){var J=e.doc;e.display.shift=!1,I||(I=J.sel);var se=+new Date-200,fe=B=="paste"||e.state.pasteIncoming>se,pe=At(n),xe=null;if(fe&&I.ranges.length>1)if(ea&&ea.text.join(`
|
|
|
`)==n){if(I.ranges.length%ea.text.length==0){xe=[];for(var We=0;We<ea.text.length;We++)xe.push(J.splitLines(ea.text[We]))}}else pe.length==I.ranges.length&&e.options.pasteLinesPerSelection&&(xe=Se(pe,function(Pt){return[Pt]}));for(var Ve=e.curOp.updateInput,ut=I.ranges.length-1;ut>=0;ut--){var it=I.ranges[ut],gt=it.from(),xt=it.to();it.empty()&&(D&&D>0?gt=bt(gt.line,gt.ch-D):e.state.overwrite&&!fe?xt=bt(xt.line,Math.min(wt(J,xt.line).text.length,xt.ch+ie(pe).length)):fe&&ea&&ea.lineWise&&ea.text.join(`
|
|
|
`)==pe.join(`
|
|
|
`)&&(gt=xt=bt(gt.line,0)));var Rt={from:gt,to:xt,text:xe?xe[ut%xe.length]:pe,origin:B||(fe?"paste":e.state.cutIncoming>se?"cut":"+input")};Ka(e.doc,Rt),Rr(e,"inputRead",e,Rt)}n&&!fe&&ll(e,n),ya(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ve),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,n){var D=e.clipboardData&&e.clipboardData.getData("Text");if(D)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&Oi(n,function(){return hs(n,D,0,null,"paste")}),!0}function ll(e,n){if(!e.options.electricChars||!e.options.smartIndent)return;for(var D=e.doc.sel,I=D.ranges.length-1;I>=0;I--){var B=D.ranges[I];if(B.head.ch>100||I&&D.ranges[I-1].head.line==B.head.line)continue;var J=e.getModeAt(B.head),se=!1;if(J.electricChars){for(var fe=0;fe<J.electricChars.length;fe++)if(n.indexOf(J.electricChars.charAt(fe))>-1){se=To(e,B.head.line,"smart");break}}else J.electricInput&&(J.electricInput.test(wt(e.doc,B.head.line).text.slice(0,B.head.ch))&&(se=To(e,B.head.line,"smart")));se&&Rr(e,"electricInput",e,B.head.line)}}function ul(e){for(var n=[],D=[],I=0;I<e.doc.sel.ranges.length;I++){var B=e.doc.sel.ranges[I].head.line,J={anchor:bt(B,0),head:bt(B+1,0)};D.push(J),n.push(e.getRange(J.anchor,J.head))}return{text:n,ranges:D}}function cl(e,n,D,I){e.setAttribute("autocorrect",D?"":"off"),e.setAttribute("autocapitalize",I?"":"off"),e.setAttribute("spellcheck",!!n)}function dl(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),n=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return p?e.style.width="1000px":e.setAttribute("wrap","off"),s&&(e.style.border="1px solid black"),cl(e),n}function eu(e){var n=e.optionHandlers,D=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(I,B){var J=this.options,se=J[I];if(J[I]==B&&I!="mode")return;J[I]=B,n.hasOwnProperty(I)&&Kn(this,n[I])(this,B,se),ze(this,"optionChange",this,I)},getOption:function(I){return this.options[I]},getDoc:function(){return this.doc},addKeyMap:function(I,B){this.state.keyMaps[B?"push":"unshift"](Ho(I))},removeKeyMap:function(I){for(var B=this.state.keyMaps,J=0;J<B.length;++J)if(B[J]==I||B[J].name==I)return B.splice(J,1),!0},addOverlay:vi(function(I,B){var J=I.token?I:e.getMode(this.options,I);if(J.startState)throw new Error("Overlays may not be stateful.");ne(this.state.overlays,{mode:J,modeSpec:I,opaque:B&&B.opaque,priority:B&&B.priority||0},function(se){return se.priority}),this.state.modeGen++,yn(this)}),removeOverlay:vi(function(I){for(var B=this.state.overlays,J=0;J<B.length;++J){var se=B[J].modeSpec;if(se==I||typeof I=="string"&&se.name==I){B.splice(J,1),this.state.modeGen++,yn(this);return}}}),indentLine:vi(function(I,B,J){typeof B!="string"&&typeof B!="number"&&(B==null?B=this.options.smartIndent?"smart":"prev":B=B?"add":"subtract"),un(this.doc,I)&&To(this,I,B,J)}),indentSelection:vi(function(I){for(var B=this.doc.sel.ranges,J=-1,se=0;se<B.length;se++){var fe=B[se];if(fe.empty())fe.head.line>J&&(To(this,fe.head.line,I,!0),J=fe.head.line,se==this.doc.sel.primIndex&&ya(this));else{var pe=fe.from(),xe=fe.to(),We=Math.max(J,pe.line);J=Math.min(this.lastLine(),xe.line-(xe.ch?0:1))+1;for(var Ve=We;Ve<J;++Ve)To(this,Ve,I);var ut=this.doc.sel.ranges;pe.ch==0&&B.length==ut.length&&ut[se].from().ch>0&&is(this.doc,se,new ln(pe,ut[se].to()),ve)}}}),getTokenAt:function(I,B){return Hr(this,I,B)},getLineTokens:function(I,B){return Hr(this,bt(I),B,!0)},getTokenTypeAt:function(I){I=K(this.doc,I);var B=pt(this,wt(this.doc,I.line)),J=0,se=(B.length-1)/2,fe=I.ch,pe;if(fe==0)pe=B[2];else for(;;){var xe=J+se>>1;if((xe?B[xe*2-1]:0)>=fe)se=xe;else if(B[xe*2+1]<fe)J=xe+1;else{pe=B[xe*2+2];break}}var We=pe?pe.indexOf("overlay "):-1;return We<0?pe:We==0?null:pe.slice(0,We-1)},getModeAt:function(I){var B=this.doc.mode;return B.innerMode?e.innerMode(B,this.getTokenAt(I).state).mode:B},getHelper:function(I,B){return this.getHelpers(I,B)[0]},getHelpers:function(I,B){var J=[];if(!D.hasOwnProperty(B))return J;var se=D[B],fe=this.getModeAt(I);if(typeof fe[B]=="string")se[fe[B]]&&J.push(se[fe[B]]);else if(fe[B])for(var pe=0;pe<fe[B].length;pe++){var xe=se[fe[B][pe]];xe&&J.push(xe)}else fe.helperType&&se[fe.helperType]?J.push(se[fe.helperType]):se[fe.name]&&J.push(se[fe.name]);for(var We=0;We<se._global.length;We++){var Ve=se._global[We];Ve.pred(fe,this)&&re(J,Ve.val)==-1&&J.push(Ve.val)}return J},getStateAfter:function(I,B){var J=this.doc;return I=le(J,I==null?J.first+J.size-1:I),Ot(this,I+1,B).state},cursorCoords:function(I,B){var J,se=this.doc.sel.primary();return I==null?J=se.head:typeof I=="object"?J=K(this.doc,I):J=I?se.from():se.to(),Br(this,J,B||"page")},charCoords:function(I,B){return Rn(this,K(this.doc,I),B||"page")},coordsChar:function(I,B){return I=Ur(this,I,B||"page"),Wr(this,I.left,I.top)},lineAtHeight:function(I,B){return I=Ur(this,{top:I,left:0},B||"page").top,Or(this.doc,I+this.display.viewOffset)},heightAtLine:function(I,B,J){var se=!1,fe;if(typeof I=="number"){var pe=this.doc.first+this.doc.size-1;I<this.doc.first?I=this.doc.first:I>pe&&(I=pe,se=!0),fe=wt(this.doc,I)}else fe=I;return Yr(this,fe,{top:0,left:0},B||"page",J||se).top+(se?this.doc.height-ci(fe):0)},defaultTextHeight:function(){return Wn(this.display)},defaultCharWidth:function(){return ri(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(I,B,J,se,fe){var pe=this.display;I=Br(this,K(this.doc,I));var xe=I.bottom,We=I.left;if(B.style.position="absolute",B.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(B),pe.sizer.appendChild(B),se=="over")xe=I.top;else if(se=="above"||se=="near"){var Ve=Math.max(pe.wrapper.clientHeight,this.doc.height),ut=Math.max(pe.sizer.clientWidth,pe.lineSpace.clientWidth);(se=="above"||I.bottom+B.offsetHeight>Ve)&&I.top>B.offsetHeight?xe=I.top-B.offsetHeight:I.bottom+B.offsetHeight<=Ve&&(xe=I.bottom),We+B.offsetWidth>ut&&(We=ut-B.offsetWidth)}B.style.top=xe+"px",B.style.left=B.style.right="",fe=="right"?(We=pe.sizer.clientWidth-B.offsetWidth,B.style.right="0px"):(fe=="left"?We=0:fe=="middle"&&(We=(pe.sizer.clientWidth-B.offsetWidth)/2),B.style.left=We+"px"),J&&Co(this,{left:We,top:xe,right:We+B.offsetWidth,bottom:xe+B.offsetHeight})},triggerOnKeyDown:vi(Qs),triggerOnKeyPress:vi(el),triggerOnKeyUp:Zs,triggerOnMouseDown:vi(tl),execCommand:function(I){if(_o.hasOwnProperty(I))return _o[I].call(null,this)},triggerElectric:vi(function(I){ll(this,I)}),findPosH:function(I,B,J,se){var fe=1;B<0&&(fe=-1,B=-B);for(var pe=K(this.doc,I),xe=0;xe<B&&!(pe=fs(this.doc,pe,fe,J,se),pe.hitSide);++xe);return pe},moveH:vi(function(I,B){var J=this;this.extendSelectionsBy(function(se){return J.display.shift||J.doc.extend||se.empty()?fs(J.doc,se.head,I,B,J.options.rtlMoveVisually):I<0?se.from():se.to()},De)}),deleteH:vi(function(I,B){var J=this.doc.sel,se=this.doc;J.somethingSelected()?se.replaceSelection("",null,"+delete"):$a(this,function(fe){var pe=fs(se,fe.head,I,B,!1);return I<0?{from:pe,to:fe.head}:{from:fe.head,to:pe}})}),findPosV:function(I,B,J,se){var fe=1,pe=se;B<0&&(fe=-1,B=-B);for(var xe=K(this.doc,I),We=0;We<B;++We){var Ve=Br(this,xe,"div");if(pe==null?pe=Ve.left:Ve.left=pe,xe=hl(this,Ve,fe,J),xe.hitSide)break}return xe},moveV:vi(function(I,B){var J=this,se=this.doc,fe=[],pe=!this.display.shift&&!se.extend&&se.sel.somethingSelected();if(se.extendSelectionsBy(function(We){if(pe)return I<0?We.from():We.to();var Ve=Br(J,We.head,"div");We.goalColumn!=null&&(Ve.left=We.goalColumn),fe.push(Ve.left);var ut=hl(J,Ve,I,B);return B=="page"&&We==se.sel.primary()&&no(J,Rn(J,ut,"div").top-Ve.top),ut},De),fe.length)for(var xe=0;xe<se.sel.ranges.length;xe++)se.sel.ranges[xe].goalColumn=fe[xe]}),findWordAt:function(I){var B=this.doc,J=wt(B,I.line).text,se=I.ch,fe=I.ch;if(J){var pe=this.getHelper(I,"wordChars");(I.sticky=="before"||fe==J.length)&&se?--se:++fe;for(var xe=J.charAt(se),We=Y(xe,pe)?function(Ve){return Y(Ve,pe)}:/\s/.test(xe)?function(Ve){return/\s/.test(Ve)}:function(Ve){return!/\s/.test(Ve)&&!Y(Ve)};se>0&&We(J.charAt(se-1));)--se;for(;fe<J.length&&We(J.charAt(fe));)++fe}return new ln(bt(I.line,se),bt(I.line,fe))},toggleOverwrite:function(I){if(I!=null&&I==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):g(this.display.cursorDiv,"CodeMirror-overwrite"),ze(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==V()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:vi(function(I,B){ba(this,I,B)}),getScrollInfo:function(){var I=this.display.scroller;return{left:I.scrollLeft,top:I.scrollTop,height:I.scrollHeight-Je(this)-this.display.barHeight,width:I.scrollWidth-Je(this)-this.display.barWidth,clientHeight:_e(this),clientWidth:Ue(this)}},scrollIntoView:vi(function(I,B){I==null?(I={from:this.doc.sel.primary().head,to:null},B==null&&(B=this.options.cursorScrollMargin)):typeof I=="number"?I={from:bt(I,0),to:null}:I.from==null&&(I={from:I,to:null}),I.to||(I.to=I.from),I.margin=B||0,I.from.line!=null?$o(this,I):Oa(this,I.from,I.to,I.margin)}),setSize:vi(function(I,B){var J=this,se=function(pe){return typeof pe=="number"||/^\d+$/.test(String(pe))?pe+"px":pe};I!=null&&(this.display.wrapper.style.width=se(I)),B!=null&&(this.display.wrapper.style.height=se(B)),this.options.lineWrapping&&_r(this);var fe=this.display.viewFrom;this.doc.iter(fe,this.display.viewTo,function(pe){if(pe.widgets){for(var xe=0;xe<pe.widgets.length;xe++)if(pe.widgets[xe].noHScroll){Mn(J,fe,"widget");break}}++fe}),this.curOp.forceUpdate=!0,ze(this,"refresh",this)}),operation:function(I){return Oi(this,I)},startOperation:function(){return oa(this)},endOperation:function(){return ha(this)},refresh:vi(function(){var I=this.display.cachedTextHeight;yn(this),this.curOp.forceUpdate=!0,Tr(this),ba(this,this.doc.scrollLeft,this.doc.scrollTop),Ba(this.display),(I==null||Math.abs(I-Wn(this.display))>.5||this.options.lineWrapping)&&Ci(this),ze(this,"refresh",this)}),swapDoc:vi(function(I){var B=this.doc;return B.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,I),Tr(this),this.display.input.reset(),ba(this,I.scrollLeft,I.scrollTop),this.curOp.forceScroll=!0,Rr(this,"swapDoc",this,B),B}),phrase:function(I){var B=this.options.phrases;return B&&Object.prototype.hasOwnProperty.call(B,I)?B[I]:I},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Me(e),e.registerHelper=function(I,B,J){D.hasOwnProperty(I)||(D[I]=e[I]={_global:[]}),D[I][B]=J},e.registerGlobalHelper=function(I,B,J,se){e.registerHelper(I,B,se),D[I]._global.push({pred:J,val:se})}}function fs(e,n,D,I,B){var J=n,se=D,fe=wt(e,n.line),pe=B&&e.direction=="rtl"?-D:D;function xe(){var Gt=n.line+pe;return Gt<e.first||Gt>=e.first+e.size?!1:(n=new bt(Gt,n.ch,n.sticky),fe=wt(e,Gt))}function We(Gt){var Nt;if(I=="codepoint"){var $t=fe.text.charCodeAt(n.ch+(I>0?0:-1));isNaN($t)?Nt=null:Nt=new bt(n.line,Math.max(0,Math.min(fe.text.length,n.ch+D*($t>=55296&&$t<56320?2:1))),-D)}else B?Nt=Pl(e.cm,fe,n,D):Nt=os(fe,n,D);if(Nt==null)if(!Gt&&xe())n=ss(B,e.cm,fe,n.line,pe);else return!1;else n=Nt;return!0}if(I=="char"||I=="codepoint")We();else if(I=="column")We(!0);else if(I=="word"||I=="group")for(var Ve=null,ut=I=="group",it=e.cm&&e.cm.getHelper(n,"wordChars"),gt=!0;!(D<0&&!We(!gt));gt=!1){var xt=fe.text.charAt(n.ch)||`
|
|
|
`,Rt=Y(xt,it)?"w":ut&&xt==`
|
|
|
`?"n":!ut||/\s/.test(xt)?null:"p";if(ut&&!gt&&!Rt&&(Rt="s"),Ve&&Ve!=Rt){D<0&&(D=1,We(),n.sticky="after");break}if(Rt&&(Ve=Rt),D>0&&!We(!gt))break}var Pt=Fo(e,n,J,se,!0);return Jr(J,Pt)&&(Pt.hitSide=!0),Pt}function hl(e,n,D,I){var B=e.doc,J=n.left,se;if(I=="page"){var fe=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),pe=Math.max(fe-.5*Wn(e.display),3);se=(D>0?n.bottom:n.top)+D*pe}else I=="line"&&(se=D>0?n.bottom+3:n.top-3);for(var xe;!(xe=Wr(e,J,se),!xe.outside);){if(D<0?se<=0:se>=B.height){xe.hitSide=!0;break}se+=D*5}return xe}var bn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};bn.prototype.init=function(e){var n=this,D=this,I=D.cm,B=D.div=e.lineDiv;cl(B,I.options.spellcheck,I.options.autocorrect,I.options.autocapitalize);function J(fe){for(var pe=fe.target;pe;pe=pe.parentNode){if(pe==B)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(pe.className))break}return!1}Ie(B,"paste",function(fe){if(!J(fe)||Ze(I,fe)||sl(fe,I))return;b<=11&&setTimeout(Kn(I,function(){return n.updateFromDOM()}),20)}),Ie(B,"compositionstart",function(fe){n.composing={data:fe.data,done:!1}}),Ie(B,"compositionupdate",function(fe){n.composing||(n.composing={data:fe.data,done:!1})}),Ie(B,"compositionend",function(fe){n.composing&&(fe.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Ie(B,"touchstart",function(){return D.forceCompositionEnd()}),Ie(B,"input",function(){n.composing||n.readFromDOMSoon()});function se(fe){if(!J(fe)||Ze(I,fe))return;if(I.somethingSelected())Go({lineWise:!1,text:I.getSelections()}),fe.type=="cut"&&I.replaceSelection("",null,"cut");else if(I.options.lineWiseCopyCut){var pe=ul(I);Go({lineWise:!0,text:pe.text}),fe.type=="cut"&&I.operation(function(){I.setSelections(pe.ranges,0,ve),I.replaceSelection("",null,"cut")})}else return;if(fe.clipboardData){fe.clipboardData.clearData();var xe=ea.text.join(`
|
|
|
`);if(fe.clipboardData.setData("Text",xe),fe.clipboardData.getData("Text")==xe){fe.preventDefault();return}}var We=dl(),Ve=We.firstChild;I.display.lineSpace.insertBefore(We,I.display.lineSpace.firstChild),Ve.value=ea.text.join(`
|
|
|
`);var ut=document.activeElement;G(Ve),setTimeout(function(){I.display.lineSpace.removeChild(We),ut.focus(),ut==B&&D.showPrimarySelection()},50)}Ie(B,"copy",se),Ie(B,"cut",se)},bn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},bn.prototype.prepareSelection=function(){var e=Ji(this.cm,!1);return e.focus=document.activeElement==this.div,e},bn.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},bn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},bn.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,D=n.doc.sel.primary(),I=D.from(),B=D.to();if(n.display.viewTo==n.display.viewFrom||I.line>=n.display.viewTo||B.line<n.display.viewFrom){e.removeAllRanges();return}var J=Ko(n,e.anchorNode,e.anchorOffset),se=Ko(n,e.focusNode,e.focusOffset);if(J&&!J.bad&&se&&!se.bad&&Bt(Sn(J,se),I)==0&&Bt(Ln(J,se),B)==0)return;var fe=n.display.view,pe=I.line>=n.display.viewFrom&&fl(n,I)||{node:fe[0].measure.map[2],offset:0},xe=B.line<n.display.viewTo&&fl(n,B);if(!xe){var We=fe[fe.length-1].measure,Ve=We.maps?We.maps[We.maps.length-1]:We.map;xe={node:Ve[Ve.length-1],offset:Ve[Ve.length-2]-Ve[Ve.length-3]}}if(!pe||!xe){e.removeAllRanges();return}var ut=e.rangeCount&&e.getRangeAt(0),it;try{it=L(pe.node,pe.offset,xe.offset,xe.node)}catch(gt){}it&&(!C&&n.state.focused?(e.collapse(pe.node,pe.offset),it.collapsed||(e.removeAllRanges(),e.addRange(it))):(e.removeAllRanges(),e.addRange(it)),ut&&e.anchorNode==null?e.addRange(ut):C&&this.startGracePeriod()),this.rememberSelection()},bn.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)},bn.prototype.showMultipleSelections=function(e){E(this.cm.display.cursorDiv,e.cursors),E(this.cm.display.selectionDiv,e.selection)},bn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},bn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return A(this.div,n)},bn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},bn.prototype.blur=function(){this.div.blur()},bn.prototype.getField=function(){return this.div},bn.prototype.supportsTouch=function(){return!0},bn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Oi(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function n(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},bn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},bn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),n=this.cm;if(c&&t&&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 D=Ko(n,e.anchorNode,e.anchorOffset),I=Ko(n,e.focusNode,e.focusOffset);D&&I&&Oi(n,function(){wi(n.doc,Zi(D,I),ve),(D.bad||I.bad)&&(n.curOp.selectionChanged=!0)})},bn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,D=e.doc.sel.primary(),I=D.from(),B=D.to();if(I.ch==0&&I.line>e.firstLine()&&(I=bt(I.line-1,wt(e.doc,I.line-1).length)),B.ch==wt(e.doc,B.line).text.length&&B.line<e.lastLine()&&(B=bt(B.line+1,0)),I.line<n.viewFrom||B.line>n.viewTo-1)return!1;var J,se,fe;I.line==n.viewFrom||(J=wn(e,I.line))==0?(se=Ut(n.view[0].line),fe=n.view[0].node):(se=Ut(n.view[J].line),fe=n.view[J-1].node.nextSibling);var pe=wn(e,B.line),xe,We;if(pe==n.view.length-1?(xe=n.viewTo-1,We=n.lineDiv.lastChild):(xe=Ut(n.view[pe+1].line)-1,We=n.view[pe+1].node.previousSibling),!fe)return!1;for(var Ve=e.doc.splitLines(ru(e,fe,We,se,xe)),ut=wr(e.doc,bt(se,0),bt(xe,wt(e.doc,xe).text.length));Ve.length>1&&ut.length>1;)if(ie(Ve)==ie(ut))Ve.pop(),ut.pop(),xe--;else if(Ve[0]==ut[0])Ve.shift(),ut.shift(),se++;else break;for(var it=0,gt=0,xt=Ve[0],Rt=ut[0],Pt=Math.min(xt.length,Rt.length);it<Pt&&xt.charCodeAt(it)==Rt.charCodeAt(it);)++it;for(var Gt=ie(Ve),Nt=ie(ut),$t=Math.min(Gt.length-(Ve.length==1?it:0),Nt.length-(ut.length==1?it:0));gt<$t&&Gt.charCodeAt(Gt.length-gt-1)==Nt.charCodeAt(Nt.length-gt-1);)++gt;if(Ve.length==1&&ut.length==1&&se==I.line)for(;it&&it>I.ch&&Gt.charCodeAt(Gt.length-gt-1)==Nt.charCodeAt(Nt.length-gt-1);)it--,gt++;Ve[Ve.length-1]=Gt.slice(0,Gt.length-gt).replace(/^\u200b+/,""),Ve[0]=Ve[0].slice(it).replace(/\u200b+$/,"");var dr=bt(se,it),ar=bt(xe,ut.length?ie(ut).length-gt:0);if(Ve.length>1||Ve[0]||Bt(dr,ar))return Va(e.doc,Ve,dr,ar,"+input"),!0},bn.prototype.ensurePolled=function(){this.forceCompositionEnd()},bn.prototype.reset=function(){this.forceCompositionEnd()},bn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},bn.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)},bn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Oi(this.cm,function(){return yn(e.cm)})},bn.prototype.setUneditable=function(e){e.contentEditable="false"},bn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Kn(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},bn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},bn.prototype.onContextMenu=function(){},bn.prototype.resetPosition=function(){},bn.prototype.needsContentAttribute=!0;function fl(e,n){var D=$e(e,n.line);if(!D||D.hidden)return null;var I=wt(e.doc,n.line),B=we(D,I,n.line),J=lt(I,e.doc.direction),se="left";if(J){var fe=qe(J,n.ch);se=fe%2?"right":"left"}var pe=St(B.map,n.ch,se);return pe.offset=pe.collapse=="right"?pe.end:pe.start,pe}function tu(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function Qa(e,n){return n&&(e.bad=!0),e}function ru(e,n,D,I,B){var J="",se=!1,fe=e.doc.lineSeparator(),pe=!1;function xe(it){return function(gt){return gt.id==it}}function We(){se&&(J+=fe,pe&&(J+=fe),se=pe=!1)}function Ve(it){it&&(We(),J+=it)}function ut(it){if(it.nodeType==1){var gt=it.getAttribute("cm-text");if(gt){Ve(gt);return}var xt=it.getAttribute("cm-marker"),Rt;if(xt){var Pt=e.findMarks(bt(I,0),bt(B+1,0),xe(+xt));Pt.length&&(Rt=Pt[0].find(0))&&Ve(wr(e.doc,Rt.from,Rt.to).join(fe));return}if(it.getAttribute("contenteditable")=="false")return;var Gt=/^(pre|div|p|li|table|br)$/i.test(it.nodeName);if(!/^br$/i.test(it.nodeName)&&it.textContent.length==0)return;Gt&&We();for(var Nt=0;Nt<it.childNodes.length;Nt++)ut(it.childNodes[Nt]);/^(pre|p)$/i.test(it.nodeName)&&(pe=!0),Gt&&(se=!0)}else it.nodeType==3&&Ve(it.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ut(n),n==D);)n=n.nextSibling,pe=!1;return J}function Ko(e,n,D){var I;if(n==e.display.lineDiv){if(I=e.display.lineDiv.childNodes[D],!I)return Qa(e.clipPos(bt(e.display.viewTo-1)),!0);n=null,D=0}else for(I=n;;I=I.parentNode){if(!I||I==e.display.lineDiv)return null;if(I.parentNode&&I.parentNode==e.display.lineDiv)break}for(var B=0;B<e.display.view.length;B++){var J=e.display.view[B];if(J.node==I)return nu(J,n,D)}}function nu(e,n,D){var I=e.text.firstChild,B=!1;if(!n||!A(I,n))return Qa(bt(Ut(e.line),0),!0);if(n==I&&(B=!0,n=I.childNodes[D],D=0,!n)){var J=e.rest?ie(e.rest):e.line;return Qa(bt(Ut(J),J.text.length),B)}var se=n.nodeType==3?n:null,fe=n;for(!se&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(se=n.firstChild,D&&(D=se.nodeValue.length));fe.parentNode!=I;)fe=fe.parentNode;var pe=e.measure,xe=pe.maps;function We(Rt,Pt,Gt){for(var Nt=-1;Nt<(xe?xe.length:0);Nt++)for(var $t=Nt<0?pe.map:xe[Nt],dr=0;dr<$t.length;dr+=3){var ar=$t[dr+2];if(ar==Rt||ar==Pt){var Pr=Ut(Nt<0?e.line:e.rest[Nt]),Tn=$t[dr]+Gt;return(Gt<0||ar!=Rt)&&(Tn=$t[dr+(Gt?1:0)]),bt(Pr,Tn)}}}var Ve=We(se,fe,D);if(Ve)return Qa(Ve,B);for(var ut=fe.nextSibling,it=se?se.nodeValue.length-D:0;ut;ut=ut.nextSibling){if(Ve=We(ut,ut.firstChild,0),Ve)return Qa(bt(Ve.line,Ve.ch-it),B);it+=ut.textContent.length}for(var gt=fe.previousSibling,xt=D;gt;gt=gt.previousSibling){if(Ve=We(gt,gt.firstChild,-1),Ve)return Qa(bt(Ve.line,Ve.ch+xt),B);xt+=gt.textContent.length}}var Xn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null};Xn.prototype.init=function(e){var n=this,D=this,I=this.cm;this.createField(e);var B=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),s&&(B.style.width="0px"),Ie(B,"input",function(){S&&b>=9&&n.hasSelection&&(n.hasSelection=null),D.poll()}),Ie(B,"paste",function(se){if(Ze(I,se)||sl(se,I))return;I.state.pasteIncoming=+new Date,D.fastPoll()});function J(se){if(Ze(I,se))return;if(I.somethingSelected())Go({lineWise:!1,text:I.getSelections()});else if(I.options.lineWiseCopyCut){var fe=ul(I);Go({lineWise:!0,text:fe.text}),se.type=="cut"?I.setSelections(fe.ranges,null,ve):(D.prevInput="",B.value=fe.text.join(`
|
|
|
`),G(B))}else return;se.type=="cut"&&(I.state.cutIncoming=+new Date)}Ie(B,"cut",J),Ie(B,"copy",J),Ie(e.scroller,"paste",function(se){if(Jn(e,se)||Ze(I,se))return;if(!B.dispatchEvent){I.state.pasteIncoming=+new Date,D.focus();return}var fe=new Event("paste");fe.clipboardData=se.clipboardData,B.dispatchEvent(fe)}),Ie(e.lineSpace,"selectstart",function(se){Jn(e,se)||Ee(se)}),Ie(B,"compositionstart",function(){var se=I.getCursor("from");D.composing&&D.composing.range.clear(),D.composing={start:se,range:I.markText(se,I.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(B,"compositionend",function(){D.composing&&(D.poll(),D.composing.range.clear(),D.composing=null)})},Xn.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},Xn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Xn.prototype.prepareSelection=function(){var e=this.cm,n=e.display,D=e.doc,I=Ji(e);if(e.options.moveInputWithCursor){var B=Br(e,D.sel.primary().head,"div"),J=n.wrapper.getBoundingClientRect(),se=n.lineDiv.getBoundingClientRect();I.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,B.top+se.top-J.top)),I.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,B.left+se.left-J.left))}return I},Xn.prototype.showSelection=function(e){var n=this.cm,D=n.display;E(D.cursorDiv,e.cursors),E(D.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var n=this.cm;if(n.somethingSelected()){this.prevInput="";var D=n.getSelection();this.textarea.value=D,n.state.focused&&G(this.textarea),S&&b>=9&&(this.hasSelection=D)}else e||(this.prevInput=this.textarea.value="",S&&b>=9&&(this.hasSelection=null))},Xn.prototype.getField=function(){return this.textarea},Xn.prototype.supportsTouch=function(){return!1},Xn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||V()!=this.textarea))try{this.textarea.focus()}catch(e){}},Xn.prototype.blur=function(){this.textarea.blur()},Xn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xn.prototype.receivedFocus=function(){this.slowPoll()},Xn.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()})},Xn.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function D(){var I=n.poll();!I&&!e?(e=!0,n.polling.set(60,D)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,D)},Xn.prototype.poll=function(){var e=this,n=this.cm,D=this.textarea,I=this.prevInput;if(this.contextMenuPending||!n.state.focused||_t(D)&&!I&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var B=D.value;if(B==I&&!n.somethingSelected())return!1;if(S&&b>=9&&this.hasSelection===B||u&&/[\uf700-\uf7ff]/.test(B))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var J=B.charCodeAt(0);if(J==8203&&!I&&(I="\u200B"),J==8666)return this.reset(),this.cm.execCommand("undo")}for(var se=0,fe=Math.min(I.length,B.length);se<fe&&I.charCodeAt(se)==B.charCodeAt(se);)++se;return Oi(n,function(){hs(n,B.slice(se),I.length-se,null,e.composing?"*compose":null),B.length>1e3||B.indexOf(`
|
|
|
`)>-1?D.value=e.prevInput="":e.prevInput=B,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xn.prototype.onKeyPress=function(){S&&b>=9&&(this.hasSelection=null),this.fastPoll()},Xn.prototype.onContextMenu=function(e){var n=this,D=n.cm,I=D.display,B=n.textarea;n.contextMenuPending&&n.contextMenuPending();var J=ni(D,e),se=I.scroller.scrollTop;if(!J||l)return;var fe=D.options.resetSelectionOnContextMenu;fe&&D.doc.sel.contains(J)==-1&&Kn(D,wi)(D.doc,Zi(J),ve);var pe=B.style.cssText,xe=n.wrapper.style.cssText,We=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",B.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(e.clientY-We.top-5)+"px; left: "+(e.clientX-We.left-5)+`px;
|
|
|
z-index: 1000; background: `+(S?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ve;p&&(Ve=window.scrollY),I.input.focus(),p&&window.scrollTo(null,Ve),I.input.reset(),D.somethingSelected()||(B.value=n.prevInput=" "),n.contextMenuPending=it,I.selForContextMenu=D.doc.sel,clearTimeout(I.detectingSelectAll);function ut(){if(B.selectionStart!=null){var xt=D.somethingSelected(),Rt="\u200B"+(xt?B.value:"");B.value="\u21DA",B.value=Rt,n.prevInput=xt?"":"\u200B",B.selectionStart=1,B.selectionEnd=Rt.length,I.selForContextMenu=D.doc.sel}}function it(){if(n.contextMenuPending!=it)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=xe,B.style.cssText=pe,S&&b<9&&I.scrollbars.setScrollTop(I.scroller.scrollTop=se),B.selectionStart!=null){(!S||S&&b<9)&&ut();var xt=0,Rt=function(){I.selForContextMenu==D.doc.sel&&B.selectionStart==0&&B.selectionEnd>0&&n.prevInput=="\u200B"?Kn(D,Is)(D):xt++<10?I.detectingSelectAll=setTimeout(Rt,500):(I.selForContextMenu=null,I.input.reset())};I.detectingSelectAll=setTimeout(Rt,200)}}if(S&&b>=9&&ut(),R){Fe(e);var gt=function(){ot(window,"mouseup",gt),setTimeout(it,20)};Ie(window,"mouseup",gt)}else setTimeout(it,50)},Xn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Xn.prototype.setUneditable=function(){},Xn.prototype.needsContentAttribute=!1;function iu(e,n){if(n=n?P(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var D=V();n.autofocus=D==e||e.getAttribute("autofocus")!=null&&D==document.body}function I(){e.value=fe.getValue()}var B;if(e.form&&(Ie(e.form,"submit",I),!n.leaveSubmitMethodAlone)){var J=e.form;B=J.submit;try{var se=J.submit=function(){I(),J.submit=B,J.submit(),J.submit=se}}catch(pe){}}n.finishInit=function(pe){pe.save=I,pe.getTextArea=function(){return e},pe.toTextArea=function(){pe.toTextArea=isNaN,I(),e.parentNode.removeChild(pe.getWrapperElement()),e.style.display="",e.form&&(ot(e.form,"submit",I),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=B))}},e.style.display="none";var fe=Pn(function(pe){return e.parentNode.insertBefore(pe,e.nextSibling)},n);return fe}function au(e){e.off=ot,e.on=Ie,e.wheelEventPixels=so,e.Doc=ki,e.splitLines=At,e.countColumn=H,e.findColumn=Te,e.isWordChar=q,e.Pass=ge,e.signal=ze,e.Line=di,e.changeEnd=qi,e.scrollbarModel=io,e.Pos=bt,e.cmpPos=Bt,e.modes=rr,e.mimeModes=Wt,e.resolveMode=dt,e.getMode=Et,e.modeExtensions=jt,e.extendMode=kt,e.copyState=hr,e.startState=Ct,e.innerMode=Nn,e.commands=_o,e.keyMap=ma,e.keyName=Vs,e.isModifierKey=Gs,e.lookupKey=Ya,e.normalizeKeyMap=Ml,e.StringStream=Dt,e.SharedTextMarker=vo,e.TextMarker=Ta,e.LineWidget=go,e.e_preventDefault=Ee,e.e_stopPropagation=Ce,e.e_stop=Fe,e.addClass=z,e.contains=A,e.rmClass=g,e.keyNames=Sa}Jl(Pn),eu(Pn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Vo in ki.prototype)ki.prototype.hasOwnProperty(Vo)&&re(ou,Vo)<0&&(Pn.prototype[Vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(ki.prototype[Vo]));return Me(ki),Pn.inputStyles={textarea:Xn,contenteditable:bn},Pn.defineMode=function(e){!Pn.defaults.mode&&e!="null"&&(Pn.defaults.mode=e),Lt.apply(this,arguments)},Pn.defineMIME=nr,Pn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Pn.defineMIME("text/plain","null"),Pn.defineExtension=function(e,n){Pn.prototype[e]=n},Pn.defineDocExtension=function(e,n){ki.prototype[e]=n},Pn.fromTextArea=iu,au(Pn),Pn.version="5.58.2",Pn})},WYAk:function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){(function(){var v=N,C=v.lib,k=C.Base,y=v.enc,m=y.Utf8,S=v.algo,b=S.HMAC=k.extend({init:function(p,d){p=this._hasher=new p.init,typeof d=="string"&&(d=m.parse(d));var t=p.blockSize,l=t*4;d.sigBytes>l&&(d=p.finalize(d)),d.clamp();for(var r=this._oKey=d.clone(),i=this._iKey=d.clone(),o=r.words,s=i.words,c=0;c<t;c++)o[c]^=1549556828,s[c]^=909522486;r.sigBytes=i.sigBytes=l,this.reset()},reset:function(){var p=this._hasher;p.reset(),p.update(this._iKey)},update:function(p){return this._hasher.update(p),this},finalize:function(p){var d=this._hasher,t=d.finalize(p);d.reset();var l=d.finalize(this._oKey.clone().concat(t));return l}})})()})},WaYH:function(F,Q,j){"use strict";var N=j("rePB"),v=j("Ff2n"),C=j("VTBJ"),k=j("1OyB"),y=j("vuIU"),m=j("JX7q"),S=j("Ji7U"),b=j("LK+K"),p=j("cDcd"),d=j("TSYQ"),t=j.n(d),l=j("sboe"),r=j("OZM5"),i=function(R){var O=R.prefixCls,g=R.level,x=R.isStart,E=R.isEnd;if(!g)return null;for(var T="".concat(O,"-indent-unit"),M=[],L=0;L<g;L+=1){var A;M.push(p.createElement("span",{key:L,className:t()(T,(A={},Object(N.a)(A,"".concat(T,"-start"),x[L+1]),Object(N.a)(A,"".concat(T,"-end"),E[L+1]),Object(N.a)(A,"".concat(T,"-end-first-level"),!L&&E[0]),A))}))}return p.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},M)},o=i,s=j("815F"),c="open",a="close",u="---",f=function(h){Object(S.a)(O,h);var R=Object(b.a)(O);function O(){var g;return Object(k.a)(this,O),g=R.apply(this,arguments),g.state={dragNodeHighlight:!1},g.onSelectorClick=function(x){var E=g.props.context.onNodeClick;E(x,Object(s.b)(g.props)),g.isSelectable()?g.onSelect(x):g.onCheck(x)},g.onSelectorDoubleClick=function(x){var E=g.props.context.onNodeDoubleClick;E(x,Object(s.b)(g.props))},g.onSelect=function(x){if(g.isDisabled())return;var E=g.props.context.onNodeSelect;x.preventDefault(),E(x,Object(s.b)(g.props))},g.onCheck=function(x){if(g.isDisabled())return;var E=g.props,T=E.disableCheckbox,M=E.checked,L=g.props.context.onNodeCheck;if(!g.isCheckable()||T)return;x.preventDefault();var A=!M;L(x,Object(s.b)(g.props),A)},g.onMouseEnter=function(x){var E=g.props.context.onNodeMouseEnter;E(x,Object(s.b)(g.props))},g.onMouseLeave=function(x){var E=g.props.context.onNodeMouseLeave;E(x,Object(s.b)(g.props))},g.onContextMenu=function(x){var E=g.props.context.onNodeContextMenu;E(x,Object(s.b)(g.props))},g.onDragStart=function(x){var E=g.props.context.onNodeDragStart;x.stopPropagation(),g.setState({dragNodeHighlight:!0}),E(x,Object(m.a)(g));try{x.dataTransfer.setData("text/plain","")}catch(T){}},g.onDragEnter=function(x){var E=g.props.context.onNodeDragEnter;x.preventDefault(),x.stopPropagation(),E(x,Object(m.a)(g))},g.onDragOver=function(x){var E=g.props.context.onNodeDragOver;x.preventDefault(),x.stopPropagation(),E(x,Object(m.a)(g))},g.onDragLeave=function(x){var E=g.props.context.onNodeDragLeave;x.stopPropagation(),E(x,Object(m.a)(g))},g.onDragEnd=function(x){var E=g.props.context.onNodeDragEnd;x.stopPropagation(),g.setState({dragNodeHighlight:!1}),E(x,Object(m.a)(g))},g.onDrop=function(x){var E=g.props.context.onNodeDrop;x.preventDefault(),x.stopPropagation(),g.setState({dragNodeHighlight:!1}),E(x,Object(m.a)(g))},g.onExpand=function(x){var E=g.props.context.onNodeExpand;E(x,Object(s.b)(g.props))},g.setSelectHandle=function(x){g.selectHandle=x},g.getNodeState=function(){var x=g.props.expanded;return g.isLeaf()?null:x?c:a},g.hasChildren=function(){var x=g.props.eventKey,E=g.props.context.keyEntities,T=E[x]||{},M=T.children;return!!(M||[]).length},g.isLeaf=function(){var x=g.props,E=x.isLeaf,T=x.loaded,M=g.props.context.loadData,L=g.hasChildren();return E===!1?!1:E||!M&&!L||M&&T&&!L},g.isDisabled=function(){var x=g.props.disabled,E=g.props.context.disabled;return!!(E||x)},g.isCheckable=function(){var x=g.props.checkable,E=g.props.context.checkable;return!E||x===!1?!1:E},g.syncLoadData=function(x){var E=x.expanded,T=x.loading,M=x.loaded,L=g.props.context,A=L.loadData,V=L.onNodeLoad;if(T)return;A&&E&&!g.isLeaf()&&(!g.hasChildren()&&!M&&V(Object(s.b)(g.props)))},g.renderSwitcher=function(){var x=g.props,E=x.expanded,T=x.switcherIcon,M=g.props.context,L=M.prefixCls,A=M.switcherIcon,V=T||A;if(g.isLeaf())return p.createElement("span",{className:t()("".concat(L,"-switcher"),"".concat(L,"-switcher-noop"))},typeof V=="function"?V(Object(C.a)(Object(C.a)({},g.props),{},{isLeaf:!0})):V);var z=t()("".concat(L,"-switcher"),"".concat(L,"-switcher_").concat(E?c:a));return p.createElement("span",{onClick:g.onExpand,className:z},typeof V=="function"?V(Object(C.a)(Object(C.a)({},g.props),{},{isLeaf:!1})):V)},g.renderCheckbox=function(){var x=g.props,E=x.checked,T=x.halfChecked,M=x.disableCheckbox,L=g.props.context.prefixCls,A=g.isDisabled(),V=g.isCheckable();if(!V)return null;var z=typeof V!="boolean"?V:null;return p.createElement("span",{className:t()("".concat(L,"-checkbox"),E&&"".concat(L,"-checkbox-checked"),!E&&T&&"".concat(L,"-checkbox-indeterminate"),(A||M)&&"".concat(L,"-checkbox-disabled")),onClick:g.onCheck},z)},g.renderIcon=function(){var x=g.props.loading,E=g.props.context.prefixCls;return p.createElement("span",{className:t()("".concat(E,"-iconEle"),"".concat(E,"-icon__").concat(g.getNodeState()||"docu"),x&&"".concat(E,"-icon_loading"))})},g.renderSelector=function(){var x=g.state.dragNodeHighlight,E=g.props,T=E.title,M=E.selected,L=E.icon,A=E.loading,V=E.data,z=g.props.context,W=z.prefixCls,G=z.showIcon,U=z.icon,P=z.draggable,H=z.loadData,$=z.titleRender,re=g.isDisabled(),te="".concat(W,"-node-content-wrapper"),ge;if(G){var ve=L||U;ge=ve?p.createElement("span",{className:t()("".concat(W,"-iconEle"),"".concat(W,"-icon__customize"))},typeof ve=="function"?ve(g.props):ve):g.renderIcon()}else H&&A&&(ge=g.renderIcon());var de;typeof T=="function"?de=T(V):$?de=$(V):de=T;var De=p.createElement("span",{className:"".concat(W,"-title")},de);return p.createElement("span",{ref:g.setSelectHandle,title:typeof T=="string"?T:"",className:t()("".concat(te),"".concat(te,"-").concat(g.getNodeState()||"normal"),!re&&(M||x)&&"".concat(W,"-node-selected"),!re&&P&&"draggable"),draggable:!re&&P||void 0,"aria-grabbed":!re&&P||void 0,onMouseEnter:g.onMouseEnter,onMouseLeave:g.onMouseLeave,onContextMenu:g.onContextMenu,onClick:g.onSelectorClick,onDoubleClick:g.onSelectorDoubleClick,onDragStart:P?g.onDragStart:void 0},ge,De)},g}return Object(y.a)(O,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var x=this.props.selectable,E=this.props.context.selectable;return typeof x=="boolean"?x:E}},{key:"render",value:function(){var x,E=this.props,T=E.eventKey,M=E.className,L=E.style,A=E.dragOver,V=E.dragOverGapTop,z=E.dragOverGapBottom,W=E.isLeaf,G=E.isStart,U=E.isEnd,P=E.expanded,H=E.selected,$=E.checked,re=E.halfChecked,te=E.loading,ge=E.domRef,ve=E.active,de=E.onMouseMove,De=Object(v.a)(E,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Te=this.props.context,he=Te.prefixCls,ue=Te.filterTreeNode,ie=Te.draggable,Se=Te.keyEntities,ne=this.isDisabled(),ce=Object(r.f)(De),Oe=Se[T]||{},oe=Oe.level,q=U[U.length-1];return p.createElement("div",Object.assign({ref:ge,className:t()(M,"".concat(he,"-treenode"),(x={},Object(N.a)(x,"".concat(he,"-treenode-disabled"),ne),Object(N.a)(x,"".concat(he,"-treenode-switcher-").concat(P?"open":"close"),!W),Object(N.a)(x,"".concat(he,"-treenode-checkbox-checked"),$),Object(N.a)(x,"".concat(he,"-treenode-checkbox-indeterminate"),re),Object(N.a)(x,"".concat(he,"-treenode-selected"),H),Object(N.a)(x,"".concat(he,"-treenode-loading"),te),Object(N.a)(x,"".concat(he,"-treenode-active"),ve),Object(N.a)(x,"".concat(he,"-treenode-leaf-last"),q),Object(N.a)(x,"drag-over",!ne&&A),Object(N.a)(x,"drag-over-gap-top",!ne&&V),Object(N.a)(x,"drag-over-gap-bottom",!ne&&z),Object(N.a)(x,"filter-node",ue&&ue(Object(s.b)(this.props))),x)),style:L,onDragEnter:ie?this.onDragEnter:void 0,onDragOver:ie?this.onDragOver:void 0,onDragLeave:ie?this.onDragLeave:void 0,onDrop:ie?this.onDrop:void 0,onDragEnd:ie?this.onDragEnd:void 0,onMouseMove:de},ce),p.createElement(o,{prefixCls:he,level:oe,isStart:G,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(p.Component),w=function(R){return p.createElement(l.a.Consumer,null,function(O){return p.createElement(f,Object.assign({},R,{context:O}))})};w.displayName="TreeNode",w.defaultProps={title:u},w.isTreeNode=1;var _=Q.a=w},XIdC:function(F,Q,j){"use strict";var N=j("rePB"),v=j("ODXe"),C=j("Ff2n"),k=j("cDcd"),y=j.n(k),m=j("TSYQ"),S=j.n(m),b=j("6cGi"),p=j("4IlW"),d=k.forwardRef(function(t,l){var r,i=t.prefixCls,o=i===void 0?"rc-switch":i,s=t.className,c=t.checked,a=t.defaultChecked,u=t.disabled,f=t.loadingIcon,w=t.checkedChildren,_=t.unCheckedChildren,h=t.onClick,R=t.onChange,O=t.onKeyDown,g=Object(C.a)(t,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),x=Object(b.a)(!1,{value:c,defaultValue:a}),E=Object(v.a)(x,2),T=E[0],M=E[1];function L(W,G){var U=T;return u||(U=W,M(U),R==null||R(U,G)),U}function A(W){W.which===p.a.LEFT?L(!1,W):W.which===p.a.RIGHT&&L(!0,W),O==null||O(W)}function V(W){var G=L(!T,W);h==null||h(G,W)}var z=S()(o,s,(r={},Object(N.a)(r,"".concat(o,"-checked"),T),Object(N.a)(r,"".concat(o,"-disabled"),u),r));return k.createElement("button",Object.assign({},g,{type:"button",role:"switch","aria-checked":T,disabled:u,className:z,ref:l,onKeyDown:A,onClick:V}),f,k.createElement("span",{className:"".concat(o,"-inner")},T?w:_))});d.displayName="Switch",Q.a=d},Y1PL:function(F,Q,j){"use strict";j.r(Q),j.d(Q,"ResizableTextArea",function(){return re});var N=j("wx14"),v=j("1OyB"),C=j("vuIU"),k=j("Ji7U"),y=j("LK+K"),m=j("cDcd"),S=j("VTBJ"),b=j("rePB"),p=j("Zm9Q"),d=j("Kwbf"),t=j("c+Xe"),l=j("m+aA"),r=j("bdgK"),i=new Map;function o(ve){ve.forEach(function(de){var De,Te=de.target;(De=i.get(Te))===null||De===void 0||De.forEach(function(he){return he(Te)})})}var s=new r.default(o),c=null,a=null;function u(ve,de){i.has(ve)||(i.set(ve,new Set),s.observe(ve)),i.get(ve).add(de)}function f(ve,de){i.has(ve)&&(i.get(ve).delete(de),i.get(ve).size||(s.unobserve(ve),i.delete(ve)))}var w=function(ve){Object(k.a)(De,ve);var de=Object(y.a)(De);function De(){return Object(v.a)(this,De),de.apply(this,arguments)}return Object(C.a)(De,[{key:"render",value:function(){return this.props.children}}]),De}(m.Component),_=m.createContext(null);function h(ve){var de=ve.children,De=ve.onBatchResize,Te=m.useRef(0),he=m.useRef([]),ue=m.useContext(_),ie=m.useCallback(function(Se,ne,ce){Te.current+=1;var Oe=Te.current;he.current.push({size:Se,element:ne,data:ce}),Promise.resolve().then(function(){Oe===Te.current&&(De==null||De(he.current),he.current=[])}),ue==null||ue(Se,ne,ce)},[De,ue]);return m.createElement(_.Provider,{value:ie},de)}function R(ve){var de=ve.children,De=ve.disabled,Te=m.useRef(null),he=m.useRef(null),ue=m.useContext(_),ie=m.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Se=m.isValidElement(de)&&Object(t.c)(de),ne=Se?de.ref:null,ce=m.useMemo(function(){return Object(t.a)(ne,Te)},[ne,Te]),Oe=m.useRef(ve);Oe.current=ve;var oe=m.useCallback(function(q){var Y=Oe.current,Z=Y.onResize,ye=Y.data,be=q.getBoundingClientRect(),Re=be.width,Qe=be.height,rt=q.offsetWidth,at=q.offsetHeight,qe=Math.floor(Re),st=Math.floor(Qe);if(ie.current.width!==qe||ie.current.height!==st||ie.current.offsetWidth!==rt||ie.current.offsetHeight!==at){var lt={width:qe,height:st,offsetWidth:rt,offsetHeight:at};ie.current=lt;var je=rt===Math.round(Re)?Re:rt,Ie=at===Math.round(Qe)?Qe:at,tt=Object(S.a)(Object(S.a)({},lt),{},{offsetWidth:je,offsetHeight:Ie});ue==null||ue(tt,q,ye),Z&&Promise.resolve().then(function(){Z(tt,q)})}},[]);return m.useEffect(function(){var q=Object(l.a)(Te.current)||Object(l.a)(he.current);return q&&!De&&u(q,oe),function(){return f(q,oe)}},[Te.current,De]),m.createElement(w,{ref:he},Se?m.cloneElement(de,{ref:ce}):de)}var O="rc-observer-key";function g(ve){var de=ve.children,De=Object(p.a)(de);return De.map(function(Te,he){var ue=(Te==null?void 0:Te.key)||"".concat(O,"-").concat(he);return m.createElement(R,Object(N.a)({},ve,{key:ue}),Te)})}g.Collection=h;var x=g,E=j("bT9E"),T=j("TSYQ"),M=j.n(T),L=`
|
|
|
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
|
|
|
`,A=["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"],V={},z;function W(ve){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,De=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(de&&V[De])return V[De];var Te=window.getComputedStyle(ve),he=Te.getPropertyValue("box-sizing")||Te.getPropertyValue("-moz-box-sizing")||Te.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(Te.getPropertyValue("padding-bottom"))+parseFloat(Te.getPropertyValue("padding-top")),ie=parseFloat(Te.getPropertyValue("border-bottom-width"))+parseFloat(Te.getPropertyValue("border-top-width")),Se=A.map(function(ce){return"".concat(ce,":").concat(Te.getPropertyValue(ce))}).join(";"),ne={sizingStyle:Se,paddingSize:ue,borderSize:ie,boxSizing:he};return de&&De&&(V[De]=ne),ne}function G(ve){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,De=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;z||(z=document.createElement("textarea"),z.setAttribute("tab-index","-1"),z.setAttribute("aria-hidden","true"),document.body.appendChild(z)),ve.getAttribute("wrap")?z.setAttribute("wrap",ve.getAttribute("wrap")):z.removeAttribute("wrap");var he=W(ve,de),ue=he.paddingSize,ie=he.borderSize,Se=he.boxSizing,ne=he.sizingStyle;z.setAttribute("style","".concat(ne,";").concat(L)),z.value=ve.value||ve.placeholder||"";var ce=Number.MIN_SAFE_INTEGER,Oe=Number.MAX_SAFE_INTEGER,oe=z.scrollHeight,q;if(Se==="border-box"?oe+=ie:Se==="content-box"&&(oe-=ue),De!==null||Te!==null){z.value=" ";var Y=z.scrollHeight-ue;De!==null&&(ce=Y*De,Se==="border-box"&&(ce=ce+ue+ie),oe=Math.max(ce,oe)),Te!==null&&(Oe=Y*Te,Se==="border-box"&&(Oe=Oe+ue+ie),q=oe>Oe?"":"hidden",oe=Math.min(Oe,oe))}return{height:oe,minHeight:ce,maxHeight:Oe,overflowY:q,resize:"none"}}var U=j("Gytx"),P=j.n(U),H;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(H||(H={}));var $=function(ve){Object(k.a)(De,ve);var de=Object(y.a)(De);function De(Te){var he;return Object(v.a)(this,De),he=de.call(this,Te),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(ue){he.textArea=ue},he.handleResize=function(ue){var ie=he.state.resizeStatus,Se=he.props,ne=Se.autoSize,ce=Se.onResize;if(ie!==H.NONE)return;typeof ce=="function"&&ce(ue),ne&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var ue=he.props.autoSize;if(!ue||!he.textArea)return;var ie=ue.minRows,Se=ue.maxRows,ne=G(he.textArea,!1,ie,Se);he.setState({textareaStyles:ne,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var ue=he.props,ie=ue.prefixCls,Se=ie===void 0?"rc-textarea":ie,ne=ue.autoSize,ce=ue.onResize,Oe=ue.className,oe=ue.disabled,q=he.state,Y=q.textareaStyles,Z=q.resizeStatus,ye=Object(E.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),be=M()(Se,Oe,Object(b.a)({},"".concat(Se,"-disabled"),oe));"value"in ye&&(ye.value=ye.value||"");var Re=Object(S.a)(Object(S.a)(Object(S.a)({},he.props.style),Y),Z===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return m.createElement(x,{onResize:he.handleResize,disabled:!(ne||ce)},m.createElement("textarea",Object(N.a)({},ye,{className:be,style:Re,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:H.NONE},he}return Object(C.a)(De,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!P()(he.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 he=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,ue)}}catch(ie){}}},{key:"render",value:function(){return this.renderTextArea()}}]),De}(m.Component),re=$,te=function(ve){Object(k.a)(De,ve);var de=Object(y.a)(De);function De(Te){var he;Object(v.a)(this,De),he=de.call(this,Te),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(ie){he.resizableTextArea=ie},he.handleChange=function(ie){var Se=he.props.onChange;he.setValue(ie.target.value,function(){he.resizableTextArea.resizeTextarea()}),Se&&Se(ie)},he.handleKeyDown=function(ie){var Se=he.props,ne=Se.onPressEnter,ce=Se.onKeyDown;ie.keyCode===13&&ne&&ne(ie),ce&&ce(ie)};var ue=typeof Te.value=="undefined"||Te.value===null?Te.defaultValue:Te.value;return he.state={value:ue},he}return Object(C.a)(De,[{key:"setValue",value:function(he,ue){"value"in this.props||this.setState({value:he},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return m.createElement(re,Object(N.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),De}(m.Component),ge=Q.default=te},ZD9Y:function(F,Q,j){"use strict";var N=j("BoS7"),v=j("Sdc0"),C=j("OaEy"),k=j("2fM7"),y=j("cDcd"),m=j.n(y),S=j("lOMy"),b=j.n(S),p=k.a.Option;Q.a=function(d){var t=d.onFontSizeChange,l=d.cmFontSize,r=d.cmCodeMode,i=d.onCodeModeChange,o=d.onTabToSpace,s=d.className,c=s===void 0?"":s,a=d.tabToSpace,u=d.children;return m.a.createElement("div",{className:"tpi-code-setting ".concat(c)},m.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),m.a.createElement("section",null,m.a.createElement("div",{className:"file-item"},m.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),m.a.createElement(k.a,{bordered:!1,size:"small",value:r,onChange:i},m.a.createElement(p,{value:"vs"},"\u767D\u8272\u80CC\u666F"),m.a.createElement(p,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),m.a.createElement("div",{className:"file-item"},m.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),m.a.createElement(k.a,{bordered:!1,size:"small",value:l,onChange:t},m.a.createElement(p,{value:12},"12px"),m.a.createElement(p,{value:14},"14px"),m.a.createElement(p,{value:16},"16px"),m.a.createElement(p,{value:18},"18px"),m.a.createElement(p,{value:20},"20px"),m.a.createElement(p,{value:22},"22px"))),m.a.createElement("div",{className:"file-item"},m.a.createElement("b",null,"Tab\u8F6C\u6362"),m.a.createElement(v.a,{checked:a,onChange:o}))),m.a.createElement("h3",null,"\u5FEB\u6377\u952E"),m.a.createElement("section",null,m.a.createElement("div",{className:"file-item"},m.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),m.a.createElement("span",null,"Ctrl + S")),m.a.createElement("div",{className:"file-item"},m.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),m.a.createElement("span",null,"F1 / Alt + F1")),m.a.createElement("div",{className:"file-item"},m.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),m.a.createElement("span",null,"Ctrl + ]/[")),m.a.createElement("div",{className:"file-item"},m.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),m.a.createElement("span",null,"Ctrl + Shift + \\")),m.a.createElement("div",{className:"file-item"},m.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),m.a.createElement("span",null,"Home")),m.a.createElement("div",{className:"file-item"},m.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),m.a.createElement("span",null,"End"))),u)}},ZW9T:function(F,Q,j){"use strict";j.d(Q,"a",function(){return G});var N=j("k1fw"),v=j("miYZ"),C=j("tsqr"),k=j("rAM+"),y=j("tJVT"),m=j("PpiC"),S=j("cDcd"),b=j.n(S),p=j("bdgK"),d=j("oBTY"),t=j("9og8"),l=j("WmNS"),r=j.n(l),i={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},s={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
|
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
|
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
|
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
|
|
|
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
|
|
|
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
|
|
|
`)},{label:"#include <string>",content:["#include <string>"].join(`
|
|
|
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
|
|
|
`)}]},c={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
|
`)}]},a=j("5VLF"),u=j.n(a),f={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},w=function(P,H){return H.map(function($){return{label:$,kind:P.languages.CompletionItemKind.Keyword,insertText:$}})},_=function(P){return Object.keys(f.tables).map(function(H){return{label:H,kind:P.languages.CompletionItemKind.Variable,insertText:H}})},h=function(P,H){var $=f.tables[P];return $?$.map(function(re){return{label:re,kind:H.languages.CompletionItemKind.Field,insertText:re}}):[]};function R(U,P,H,$,re){var te=P.getWordUntilPosition(H),ge={startLineNumber:H.lineNumber,endLineNumber:H.lineNumber,startColumn:te.startColumn,endColumn:te.endColumn},ve=$.map(function(de){return{label:de,kind:U.languages.CompletionItemKind.Keyword,insertText:de,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}});return re.map(function(de){ve.push(Object(N.a)(Object(N.a)({},de),{},{range:ge}))}),ve}var O=function(U){f.languages.map(function(re){return U.languages.registerDocumentFormattingEditProvider(re,{provideDocumentFormattingEdits:function(ge,ve,de){return Object(t.a)(r.a.mark(function De(){var Te;return r.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return Te=u()(ge.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ue.abrupt("return",[{range:ge.getFullModelRange(),text:Te}]);case 2:case"end":return ue.stop()}},De)}))()}}),re});var P=s.quickKey.map(function(re){return{label:re.label,kind:U.languages.CompletionItemKind.Method,insertText:re.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),H=c.quickKey.map(function(re){return{label:re.label,kind:U.languages.CompletionItemKind.Method,insertText:re.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=o.quickKey.map(function(re){return{label:re.label,kind:U.languages.CompletionItemKind.Method,insertText:re.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}});U.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(d.a)(s.keywords),Object(d.a)(s.quickKey.map(function(re){return re.label}))),provideCompletionItems:function(te,ge){var ve=te.getValueInRange({startLineNumber:ge.lineNumber,startColumn:1,endLineNumber:ge.lineNumber,endColumn:ge.column}),de=ve.match(/cu/gim);console.log("match:",de,ge,ve,te);var De=[],Te=ge.lineNumber,he=ge.column,ue=te.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:he}),ie=ue.trim().split(/\s+/),Se=ie[ie.length-1];if(Se.endsWith(".")){var ne=Se.slice(0,Se.length-1);Object.keys(f.tables).includes(ne)&&(De=Object(d.a)(h(ne,U)))}else Se==="."?De=[]:De=[].concat(Object(d.a)(_(U)),Object(d.a)(w(U,s.keywords)),Object(d.a)(P));return{suggestions:De}}}),U.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(d.a)(i.keywords)),provideCompletionItems:function(te,ge){var ve=te.getValueInRange({startLineNumber:ge.lineNumber,startColumn:1,endLineNumber:ge.lineNumber,endColumn:ge.column}),de=ve.match(/cu/gim);console.log("match:",de,ge,ve,te);var De=[],Te=ge.lineNumber,he=ge.column,ue=te.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:he}),ie=ue.trim().split(/\s+/),Se=ie[ie.length-1];if(Se.endsWith(".")){var ne=Se.slice(0,Se.length-1);Object.keys(f.tables).includes(ne)&&(De=Object(d.a)(h(ne,U)))}else Se==="."?De=[]:De=[].concat(Object(d.a)(_(U)),Object(d.a)(w(U,i.keywords)));return{suggestions:De}}}),U.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(d.a)(o.keywords)),provideCompletionItems:function(te,ge){var ve=[],de=ge.lineNumber,De=ge.column,Te=te.getValueInRange({startLineNumber:de,startColumn:0,endLineNumber:de,endColumn:De}),he=Te.trim().split(/\s+/),ue=he[he.length-1];if(ue.endsWith(".")){var ie=ue.slice(0,ue.length-1);Object.keys(f.tables).includes(ie)&&(ve=Object(d.a)(h(ie,U)))}else ue==="."?ve=[]:ve=[].concat(Object(d.a)(_(U)),Object(d.a)(w(U,o.keywords)),Object(d.a)($));return{suggestions:ve}}}),U.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(d.a)(c.keywords)),provideCompletionItems:function(te,ge){var ve=[],de=ge.lineNumber,De=ge.column,Te=te.getValueInRange({startLineNumber:de,startColumn:0,endLineNumber:de,endColumn:De}),he=Te.trim().split(/\s+/),ue=he[he.length-1];if(ue.endsWith(".")){var ie=ue.slice(0,ue.length-1);Object.keys(f.tables).includes(ie)&&(ve=Object(d.a)(h(ie,U)))}else ue==="."?ve=[]:ve=[].concat(Object(d.a)(_(U)),Object(d.a)(w(U,c.keywords)),Object(d.a)(H));return{suggestions:ve}}})},g="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",x=j("LvDl"),E=j("+ua5");function T(U){return/^\d+$/.test(U)?"".concat(U,"px"):U}function M(){}var L=!1,A={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function V(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],P=U;if(Array.isArray(U)){for(var H=0;H<U.length;H++){var $=A[U[H]];if($)return $}return P[0]}return A[P]||P}var z=null,W=Q.b=function(U){var P=U.width,H=P===void 0?"100%":P,$=U.height,re=$===void 0?"100%":$,te=U.value,ge=U.language,ve=ge===void 0?"javascript":ge,de=U.style,De=de===void 0?{}:de,Te=U.options,he=Te===void 0?{}:Te,ue=U.overrideServices,ie=ue===void 0?{}:ue,Se=U.theme,ne=Se===void 0?"vs-dark":Se,ce=U.onEditBlur,Oe=U.onSave,oe=U.autoHeight,q=oe===void 0?!1:oe,Y=U.forbidCopy,Z=Y===void 0?!1:Y,ye=U.onChange,be=ye===void 0?M:ye,Re=U.editorDidMount,Qe=Re===void 0?M:Re,rt=U.onFocus,at=rt===void 0?M:rt,qe=U.filename,st=qe===void 0?"educoder.txt":qe,lt=U.errorLine,je=U.errorContent,Ie=je===void 0?"":je,tt=Object(m.a)(U,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ot=Object(S.useRef)(),ze=Object(S.useRef)({}),Ze=Object(S.useRef)(),Ne=Object(S.useRef)(!1),Ae=Object(S.useRef)(),Me=Object(S.useState)(!1),Ee=Object(y.a)(Me,2),Ce=Ee[0],ke=Ee[1];function Fe(){var dt;return ot.current&&(dt=new p.default(function(Et){var jt=Object(k.a)(Et),kt;try{for(jt.s();!(kt=jt.n()).done;){var hr=kt.value;(hr.target.offsetHeight>0||hr.target.offsetWidth>0)&&ze.current.instance.layout()}}catch(Nn){jt.e(Nn)}finally{jt.f()}}),dt.observe(ot.current)),dt}function Be(){C.b.warn(decodeURIComponent(g))}var et=function(){var Et=ze.current.instance;if(te!=null&&Et&&Ce){var jt=Et.getModel();jt&&te!==jt.getValue()&&(L=!0,jt.setValue(te),Et.layout(),L=!1)}};Object(S.useEffect)(function(){Ze.current&&clearTimeout(Ze.current),Ze.current=setTimeout(function(){et()},500)},[te,Ce,ze.current]),Object(S.useEffect)(function(){if(lt&&ze.current&&ze.current.instance){var dt=ze.current.instance;dt.changeViewZones(function(jt){var kt=document.createElement("div");kt.style.padding="10px 20px",kt.style.width="calc(100% - 20px)",kt.className="my-error-line-wrp",kt.innerHTML=Ie,jt.addZone({afterLineNumber:lt||11,heightInLines:3,domNode:kt})});var Et={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};dt.addOverlayWidget(Et),dt.revealPositionInCenter({lineNumber:20,column:1})}},[lt,ze.current,Ce]);function ct(){var dt=ze.current.instance;if(dt){var Et=dt.getSelection(),jt=ze.current.pastePos||{},kt=new z.Range(jt.startLineNumber||Et.endLineNumber,jt.startColumn||Et.endColumn,jt.endLineNumber||Et.endLineNumber,jt.endColumn||Et.endColumn);setTimeout(function(){dt.executeEdits("",[{range:kt,text:""}])},300)}}function yt(dt){(window.navigator.platform.match("Mac")?dt.metaKey:dt.ctrlKey)&&dt.keyCode==83&&(dt.preventDefault(),Oe())}var ft=function(){if(q&&ze.current.instance){var Et=ze.current.instance.getContentHeight();Lt(Et<re?re:Et)}else Lt(re)};function mt(dt){var Et=document.createEvent("MouseEvents");Et.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),dt.dispatchEvent(Et)}function It(dt,Et){var jt=window.URL||window.webkitURL||window,kt=new Blob([Et]),hr=document.createElementNS("http://www.w3.org/1999/xhtml","a");hr.href=jt.createObjectURL(kt),hr.download=dt,mt(hr)}Object(S.useEffect)(function(){ft()},[ft]),Object(S.useEffect)(function(){ot.current&&!Ce&&j.e(27).then(j.t.bind(null,"M/lh",7)).then(function(dt){try{z=dt,ze.current.instance=z.editor.create(ot.current,{value:te,language:V(ve),theme:ne,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},ie);var Et=ze.current.instance;if(Qe(Et,z),setTimeout(function(){ft(),ze.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){It(st||"educoder.txt",Et.getValue())}})},500),ze.current.subscription=Et.onDidChangeModelContent(function(kt){Ne.current?clearTimeout(Ae.current):(ft(),be(Et.getValue(),kt)),Ae.current=setTimeout(function(){Ne.current=!1},500)}),window.Monaco||O(z),Z&&(Et.addCommand(z.KeyMod.CtrlCmd|z.KeyMod.Shift|z.KeyCode.KEY_V,function(){return Be(),null}),Et.addCommand(z.KeyMod.CtrlCmd|z.KeyCode.KEY_C,function(){return Be(),null})),window.Monaco=z,ce&&Et.onDidBlurEditorWidget(function(){ce(Et.getValue())}),at&&Et.onDidFocusEditorText(function(){at(Et.getValue())}),Z){Et.addCommand(z.KeyMod.CtrlCmd|z.KeyCode.KEY_V,function(){return Be(),null}),Et.onDidPaste(function(kt){ze.current.pastePos=kt});try{window.addEventListener("paste",ct)}catch(kt){}}var jt=Fe();return ke(!0),function(){var kt=ze.current.instance;kt.dispose();var hr=kt.getModel();hr&&hr.dispose(),ze.current.subscription&&ze.current.subscription.dispose(),Z&&window.removeEventListener("paste",ct),jt.unobserve(ot.current)}}catch(kt){}})},[]),Object(S.useEffect)(function(){var dt=ze.current.instance;if(dt&&Ce)return document.addEventListener("keydown",yt,!1),function(){document.removeEventListener("keydown",yt)}},[Oe,Ce]),Object(S.useEffect)(function(){var dt=ze.current.instance;if(dt&&Ce){var Et=V(ve);z.editor.setModelLanguage(dt.getModel(),Et),console.log("language:",ve,dt.getModel(),Et)}},[ve,Ce]),Object(S.useEffect)(function(){var dt=ze.current.instance;dt&&Ce&&z.editor.setTheme(ne)},[ne,Ce]),Object(S.useEffect)(function(){var dt=ze.current.instance;dt&&Ce&&(dt.updateOptions(Object(N.a)({},he)),setTimeout(function(){dt.getModel().updateOptions(Object(N.a)({},he))},200))},[JSON.stringify(he),Ce]),Object(S.useEffect)(function(){var dt=ze.current.instance;dt&&Ce&&dt.layout()},[H,re,Ce]);var At=Object(S.useState)(T(H)),_t=Object(y.a)(At,2),Vt=_t[0],Kt=_t[1],tr=Object(S.useState)(T(re)),rr=Object(y.a)(tr,2),Wt=rr[0],Lt=rr[1],nr=Object(N.a)(Object(N.a)({},De),{},{width:Vt,height:Wt});return b.a.createElement("div",{className:"my-monaco-editor",ref:ot,style:nr})};function G(U){var P=U.width,H=P===void 0?"100%":P,$=U.height,re=$===void 0?"100%":$,te=U.original,ge=U.modified,ve=U.language,de=U.options,De=de===void 0?{}:de,Te=Object(S.useRef)(),he=Object(S.useState)(null),ue=Object(y.a)(he,2),ie=ue[0],Se=ue[1];function ne(q){var Y;return Te.current&&(Y=new p.default(function(Z){var ye=Object(k.a)(Z),be;try{for(ye.s();!(be=ye.n()).done;){var Re=be.value;(Re.target.offsetHeight>0||Re.target.offsetWidth>0)&&q.layout()}}catch(Qe){ye.e(Qe)}finally{ye.f()}}),Y.observe(Te.current)),Y}Object(S.useEffect)(function(){Te.current&&j.e(27).then(j.t.bind(null,"M/lh",7)).then(function(q){z=q;var Y=z.editor.createDiffEditor(Te.current,Object(N.a)(Object(N.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},De),{},{wordWrap:!0}));Se(Y);var Z=ne(Y);return function(){Y.dispose();var ye=Y.getModel();ye&&ye.dispose(),Z.unobserve(Te.current)}})},[]),Object(S.useEffect)(function(){ie&&ie.setModel({original:z.editor.createModel(te,ve),modified:z.editor.createModel(ge,ve)})},[te,ge,ve,ie]);var ce=T(H),Oe=T(re),oe={width:ce,height:Oe};return b.a.createElement("div",{className:"my-diff-editor",ref:Te,style:oe})}},ZpRC:function(F,Q,j){"use strict";function N(t){return typeof t=="object"&&t!=null&&t.nodeType===1}function v(t,l){return(!l||t!=="hidden")&&t!=="visible"&&t!=="clip"}function C(t,l){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return v(r.overflowY,l)||v(r.overflowX,l)||function(i){var o=function(s){if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch(c){return null}}(i);return!!o&&(o.clientHeight<i.scrollHeight||o.clientWidth<i.scrollWidth)}(t)}return!1}function k(t,l,r,i,o,s,c,a){return s<t&&c>l||s>t&&c<l?0:s<=t&&a<=r||c>=l&&a>=r?s-t-i:c>l&&a<r||s<t&&a>r?c-l+o:0}var y=function(t,l){var r=window,i=l.scrollMode,o=l.block,s=l.inline,c=l.boundary,a=l.skipOverflowHiddenElements,u=typeof c=="function"?c:function(Y){return Y!==c};if(!N(t))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,w=[],_=t;N(_)&&u(_);){if((_=_.parentElement)===f){w.push(_);break}_!=null&&_===document.body&&C(_)&&!C(document.documentElement)||_!=null&&C(_,a)&&w.push(_)}for(var h=r.visualViewport?r.visualViewport.width:innerWidth,R=r.visualViewport?r.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,x=t.getBoundingClientRect(),E=x.height,T=x.width,M=x.top,L=x.right,A=x.bottom,V=x.left,z=o==="start"||o==="nearest"?M:o==="end"?A:M+E/2,W=s==="center"?V+T/2:s==="end"?L:V,G=[],U=0;U<w.length;U++){var P=w[U],H=P.getBoundingClientRect(),$=H.height,re=H.width,te=H.top,ge=H.right,ve=H.bottom,de=H.left;if(i==="if-needed"&&M>=0&&V>=0&&A<=R&&L<=h&&M>=te&&A<=ve&&V>=de&&L<=ge)return G;var De=getComputedStyle(P),Te=parseInt(De.borderLeftWidth,10),he=parseInt(De.borderTopWidth,10),ue=parseInt(De.borderRightWidth,10),ie=parseInt(De.borderBottomWidth,10),Se=0,ne=0,ce="offsetWidth"in P?P.offsetWidth-P.clientWidth-Te-ue:0,Oe="offsetHeight"in P?P.offsetHeight-P.clientHeight-he-ie:0;if(f===P)Se=o==="start"?z:o==="end"?z-R:o==="nearest"?k(g,g+R,R,he,ie,g+z,g+z+E,E):z-R/2,ne=s==="start"?W:s==="center"?W-h/2:s==="end"?W-h:k(O,O+h,h,Te,ue,O+W,O+W+T,T),Se=Math.max(0,Se+g),ne=Math.max(0,ne+O);else{Se=o==="start"?z-te-he:o==="end"?z-ve+ie+Oe:o==="nearest"?k(te,ve,$,he,ie+Oe,z,z+E,E):z-(te+$/2)+Oe/2,ne=s==="start"?W-de-Te:s==="center"?W-(de+re/2)+ce/2:s==="end"?W-ge+ue+ce:k(de,ge,re,Te,ue+ce,W,W+T,T);var oe=P.scrollLeft,q=P.scrollTop;z+=q-(Se=Math.max(0,Math.min(q+Se,P.scrollHeight-$+Oe))),W+=oe-(ne=Math.max(0,Math.min(oe+ne,P.scrollWidth-re+ce)))}G.push({el:P,top:Se,left:ne})}return G};function m(t){return t===Object(t)&&Object.keys(t).length!==0}function S(t,l){l===void 0&&(l="auto");var r="scrollBehavior"in document.body.style;t.forEach(function(i){var o=i.el,s=i.top,c=i.left;o.scroll&&r?o.scroll({top:s,left:c,behavior:l}):(o.scrollTop=s,o.scrollLeft=c)})}function b(t){return t===!1?{block:"end",inline:"nearest"}:m(t)?t:{block:"start",inline:"nearest"}}function p(t,l){var r=!t.ownerDocument.documentElement.contains(t);if(m(l)&&typeof l.behavior=="function")return l.behavior(r?[]:y(t,l));if(r)return;var i=b(l);return S(y(t,i),i.behavior)}var d=Q.a=p},Zss7:function(F,Q,j){var N;(function(v){var C=/^\s+/,k=/\s+$/,y=0,m=v.round,S=v.min,b=v.max,p=v.random;function d(ie,Se){if(ie=ie||"",Se=Se||{},ie instanceof d)return ie;if(!(this instanceof d))return new d(ie,Se);var ne=t(ie);this._originalInput=ie,this._r=ne.r,this._g=ne.g,this._b=ne.b,this._a=ne.a,this._roundA=m(100*this._a)/100,this._format=Se.format||ne.format,this._gradientType=Se.gradientType,this._r<1&&(this._r=m(this._r)),this._g<1&&(this._g=m(this._g)),this._b<1&&(this._b=m(this._b)),this._ok=ne.ok,this._tc_id=y++}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ie=this.toRgb();return(ie.r*299+ie.g*587+ie.b*114)/1e3},getLuminance:function(){var ie=this.toRgb(),Se,ne,ce,Oe,oe,q;return Se=ie.r/255,ne=ie.g/255,ce=ie.b/255,Se<=.03928?Oe=Se/12.92:Oe=v.pow((Se+.055)/1.055,2.4),ne<=.03928?oe=ne/12.92:oe=v.pow((ne+.055)/1.055,2.4),ce<=.03928?q=ce/12.92:q=v.pow((ce+.055)/1.055,2.4),.2126*Oe+.7152*oe+.0722*q},setAlpha:function(ie){return this._a=G(ie),this._roundA=m(100*this._a)/100,this},toHsv:function(){var ie=o(this._r,this._g,this._b);return{h:ie.h*360,s:ie.s,v:ie.v,a:this._a}},toHsvString:function(){var ie=o(this._r,this._g,this._b),Se=m(ie.h*360),ne=m(ie.s*100),ce=m(ie.v*100);return this._a==1?"hsv("+Se+", "+ne+"%, "+ce+"%)":"hsva("+Se+", "+ne+"%, "+ce+"%, "+this._roundA+")"},toHsl:function(){var ie=r(this._r,this._g,this._b);return{h:ie.h*360,s:ie.s,l:ie.l,a:this._a}},toHslString:function(){var ie=r(this._r,this._g,this._b),Se=m(ie.h*360),ne=m(ie.s*100),ce=m(ie.l*100);return this._a==1?"hsl("+Se+", "+ne+"%, "+ce+"%)":"hsla("+Se+", "+ne+"%, "+ce+"%, "+this._roundA+")"},toHex:function(ie){return c(this._r,this._g,this._b,ie)},toHexString:function(ie){return"#"+this.toHex(ie)},toHex8:function(ie){return a(this._r,this._g,this._b,this._a,ie)},toHex8String:function(ie){return"#"+this.toHex8(ie)},toRgb:function(){return{r:m(this._r),g:m(this._g),b:m(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+m(this._r)+", "+m(this._g)+", "+m(this._b)+")":"rgba("+m(this._r)+", "+m(this._g)+", "+m(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:m(U(this._r,255)*100)+"%",g:m(U(this._g,255)*100)+"%",b:m(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+m(U(this._r,255)*100)+"%, "+m(U(this._g,255)*100)+"%, "+m(U(this._b,255)*100)+"%)":"rgba("+m(U(this._r,255)*100)+"%, "+m(U(this._g,255)*100)+"%, "+m(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:z[c(this._r,this._g,this._b,!0)]||!1},toFilter:function(ie){var Se="#"+u(this._r,this._g,this._b,this._a),ne=Se,ce=this._gradientType?"GradientType = 1, ":"";if(ie){var Oe=d(ie);ne="#"+u(Oe._r,Oe._g,Oe._b,Oe._a)}return"progid:DXImageTransform.Microsoft.gradient("+ce+"startColorstr="+Se+",endColorstr="+ne+")"},toString:function(ie){var Se=!!ie;ie=ie||this._format;var ne=!1,ce=this._a<1&&this._a>=0,Oe=!Se&&ce&&(ie==="hex"||ie==="hex6"||ie==="hex3"||ie==="hex4"||ie==="hex8"||ie==="name");return Oe?ie==="name"&&this._a===0?this.toName():this.toRgbString():(ie==="rgb"&&(ne=this.toRgbString()),ie==="prgb"&&(ne=this.toPercentageRgbString()),(ie==="hex"||ie==="hex6")&&(ne=this.toHexString()),ie==="hex3"&&(ne=this.toHexString(!0)),ie==="hex4"&&(ne=this.toHex8String(!0)),ie==="hex8"&&(ne=this.toHex8String()),ie==="name"&&(ne=this.toName()),ie==="hsl"&&(ne=this.toHslString()),ie==="hsv"&&(ne=this.toHsvString()),ne||this.toHexString())},clone:function(){return d(this.toString())},_applyModification:function(ie,Se){var ne=ie.apply(null,[this].concat([].slice.call(Se)));return this._r=ne._r,this._g=ne._g,this._b=ne._b,this.setAlpha(ne._a),this},lighten:function(){return this._applyModification(h,arguments)},brighten:function(){return this._applyModification(R,arguments)},darken:function(){return this._applyModification(O,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(_,arguments)},spin:function(){return this._applyModification(g,arguments)},_applyCombination:function(ie,Se){return ie.apply(null,[this].concat([].slice.call(Se)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(x,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(E,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},d.fromRatio=function(ie,Se){if(typeof ie=="object"){var ne={};for(var ce in ie)ie.hasOwnProperty(ce)&&(ce==="a"?ne[ce]=ie[ce]:ne[ce]=ge(ie[ce]));ie=ne}return d(ie,Se)};function t(ie){var Se={r:0,g:0,b:0},ne=1,ce=null,Oe=null,oe=null,q=!1,Y=!1;return typeof ie=="string"&&(ie=he(ie)),typeof ie=="object"&&(Te(ie.r)&&Te(ie.g)&&Te(ie.b)?(Se=l(ie.r,ie.g,ie.b),q=!0,Y=String(ie.r).substr(-1)==="%"?"prgb":"rgb"):Te(ie.h)&&Te(ie.s)&&Te(ie.v)?(ce=ge(ie.s),Oe=ge(ie.v),Se=s(ie.h,ce,Oe),q=!0,Y="hsv"):Te(ie.h)&&Te(ie.s)&&Te(ie.l)&&(ce=ge(ie.s),oe=ge(ie.l),Se=i(ie.h,ce,oe),q=!0,Y="hsl"),ie.hasOwnProperty("a")&&(ne=ie.a)),ne=G(ne),{ok:q,format:ie.format||Y,r:S(255,b(Se.r,0)),g:S(255,b(Se.g,0)),b:S(255,b(Se.b,0)),a:ne}}function l(ie,Se,ne){return{r:U(ie,255)*255,g:U(Se,255)*255,b:U(ne,255)*255}}function r(ie,Se,ne){ie=U(ie,255),Se=U(Se,255),ne=U(ne,255);var ce=b(ie,Se,ne),Oe=S(ie,Se,ne),oe,q,Y=(ce+Oe)/2;if(ce==Oe)oe=q=0;else{var Z=ce-Oe;q=Y>.5?Z/(2-ce-Oe):Z/(ce+Oe);switch(ce){case ie:oe=(Se-ne)/Z+(Se<ne?6:0);break;case Se:oe=(ne-ie)/Z+2;break;case ne:oe=(ie-Se)/Z+4;break}oe/=6}return{h:oe,s:q,l:Y}}function i(ie,Se,ne){var ce,Oe,oe;ie=U(ie,360),Se=U(Se,100),ne=U(ne,100);function q(ye,be,Re){return Re<0&&(Re+=1),Re>1&&(Re-=1),Re<1/6?ye+(be-ye)*6*Re:Re<1/2?be:Re<2/3?ye+(be-ye)*(2/3-Re)*6:ye}if(Se===0)ce=Oe=oe=ne;else{var Y=ne<.5?ne*(1+Se):ne+Se-ne*Se,Z=2*ne-Y;ce=q(Z,Y,ie+1/3),Oe=q(Z,Y,ie),oe=q(Z,Y,ie-1/3)}return{r:ce*255,g:Oe*255,b:oe*255}}function o(ie,Se,ne){ie=U(ie,255),Se=U(Se,255),ne=U(ne,255);var ce=b(ie,Se,ne),Oe=S(ie,Se,ne),oe,q,Y=ce,Z=ce-Oe;if(q=ce===0?0:Z/ce,ce==Oe)oe=0;else{switch(ce){case ie:oe=(Se-ne)/Z+(Se<ne?6:0);break;case Se:oe=(ne-ie)/Z+2;break;case ne:oe=(ie-Se)/Z+4;break}oe/=6}return{h:oe,s:q,v:Y}}function s(ie,Se,ne){ie=U(ie,360)*6,Se=U(Se,100),ne=U(ne,100);var ce=v.floor(ie),Oe=ie-ce,oe=ne*(1-Se),q=ne*(1-Oe*Se),Y=ne*(1-(1-Oe)*Se),Z=ce%6,ye=[ne,q,oe,oe,Y,ne][Z],be=[Y,ne,ne,q,oe,oe][Z],Re=[oe,oe,Y,ne,ne,q][Z];return{r:ye*255,g:be*255,b:Re*255}}function c(ie,Se,ne,ce){var Oe=[te(m(ie).toString(16)),te(m(Se).toString(16)),te(m(ne).toString(16))];return ce&&Oe[0].charAt(0)==Oe[0].charAt(1)&&Oe[1].charAt(0)==Oe[1].charAt(1)&&Oe[2].charAt(0)==Oe[2].charAt(1)?Oe[0].charAt(0)+Oe[1].charAt(0)+Oe[2].charAt(0):Oe.join("")}function a(ie,Se,ne,ce,Oe){var oe=[te(m(ie).toString(16)),te(m(Se).toString(16)),te(m(ne).toString(16)),te(ve(ce))];return Oe&&oe[0].charAt(0)==oe[0].charAt(1)&&oe[1].charAt(0)==oe[1].charAt(1)&&oe[2].charAt(0)==oe[2].charAt(1)&&oe[3].charAt(0)==oe[3].charAt(1)?oe[0].charAt(0)+oe[1].charAt(0)+oe[2].charAt(0)+oe[3].charAt(0):oe.join("")}function u(ie,Se,ne,ce){var Oe=[te(ve(ce)),te(m(ie).toString(16)),te(m(Se).toString(16)),te(m(ne).toString(16))];return Oe.join("")}d.equals=function(ie,Se){return!ie||!Se?!1:d(ie).toRgbString()==d(Se).toRgbString()},d.random=function(){return d.fromRatio({r:p(),g:p(),b:p()})};function f(ie,Se){Se=Se===0?0:Se||10;var ne=d(ie).toHsl();return ne.s-=Se/100,ne.s=P(ne.s),d(ne)}function w(ie,Se){Se=Se===0?0:Se||10;var ne=d(ie).toHsl();return ne.s+=Se/100,ne.s=P(ne.s),d(ne)}function _(ie){return d(ie).desaturate(100)}function h(ie,Se){Se=Se===0?0:Se||10;var ne=d(ie).toHsl();return ne.l+=Se/100,ne.l=P(ne.l),d(ne)}function R(ie,Se){Se=Se===0?0:Se||10;var ne=d(ie).toRgb();return ne.r=b(0,S(255,ne.r-m(255*-(Se/100)))),ne.g=b(0,S(255,ne.g-m(255*-(Se/100)))),ne.b=b(0,S(255,ne.b-m(255*-(Se/100)))),d(ne)}function O(ie,Se){Se=Se===0?0:Se||10;var ne=d(ie).toHsl();return ne.l-=Se/100,ne.l=P(ne.l),d(ne)}function g(ie,Se){var ne=d(ie).toHsl(),ce=(ne.h+Se)%360;return ne.h=ce<0?360+ce:ce,d(ne)}function x(ie){var Se=d(ie).toHsl();return Se.h=(Se.h+180)%360,d(Se)}function E(ie){var Se=d(ie).toHsl(),ne=Se.h;return[d(ie),d({h:(ne+120)%360,s:Se.s,l:Se.l}),d({h:(ne+240)%360,s:Se.s,l:Se.l})]}function T(ie){var Se=d(ie).toHsl(),ne=Se.h;return[d(ie),d({h:(ne+90)%360,s:Se.s,l:Se.l}),d({h:(ne+180)%360,s:Se.s,l:Se.l}),d({h:(ne+270)%360,s:Se.s,l:Se.l})]}function M(ie){var Se=d(ie).toHsl(),ne=Se.h;return[d(ie),d({h:(ne+72)%360,s:Se.s,l:Se.l}),d({h:(ne+216)%360,s:Se.s,l:Se.l})]}function L(ie,Se,ne){Se=Se||6,ne=ne||30;var ce=d(ie).toHsl(),Oe=360/ne,oe=[d(ie)];for(ce.h=(ce.h-(Oe*Se>>1)+720)%360;--Se;)ce.h=(ce.h+Oe)%360,oe.push(d(ce));return oe}function A(ie,Se){Se=Se||6;for(var ne=d(ie).toHsv(),ce=ne.h,Oe=ne.s,oe=ne.v,q=[],Y=1/Se;Se--;)q.push(d({h:ce,s:Oe,v:oe})),oe=(oe+Y)%1;return q}d.mix=function(ie,Se,ne){ne=ne===0?0:ne||50;var ce=d(ie).toRgb(),Oe=d(Se).toRgb(),oe=ne/100,q={r:(Oe.r-ce.r)*oe+ce.r,g:(Oe.g-ce.g)*oe+ce.g,b:(Oe.b-ce.b)*oe+ce.b,a:(Oe.a-ce.a)*oe+ce.a};return d(q)},d.readability=function(ie,Se){var ne=d(ie),ce=d(Se);return(v.max(ne.getLuminance(),ce.getLuminance())+.05)/(v.min(ne.getLuminance(),ce.getLuminance())+.05)},d.isReadable=function(ie,Se,ne){var ce=d.readability(ie,Se),Oe,oe;oe=!1,Oe=ue(ne);switch(Oe.level+Oe.size){case"AAsmall":case"AAAlarge":oe=ce>=4.5;break;case"AAlarge":oe=ce>=3;break;case"AAAsmall":oe=ce>=7;break}return oe},d.mostReadable=function(ie,Se,ne){var ce=null,Oe=0,oe,q,Y,Z;ne=ne||{},q=ne.includeFallbackColors,Y=ne.level,Z=ne.size;for(var ye=0;ye<Se.length;ye++)oe=d.readability(ie,Se[ye]),oe>Oe&&(Oe=oe,ce=d(Se[ye]));return d.isReadable(ie,ce,{level:Y,size:Z})||!q?ce:(ne.includeFallbackColors=!1,d.mostReadable(ie,["#fff","#000"],ne))};var V=d.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"},z=d.hexNames=W(V);function W(ie){var Se={};for(var ne in ie)ie.hasOwnProperty(ne)&&(Se[ie[ne]]=ne);return Se}function G(ie){return ie=parseFloat(ie),(isNaN(ie)||ie<0||ie>1)&&(ie=1),ie}function U(ie,Se){$(ie)&&(ie="100%");var ne=re(ie);return ie=S(Se,b(0,parseFloat(ie))),ne&&(ie=parseInt(ie*Se,10)/100),v.abs(ie-Se)<1e-6?1:ie%Se/parseFloat(Se)}function P(ie){return S(1,b(0,ie))}function H(ie){return parseInt(ie,16)}function $(ie){return typeof ie=="string"&&ie.indexOf(".")!=-1&&parseFloat(ie)===1}function re(ie){return typeof ie=="string"&&ie.indexOf("%")!=-1}function te(ie){return ie.length==1?"0"+ie:""+ie}function ge(ie){return ie<=1&&(ie=ie*100+"%"),ie}function ve(ie){return v.round(parseFloat(ie)*255).toString(16)}function de(ie){return H(ie)/255}var De=function(){var ie="[-\\+]?\\d+%?",Se="[-\\+]?\\d*\\.\\d+%?",ne="(?:"+Se+")|(?:"+ie+")",ce="[\\s|\\(]+("+ne+")[,|\\s]+("+ne+")[,|\\s]+("+ne+")\\s*\\)?",Oe="[\\s|\\(]+("+ne+")[,|\\s]+("+ne+")[,|\\s]+("+ne+")[,|\\s]+("+ne+")\\s*\\)?";return{CSS_UNIT:new RegExp(ne),rgb:new RegExp("rgb"+ce),rgba:new RegExp("rgba"+Oe),hsl:new RegExp("hsl"+ce),hsla:new RegExp("hsla"+Oe),hsv:new RegExp("hsv"+ce),hsva:new RegExp("hsva"+Oe),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 Te(ie){return!!De.CSS_UNIT.exec(ie)}function he(ie){ie=ie.replace(C,"").replace(k,"").toLowerCase();var Se=!1;if(V[ie])ie=V[ie],Se=!0;else if(ie=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ne;return(ne=De.rgb.exec(ie))?{r:ne[1],g:ne[2],b:ne[3]}:(ne=De.rgba.exec(ie))?{r:ne[1],g:ne[2],b:ne[3],a:ne[4]}:(ne=De.hsl.exec(ie))?{h:ne[1],s:ne[2],l:ne[3]}:(ne=De.hsla.exec(ie))?{h:ne[1],s:ne[2],l:ne[3],a:ne[4]}:(ne=De.hsv.exec(ie))?{h:ne[1],s:ne[2],v:ne[3]}:(ne=De.hsva.exec(ie))?{h:ne[1],s:ne[2],v:ne[3],a:ne[4]}:(ne=De.hex8.exec(ie))?{r:H(ne[1]),g:H(ne[2]),b:H(ne[3]),a:de(ne[4]),format:Se?"name":"hex8"}:(ne=De.hex6.exec(ie))?{r:H(ne[1]),g:H(ne[2]),b:H(ne[3]),format:Se?"name":"hex"}:(ne=De.hex4.exec(ie))?{r:H(ne[1]+""+ne[1]),g:H(ne[2]+""+ne[2]),b:H(ne[3]+""+ne[3]),a:de(ne[4]+""+ne[4]),format:Se?"name":"hex8"}:(ne=De.hex3.exec(ie))?{r:H(ne[1]+""+ne[1]),g:H(ne[2]+""+ne[2]),b:H(ne[3]+""+ne[3]),format:Se?"name":"hex"}:!1}function ue(ie){var Se,ne;return ie=ie||{level:"AA",size:"small"},Se=(ie.level||"AA").toUpperCase(),ne=(ie.size||"small").toLowerCase(),Se!=="AA"&&Se!=="AAA"&&(Se="AA"),ne!=="small"&&ne!=="large"&&(ne="small"),{level:Se,size:ne}}F.exports?F.exports=d:!(N=function(){return d}.call(Q,j,Q,F),N!==void 0&&(F.exports=N))})(Math)},bCnd:function(F,Q,j){"use strict";j.d(Q,"b",function(){return k}),j.d(Q,"a",function(){return y});var N=j("je13"),v=j.n(N),C=!1;function k(m,S){var b=v.a.get("__ec");b||(b={}),b[m]=S,v.a.set("__ec",b)}function y(m,S){var b=v.a.get("__ec");return b?b[m]===void 0?S:b[m]:S}},bQjk:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return function(v){var C=N,k=C.lib,y=k.CipherParams,m=C.enc,S=m.Hex,b=C.format,p=b.Hex={stringify:function(d){return d.ciphertext.toString(S)},parse:function(d){var t=S.parse(d);return y.create({ciphertext:t})}}}(),N.format.Hex})},bT9E:function(F,Q,j){"use strict";j.d(Q,"a",function(){return v});var N=j("VTBJ");function v(C,k){var y=Object(N.a)({},C);return Array.isArray(k)&&k.forEach(function(m){delete y[m]}),y}},biw7:function(F,Q,j){"use strict";var N=j("cDcd"),v=j.n(N),C=N.createContext(null);Q.a=C},c5Ni:function(F,Q,j){},cDPC:function(F,Q,j){"use strict";var N=j("tJVT"),v=j("cDcd"),C=j.n(v),k=j("i3hx"),y=j.n(k);Q.a=function(m){var S=m.defaultX,b=S===void 0?"40%":S,p=m.leftChild,d=m.rightChild,t=m.className,l=m.hideResize,r=l===void 0?!1:l,i=Object(v.useState)(b),o=Object(N.a)(i,2),s=o[0],c=o[1],a=Object(v.useRef)();function u(){a.current=!0}Object(v.useEffect)(function(){function _(R){a.current&&c(R.pageX)}function h(){a.current=!1}return window.addEventListener("mousemove",_),window.addEventListener("mouseup",h),function(){window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",h)}},[]);var f=typeof s=="number"&&s!==.01?"".concat(s,"px"):b,w="calc(100% - ".concat(r?"0px":"4px"," - ").concat(f,")");return C.a.createElement("div",{className:"split-panel-container ".concat(t)},C.a.createElement("section",{style:{width:f,display:s===.01?"none":""}},p),C.a.createElement("section",{className:"resize-x-bar",onMouseDown:u},C.a.createElement("a",{className:"btn-resize"},C.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},C.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"})))),C.a.createElement("section",{style:{width:w}},d))}},cv67:function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(v){var C=N,k=C.lib,y=k.WordArray,m=k.Hasher,S=C.algo,b=[];(function(){for(var i=0;i<64;i++)b[i]=v.abs(v.sin(i+1))*4294967296|0})();var p=S.MD5=m.extend({_doReset:function(){this._hash=new y.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(i,o){for(var s=0;s<16;s++){var c=o+s,a=i[c];i[c]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}var u=this._hash.words,f=i[o+0],w=i[o+1],_=i[o+2],h=i[o+3],R=i[o+4],O=i[o+5],g=i[o+6],x=i[o+7],E=i[o+8],T=i[o+9],M=i[o+10],L=i[o+11],A=i[o+12],V=i[o+13],z=i[o+14],W=i[o+15],G=u[0],U=u[1],P=u[2],H=u[3];G=d(G,U,P,H,f,7,b[0]),H=d(H,G,U,P,w,12,b[1]),P=d(P,H,G,U,_,17,b[2]),U=d(U,P,H,G,h,22,b[3]),G=d(G,U,P,H,R,7,b[4]),H=d(H,G,U,P,O,12,b[5]),P=d(P,H,G,U,g,17,b[6]),U=d(U,P,H,G,x,22,b[7]),G=d(G,U,P,H,E,7,b[8]),H=d(H,G,U,P,T,12,b[9]),P=d(P,H,G,U,M,17,b[10]),U=d(U,P,H,G,L,22,b[11]),G=d(G,U,P,H,A,7,b[12]),H=d(H,G,U,P,V,12,b[13]),P=d(P,H,G,U,z,17,b[14]),U=d(U,P,H,G,W,22,b[15]),G=t(G,U,P,H,w,5,b[16]),H=t(H,G,U,P,g,9,b[17]),P=t(P,H,G,U,L,14,b[18]),U=t(U,P,H,G,f,20,b[19]),G=t(G,U,P,H,O,5,b[20]),H=t(H,G,U,P,M,9,b[21]),P=t(P,H,G,U,W,14,b[22]),U=t(U,P,H,G,R,20,b[23]),G=t(G,U,P,H,T,5,b[24]),H=t(H,G,U,P,z,9,b[25]),P=t(P,H,G,U,h,14,b[26]),U=t(U,P,H,G,E,20,b[27]),G=t(G,U,P,H,V,5,b[28]),H=t(H,G,U,P,_,9,b[29]),P=t(P,H,G,U,x,14,b[30]),U=t(U,P,H,G,A,20,b[31]),G=l(G,U,P,H,O,4,b[32]),H=l(H,G,U,P,E,11,b[33]),P=l(P,H,G,U,L,16,b[34]),U=l(U,P,H,G,z,23,b[35]),G=l(G,U,P,H,w,4,b[36]),H=l(H,G,U,P,R,11,b[37]),P=l(P,H,G,U,x,16,b[38]),U=l(U,P,H,G,M,23,b[39]),G=l(G,U,P,H,V,4,b[40]),H=l(H,G,U,P,f,11,b[41]),P=l(P,H,G,U,h,16,b[42]),U=l(U,P,H,G,g,23,b[43]),G=l(G,U,P,H,T,4,b[44]),H=l(H,G,U,P,A,11,b[45]),P=l(P,H,G,U,W,16,b[46]),U=l(U,P,H,G,_,23,b[47]),G=r(G,U,P,H,f,6,b[48]),H=r(H,G,U,P,x,10,b[49]),P=r(P,H,G,U,z,15,b[50]),U=r(U,P,H,G,O,21,b[51]),G=r(G,U,P,H,A,6,b[52]),H=r(H,G,U,P,h,10,b[53]),P=r(P,H,G,U,M,15,b[54]),U=r(U,P,H,G,w,21,b[55]),G=r(G,U,P,H,E,6,b[56]),H=r(H,G,U,P,W,10,b[57]),P=r(P,H,G,U,g,15,b[58]),U=r(U,P,H,G,V,21,b[59]),G=r(G,U,P,H,R,6,b[60]),H=r(H,G,U,P,L,10,b[61]),P=r(P,H,G,U,_,15,b[62]),U=r(U,P,H,G,T,21,b[63]),u[0]=u[0]+G|0,u[1]=u[1]+U|0,u[2]=u[2]+P|0,u[3]=u[3]+H|0},_doFinalize:function(){var i=this._data,o=i.words,s=this._nDataBytes*8,c=i.sigBytes*8;o[c>>>5]|=128<<24-c%32;var a=v.floor(s/4294967296),u=s;o[(c+64>>>9<<4)+15]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,o[(c+64>>>9<<4)+14]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,i.sigBytes=(o.length+1)*4,this._process();for(var f=this._hash,w=f.words,_=0;_<4;_++){var h=w[_];w[_]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360}return f},clone:function(){var i=m.clone.call(this);return i._hash=this._hash.clone(),i}});function d(i,o,s,c,a,u,f){var w=i+(o&s|~o&c)+a+f;return(w<<u|w>>>32-u)+o}function t(i,o,s,c,a,u,f){var w=i+(o&c|s&~c)+a+f;return(w<<u|w>>>32-u)+o}function l(i,o,s,c,a,u,f){var w=i+(o^s^c)+a+f;return(w<<u|w>>>32-u)+o}function r(i,o,s,c,a,u,f){var w=i+(s^(o|~c))+a+f;return(w<<u|w>>>32-u)+o}C.MD5=m._createHelper(p),C.HmacMD5=m._createHmacHelper(p)}(Math),N.MD5})},dejd:function(F,Q,j){},dmUQ:function(F,Q,j){"use strict";var N=j("Ff2n"),v=j("rePB"),C=j("1OyB"),k=j("vuIU"),y=j("Ji7U"),m=j("md7G"),S=j("foSv"),b=j("cDcd"),p=j.n(b),d=j("TSYQ"),t=j.n(d),l=j("4IlW");function r(E,T){var M=Object.keys(E);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(E);T&&(L=L.filter(function(A){return Object.getOwnPropertyDescriptor(E,A).enumerable})),M.push.apply(M,L)}return M}function i(E){for(var T=1;T<arguments.length;T++){var M=arguments[T]!=null?arguments[T]:{};T%2?r(Object(M),!0).forEach(function(L){Object(v.a)(E,L,M[L])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(M)):r(Object(M)).forEach(function(L){Object.defineProperty(E,L,Object.getOwnPropertyDescriptor(M,L))})}return E}function o(E){var T=s();return function(){var L=Object(S.a)(E),A;if(T){var V=Object(S.a)(this).constructor;A=Reflect.construct(L,arguments,V)}else A=L.apply(this,arguments);return Object(m.a)(this,A)}}function s(){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(E){return!1}}function c(){}function a(E){E.preventDefault()}var u=function(T){return T.replace(/[^\w.-]+/g,"")},f=200,w=600,_=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,h=function(T){return T!=null},R=function(T,M){return M===T||typeof M=="number"&&typeof T=="number"&&isNaN(M)&&isNaN(T)},O=function(E){Object(y.a)(M,E);var T=o(M);function M(L){var A;Object(C.a)(this,M),A=T.call(this,L),A.onKeyDown=function(W){var G=A.props,U=G.onKeyDown,P=G.onPressEnter;if(W.keyCode===l.a.UP){var H=A.getRatio(W);A.up(W,H,null),A.stop()}else if(W.keyCode===l.a.DOWN){var $=A.getRatio(W);A.down(W,$,null),A.stop()}else W.keyCode===l.a.ENTER&&P&&P(W);if(A.recordCursorPosition(),A.lastKeyCode=W.keyCode,U){for(var re=arguments.length,te=new Array(re>1?re-1:0),ge=1;ge<re;ge++)te[ge-1]=arguments[ge];U.apply(void 0,[W].concat(te))}},A.onKeyUp=function(W){var G=A.props.onKeyUp;if(A.stop(),A.recordCursorPosition(),G){for(var U=arguments.length,P=new Array(U>1?U-1:0),H=1;H<U;H++)P[H-1]=arguments[H];G.apply(void 0,[W].concat(P))}},A.onChange=function(W){var G=A.props.onChange;A.state.focused&&(A.inputting=!0),A.rawInput=A.props.parser(A.getValueFromEvent(W)),A.setState({inputValue:A.rawInput}),G(A.toNumber(A.rawInput))},A.onMouseUp=function(){var W=A.props.onMouseUp;A.recordCursorPosition(),W&&W.apply(void 0,arguments)},A.onFocus=function(){var W;A.setState({focused:!0}),(W=A.props).onFocus.apply(W,arguments)},A.onBlur=function(){var W=A.props.onBlur;A.inputting=!1,A.setState({focused:!1});var G=A.getCurrentValidValue(A.state.inputValue),U=A.setValue(G,c);if(W){var P=A.input.value,H=A.getInputDisplayValue({focus:!1,value:U});A.input.value=H&&Number(H),W.apply(void 0,arguments),A.input.value=P}},A.getRatio=function(W){var G=1;return W.metaKey||W.ctrlKey?G=.1:W.shiftKey&&(G=10),G},A.getFullNum=function(W){return isNaN(W)?W:/e/i.test(String(W))?Number(W).toFixed(18).replace(/\.?0+$/,""):W},A.getPrecision=function(W){if(h(A.props.precision))return A.props.precision;var G=String(W);if(G.indexOf("e-")>=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var U=0;return G.indexOf(".")>=0&&(U=G.length-G.indexOf(".")-1),U},A.getInputDisplayValue=function(W){var G=W||A.state,U=G.focused,P=G.inputValue,H=G.value,$;U?$=P:$=A.toPrecisionAsStep(H),$==null&&($="");var re=A.formatWrapper($);return h(A.props.decimalSeparator)&&(re=re.toString().replace(".",A.props.decimalSeparator)),re},A.recordCursorPosition=function(){try{A.cursorStart=A.input.selectionStart,A.cursorEnd=A.input.selectionEnd,A.currentValue=A.input.value,A.cursorBefore=A.input.value.substring(0,A.cursorStart),A.cursorAfter=A.input.value.substring(A.cursorEnd)}catch(W){}},A.restoreByAfter=function(W){if(W===void 0)return!1;var G=A.input.value,U=G.lastIndexOf(W);if(U===-1)return!1;var P=A.cursorBefore.length;return A.lastKeyCode===l.a.DELETE&&A.cursorBefore.charAt(P-1)===W[0]?(A.fixCaret(P,P),!0):U+W.length===G.length?(A.fixCaret(U,U),!0):!1},A.partRestoreByAfter=function(W){return W===void 0?!1:Array.prototype.some.call(W,function(G,U){var P=W.substring(U);return A.restoreByAfter(P)})},A.isNotCompleteNumber=function(W){return isNaN(W)||W===""||W===null||W&&W.toString().indexOf(".")===W.toString().length-1},A.stop=function(){A.autoStepTimer&&clearTimeout(A.autoStepTimer)},A.down=function(W,G,U){A.pressingUpOrDown=!0,A.step("down",W,G,U)},A.up=function(W,G,U){A.pressingUpOrDown=!0,A.step("up",W,G,U)},A.saveInput=function(W){A.input=W};var V=L.value;V===void 0&&(V=L.defaultValue),A.state={focused:L.autoFocus};var z=A.getValidValue(A.toNumber(V));return A.state=i(i({},A.state),{},{inputValue:A.toPrecisionAsStep(z),value:z}),A}return Object(k.a)(M,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(A){var V=this.props,z=V.value,W=V.onChange,G=V.max,U=V.min,P=this.state.focused;if(A){if(!R(A.value,z)||!R(A.max,G)||!R(A.min,U)){var H=P?z:this.getValidValue(z),$;this.pressingUpOrDown?$=H:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:$})}var re="value"in this.props?z:this.state.value;"max"in this.props&&A.max!==G&&typeof re=="number"&&re>G&&W&&W(G),"min"in this.props&&A.min!==U&&typeof re=="number"&&re<U&&W&&W(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var te=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===l.a.BACKSPACE?te=this.cursorStart-1:this.lastKeyCode===l.a.DELETE&&(te=this.cursorStart):te=this.input.value.length,this.fixCaret(te,te)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case l.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case l.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ge){}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(A){var V=A;return V===""?V="":this.isNotCompleteNumber(parseFloat(V))?V=this.state.value:V=this.getValidValue(V),this.toNumber(V)}},{key:"getValueFromEvent",value:function(A){var V=A.target.value.trim().replace(/。/g,".");return h(this.props.decimalSeparator)&&(V=V.replace(this.props.decimalSeparator,".")),V}},{key:"getValidValue",value:function(A){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,W=parseFloat(A);return isNaN(W)?A:(W<V&&(W=V),W>z&&(W=z),W)}},{key:"setValue",value:function(A,V){var z=this.props.precision,W=this.isNotCompleteNumber(parseFloat(A))?null:parseFloat(A),G=this.state.value,U=G===void 0?null:G,P=this.state.inputValue,H=P===void 0?null:P,$=typeof W=="number"?W.toFixed(z):"".concat(W),re=W!==U||$!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},V)):this.setState({value:W,inputValue:this.toPrecisionAsStep(A)},V),re&&this.props.onChange(W),W}},{key:"getMaxPrecision",value:function(A){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.props,W=z.precision,G=z.step;if(h(W))return W;var U=this.getPrecision(V),P=this.getPrecision(G),H=this.getPrecision(A);return A?Math.max(H,U+P):U+P}},{key:"getPrecisionFactor",value:function(A){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.getMaxPrecision(A,V);return Math.pow(10,z)}},{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(A){return this.props.formatter?this.props.formatter(A):A}},{key:"toPrecisionAsStep",value:function(A){if(this.isNotCompleteNumber(A)||A==="")return A;var V=Math.abs(this.getMaxPrecision(A));return isNaN(V)?A.toString():Number(A).toFixed(V)}},{key:"toNumber",value:function(A){var V=this.props.precision,z=this.state.focused,W=A&&A.length>16&&z;return this.isNotCompleteNumber(A)||W?A:h(V)?Math.round(A*Math.pow(10,V))/Math.pow(10,V):Number(A)}},{key:"upStep",value:function(A,V){var z=this.props.step,W=this.getPrecisionFactor(A,V),G=Math.abs(this.getMaxPrecision(A,V)),U=((W*A+W*z*V)/W).toFixed(G);return this.toNumber(U)}},{key:"downStep",value:function(A,V){var z=this.props.step,W=this.getPrecisionFactor(A,V),G=Math.abs(this.getMaxPrecision(A,V)),U=((W*A-W*z*V)/W).toFixed(G);return this.toNumber(U)}},{key:"step",value:function(A,V){var z=this,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),V&&(V.persist(),V.preventDefault());var U=this.props;if(U.disabled)return;var P=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(P))return;var H=this["".concat(A,"Step")](P,W),$=H>U.max||H<U.min;if(H>U.max?H=U.max:H<U.min&&(H=U.min),this.setValue(H,null),this.setState({focused:!0},function(){z.pressingUpOrDown=!1}),$)return;this.autoStepTimer=setTimeout(function(){z[A](V,W,!0)},G?f:w)}},{key:"fixCaret",value:function(A,V){if(A===void 0||V===void 0||!this.input||!this.input.value)return;try{var z=this.input.selectionStart,W=this.input.selectionEnd;(A!==z||V!==W)&&this.input.setSelectionRange(A,V)}catch(G){}}},{key:"render",value:function(){var A,V=this.props,z=V.prefixCls,W=V.disabled,G=V.readOnly,U=V.useTouch,P=V.autoComplete,H=V.upHandler,$=V.downHandler,re=V.className,te=V.max,ge=V.min,ve=V.style,de=V.title,De=V.onMouseEnter,Te=V.onMouseLeave,he=V.onMouseOver,ue=V.onMouseOut,ie=V.required,Se=V.onClick,ne=V.tabIndex,ce=V.type,Oe=V.placeholder,oe=V.id,q=V.inputMode,Y=V.pattern,Z=V.step,ye=V.maxLength,be=V.autoFocus,Re=V.name,Qe=V.onPaste,rt=V.onInput,at=Object(N.a)(V,["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"]),qe=this.state,st=qe.value,lt=qe.focused,je=t()(z,(A={},Object(v.a)(A,re,!!re),Object(v.a)(A,"".concat(z,"-disabled"),W),Object(v.a)(A,"".concat(z,"-focused"),lt),A)),Ie={};Object.keys(at).forEach(function(Fe){(Fe.substr(0,5)==="data-"||Fe.substr(0,5)==="aria-"||Fe==="role")&&(Ie[Fe]=at[Fe])});var tt=!G&&!W,ot=this.getInputDisplayValue(null),ze=(st||st===0)&&(isNaN(st)||Number(st)>=te),Ze=(st||st===0)&&(isNaN(st)||Number(st)<=ge),Ne=ze||W||G,Ae=Ze||W||G,Me=t()("".concat(z,"-handler"),"".concat(z,"-handler-up"),Object(v.a)({},"".concat(z,"-handler-up-disabled"),Ne)),Ee=t()("".concat(z,"-handler"),"".concat(z,"-handler-down"),Object(v.a)({},"".concat(z,"-handler-down-disabled"),Ae)),Ce=U?{onTouchStart:Ne?c:this.up,onTouchEnd:this.stop}:{onMouseDown:Ne?c:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ke=U?{onTouchStart:Ae?c:this.down,onTouchEnd:this.stop}:{onMouseDown:Ae?c:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return p.a.createElement("div",{className:je,style:ve,title:de,onMouseEnter:De,onMouseLeave:Te,onMouseOver:he,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},p.a.createElement("div",{className:"".concat(z,"-handler-wrap")},p.a.createElement("span",Object.assign({unselectable:"on"},Ce,{role:"button","aria-label":"Increase Value","aria-disabled":Ne,className:Me}),H||p.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-up-inner"),onClick:a})),p.a.createElement("span",Object.assign({unselectable:"on"},ke,{role:"button","aria-label":"Decrease Value","aria-disabled":Ae,className:Ee}),$||p.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-down-inner"),onClick:a}))),p.a.createElement("div",{className:"".concat(z,"-input-wrap")},p.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ge,"aria-valuemax":te,"aria-valuenow":st,required:ie,type:ce,placeholder:Oe,onPaste:Qe,onClick:Se,onMouseUp:this.onMouseUp,className:"".concat(z,"-input"),tabIndex:ne,autoComplete:P,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:c,onKeyUp:tt?this.onKeyUp:c,autoFocus:be,maxLength:ye,readOnly:G,disabled:W,max:te,min:ge,step:Z,name:Re,title:de,id:oe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ot),pattern:Y,inputMode:q,onInput:rt},Ie))))}}]),M}(p.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_,min:-_,step:1,style:{},onChange:c,onKeyDown:c,onPressEnter:c,onFocus:c,onBlur:c,parser:u,required:!1,autoComplete:"off"};var g=O,x=Q.a=g},e7zE:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("3y9D"),j("WYAk"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.Base,y=C.WordArray,m=v.algo,S=m.SHA1,b=m.HMAC,p=m.PBKDF2=k.extend({cfg:k.extend({keySize:128/32,hasher:S,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,t){for(var l=this.cfg,r=b.create(l.hasher,d),i=y.create(),o=y.create([1]),s=i.words,c=o.words,a=l.keySize,u=l.iterations;s.length<a;){var f=r.update(t).finalize(o);r.reset();for(var w=f.words,_=w.length,h=f,R=1;R<u;R++){h=r.finalize(h),r.reset();for(var O=h.words,g=0;g<_;g++)w[g]^=O[g]}i.concat(f),c[0]++}return i.sigBytes=a*4,i}});v.PBKDF2=function(d,t,l){return p.create(l).compute(d,t)}}(),N.PBKDF2})},eRFJ:function(F,Q,j){F.exports={header:"header___2DEfS",field:"field___2KFR1","oj-form-container":"oj-form-container___11-CJ","oj-left-panel":"oj-left-panel___2_COu","oj-form-info":"oj-form-info___3RmjJ",footer:"footer___13GF0",result:"result___2TPH2",passText:"passText___m4yU3",noPassText:"noPassText___bU8yW",pass:"pass___1qwzN",noPass:"noPass___35fR7","test-case-name":"test-case-name___JX6gg","btn-remove-case":"btn-remove-case___20q0s","icon-tag":"icon-tag___ahN2d",btn_back:"btn_back___2GR2u",testJi:"testJi___lY3ok",upBtn:"upBtn___14ov-","oj-problems":"oj-problems___3xexO",row:"row____2CFx",a:"a___1o_MZ",b:"b___2s_8T",inputTwo:"inputTwo___2QE50",inputOne:"inputOne___3VLjS",cusModal:"cusModal___3HaCu","oj-custom-large-spin":"oj-custom-large-spin___18Uw5",MdEditor:"MdEditor___2TQ6G"}},fcSX:function(F,Q,j){"use strict";var N=j("Ff2n"),v=j("1OyB"),C=j("vuIU"),k=j("Ji7U"),y=j("md7G"),m=j("foSv"),S=j("1W/9"),b=j("cDcd"),p=j("rePB"),d=j("JX7q"),t=j("TSYQ"),l=j.n(t),r=j("qx4F"),i=j("4IlW");function o(W){return Array.isArray(W)?W:[W]}var s={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},c=Object.keys(s).filter(function(W){if(typeof document=="undefined")return!1;var G=document.getElementsByTagName("html")[0];return W in(G?G.style:{})})[0],a=s[c];function u(W,G,U,P){W.addEventListener?W.addEventListener(G,U,P):W.attachEvent&&W.attachEvent("on".concat(G),U)}function f(W,G,U,P){W.removeEventListener?W.removeEventListener(G,U,P):W.attachEvent&&W.detachEvent("on".concat(G),U)}function w(W,G){var U=typeof W=="function"?W(G):W;return Array.isArray(U)?U.length===2?U:[U[0],U[1]]:[U]}var _=function(G){return!isNaN(parseFloat(G))&&isFinite(G)},h=!(typeof window!="undefined"&&window.document&&window.document.createElement),R=function W(G,U,P,H){if(!U||U===document||U instanceof Document)return!1;if(U===G.parentNode)return!0;var $=Math.max(Math.abs(P),Math.abs(H))===Math.abs(H),re=Math.max(Math.abs(P),Math.abs(H))===Math.abs(P),te=U.scrollHeight-U.clientHeight,ge=U.scrollWidth-U.clientWidth,ve=document.defaultView.getComputedStyle(U),de=ve.overflowY==="auto"||ve.overflowY==="scroll",De=ve.overflowX==="auto"||ve.overflowX==="scroll",Te=te&&de,he=ge&&De;return $&&(!Te||Te&&(U.scrollTop>=te&&H<0||U.scrollTop<=0&&H>0))||re&&(!he||he&&(U.scrollLeft>=ge&&P<0||U.scrollLeft<=0&&P>0))?W(G,U.parentNode,P,H):!1};function O(W){var G=g();return function(){var P=Object(m.a)(W),H;if(G){var $=Object(m.a)(this).constructor;H=Reflect.construct(P,arguments,$)}else H=P.apply(this,arguments);return Object(y.a)(this,H)}}function g(){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(W){return!1}}var x={},E=function(W){Object(k.a)(U,W);var G=O(U);function U(P){var H;return Object(v.a)(this,U),H=G.call(this,P),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function($){if($.touches.length>1)return;H.startPos={x:$.touches[0].clientX,y:$.touches[0].clientY}},H.removeMoveHandler=function($){if($.changedTouches.length>1)return;var re=$.currentTarget,te=$.changedTouches[0].clientX-H.startPos.x,ge=$.changedTouches[0].clientY-H.startPos.y;(re===H.maskDom||re===H.handlerDom||re===H.contentDom&&R(re,$.target,te,ge))&&$.cancelable&&$.preventDefault()},H.transitionEnd=function($){var re=$.target;f(re,a,H.transitionEnd),re.style.transition=""},H.onKeyDown=function($){if($.keyCode===i.a.ESC){var re=H.props.onClose;$.stopPropagation(),re&&re($)}},H.onWrapperTransitionEnd=function($){var re=H.props,te=re.open,ge=re.afterVisibleChange;$.target===H.contentWrapper&&$.propertyName.match(/transform$/)&&(H.dom.style.transition="",!te&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),ge&&ge(!!te))},H.openLevelTransition=function(){var $=H.props,re=$.open,te=$.width,ge=$.height,ve=H.getHorizontalBoolAndPlacementName(),de=ve.isHorizontal,De=ve.placementName,Te=H.contentDom?H.contentDom.getBoundingClientRect()[de?"width":"height"]:0,he=(de?te:ge)||Te;H.setLevelAndScrolling(re,De,he)},H.setLevelTransform=function($,re,te,ge){var ve=H.props,de=ve.placement,De=ve.levelMove,Te=ve.duration,he=ve.ease,ue=ve.showMask;H.levelDom.forEach(function(ie){ie.style.transition="transform ".concat(Te," ").concat(he),u(ie,a,H.transitionEnd);var Se=$?te:0;if(De){var ne=w(De,{target:ie,open:$});Se=$?ne[0]:ne[1]||0}var ce=typeof Se=="number"?"".concat(Se,"px"):Se,Oe=de==="left"||de==="top"?ce:"-".concat(ce);Oe=ue&&de==="right"&&ge?"calc(".concat(Oe," + ").concat(ge,"px)"):Oe,ie.style.transform=Se?"".concat(re,"(").concat(Oe,")"):""})},H.setLevelAndScrolling=function($,re,te){var ge=H.props.onChange;if(!h){var ve=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(r.a)(!0):0;H.setLevelTransform($,re,te,ve),H.toggleScrollingToDrawerAndBody(ve)}ge&&ge($)},H.toggleScrollingToDrawerAndBody=function($){var re=H.props,te=re.getOpenCount,ge=re.getContainer,ve=re.showMask,de=re.open,De=ge&&ge(),Te=te&&te();if(De&&De.parentNode===document.body&&ve){var he=["touchstart"],ue=[document.body,H.maskDom,H.handlerDom,H.contentDom];de&&document.body.style.overflow!=="hidden"?($&&H.addScrollingEffect($),Te===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ue.forEach(function(ie,Se){if(!ie)return;u(ie,he[Se]||"touchmove",Se?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(Te||(document.body.style.overflow=""),document.body.style.touchAction="",$&&H.remScrollingEffect($),ue.forEach(function(ie,Se){if(!ie)return;f(ie,he[Se]||"touchmove",Se?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function($){var re=H.props,te=re.placement,ge=re.duration,ve=re.ease,de=re.getOpenCount,De=re.switchScrollingEffect,Te=de&&de();Te===1&&De();var he="width ".concat(ge," ").concat(ve),ue="transform ".concat(ge," ").concat(ve);H.dom.style.transition="none";switch(te){case"right":H.dom.style.transform="translateX(-".concat($,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat($,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ue,",").concat(he),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function($){var re=H.props,te=re.placement,ge=re.duration,ve=re.ease,de=re.getOpenCount,De=re.switchScrollingEffect,Te=de&&de();Te||De(!0),c&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var he,ue="width ".concat(ge," ").concat(ve),ie="transform ".concat(ge," ").concat(ve);switch(te){case"left":{H.dom.style.width="100%",ue="width 0s ".concat(ve," ").concat(ge);break}case"right":{H.dom.style.transform="translateX(".concat($,"px)"),H.dom.style.width="100%",ue="width 0s ".concat(ve," ").concat(ge),H.maskDom&&(H.maskDom.style.left="-".concat($,"px"),H.maskDom.style.width="calc(100% + ".concat($,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat($,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",he="height 0s ".concat(ve," ").concat(ge);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ie,",").concat(he?"".concat(he,","):"").concat(ue),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(x).some(function($){return x[$]})},H.getLevelDom=function($){var re=$.level,te=$.getContainer;if(h)return;var ge=te&&te(),ve=ge?ge.parentNode:null;if(H.levelDom=[],re==="all"){var de=ve?Array.prototype.slice.call(ve.children):[];de.forEach(function(De){De.nodeName!=="SCRIPT"&&De.nodeName!=="STYLE"&&De.nodeName!=="LINK"&&De!==ge&&H.levelDom.push(De)})}else re&&o(re).forEach(function(De){document.querySelectorAll(De).forEach(function(Te){H.levelDom.push(Te)})})},H.getHorizontalBoolAndPlacementName=function(){var $=H.props.placement,re=$==="left"||$==="right",te="translate".concat(re?"X":"Y");return{isHorizontal:re,placementName:te}},H.state={_self:Object(d.a)(H)},H}return Object(C.a)(U,[{key:"componentDidMount",value:function(){var H=this;if(!h){var $=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return $=!0,null}}))}catch(de){}this.passive=$?{passive:!1}:!1}var re=this.props,te=re.open,ge=re.getContainer,ve=ge&&ge();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),te&&(ve&&ve.parentNode===document.body&&(x[this.drawerId]=te),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var $=this.props,re=$.open,te=$.getContainer,ge=te&&te();re!==H.open&&(re&&this.domFocus(),ge&&ge.parentNode===document.body&&(x[this.drawerId]=!!re),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,$=H.getOpenCount,re=H.open,te=H.switchScrollingEffect,ge=typeof $=="function"&&$();delete x[this.drawerId],re&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ge||(document.body.style.overflow="",te(!0))}},{key:"render",value:function(){var H,$=this,re=this.props,te=re.className,ge=re.children,ve=re.style,de=re.width,De=re.height,Te=re.defaultOpen,he=re.open,ue=re.prefixCls,ie=re.placement,Se=re.level,ne=re.levelMove,ce=re.ease,Oe=re.duration,oe=re.getContainer,q=re.handler,Y=re.onChange,Z=re.afterVisibleChange,ye=re.showMask,be=re.maskClosable,Re=re.maskStyle,Qe=re.onClose,rt=re.onHandleClick,at=re.keyboard,qe=re.getOpenCount,st=re.switchScrollingEffect,lt=Object(N.a)(re,["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"]),je=this.dom?he:!1,Ie=l()(ue,(H={},Object(p.a)(H,"".concat(ue,"-").concat(ie),!0),Object(p.a)(H,"".concat(ue,"-open"),je),Object(p.a)(H,te||"",!!te),Object(p.a)(H,"no-mask",!ye),H)),tt=this.getHorizontalBoolAndPlacementName(),ot=tt.placementName,ze=ie==="left"||ie==="top"?"-100%":"100%",Ze=je?"":"".concat(ot,"(").concat(ze,")"),Ne=q&&b.cloneElement(q,{onClick:function(Me){q.props.onClick&&q.props.onClick(),rt&&rt(Me)},ref:function(Me){$.handlerDom=Me}});return b.createElement("div",Object.assign({},lt,{tabIndex:-1,className:Ie,style:ve,ref:function(Me){$.dom=Me},onKeyDown:je&&at?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),ye&&b.createElement("div",{className:"".concat(ue,"-mask"),onClick:be?Qe:void 0,style:Re,ref:function(Me){$.maskDom=Me}}),b.createElement("div",{className:"".concat(ue,"-content-wrapper"),style:{transform:Ze,msTransform:Ze,width:_(de)?"".concat(de,"px"):de,height:_(De)?"".concat(De,"px"):De},ref:function(Me){$.contentWrapper=Me}},b.createElement("div",{className:"".concat(ue,"-content"),ref:function(Me){$.contentDom=Me},onTouchStart:je&&ye?this.removeStartHandler:void 0,onTouchMove:je&&ye?this.removeMoveHandler:void 0},ge),Ne))}}],[{key:"getDerivedStateFromProps",value:function(H,$){var re=$.prevProps,te=$._self,ge={prevProps:H};if(re!==void 0){var ve=H.placement,de=H.level;ve!==re.placement&&(te.contentDom=null),de!==re.level&&te.getLevelDom(H)}return ge}}]),U}(b.Component);E.defaultProps={switchScrollingEffect:function(){}};var T=E;function M(W){var G=L();return function(){var P=Object(m.a)(W),H;if(G){var $=Object(m.a)(this).constructor;H=Reflect.construct(P,arguments,$)}else H=P.apply(this,arguments);return Object(y.a)(this,H)}}function L(){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(W){return!1}}var A=function(W){Object(k.a)(U,W);var G=M(U);function U(P){var H;Object(v.a)(this,U),H=G.call(this,P),H.onHandleClick=function(re){var te=H.props,ge=te.onHandleClick,ve=te.open;if(ge&&ge(re),typeof ve=="undefined"){var de=H.state.open;H.setState({open:!de})}},H.onClose=function(re){var te=H.props,ge=te.onClose,ve=te.open;ge&&ge(re),typeof ve=="undefined"&&H.setState({open:!1})};var $=typeof P.open!="undefined"?P.open:!!P.defaultOpen;return H.state={open:$},"onMaskClick"in P&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(C.a)(U,[{key:"render",value:function(){var H=this,$=this.props,re=$.defaultOpen,te=$.getContainer,ge=$.wrapperClassName,ve=$.forceRender,de=$.handler,De=Object(N.a)($,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Te=this.state.open;if(!te)return b.createElement("div",{className:ge,ref:function(ie){H.dom=ie}},b.createElement(T,Object.assign({},De,{open:Te,handler:de,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var he=!!de||ve;return b.createElement(S.a,{visible:Te,forceRender:he,getContainer:te,wrapperClassName:ge},function(ue){var ie=ue.visible,Se=ue.afterClose,ne=Object(N.a)(ue,["visible","afterClose"]);return b.createElement(T,Object.assign({},De,ne,{open:ie!==void 0?ie:Te,afterVisibleChange:Se!==void 0?Se:De.afterVisibleChange,handler:de,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,$){var re=$.prevProps,te={prevProps:H};return typeof re!="undefined"&&H.open!==re.open&&(te.open=H.open),te}}]),U}(b.Component);A.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:b.createElement("div",{className:"drawer-handle"},b.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var V=A,z=Q.a=V},fyJ8:function(F,Q,j){"use strict";var N=j("rePB"),v=j("VTBJ"),C=j("Ff2n"),k=j("U8pU"),y=j("cDcd"),m=j.n(y),S=j("TSYQ"),b=j.n(S),p=j("c+Xe"),d=j("sR1s");function t(s){return s&&Object(k.a)(s)==="object"&&!Array.isArray(s)&&!y.isValidElement(s)}function l(s){return typeof s=="string"?!0:Object(p.c)(s)}function r(s,c){var a,u=s.prefixCls,f=s.className,w=s.record,_=s.index,h=s.dataIndex,R=s.render,O=s.children,g=s.component,x=g===void 0?"td":g,E=s.colSpan,T=s.rowSpan,M=s.fixLeft,L=s.fixRight,A=s.firstFixLeft,V=s.lastFixLeft,z=s.firstFixRight,W=s.lastFixRight,G=s.appendNode,U=s.additionalProps,P=U===void 0?{}:U,H=s.ellipsis,$=s.align,re=s.rowType,te=s.isSticky,ge="".concat(u,"-cell"),ve,de;if(O)de=O;else{var De=Object(d.b)(w,h);if(de=De,R){var Te=R(De,w,_);t(Te)?(de=Te.children,ve=Te.props):de=Te}}Object(k.a)(de)==="object"&&!Array.isArray(de)&&!y.isValidElement(de)&&(de=null),H&&(V||z)&&(de=y.createElement("span",{className:"".concat(ge,"-content")},de));var he=ve||{},ue=he.colSpan,ie=he.rowSpan,Se=he.style,ne=he.className,ce=Object(C.a)(he,["colSpan","rowSpan","style","className"]),Oe=ue!==void 0?ue:E,oe=ie!==void 0?ie:T;if(Oe===0||oe===0)return null;var q={},Y=typeof M=="number",Z=typeof L=="number";Y&&(q.position="sticky",q.left=M),Z&&(q.position="sticky",q.right=L);var ye={};$&&(ye.textAlign=$);var be,Re=H===!0?{showTitle:!0}:H;Re&&(Re.showTitle||re==="header")&&(typeof de=="string"||typeof de=="number"?be=de.toString():y.isValidElement(de)&&typeof de.props.children=="string"&&(be=de.props.children));var Qe=Object(v.a)(Object(v.a)(Object(v.a)({title:be},ce),P),{},{colSpan:Oe&&Oe!==1?Oe:null,rowSpan:oe&&oe!==1?oe:null,className:b()(ge,f,(a={},Object(N.a)(a,"".concat(ge,"-fix-left"),Y),Object(N.a)(a,"".concat(ge,"-fix-left-first"),A),Object(N.a)(a,"".concat(ge,"-fix-left-last"),V),Object(N.a)(a,"".concat(ge,"-fix-right"),Z),Object(N.a)(a,"".concat(ge,"-fix-right-first"),z),Object(N.a)(a,"".concat(ge,"-fix-right-last"),W),Object(N.a)(a,"".concat(ge,"-ellipsis"),H),Object(N.a)(a,"".concat(ge,"-with-append"),G),Object(N.a)(a,"".concat(ge,"-fix-sticky"),(Y||Z)&&te),a),P.className,ne),style:Object(v.a)(Object(v.a)(Object(v.a)(Object(v.a)({},P.style),ye),q),Se),ref:l(x)?c:null});return y.createElement(x,Object.assign({},Qe),G,de)}var i=y.forwardRef(r);i.displayName="Cell";var o=y.memo(i,function(s,c){return c.shouldCellUpdate?!c.shouldCellUpdate(c.record,s.record):!1});Q.a=o},gRFJ:function(F,Q,j){F.exports=[j("rdUC"),j("ynwM"),j("RELg"),j("DlR+"),j("CrYA"),j("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(F){return F<10?"0"+F:F}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(F){return rx_escapable.lastIndex=0,rx_escapable.test(F)?'"'+F.replace(rx_escapable,function(Q){var j=meta[Q];return typeof j=="string"?j:"\\u"+("0000"+Q.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+F+'"'}function str(F,Q){var j,N,v,C,k=gap,y,m=Q[F];m&&typeof m=="object"&&typeof m.toJSON=="function"&&(m=m.toJSON(F)),typeof rep=="function"&&(m=rep.call(Q,F,m));switch(typeof m){case"string":return quote(m);case"number":return isFinite(m)?String(m):"null";case"boolean":case"null":return String(m);case"object":if(!m)return"null";if(gap+=indent,y=[],Object.prototype.toString.apply(m)==="[object Array]"){for(C=m.length,j=0;j<C;j+=1)y[j]=str(j,m)||"null";return v=y.length===0?"[]":gap?`[
|
|
|
`+gap+y.join(`,
|
|
|
`+gap)+`
|
|
|
`+k+"]":"["+y.join(",")+"]",gap=k,v}if(rep&&typeof rep=="object")for(C=rep.length,j=0;j<C;j+=1)typeof rep[j]=="string"&&(N=rep[j],v=str(N,m),v&&y.push(quote(N)+(gap?": ":":")+v));else for(N in m)Object.prototype.hasOwnProperty.call(m,N)&&(v=str(N,m),v&&y.push(quote(N)+(gap?": ":":")+v));return v=y.length===0?"{}":gap?`{
|
|
|
`+gap+y.join(`,
|
|
|
`+gap)+`
|
|
|
`+k+"}":"{"+y.join(",")+"}",gap=k,v}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(F,Q,j){var N;if(gap="",indent="",typeof j=="number")for(N=0;N<j;N+=1)indent+=" ";else typeof j=="string"&&(indent=j);if(rep=Q,Q&&typeof Q!="function"&&(typeof Q!="object"||typeof Q.length!="number"))throw new Error("JSON.stringify");return str("",{"":F})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(F,Q){var j,N,v=F[Q];if(v&&typeof v=="object")for(j in v)Object.prototype.hasOwnProperty.call(v,j)&&(N=walk(v,j),N!==void 0?v[j]=N:delete v[j]);return reviver.call(F,Q,v)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(F){return"\\u"+("0000"+F.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(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.mode.ECB=function(){var v=N.lib.BlockCipherMode.extend();return v.Encryptor=v.extend({processBlock:function(C,k){this._cipher.encryptBlock(C,k)}}),v.Decryptor=v.extend({processBlock:function(C,k){this._cipher.decryptBlock(C,k)}}),v}(),N.mode.ECB})},h78n:function(F,Q,j){"use strict";j.d(Q,"a",function(){return A});var N=j("cDcd"),v=j.n(N),C=j("TSYQ"),k=j.n(C),y={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},m=function(W){var G=W.map(function(){return Object(N.useRef)()}),U=Object(N.useRef)();return Object(N.useEffect)(function(){var P=Date.now(),H=!1;Object.keys(G).forEach(function($){var re=G[$].current;if(!re)return;H=!0;var te=re.style;te.transitionDuration=".3s, .3s, .3s, .06s",U.current&&P-U.current<100&&(te.transitionDuration="0s, 0s")}),H&&(U.current=Date.now())}),[G]};function S(){return S=Object.assign||function(z){for(var W=1;W<arguments.length;W++){var G=arguments[W];for(var U in G)Object.prototype.hasOwnProperty.call(G,U)&&(z[U]=G[U])}return z},S.apply(this,arguments)}function b(z,W){return r(z)||l(z,W)||d(z,W)||p()}function p(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(z,W){if(!z)return;if(typeof z=="string")return t(z,W);var G=Object.prototype.toString.call(z).slice(8,-1);if(G==="Object"&&z.constructor&&(G=z.constructor.name),G==="Map"||G==="Set")return Array.from(z);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return t(z,W)}function t(z,W){(W==null||W>z.length)&&(W=z.length);for(var G=0,U=new Array(W);G<W;G++)U[G]=z[G];return U}function l(z,W){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(z)))return;var G=[],U=!0,P=!1,H=void 0;try{for(var $=z[Symbol.iterator](),re;!(U=(re=$.next()).done)&&!(G.push(re.value),W&&G.length===W);U=!0);}catch(te){P=!0,H=te}finally{try{!U&&$.return!=null&&$.return()}finally{if(P)throw H}}return G}function r(z){if(Array.isArray(z))return z}function i(z,W){if(z==null)return{};var G=o(z,W),U,P;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(z);for(P=0;P<H.length;P++){if(U=H[P],W.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,U))continue;G[U]=z[U]}}return G}function o(z,W){if(z==null)return{};var G={},U=Object.keys(z),P,H;for(H=0;H<U.length;H++){if(P=U[H],W.indexOf(P)>=0)continue;G[P]=z[P]}return G}var s=function(W){var G=W.className,U=W.percent,P=W.prefixCls,H=W.strokeColor,$=W.strokeLinecap,re=W.strokeWidth,te=W.style,ge=W.trailColor,ve=W.trailWidth,de=W.transition,De=i(W,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete De.gapPosition;var Te=Array.isArray(U)?U:[U],he=Array.isArray(H)?H:[H],ue=m(Te),ie=b(ue,1),Se=ie[0],ne=re/2,ce=100-re/2,Oe="M ".concat($==="round"?ne:0,",").concat(ne,`
|
|
|
L `).concat($==="round"?ce:100,",").concat(ne),oe="0 0 100 ".concat(re),q=0;return v.a.createElement("svg",S({className:k()("".concat(P,"-line"),G),viewBox:oe,preserveAspectRatio:"none",style:te},De),v.a.createElement("path",{className:"".concat(P,"-line-trail"),d:Oe,strokeLinecap:$,stroke:ge,strokeWidth:ve||re,fillOpacity:"0"}),Te.map(function(Y,Z){var ye={strokeDasharray:"".concat(Y,"px, 100px"),strokeDashoffset:"-".concat(q,"px"),transition:de||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},be=he[Z]||he[he.length-1];return q+=Y,v.a.createElement("path",{key:Z,className:"".concat(P,"-line-path"),d:Oe,strokeLinecap:$,stroke:be,strokeWidth:re,fillOpacity:"0",ref:Se[Z],style:ye})}))};s.defaultProps=y;var c=s;function a(){return a=Object.assign||function(z){for(var W=1;W<arguments.length;W++){var G=arguments[W];for(var U in G)Object.prototype.hasOwnProperty.call(G,U)&&(z[U]=G[U])}return z},a.apply(this,arguments)}function u(z,W){return R(z)||h(z,W)||w(z,W)||f()}function f(){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,W){if(!z)return;if(typeof z=="string")return _(z,W);var G=Object.prototype.toString.call(z).slice(8,-1);if(G==="Object"&&z.constructor&&(G=z.constructor.name),G==="Map"||G==="Set")return Array.from(z);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return _(z,W)}function _(z,W){(W==null||W>z.length)&&(W=z.length);for(var G=0,U=new Array(W);G<W;G++)U[G]=z[G];return U}function h(z,W){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(z)))return;var G=[],U=!0,P=!1,H=void 0;try{for(var $=z[Symbol.iterator](),re;!(U=(re=$.next()).done)&&!(G.push(re.value),W&&G.length===W);U=!0);}catch(te){P=!0,H=te}finally{try{!U&&$.return!=null&&$.return()}finally{if(P)throw H}}return G}function R(z){if(Array.isArray(z))return z}function O(z,W){if(z==null)return{};var G=g(z,W),U,P;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(z);for(P=0;P<H.length;P++){if(U=H[P],W.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,U))continue;G[U]=z[U]}}return G}function g(z,W){if(z==null)return{};var G={},U=Object.keys(z),P,H;for(H=0;H<U.length;H++){if(P=U[H],W.indexOf(P)>=0)continue;G[P]=z[P]}return G}var x=0;function E(z){return+z.replace("%","")}function T(z){return Array.isArray(z)?z:[z]}function M(z,W,G,U){var P=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,$=50-U/2,re=0,te=-$,ge=0,ve=-2*$;switch(H){case"left":re=-$,te=0,ge=2*$,ve=0;break;case"right":re=$,te=0,ge=-2*$,ve=0;break;case"bottom":te=$,ve=2*$;break;default:}var de="M 50,50 m ".concat(re,",").concat(te,`
|
|
|
a `).concat($,",").concat($," 0 1 1 ").concat(ge,",").concat(-ve,`
|
|
|
a `).concat($,",").concat($," 0 1 1 ").concat(-ge,",").concat(ve),De=Math.PI*2*$,Te={stroke:G,strokeDasharray:"".concat(W/100*(De-P),"px ").concat(De,"px"),strokeDashoffset:"-".concat(P/2+z/100*(De-P),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:de,pathStyle:Te}}var L=function(W){var G=W.prefixCls,U=W.strokeWidth,P=W.trailWidth,H=W.gapDegree,$=W.gapPosition,re=W.trailColor,te=W.strokeLinecap,ge=W.style,ve=W.className,de=W.strokeColor,De=W.percent,Te=O(W,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),he=Object(N.useMemo)(function(){return x+=1,x},[]),ue=M(0,100,re,U,H,$),ie=ue.pathString,Se=ue.pathStyle,ne=T(De),ce=T(de),Oe=ce.find(function(ye){return Object.prototype.toString.call(ye)==="[object Object]"}),oe=m(ne),q=u(oe,1),Y=q[0],Z=function(){var be=0;return ne.map(function(Re,Qe){var rt=ce[Qe]||ce[ce.length-1],at=Object.prototype.toString.call(rt)==="[object Object]"?"url(#".concat(G,"-gradient-").concat(he,")"):"",qe=M(be,Re,rt,U,H,$);return be+=Re,v.a.createElement("path",{key:Qe,className:"".concat(G,"-circle-path"),d:qe.pathString,stroke:at,strokeLinecap:te,strokeWidth:U,opacity:Re===0?0:1,fillOpacity:"0",style:qe.pathStyle,ref:Y[Qe]})})};return v.a.createElement("svg",a({className:k()("".concat(G,"-circle"),ve),viewBox:"0 0 100 100",style:ge},Te),Oe&&v.a.createElement("defs",null,v.a.createElement("linearGradient",{id:"".concat(G,"-gradient-").concat(he),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Oe).sort(function(ye,be){return E(ye)-E(be)}).map(function(ye,be){return v.a.createElement("stop",{key:be,offset:ye,stopColor:Oe[ye]})}))),v.a.createElement("path",{className:"".concat(G,"-circle-trail"),d:ie,stroke:re,strokeLinecap:te,strokeWidth:P||U,fillOpacity:"0",style:Se}),Z().reverse())};L.defaultProps=y;var A=L,V={Line:c,Circle:A}},hW8S:function(F,Q,j){"use strict";j.d(Q,"a",function(){return k}),j.d(Q,"c",function(){return y}),j.d(Q,"b",function(){return m});var N=j("VTBJ"),v=j("Ff2n"),C=j("Kwbf"),k="RC_TABLE_INTERNAL_COL_DEFINE";function y(S){var b=S.expandable,p=Object(v.a)(S,["expandable"]);return"expandable"in S?Object(N.a)(Object(N.a)({},p),b):p}function m(S){return Object.keys(S).reduce(function(b,p){return(p.substr(0,5)==="data-"||p.substr(0,5)==="aria-")&&(b[p]=S[p]),b},{})}},i3hx:function(F,Q,j){},jO9C:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.pad.Iso97971={pad:function(v,C){v.concat(N.lib.WordArray.create([2147483648],1)),N.pad.ZeroPadding.pad(v,C)},unpad:function(v){N.pad.ZeroPadding.unpad(v),v.sigBytes--}},N.pad.Iso97971})},je13:function(F,Q,j){var N=j("5nXd"),v=j("gRFJ"),C=[j("uQRt")];F.exports=N.createStore(v,C)},k3GJ:function(F,Q,j){"use strict";j.d(Q,"a",function(){return An});var N=j("rePB"),v=j("ODXe"),C=j("Ff2n"),k=j("VTBJ"),y=j("cDcd"),m=j("TSYQ"),S=j.n(m),b=j("Zm9Q"),p=j("6cGi"),d=j("KQm4"),t=j("xEkU"),l=j.n(t),r=j("t23M");function i(Pe){var Xe=Object(y.useRef)(),Je=Object(y.useRef)(!1);function Ue(){for(var _e=arguments.length,Le=new Array(_e),we=0;we<_e;we++)Le[we]=arguments[we];Je.current||(l.a.cancel(Xe.current),Xe.current=l()(function(){Pe.apply(void 0,Le)}))}return Object(y.useEffect)(function(){return function(){Je.current=!0,l.a.cancel(Xe.current)}},[]),Ue}function o(Pe){var Xe=Object(y.useRef)([]),Je=Object(y.useState)({}),Ue=Object(v.a)(Je,2),_e=Ue[1],Le=Object(y.useRef)(typeof Pe=="function"?Pe():Pe),we=i(function(){var Ge=Le.current;Xe.current.forEach(function($e){Ge=$e(Ge)}),Xe.current=[],Le.current=Ge,_e({})});function He(Ge){Xe.current.push(Ge),we()}return[Le.current,He]}var s=j("4IlW");function c(Pe,Xe){var Je,Ue=Pe.prefixCls,_e=Pe.id,Le=Pe.active,we=Pe.rtl,He=Pe.tab,Ge=He.key,$e=He.tab,Ye=He.disabled,nt=He.closeIcon,ht=Pe.tabBarGutter,St=Pe.tabPosition,Tt=Pe.closable,Mt=Pe.renderWrapper,er=Pe.removeAriaLabel,yr=Pe.editable,_r=Pe.onClick,Tr=Pe.onRemove,kr=Pe.onFocus,Dr="".concat(Ue,"-tab");y.useEffect(function(){return Tr},[]);var Sr={};St==="top"||St==="bottom"?Sr[we?"marginLeft":"marginRight"]=ht:Sr.marginBottom=ht;var Yr=yr&&Tt!==!1&&!Ye;function Ur(ur){if(Ye)return;_r(ur)}function Rn(ur){ur.preventDefault(),ur.stopPropagation(),yr.onEdit("remove",{key:Ge,event:ur})}var Br=y.createElement("div",{key:Ge,ref:Xe,className:S()(Dr,(Je={},Object(N.a)(Je,"".concat(Dr,"-with-remove"),Yr),Object(N.a)(Je,"".concat(Dr,"-active"),Le),Object(N.a)(Je,"".concat(Dr,"-disabled"),Ye),Je)),style:Sr,onClick:Ur},y.createElement("div",{role:"tab","aria-selected":Le,id:_e&&"".concat(_e,"-tab-").concat(Ge),className:"".concat(Dr,"-btn"),"aria-controls":_e&&"".concat(_e,"-panel-").concat(Ge),"aria-disabled":Ye,tabIndex:Ye?null:0,onClick:function(ir){ir.stopPropagation(),Ur(ir)},onKeyDown:function(ir){[s.a.SPACE,s.a.ENTER].includes(ir.which)&&(ir.preventDefault(),Ur(ir))},onFocus:kr},$e),Yr&&y.createElement("button",{type:"button","aria-label":er||"remove",tabIndex:0,className:"".concat(Dr,"-remove"),onClick:function(ir){ir.stopPropagation(),Rn(ir)}},nt||yr.removeIcon||"\xD7"));return Mt&&(Br=Mt(Br)),Br}var a=y.forwardRef(c),u={width:0,height:0,left:0,top:0};function f(Pe,Xe,Je){return Object(y.useMemo)(function(){for(var Ue,_e=new Map,Le=Xe.get((Ue=Pe[0])===null||Ue===void 0?void 0:Ue.key)||u,we=Le.left+Le.width,He=0;He<Pe.length;He+=1){var Ge=Pe[He].key,$e=Xe.get(Ge);if(!$e){var Ye;$e=Xe.get((Ye=Pe[He-1])===null||Ye===void 0?void 0:Ye.key)||u}var nt=_e.get(Ge)||Object(k.a)({},$e);nt.right=we-nt.left-nt.width,_e.set(Ge,nt)}return _e},[Pe.map(function(Ue){return Ue.key}).join("_"),Xe,Je])}var w={width:0,height:0,left:0,top:0,right:0};function _(Pe,Xe,Je,Ue,_e){var Le=_e.tabs,we=_e.tabPosition,He=_e.rtl,Ge,$e,Ye;["top","bottom"].includes(we)?(Ge="width",$e=He?"right":"left",Ye=Math.abs(Xe.left)):(Ge="height",$e="top",Ye=-Xe.top);var nt=Xe[Ge],ht=Je[Ge],St=Ue[Ge],Tt=nt;return ht+St>nt&&(Tt=nt-St),Object(y.useMemo)(function(){if(!Le.length)return[0,0];for(var Mt=Le.length,er=Mt,yr=0;yr<Mt;yr+=1){var _r=Pe.get(Le[yr].key)||w;if(_r[$e]+_r[Ge]>Ye+Tt){er=yr-1;break}}for(var Tr=0,kr=Mt-1;kr>=0;kr-=1){var Dr=Pe.get(Le[kr].key)||w;if(Dr[$e]<Ye){Tr=kr+1;break}}return[Tr,er]},[Pe,Ye,Tt,we,Le.map(function(Mt){return Mt.key}).join("_"),He])}var h=j("wx14"),R=j("1OyB"),O=j("vuIU"),g=j("JX7q"),x=j("Ji7U"),E=j("LK+K"),T=j("I8Z2"),M=j("bT9E"),L=j("2GS6"),A=j("Gytx"),V=j.n(A),z=j("U8pU"),W=/iPhone/i,G=/iPod/i,U=/iPad/i,P=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,$=/\bAndroid(?:.+)SD4930UR\b/i,re=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,te=/Windows Phone/i,ge=/\bWindows(?:.+)ARM\b/i,ve=/BlackBerry/i,de=/BB10/i,De=/Opera Mini/i,Te=/\b(CriOS|Chrome)(?:.+)Mobile/i,he=/Mobile(?:.+)Firefox\b/i;function ue(Pe,Xe){return Pe.test(Xe)}function ie(Pe){var Xe=Pe||(typeof navigator!="undefined"?navigator.userAgent:""),Je=(Xe||"").split("[FBAN");if(typeof Je[1]!="undefined"){var Ue=Je,_e=Object(v.a)(Ue,1);Xe=_e[0]}if(Je=Xe.split("Twitter"),typeof Je[1]!="undefined"){var Le=Je,we=Object(v.a)(Le,1);Xe=we[0]}var He={apple:{phone:ue(W,Xe)&&!ue(te,Xe),ipod:ue(G,Xe),tablet:!ue(W,Xe)&&ue(U,Xe)&&!ue(te,Xe),device:(ue(W,Xe)||ue(G,Xe)||ue(U,Xe))&&!ue(te,Xe)},amazon:{phone:ue($,Xe),tablet:!ue($,Xe)&&ue(re,Xe),device:ue($,Xe)||ue(re,Xe)},android:{phone:!ue(te,Xe)&&ue($,Xe)||!ue(te,Xe)&&ue(P,Xe),tablet:!ue(te,Xe)&&!ue($,Xe)&&!ue(P,Xe)&&(ue(re,Xe)||ue(H,Xe)),device:!ue(te,Xe)&&(ue($,Xe)||ue(re,Xe)||ue(P,Xe)||ue(H,Xe))||ue(/\bokhttp\b/i,Xe)},windows:{phone:ue(te,Xe),tablet:ue(ge,Xe),device:ue(te,Xe)||ue(ge,Xe)},other:{blackberry:ue(ve,Xe),blackberry10:ue(de,Xe),opera:ue(De,Xe),firefox:ue(he,Xe),chrome:ue(Te,Xe),device:ue(ve,Xe)||ue(de,Xe)||ue(De,Xe)||ue(he,Xe)||ue(Te,Xe)},any:null,phone:null,tablet:null};return He.any=He.apple.device||He.android.device||He.windows.device||He.other.device,He.phone=He.apple.phone||He.android.phone||He.windows.phone,He.tablet=He.apple.tablet||He.android.tablet||He.windows.tablet,He}var Se=Object(k.a)(Object(k.a)({},ie()),{},{isMobile:ie}),ne=Se;function ce(){}function Oe(Pe,Xe,Je){var Ue=Xe||"";return Pe.key||"".concat(Ue,"item_").concat(Je)}function oe(Pe){return"".concat(Pe,"-menu-")}function q(Pe,Xe){var Je=-1;y.Children.forEach(Pe,function(Ue){Je+=1,Ue&&Ue.type&&Ue.type.isMenuItemGroup?y.Children.forEach(Ue.props.children,function(_e){Je+=1,Xe(_e,Je)}):Xe(Ue,Je)})}function Y(Pe,Xe,Je){if(!Pe||Je.find)return;y.Children.forEach(Pe,function(Ue){if(Ue){var _e=Ue.type;if(!_e||!(_e.isSubMenu||_e.isMenuItem||_e.isMenuItemGroup))return;Xe.indexOf(Ue.key)!==-1?Je.find=!0:Ue.props.children&&Y(Ue.props.children,Xe,Je)}})}var Z=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],ye=function(Xe){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=Xe&&typeof Xe.getBoundingClientRect=="function"&&Xe.getBoundingClientRect().width;if(Ue){if(Je){var _e=getComputedStyle(Xe),Le=_e.marginLeft,we=_e.marginRight;Ue+=+Le.replace("px","")+ +we.replace("px","")}Ue=+Ue.toFixed(6)}return Ue||0},be=function(Xe,Je,Ue){Xe&&Object(z.a)(Xe.style)==="object"&&(Xe.style[Je]=Ue)},Re=function(){return ne.any},Qe=j("bdgK"),rt=j("faye"),at=j.n(rt),qe=j("wgJM"),st=j("l4aY"),lt=j("m+aA"),je=j("c+Xe"),Ie=j("zT1h"),tt=j("QC+M");function ot(Pe,Xe,Je){return Je?Pe[0]===Xe[0]:Pe[0]===Xe[0]&&Pe[1]===Xe[1]}function ze(Pe,Xe,Je){var Ue=Pe[Xe]||{};return Object(k.a)(Object(k.a)({},Ue),Je)}function Ze(Pe,Xe,Je,Ue){for(var _e=Je.points,Le=Object.keys(Pe),we=0;we<Le.length;we+=1){var He=Le[we];if(ot(Pe[He].points,_e,Ue))return"".concat(Xe,"-placement-").concat(He)}return""}var Ne=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Pe=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Pe)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Pe==null?void 0:Pe.substr(0,4)))},Ae=j("MNnm");function Me(Pe,Xe){var Je={};return Je[Pe.toLowerCase()]=Xe.toLowerCase(),Je["Webkit".concat(Pe)]="webkit".concat(Xe),Je["Moz".concat(Pe)]="moz".concat(Xe),Je["ms".concat(Pe)]="MS".concat(Xe),Je["O".concat(Pe)]="o".concat(Xe.toLowerCase()),Je}function Ee(Pe,Xe){var Je={animationend:Me("Animation","AnimationEnd"),transitionend:Me("Transition","TransitionEnd")};return Pe&&("AnimationEvent"in Xe||delete Je.animationend.animation,"TransitionEvent"in Xe||delete Je.transitionend.transition),Je}var Ce=Ee(Object(Ae.a)(),typeof window!="undefined"?window:{}),ke={};if(Object(Ae.a)()){var Fe=document.createElement("div");ke=Fe.style}var Be={};function et(Pe){if(Be[Pe])return Be[Pe];var Xe=Ce[Pe];if(Xe)for(var Je=Object.keys(Xe),Ue=Je.length,_e=0;_e<Ue;_e+=1){var Le=Je[_e];if(Object.prototype.hasOwnProperty.call(Xe,Le)&&Le in ke)return Be[Pe]=Xe[Le],Be[Pe]}return""}var ct=et("animationend"),yt=et("transitionend"),ft=!!(ct&&yt),mt=ct||"animationend",It=yt||"transitionend";function At(Pe,Xe){if(!Pe)return null;if(Object(z.a)(Pe)==="object"){var Je=Xe.replace(/-\w/g,function(Ue){return Ue[1].toUpperCase()});return Pe[Je]}return"".concat(Pe,"-").concat(Xe)}var _t="none",Vt="appear",Kt="enter",tr="leave",rr="none",Wt="prepare",Lt="start",nr="active",dt="end";function Et(Pe){var Xe=Object(y.useRef)(!1),Je=Object(y.useState)(Pe),Ue=Object(v.a)(Je,2),_e=Ue[0],Le=Ue[1];function we(He){Xe.current||Le(He)}return Object(y.useEffect)(function(){return function(){Xe.current=!0}},[]),[_e,we]}var jt=Object(Ae.a)()?y.useLayoutEffect:y.useEffect,kt=jt,hr=function(){var Pe=y.useRef(null);function Xe(){qe.a.cancel(Pe.current)}function Je(Ue){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Xe();var Le=Object(qe.a)(function(){_e<=1?Ue({isCanceled:function(){return Le!==Pe.current}}):Je(Ue,_e-1)});Pe.current=Le}return y.useEffect(function(){return function(){Xe()}},[]),[Je,Xe]},Nn=[Wt,Lt,nr,dt],Ct=!1,Dt=!0;function wt(Pe){return Pe===nr||Pe===dt}var wr=function(Pe,Xe){var Je=y.useState(rr),Ue=Object(v.a)(Je,2),_e=Ue[0],Le=Ue[1],we=hr(),He=Object(v.a)(we,2),Ge=He[0],$e=He[1];function Ye(){Le(Wt)}return kt(function(){if(_e!==rr&&_e!==dt){var nt=Nn.indexOf(_e),ht=Nn[nt+1],St=Xe(_e);St===Ct?Le(ht):Ge(function(Tt){function Mt(){if(Tt.isCanceled())return;Le(ht)}St===!0?Mt():Promise.resolve(St).then(Mt)})}},[Pe,_e]),y.useEffect(function(){return function(){$e()}},[]),[Ye,_e]},Cr=function(Pe){var Xe=Object(y.useRef)(),Je=Object(y.useRef)(Pe);Je.current=Pe;var Ue=y.useCallback(function(we){Je.current(we)},[]);function _e(we){we&&(we.removeEventListener(It,Ue),we.removeEventListener(mt,Ue))}function Le(we){Xe.current&&Xe.current!==we&&_e(Xe.current),we&&we!==Xe.current&&(we.addEventListener(It,Ue),we.addEventListener(mt,Ue),Xe.current=we)}return y.useEffect(function(){return function(){_e(Xe.current)}},[]),[Le,_e]};function Jt(Pe,Xe,Je,Ue){var _e=Ue.motionEnter,Le=_e===void 0?!0:_e,we=Ue.motionAppear,He=we===void 0?!0:we,Ge=Ue.motionLeave,$e=Ge===void 0?!0:Ge,Ye=Ue.motionDeadline,nt=Ue.motionLeaveImmediately,ht=Ue.onAppearPrepare,St=Ue.onEnterPrepare,Tt=Ue.onLeavePrepare,Mt=Ue.onAppearStart,er=Ue.onEnterStart,yr=Ue.onLeaveStart,_r=Ue.onAppearActive,Tr=Ue.onEnterActive,kr=Ue.onLeaveActive,Dr=Ue.onAppearEnd,Sr=Ue.onEnterEnd,Yr=Ue.onLeaveEnd,Ur=Ue.onVisibleChanged,Rn=Et(),Br=Object(v.a)(Rn,2),ur=Br[0],ir=Br[1],Wr=Et(_t),$r=Object(v.a)(Wr,2),Zt=$r[0],en=$r[1],In=Et(null),an=Object(v.a)(In,2),vn=an[0],pn=an[1],Wn=Object(y.useRef)(!1),ri=Object(y.useRef)(null),kn=Object(y.useRef)(!1),xi=Object(y.useRef)(null);function Wi(){var xn=Je();return xn||xi.current}var Ci=Object(y.useRef)(!1);function ni(xn){var fn=Wi();if(xn&&!xn.deadline&&xn.target!==fn)return;var ii;Zt===Vt&&Ci.current?ii=Dr==null?void 0:Dr(fn,xn):Zt===Kt&&Ci.current?ii=Sr==null?void 0:Sr(fn,xn):Zt===tr&&Ci.current&&(ii=Yr==null?void 0:Yr(fn,xn)),ii!==!1&&!kn.current&&(en(_t),pn(null))}var wn=Cr(ni),yn=Object(v.a)(wn,1),Mn=yn[0],Dn=y.useMemo(function(){var xn,fn,ii;switch(Zt){case"appear":return xn={},Object(N.a)(xn,Wt,ht),Object(N.a)(xn,Lt,Mt),Object(N.a)(xn,nr,_r),xn;case"enter":return fn={},Object(N.a)(fn,Wt,St),Object(N.a)(fn,Lt,er),Object(N.a)(fn,nr,Tr),fn;case"leave":return ii={},Object(N.a)(ii,Wt,Tt),Object(N.a)(ii,Lt,yr),Object(N.a)(ii,nr,kr),ii;default:return{}}},[Zt]),zi=wr(Zt,function(xn){if(xn===Wt){var fn=Dn[Wt];return fn?fn(Wi()):Ct}if(mn in Dn){var ii;pn(((ii=Dn[mn])===null||ii===void 0?void 0:ii.call(Dn,Wi(),null))||null)}return mn===nr&&(Mn(Wi()),Ye>0&&(clearTimeout(ri.current),ri.current=setTimeout(function(){ni({deadline:!0})},Ye))),Dt}),ta=Object(v.a)(zi,2),ra=ta[0],mn=ta[1],Ji=wt(mn);Ci.current=Ji,kt(function(){ir(Xe);var xn=Wn.current;if(Wn.current=!0,!Pe)return;var fn;!xn&&Xe&&He&&(fn=Vt),xn&&Xe&&Le&&(fn=Kt),(xn&&!Xe&&$e||!xn&&nt&&!Xe&&$e)&&(fn=tr),fn&&(en(fn),ra())},[Xe]),Object(y.useEffect)(function(){(Zt===Vt&&!He||Zt===Kt&&!Le||Zt===tr&&!$e)&&en(_t)},[He,Le,$e]),Object(y.useEffect)(function(){return function(){clearTimeout(ri.current),kn.current=!0}},[]),Object(y.useEffect)(function(){ur!==void 0&&Zt===_t&&(Ur==null||Ur(ur))},[ur,Zt]);var na=vn;return Dn[Wt]&&mn===Lt&&(na=Object(k.a)({transition:"none"},na)),[Zt,mn,na,ur!=null?ur:Xe]}var Ut=function(Pe){Object(x.a)(Je,Pe);var Xe=Object(E.a)(Je);function Je(){return Object(R.a)(this,Je),Xe.apply(this,arguments)}return Object(O.a)(Je,[{key:"render",value:function(){return this.props.children}}]),Je}(y.Component),Or=Ut;function un(Pe){var Xe=Pe;Object(z.a)(Pe)==="object"&&(Xe=Pe.transitionSupport);function Je(_e){return!!(_e.motionName&&Xe)}var Ue=y.forwardRef(function(_e,Le){var we=_e.visible,He=we===void 0?!0:we,Ge=_e.removeOnLeave,$e=Ge===void 0?!0:Ge,Ye=_e.forceRender,nt=_e.children,ht=_e.motionName,St=_e.leavedClassName,Tt=_e.eventProps,Mt=Je(_e),er=Object(y.useRef)(),yr=Object(y.useRef)();function _r(){try{return Object(lt.a)(er.current||yr.current)}catch(en){return null}}var Tr=Jt(Mt,He,_r,_e),kr=Object(v.a)(Tr,4),Dr=kr[0],Sr=kr[1],Yr=kr[2],Ur=kr[3],Rn=y.useRef(Ur);Ur&&(Rn.current=!0);var Br=Object(y.useRef)(Le);Br.current=Le;var ur=y.useCallback(function(en){er.current=en,Object(je.b)(Br.current,en)},[]),ir,Wr=Object(k.a)(Object(k.a)({},Tt),{},{visible:He});if(!nt)ir=null;else if(Dr===_t||!Je(_e))Ur?ir=nt(Object(k.a)({},Wr),ur):!$e&&Rn.current?ir=nt(Object(k.a)(Object(k.a)({},Wr),{},{className:St}),ur):Ye?ir=nt(Object(k.a)(Object(k.a)({},Wr),{},{style:{display:"none"}}),ur):ir=null;else{var $r,Zt;Sr===Wt?Zt="prepare":wt(Sr)?Zt="active":Sr===Lt&&(Zt="start"),ir=nt(Object(k.a)(Object(k.a)({},Wr),{},{className:S()(At(ht,Dr),($r={},Object(N.a)($r,At(ht,"".concat(Dr,"-").concat(Zt)),Zt),Object(N.a)($r,ht,typeof ht=="string"),$r)),style:Yr}),ur)}return y.createElement(Or,{ref:yr},ir)});return Ue.displayName="CSSMotion",Ue}var Nr=un(ft),bt="add",Bt="keep",Jr="remove",on="removed";function Ln(Pe){var Xe;return Pe&&Object(z.a)(Pe)==="object"&&"key"in Pe?Xe=Pe:Xe={key:Pe},Object(k.a)(Object(k.a)({},Xe),{},{key:String(Xe.key)})}function Sn(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Pe.map(Ln)}function le(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Je=[],Ue=0,_e=Xe.length,Le=Sn(Pe),we=Sn(Xe);Le.forEach(function($e){for(var Ye=!1,nt=Ue;nt<_e;nt+=1){var ht=we[nt];if(ht.key===$e.key){Ue<nt&&(Je=Je.concat(we.slice(Ue,nt).map(function(St){return Object(k.a)(Object(k.a)({},St),{},{status:bt})})),Ue=nt),Je.push(Object(k.a)(Object(k.a)({},ht),{},{status:Bt})),Ue+=1,Ye=!0;break}}Ye||Je.push(Object(k.a)(Object(k.a)({},$e),{},{status:Jr}))}),Ue<_e&&(Je=Je.concat(we.slice(Ue).map(function($e){return Object(k.a)(Object(k.a)({},$e),{},{status:bt})})));var He={};Je.forEach(function($e){var Ye=$e.key;He[Ye]=(He[Ye]||0)+1});var Ge=Object.keys(He).filter(function($e){return He[$e]>1});return Ge.forEach(function($e){Je=Je.filter(function(Ye){var nt=Ye.key,ht=Ye.status;return nt!==$e||ht!==Jr}),Je.forEach(function(Ye){Ye.key===$e&&(Ye.status=Bt)})}),Je}var K=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function X(Pe){var Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Nr,Je=function(Ue){Object(x.a)(Le,Ue);var _e=Object(E.a)(Le);function Le(){var we;return Object(R.a)(this,Le),we=_e.apply(this,arguments),we.state={keyEntities:[]},we.removeKey=function(He){we.setState(function(Ge){var $e=Ge.keyEntities;return{keyEntities:$e.map(function(Ye){return Ye.key!==He?Ye:Object(k.a)(Object(k.a)({},Ye),{},{status:on})})}})},we}return Object(O.a)(Le,[{key:"render",value:function(){var He=this,Ge=this.state.keyEntities,$e=this.props,Ye=$e.component,nt=$e.children,ht=$e.onVisibleChanged,St=Object(C.a)($e,["component","children","onVisibleChanged"]),Tt=Ye||y.Fragment,Mt={};return K.forEach(function(er){Mt[er]=St[er],delete St[er]}),delete St.keys,y.createElement(Tt,St,Ge.map(function(er){var yr=er.status,_r=Object(C.a)(er,["status"]),Tr=yr===bt||yr===Bt;return y.createElement(Xe,Object(h.a)({},Mt,{key:_r.key,visible:Tr,eventProps:_r,onVisibleChanged:function(Dr){ht==null||ht(Dr,{key:_r.key}),Dr||He.removeKey(_r.key)}}),nt)}))}}],[{key:"getDerivedStateFromProps",value:function(He,Ge){var $e=He.keys,Ye=Ge.keyEntities,nt=Sn($e),ht=le(Ye,nt);return{keyEntities:ht.filter(function(St){var Tt=Ye.find(function(Mt){var er=Mt.key;return St.key===er});return!(Tt&&Tt.status===on&&St.status===Jr)})}}}]),Le}(y.Component);return Je.defaultProps={component:"div"},Je}var ee=X(ft),me=Nr;function ae(Pe){var Xe=Pe.prefixCls,Je=Pe.motion,Ue=Pe.animation,_e=Pe.transitionName;return Je||(Ue?{motionName:"".concat(Xe,"-").concat(Ue)}:_e?{motionName:_e}:null)}function Ke(Pe){var Xe=Pe.prefixCls,Je=Pe.visible,Ue=Pe.zIndex,_e=Pe.mask,Le=Pe.maskMotion,we=Pe.maskAnimation,He=Pe.maskTransitionName;if(!_e)return null;var Ge={};return(Le||He||we)&&(Ge=Object(k.a)({motionAppear:!0},ae({motion:Le,prefixCls:Xe,transitionName:He,animation:we}))),y.createElement(me,Object(h.a)({},Ge,{visible:Je,removeOnLeave:!0}),function($e){var Ye=$e.className;return y.createElement("div",{style:{zIndex:Ue},className:S()("".concat(Xe,"-mask"),Ye)})})}var pt=j("9mu1"),Ot=j("o0o1"),Ht=j.n(Ot),vt=j("HaE+"),Xt=["measure","align",null,"motion"],qt=function(Pe,Xe){var Je=Object(y.useState)(null),Ue=Object(v.a)(Je,2),_e=Ue[0],Le=Ue[1],we=Object(y.useRef)(),He=Object(y.useRef)(!1);function Ge(nt){He.current||Le(nt)}function $e(){qe.a.cancel(we.current)}function Ye(nt){$e(),we.current=Object(qe.a)(function(){Ge(function(ht){switch(_e){case"align":return"motion";case"motion":return"stable";default:}return ht}),nt==null||nt()})}return Object(y.useEffect)(function(){Ge("measure")},[Pe]),Object(y.useEffect)(function(){switch(_e){case"measure":Xe();break;default:}_e&&(we.current=Object(qe.a)(Object(vt.a)(Ht.a.mark(function nt(){var ht,St;return Ht.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:ht=Xt.indexOf(_e),St=Xt[ht+1],St&&ht!==-1&&Ge(St);case 3:case"end":return Mt.stop()}},nt)}))))},[_e]),Object(y.useEffect)(function(){return function(){He.current=!0,$e()}},[]),[_e,Ye]},Hr=function(Pe){var Xe=y.useState({width:0,height:0}),Je=Object(v.a)(Xe,2),Ue=Je[0],_e=Je[1];function Le(He){_e({width:He.offsetWidth,height:He.offsetHeight})}var we=y.useMemo(function(){var He={};if(Pe){var Ge=Ue.width,$e=Ue.height;Pe.indexOf("height")!==-1&&$e?He.height=$e:Pe.indexOf("minHeight")!==-1&&$e&&(He.minHeight=$e),Pe.indexOf("width")!==-1&&Ge?He.width=Ge:Pe.indexOf("minWidth")!==-1&&Ge&&(He.minWidth=Ge)}return He},[Pe,Ue]);return[we,Le]},nn=y.forwardRef(function(Pe,Xe){var Je=Pe.visible,Ue=Pe.prefixCls,_e=Pe.className,Le=Pe.style,we=Pe.children,He=Pe.zIndex,Ge=Pe.stretch,$e=Pe.destroyPopupOnHide,Ye=Pe.forceRender,nt=Pe.align,ht=Pe.point,St=Pe.getRootDomNode,Tt=Pe.getClassNameFromAlign,Mt=Pe.onAlign,er=Pe.onMouseEnter,yr=Pe.onMouseLeave,_r=Pe.onMouseDown,Tr=Pe.onTouchStart,kr=Object(y.useRef)(),Dr=Object(y.useRef)(),Sr=Object(y.useState)(),Yr=Object(v.a)(Sr,2),Ur=Yr[0],Rn=Yr[1],Br=Hr(Ge),ur=Object(v.a)(Br,2),ir=ur[0],Wr=ur[1];function $r(){Ge&&Wr(St())}var Zt=qt(Je,$r),en=Object(v.a)(Zt,2),In=en[0],an=en[1],vn=Object(y.useRef)();function pn(){return ht||St}function Wn(){var wn;(wn=kr.current)===null||wn===void 0||wn.forceAlign()}function ri(wn,yn){var Mn=Tt(yn);Ur!==Mn&&Rn(Mn),In==="align"&&(Ur!==Mn?Promise.resolve().then(function(){Wn()}):an(function(){var Dn;(Dn=vn.current)===null||Dn===void 0||Dn.call(vn)}),Mt==null||Mt(wn,yn))}var kn=Object(k.a)({},ae(Pe));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(wn){var yn=kn[wn];kn[wn]=function(Mn,Dn){return an(),yn==null?void 0:yn(Mn,Dn)}});function xi(){return new Promise(function(wn){vn.current=wn})}y.useEffect(function(){!kn.motionName&&In==="motion"&&an()},[kn.motionName,In]),y.useImperativeHandle(Xe,function(){return{forceAlign:Wn,getElement:function(){return Dr.current}}});var Wi=Object(k.a)(Object(k.a)({},ir),{},{zIndex:He,opacity:In==="motion"||In==="stable"||!Je?void 0:0,pointerEvents:In==="stable"?void 0:"none"},Le),Ci=!0;(nt==null?void 0:nt.points)&&(In==="align"||In==="stable")&&(Ci=!1);var ni=we;return y.Children.count(we)>1&&(ni=y.createElement("div",{className:"".concat(Ue,"-content")},we)),y.createElement(me,Object(h.a)({visible:Je,ref:Dr,leavedClassName:"".concat(Ue,"-hidden")},kn,{onAppearPrepare:xi,onEnterPrepare:xi,removeOnLeave:$e,forceRender:Ye}),function(wn,yn){var Mn=wn.className,Dn=wn.style,zi=S()(Ue,_e,Ur,Mn);return y.createElement(pt.a,{target:pn(),key:"popup",ref:kr,monitorWindowResize:!0,disabled:Ci,align:nt,onAlign:ri},y.createElement("div",{ref:yn,className:zi,onMouseEnter:er,onMouseLeave:yr,onMouseDownCapture:_r,onTouchStartCapture:Tr,style:Object(k.a)(Object(k.a)({},Dn),Wi)},ni))})});nn.displayName="PopupInner";var zr=nn,or=y.forwardRef(function(Pe,Xe){var Je=Pe.prefixCls,Ue=Pe.visible,_e=Pe.zIndex,Le=Pe.children,we=Pe.mobile;we=we===void 0?{}:we;var He=we.popupClassName,Ge=we.popupStyle,$e=we.popupMotion,Ye=$e===void 0?{}:$e,nt=we.popupRender,ht=y.useRef();y.useImperativeHandle(Xe,function(){return{forceAlign:function(){},getElement:function(){return ht.current}}});var St=Object(k.a)({zIndex:_e},Ge),Tt=Le;return y.Children.count(Le)>1&&(Tt=y.createElement("div",{className:"".concat(Je,"-content")},Le)),nt&&(Tt=nt(Tt)),y.createElement(me,Object(h.a)({visible:Ue,ref:ht,removeOnLeave:!0},Ye),function(Mt,er){var yr=Mt.className,_r=Mt.style,Tr=S()(Je,He,yr);return y.createElement("div",{ref:er,className:Tr,style:Object(k.a)(Object(k.a)({},_r),St)},Tt)})});or.displayName="MobilePopupInner";var Qr=or,Cn=["visible","mobile"],zt=y.forwardRef(function(Pe,Xe){var Je=Pe.visible,Ue=Pe.mobile,_e=Object(C.a)(Pe,Cn),Le=Object(y.useState)(Je),we=Object(v.a)(Le,2),He=we[0],Ge=we[1],$e=Object(y.useState)(!1),Ye=Object(v.a)($e,2),nt=Ye[0],ht=Ye[1],St=Object(k.a)(Object(k.a)({},_e),{},{visible:He});Object(y.useEffect)(function(){Ge(Je),Je&&Ue&&ht(Ne())},[Je,Ue]);var Tt=nt?y.createElement(Qr,Object(h.a)({},St,{mobile:Ue,ref:Xe})):y.createElement(zr,Object(h.a)({},St,{ref:Xe}));return y.createElement("div",null,y.createElement(Ke,St),Tt)});zt.displayName="Popup";var pr=zt,fr=y.createContext(null),jr=fr;function Er(){}function li(){return""}function On(Pe){return Pe?Pe.ownerDocument:window.document}var Ui=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Bi(Pe){var Xe=function(Je){Object(x.a)(_e,Je);var Ue=Object(E.a)(_e);function _e(Le){var we;Object(R.a)(this,_e),we=Ue.call(this,Le),we.popupRef=y.createRef(),we.triggerRef=y.createRef(),we.attachId=void 0,we.clickOutsideHandler=void 0,we.touchOutsideHandler=void 0,we.contextMenuOutsideHandler1=void 0,we.contextMenuOutsideHandler2=void 0,we.mouseDownTimeout=void 0,we.focusTime=void 0,we.preClickTime=void 0,we.preTouchTime=void 0,we.delayTimer=void 0,we.hasPopupMouseDown=void 0,we.onMouseEnter=function(Ge){var $e=we.props.mouseEnterDelay;we.fireEvents("onMouseEnter",Ge),we.delaySetPopupVisible(!0,$e,$e?null:Ge)},we.onMouseMove=function(Ge){we.fireEvents("onMouseMove",Ge),we.setPoint(Ge)},we.onMouseLeave=function(Ge){we.fireEvents("onMouseLeave",Ge),we.delaySetPopupVisible(!1,we.props.mouseLeaveDelay)},we.onPopupMouseEnter=function(){we.clearDelayTimer()},we.onPopupMouseLeave=function(Ge){var $e;if(Ge.relatedTarget&&!Ge.relatedTarget.setTimeout&&Object(st.a)(($e=we.popupRef.current)===null||$e===void 0?void 0:$e.getElement(),Ge.relatedTarget))return;we.delaySetPopupVisible(!1,we.props.mouseLeaveDelay)},we.onFocus=function(Ge){we.fireEvents("onFocus",Ge),we.clearDelayTimer(),we.isFocusToShow()&&(we.focusTime=Date.now(),we.delaySetPopupVisible(!0,we.props.focusDelay))},we.onMouseDown=function(Ge){we.fireEvents("onMouseDown",Ge),we.preClickTime=Date.now()},we.onTouchStart=function(Ge){we.fireEvents("onTouchStart",Ge),we.preTouchTime=Date.now()},we.onBlur=function(Ge){we.fireEvents("onBlur",Ge),we.clearDelayTimer(),we.isBlurToHide()&&we.delaySetPopupVisible(!1,we.props.blurDelay)},we.onContextMenu=function(Ge){Ge.preventDefault(),we.fireEvents("onContextMenu",Ge),we.setPopupVisible(!0,Ge)},we.onContextMenuClose=function(){we.isContextMenuToShow()&&we.close()},we.onClick=function(Ge){if(we.fireEvents("onClick",Ge),we.focusTime){var $e;if(we.preClickTime&&we.preTouchTime?$e=Math.min(we.preClickTime,we.preTouchTime):we.preClickTime?$e=we.preClickTime:we.preTouchTime&&($e=we.preTouchTime),Math.abs($e-we.focusTime)<20)return;we.focusTime=0}we.preClickTime=0,we.preTouchTime=0,we.isClickToShow()&&(we.isClickToHide()||we.isBlurToHide())&&Ge&&Ge.preventDefault&&Ge.preventDefault();var Ye=!we.state.popupVisible;(we.isClickToHide()&&!Ye||Ye&&we.isClickToShow())&&we.setPopupVisible(!we.state.popupVisible,Ge)},we.onPopupMouseDown=function(){if(we.hasPopupMouseDown=!0,clearTimeout(we.mouseDownTimeout),we.mouseDownTimeout=window.setTimeout(function(){we.hasPopupMouseDown=!1},0),we.context){var Ge;(Ge=we.context).onPopupMouseDown.apply(Ge,arguments)}},we.onDocumentClick=function(Ge){if(we.props.mask&&!we.props.maskClosable)return;var $e=Ge.target,Ye=we.getRootDomNode(),nt=we.getPopupDomNode();(!Object(st.a)(Ye,$e)||we.isContextMenuOnly())&&!Object(st.a)(nt,$e)&&!we.hasPopupMouseDown&&we.close()},we.getRootDomNode=function(){var Ge=we.props.getTriggerDOMNode;if(Ge)return Ge(we.triggerRef.current);try{var $e=Object(lt.a)(we.triggerRef.current);if($e)return $e}catch(Ye){}return at.a.findDOMNode(Object(g.a)(we))},we.getPopupClassNameFromAlign=function(Ge){var $e=[],Ye=we.props,nt=Ye.popupPlacement,ht=Ye.builtinPlacements,St=Ye.prefixCls,Tt=Ye.alignPoint,Mt=Ye.getPopupClassNameFromAlign;return nt&&ht&&$e.push(Ze(ht,St,Ge,Tt)),Mt&&$e.push(Mt(Ge)),$e.join(" ")},we.getComponent=function(){var Ge=we.props,$e=Ge.prefixCls,Ye=Ge.destroyPopupOnHide,nt=Ge.popupClassName,ht=Ge.onPopupAlign,St=Ge.popupMotion,Tt=Ge.popupAnimation,Mt=Ge.popupTransitionName,er=Ge.popupStyle,yr=Ge.mask,_r=Ge.maskAnimation,Tr=Ge.maskTransitionName,kr=Ge.maskMotion,Dr=Ge.zIndex,Sr=Ge.popup,Yr=Ge.stretch,Ur=Ge.alignPoint,Rn=Ge.mobile,Br=Ge.forceRender,ur=we.state,ir=ur.popupVisible,Wr=ur.point,$r=we.getPopupAlign(),Zt={};return we.isMouseEnterToShow()&&(Zt.onMouseEnter=we.onPopupMouseEnter),we.isMouseLeaveToHide()&&(Zt.onMouseLeave=we.onPopupMouseLeave),Zt.onMouseDown=we.onPopupMouseDown,Zt.onTouchStart=we.onPopupMouseDown,y.createElement(pr,Object(h.a)({prefixCls:$e,destroyPopupOnHide:Ye,visible:ir,point:Ur&&Wr,className:nt,align:$r,onAlign:ht,animation:Tt,getClassNameFromAlign:we.getPopupClassNameFromAlign},Zt,{stretch:Yr,getRootDomNode:we.getRootDomNode,style:er,mask:yr,zIndex:Dr,transitionName:Mt,maskAnimation:_r,maskTransitionName:Tr,maskMotion:kr,ref:we.popupRef,motion:St,mobile:Rn,forceRender:Br}),typeof Sr=="function"?Sr():Sr)},we.attachParent=function(Ge){qe.a.cancel(we.attachId);var $e=we.props,Ye=$e.getPopupContainer,nt=$e.getDocument,ht=we.getRootDomNode(),St;Ye?(ht||Ye.length===0)&&(St=Ye(ht)):St=nt(we.getRootDomNode()).body,St?St.appendChild(Ge):we.attachId=Object(qe.a)(function(){we.attachParent(Ge)})},we.getContainer=function(){var Ge=we.props.getDocument,$e=Ge(we.getRootDomNode()).createElement("div");return $e.style.position="absolute",$e.style.top="0",$e.style.left="0",$e.style.width="100%",we.attachParent($e),$e},we.setPoint=function(Ge){var $e=we.props.alignPoint;if(!$e||!Ge)return;we.setState({point:{pageX:Ge.pageX,pageY:Ge.pageY}})},we.handlePortalUpdate=function(){we.state.prevPopupVisible!==we.state.popupVisible&&we.props.afterPopupVisibleChange(we.state.popupVisible)},we.triggerContextValue={onPopupMouseDown:we.onPopupMouseDown};var He;return"popupVisible"in Le?He=!!Le.popupVisible:He=!!Le.defaultPopupVisible,we.state={prevPopupVisible:He,popupVisible:He},Ui.forEach(function(Ge){we["fire".concat(Ge)]=function($e){we.fireEvents(Ge,$e)}}),we}return Object(O.a)(_e,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var we=this.props,He=this.state;if(He.popupVisible){var Ge;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Ge=we.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ie.a)(Ge,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Ge=Ge||we.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ie.a)(Ge,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Ge=Ge||we.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ie.a)(Ge,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ie.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),qe.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var we;return((we=this.popupRef.current)===null||we===void 0?void 0:we.getElement())||null}},{key:"getPopupAlign",value:function(){var we=this.props,He=we.popupPlacement,Ge=we.popupAlign,$e=we.builtinPlacements;return He&&$e?ze($e,He,Ge):Ge}},{key:"setPopupVisible",value:function(we,He){var Ge=this.props.alignPoint,$e=this.state.popupVisible;this.clearDelayTimer(),$e!==we&&("popupVisible"in this.props||this.setState({popupVisible:we,prevPopupVisible:$e}),this.props.onPopupVisibleChange(we)),Ge&&He&&we&&this.setPoint(He)}},{key:"delaySetPopupVisible",value:function(we,He,Ge){var $e=this,Ye=He*1e3;if(this.clearDelayTimer(),Ye){var nt=Ge?{pageX:Ge.pageX,pageY:Ge.pageY}:null;this.delayTimer=window.setTimeout(function(){$e.setPopupVisible(we,nt),$e.clearDelayTimer()},Ye)}else this.setPopupVisible(we,Ge)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(we){var He=this.props.children.props,Ge=this.props;return He[we]&&Ge[we]?this["fire".concat(we)]:He[we]||Ge[we]}},{key:"isClickToShow",value:function(){var we=this.props,He=we.action,Ge=we.showAction;return He.indexOf("click")!==-1||Ge.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var we=this.props.action;return we==="contextMenu"||we.length===1&&we[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var we=this.props,He=we.action,Ge=we.showAction;return He.indexOf("contextMenu")!==-1||Ge.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var we=this.props,He=we.action,Ge=we.hideAction;return He.indexOf("click")!==-1||Ge.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var we=this.props,He=we.action,Ge=we.showAction;return He.indexOf("hover")!==-1||Ge.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var we=this.props,He=we.action,Ge=we.hideAction;return He.indexOf("hover")!==-1||Ge.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var we=this.props,He=we.action,Ge=we.showAction;return He.indexOf("focus")!==-1||Ge.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var we=this.props,He=we.action,Ge=we.hideAction;return He.indexOf("focus")!==-1||Ge.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var we;(we=this.popupRef.current)===null||we===void 0||we.forceAlign()}}},{key:"fireEvents",value:function(we,He){var Ge=this.props.children.props[we];Ge&&Ge(He);var $e=this.props[we];$e&&$e(He)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var we=this.state.popupVisible,He=this.props,Ge=He.children,$e=He.forceRender,Ye=He.alignPoint,nt=He.className,ht=He.autoDestroy,St=y.Children.only(Ge),Tt={key:"trigger"};this.isContextMenuToShow()?Tt.onContextMenu=this.onContextMenu:Tt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Tt.onClick=this.onClick,Tt.onMouseDown=this.onMouseDown,Tt.onTouchStart=this.onTouchStart):(Tt.onClick=this.createTwoChains("onClick"),Tt.onMouseDown=this.createTwoChains("onMouseDown"),Tt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Tt.onMouseEnter=this.onMouseEnter,Ye&&(Tt.onMouseMove=this.onMouseMove)):Tt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Tt.onMouseLeave=this.onMouseLeave:Tt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Tt.onFocus=this.onFocus,Tt.onBlur=this.onBlur):(Tt.onFocus=this.createTwoChains("onFocus"),Tt.onBlur=this.createTwoChains("onBlur"));var Mt=S()(St&&St.props&&St.props.className,nt);Mt&&(Tt.className=Mt);var er=Object(k.a)({},Tt);Object(je.c)(St)&&(er.ref=Object(je.a)(this.triggerRef,St.ref));var yr=y.cloneElement(St,er),_r;return(we||this.popupRef.current||$e)&&(_r=y.createElement(Pe,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!we&&ht&&(_r=null),y.createElement(jr.Provider,{value:this.triggerContextValue},yr,_r)}}],[{key:"getDerivedStateFromProps",value:function(we,He){var Ge=we.popupVisible,$e={};return Ge!==void 0&&He.popupVisible!==Ge&&($e.popupVisible=Ge,$e.prevPopupVisible=He.popupVisible),$e}}]),_e}(y.Component);return Xe.contextType=jr,Xe.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:li,getDocument:On,onPopupVisibleChange:Er,afterPopupVisibleChange:Er,onPopupAlign:Er,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Xe}var qn=Bi(tt.a),sn={adjustX:1,adjustY:1},Si={topLeft:{points:["bl","tl"],overflow:sn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:sn,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:sn,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:sn,offset:[4,0]}},dn={topLeft:{points:["bl","tl"],overflow:sn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:sn,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:sn,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:sn,offset:[4,0]}},Yn=Si,Zr=0,cr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},tn=function(Xe,Je,Ue){var _e=oe(Je),Le=Xe.getState();Xe.setState({defaultActiveFirst:Object(k.a)(Object(k.a)({},Le.defaultActiveFirst),{},Object(N.a)({},_e,Ue))})},br=function(Pe){Object(x.a)(Je,Pe);var Xe=Object(E.a)(Je);function Je(Ue){var _e;Object(R.a)(this,Je),_e=Xe.call(this,Ue),_e.onDestroy=function(Ye){_e.props.onDestroy(Ye)},_e.onKeyDown=function(Ye){var nt=Ye.keyCode,ht=_e.menuInstance,St=_e.props.store,Tt=_e.getVisible();if(nt===s.a.ENTER)return _e.onTitleClick(Ye),tn(St,_e.props.eventKey,!0),!0;if(nt===s.a.RIGHT)return Tt?ht.onKeyDown(Ye):(_e.triggerOpenChange(!0),tn(St,_e.props.eventKey,!0)),!0;if(nt===s.a.LEFT){var Mt;if(Tt)Mt=ht.onKeyDown(Ye);else return;return Mt||(_e.triggerOpenChange(!1),Mt=!0),Mt}return Tt&&(nt===s.a.UP||nt===s.a.DOWN)?ht.onKeyDown(Ye):void 0},_e.onOpenChange=function(Ye){_e.props.onOpenChange(Ye)},_e.onPopupVisibleChange=function(Ye){_e.triggerOpenChange(Ye,Ye?"mouseenter":"mouseleave")},_e.onMouseEnter=function(Ye){var nt=_e.props,ht=nt.eventKey,St=nt.onMouseEnter,Tt=nt.store;tn(Tt,_e.props.eventKey,!1),St({key:ht,domEvent:Ye})},_e.onMouseLeave=function(Ye){var nt=_e.props,ht=nt.parentMenu,St=nt.eventKey,Tt=nt.onMouseLeave;ht.subMenuInstance=Object(g.a)(_e),Tt({key:St,domEvent:Ye})},_e.onTitleMouseEnter=function(Ye){var nt=_e.props,ht=nt.eventKey,St=nt.onItemHover,Tt=nt.onTitleMouseEnter;St({key:ht,hover:!0}),Tt({key:ht,domEvent:Ye})},_e.onTitleMouseLeave=function(Ye){var nt=_e.props,ht=nt.parentMenu,St=nt.eventKey,Tt=nt.onItemHover,Mt=nt.onTitleMouseLeave;ht.subMenuInstance=Object(g.a)(_e),Tt({key:St,hover:!1}),Mt({key:St,domEvent:Ye})},_e.onTitleClick=function(Ye){var nt=Object(g.a)(_e),ht=nt.props;if(ht.onTitleClick({key:ht.eventKey,domEvent:Ye}),ht.triggerSubMenuAction==="hover")return;_e.triggerOpenChange(!_e.getVisible(),"click"),tn(ht.store,_e.props.eventKey,!1)},_e.onSubMenuClick=function(Ye){typeof _e.props.onClick=="function"&&_e.props.onClick(_e.addKeyPath(Ye))},_e.onSelect=function(Ye){_e.props.onSelect(Ye)},_e.onDeselect=function(Ye){_e.props.onDeselect(Ye)},_e.getPrefixCls=function(){return"".concat(_e.props.rootPrefixCls,"-submenu")},_e.getActiveClassName=function(){return"".concat(_e.getPrefixCls(),"-active")},_e.getDisabledClassName=function(){return"".concat(_e.getPrefixCls(),"-disabled")},_e.getSelectedClassName=function(){return"".concat(_e.getPrefixCls(),"-selected")},_e.getOpenClassName=function(){return"".concat(_e.props.rootPrefixCls,"-submenu-open")},_e.getVisible=function(){return _e.state.isOpen},_e.getMode=function(){return _e.state.mode},_e.saveMenuInstance=function(Ye){_e.menuInstance=Ye},_e.addKeyPath=function(Ye){return Object(k.a)(Object(k.a)({},Ye),{},{keyPath:(Ye.keyPath||[]).concat(_e.props.eventKey)})},_e.triggerOpenChange=function(Ye,nt){var ht=_e.props.eventKey,St=function(){_e.onOpenChange({key:ht,item:Object(g.a)(_e),trigger:nt,open:Ye})};nt==="mouseenter"?_e.mouseenterTimeout=setTimeout(function(){St()},0):St()},_e.isChildrenSelected=function(){var Ye={find:!1};return Y(_e.props.children,_e.props.selectedKeys,Ye),Ye.find},_e.isInlineMode=function(){return _e.getMode()==="inline"},_e.adjustWidth=function(){if(!_e.subMenuTitle||!_e.menuInstance)return;var Ye=rt.findDOMNode(_e.menuInstance);if(Ye.offsetWidth>=_e.subMenuTitle.offsetWidth)return;Ye.style.minWidth="".concat(_e.subMenuTitle.offsetWidth,"px")},_e.saveSubMenuTitle=function(Ye){_e.subMenuTitle=Ye},_e.getBaseProps=function(){var Ye=Object(g.a)(_e),nt=Ye.props,ht=_e.getMode();return{mode:ht==="horizontal"?"vertical":ht,visible:_e.getVisible(),level:nt.level+1,inlineIndent:nt.inlineIndent,focusable:!1,onClick:_e.onSubMenuClick,onSelect:_e.onSelect,onDeselect:_e.onDeselect,onDestroy:_e.onDestroy,selectedKeys:nt.selectedKeys,eventKey:"".concat(nt.eventKey,"-menu-"),openKeys:nt.openKeys,motion:nt.motion,onOpenChange:_e.onOpenChange,subMenuOpenDelay:nt.subMenuOpenDelay,parentMenu:Object(g.a)(_e),subMenuCloseDelay:nt.subMenuCloseDelay,forceSubMenuRender:nt.forceSubMenuRender,triggerSubMenuAction:nt.triggerSubMenuAction,builtinPlacements:nt.builtinPlacements,defaultActiveFirst:nt.store.getState().defaultActiveFirst[oe(nt.eventKey)],multiple:nt.multiple,prefixCls:nt.rootPrefixCls,id:_e.internalMenuId,manualRef:_e.saveMenuInstance,itemIcon:nt.itemIcon,expandIcon:nt.expandIcon,direction:nt.direction}},_e.getMotion=function(Ye,nt){var ht=Object(g.a)(_e),St=ht.haveRendered,Tt=_e.props,Mt=Tt.motion,er=Tt.rootPrefixCls,yr=Object(k.a)(Object(k.a)({},Mt),{},{leavedClassName:"".concat(er,"-hidden"),removeOnLeave:!1,motionAppear:St||!nt||Ye!=="inline"});return yr};var Le=Ue.store,we=Ue.eventKey,He=Le.getState(),Ge=He.defaultActiveFirst;_e.isRootMenu=!1;var $e=!1;return Ge&&($e=Ge[we]),tn(Le,we,$e),_e.state={mode:Ue.mode,isOpen:Ue.isOpen},_e}return Object(O.a)(Je,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var _e=this,Le=this.props,we=Le.mode,He=Le.parentMenu,Ge=Le.manualRef,$e=Le.isOpen,Ye=function(){_e.setState({mode:we,isOpen:$e})},nt=$e!==this.state.isOpen,ht=we!==this.state.mode;if((ht||nt)&&(qe.a.cancel(this.updateStateRaf),ht?this.updateStateRaf=Object(qe.a)(Ye):Ye()),Ge&&Ge(this),we!=="horizontal"||!(He==null?void 0:He.isRootMenu)||!$e)return;this.minWidthTimeout=setTimeout(function(){return _e.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var _e=this.props,Le=_e.onDestroy,we=_e.eventKey;Le&&Le(we),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),qe.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(_e,Le){var we=this.getBaseProps();return y.createElement(Hi,Object(h.a)({},we,{id:this.internalMenuId,className:_e,style:Le}),this.props.children)}},{key:"renderChildren",value:function(){var _e=this,Le=this.getBaseProps(),we=Le.mode,He=Le.visible,Ge=Le.forceSubMenuRender,$e=Le.direction,Ye=this.getMotion(we,He);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||He||Ge,!this.haveOpened)return y.createElement("div",null);var nt=S()("".concat(Le.prefixCls,"-sub"),Object(N.a)({},"".concat(Le.prefixCls,"-rtl"),$e==="rtl"));return this.isInlineMode()?y.createElement(me,Object(h.a)({visible:Le.visible,forceRender:Ge},Ye),function(ht){var St=ht.className,Tt=ht.style,Mt=S()(nt,St);return _e.renderPopupMenu(Mt,Tt)}):this.renderPopupMenu(nt)}},{key:"render",value:function(){var _e,Le,we,He=Object(k.a)({},this.props),Ge=this.getVisible(),$e=this.getPrefixCls(),Ye=this.isInlineMode(),nt=this.getMode(),ht=S()($e,"".concat($e,"-").concat(nt),(_e={},Object(N.a)(_e,He.className,!!He.className),Object(N.a)(_e,this.getOpenClassName(),Ge),Object(N.a)(_e,this.getActiveClassName(),He.active||Ge&&!Ye),Object(N.a)(_e,this.getDisabledClassName(),He.disabled),Object(N.a)(_e,this.getSelectedClassName(),this.isChildrenSelected()),_e));this.internalMenuId||(He.eventKey?this.internalMenuId="".concat(He.eventKey,"$Menu"):(Zr+=1,this.internalMenuId="$__$".concat(Zr,"$Menu")));var St={},Tt={},Mt={};He.disabled||(St={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Tt={onClick:this.onTitleClick},Mt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var er={},yr=He.direction,_r=yr==="rtl";Ye&&(_r?er.paddingRight=He.inlineIndent*He.level:er.paddingLeft=He.inlineIndent*He.level);var Tr={};this.getVisible()&&(Tr={"aria-owns":this.internalMenuId});var kr=null;nt!=="horizontal"&&(kr=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(kr=y.createElement(this.props.expandIcon,Object(k.a)({},this.props))));var Dr=y.createElement("div",Object(h.a)({ref:this.saveSubMenuTitle,style:er,className:"".concat($e,"-title"),role:"button"},Mt,Tt,{"aria-expanded":Ge},Tr,{"aria-haspopup":"true",title:typeof He.title=="string"?He.title:void 0}),He.title,kr||y.createElement("i",{className:"".concat($e,"-arrow")})),Sr=this.renderChildren(),Yr=((Le=He.parentMenu)===null||Le===void 0?void 0:Le.isRootMenu)?He.parentMenu.props.getPopupContainer:function(pn){return pn.parentNode},Ur=cr[nt],Rn=He.popupOffset?{offset:He.popupOffset}:{},Br=S()((we={},Object(N.a)(we,He.popupClassName,He.popupClassName&&!Ye),Object(N.a)(we,"".concat($e,"-rtl"),_r),we)),ur=He.disabled,ir=He.triggerSubMenuAction,Wr=He.subMenuOpenDelay,$r=He.forceSubMenuRender,Zt=He.subMenuCloseDelay,en=He.builtinPlacements;Z.forEach(function(pn){return delete He[pn]}),delete He.onClick;var In=_r?Object(k.a)(Object(k.a)({},dn),en):Object(k.a)(Object(k.a)({},Si),en);delete He.direction;var an=this.getBaseProps(),vn=Ye?null:this.getMotion(an.mode,an.visible);return y.createElement("li",Object(h.a)({},He,St,{className:ht,role:"menuitem"}),y.createElement(qn,{prefixCls:$e,popupClassName:S()("".concat($e,"-popup"),Br),getPopupContainer:Yr,builtinPlacements:In,popupPlacement:Ur,popupVisible:Ye?!1:Ge,popupAlign:Rn,popup:Ye?null:Sr,action:ur||Ye?[]:[ir],mouseEnterDelay:Wr,mouseLeaveDelay:Zt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:$r,popupMotion:vn},Dr),Ye?Sr:null)}}]),Je}(y.Component);br.defaultProps={onMouseEnter:ce,onMouseLeave:ce,onTitleMouseEnter:ce,onTitleMouseLeave:ce,onTitleClick:ce,manualRef:ce,mode:"vertical",title:""};var hn=Object(T.b)(function(Pe,Xe){var Je=Pe.openKeys,Ue=Pe.activeKey,_e=Pe.selectedKeys,Le=Xe.eventKey,we=Xe.subMenuKey;return{isOpen:Je.indexOf(Le)>-1,active:Ue[we]===Le,selectedKeys:_e}})(br);hn.isSubMenu=!0;var Fr=hn,mi="menuitem-overflowed",_n=.5,Un=function(Pe){Object(x.a)(Je,Pe);var Xe=Object(E.a)(Je);function Je(){var Ue;return Object(R.a)(this,Je),Ue=Xe.apply(this,arguments),Ue.resizeObserver=null,Ue.mutationObserver=null,Ue.originalTotalWidth=0,Ue.overflowedItems=[],Ue.menuItemSizes=[],Ue.cancelFrameId=null,Ue.state={lastVisibleIndex:void 0},Ue.childRef=y.createRef(),Ue.getMenuItemNodes=function(){var _e=Ue.props.prefixCls,Le=Ue.childRef.current;return Le?[].slice.call(Le.children).filter(function(we){return we.className.split(" ").indexOf("".concat(_e,"-overflowed-submenu"))<0}):[]},Ue.getOverflowedSubMenuItem=function(_e,Le,we){var He=Ue.props,Ge=He.overflowedIndicator,$e=He.level,Ye=He.mode,nt=He.prefixCls,ht=He.theme;if($e!==1||Ye!=="horizontal")return null;var St=Ue.props.children[0],Tt=St.props,Mt=Tt.children,er=Tt.title,yr=Tt.style,_r=Object(C.a)(Tt,["children","title","style"]),Tr=Object(k.a)({},yr),kr="".concat(_e,"-overflowed-indicator"),Dr="".concat(_e,"-overflowed-indicator");Le.length===0&&we!==!0?Tr=Object(k.a)(Object(k.a)({},Tr),{},{display:"none"}):we&&(Tr=Object(k.a)(Object(k.a)({},Tr),{},{visibility:"hidden",position:"absolute"}),kr="".concat(kr,"-placeholder"),Dr="".concat(Dr,"-placeholder"));var Sr=ht?"".concat(nt,"-").concat(ht):"",Yr={};return Z.forEach(function(Ur){_r[Ur]!==void 0&&(Yr[Ur]=_r[Ur])}),y.createElement(Fr,Object(h.a)({title:Ge,className:"".concat(nt,"-overflowed-submenu"),popupClassName:Sr},Yr,{key:kr,eventKey:Dr,disabled:!1,style:Tr}),Le)},Ue.setChildrenWidthAndResize=function(){if(Ue.props.mode!=="horizontal")return;var _e=Ue.childRef.current;if(!_e)return;var Le=_e.children;if(!Le||Le.length===0)return;var we=_e.children[Le.length-1];be(we,"display","inline-block");var He=Ue.getMenuItemNodes(),Ge=He.filter(function($e){return $e.className.split(" ").indexOf(mi)>=0});Ge.forEach(function($e){be($e,"display","inline-block")}),Ue.menuItemSizes=He.map(function($e){return ye($e,!0)}),Ge.forEach(function($e){be($e,"display","none")}),Ue.overflowedIndicatorWidth=ye(_e.children[_e.children.length-1],!0),Ue.originalTotalWidth=Ue.menuItemSizes.reduce(function($e,Ye){return $e+Ye},0),Ue.handleResize(),be(we,"display","none")},Ue.handleResize=function(){if(Ue.props.mode!=="horizontal")return;var _e=Ue.childRef.current;if(!_e)return;var Le=ye(_e);Ue.overflowedItems=[];var we=0,He;Ue.originalTotalWidth>Le+_n&&(He=-1,Ue.menuItemSizes.forEach(function(Ge){we+=Ge,we+Ue.overflowedIndicatorWidth<=Le&&(He+=1)})),Ue.setState({lastVisibleIndex:He})},Ue}return Object(O.a)(Je,[{key:"componentDidMount",value:function(){var _e=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Le=this.childRef.current;if(!Le)return;this.resizeObserver=new Qe.default(function(we){we.forEach(function(){var He=_e.cancelFrameId;cancelAnimationFrame(He),_e.cancelFrameId=requestAnimationFrame(_e.setChildrenWidthAndResize)})}),[].slice.call(Le.children).concat(Le).forEach(function(we){_e.resizeObserver.observe(we)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){_e.resizeObserver.disconnect(),[].slice.call(Le.children).concat(Le).forEach(function(we){_e.resizeObserver.observe(we)}),_e.setChildrenWidthAndResize()}),this.mutationObserver.observe(Le,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(_e){var Le=this,we=this.state.lastVisibleIndex;return(_e||[]).reduce(function(He,Ge,$e){var Ye=Ge;if(Le.props.mode==="horizontal"){var nt=Le.getOverflowedSubMenuItem(Ge.props.eventKey,[]);we!==void 0&&Le.props.className.indexOf("".concat(Le.props.prefixCls,"-root"))!==-1&&($e>we&&(Ye=y.cloneElement(Ge,{style:{display:"none"},eventKey:"".concat(Ge.props.eventKey,"-hidden"),className:"".concat(mi)})),$e===we+1&&(Le.overflowedItems=_e.slice(we+1).map(function(St){return y.cloneElement(St,{key:St.props.eventKey,mode:"vertical-left"})}),nt=Le.getOverflowedSubMenuItem(Ge.props.eventKey,Le.overflowedItems)));var ht=[].concat(Object(d.a)(He),[nt,Ye]);return $e===_e.length-1&&ht.push(Le.getOverflowedSubMenuItem(Ge.props.eventKey,[],!0)),ht}return[].concat(Object(d.a)(He),[Ye])},[])}},{key:"render",value:function(){var _e=this.props,Le=_e.visible,we=_e.prefixCls,He=_e.overflowedIndicator,Ge=_e.mode,$e=_e.level,Ye=_e.tag,nt=_e.children,ht=_e.theme,St=Object(C.a)(_e,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Tt=Ye;return y.createElement(Tt,Object(h.a)({ref:this.childRef},St),this.renderChildren(nt))}}]),Je}(y.Component);Un.defaultProps={tag:"div",className:""};var Di=Un;function ui(Pe){return Pe.length?Pe.every(function(Xe){return!!Xe.props.disabled}):!0}function bi(Pe,Xe,Je){var Ue=Pe.getState();Pe.setState({activeKey:Object(k.a)(Object(k.a)({},Ue.activeKey),{},Object(N.a)({},Xe,Je))})}function ei(Pe){return Pe.eventKey||"0-menu-"}function ti(Pe,Xe){var Je=Xe,Ue=Pe.children,_e=Pe.eventKey;if(Je){var Le;if(q(Ue,function(we,He){we&&we.props&&!we.props.disabled&&Je===Oe(we,_e,He)&&(Le=!0)}),Le)return Je}return Je=null,Pe.defaultActiveFirst&&q(Ue,function(we,He){!Je&&we&&!we.props.disabled&&(Je=Oe(we,_e,He))}),Je}function ji(Pe){if(!Pe)return;var Xe=this.instanceArray.indexOf(Pe);Xe!==-1?this.instanceArray[Xe]=Pe:this.instanceArray.push(Pe)}var ci=function(Pe){Object(x.a)(Je,Pe);var Xe=Object(E.a)(Je);function Je(Ue){var _e;return Object(R.a)(this,Je),_e=Xe.call(this,Ue),_e.onKeyDown=function(Le,we){var He=Le.keyCode,Ge;if(_e.getFlatInstanceArray().forEach(function(Ye){Ye&&Ye.props.active&&Ye.onKeyDown&&(Ge=Ye.onKeyDown(Le))}),Ge)return 1;var $e=null;return(He===s.a.UP||He===s.a.DOWN)&&($e=_e.step(He===s.a.UP?-1:1)),$e?(Le.preventDefault(),bi(_e.props.store,ei(_e.props),$e.props.eventKey),typeof we=="function"&&we($e),1):void 0},_e.onItemHover=function(Le){var we=Le.key,He=Le.hover;bi(_e.props.store,ei(_e.props),He?we:null)},_e.onDeselect=function(Le){_e.props.onDeselect(Le)},_e.onSelect=function(Le){_e.props.onSelect(Le)},_e.onClick=function(Le){_e.props.onClick(Le)},_e.onOpenChange=function(Le){_e.props.onOpenChange(Le)},_e.onDestroy=function(Le){_e.props.onDestroy(Le)},_e.getFlatInstanceArray=function(){return _e.instanceArray},_e.step=function(Le){var we=_e.getFlatInstanceArray(),He=_e.props.store.getState().activeKey[ei(_e.props)],Ge=we.length;if(!Ge)return null;Le<0&&(we=we.concat().reverse());var $e=-1;if(we.every(function(St,Tt){return St&&St.props.eventKey===He?($e=Tt,!1):!0}),!_e.props.defaultActiveFirst&&$e!==-1&&ui(we.slice($e,Ge-1)))return;var Ye=($e+1)%Ge,nt=Ye;do{var ht=we[nt];if(!ht||ht.props.disabled)nt=(nt+1)%Ge;else return ht}while(nt!==Ye);return null},_e.renderCommonMenuItem=function(Le,we,He){var Ge=_e.props.store.getState(),$e=Object(g.a)(_e),Ye=$e.props,nt=Oe(Le,Ye.eventKey,we),ht=Le.props;if(!ht||typeof Le.type=="string")return Le;var St=nt===Ge.activeKey,Tt=Object(k.a)(Object(k.a)({mode:ht.mode||Ye.mode,level:Ye.level,inlineIndent:Ye.inlineIndent,renderMenuItem:_e.renderMenuItem,rootPrefixCls:Ye.prefixCls,index:we,parentMenu:Ye.parentMenu,manualRef:ht.disabled?void 0:Object(L.a)(Le.ref,ji.bind(Object(g.a)(_e))),eventKey:nt,active:!ht.disabled&&St,multiple:Ye.multiple,onClick:function(er){(ht.onClick||ce)(er),_e.onClick(er)},onItemHover:_e.onItemHover,motion:Ye.motion,subMenuOpenDelay:Ye.subMenuOpenDelay,subMenuCloseDelay:Ye.subMenuCloseDelay,forceSubMenuRender:Ye.forceSubMenuRender,onOpenChange:_e.onOpenChange,onDeselect:_e.onDeselect,onSelect:_e.onSelect,builtinPlacements:Ye.builtinPlacements,itemIcon:ht.itemIcon||_e.props.itemIcon,expandIcon:ht.expandIcon||_e.props.expandIcon},He),{},{direction:Ye.direction});return(Ye.mode==="inline"||Re())&&(Tt.triggerSubMenuAction="click"),y.cloneElement(Le,Object(k.a)(Object(k.a)({},Tt),{},{key:nt||we}))},_e.renderMenuItem=function(Le,we,He){if(!Le)return null;var Ge=_e.props.store.getState(),$e={openKeys:Ge.openKeys,selectedKeys:Ge.selectedKeys,triggerSubMenuAction:_e.props.triggerSubMenuAction,subMenuKey:He};return _e.renderCommonMenuItem(Le,we,$e)},Ue.store.setState({activeKey:Object(k.a)(Object(k.a)({},Ue.store.getState().activeKey),{},Object(N.a)({},Ue.eventKey,ti(Ue,Ue.activeKey)))}),_e.instanceArray=[],_e}return Object(O.a)(Je,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(_e){return this.props.visible||_e.visible||this.props.className!==_e.className||!V()(this.props.style,_e.style)}},{key:"componentDidUpdate",value:function(_e){var Le=this.props,we="activeKey"in Le?Le.activeKey:Le.store.getState().activeKey[ei(Le)],He=ti(Le,we);if(He!==we)bi(Le.store,ei(Le),He);else if("activeKey"in _e){var Ge=ti(_e,_e.activeKey);He!==Ge&&bi(Le.store,ei(Le),He)}}},{key:"render",value:function(){var _e=this,Le=Object(h.a)({},this.props);this.instanceArray=[];var we=S()(Le.prefixCls,Le.className,"".concat(Le.prefixCls,"-").concat(Le.mode)),He={className:we,role:Le.role||"menu"};Le.id&&(He.id=Le.id),Le.focusable&&(He.tabIndex=0,He.onKeyDown=this.onKeyDown);var Ge=Le.prefixCls,$e=Le.eventKey,Ye=Le.visible,nt=Le.level,ht=Le.mode,St=Le.overflowedIndicator,Tt=Le.theme;return Z.forEach(function(Mt){return delete Le[Mt]}),delete Le.onClick,y.createElement(Di,Object(h.a)({},Le,{prefixCls:Ge,mode:ht,tag:"ul",level:nt,theme:Tt,visible:Ye,overflowedIndicator:St},He),Object(b.a)(Le.children).map(function(Mt,er){return _e.renderMenuItem(Mt,er,$e||"0-menu-")}))}}]),Je}(y.Component);ci.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:ce};var _i=Object(T.b)()(ci),Hi=_i,di=j("Kwbf");function qr(Pe,Xe,Je){var Ue=Pe.prefixCls,_e=Pe.motion,Le=Pe.defaultMotions,we=Le===void 0?{}:Le,He=Pe.openAnimation,Ge=Pe.openTransitionName,$e=Xe.switchingModeFromInline;if(_e)return _e;if(Object(z.a)(He)==="object"&&He)Object(di.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof He=="string")return{motionName:"".concat(Ue,"-open-").concat(He)};if(Ge)return{motionName:Ge};var Ye=we[Je];return Ye||($e?null:we.other)}var Yt=function(Pe){Object(x.a)(Je,Pe);var Xe=Object(E.a)(Je);function Je(Ue){var _e;Object(R.a)(this,Je),_e=Xe.call(this,Ue),_e.onSelect=function(He){var Ge=Object(g.a)(_e),$e=Ge.props;if($e.selectable){var Ye=_e.store.getState(),nt=Ye.selectedKeys,ht=He.key;$e.multiple?nt=nt.concat([ht]):nt=[ht],"selectedKeys"in $e||_e.store.setState({selectedKeys:nt}),$e.onSelect(Object(k.a)(Object(k.a)({},He),{},{selectedKeys:nt}))}},_e.onClick=function(He){var Ge=_e.getRealMenuMode(),$e=Object(g.a)(_e),Ye=$e.store,nt=$e.props.onOpenChange;Ge!=="inline"&&!("openKeys"in _e.props)&&(Ye.setState({openKeys:[]}),nt([])),_e.props.onClick(He)},_e.onKeyDown=function(He,Ge){_e.innerMenu.getWrappedInstance().onKeyDown(He,Ge)},_e.onOpenChange=function(He){var Ge=Object(g.a)(_e),$e=Ge.props,Ye=_e.store.getState().openKeys.concat(),nt=!1,ht=function(Tt){var Mt=!1;if(Tt.open)Mt=Ye.indexOf(Tt.key)===-1,Mt&&Ye.push(Tt.key);else{var er=Ye.indexOf(Tt.key);Mt=er!==-1,Mt&&Ye.splice(er,1)}nt=nt||Mt};Array.isArray(He)?He.forEach(ht):ht(He),nt&&("openKeys"in _e.props||_e.store.setState({openKeys:Ye}),$e.onOpenChange(Ye))},_e.onDeselect=function(He){var Ge=Object(g.a)(_e),$e=Ge.props;if($e.selectable){var Ye=_e.store.getState().selectedKeys.concat(),nt=He.key,ht=Ye.indexOf(nt);ht!==-1&&Ye.splice(ht,1),"selectedKeys"in $e||_e.store.setState({selectedKeys:Ye}),$e.onDeselect(Object(k.a)(Object(k.a)({},He),{},{selectedKeys:Ye}))}},_e.onMouseEnter=function(He){_e.restoreModeVerticalFromInline();var Ge=_e.props.onMouseEnter;Ge&&Ge(He)},_e.onTransitionEnd=function(He){var Ge=He.propertyName==="width"&&He.target===He.currentTarget,$e=He.target.className,Ye=Object.prototype.toString.call($e)==="[object SVGAnimatedString]"?$e.animVal:$e,nt=He.propertyName==="font-size"&&Ye.indexOf("anticon")>=0;(Ge||nt)&&_e.restoreModeVerticalFromInline()},_e.setInnerMenu=function(He){_e.innerMenu=He},_e.isRootMenu=!0;var Le=Ue.defaultSelectedKeys,we=Ue.defaultOpenKeys;return"selectedKeys"in Ue&&(Le=Ue.selectedKeys||[]),"openKeys"in Ue&&(we=Ue.openKeys||[]),_e.store=Object(T.c)({selectedKeys:Le,openKeys:we,activeKey:{"0-menu-":ti(Ue,Ue.activeKey)}}),_e.state={switchingModeFromInline:!1,prevProps:Ue,inlineOpenKeys:[],store:_e.store},_e}return Object(O.a)(Je,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(_e){var Le=this.props,we=Le.siderCollapsed,He=Le.inlineCollapsed,Ge=Le.onOpenChange;(!_e.inlineCollapsed&&He||!_e.siderCollapsed&&we)&&Ge([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var _e=this.props.collapsedWidth,Le=this.store,we=this.prevOpenKeys,He=this.getInlineCollapsed()&&(_e===0||_e==="0"||_e==="0px");He?(this.prevOpenKeys=Le.getState().openKeys.concat(),this.store.setState({openKeys:[]})):we&&(this.store.setState({openKeys:we}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var _e=this.props.mode,Le=this.state.switchingModeFromInline,we=this.getInlineCollapsed();return Le&&we?"inline":we?"vertical":_e}},{key:"getInlineCollapsed",value:function(){var _e=this.props,Le=_e.inlineCollapsed,we=_e.siderCollapsed;return we!==void 0?we:Le}},{key:"restoreModeVerticalFromInline",value:function(){var _e=this.state.switchingModeFromInline;_e&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var _e=Object(k.a)({},Object(M.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Le=this.getRealMenuMode();return _e.className+=" ".concat(_e.prefixCls,"-root"),_e.direction==="rtl"&&(_e.className+=" ".concat(_e.prefixCls,"-rtl")),_e=Object(k.a)(Object(k.a)({},_e),{},{mode:Le,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:qr(this.props,this.state,Le)}),delete _e.openAnimation,delete _e.openTransitionName,y.createElement(T.a,{store:this.store},y.createElement(Hi,Object(h.a)({},_e,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(_e,Le){var we=Le.prevProps,He=Le.store,Ge=He.getState(),$e={},Ye={prevProps:_e};return we.mode==="inline"&&_e.mode!=="inline"&&(Ye.switchingModeFromInline=!0),"openKeys"in _e?$e.openKeys=_e.openKeys||[]:((_e.inlineCollapsed&&!we.inlineCollapsed||_e.siderCollapsed&&!we.siderCollapsed)&&(Ye.switchingModeFromInline=!0,Ye.inlineOpenKeys=Ge.openKeys,$e.openKeys=[]),(!_e.inlineCollapsed&&we.inlineCollapsed||!_e.siderCollapsed&&we.siderCollapsed)&&($e.openKeys=Le.inlineOpenKeys,Ye.inlineOpenKeys=[])),Object.keys($e).length&&He.setState($e),Ye}}]),Je}(y.Component);Yt.defaultProps={selectable:!0,onClick:ce,onSelect:ce,onOpenChange:ce,onDeselect:ce,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:y.createElement("span",null,"\xB7\xB7\xB7")};var sr=Yt,Qt=function(Pe){Object(x.a)(Je,Pe);var Xe=Object(E.a)(Je);function Je(){var Ue;return Object(R.a)(this,Je),Ue=Xe.apply(this,arguments),Ue.onKeyDown=function(_e){var Le=_e.keyCode;return Le===s.a.ENTER?(Ue.onClick(_e),!0):void 0},Ue.onMouseLeave=function(_e){var Le=Ue.props,we=Le.eventKey,He=Le.onItemHover,Ge=Le.onMouseLeave;He({key:we,hover:!1}),Ge({key:we,domEvent:_e})},Ue.onMouseEnter=function(_e){var Le=Ue.props,we=Le.eventKey,He=Le.onItemHover,Ge=Le.onMouseEnter;He({key:we,hover:!0}),Ge({key:we,domEvent:_e})},Ue.onClick=function(_e){var Le=Ue.props,we=Le.eventKey,He=Le.multiple,Ge=Le.onClick,$e=Le.onSelect,Ye=Le.onDeselect,nt=Le.isSelected,ht={key:we,keyPath:[we],item:Object(g.a)(Ue),domEvent:_e};Ge(ht),He?nt?Ye(ht):$e(ht):nt||$e(ht)},Ue.saveNode=function(_e){Ue.node=_e},Ue}return Object(O.a)(Je,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var _e=this.props;_e.onDestroy&&_e.onDestroy(_e.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var _e,Le=Object(k.a)({},this.props),we=S()(this.getPrefixCls(),Le.className,(_e={},Object(N.a)(_e,this.getActiveClassName(),!Le.disabled&&Le.active),Object(N.a)(_e,this.getSelectedClassName(),Le.isSelected),Object(N.a)(_e,this.getDisabledClassName(),Le.disabled),_e)),He=Object(k.a)(Object(k.a)({},Le.attribute),{},{title:typeof Le.title=="string"?Le.title:void 0,className:we,role:Le.role||"menuitem","aria-disabled":Le.disabled});Le.role==="option"?He=Object(k.a)(Object(k.a)({},He),{},{role:"option","aria-selected":Le.isSelected}):(Le.role===null||Le.role==="none")&&(He.role="none");var Ge={onClick:Le.disabled?null:this.onClick,onMouseLeave:Le.disabled?null:this.onMouseLeave,onMouseEnter:Le.disabled?null:this.onMouseEnter},$e=Object(k.a)({},Le.style);Le.mode==="inline"&&(Le.direction==="rtl"?$e.paddingRight=Le.inlineIndent*Le.level:$e.paddingLeft=Le.inlineIndent*Le.level),Z.forEach(function(nt){return delete Le[nt]}),delete Le.direction;var Ye=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ye=y.createElement(this.props.itemIcon,this.props)),y.createElement("li",Object(h.a)({},Object(M.a)(Le,["onClick","onMouseEnter","onMouseLeave","onSelect"]),He,Ge,{style:$e,ref:this.saveNode}),Le.children,Ye)}}]),Je}(y.Component);Qt.isMenuItem=!0,Qt.defaultProps={onSelect:ce,onMouseEnter:ce,onMouseLeave:ce,manualRef:ce};var gr=Object(T.b)(function(Pe,Xe){var Je=Pe.activeKey,Ue=Pe.selectedKeys,_e=Xe.eventKey,Le=Xe.subMenuKey;return{active:Je[Le]===_e,isSelected:Array.isArray(Ue)?Ue.indexOf(_e)!==-1:Ue===_e}})(Qt),Lr=gr,Kr=function(Pe){Object(x.a)(Je,Pe);var Xe=Object(E.a)(Je);function Je(){var Ue;return Object(R.a)(this,Je),Ue=Xe.apply(this,arguments),Ue.renderInnerMenuItem=function(_e){var Le=Ue.props,we=Le.renderMenuItem,He=Le.index;return we(_e,He,Ue.props.subMenuKey)},Ue}return Object(O.a)(Je,[{key:"render",value:function(){var _e=Object(h.a)({},this.props),Le=_e.className,we=Le===void 0?"":Le,He=_e.rootPrefixCls,Ge="".concat(He,"-item-group-title"),$e="".concat(He,"-item-group-list"),Ye=_e.title,nt=_e.children;return Z.forEach(function(ht){return delete _e[ht]}),delete _e.direction,y.createElement("li",Object(h.a)({},_e,{onClick:function(St){return St.stopPropagation()},className:"".concat(we," ").concat(He,"-item-group")}),y.createElement("div",{className:Ge,title:typeof Ye=="string"?Ye:void 0},Ye),y.createElement("ul",{className:$e},y.Children.map(nt,this.renderInnerMenuItem)))}}]),Je}(y.Component);Kr.isMenuItemGroup=!0,Kr.defaultProps={disabled:!0};var Ar=Kr,gn=function(Xe){var Je=Xe.className,Ue=Xe.rootPrefixCls,_e=Xe.style;return y.createElement("li",{className:"".concat(Je," ").concat(Ue,"-item-divider"),style:_e})};gn.defaultProps={disabled:!0,className:"",style:{}};var $n=gn,xr=sr,Ei=j("eDIo");function Vr(Pe,Xe){var Je=Pe.prefixCls,Ue=Pe.editable,_e=Pe.locale,Le=Pe.style;return!Ue||Ue.showAdd===!1?null:y.createElement("button",{ref:Xe,type:"button",className:"".concat(Je,"-nav-add"),style:Le,"aria-label":(_e==null?void 0:_e.addAriaLabel)||"Add tab",onClick:function(He){Ue.onEdit("add",{event:He})}},Ue.addIcon||"+")}var jn=y.forwardRef(Vr);function Bn(Pe,Xe){var Je=Pe.prefixCls,Ue=Pe.id,_e=Pe.tabs,Le=Pe.locale,we=Pe.mobile,He=Pe.moreIcon,Ge=He===void 0?"More":He,$e=Pe.moreTransitionName,Ye=Pe.style,nt=Pe.className,ht=Pe.editable,St=Pe.tabBarGutter,Tt=Pe.rtl,Mt=Pe.onTabClick,er=Object(y.useState)(!1),yr=Object(v.a)(er,2),_r=yr[0],Tr=yr[1],kr=Object(y.useState)(null),Dr=Object(v.a)(kr,2),Sr=Dr[0],Yr=Dr[1],Ur="".concat(Ue,"-more-popup"),Rn="".concat(Je,"-dropdown"),Br=Sr!==null?"".concat(Ur,"-").concat(Sr):null,ur=Le==null?void 0:Le.dropdownAriaLabel,ir=y.createElement(xr,{onClick:function(vn){var pn=vn.key,Wn=vn.domEvent;Mt(pn,Wn),Tr(!1)},id:Ur,tabIndex:-1,role:"listbox","aria-activedescendant":Br,selectedKeys:[Sr],"aria-label":ur!==void 0?ur:"expanded dropdown"},_e.map(function(an){return y.createElement(Lr,{key:an.key,id:"".concat(Ur,"-").concat(an.key),role:"option","aria-controls":Ue&&"".concat(Ue,"-panel-").concat(an.key),disabled:an.disabled},an.tab)}));function Wr(an){for(var vn=_e.filter(function(xi){return!xi.disabled}),pn=vn.findIndex(function(xi){return xi.key===Sr})||0,Wn=vn.length,ri=0;ri<Wn;ri+=1){pn=(pn+an+Wn)%Wn;var kn=vn[pn];if(!kn.disabled){Yr(kn.key);return}}}function $r(an){var vn=an.which;if(!_r){[s.a.DOWN,s.a.SPACE,s.a.ENTER].includes(vn)&&(Tr(!0),an.preventDefault());return}switch(vn){case s.a.UP:Wr(-1),an.preventDefault();break;case s.a.DOWN:Wr(1),an.preventDefault();break;case s.a.ESC:Tr(!1);break;case s.a.SPACE:case s.a.ENTER:Sr!==null&&Mt(Sr,an);break}}Object(y.useEffect)(function(){var an=document.getElementById(Br);an&&an.scrollIntoView&&an.scrollIntoView(!1)},[Sr]),Object(y.useEffect)(function(){_r||Yr(null)},[_r]);var Zt=Object(N.a)({},Tt?"marginLeft":"marginRight",St);_e.length||(Zt.visibility="hidden",Zt.order=1);var en=S()(Object(N.a)({},"".concat(Rn,"-rtl"),Tt)),In=we?null:y.createElement(Ei.a,{prefixCls:Rn,overlay:ir,trigger:["hover"],visible:_r,transitionName:$e,onVisibleChange:Tr,overlayClassName:en,mouseEnterDelay:.1,mouseLeaveDelay:.1},y.createElement("button",{type:"button",className:"".concat(Je,"-nav-more"),style:Zt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Ur,id:"".concat(Ue,"-more"),"aria-expanded":_r,onKeyDown:$r},Ge));return y.createElement("div",{className:S()("".concat(Je,"-nav-operations"),nt),style:Ye,ref:Xe},In,y.createElement(jn,{prefixCls:Je,locale:Le,editable:ht}))}var gi=y.forwardRef(Bn),ua=Object(y.createContext)(null),Xr=.1,Mr=.01,Rr=20,hi=Math.pow(.995,Rr);function Xi(){var Pe=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Pe)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Pe.substr(0,4)))}function Yi(Pe,Xe){var Je=Object(y.useState)(),Ue=Object(v.a)(Je,2),_e=Ue[0],Le=Ue[1],we=Object(y.useState)(0),He=Object(v.a)(we,2),Ge=He[0],$e=He[1],Ye=Object(y.useState)(0),nt=Object(v.a)(Ye,2),ht=nt[0],St=nt[1],Tt=Object(y.useState)(),Mt=Object(v.a)(Tt,2),er=Mt[0],yr=Mt[1],_r=Object(y.useRef)();function Tr(ur){var ir=ur.touches[0],Wr=ir.screenX,$r=ir.screenY;Le({x:Wr,y:$r}),window.clearInterval(_r.current)}function kr(ur){if(!_e)return;ur.preventDefault();var ir=ur.touches[0],Wr=ir.screenX,$r=ir.screenY;Le({x:Wr,y:$r});var Zt=Wr-_e.x,en=$r-_e.y;Xe(Zt,en);var In=Date.now();$e(In),St(In-Ge),yr({x:Zt,y:en})}function Dr(){if(!_e)return;if(Le(null),yr(null),er){var ur=er.x/ht,ir=er.y/ht,Wr=Math.abs(ur),$r=Math.abs(ir);if(Math.max(Wr,$r)<Xr)return;var Zt=ur,en=ir;_r.current=window.setInterval(function(){if(Math.abs(Zt)<Mr&&Math.abs(en)<Mr){window.clearInterval(_r.current);return}Zt*=hi,en*=hi,Xe(Zt*Rr,en*Rr)},Rr)}}var Sr=Object(y.useRef)(0),Yr=Object(y.useRef)(!1),Ur=Object(y.useRef)();function Rn(ur){var ir=ur.deltaX,Wr=ur.deltaY,$r=0,Zt=Math.abs(ir),en=Math.abs(Wr);Zt===en?$r=Ur.current==="x"?ir:Wr:Zt>en?($r=ir,Ur.current="x"):($r=Wr,Ur.current="y");var In=Date.now();In-Sr.current>100&&(Yr.current=!1),(Xe(-$r,-$r)||Yr.current)&&(ur.preventDefault(),Yr.current=!0),Sr.current=In}var Br=Object(y.useRef)(null);Br.current={onTouchStart:Tr,onTouchMove:kr,onTouchEnd:Dr,onWheel:Rn},y.useEffect(function(){function ur(Zt){Br.current.onTouchStart(Zt)}function ir(Zt){Br.current.onTouchMove(Zt)}function Wr(Zt){Br.current.onTouchEnd(Zt)}function $r(Zt){Br.current.onWheel(Zt)}return document.addEventListener("touchmove",ir,{passive:!1}),document.addEventListener("touchend",Wr,{passive:!1}),Pe.current.addEventListener("touchstart",ur,{passive:!1}),Pe.current.addEventListener("wheel",$r),function(){document.removeEventListener("touchmove",ir),document.removeEventListener("touchend",Wr)}},[])}function lr(){var Pe=Object(y.useRef)(new Map);function Xe(Ue){return Pe.current.has(Ue)||Pe.current.set(Ue,y.createRef()),Pe.current.get(Ue)}function Je(Ue){Pe.current.delete(Ue)}return[Xe,Je]}function Ft(Pe,Xe){var Je=y.useRef(Pe),Ue=y.useState({}),_e=Object(v.a)(Ue,2),Le=_e[1];function we(He){var Ge=typeof He=="function"?He(Je.current):He;Ge!==Je.current&&Xe(Ge,Je.current),Je.current=Ge,Le({})}return[Je.current,we]}var mr=function(Xe){var Je=Xe.position,Ue=Xe.prefixCls,_e=Xe.extra;if(!_e)return null;var Le,we=_e;return Je==="right"&&(Le=we.right||!we.left&&we||null),Je==="left"&&(Le=we.left||null),Le?y.createElement("div",{className:"".concat(Ue,"-extra-content")},Le):null};function vr(Pe,Xe){var Je,Ue=y.useContext(ua),_e=Ue.prefixCls,Le=Ue.tabs,we=Pe.className,He=Pe.style,Ge=Pe.id,$e=Pe.animated,Ye=Pe.activeKey,nt=Pe.rtl,ht=Pe.extra,St=Pe.editable,Tt=Pe.locale,Mt=Pe.tabPosition,er=Pe.tabBarGutter,yr=Pe.children,_r=Pe.onTabClick,Tr=Pe.onTabScroll,kr=Object(y.useRef)(),Dr=Object(y.useRef)(),Sr=Object(y.useRef)(),Yr=Object(y.useRef)(),Ur=lr(),Rn=Object(v.a)(Ur,2),Br=Rn[0],ur=Rn[1],ir=Mt==="top"||Mt==="bottom",Wr=Ft(0,function(cn,Gr){ir&&Tr&&Tr({direction:cn>Gr?"left":"right"})}),$r=Object(v.a)(Wr,2),Zt=$r[0],en=$r[1],In=Ft(0,function(cn,Gr){!ir&&Tr&&Tr({direction:cn>Gr?"top":"bottom"})}),an=Object(v.a)(In,2),vn=an[0],pn=an[1],Wn=Object(y.useState)(0),ri=Object(v.a)(Wn,2),kn=ri[0],xi=ri[1],Wi=Object(y.useState)(0),Ci=Object(v.a)(Wi,2),ni=Ci[0],wn=Ci[1],yn=Object(y.useState)(0),Mn=Object(v.a)(yn,2),Dn=Mn[0],zi=Mn[1],ta=Object(y.useState)(0),ra=Object(v.a)(ta,2),mn=ra[0],Ji=ra[1],na=Object(y.useState)(null),xn=Object(v.a)(na,2),fn=xn[0],ii=xn[1],So=Object(y.useState)(null),eo=Object(v.a)(So,2),ia=eo[0],va=eo[1],Ma=Object(y.useState)(0),to=Object(v.a)(Ma,2),Pa=to[0],Xo=to[1],Yo=Object(y.useState)(0),Co=Object(v.a)(Yo,2),ro=Co[0],no=Co[1],ya=o(new Map),ba=Object(v.a)(ya,2),$o=ba[0],Na=ba[1],Oa=f(Le,$o,kn),_a="".concat(_e,"-nav-operations-hidden"),Ea=0,Gi=0;ir?nt?(Ea=0,Gi=Math.max(0,kn-fn)):(Ea=Math.min(0,fn-kn),Gi=0):(Ea=Math.min(0,ia-ni),Gi=0);function ca(cn){return cn<Ea?[Ea,!1]:cn>Gi?[Gi,!1]:[cn,!0]}var aa=Object(y.useRef)(),Aa=Object(y.useState)(),da=Object(v.a)(Aa,2),ja=da[0],io=da[1];function Fa(){io(Date.now())}function ao(){window.clearTimeout(aa.current)}Yi(kr,function(cn,Gr){var ai=!1;function Ai(xa,Qi){xa(function(Da){var sa=ca(Da+Qi),oi=Object(v.a)(sa,2),Ha=oi[0],so=oi[1];return ai=so,Ha})}if(ir){if(fn>=kn)return ai;Ai(en,cn)}else{if(ia>=ni)return ai;Ai(pn,Gr)}return ao(),Fa(),ai}),Object(y.useEffect)(function(){return ao(),ja&&(aa.current=window.setTimeout(function(){io(0)},100)),ao},[ja]);function oa(){var cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ye,Gr=Oa.get(cn);if(!Gr)return;if(ir){var ai=Zt;nt?Gr.right<Zt?ai=Gr.right:Gr.right+Gr.width>Zt+fn&&(ai=Gr.right+Gr.width-fn):Gr.left<-Zt?ai=-Gr.left:Gr.left+Gr.width>-Zt+fn&&(ai=-(Gr.left+Gr.width-fn)),pn(0),en(ca(ai)[0])}else{var Ai=vn;Gr.top<-vn?Ai=-Gr.top:Gr.top+Gr.height>-vn+ia&&(Ai=-(Gr.top+Gr.height-ia)),en(0),pn(ca(Ai)[0])}}var ha=_(Oa,{width:fn,height:ia,left:Zt,top:vn},{width:Dn,height:mn},{width:Pa,height:ro},Object(k.a)(Object(k.a)({},Pe),{},{tabs:Le})),Oo=Object(v.a)(ha,2),Jo=Oo[0],Qo=Oo[1],Zo=Le.map(function(cn){var Gr=cn.key;return y.createElement(a,{id:Ge,prefixCls:_e,key:Gr,rtl:nt,tab:cn,closable:cn.closable,editable:St,active:Gr===Ye,tabPosition:Mt,tabBarGutter:er,renderWrapper:yr,removeAriaLabel:Tt==null?void 0:Tt.removeAriaLabel,ref:Br(Gr),onClick:function(Ai){_r(Gr,Ai)},onRemove:function(){ur(Gr)},onFocus:function(){oa(Gr),Fa(),nt||(kr.current.scrollLeft=0),kr.current.scrollTop=0}})}),oo=i(function(){var cn,Gr,ai,Ai,xa,Qi,Da,sa,oi,Ha=((cn=kr.current)===null||cn===void 0?void 0:cn.offsetWidth)||0,so=((Gr=kr.current)===null||Gr===void 0?void 0:Gr.offsetHeight)||0,lo=((ai=Yr.current)===null||ai===void 0?void 0:ai.offsetWidth)||0,Ri=((Ai=Yr.current)===null||Ai===void 0?void 0:Ai.offsetHeight)||0,ln=((xa=Sr.current)===null||xa===void 0?void 0:xa.offsetWidth)||0,Vi=((Qi=Sr.current)===null||Qi===void 0?void 0:Qi.offsetHeight)||0;ii(Ha),va(so),Xo(lo),no(Ri);var Zi=(((Da=Dr.current)===null||Da===void 0?void 0:Da.offsetWidth)||0)-lo,qi=(((sa=Dr.current)===null||sa===void 0?void 0:sa.offsetHeight)||0)-Ri;xi(Zi),wn(qi);var uo=(oi=Sr.current)===null||oi===void 0?void 0:oi.className.includes(_a);zi(Zi-(uo?0:ln)),Ji(qi-(uo?0:Vi)),Na(function(){var Wa=new Map;return Le.forEach(function(Lo){var ko=Lo.key,pa=Br(ko).current;pa&&Wa.set(ko,{width:pa.offsetWidth,height:pa.offsetHeight,left:pa.offsetLeft,top:pa.offsetTop})}),Wa})}),qo=Le.slice(0,Jo),Oi=Le.slice(Qo+1),Kn=[].concat(Object(d.a)(qo),Object(d.a)(Oi)),vi=Object(y.useState)(),Vn=Object(v.a)(vi,2),Ra=Vn[0],es=Vn[1],Ki=Oa.get(Ye),Ao=Object(y.useRef)();function Ro(){l.a.cancel(Ao.current)}Object(y.useEffect)(function(){var cn={};return Ki&&(ir?(nt?cn.right=Ki.right:cn.left=Ki.left,cn.width=Ki.width):(cn.top=Ki.top,cn.height=Ki.height)),Ro(),Ao.current=l()(function(){es(cn)}),Ro},[Ki,ir,nt]),Object(y.useEffect)(function(){oa()},[Ye,Ki,Oa,ir]),Object(y.useEffect)(function(){oo()},[nt,er,Ye,Le.map(function(cn){return cn.key}).join("_")]);var Io=!!Kn.length,fa="".concat(_e,"-nav-wrap"),Ua,Ia,Do,Ba;return ir?nt?(Ia=Zt>0,Ua=Zt+fn<kn):(Ua=Zt<0,Ia=-Zt+fn<kn):(Do=vn<0,Ba=-vn+ia<ni),y.createElement("div",{ref:Xe,role:"tablist",className:S()("".concat(_e,"-nav"),we),style:He,onKeyDown:function(){Fa()}},y.createElement(mr,{position:"left",extra:ht,prefixCls:_e}),y.createElement(r.a,{onResize:oo},y.createElement("div",{className:S()(fa,(Je={},Object(N.a)(Je,"".concat(fa,"-ping-left"),Ua),Object(N.a)(Je,"".concat(fa,"-ping-right"),Ia),Object(N.a)(Je,"".concat(fa,"-ping-top"),Do),Object(N.a)(Je,"".concat(fa,"-ping-bottom"),Ba),Je)),ref:kr},y.createElement(r.a,{onResize:oo},y.createElement("div",{ref:Dr,className:"".concat(_e,"-nav-list"),style:{transform:"translate(".concat(Zt,"px, ").concat(vn,"px)"),transition:ja?"none":void 0}},Zo,y.createElement(jn,{ref:Yr,prefixCls:_e,locale:Tt,editable:St,style:{visibility:Io?"hidden":null}}),y.createElement("div",{className:S()("".concat(_e,"-ink-bar"),Object(N.a)({},"".concat(_e,"-ink-bar-animated"),$e.inkBar)),style:Ra}))))),y.createElement(gi,Object.assign({},Pe,{ref:Sr,prefixCls:_e,tabs:Kn,className:!Io&&_a})),y.createElement(mr,{position:"right",extra:ht,prefixCls:_e}))}var rn=y.forwardRef(vr);function Ir(Pe){var Xe=Pe.id,Je=Pe.activeKey,Ue=Pe.animated,_e=Pe.tabPosition,Le=Pe.rtl,we=Pe.destroyInactiveTabPane,He=y.useContext(ua),Ge=He.prefixCls,$e=He.tabs,Ye=Ue.tabPane,nt=$e.findIndex(function(ht){return ht.key===Je});return y.createElement("div",{className:S()("".concat(Ge,"-content-holder"))},y.createElement("div",{className:S()("".concat(Ge,"-content"),"".concat(Ge,"-content-").concat(_e),Object(N.a)({},"".concat(Ge,"-content-animated"),Ye)),style:nt&&Ye?Object(N.a)({},Le?"marginRight":"marginLeft","-".concat(nt,"00%")):null},$e.map(function(ht){return y.cloneElement(ht.node,{key:ht.key,prefixCls:Ge,tabKey:ht.key,id:Xe,animated:Ye,active:ht.key===Je,destroyInactiveTabPane:we})})))}function An(Pe){var Xe=Pe.prefixCls,Je=Pe.forceRender,Ue=Pe.className,_e=Pe.style,Le=Pe.id,we=Pe.active,He=Pe.animated,Ge=Pe.destroyInactiveTabPane,$e=Pe.tabKey,Ye=Pe.children,nt=y.useState(Je),ht=Object(v.a)(nt,2),St=ht[0],Tt=ht[1];y.useEffect(function(){we?Tt(!0):Ge&&Tt(!1)},[we,Ge]);var Mt={};return we||(He?(Mt.visibility="hidden",Mt.height=0,Mt.overflowY="hidden"):Mt.display="none"),y.createElement("div",{id:Le&&"".concat(Le,"-panel-").concat($e),role:"tabpanel",tabIndex:we?0:-1,"aria-labelledby":Le&&"".concat(Le,"-tab-").concat($e),"aria-hidden":!we,style:Object(k.a)(Object(k.a)({},Mt),_e),className:S()("".concat(Xe,"-tabpane"),we&&"".concat(Xe,"-tabpane-active"),Ue)},(we||St||Je)&&Ye)}var En=0;function Li(Pe){return Object(b.a)(Pe).map(function(Xe){if(y.isValidElement(Xe)){var Je=Xe.key!==void 0?String(Xe.key):void 0;return Object(k.a)(Object(k.a)({key:Je},Xe.props),{},{node:Xe})}return null}).filter(function(Xe){return Xe})}function Hn(Pe,Xe){var Je,Ue=Pe.id,_e=Pe.prefixCls,Le=_e===void 0?"rc-tabs":_e,we=Pe.className,He=Pe.children,Ge=Pe.direction,$e=Pe.activeKey,Ye=Pe.defaultActiveKey,nt=Pe.editable,ht=Pe.animated,St=Pe.tabPosition,Tt=St===void 0?"top":St,Mt=Pe.tabBarGutter,er=Pe.tabBarStyle,yr=Pe.tabBarExtraContent,_r=Pe.locale,Tr=Pe.moreIcon,kr=Pe.moreTransitionName,Dr=Pe.destroyInactiveTabPane,Sr=Pe.renderTabBar,Yr=Pe.onChange,Ur=Pe.onTabClick,Rn=Pe.onTabScroll,Br=Object(C.a)(Pe,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),ur=Li(He),ir=Ge==="rtl",Wr;ht===!1?Wr={inkBar:!1,tabPane:!1}:Wr=Object(k.a)({inkBar:!0,tabPane:!1},ht!==!0?ht:null);var $r=Object(y.useState)(!1),Zt=Object(v.a)($r,2),en=Zt[0],In=Zt[1];Object(y.useEffect)(function(){In(Xi())},[]);var an=Object(p.a)(function(){var mn;return(mn=ur[0])===null||mn===void 0?void 0:mn.key},{value:$e,defaultValue:Ye}),vn=Object(v.a)(an,2),pn=vn[0],Wn=vn[1],ri=Object(y.useState)(function(){return ur.findIndex(function(mn){return mn.key===pn})}),kn=Object(v.a)(ri,2),xi=kn[0],Wi=kn[1];Object(y.useEffect)(function(){var mn=ur.findIndex(function(na){return na.key===pn});if(mn===-1){var Ji;mn=Math.max(0,Math.min(xi,ur.length-1)),Wn((Ji=ur[mn])===null||Ji===void 0?void 0:Ji.key)}Wi(mn)},[ur.map(function(mn){return mn.key}).join("_"),pn,xi]);var Ci=Object(p.a)(null,{value:Ue}),ni=Object(v.a)(Ci,2),wn=ni[0],yn=ni[1],Mn=Tt;en&&!["left","right"].includes(Tt)&&(Mn="top"),Object(y.useEffect)(function(){Ue||(yn("rc-tabs-".concat(En)),En+=1)},[]);function Dn(mn,Ji){Ur==null||Ur(mn,Ji),Wn(mn),Yr==null||Yr(mn)}var zi={id:wn,activeKey:pn,animated:Wr,tabPosition:Mn,rtl:ir,mobile:en},ta,ra=Object(k.a)(Object(k.a)({},zi),{},{editable:nt,locale:_r,moreIcon:Tr,moreTransitionName:kr,tabBarGutter:Mt,onTabClick:Dn,onTabScroll:Rn,extra:yr,style:er,panes:He});return Sr?ta=Sr(ra,rn):ta=y.createElement(rn,Object.assign({},ra)),y.createElement(ua.Provider,{value:{tabs:ur,prefixCls:Le}},y.createElement("div",Object.assign({ref:Xe,id:Ue,className:S()(Le,"".concat(Le,"-").concat(Mn),(Je={},Object(N.a)(Je,"".concat(Le,"-mobile"),en),Object(N.a)(Je,"".concat(Le,"-editable"),nt),Object(N.a)(Je,"".concat(Le,"-rtl"),ir),Je),we)},Br),ta,y.createElement(Ir,Object.assign({destroyInactiveTabPane:Dr},zi,{animated:Wr}))))}var Gn=y.forwardRef(Hn);Gn.TabPane=An;var Jn=Gn,$i=Q.b=Jn},kSUc:function(F,Q,j){},lOMy:function(F,Q,j){},lPiR:function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(v){var C=N,k=C.lib,y=k.WordArray,m=k.Hasher,S=C.algo,b=[],p=[];(function(){function l(s){for(var c=v.sqrt(s),a=2;a<=c;a++)if(!(s%a))return!1;return!0}function r(s){return(s-(s|0))*4294967296|0}for(var i=2,o=0;o<64;)l(i)&&(o<8&&(b[o]=r(v.pow(i,1/2))),p[o]=r(v.pow(i,1/3)),o++),i++})();var d=[],t=S.SHA256=m.extend({_doReset:function(){this._hash=new y.init(b.slice(0))},_doProcessBlock:function(l,r){for(var i=this._hash.words,o=i[0],s=i[1],c=i[2],a=i[3],u=i[4],f=i[5],w=i[6],_=i[7],h=0;h<64;h++){if(h<16)d[h]=l[r+h]|0;else{var R=d[h-15],O=(R<<25|R>>>7)^(R<<14|R>>>18)^R>>>3,g=d[h-2],x=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;d[h]=O+d[h-7]+x+d[h-16]}var E=u&f^~u&w,T=o&s^o&c^s&c,M=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),L=(u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25),A=_+L+E+p[h]+d[h],V=M+T;_=w,w=f,f=u,u=a+A|0,a=c,c=s,s=o,o=A+V|0}i[0]=i[0]+o|0,i[1]=i[1]+s|0,i[2]=i[2]+c|0,i[3]=i[3]+a|0,i[4]=i[4]+u|0,i[5]=i[5]+f|0,i[6]=i[6]+w|0,i[7]=i[7]+_|0},_doFinalize:function(){var l=this._data,r=l.words,i=this._nDataBytes*8,o=l.sigBytes*8;return r[o>>>5]|=128<<24-o%32,r[(o+64>>>9<<4)+14]=v.floor(i/4294967296),r[(o+64>>>9<<4)+15]=i,l.sigBytes=r.length*4,this._process(),this._hash},clone:function(){var l=m.clone.call(this);return l._hash=this._hash.clone(),l}});C.SHA256=m._createHelper(t),C.HmacSHA256=m._createHmacHelper(t)}(Math),N.SHA256})},lZu9:function(F,Q,j){(function(N){N(j("VrN/"),j("1eCo"),j("8EBN"))})(function(N){"use strict";N.defineMode("markdown",function(v,C){var k=N.getMode(v,"text/html"),y=k.name=="null";function m(U){if(N.findModeByName){var P=N.findModeByName(U);P&&(U=P.mime||P.mimes[0])}var H=N.getMode(v,U);return H.name=="null"?null:H}C.highlightFormatting===void 0&&(C.highlightFormatting=!1),C.maxBlockquoteDepth===void 0&&(C.maxBlockquoteDepth=0),C.taskLists===void 0&&(C.taskLists=!1),C.strikethrough===void 0&&(C.strikethrough=!1),C.emoji===void 0&&(C.emoji=!1),C.fencedCodeBlockHighlighting===void 0&&(C.fencedCodeBlockHighlighting=!0),C.fencedCodeBlockDefaultMode===void 0&&(C.fencedCodeBlockDefaultMode="text/plain"),C.xml===void 0&&(C.xml=!0),C.tokenTypeOverrides===void 0&&(C.tokenTypeOverrides={});var S={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 b in S)S.hasOwnProperty(b)&&C.tokenTypeOverrides[b]&&(S[b]=C.tokenTypeOverrides[b]);var p=/^([*\-_])(?:\s*\1){2,}\s*$/,d=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,t=/^\[(x| )\](?=\s)/i,l=C.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,r=/^ {0,3}(?:\={1,}|-{2,})\s*$/,i=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,s=/^\s*\[[^\]]+?\]:.*$/,c=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,a=" ";function u(U,P,H){return P.f=P.inline=H,H(U,P)}function f(U,P,H){return P.f=P.block=H,H(U,P)}function w(U){return!U||!/\S/.test(U.string)}function _(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==R){var P=y;if(!P){var H=N.innerMode(k,U.htmlState);P=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}P&&(U.f=E,U.block=h,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function h(U,P){var H=U.column()===P.indentation,$=w(P.prevLine.stream),re=P.indentedCode,te=P.prevLine.hr,ge=P.list!==!1,ve=(P.listStack[P.listStack.length-1]||0)+3;P.indentedCode=!1;var de=P.indentation;if(P.indentationDiff===null&&(P.indentationDiff=P.indentation,ge)){for(P.list=null;de<P.listStack[P.listStack.length-1];)P.listStack.pop(),P.listStack.length?P.indentation=P.listStack[P.listStack.length-1]:P.list=!1;P.list!==!1&&(P.indentationDiff=de-P.listStack[P.listStack.length-1])}var De=!$&&!te&&!P.prevLine.header&&(!ge||!re)&&!P.prevLine.fencedCodeEnd,Te=(P.list===!1||te||$)&&P.indentation<=ve&&U.match(p),he=null;if(P.indentationDiff>=4&&(re||P.prevLine.fencedCodeEnd||P.prevLine.header||$))return U.skipToEnd(),P.indentedCode=!0,S.code;if(U.eatSpace())return null;if(H&&P.indentation<=ve&&(he=U.match(l))&&he[1].length<=6)return P.quote=0,P.header=he[1].length,P.thisLine.header=!0,C.highlightFormatting&&(P.formatting="header"),P.f=P.inline,g(P);if(P.indentation<=ve&&U.eat(">"))return P.quote=H?1:P.quote+1,C.highlightFormatting&&(P.formatting="quote"),U.eatSpace(),g(P);if(!Te&&!P.setext&&H&&P.indentation<=ve&&(he=U.match(d))){var ue=he[1]?"ol":"ul";return P.indentation=de+U.current().length,P.list=!0,P.quote=0,P.listStack.push(P.indentation),P.em=!1,P.strong=!1,P.code=!1,P.strikethrough=!1,C.taskLists&&U.match(t,!1)&&(P.taskList=!0),P.f=P.inline,C.highlightFormatting&&(P.formatting=["list","list-"+ue]),g(P)}else{if(H&&P.indentation<=ve&&(he=U.match(o,!0)))return P.quote=0,P.fencedEndRE=new RegExp(he[1]+"+ *$"),P.localMode=C.fencedCodeBlockHighlighting&&m(he[2]||C.fencedCodeBlockDefaultMode),P.localMode&&(P.localState=N.startState(P.localMode)),P.f=P.block=O,C.highlightFormatting&&(P.formatting="code-block"),P.code=-1,g(P);if(P.setext||(!De||!ge)&&!P.quote&&P.list===!1&&!P.code&&!Te&&!s.test(U.string)&&(he=U.lookAhead(1))&&(he=he.match(r)))return P.setext?(P.header=P.setext,P.setext=0,U.skipToEnd(),C.highlightFormatting&&(P.formatting="header")):(P.header=he[0].charAt(0)=="="?1:2,P.setext=P.header),P.thisLine.header=!0,P.f=P.inline,g(P);if(Te)return U.skipToEnd(),P.hr=!0,P.thisLine.hr=!0,S.hr;if(U.peek()==="[")return u(U,P,V)}return u(U,P,P.inline)}function R(U,P){var H=k.token(U,P.htmlState);if(!y){var $=N.innerMode(k,P.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||P.md_inside&&U.current().indexOf(">")>-1)&&(P.f=E,P.block=h,P.htmlState=null)}return H}function O(U,P){var H=P.listStack[P.listStack.length-1]||0,$=P.indentation<H,re=H+3;if(P.fencedEndRE&&P.indentation<=re&&($||U.match(P.fencedEndRE))){C.highlightFormatting&&(P.formatting="code-block");var te;return $||(te=g(P)),P.localMode=P.localState=null,P.block=h,P.f=E,P.fencedEndRE=null,P.code=0,P.thisLine.fencedCodeEnd=!0,$?f(U,P,P.block):te}else return P.localMode?P.localMode.token(U,P.localState):(U.skipToEnd(),S.code)}function g(U){var P=[];if(U.formatting){P.push(S.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var H=0;H<U.formatting.length;H++)P.push(S.formatting+"-"+U.formatting[H]),U.formatting[H]==="header"&&P.push(S.formatting+"-"+U.formatting[H]+"-"+U.header),U.formatting[H]==="quote"&&(!C.maxBlockquoteDepth||C.maxBlockquoteDepth>=U.quote?P.push(S.formatting+"-"+U.formatting[H]+"-"+U.quote):P.push("error"))}if(U.taskOpen)return P.push("meta"),P.length?P.join(" "):null;if(U.taskClosed)return P.push("property"),P.length?P.join(" "):null;if(U.linkHref?P.push(S.linkHref,"url"):(U.strong&&P.push(S.strong),U.em&&P.push(S.em),U.strikethrough&&P.push(S.strikethrough),U.emoji&&P.push(S.emoji),U.linkText&&P.push(S.linkText),U.code&&P.push(S.code),U.image&&P.push(S.image),U.imageAltText&&P.push(S.imageAltText,"link"),U.imageMarker&&P.push(S.imageMarker)),U.header&&P.push(S.header,S.header+"-"+U.header),U.quote&&(P.push(S.quote),!C.maxBlockquoteDepth||C.maxBlockquoteDepth>=U.quote?P.push(S.quote+"-"+U.quote):P.push(S.quote+"-"+C.maxBlockquoteDepth)),U.list!==!1){var $=(U.listStack.length-1)%3;$?$===1?P.push(S.list2):P.push(S.list3):P.push(S.list1)}return U.trailingSpaceNewLine?P.push("trailing-space-new-line"):U.trailingSpace&&P.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),P.length?P.join(" "):null}function x(U,P){return U.match(i,!0)?g(P):void 0}function E(U,P){var H=P.text(U,P);if(typeof H!="undefined")return H;if(P.list)return P.list=null,g(P);if(P.taskList){var $=U.match(t,!0)[1]===" ";return $?P.taskOpen=!0:P.taskClosed=!0,C.highlightFormatting&&(P.formatting="task"),P.taskList=!1,g(P)}if(P.taskOpen=!1,P.taskClosed=!1,P.header&&U.match(/^#+$/,!0))return C.highlightFormatting&&(P.formatting="header"),g(P);var re=U.next();if(P.linkTitle){P.linkTitle=!1;var te=re;re==="("&&(te=")"),te=(te+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ge="^\\s*(?:[^"+te+"\\\\]+|\\\\\\\\|\\\\.)"+te;if(U.match(new RegExp(ge),!0))return S.linkHref}if(re==="`"){var ve=P.formatting;C.highlightFormatting&&(P.formatting="code"),U.eatWhile("`");var de=U.current().length;if(P.code==0&&(!P.quote||de==1))return P.code=de,g(P);if(de==P.code){var De=g(P);return P.code=0,De}else return P.formatting=ve,g(P)}else if(P.code)return g(P);if(re==="\\"&&(U.next(),C.highlightFormatting)){var Te=g(P),he=S.formatting+"-escape";return Te?Te+" "+he:he}if(re==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return P.imageMarker=!0,P.image=!0,C.highlightFormatting&&(P.formatting="image"),g(P);if(re==="["&&P.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return P.imageMarker=!1,P.imageAltText=!0,C.highlightFormatting&&(P.formatting="image"),g(P);if(re==="]"&&P.imageAltText){C.highlightFormatting&&(P.formatting="image");var Te=g(P);return P.imageAltText=!1,P.image=!1,P.inline=P.f=M,Te}if(re==="["&&!P.image)return P.linkText&&U.match(/^.*?\]/)||(P.linkText=!0,C.highlightFormatting&&(P.formatting="link")),g(P);if(re==="]"&&P.linkText){C.highlightFormatting&&(P.formatting="link");var Te=g(P);return P.linkText=!1,P.inline=P.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?M:E,Te}if(re==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){P.f=P.inline=T,C.highlightFormatting&&(P.formatting="link");var Te=g(P);return Te?Te+=" ":Te="",Te+S.linkInline}if(re==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){P.f=P.inline=T,C.highlightFormatting&&(P.formatting="link");var Te=g(P);return Te?Te+=" ":Te="",Te+S.linkEmail}if(C.xml&&re==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=U.string.indexOf(">",U.pos);if(ue!=-1){var ie=U.string.substring(U.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ie)&&(P.md_inside=!0)}return U.backUp(1),P.htmlState=N.startState(k),f(U,P,R)}if(C.xml&&re==="<"&&U.match(/^\/\w*?>/))return P.md_inside=!1,"tag";if(re==="*"||re==="_"){for(var Se=1,ne=U.pos==1?" ":U.string.charAt(U.pos-2);Se<3&&U.eat(re);)Se++;var ce=U.peek()||" ",Oe=!/\s/.test(ce)&&(!c.test(ce)||/\s/.test(ne)||c.test(ne)),oe=!/\s/.test(ne)&&(!c.test(ne)||/\s/.test(ce)||c.test(ce)),q=null,Y=null;if(Se%2&&(!P.em&&Oe&&(re==="*"||!oe||c.test(ne))?q=!0:P.em==re&&oe&&(re==="*"||!Oe||c.test(ce))&&(q=!1)),Se>1&&(!P.strong&&Oe&&(re==="*"||!oe||c.test(ne))?Y=!0:P.strong==re&&oe&&(re==="*"||!Oe||c.test(ce))&&(Y=!1)),Y!=null||q!=null){C.highlightFormatting&&(P.formatting=q==null?"strong":Y==null?"em":"strong em"),q===!0&&(P.em=re),Y===!0&&(P.strong=re);var De=g(P);return q===!1&&(P.em=!1),Y===!1&&(P.strong=!1),De}}else if(re===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return g(P);U.backUp(1)}if(C.strikethrough){if(re==="~"&&U.eatWhile(re)){if(P.strikethrough){C.highlightFormatting&&(P.formatting="strikethrough");var De=g(P);return P.strikethrough=!1,De}else if(U.match(/^[^\s]/,!1))return P.strikethrough=!0,C.highlightFormatting&&(P.formatting="strikethrough"),g(P)}else if(re===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return g(P);U.backUp(2)}}if(C.emoji&&re===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){P.emoji=!0,C.highlightFormatting&&(P.formatting="emoji");var Z=g(P);return P.emoji=!1,Z}return re===" "&&(U.match(/^ +$/,!1)?P.trailingSpace++:P.trailingSpace&&(P.trailingSpaceNewLine=!0)),g(P)}function T(U,P){var H=U.next();if(H===">"){P.f=P.inline=E,C.highlightFormatting&&(P.formatting="link");var $=g(P);return $?$+=" ":$="",$+S.linkInline}return U.match(/^[^>]+/,!0),S.linkInline}function M(U,P){if(U.eatSpace())return null;var H=U.next();return H==="("||H==="["?(P.f=P.inline=A(H==="("?")":"]"),C.highlightFormatting&&(P.formatting="link-string"),P.linkHref=!0,g(P)):"error"}var L={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(U){return function(P,H){var $=P.next();if($===U){H.f=H.inline=E,C.highlightFormatting&&(H.formatting="link-string");var re=g(H);return H.linkHref=!1,re}return P.match(L[U]),H.linkHref=!0,g(H)}}function V(U,P){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(P.f=z,U.next(),C.highlightFormatting&&(P.formatting="link"),P.linkText=!0,g(P)):u(U,P,E)}function z(U,P){if(U.match(/^\]:/,!0)){P.f=P.inline=W,C.highlightFormatting&&(P.formatting="link");var H=g(P);return P.linkText=!1,H}return U.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function W(U,P){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?P.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),P.f=P.inline=E,S.linkHref+" url")}var G={startState:function(){return{f:h,prevLine:{stream:null},thisLine:{stream:null},block:h,htmlState:null,indentation:0,inline:E,text:x,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&N.copyState(k,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?N.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,P){if(P.formatting=!1,U!=P.thisLine.stream){if(P.header=0,P.hr=!1,U.match(/^\s*$/,!0))return _(P),null;if(P.prevLine=P.thisLine,P.thisLine={stream:U},P.taskList=!1,P.trailingSpace=0,P.trailingSpaceNewLine=!1,!P.localState&&(P.f=P.block,P.f!=R)){var H=U.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(P.indentation=H,P.indentationDiff=null,H>0)return null}}return P.f(U,P)},innerMode:function(U){return U.block==R?{state:U.htmlState,mode:k}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:G}},indent:function(U,P,H){return U.block==R&&k.indent?k.indent(U.htmlState,P,H):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,P,H):N.Pass},blankLine:_,getType:g,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),N.defineMIME("text/markdown","markdown"),N.defineMIME("text/x-markdown","markdown")})},mxV5:function(module,exports,__webpack_require__){(function(global){var require,require;(function(F){if(!0)module.exports=F();else var Q})(function(){var define,module,exports;return function(){function F(Q,j,N){function v(y,m){if(!j[y]){if(!Q[y]){var S=typeof require=="function"&&require;if(!m&&S)return require(y,!0);if(C)return C(y,!0);var b=new Error("Cannot find module '"+y+"'");throw b.code="MODULE_NOT_FOUND",b}var p=j[y]={exports:{}};Q[y][0].call(p.exports,function(d){var t=Q[y][1][d];return v(t||d)},p,p.exports,F,Q,j,N)}return j[y].exports}for(var C=typeof require=="function"&&require,k=0;k<N.length;k++)v(N[k]);return v}return F}()({1:[function(F,Q,j){"use strict";var N=F("./browser/client");N.Buffer=F("buffer").Buffer,N.urllib=F("../shims/xhr"),N.version=F("./browser/version").version,Q.exports=N},{"../shims/xhr":291,"./browser/client":2,"./browser/version":5,buffer:73}],2:[function(F,Q,j){(function(N,v){"use strict";var C=F("babel-runtime/core-js/promise"),k=p(C),y=F("babel-runtime/regenerator"),m=p(y),S=F("babel-runtime/core-js/object/assign"),b=p(S);function p(V){return V&&V.__esModule?V:{default:V}}var d=F("debug")("ali-oss"),t=F("copy-to"),l=F("xml2js"),r=F("agentkeepalive"),i=F("merge-descriptors"),o=F("url"),s=F("is-type-of"),c=F("platform"),a=F("utility"),u=F("urllib"),f=F("./version"),w=F("bowser"),_=F("../common/signUtils"),h=F("../common/utils/isIP"),R=h.isIP,O=F("../common/client/initOptions"),g=F("../common/utils/createRequest"),x=g.createRequest,E=new r;function T(){var V=c.name,z=c.version;V&&V.toLowerCase&&V.toLowerCase()==="ie"&&z.split(".")[0]<10&&console.warn("ali-oss does not support the current browser")}function M(){return location&&location.protocol==="https:"}function L(V,z){if(T(),!(this instanceof L))return new L(V,z);V&&V.inited?this.options=V:this.options=L.initOptions(V),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=u,this.agent=this.options.agent||E),this.ctx=z,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}Q.exports=L,L.initOptions=function(z){z.stsToken||console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");var W=(0,b.default)({secure:M(),useFetch:!1},z);return O(W)};var A=L.prototype;A.debug=d,i(A,F("./object")),i(A,F("../common/bucket/getBucketWebsite")),i(A,F("../common/bucket/putBucketWebsite")),i(A,F("../common/bucket/deleteBucketWebsite")),i(A,F("../common/bucket/getBucketLifecycle")),i(A,F("../common/bucket/putBucketLifecycle")),i(A,F("../common/bucket/deleteBucketLifecycle")),i(A,F("../common/bucket/putBucketVersioning")),i(A,F("../common/bucket/getBucketVersioning")),i(A,F("./managed-upload")),i(A,F("../common/multipart")),i(A,F("../common/parallel")),A.signature=function(z){return this.debug("authorization stringToSign: %s",z,"info"),_.computeSignature(this.options.accessKeySecret,z)},A.authorization=function(z,W,G,U){var P=_.buildCanonicalString(z.toUpperCase(),W,{headers:U,parameters:G});return _.authorization(this.options.accessKeyId,this.options.accessKeySecret,P)},A.request=function(z){var W,G,U,P,H,$;return m.default.async(function(te){for(;;)switch(te.prev=te.next){case 0:return W=x.call(this,z),this.options.useFetch||(W.params.mode="disable-fetch"),G=void 0,U=void 0,P=!!z.stream,te.prev=5,te.next=8,m.default.awrap(this.urllib.request(W.url,W.params));case 8:G=te.sent,this.debug("response %s %s, got %s, headers: %j",z.method,W.url,G.status,G.headers,"info"),te.next=15;break;case 12:te.prev=12,te.t0=te.catch(5),U=te.t0;case 15:if(H=void 0,!(G&&z.successStatuses&&z.successStatuses.indexOf(G.status)===-1)){te.next=28;break}return te.next=19,m.default.awrap(this.requestError(G));case 19:if(H=te.sent,!(H.code==="RequestTimeTooSkewed"&&!P)){te.next=25;break}return this.options.amendTimeSkewed=+new Date(H.serverTime)-new Date,te.next=24,m.default.awrap(this.request(z));case 24:return te.abrupt("return",te.sent);case 25:H.params=z,te.next=32;break;case 28:if(!U){te.next=32;break}return te.next=31,m.default.awrap(this.requestError(U));case 31:H=te.sent;case 32:if(!H){te.next=34;break}throw H;case 34:if(!z.xmlResponse){te.next=39;break}return te.next=37,m.default.awrap(this.parseXML(G.data));case 37:$=te.sent,G.data=$;case 39:return te.abrupt("return",G);case 40:case"end":return te.stop()}},null,this,[[5,12]])},A._getResource=function(z){var W="/";return z.bucket&&(W+=z.bucket+"/"),z.object&&(W+=z.object),W},A._isIP=R,A._escape=function(z){return a.encodeURIComponent(z).replace(/%2F/g,"/")},A._getReqUrl=function(z){var W={};t(this.options.endpoint).to(W);var G=this._isIP(W.hostname),U=this.options.cname;z.bucket&&!U&&!G&&(W.host=z.bucket+"."+W.host);var P="/";z.bucket&&G&&(P+=z.bucket+"/"),z.object&&(P+=this._escape(z.object).replace(/\+/g,"%2B")),W.pathname=P;var H={};if(z.query&&i(H,z.query),z.subres){var $={};s.string(z.subres)?$[z.subres]="":s.array(z.subres)?z.subres.forEach(function(re){$[re]=""}):$=z.subres,i(H,$)}return W.query=H,o.format(W)},A._getUserAgent=function(){var z=v&&v.browser?"js":"nodejs",W="aliyun-sdk-"+z+"/"+f.version,G=c.description;return!G&&v&&(G="Node.js "+v.version.slice(1)+" on "+v.platform+" "+v.arch),this._checkUserAgent(W+" "+G)},A._checkUserAgent=function(z){var W=z.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta");return W},A.checkBrowserAndVersion=function(z,W){return w.name===z&&w.version.split(".")[0]===W},A.parseXML=function(z){return new k.default(function(W,G){N.isBuffer(z)&&(z=z.toString()),l.parseString(z,{explicitRoot:!1,explicitArray:!1},function(U,P){U?G(U):W(P)})})},A.requestError=function(z){var W,G,U,P;return m.default.async(function($){for(;;)switch($.prev=$.next){case 0:if(W=null,!(!z.data||!z.data.length)){$.next=5;break}z.status===-1||z.status===-2?(W=new Error(z.message),W.name=z.name,W.status=z.status,W.code=z.name):(z.status===404?(W=new Error("Object not exists"),W.name="NoSuchKeyError",W.status=404,W.code="NoSuchKey"):z.status===412?(W=new Error("Pre condition failed"),W.name="PreconditionFailedError",W.status=412,W.code="PreconditionFailed"):(W=new Error("Unknow error, status: "+z.status),W.name="UnknowError",W.status=z.status),W.requestId=z.headers["x-oss-request-id"],W.host=""),$.next=33;break;case 5:return G=String(z.data),this.debug("request response error data: %s",G,"error"),U=void 0,$.prev=8,$.next=11,m.default.awrap(this.parseXML(G));case 11:if($.t0=$.sent,$.t0){$.next=14;break}$.t0={};case 14:U=$.t0,$.next=24;break;case 17:return $.prev=17,$.t1=$.catch(8),this.debug(G,"error"),$.t1.message+=`
|
|
|
raw xml: `+G,$.t1.status=z.status,$.t1.requestId=z.headers["x-oss-request-id"],$.abrupt("return",$.t1);case 24:P=U.Message||"unknow request error, status: "+z.status,U.Condition&&(P+=" (condition: "+U.Condition+")"),W=new Error(P),W.name=U.Code?U.Code+"Error":"UnknowError",W.status=z.status,W.code=U.Code,W.requestId=U.RequestId,W.hostId=U.HostId,W.serverTime=U.ServerTime;case 33:return this.debug("generate error %j",W,"error"),$.abrupt("return",W);case 35:case"end":return $.stop()}},null,this,[[8,17]])}}).call(this,{isBuffer:F("../../node_modules/is-buffer/index.js")},F("_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(F,Q,j){(function(N){"use strict";var v=F("babel-runtime/core-js/array/from"),C=b(v),k=F("babel-runtime/core-js/promise"),y=b(k),m=F("babel-runtime/regenerator"),S=b(m);function b(_){return _&&_.__esModule?_:{default:_}}var p=F("is-type-of"),d=F("util"),t=F("path"),l=F("mime"),r=F("copy-to"),i=F("../common/utils/isBlob"),o=i.isBlob,s=F("../common/utils/isFile"),c=s.isFile,a=j;a.multipartUpload=function(h,R,O){var g,x,E,T,M,L,A,V,z;return S.default.async(function(G){for(;;)switch(G.prev=G.next){case 0:if(this.resetCancelFlag(),O=O||{},!(O.checkpoint&&O.checkpoint.uploadId)){G.next=6;break}return G.next=5,S.default.awrap(this._resumeMultipart(O.checkpoint,O));case 5:return G.abrupt("return",G.sent);case 6:return g=100*1024,O.mime||(c(R)?O.mime=l.getType(t.extname(R.name)):o(R)?O.mime=R.type:O.mime=l.getType(t.extname(R))),O.headers=O.headers||{},this._convertMetaToHeaders(O.meta,O.headers),G.next=12,S.default.awrap(this._getFileSize(R));case 12:if(x=G.sent,!(x<g)){G.next=25;break}return E=this._createStream(R,0,x),O.contentLength=x,G.next=18,S.default.awrap(this.putStream(h,E,O));case 18:if(T=G.sent,!(O&&O.progress)){G.next=22;break}return G.next=22,S.default.awrap(O.progress(1));case 22:return M={res:T.res,bucket:this.options.bucket,name:h,etag:T.res.headers.etag},(O.headers&&O.headers["x-oss-callback"]||O.callback)&&(M.data=T.data),G.abrupt("return",M);case 25:if(!(O.partSize&&!(parseInt(O.partSize,10)===O.partSize))){G.next=27;break}throw new Error("partSize must be int number");case 27:if(!(O.partSize&&O.partSize<g)){G.next=29;break}throw new Error("partSize must not be smaller than "+g);case 29:return G.next=31,S.default.awrap(this.initMultipartUpload(h,O));case 31:if(L=G.sent,A=L.uploadId,V=this._getPartSize(x,O.partSize),z={file:R,name:h,fileSize:x,partSize:V,uploadId:A,doneParts:[]},!(O&&O.progress)){G.next=38;break}return G.next=38,S.default.awrap(O.progress(0,z,L.res));case 38:return G.next=40,S.default.awrap(this._resumeMultipart(z,O));case 40:return G.abrupt("return",G.sent);case 41:case"end":return G.stop()}},null,this)},a._resumeMultipart=function(h,R){var O,g,x,E,T,M,L,A,V,z,W,G,U,P,H,$,re,te;return S.default.async(function(ve){for(;;)switch(ve.prev=ve.next){case 0:if(O=this,!this.isCancel()){ve.next=3;break}throw this._makeCancelEvent();case 3:return g=h.file,x=h.fileSize,E=h.partSize,T=h.uploadId,M=h.doneParts,L=h.name,A=[],M.length>0&&r(M).to(A),V=this._divideParts(x,E),z=V.length,W=!1,G=function(De,Te){var he=this;return new y.default(function(ie,Se){var ne,ce,Oe,oe;return S.default.async(function(Y){for(;;)switch(Y.prev=Y.next){case 0:if(Y.prev=0,De.isCancel()){Y.next=18;break}return ne=V[Te-1],ce={stream:De._createStream(g,ne.start,ne.end),size:ne.end-ne.start},Y.next=6,S.default.awrap(De._uploadPart(L,T,Te,ce));case 6:if(Oe=Y.sent,!(!De.isCancel()&&!W)){Y.next=15;break}if(h.doneParts.push({number:Te,etag:Oe.res.headers.etag}),!R.progress){Y.next=12;break}return Y.next=12,S.default.awrap(R.progress(M.length/z,h,Oe.res));case 12:ie({number:Te,etag:Oe.res.headers.etag}),Y.next=16;break;case 15:ie();case 16:Y.next=19;break;case 18:ie();case 19:Y.next=30;break;case 21:Y.prev=21,Y.t0=Y.catch(0),oe=new Error,oe.name=Y.t0.name,oe.message=Y.t0.message,oe.stack=Y.t0.stack,oe.partNum=Te,r(Y.t0).to(oe),Se(oe);case 30:case"end":return Y.stop()}},null,he,[[0,21]])})},U=(0,C.default)(new Array(z),function(de,De){return De+1}),P=A.map(function(de){return de.number}),H=U.filter(function(de){return P.indexOf(de)<0}),$=5,re=R.parallel||$,ve.next=17,S.default.awrap(this._parallel(H,re,function(de){return new y.default(function(De,Te){G(O,de).then(function(he){he&&A.push(he),De()}).catch(function(he){Te(he)})})}));case 17:if(te=ve.sent,W=!0,!this.isCancel()){ve.next=22;break}throw G=null,this._makeCancelEvent();case 22:if(!(te&&te.length>0)){ve.next=25;break}throw te[0].message="Failed to upload some parts with error: "+te[0].toString()+" part_num: "+te[0].partNum,te[0];case 25:return ve.next=27,S.default.awrap(this.completeMultipartUpload(L,T,A,R));case 27:return ve.abrupt("return",ve.sent);case 28:case"end":return ve.stop()}},null,this)},a._getFileSize=function(h){return S.default.async(function(O){for(;;)switch(O.prev=O.next){case 0:if(!p.buffer(h)){O.next=4;break}return O.abrupt("return",h.length);case 4:if(!(o(h)||c(h))){O.next=6;break}return O.abrupt("return",h.size);case 6:throw new Error("_getFileSize requires Buffer/File/Blob.");case 7:case"end":return O.stop()}},null,this)};var u=F("stream"),f=u.Readable;function w(_,h){if(!(this instanceof w))return new w(_,h);f.call(this,h),this.file=_,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}d.inherits(w,f),w.prototype.readFileAndPush=function(h){if(this.fileBuffer)for(var R=!0;R&&this.fileBuffer&&this.start<this.fileBuffer.length;){var O=this.start,g=O+h;g=g>this.fileBuffer.length?this.fileBuffer.length:g,this.start=g,R=this.push(this.fileBuffer.slice(O,g))}},w.prototype._read=function(h){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;h=h||R;var O=this;this.reader.onload=function(x){O.fileBuffer=N.from(new Uint8Array(x.target.result)),O.file=null,O.readFileAndPush(h)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(h)},a._createStream=function(h,R,O){if(o(h)||c(h))return new w(h.slice(R,O));throw new Error("_createStream requires File/Blob.")},a._getPartSize=function(h,R){var O=10*1e3,g=1024*1024;return R?Math.max(Math.ceil(h/O),R):g},a._divideParts=function(h,R){for(var O=Math.ceil(h/R),g=[],x=0;x<O;x++){var E=R*x,T=Math.min(E+R,h);g.push({start:E,end:T})}return g}}).call(this,F("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(F,Q,j){"use strict";var N=F("babel-runtime/core-js/promise"),v=p(N),C=F("babel-runtime/core-js/object/keys"),k=p(C),y=F("babel-runtime/core-js/object/assign"),m=p(y),S=F("babel-runtime/regenerator"),b=p(S);function p(O){return O&&O.__esModule?O:{default:O}}var d=F("utility"),t=F("fs"),l=F("is-type-of"),r=F("url"),i=F("copy-to"),o=F("path"),s=F("mime"),c=F("../common/callback"),a=F("../common/signUtils"),u=F("merge-descriptors"),f=F("../common/utils/isBlob"),w=f.isBlob,_=F("../common/utils/isFile"),h=_.isFile,R=j;R.append=function(g,x,E){var T;return b.default.async(function(L){for(;;)switch(L.prev=L.next){case 0:return E=E||{},E.position===void 0&&(E.position="0"),E.subres={append:"",position:E.position},E.method="POST",L.next=6,b.default.awrap(this.put(g,x,E));case 6:return T=L.sent,T.nextAppendPosition=T.res.headers["x-oss-next-append-position"],L.abrupt("return",T);case 9:case"end":return L.stop()}},null,this)},R.put=function(g,x,E){var T,M,L,A,V,z,W;return b.default.async(function(U){for(;;)switch(U.prev=U.next){case 0:if(T=void 0,E=E||{},g=this._objectName(g),!l.buffer(x)){U.next=7;break}T=x,U.next=33;break;case 7:if(!(w(x)||h(x))){U.next=32;break}return E.mime||(h(x)?E.mime=s.getType(o.extname(x.name)):E.mime=x.type),M=this._createStream(x,0,x.size),U.next=12,b.default.awrap(this._getFileSize(x));case 12:return E.contentLength=U.sent,U.prev=13,U.next=16,b.default.awrap(this.putStream(g,M,E));case 16:return L=U.sent,U.abrupt("return",L);case 20:if(U.prev=20,U.t0=U.catch(13),!(U.t0.code==="RequestTimeTooSkewed")){U.next=29;break}return this.options.amendTimeSkewed=+new Date(U.t0.serverTime)-new Date,U.next=26,b.default.awrap(this.put(g,x,E));case 26:return U.abrupt("return",U.sent);case 29:throw U.t0;case 30:U.next=33;break;case 32:throw new TypeError("Must provide Buffer/Blob/File for put.");case 33:return E.headers=E.headers||{},this._convertMetaToHeaders(E.meta,E.headers),A=E.method||"PUT",V=this._objectRequestParams(A,g,E),c.encodeCallback(V,E),V.mime=E.mime,V.content=T,V.successStatuses=[200],U.next=43,b.default.awrap(this.request(V));case 43:return z=U.sent,W={name:g,url:this._objectUrl(g),res:z.res},V.headers&&V.headers["x-oss-callback"]&&(W.data=JSON.parse(z.data.toString())),U.abrupt("return",W);case 47:case"end":return U.stop()}},null,this,[[13,20]])},R.putStream=function(g,x,E){var T,M,L,A;return b.default.async(function(z){for(;;)switch(z.prev=z.next){case 0:return E=E||{},E.headers=E.headers||{},g=this._objectName(g),E.contentLength?E.headers["Content-Length"]=E.contentLength:E.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(E.meta,E.headers),T=E.method||"PUT",M=this._objectRequestParams(T,g,E),c.encodeCallback(M,E),M.mime=E.mime,M.stream=x,M.successStatuses=[200],z.next=13,b.default.awrap(this.request(M));case 13:return L=z.sent,A={name:g,url:this._objectUrl(g),res:L.res},M.headers&&M.headers["x-oss-callback"]&&(A.data=JSON.parse(L.data.toString())),z.abrupt("return",A);case 17:case"end":return z.stop()}},null,this)},u(R,F("../common/object/copyObject")),u(R,F("../common/object/getObjectTagging")),u(R,F("../common/object/putObjectTagging")),u(R,F("../common/object/deleteObjectTagging")),u(R,F("../common/image")),u(R,F("../common/object/getBucketVersions")),u(R,F("../common/object/getACL")),u(R,F("../common/object/putACL")),u(R,F("../common/object/head")),u(R,F("../common/object/delete")),u(R,F("../common/object/get")),u(R,F("../common/object/putSymlink")),u(R,F("../common/object/getSymlink")),u(R,F("../common/object/deleteMulti")),u(R,F("../common/object/getObjectMeta")),R.putMeta=function(g,x,E){var T;return b.default.async(function(L){for(;;)switch(L.prev=L.next){case 0:return L.next=2,b.default.awrap(this.copy(g,g,{meta:x||{},timeout:E&&E.timeout,ctx:E&&E.ctx}));case 2:return T=L.sent,L.abrupt("return",T);case 4:case"end":return L.stop()}},null,this)},R.list=function(g,x){var E,T,M,L,A;return b.default.async(function(z){for(;;)switch(z.prev=z.next){case 0:return E=this._objectRequestParams("GET","",x),E.query=g,E.xmlResponse=!0,E.successStatuses=[200],z.next=6,b.default.awrap(this.request(E));case 6:return T=z.sent,M=T.data.Contents,L=this,M&&(Array.isArray(M)||(M=[M]),M=M.map(function(W){return{name:W.Key,url:L._objectUrl(W.Key),lastModified:W.LastModified,etag:W.ETag,type:W.Type,size:Number(W.Size),storageClass:W.StorageClass,owner:{id:W.Owner.ID,displayName:W.Owner.DisplayName}}})),A=T.data.CommonPrefixes||null,A&&(Array.isArray(A)||(A=[A]),A=A.map(function(W){return W.Prefix})),z.abrupt("return",{res:T.res,objects:M,prefixes:A,nextMarker:T.data.NextMarker||null,isTruncated:T.data.IsTruncated==="true"});case 13:case"end":return z.stop()}},null,this)},R.restore=function(g,x){var E,T;return b.default.async(function(L){for(;;)switch(L.prev=L.next){case 0:return x=x||{},x.subres=(0,m.default)({restore:""},x.subres),x.versionId&&(x.subres.versionId=x.versionId),E=this._objectRequestParams("POST",g,x),E.successStatuses=[202],L.next=7,b.default.awrap(this.request(E));case 7:return T=L.sent,L.abrupt("return",{res:T.res});case 9:case"end":return L.stop()}},null,this)},R.signatureUrl=function(g,x){x=x||{},g=this._objectName(g),x.method=x.method||"GET";var E=d.timestamp()+(x.expires||1800),T={bucket:this.options.bucket,object:g},M=this._getResource(T);this.options.stsToken&&(x["security-token"]=this.options.stsToken);var L=a._signatureForURL(this.options.accessKeySecret,x,M,E),A=r.parse(this._getReqUrl(T));return A.query={OSSAccessKeyId:this.options.accessKeyId,Expires:E,Signature:L.Signature},i(L.subResource).to(A.query),A.format()},R.getObjectUrl=function(g,x){return x?x[x.length-1]!=="/"&&(x+="/"):x=this.options.endpoint.format(),x+this._escape(this._objectName(g))},R._objectUrl=function(g){return this._getReqUrl({bucket:this.options.bucket,object:g})},R.generateObjectUrl=function(O,g){if(g)g[g.length-1]!=="/"&&(g+="/");else{g=this.options.endpoint.format();var x=r.parse(g),E=this.options.bucket;x.hostname=E+"."+x.hostname,x.host=E+"."+x.host,g=x.format()}return g+this._escape(this._objectName(O))},R._objectRequestParams=function(g,x,E){if(!this.options.bucket)throw new Error("Please create a bucket first");E=E||{},x=this._objectName(x);var T={object:x,bucket:this.options.bucket,method:g,subres:E&&E.subres,timeout:E&&E.timeout,ctx:E&&E.ctx};return E.headers&&(T.headers={},i(E.headers).to(T.headers)),T},R._objectName=function(g){return g.replace(/^\/+/,"")},R._convertMetaToHeaders=function(g,x){if(!g)return;(0,k.default)(g).forEach(function(E){x["x-oss-meta-"+E]=g[E]})},R._deleteFileSafe=function(g){var x=this;return new v.default(function(E){t.exists(g,function(T){T?t.unlink(g,function(M){M&&x.debug("unlink %j error: %s",g,M,"error"),E()}):E()})})}},{"../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(F,Q,j){"use strict";j.version="6.10.0"},{}],6:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(S){return S&&S.__esModule?S:{default:S}}var k=F("../utils/checkBucketName"),y=k.checkBucketName,m=j;m.deleteBucketLifecycle=function(b,p){var d,t;return v.default.async(function(r){for(;;)switch(r.prev=r.next){case 0:return y(b),d=this._bucketRequestParams("DELETE",b,"lifecycle",p),d.successStatuses=[204],r.next=5,v.default.awrap(this.request(d));case 5:return t=r.sent,r.abrupt("return",{res:t.res});case 7:case"end":return r.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],7:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(S){return S&&S.__esModule?S:{default:S}}var k=F("../utils/checkBucketName"),y=k.checkBucketName,m=j;m.deleteBucketWebsite=function(b,p){var d,t;return v.default.async(function(r){for(;;)switch(r.prev=r.next){case 0:return y(b),d=this._bucketRequestParams("DELETE",b,"website",p),d.successStatuses=[204],r.next=5,v.default.awrap(this.request(d));case 5:return t=r.sent,r.abrupt("return",{res:t.res});case 7:case"end":return r.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],8:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(t){return t&&t.__esModule?t:{default:t}}var k=F("../utils/checkBucketName"),y=k.checkBucketName,m=F("../utils/isArray"),S=m.isArray,b=F("../utils/formatObjKey"),p=b.formatObjKey,d=j;d.getBucketLifecycle=function(l,r){var i,o,s;return v.default.async(function(a){for(;;)switch(a.prev=a.next){case 0:return y(l),i=this._bucketRequestParams("GET",l,"lifecycle",r),i.successStatuses=[200],i.xmlResponse=!0,a.next=6,v.default.awrap(this.request(i));case 6:return o=a.sent,s=o.data.Rule||null,s&&(S(s)||(s=[s]),s=s.map(function(u){return u.ID&&(u.id=u.ID,delete u.ID),u.Tag&&!S(u.Tag)&&(u.Tag=[u.Tag]),p(u,"firstLowerCase")})),a.abrupt("return",{rules:s,res:o.res});case 10:case"end":return a.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/formatObjKey":40,"../utils/isArray":42,"babel-runtime/regenerator":68}],9:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(S){return S&&S.__esModule?S:{default:S}}var k=F("../utils/checkBucketName"),y=k.checkBucketName,m=j;m.getBucketVersioning=function(b,p){var d,t,l;return v.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:return y(b),d=this._bucketRequestParams("GET",b,"versioning",p),d.xmlResponse=!0,d.successStatuses=[200],i.next=6,v.default.awrap(this.request(d));case 6:return t=i.sent,l=t.data.Status,i.abrupt("return",{status:t.status,versionStatus:l,res:t.res});case 9:case"end":return i.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],10:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(p){return p&&p.__esModule?p:{default:p}}var k=F("../utils/checkBucketName"),y=k.checkBucketName,m=F("../utils/isObject"),S=m.isObject,b=j;b.getBucketWebsite=function(d,t){var l,r,i;return v.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return y(d),l=this._bucketRequestParams("GET",d,"website",t),l.successStatuses=[200],l.xmlResponse=!0,s.next=6,v.default.awrap(this.request(l));case 6:return r=s.sent,i=[],r.data.RoutingRules&&r.data.RoutingRules.RoutingRule&&(S(r.data.RoutingRules.RoutingRule)?i=[r.data.RoutingRules.RoutingRule]:i=r.data.RoutingRules.RoutingRule),s.abrupt("return",{index:r.data.IndexDocument&&r.data.IndexDocument.Suffix||"",supportSubDir:r.data.IndexDocument&&r.data.IndexDocument.SupportSubDir||"false",type:r.data.IndexDocument&&r.data.IndexDocument.Type,routingRules:i,error:r.data.ErrorDocument&&r.data.ErrorDocument.Key||null,res:r.res});case 10:case"end":return s.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isObject":46,"babel-runtime/regenerator":68}],11:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(h){return h&&h.__esModule?h:{default:h}}var k=F("../utils/checkBucketName"),y=k.checkBucketName,m=F("../utils/isArray"),S=m.isArray,b=F("../utils/deepCopy"),p=b.deepCopy,d=F("../utils/isObject"),t=d.isObject,l=F("../utils/obj2xml"),r=l.obj2xml,i=F("../utils/checkObjectTag"),o=i.checkObjectTag,s=F("../utils/getStrBytesCount"),c=s.getStrBytesCount,a=j;a.putBucketLifecycle=function(R,O,g){var x,E,T,M,L;return v.default.async(function(V){for(;;)switch(V.prev=V.next){case 0:if(y(R),S(O)){V.next=3;break}throw new Error("rules must be Array");case 3:return x=this._bucketRequestParams("PUT",R,"lifecycle",g),E=[],T={LifecycleConfiguration:{Rule:E}},O.forEach(function(z){u(z),_(z),z.id&&(z.ID=z.id,delete z.id),E.push(z)}),M=r(T,{headers:!0,firstUpperCase:!0}),x.content=M,x.mime="xml",x.successStatuses=[200],V.next=13,v.default.awrap(this.request(x));case 13:return L=V.sent,V.abrupt("return",{res:L.res});case 15:case"end":return V.stop()}},null,this)};function u(h){h.days&&(h.expiration={days:h.days}),h.date&&(h.expiration={createdBeforeDate:h.date})}function f(h,R){var O=h.days,g=h.createdBeforeDate;if(!O&&!g)throw new Error(R+" must includes days or createdBeforeDate");if(O&&!/^[1-9][0-9]*$/.test(O))throw new Error("days must be a positive integer");if(g&&!/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(g))throw new Error("createdBeforeDate must be date and conform to iso8601 format")}function w(h){if(!S(h)&&!t(h))throw new Error("tag must be Object or Array");h=t(h)?[h]:h;var R={},O=p(h);O.forEach(function(g){R[g.key]=g.value}),o(R)}function _(h){if(h.id&&c(h.id)>255)throw new Error("ID is composed of 255 bytes at most");if(h.prefix===""||h.prefix===void 0)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(h.status))throw new Error("Status must be Enabled or Disabled");if(h.transition){if(!["IA","Archive"].includes(h.transition.storageClass))throw new Error("StorageClass must be IA or Archive");f(h.transition,"Transition")}if(h.expiration){if(!h.expiration.expiredObjectDeleteMarker)f(h.expiration,"Expiration");else if(h.expiration.days||h.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}if(h.abortMultipartUpload&&f(h.abortMultipartUpload,"AbortMultipartUpload"),!h.expiration&&!h.abortMultipartUpload&&!h.transition&&!h.noncurrentVersionTransition)throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(h.tag){if(h.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");w(h.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(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(p){return p&&p.__esModule?p:{default:p}}var k=F("../utils/checkBucketName"),y=k.checkBucketName,m=F("../utils/obj2xml"),S=m.obj2xml,b=j;b.putBucketVersioning=function(d,t){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,o;return v.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(y(d),["Enabled","Suspended"].includes(t)){c.next=3;break}throw new Error("status must be Enabled or Suspended");case 3:return r=this._bucketRequestParams("PUT",d,"versioning",l),i={VersioningConfiguration:{Status:t}},r.mime="xml",r.content=S(i,{headers:!0}),c.next=9,v.default.awrap(this.request(r));case 9:return o=c.sent,c.abrupt("return",{res:o.res,status:o.status});case 11:case"end":return c.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],13:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(t){return t&&t.__esModule?t:{default:t}}var k=F("../utils/checkBucketName"),y=k.checkBucketName,m=F("../utils/obj2xml"),S=m.obj2xml,b=F("../utils/isArray"),p=b.isArray,d=j;d.putBucketWebsite=function(l){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments[2],o,s,c,a,u;return v.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:if(y(l),o=this._bucketRequestParams("PUT",l,"website",i),s={Suffix:r.index||"index.html"},c={IndexDocument:s},a={WebsiteConfiguration:c},r.supportSubDir&&(s.SupportSubDir=r.supportSubDir),r.type&&(s.Type=r.type),r.error&&(c.ErrorDocument={Key:r.error}),!(r.routingRules!==void 0)){w.next=12;break}if(p(r.routingRules)){w.next=11;break}throw new Error("RoutingRules must be Array");case 11:c.RoutingRules={RoutingRule:r.routingRules};case 12:return a=S(a),o.content=a,o.mime="xml",o.successStatuses=[200],w.next=18,v.default.awrap(this.request(o));case 18:return u=w.sent,w.abrupt("return",{res:u.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(F,Q,j){(function(N){"use strict";var v=F("babel-runtime/core-js/object/keys"),C=m(v),k=F("babel-runtime/core-js/json/stringify"),y=m(k);function m(S){return S&&S.__esModule?S:{default:S}}j.encodeCallback=function(b,p){if(b.headers=b.headers||{},!Object.prototype.hasOwnProperty.call(b.headers,"x-oss-callback")&&p.callback){var d={callbackUrl:encodeURI(p.callback.url),callbackBody:p.callback.body};p.callback.host&&(d.callbackHost=p.callback.host),p.callback.contentType&&(d.callbackBodyType=p.callback.contentType);var t=N.from((0,y.default)(d)).toString("base64");if(b.headers["x-oss-callback"]=t,p.callback.customValue){var l={};(0,C.default)(p.callback.customValue).forEach(function(r){l["x:"+r]=p.callback.customValue[r]}),b.headers["x-oss-callback-var"]=N.from((0,y.default)(l)).toString("base64")}}}}).call(this,F("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,buffer:73}],15:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/assign"),v=C(N);function C(d){return d&&d.__esModule?d:{default:d}}var k=F("humanize-ms"),y=F("url"),m=F("../utils/checkBucketName"),S=m.checkBucketName;function b(d,t){var l=y.parse(d);if(l.protocol||(l=y.parse("http"+(t?"s":"")+"://"+d)),l.protocol!=="http:"&&l.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return l}function p(d,t,l){var r=l?"https://":"http://",i=t?"-internal.aliyuncs.com":".aliyuncs.com",o="vpc100-oss-cn-";return d.substr(0,o.length)===o&&(i=".aliyuncs.com"),y.parse(r+d+i)}Q.exports=function(d){if(!d||!d.accessKeyId||!d.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");d.bucket&&S(d.bucket);var t=(0,v.default)({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1},d);if(t.accessKeyId=t.accessKeyId.trim(),t.accessKeySecret=t.accessKeySecret.trim(),t.timeout&&(t.timeout=k(t.timeout)),t.endpoint)t.endpoint=b(t.endpoint,t.secure);else if(t.region)t.endpoint=p(t.region,t.internal,t.secure);else throw new Error("require options.endpoint or options.region");return t.inited=!0,t}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/assign":54,"humanize-ms":194,url:238}],16:[function(F,Q,j){"use strict";var N=F("merge-descriptors"),v=j;N(v,F("./processObjectSave"))},{"./processObjectSave":17,"merge-descriptors":200}],17:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(t){return t&&t.__esModule?t:{default:t}}var k=F("../utils/checkBucketName"),y=k.checkBucketName,m=F("querystring"),S=F("js-base64"),b=S.Base64.encode,p=j;p.processObjectSave=function(l,r,i,o){var s,c,a,u;return v.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:return d(l,"sourceObject"),d(r,"targetObject"),d(i,"process"),r=this._objectName(r),o&&y(o),s=this._objectRequestParams("POST",l,{subres:"x-oss-process"}),c=o?",b_"+b(o):"",r=b(r),a={"x-oss-process":i+"|sys/saveas,o_"+r+c},s.content=m.stringify(a),w.next=12,v.default.awrap(this.request(s));case 12:return u=w.sent,w.abrupt("return",{res:u.res,status:u.res.status});case 14:case"end":return w.stop()}},null,this)};function d(t,l){if(!t)throw new Error(l+" is required");if(typeof t!="string")throw new Error(l+" must be String")}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68,"js-base64":199,querystring:212}],18:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=C(N);function C(p){return p&&p.__esModule?p:{default:p}}var k=F("copy-to"),y=F("./callback"),m=F("./utils/deepCopy"),S=m.deepCopy,b=j;b.listUploads=function(d,t){var l,r,i,o;return v.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return t=t||{},l={},k(t).to(l),l.subres="uploads",r=this._objectRequestParams("GET","",l),r.query=d,r.xmlResponse=!0,r.successStatuses=[200],c.next=10,v.default.awrap(this.request(r));case 10:return i=c.sent,o=i.data.Upload||[],Array.isArray(o)||(o=[o]),o=o.map(function(a){return{name:a.Key,uploadId:a.UploadId,initiated:a.Initiated}}),c.abrupt("return",{res:i.res,uploads:o,bucket:i.data.Bucket,nextKeyMarker:i.data.NextKeyMarker,nextUploadIdMarker:i.data.NextUploadIdMarker,isTruncated:i.data.IsTruncated==="true"});case 15:case"end":return c.stop()}},null,this)},b.listParts=function(d,t,l,r){var i,o,s;return v.default.async(function(a){for(;;)switch(a.prev=a.next){case 0:return r=r||{},i={},k(r).to(i),i.subres={uploadId:t},o=this._objectRequestParams("GET",d,i),o.query=l,o.xmlResponse=!0,o.successStatuses=[200],a.next=10,v.default.awrap(this.request(o));case 10:return s=a.sent,a.abrupt("return",{res:s.res,uploadId:s.data.UploadId,bucket:s.data.Bucket,name:s.data.Key,partNumberMarker:s.data.PartNumberMarker,nextPartNumberMarker:s.data.NextPartNumberMarker,maxParts:s.data.MaxParts,isTruncated:s.data.IsTruncated,parts:s.data.Part||[]});case 12:case"end":return a.stop()}},null,this)},b.abortMultipartUpload=function(d,t,l){var r,i,o;return v.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return this._stop(),l=l||{},r={},k(l).to(r),r.subres={uploadId:t},i=this._objectRequestParams("DELETE",d,r),i.successStatuses=[204],c.next=9,v.default.awrap(this.request(i));case 9:return o=c.sent,c.abrupt("return",{res:o.res});case 11:case"end":return c.stop()}},null,this)},b.initMultipartUpload=function(d,t){var l,r,i;return v.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return t=t||{},l={},k(t).to(l),l.headers=l.headers||{},this._convertMetaToHeaders(t.meta,l.headers),l.subres="uploads",r=this._objectRequestParams("POST",d,l),r.mime=t.mime,r.xmlResponse=!0,r.successStatuses=[200],s.next=12,v.default.awrap(this.request(r));case 12:return i=s.sent,s.abrupt("return",{res:i.res,bucket:i.data.Bucket,name:i.data.Key,uploadId:i.data.UploadId});case 14:case"end":return s.stop()}},null,this)},b.uploadPart=function(d,t,l,r,i,o,s){var c;return v.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return c={stream:this._createStream(r,i,o),size:o-i},u.next=3,v.default.awrap(this._uploadPart(d,t,l,c,s));case 3:return u.abrupt("return",u.sent);case 4:case"end":return u.stop()}},null,this)},b.completeMultipartUpload=function(d,t,l,r){var i,o,s,c,a,u,f,w;return v.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:for(i=l.concat().sort(function(R,O){return R.number-O.number}).filter(function(R,O,g){return!O||R.number!==g[O-1].number}),o=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<CompleteMultipartUpload>
|
|
|
`,s=0;s<i.length;s++)c=i[s],o+=`<Part>
|
|
|
`,o+="<PartNumber>"+c.number+`</PartNumber>
|
|
|
`,o+="<ETag>"+c.etag+`</ETag>
|
|
|
`,o+=`</Part>
|
|
|
`;return o+="</CompleteMultipartUpload>",r=r||{},a={},a=S(r),a.headers&&delete a.headers["x-oss-server-side-encryption"],a.subres={uploadId:t},u=this._objectRequestParams("POST",d,a),y.encodeCallback(u,a),u.mime="xml",u.content=o,u.headers&&u.headers["x-oss-callback"]||(u.xmlResponse=!0),u.successStatuses=[200],h.next=17,v.default.awrap(this.request(u));case 17:return f=h.sent,w={res:f.res,bucket:u.bucket,name:d,etag:f.res.headers.etag},u.headers&&u.headers["x-oss-callback"]&&(w.data=JSON.parse(f.data.toString())),h.abrupt("return",w);case 21:case"end":return h.stop()}},null,this)},b._uploadPart=function(d,t,l,r,i){var o,s,c;return v.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return i=i||{},o={},k(i).to(o),o.headers={"Content-Length":r.size},o.subres={partNumber:l,uploadId:t},s=this._objectRequestParams("PUT",d,o),s.mime=o.mime,s.stream=r.stream,s.successStatuses=[200],u.next=11,v.default.awrap(this.request(s));case 11:if(c=u.sent,c.res.headers.etag){u.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 r.stream=null,s.stream=null,u.abrupt("return",{name:d,etag:c.res.headers.etag,res:c.res});case 17:case"end":return u.stop()}},null,this)}},{"./callback":14,"./utils/deepCopy":39,"babel-runtime/regenerator":68,"copy-to":76}],19:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=S(N),C=F("babel-runtime/core-js/object/keys"),k=S(C),y=F("babel-runtime/helpers/typeof"),m=S(y);function S(t){return t&&t.__esModule?t:{default:t}}var b=F("../utils/checkBucketName"),p=b.checkBucketName,d=j;d.copy=function(l,r,i,o){var s,c,a;return v.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return(typeof i=="undefined"?"undefined":(0,m.default)(i))==="object"&&(o=i),o=o||{},o.headers=o.headers||{},(0,k.default)(o.headers).forEach(function(w){o.headers["x-oss-copy-source-"+w.toLowerCase()]=o.headers[w]}),o.meta&&(o.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(o.meta,o.headers),r=this._getSourceName(r,i),o.versionId&&(r=r+"?versionId="+o.versionId),o.headers["x-oss-copy-source"]=r,s=this._objectRequestParams("PUT",l,o),s.xmlResponse=!0,s.successStatuses=[200,304],f.next=14,v.default.awrap(this.request(s));case 14:return c=f.sent,a=c.data,a&&(a={etag:a.ETag,lastModified:a.LastModified}),f.abrupt("return",{data:a,res:c.res});case 18:case"end":return f.stop()}},null,this)},d._getSourceName=function(l,r){return typeof r=="string"?l=this._objectName(l):l[0]!=="/"?r=this.options.bucket:(r=l.replace(/\/(.+?)(\/.*)/,"$1"),l=l.replace(/(\/.+?\/)(.*)/,"$2")),p(r),l=encodeURI(l),l="/"+r+"/"+l,l}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,"babel-runtime/regenerator":68}],20:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(S){return S&&S.__esModule?S:{default:S}}var m=j;m.delete=function(b){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d,t;return v.default.async(function(r){for(;;)switch(r.prev=r.next){case 0:return p.subres=(0,k.default)({},p.subres),p.versionId&&(p.subres.versionId=p.versionId),d=this._objectRequestParams("DELETE",b,p),d.successStatuses=[204],r.next=6,v.default.awrap(this.request(d));case 6:return t=r.sent,r.abrupt("return",{res:t.res});case 8:case"end":return r.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],21:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(d){return d&&d.__esModule?d:{default:d}}var m=F("utility"),S=F("../utils/obj2xml"),b=S.obj2xml,p=j;p.deleteMulti=function(t){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,s,c,a,u,f,w,_,h,R;return v.default.async(function(g){for(;;)switch(g.prev=g.next){case 0:if(r=[],!(!t||!t.length)){g.next=3;break}throw new Error("names is required");case 3:for(i=0;i<t.length;i++)o={},typeof t[i]=="string"?o.Key=m.escape(this._objectName(t[i])):(s=t[i],c=s.key,a=s.versionId,o.Key=m.escape(this._objectName(c)),o.VersionId=a),r.push(o);return u={Delete:{Quiet:!!l.quiet,Object:r}},f=b(u,{headers:!0}),l.subres=(0,k.default)({delete:""},l.subres),l.versionId&&(l.subres.versionId=l.versionId),w=this._objectRequestParams("POST","",l),w.mime="xml",w.content=f,w.xmlResponse=!0,w.successStatuses=[200],g.next=15,v.default.awrap(this.request(w));case 15:return _=g.sent,h=_.data,R=h&&h.Deleted||null,R&&(Array.isArray(R)||(R=[R])),g.abrupt("return",{res:_.res,deleted:R||[]});case 20:case"end":return g.stop()}},null,this)}},{"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,utility:290}],22:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(S){return S&&S.__esModule?S:{default:S}}var m=j;m.deleteObjectTagging=function(b){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d,t;return v.default.async(function(r){for(;;)switch(r.prev=r.next){case 0:return p.subres=(0,k.default)({tagging:""},p.subres),p.versionId&&(p.subres.versionId=p.versionId),b=this._objectName(b),d=this._objectRequestParams("DELETE",b,p),d.successStatuses=[204],r.next=7,v.default.awrap(this.request(d));case 7:return t=r.sent,r.abrupt("return",{status:t.status,res:t.res});case 9:case"end":return r.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],23:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(p){return p&&p.__esModule?p:{default:p}}var m=F("fs"),S=F("is-type-of"),b=j;b.get=function(d,t){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,o,s;return v.default.async(function(a){for(;;)switch(a.prev=a.next){case 0:return r=null,i=!1,S.writableStream(t)?r=t:S.string(t)?(r=m.createWriteStream(t),i=!0):l=t,l=l||{},l.subres=(0,k.default)({},l.subres),l.versionId&&(l.subres.versionId=l.versionId),l.process&&(l.subres["x-oss-process"]=l.process),o=void 0,a.prev=8,s=this._objectRequestParams("GET",d,l),s.writeStream=r,s.successStatuses=[200,206,304],a.next=14,v.default.awrap(this.request(s));case 14:o=a.sent,i&&r.destroy(),a.next=25;break;case 18:if(a.prev=18,a.t0=a.catch(8),!i){a.next=24;break}return r.destroy(),a.next=24,v.default.awrap(this._deleteFileSafe(t));case 24:throw a.t0;case 25:return a.abrupt("return",{res:o.res,content:o.data});case 26:case"end":return a.stop()}},null,this,[[8,18]])}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,fs:71,"is-type-of":289}],24:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(S){return S&&S.__esModule?S:{default:S}}var m=j;m.getACL=function(b){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d,t;return v.default.async(function(r){for(;;)switch(r.prev=r.next){case 0:return p.subres=(0,k.default)({acl:""},p.subres),p.versionId&&(p.subres.versionId=p.versionId),b=this._objectName(b),d=this._objectRequestParams("GET",b,p),d.successStatuses=[200],d.xmlResponse=!0,r.next=8,v.default.awrap(this.request(d));case 8:return t=r.sent,r.abrupt("return",{acl:t.data.AccessControlList.Grant,owner:{id:t.data.Owner.ID,displayName:t.data.Owner.DisplayName},res:t.res});case 10:case"end":return r.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],25:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/keys"),v=S(N),C=F("babel-runtime/regenerator"),k=S(C),y=F("babel-runtime/core-js/object/assign"),m=S(y);function S(s){return s&&s.__esModule?s:{default:s}}var b=j,p=F("../utils/isObject"),d=p.isObject,t=F("../utils/isArray"),l=t.isArray;b.getBucketVersions=r,b.listObjectVersions=r;function r(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,u,f,w,_,h;return k.default.async(function(O){for(;;)switch(O.prev=O.next){case 0:if(!(s.versionIdMarker&&s.keyMarker===void 0)){O.next=2;break}throw new Error("A version-id marker cannot be specified without a key marker");case 2:return c.subres=(0,m.default)({versions:""},c.subres),c.versionId&&(c.subres.versionId=c.versionId),a=this._objectRequestParams("GET","",c),a.xmlResponse=!0,a.successStatuses=[200],a.query=o(s),O.next=10,k.default.awrap(this.request(a));case 10:return u=O.sent,f=u.data.Version||[],w=u.data.DeleteMarker||[],_=this,f&&(Array.isArray(f)||(f=[f]),f=f.map(function(g){return{name:g.Key,url:_._objectUrl(g.Key),lastModified:g.LastModified,isLatest:g.IsLatest==="true",versionId:g.VersionId,etag:g.ETag,type:g.Type,size:Number(g.Size),storageClass:g.StorageClass,owner:{id:g.Owner.ID,displayName:g.Owner.DisplayName}}})),w&&(l(w)||(w=[w]),w=w.map(function(g){return{name:g.Key,lastModified:g.LastModified,versionId:g.VersionId,owner:{id:g.Owner.ID,displayName:g.Owner.DisplayName}}})),h=u.data.CommonPrefixes||null,h&&(l(h)||(h=[h]),h=h.map(function(g){return g.Prefix})),O.abrupt("return",{res:u.res,objects:f,deleteMarker:w,prefixes:h,nextMarker:u.data.NextMarker||null,NextVersionIdMarker:u.data.NextVersionIdMarker||null,isTruncated:u.data.IsTruncated==="true"});case 19:case"end":return O.stop()}},null,this)}function i(s){return s.replace(/([A-Z])/g,"-$1").toLowerCase()}function o(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c={};return d(s)&&(0,v.default)(s).forEach(function(a){c[i(a)]=s[a]}),c}},{"../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(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(S){return S&&S.__esModule?S:{default:S}}var m=j;m.getObjectMeta=function(b,p){var d,t;return v.default.async(function(r){for(;;)switch(r.prev=r.next){case 0:return p=p||{},b=this._objectName(b),p.subres=(0,k.default)({objectMeta:""},p.subres),p.versionId&&(p.subres.versionId=p.versionId),d=this._objectRequestParams("HEAD",b,p),d.successStatuses=[200],r.next=8,v.default.awrap(this.request(d));case 8:return t=r.sent,r.abrupt("return",{status:t.status,res:t.res});case 10:case"end":return r.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],27:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(p){return p&&p.__esModule?p:{default:p}}var m=j,S=F("../utils/isObject"),b=S.isObject;m.getObjectTagging=function(d){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l,r,i,o,s;return v.default.async(function(a){for(;;)switch(a.prev=a.next){case 0:return t.subres=(0,k.default)({tagging:""},t.subres),t.versionId&&(t.subres.versionId=t.versionId),d=this._objectName(d),l=this._objectRequestParams("GET",d,t),l.successStatuses=[200],a.next=7,v.default.awrap(this.request(l));case 7:return r=a.sent,a.next=10,v.default.awrap(this.parseXML(r.data));case 10:return i=a.sent,o=i.TagSet.Tag,o=o&&b(o)?[o]:o||[],s={},o.forEach(function(u){s[u.Key]=u.Value}),a.abrupt("return",{status:r.status,res:r.res,tag:s});case 16:case"end":return a.stop()}},null,this)}},{"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],28:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(S){return S&&S.__esModule?S:{default:S}}var m=j;m.getSymlink=function(b){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d,t,l;return v.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:return p.subres=(0,k.default)({symlink:""},p.subres),p.versionId&&(p.subres.versionId=p.versionId),b=this._objectName(b),d=this._objectRequestParams("GET",b,p),d.successStatuses=[200],i.next=7,v.default.awrap(this.request(d));case 7:return t=i.sent,l=t.res.headers["x-oss-symlink-target"],i.abrupt("return",{targetName:decodeURIComponent(l),res:t.res});case 10:case"end":return i.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],29:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=S(N),C=F("babel-runtime/core-js/object/keys"),k=S(C),y=F("babel-runtime/core-js/object/assign"),m=S(y);function S(p){return p&&p.__esModule?p:{default:p}}var b=j;b.head=function(d){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l,r,i;return v.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return t.subres=(0,m.default)({},t.subres),t.versionId&&(t.subres.versionId=t.versionId),l=this._objectRequestParams("HEAD",d,t),l.successStatuses=[200,304],s.next=6,v.default.awrap(this.request(l));case 6:return r=s.sent,i={meta:null,res:r.res,status:r.status},r.status===200&&(0,k.default)(r.headers).forEach(function(c){c.indexOf("x-oss-meta-")===0&&(i.meta||(i.meta={}),i.meta[c.substring(11)]=r.headers[c])}),s.abrupt("return",i);case 10:case"end":return s.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],30:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(S){return S&&S.__esModule?S:{default:S}}var m=j;m.putACL=function(b,p,d){var t,l;return v.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:return d=d||{},d.subres=(0,k.default)({acl:""},d.subres),d.versionId&&(d.subres.versionId=d.versionId),d.headers=d.headers||{},d.headers["x-oss-object-acl"]=p,b=this._objectName(b),t=this._objectRequestParams("PUT",b,d),t.successStatuses=[200],i.next=10,v.default.awrap(this.request(t));case 10:return l=i.sent,i.abrupt("return",{res:l.res});case 12:case"end":return i.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],31:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=S(N),C=F("babel-runtime/core-js/object/keys"),k=S(C),y=F("babel-runtime/core-js/object/assign"),m=S(y);function S(r){return r&&r.__esModule?r:{default:r}}var b=F("../utils/obj2xml"),p=b.obj2xml,d=F("../utils/checkObjectTag"),t=d.checkObjectTag,l=j;l.putObjectTagging=function(i,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c,a,u;return v.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:return t(o),s.subres=(0,m.default)({tagging:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),i=this._objectName(i),c=this._objectRequestParams("PUT",i,s),c.successStatuses=[200],o=(0,k.default)(o).map(function(_){return{Key:_,Value:o[_]}}),a={Tagging:{TagSet:{Tag:o}}},c.mime="xml",c.content=p(a),w.next=12,v.default.awrap(this.request(c));case 12:return u=w.sent,w.abrupt("return",{res:u.res,status:u.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(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/object/assign"),k=y(C);function y(S){return S&&S.__esModule?S:{default:S}}var m=j;m.putSymlink=function(b,p,d){var t,l;return v.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:return d=d||{},d.headers=d.headers||{},p=this._escape(this._objectName(p)),this._convertMetaToHeaders(d.meta,d.headers),d.headers["x-oss-symlink-target"]=p,d.subres=(0,k.default)({symlink:""},d.subres),d.versionId&&(d.subres.versionId=d.versionId),d.storageClass&&(d.headers["x-oss-storage-class"]=d.storageClass),b=this._objectName(b),t=this._objectRequestParams("PUT",b,d),t.successStatuses=[200],i.next=13,v.default.awrap(this.request(t));case 13:return l=i.sent,i.abrupt("return",{res:l.res});case 15:case"end":return i.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],33:[function(F,Q,j){"use strict";var N=F("babel-runtime/regenerator"),v=y(N),C=F("babel-runtime/core-js/promise"),k=y(C);function y(S){return S&&S.__esModule?S:{default:S}}var m=j;m._parallelNode=function(b,p,d,t){var l,r,i,o,s,c,a,u;return v.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:l=this,r=[],i=[],o=b.length/p,s=b.length%p,c=s===0?o:(b.length-s)/p+1,a=1,u=0;case 8:if(!(u<b.length)){w.next=26;break}if(!l.isCancel()){w.next=11;break}return w.abrupt("break",26);case 11:if(t?i.push(d(l,b[u],t)):i.push(d(l,b[u])),!(i.length===p||a===c&&u===b.length-1)){w.next=23;break}return w.prev=13,a+=1,w.next=17,v.default.awrap(k.default.all(i));case 17:w.next=22;break;case 19:w.prev=19,w.t0=w.catch(13),r.push(w.t0);case 22:i=[];case 23:u++,w.next=8;break;case 26:return w.abrupt("return",r);case 27:case"end":return w.stop()}},null,this,[[13,19]])},m._parallel=function(b,p,d){var t=this;return new k.default(function(l){var r=[];if(p<=0||!b){l(r);return}function i(h){return function(){if(h===null)throw new Error("Callback was already called.");var R=h;h=null;for(var O=arguments.length,g=Array(O),x=0;x<O;x++)g[x]=arguments[x];R.apply(this,g)}}function o(h){var R=-1,O=h.length;return function(){return++R<O&&!t.isCancel()?{value:h[R],key:R}:null}}var s=o(b),c=!1,a=0,u=!1;function f(h,R){a-=1,h?(c=!0,r.push(h),l(r)):R==={}||c&&a<=0?(c=!0,l(r)):u||(t.isCancel()?l(r):_())}function w(h,R){d(h).then(function(O){R(null,O)}).catch(function(O){R(O)})}function _(){for(u=!0;a<p&&!c&&!t.isCancel();){var h=s();if(h===null||r.length>0){c=!0,a<=0&&l(r);return}a+=1,w(h.value,i(f))}u=!1}_()})},m.cancel=function(b){this.options.cancelFlag=!0,b&&this.abortMultipartUpload(b.name,b.uploadId,b.options)},m.isCancel=function(){return this.options.cancelFlag},m.resetCancelFlag=function(){this.options.cancelFlag=!1},m._stop=function(){this.options.cancelFlag=!0},m._makeCancelEvent=function(){var b={status:0,name:"cancel"};return b}},{"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68}],34:[function(F,Q,j){(function(N){"use strict";var v=F("babel-runtime/core-js/json/stringify"),C=m(v),k=F("babel-runtime/core-js/object/keys"),y=m(k);function m(p){return p&&p.__esModule?p:{default:p}}var S=F("./../../shims/crypto/crypto.js"),b=F("is-type-of");j.buildCanonicalizedResource=function(d,t){var l=""+d,r="?";if(b.string(t)&&t.trim()!=="")l+=r+t;else if(b.array(t))t.sort(),l+=r+t.join("&");else if(t){var i=function(c,a){return c[0]>a[0]?1:c[0]<a[0]?-1:0},o=function(c){l+=r+c,t[c]&&(l+="="+t[c]),r="&"};(0,y.default)(t).sort(i).forEach(o)}return l},j.buildCanonicalString=function(d,t,l,r){l=l||{};var i=l.headers||{},o="x-oss-",s=[],c={},a=[d.toUpperCase(),i["Content-Md5"]||"",i["Content-Type"]||i["Content-Type".toLowerCase()],r||i["x-oss-date"]];return(0,y.default)(i).forEach(function(u){var f=u.toLowerCase();f.indexOf(o)===0&&(c[f]=String(i[u]).trim())}),(0,y.default)(c).sort().forEach(function(u){s.push(u+":"+c[u])}),a=a.concat(s),a.push(this.buildCanonicalizedResource(t,l.parameters)),a.join(`
|
|
|
`)},j.computeSignature=function(d,t){var l=S.createHmac("sha1",d);return l.update(N.from(t,"utf8")).digest("base64")},j.authorization=function(d,t,l){return"OSS "+d+":"+this.computeSignature(t,l)},j._signatureForURL=function(d){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=arguments[2],r=arguments[3],i={},o=t.subResource,s=o===void 0?{}:o;if(t.process){var c="x-oss-process";s[c]=t.process}if(t.trafficLimit){var a="x-oss-traffic-limit";s[a]=t.trafficLimit}if(t.response&&(0,y.default)(t.response).forEach(function(_){var h="response-"+_.toLowerCase();s[h]=t.response[_]}),(0,y.default)(t).forEach(function(_){var h=_.toLowerCase(),R=t[_];h.indexOf("x-oss-")===0?i[h]=R:(h.indexOf("content-md5")===0||h.indexOf("content-type")===0)&&(i[_]=R)}),Object.prototype.hasOwnProperty.call(t,"security-token")&&(s["security-token"]=t["security-token"]),Object.prototype.hasOwnProperty.call(t,"callback")){var u={callbackUrl:encodeURI(t.callback.url),callbackBody:t.callback.body};if(t.callback.host&&(u.callbackHost=t.callback.host),t.callback.contentType&&(u.callbackBodyType=t.callback.contentType),s.callback=N.from((0,C.default)(u)).toString("base64"),t.callback.customValue){var f={};(0,y.default)(t.callback.customValue).forEach(function(_){f["x:"+_]=t.callback.customValue[_]}),s["callback-var"]=N.from((0,C.default)(f)).toString("base64")}}var w=this.buildCanonicalString(t.method,l,{headers:i,parameters:s},r.toString());return{Signature:this.computeSignature(d,w),subResource:s}}}).call(this,F("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(F,Q,j){"use strict";Object.defineProperty(j,"__esModule",{value:!0}),j.checkBucketName=void 0,j.checkBucketName=function(N,v){var C=v?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;if(!C.test(N))throw new Error("The bucket must be conform to the specifications")}},{}],36:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/entries"),v=C(N);function C(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(j,"__esModule",{value:!0}),j.checkObjectTag=void 0;var k=F("./checkValid"),y=k.checkValid,m=F("./isObject"),S=m.isObject,b=[{validator:function(l){if(typeof l!="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 (/)"}],p={key:[].concat(b,[{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}]),value:[].concat(b,[{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}])};function d(t){if(!S(t))throw new Error("tag must be Object");var l=(0,v.default)(t);if(l.length>10)throw new Error("maximum of 10 tags for a object");var r=["key","value"];l.forEach(function(i){i.forEach(function(o,s){y(o,p[r[s]])})})}j.checkObjectTag=d},{"./checkValid":37,"./isObject":46,"babel-runtime/core-js/object/entries":57}],37:[function(F,Q,j){"use strict";Object.defineProperty(j,"__esModule",{value:!0}),j.checkValid=void 0;function N(v,C){C.forEach(function(k){if(k.validator)k.validator(v);else if(k.pattern&&!k.pattern.test(v))throw new Error(k.msg)})}j.checkValid=N},{}],38:[function(F,Q,j){(function(N){"use strict";var v=F("babel-runtime/core-js/object/assign"),C=k(v);function k(i){return i&&i.__esModule?i:{default:i}}Object.defineProperty(j,"__esModule",{value:!0}),j.createRequest=void 0;var y=F("./../../../shims/crypto/crypto.js"),m=F("debug")("ali-oss"),S=F("mime"),b=F("dateformat"),p=F("copy-to"),d=F("path");function t(i,o){return i[o]||i[o.toLowerCase()]}function l(i,o){delete i[o],delete i[o.toLowerCase()]}function r(i){var o=new Date;this.options.amendTimeSkewed&&(o=+new Date+this.options.amendTimeSkewed);var s={"x-oss-date":b(o,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.userAgent.includes("nodejs")&&(s["User-Agent"]=this.userAgent),this.options.isRequestPay&&(0,C.default)(s,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(s["x-oss-security-token"]=this.options.stsToken),p(i.headers).to(s),t(s,"Content-Type")||(i.mime&&i.mime.indexOf("/")>0?s["Content-Type"]=i.mime:s["Content-Type"]=S.getType(i.mime||d.extname(i.object||""))),t(s,"Content-Type")||l(s,"Content-Type"),i.content&&(s["Content-Md5"]=y.createHash("md5").update(N.from(i.content,"utf8")).digest("base64"),s["Content-Length"]||(s["Content-Length"]=i.content.length));var c=this._getResource(i);s.authorization=this.authorization(i.method,c,i.subres,s);var a=this._getReqUrl(i);m("request %s %s, with headers %j, !!stream: %s",i.method,a,s,!!i.stream);var u=i.timeout||this.options.timeout,f={method:i.method,content:i.content,stream:i.stream,headers:s,timeout:u,writeStream:i.writeStream,customResponse:i.customResponse,ctx:i.ctx||this.ctx};return this.agent&&(f.agent=this.agent),this.httpsAgent&&(f.httpsAgent=this.httpsAgent),{url:a,params:f}}j.createRequest=r}).call(this,F("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(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/keys"),v=y(N),C=F("babel-runtime/helpers/typeof"),k=y(C);function y(m){return m&&m.__esModule?m:{default:m}}Object.defineProperty(j,"__esModule",{value:!0}),j.deepCopy=void 0,j.deepCopy=function(m){if(m===null||(typeof m=="undefined"?"undefined":(0,k.default)(m))!=="object")return m;var S=Array.isArray(m)?[]:{};return(0,v.default)(m).forEach(function(b){S[b]=j.deepCopy(m[b])}),S}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],40:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/keys"),v=y(N),C=F("babel-runtime/helpers/typeof"),k=y(C);function y(b){return b&&b.__esModule?b:{default:b}}Object.defineProperty(j,"__esModule",{value:!0}),j.formatObjKey=void 0;function m(b,p){if(b===null||(typeof b=="undefined"?"undefined":(0,k.default)(b))!=="object")return b;var d=void 0;if(Array.isArray(b)){d=[];for(var t=0;t<b.length;t++)d.push(m(b[t],p))}else d={},(0,v.default)(b).forEach(function(l){d[S(l,p)]=m(b[l],p)});return d}j.formatObjKey=m;function S(b,p){return p==="firstUpperCase"?b=b.replace(/^./,function(d){return d.toUpperCase()}):p==="firstLowerCase"&&(b=b.replace(/^./,function(d){return d.toLowerCase()})),b}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],41:[function(F,Q,j){"use strict";Object.defineProperty(j,"__esModule",{value:!0}),j.getStrBytesCount=void 0;function N(v){for(var C=0,k=0;k<v.length;k++){var y=v.charAt(k);/^[\u00-\uff]$/.test(y)?C+=1:C+=2}return C}j.getStrBytesCount=N},{}],42:[function(F,Q,j){"use strict";Object.defineProperty(j,"__esModule",{value:!0}),j.isArray=void 0,j.isArray=function(N){return Object.prototype.toString.call(N)==="[object Array]"}},{}],43:[function(F,Q,j){"use strict";Object.defineProperty(j,"__esModule",{value:!0}),j.isBlob=void 0;function N(v){return typeof Blob!="undefined"&&v instanceof Blob}j.isBlob=N},{}],44:[function(F,Q,j){"use strict";Object.defineProperty(j,"__esModule",{value:!0}),j.isFile=void 0,j.isFile=function(N){return typeof File!="undefined"&&N instanceof File}},{}],45:[function(F,Q,j){"use strict";Object.defineProperty(j,"__esModule",{value:!0}),j.isIP=void 0,j.isIP=function(N){var v=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,C=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return v.test(N)||C.test(N)}},{}],46:[function(F,Q,j){"use strict";Object.defineProperty(j,"__esModule",{value:!0}),j.isObject=void 0,j.isObject=function(N){return Object.prototype.toString.call(N)==="[object Object]"}},{}],47:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/keys"),v=C(N);function C(S){return S&&S.__esModule?S:{default:S}}Object.defineProperty(j,"__esModule",{value:!0}),j.obj2xml=void 0;var k=F("./formatObjKey");function y(S){return Object.prototype.toString.call(S).replace(/(.*? |])/g,"").toLowerCase()}function m(S,b){var p="";return b&&b.headers&&(p=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
`),b&&b.firstUpperCase&&(S=k.formatObjKey(S,"firstUpperCase")),y(S)==="object"?(0,v.default)(S).forEach(function(d){y(S[d])==="string"||y(S[d])==="number"?p+="<"+d+">"+S[d]+"</"+d+">":y(S[d])==="object"?p+="<"+d+">"+m(S[d])+"</"+d+">":y(S[d])==="array"?p+=S[d].map(function(t){return"<"+d+">"+m(t)+"</"+d+">"}).join(""):p+="<"+d+">"+S[d].toString()+"</"+d+">"}):p+=S.toString(),p}j.obj2xml=m},{"./formatObjKey":40,"babel-runtime/core-js/object/keys":60}],48:[function(F,Q,j){Q.exports=N,Q.exports.HttpsAgent=N;function N(){}},{}],49:[function(F,Q,j){Q.exports=F("./register")().Promise},{"./register":51}],50:[function(F,Q,j){"use strict";var N="@@any-promise/REGISTRATION",v=null;Q.exports=function(C,k){return function(m,S){m=m||null,S=S||{};var b=S.global!==!1;if(v===null&&b&&(v=C[N]||null),v!==null&&m!==null&&v.implementation!==m)throw new Error('any-promise already defined as "'+v.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return v===null&&(m!==null&&typeof S.Promise!="undefined"?v={Promise:S.Promise,implementation:m}:v=k(m),b&&(C[N]=v)),v}}},{}],51:[function(F,Q,j){"use strict";Q.exports=F("./loader")(window,N);function N(){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(F,Q,j){Q.exports={default:F("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":77}],53:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":78}],54:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":79}],55:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":80}],56:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":81}],57:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/object/entries"),__esModule:!0}},{"core-js/library/fn/object/entries":82}],58:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":83}],59:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":84}],60:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":85}],61:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":86}],62:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":87}],63:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":88}],64:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":90}],65:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":89}],66:[function(F,Q,j){Q.exports={default:F("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":91}],67:[function(F,Q,j){"use strict";j.__esModule=!0;var N=F("../core-js/symbol/iterator"),v=m(N),C=F("../core-js/symbol"),k=m(C),y=typeof k.default=="function"&&typeof v.default=="symbol"?function(S){return typeof S}:function(S){return S&&typeof k.default=="function"&&S.constructor===k.default&&S!==k.default.prototype?"symbol":typeof S};function m(S){return S&&S.__esModule?S:{default:S}}j.default=typeof k.default=="function"&&y(v.default)==="symbol"?function(S){return typeof S=="undefined"?"undefined":y(S)}:function(S){return S&&typeof k.default=="function"&&S.constructor===k.default&&S!==k.default.prototype?"symbol":typeof S=="undefined"?"undefined":y(S)}},{"../core-js/symbol":64,"../core-js/symbol/iterator":66}],68:[function(F,Q,j){Q.exports=F("regenerator-runtime")},{"regenerator-runtime":226}],69:[function(F,Q,j){"use strict";j.byteLength=b,j.toByteArray=d,j.fromByteArray=r;for(var N=[],v=[],C=typeof Uint8Array!="undefined"?Uint8Array:Array,k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=0,m=k.length;y<m;++y)N[y]=k[y],v[k.charCodeAt(y)]=y;v["-".charCodeAt(0)]=62,v["_".charCodeAt(0)]=63;function S(i){var o=i.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var s=i.indexOf("=");s===-1&&(s=o);var c=s===o?0:4-s%4;return[s,c]}function b(i){var o=S(i),s=o[0],c=o[1];return(s+c)*3/4-c}function p(i,o,s){return(o+s)*3/4-s}function d(i){var o,s=S(i),c=s[0],a=s[1],u=new C(p(i,c,a)),f=0,w=a>0?c-4:c,_;for(_=0;_<w;_+=4)o=v[i.charCodeAt(_)]<<18|v[i.charCodeAt(_+1)]<<12|v[i.charCodeAt(_+2)]<<6|v[i.charCodeAt(_+3)],u[f++]=o>>16&255,u[f++]=o>>8&255,u[f++]=o&255;return a===2&&(o=v[i.charCodeAt(_)]<<2|v[i.charCodeAt(_+1)]>>4,u[f++]=o&255),a===1&&(o=v[i.charCodeAt(_)]<<10|v[i.charCodeAt(_+1)]<<4|v[i.charCodeAt(_+2)]>>2,u[f++]=o>>8&255,u[f++]=o&255),u}function t(i){return N[i>>18&63]+N[i>>12&63]+N[i>>6&63]+N[i&63]}function l(i,o,s){for(var c,a=[],u=o;u<s;u+=3)c=(i[u]<<16&16711680)+(i[u+1]<<8&65280)+(i[u+2]&255),a.push(t(c));return a.join("")}function r(i){for(var o,s=i.length,c=s%3,a=[],u=16383,f=0,w=s-c;f<w;f+=u)a.push(l(i,f,f+u>w?w:f+u));return c===1?(o=i[s-1],a.push(N[o>>2]+N[o<<4&63]+"==")):c===2&&(o=(i[s-2]<<8)+i[s-1],a.push(N[o>>10]+N[o>>4&63]+N[o<<2&63]+"=")),a.join("")}},{}],70:[function(F,Q,j){/*!
|
|
|
* Bowser - a browser detector
|
|
|
* https://github.com/ded/bowser
|
|
|
* MIT License | (c) Dustin Diaz 2015
|
|
|
*/!function(N,v,C){typeof Q!="undefined"&&Q.exports?Q.exports=C():typeof define=="function"&&define.amd?define(v,C):N[v]=C()}(this,"bowser",function(){var N=!0;function v(p){function d(G){var U=p.match(G);return U&&U.length>1&&U[1]||""}function t(G){var U=p.match(G);return U&&U.length>1&&U[2]||""}var l=d(/(ipod|iphone|ipad)/i).toLowerCase(),r=/like android/i.test(p),i=!r&&/android/i.test(p),o=/nexus\s*[0-6]\s*/i.test(p),s=!o&&/nexus\s*[0-9]+/i.test(p),c=/CrOS/.test(p),a=/silk/i.test(p),u=/sailfish/i.test(p),f=/tizen/i.test(p),w=/(web|hpw)(o|0)s/i.test(p),_=/windows phone/i.test(p),h=/SamsungBrowser/i.test(p),R=!_&&/windows/i.test(p),O=!l&&!a&&/macintosh/i.test(p),g=!i&&!u&&!f&&!w&&/linux/i.test(p),x=t(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),E=d(/version\/(\d+(\.\d+)?)/i),T=/tablet/i.test(p)&&!/tablet pc/i.test(p),M=!T&&/[^-]mobi/i.test(p),L=/xbox/i.test(p),A;/opera/i.test(p)?A={name:"Opera",opera:N,version:E||d(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(p)?A={name:"Opera",opera:N,version:d(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||E}:/SamsungBrowser/i.test(p)?A={name:"Samsung Internet for Android",samsungBrowser:N,version:E||d(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(p)?A={name:"NAVER Whale browser",whale:N,version:d(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(p)?A={name:"MZ Browser",mzbrowser:N,version:d(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(p)?A={name:"Opera Coast",coast:N,version:E||d(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(p)?A={name:"Focus",focus:N,version:d(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(p)?A={name:"Yandex Browser",yandexbrowser:N,version:E||d(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(p)?A={name:"UC Browser",ucbrowser:N,version:d(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(p)?A={name:"Maxthon",maxthon:N,version:d(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(p)?A={name:"Epiphany",epiphany:N,version:d(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(p)?A={name:"Puffin",puffin:N,version:d(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(p)?A={name:"Sleipnir",sleipnir:N,version:d(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(p)?A={name:"K-Meleon",kMeleon:N,version:d(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:_?(A={name:"Windows Phone",osname:"Windows Phone",windowsphone:N},x?(A.msedge=N,A.version=x):(A.msie=N,A.version=d(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(p)?A={name:"Internet Explorer",msie:N,version:d(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:c?A={name:"Chrome",osname:"Chrome OS",chromeos:N,chromeBook:N,chrome:N,version:d(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(p)?A={name:"Microsoft Edge",msedge:N,version:x}:/vivaldi/i.test(p)?A={name:"Vivaldi",vivaldi:N,version:d(/vivaldi\/(\d+(\.\d+)?)/i)||E}:u?A={name:"Sailfish",osname:"Sailfish OS",sailfish:N,version:d(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(p)?A={name:"SeaMonkey",seamonkey:N,version:d(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(p)?(A={name:"Firefox",firefox:N,version:d(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(p)&&(A.firefoxos=N,A.osname="Firefox OS")):a?A={name:"Amazon Silk",silk:N,version:d(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(p)?A={name:"PhantomJS",phantom:N,version:d(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(p)?A={name:"SlimerJS",slimer:N,version:d(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(p)||/rim\stablet/i.test(p)?A={name:"BlackBerry",osname:"BlackBerry OS",blackberry:N,version:E||d(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:w?(A={name:"WebOS",osname:"WebOS",webos:N,version:E||d(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(p)&&(A.touchpad=N)):/bada/i.test(p)?A={name:"Bada",osname:"Bada",bada:N,version:d(/dolfin\/(\d+(\.\d+)?)/i)}:f?A={name:"Tizen",osname:"Tizen",tizen:N,version:d(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||E}:/qupzilla/i.test(p)?A={name:"QupZilla",qupzilla:N,version:d(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||E}:/chromium/i.test(p)?A={name:"Chromium",chromium:N,version:d(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||E}:/chrome|crios|crmo/i.test(p)?A={name:"Chrome",chrome:N,version:d(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:i?A={name:"Android",version:E}:/safari|applewebkit/i.test(p)?(A={name:"Safari",safari:N},E&&(A.version=E)):l?(A={name:l=="iphone"?"iPhone":l=="ipad"?"iPad":"iPod"},E&&(A.version=E)):/googlebot/i.test(p)?A={name:"Googlebot",googlebot:N,version:d(/googlebot\/(\d+(\.\d+))/i)||E}:A={name:d(/^(.*)\/(.*) /),version:t(/^(.*)\/(.*) /)},!A.msedge&&/(apple)?webkit/i.test(p)?(/(apple)?webkit\/537\.36/i.test(p)?(A.name=A.name||"Blink",A.blink=N):(A.name=A.name||"Webkit",A.webkit=N),!A.version&&E&&(A.version=E)):!A.opera&&/gecko\//i.test(p)&&(A.name=A.name||"Gecko",A.gecko=N,A.version=A.version||d(/gecko\/(\d+(\.\d+)?)/i)),!A.windowsphone&&(i||A.silk)?(A.android=N,A.osname="Android"):!A.windowsphone&&l?(A[l]=N,A.ios=N,A.osname="iOS"):O?(A.mac=N,A.osname="macOS"):L?(A.xbox=N,A.osname="Xbox"):R?(A.windows=N,A.osname="Windows"):g&&(A.linux=N,A.osname="Linux");function V(G){switch(G){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 z="";A.windows?z=V(d(/Windows ((NT|XP)( \d\d?.\d)?)/i)):A.windowsphone?z=d(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):A.mac?(z=d(/Mac OS X (\d+([_\.\s]\d+)*)/i),z=z.replace(/[_\s]/g,".")):l?(z=d(/os (\d+([_\s]\d+)*) like mac os x/i),z=z.replace(/[_\s]/g,".")):i?z=d(/android[ \/-](\d+(\.\d+)*)/i):A.webos?z=d(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):A.blackberry?z=d(/rim\stablet\sos\s(\d+(\.\d+)*)/i):A.bada?z=d(/bada\/(\d+(\.\d+)*)/i):A.tizen&&(z=d(/tizen[\/\s](\d+(\.\d+)*)/i)),z&&(A.osversion=z);var W=!A.windows&&z.split(".")[0];return T||s||l=="ipad"||i&&(W==3||W>=4&&!M)||A.silk?A.tablet=N:(M||l=="iphone"||l=="ipod"||i||o||A.blackberry||A.webos||A.bada)&&(A.mobile=N),A.msedge||A.msie&&A.version>=10||A.yandexbrowser&&A.version>=15||A.vivaldi&&A.version>=1||A.chrome&&A.version>=20||A.samsungBrowser&&A.version>=4||A.whale&&m([A.version,"1.0"])===1||A.mzbrowser&&m([A.version,"6.0"])===1||A.focus&&m([A.version,"1.0"])===1||A.firefox&&A.version>=20||A.safari&&A.version>=6||A.opera&&A.version>=10||A.ios&&A.osversion&&A.osversion.split(".")[0]>=6||A.blackberry&&A.version>=10.1||A.chromium&&A.version>=20?A.a=N:A.msie&&A.version<10||A.chrome&&A.version<20||A.firefox&&A.version<20||A.safari&&A.version<6||A.opera&&A.version<10||A.ios&&A.osversion&&A.osversion.split(".")[0]<6||A.chromium&&A.version<20?A.c=N:A.x=N,A}var C=v(typeof navigator!="undefined"&&navigator.userAgent||"");C.test=function(p){for(var d=0;d<p.length;++d){var t=p[d];if(typeof t=="string"&&t in C)return!0}return!1};function k(p){return p.split(".").length}function y(p,d){var t=[],l;if(Array.prototype.map)return Array.prototype.map.call(p,d);for(l=0;l<p.length;l++)t.push(d(p[l]));return t}function m(p){for(var d=Math.max(k(p[0]),k(p[1])),t=y(p,function(l){var r=d-k(l);return l=l+new Array(r+1).join(".0"),y(l.split("."),function(i){return new Array(20-i.length).join("0")+i}).reverse()});--d>=0;){if(t[0][d]>t[1][d])return 1;if(t[0][d]===t[1][d]){if(d===0)return 0}else return-1}}function S(p,d,t){var l=C;typeof d=="string"&&(t=d,d=void 0),d===void 0&&(d=!1),t&&(l=v(t));var r=""+l.version;for(var i in p)if(p.hasOwnProperty(i)&&l[i]){if(typeof p[i]!="string")throw new Error("Browser version in the minVersion map should be a string: "+i+": "+String(p));return m([r,p[i]])<0}return d}function b(p,d,t){return!S(p,d,t)}return C.isUnsupportedBrowser=S,C.compareVersions=m,C.check=b,C._detect=v,C.detect=v,C})},{}],71:[function(F,Q,j){},{}],72:[function(F,Q,j){var N=F("buffer").Buffer,v=N.isEncoding||function(b){switch(b&&b.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 C(b){if(b&&!v(b))throw new Error("Unknown encoding: "+b)}var k=j.StringDecoder=function(b){this.encoding=(b||"utf8").toLowerCase().replace(/[-_]/,""),C(b);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=m;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=S;break;default:this.write=y;return}this.charBuffer=new N(6),this.charReceived=0,this.charLength=0};k.prototype.write=function(b){for(var p="";this.charLength;){var d=b.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:b.length;if(b.copy(this.charBuffer,this.charReceived,0,d),this.charReceived+=d,this.charReceived<this.charLength)return"";b=b.slice(d,b.length),p=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var l=p.charCodeAt(p.length-1);if(l>=55296&&l<=56319){this.charLength+=this.surrogateSize,p="";continue}if(this.charReceived=this.charLength=0,b.length===0)return p;break}this.detectIncompleteChar(b);var t=b.length;this.charLength&&(b.copy(this.charBuffer,0,b.length-this.charReceived,t),t-=this.charReceived),p+=b.toString(this.encoding,0,t);var t=p.length-1,l=p.charCodeAt(t);if(l>=55296&&l<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),b.copy(this.charBuffer,0,0,r),p.substring(0,t)}return p},k.prototype.detectIncompleteChar=function(b){for(var p=b.length>=3?3:b.length;p>0;p--){var d=b[b.length-p];if(p==1&&d>>5==6){this.charLength=2;break}if(p<=2&&d>>4==14){this.charLength=3;break}if(p<=3&&d>>3==30){this.charLength=4;break}}this.charReceived=p},k.prototype.end=function(b){var p="";if(b&&b.length&&(p=this.write(b)),this.charReceived){var d=this.charReceived,t=this.charBuffer,l=this.encoding;p+=t.slice(0,d).toString(l)}return p};function y(b){return b.toString(this.encoding)}function m(b){this.charReceived=b.length%2,this.charLength=this.charReceived?2:0}function S(b){this.charReceived=b.length%3,this.charLength=this.charReceived?3:0}},{buffer:73}],73:[function(F,Q,j){(function(N,v){/*!
|
|
|
* The buffer module from node.js, for the browser.
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
|
* @license MIT
|
|
|
*/"use strict";var C=F("base64-js"),k=F("ieee754"),y=F("isarray");j.Buffer=v,j.SlowBuffer=a,j.INSPECT_MAX_BYTES=50,v.TYPED_ARRAY_SUPPORT=N.TYPED_ARRAY_SUPPORT!==void 0?N.TYPED_ARRAY_SUPPORT:m(),j.kMaxLength=S();function m(){try{var oe=new Uint8Array(1);return oe.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},oe.foo()===42&&typeof oe.subarray=="function"&&oe.subarray(1,1).byteLength===0}catch(q){return!1}}function S(){return v.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function b(oe,q){if(S()<q)throw new RangeError("Invalid typed array length");return v.TYPED_ARRAY_SUPPORT?(oe=new Uint8Array(q),oe.__proto__=v.prototype):(oe===null&&(oe=new v(q)),oe.length=q),oe}function v(oe,q,Y){if(!v.TYPED_ARRAY_SUPPORT&&!(this instanceof v))return new v(oe,q,Y);if(typeof oe=="number"){if(typeof q=="string")throw new Error("If encoding is specified then the first argument must be a string");return l(this,oe)}return p(this,oe,q,Y)}v.poolSize=8192,v._augment=function(oe){return oe.__proto__=v.prototype,oe};function p(oe,q,Y,Z){if(typeof q=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&q instanceof ArrayBuffer?o(oe,q,Y,Z):typeof q=="string"?r(oe,q,Y):s(oe,q)}v.from=function(oe,q,Y){return p(null,oe,q,Y)},v.TYPED_ARRAY_SUPPORT&&(v.prototype.__proto__=Uint8Array.prototype,v.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&v[Symbol.species]===v&&Object.defineProperty(v,Symbol.species,{value:null,configurable:!0}));function d(oe){if(typeof oe!="number")throw new TypeError('"size" argument must be a number');if(oe<0)throw new RangeError('"size" argument must not be negative')}function t(oe,q,Y,Z){return d(q),q<=0?b(oe,q):Y!==void 0?typeof Z=="string"?b(oe,q).fill(Y,Z):b(oe,q).fill(Y):b(oe,q)}v.alloc=function(oe,q,Y){return t(null,oe,q,Y)};function l(oe,q){if(d(q),oe=b(oe,q<0?0:c(q)|0),!v.TYPED_ARRAY_SUPPORT)for(var Y=0;Y<q;++Y)oe[Y]=0;return oe}v.allocUnsafe=function(oe){return l(null,oe)},v.allocUnsafeSlow=function(oe){return l(null,oe)};function r(oe,q,Y){if((typeof Y!="string"||Y==="")&&(Y="utf8"),!v.isEncoding(Y))throw new TypeError('"encoding" must be a valid string encoding');var Z=u(q,Y)|0;oe=b(oe,Z);var ye=oe.write(q,Y);return ye!==Z&&(oe=oe.slice(0,ye)),oe}function i(oe,q){var Y=q.length<0?0:c(q.length)|0;oe=b(oe,Y);for(var Z=0;Z<Y;Z+=1)oe[Z]=q[Z]&255;return oe}function o(oe,q,Y,Z){if(q.byteLength,Y<0||q.byteLength<Y)throw new RangeError("'offset' is out of bounds");if(q.byteLength<Y+(Z||0))throw new RangeError("'length' is out of bounds");return Y===void 0&&Z===void 0?q=new Uint8Array(q):Z===void 0?q=new Uint8Array(q,Y):q=new Uint8Array(q,Y,Z),v.TYPED_ARRAY_SUPPORT?(oe=q,oe.__proto__=v.prototype):oe=i(oe,q),oe}function s(oe,q){if(v.isBuffer(q)){var Y=c(q.length)|0;return oe=b(oe,Y),oe.length===0||q.copy(oe,0,0,Y),oe}if(q){if(typeof ArrayBuffer!="undefined"&&q.buffer instanceof ArrayBuffer||"length"in q)return typeof q.length!="number"||Oe(q.length)?b(oe,0):i(oe,q);if(q.type==="Buffer"&&y(q.data))return i(oe,q.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function c(oe){if(oe>=S())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S().toString(16)+" bytes");return oe|0}function a(oe){return+oe!=oe&&(oe=0),v.alloc(+oe)}v.isBuffer=function(q){return!!(q!=null&&q._isBuffer)},v.compare=function(q,Y){if(!v.isBuffer(q)||!v.isBuffer(Y))throw new TypeError("Arguments must be Buffers");if(q===Y)return 0;for(var Z=q.length,ye=Y.length,be=0,Re=Math.min(Z,ye);be<Re;++be)if(q[be]!==Y[be]){Z=q[be],ye=Y[be];break}return Z<ye?-1:ye<Z?1:0},v.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}},v.concat=function(q,Y){if(!y(q))throw new TypeError('"list" argument must be an Array of Buffers');if(q.length===0)return v.alloc(0);var Z;if(Y===void 0)for(Y=0,Z=0;Z<q.length;++Z)Y+=q[Z].length;var ye=v.allocUnsafe(Y),be=0;for(Z=0;Z<q.length;++Z){var Re=q[Z];if(!v.isBuffer(Re))throw new TypeError('"list" argument must be an Array of Buffers');Re.copy(ye,be),be+=Re.length}return ye};function u(oe,q){if(v.isBuffer(oe))return oe.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(oe)||oe instanceof ArrayBuffer))return oe.byteLength;typeof oe!="string"&&(oe=""+oe);var Y=oe.length;if(Y===0)return 0;for(var Z=!1;;)switch(q){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":case void 0:return ue(oe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>1;case"base64":return ne(oe).length;default:if(Z)return ue(oe).length;q=(""+q).toLowerCase(),Z=!0}}v.byteLength=u;function f(oe,q,Y){var Z=!1;if((q===void 0||q<0)&&(q=0),q>this.length)return"";if((Y===void 0||Y>this.length)&&(Y=this.length),Y<=0)return"";if(Y>>>=0,q>>>=0,Y<=q)return"";for(oe||(oe="utf8");;)switch(oe){case"hex":return G(this,q,Y);case"utf8":case"utf-8":return L(this,q,Y);case"ascii":return z(this,q,Y);case"latin1":case"binary":return W(this,q,Y);case"base64":return M(this,q,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,q,Y);default:if(Z)throw new TypeError("Unknown encoding: "+oe);oe=(oe+"").toLowerCase(),Z=!0}}v.prototype._isBuffer=!0;function w(oe,q,Y){var Z=oe[q];oe[q]=oe[Y],oe[Y]=Z}v.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 Y=0;Y<q;Y+=2)w(this,Y,Y+1);return this},v.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 Y=0;Y<q;Y+=4)w(this,Y,Y+3),w(this,Y+1,Y+2);return this},v.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 Y=0;Y<q;Y+=8)w(this,Y,Y+7),w(this,Y+1,Y+6),w(this,Y+2,Y+5),w(this,Y+3,Y+4);return this},v.prototype.toString=function(){var q=this.length|0;return q===0?"":arguments.length===0?L(this,0,q):f.apply(this,arguments)},v.prototype.equals=function(q){if(!v.isBuffer(q))throw new TypeError("Argument must be a Buffer");return this===q?!0:v.compare(this,q)===0},v.prototype.inspect=function(){var q="",Y=j.INSPECT_MAX_BYTES;return this.length>0&&(q=this.toString("hex",0,Y).match(/.{2}/g).join(" "),this.length>Y&&(q+=" ... ")),"<Buffer "+q+">"},v.prototype.compare=function(q,Y,Z,ye,be){if(!v.isBuffer(q))throw new TypeError("Argument must be a Buffer");if(Y===void 0&&(Y=0),Z===void 0&&(Z=q?q.length:0),ye===void 0&&(ye=0),be===void 0&&(be=this.length),Y<0||Z>q.length||ye<0||be>this.length)throw new RangeError("out of range index");if(ye>=be&&Y>=Z)return 0;if(ye>=be)return-1;if(Y>=Z)return 1;if(Y>>>=0,Z>>>=0,ye>>>=0,be>>>=0,this===q)return 0;for(var Re=be-ye,Qe=Z-Y,rt=Math.min(Re,Qe),at=this.slice(ye,be),qe=q.slice(Y,Z),st=0;st<rt;++st)if(at[st]!==qe[st]){Re=at[st],Qe=qe[st];break}return Re<Qe?-1:Qe<Re?1:0};function _(oe,q,Y,Z,ye){if(oe.length===0)return-1;if(typeof Y=="string"?(Z=Y,Y=0):Y>2147483647?Y=2147483647:Y<-2147483648&&(Y=-2147483648),Y=+Y,isNaN(Y)&&(Y=ye?0:oe.length-1),Y<0&&(Y=oe.length+Y),Y>=oe.length){if(ye)return-1;Y=oe.length-1}else if(Y<0)if(ye)Y=0;else return-1;if(typeof q=="string"&&(q=v.from(q,Z)),v.isBuffer(q))return q.length===0?-1:h(oe,q,Y,Z,ye);if(typeof q=="number")return q=q&255,v.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?ye?Uint8Array.prototype.indexOf.call(oe,q,Y):Uint8Array.prototype.lastIndexOf.call(oe,q,Y):h(oe,[q],Y,Z,ye);throw new TypeError("val must be string, number or Buffer")}function h(oe,q,Y,Z,ye){var be=1,Re=oe.length,Qe=q.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(oe.length<2||q.length<2)return-1;be=2,Re/=2,Qe/=2,Y/=2}function rt(je,Ie){return be===1?je[Ie]:je.readUInt16BE(Ie*be)}var at;if(ye){var qe=-1;for(at=Y;at<Re;at++)if(rt(oe,at)===rt(q,qe===-1?0:at-qe)){if(qe===-1&&(qe=at),at-qe+1===Qe)return qe*be}else qe!==-1&&(at-=at-qe),qe=-1}else for(Y+Qe>Re&&(Y=Re-Qe),at=Y;at>=0;at--){for(var st=!0,lt=0;lt<Qe;lt++)if(rt(oe,at+lt)!==rt(q,lt)){st=!1;break}if(st)return at}return-1}v.prototype.includes=function(q,Y,Z){return this.indexOf(q,Y,Z)!==-1},v.prototype.indexOf=function(q,Y,Z){return _(this,q,Y,Z,!0)},v.prototype.lastIndexOf=function(q,Y,Z){return _(this,q,Y,Z,!1)};function R(oe,q,Y,Z){Y=Number(Y)||0;var ye=oe.length-Y;Z?(Z=Number(Z),Z>ye&&(Z=ye)):Z=ye;var be=q.length;if(be%2!==0)throw new TypeError("Invalid hex string");Z>be/2&&(Z=be/2);for(var Re=0;Re<Z;++Re){var Qe=parseInt(q.substr(Re*2,2),16);if(isNaN(Qe))return Re;oe[Y+Re]=Qe}return Re}function O(oe,q,Y,Z){return ce(ue(q,oe.length-Y),oe,Y,Z)}function g(oe,q,Y,Z){return ce(ie(q),oe,Y,Z)}function x(oe,q,Y,Z){return g(oe,q,Y,Z)}function E(oe,q,Y,Z){return ce(ne(q),oe,Y,Z)}function T(oe,q,Y,Z){return ce(Se(q,oe.length-Y),oe,Y,Z)}v.prototype.write=function(q,Y,Z,ye){if(Y===void 0)ye="utf8",Z=this.length,Y=0;else if(Z===void 0&&typeof Y=="string")ye=Y,Z=this.length,Y=0;else if(isFinite(Y))Y=Y|0,isFinite(Z)?(Z=Z|0,ye===void 0&&(ye="utf8")):(ye=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var be=this.length-Y;if((Z===void 0||Z>be)&&(Z=be),q.length>0&&(Z<0||Y<0)||Y>this.length)throw new RangeError("Attempt to write outside buffer bounds");ye||(ye="utf8");for(var Re=!1;;)switch(ye){case"hex":return R(this,q,Y,Z);case"utf8":case"utf-8":return O(this,q,Y,Z);case"ascii":return g(this,q,Y,Z);case"latin1":case"binary":return x(this,q,Y,Z);case"base64":return E(this,q,Y,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,q,Y,Z);default:if(Re)throw new TypeError("Unknown encoding: "+ye);ye=(""+ye).toLowerCase(),Re=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function M(oe,q,Y){return q===0&&Y===oe.length?C.fromByteArray(oe):C.fromByteArray(oe.slice(q,Y))}function L(oe,q,Y){Y=Math.min(oe.length,Y);for(var Z=[],ye=q;ye<Y;){var be=oe[ye],Re=null,Qe=be>239?4:be>223?3:be>191?2:1;if(ye+Qe<=Y){var rt,at,qe,st;switch(Qe){case 1:be<128&&(Re=be);break;case 2:rt=oe[ye+1],(rt&192)===128&&(st=(be&31)<<6|rt&63,st>127&&(Re=st));break;case 3:rt=oe[ye+1],at=oe[ye+2],(rt&192)===128&&(at&192)===128&&(st=(be&15)<<12|(rt&63)<<6|at&63,st>2047&&(st<55296||st>57343)&&(Re=st));break;case 4:rt=oe[ye+1],at=oe[ye+2],qe=oe[ye+3],(rt&192)===128&&(at&192)===128&&(qe&192)===128&&(st=(be&15)<<18|(rt&63)<<12|(at&63)<<6|qe&63,st>65535&&st<1114112&&(Re=st))}}Re===null?(Re=65533,Qe=1):Re>65535&&(Re-=65536,Z.push(Re>>>10&1023|55296),Re=56320|Re&1023),Z.push(Re),ye+=Qe}return V(Z)}var A=4096;function V(oe){var q=oe.length;if(q<=A)return String.fromCharCode.apply(String,oe);for(var Y="",Z=0;Z<q;)Y+=String.fromCharCode.apply(String,oe.slice(Z,Z+=A));return Y}function z(oe,q,Y){var Z="";Y=Math.min(oe.length,Y);for(var ye=q;ye<Y;++ye)Z+=String.fromCharCode(oe[ye]&127);return Z}function W(oe,q,Y){var Z="";Y=Math.min(oe.length,Y);for(var ye=q;ye<Y;++ye)Z+=String.fromCharCode(oe[ye]);return Z}function G(oe,q,Y){var Z=oe.length;(!q||q<0)&&(q=0),(!Y||Y<0||Y>Z)&&(Y=Z);for(var ye="",be=q;be<Y;++be)ye+=he(oe[be]);return ye}function U(oe,q,Y){for(var Z=oe.slice(q,Y),ye="",be=0;be<Z.length;be+=2)ye+=String.fromCharCode(Z[be]+Z[be+1]*256);return ye}v.prototype.slice=function(q,Y){var Z=this.length;q=~~q,Y=Y===void 0?Z:~~Y,q<0?(q+=Z,q<0&&(q=0)):q>Z&&(q=Z),Y<0?(Y+=Z,Y<0&&(Y=0)):Y>Z&&(Y=Z),Y<q&&(Y=q);var ye;if(v.TYPED_ARRAY_SUPPORT)ye=this.subarray(q,Y),ye.__proto__=v.prototype;else{var be=Y-q;ye=new v(be,void 0);for(var Re=0;Re<be;++Re)ye[Re]=this[Re+q]}return ye};function P(oe,q,Y){if(oe%1!==0||oe<0)throw new RangeError("offset is not uint");if(oe+q>Y)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUIntLE=function(q,Y,Z){q=q|0,Y=Y|0,Z||P(q,Y,this.length);for(var ye=this[q],be=1,Re=0;++Re<Y&&(be*=256);)ye+=this[q+Re]*be;return ye},v.prototype.readUIntBE=function(q,Y,Z){q=q|0,Y=Y|0,Z||P(q,Y,this.length);for(var ye=this[q+--Y],be=1;Y>0&&(be*=256);)ye+=this[q+--Y]*be;return ye},v.prototype.readUInt8=function(q,Y){return Y||P(q,1,this.length),this[q]},v.prototype.readUInt16LE=function(q,Y){return Y||P(q,2,this.length),this[q]|this[q+1]<<8},v.prototype.readUInt16BE=function(q,Y){return Y||P(q,2,this.length),this[q]<<8|this[q+1]},v.prototype.readUInt32LE=function(q,Y){return Y||P(q,4,this.length),(this[q]|this[q+1]<<8|this[q+2]<<16)+this[q+3]*16777216},v.prototype.readUInt32BE=function(q,Y){return Y||P(q,4,this.length),this[q]*16777216+(this[q+1]<<16|this[q+2]<<8|this[q+3])},v.prototype.readIntLE=function(q,Y,Z){q=q|0,Y=Y|0,Z||P(q,Y,this.length);for(var ye=this[q],be=1,Re=0;++Re<Y&&(be*=256);)ye+=this[q+Re]*be;return be*=128,ye>=be&&(ye-=Math.pow(2,8*Y)),ye},v.prototype.readIntBE=function(q,Y,Z){q=q|0,Y=Y|0,Z||P(q,Y,this.length);for(var ye=Y,be=1,Re=this[q+--ye];ye>0&&(be*=256);)Re+=this[q+--ye]*be;return be*=128,Re>=be&&(Re-=Math.pow(2,8*Y)),Re},v.prototype.readInt8=function(q,Y){return Y||P(q,1,this.length),this[q]&128?(255-this[q]+1)*-1:this[q]},v.prototype.readInt16LE=function(q,Y){Y||P(q,2,this.length);var Z=this[q]|this[q+1]<<8;return Z&32768?Z|4294901760:Z},v.prototype.readInt16BE=function(q,Y){Y||P(q,2,this.length);var Z=this[q+1]|this[q]<<8;return Z&32768?Z|4294901760:Z},v.prototype.readInt32LE=function(q,Y){return Y||P(q,4,this.length),this[q]|this[q+1]<<8|this[q+2]<<16|this[q+3]<<24},v.prototype.readInt32BE=function(q,Y){return Y||P(q,4,this.length),this[q]<<24|this[q+1]<<16|this[q+2]<<8|this[q+3]},v.prototype.readFloatLE=function(q,Y){return Y||P(q,4,this.length),k.read(this,q,!0,23,4)},v.prototype.readFloatBE=function(q,Y){return Y||P(q,4,this.length),k.read(this,q,!1,23,4)},v.prototype.readDoubleLE=function(q,Y){return Y||P(q,8,this.length),k.read(this,q,!0,52,8)},v.prototype.readDoubleBE=function(q,Y){return Y||P(q,8,this.length),k.read(this,q,!1,52,8)};function H(oe,q,Y,Z,ye,be){if(!v.isBuffer(oe))throw new TypeError('"buffer" argument must be a Buffer instance');if(q>ye||q<be)throw new RangeError('"value" argument is out of bounds');if(Y+Z>oe.length)throw new RangeError("Index out of range")}v.prototype.writeUIntLE=function(q,Y,Z,ye){if(q=+q,Y=Y|0,Z=Z|0,!ye){var be=Math.pow(2,8*Z)-1;H(this,q,Y,Z,be,0)}var Re=1,Qe=0;for(this[Y]=q&255;++Qe<Z&&(Re*=256);)this[Y+Qe]=q/Re&255;return Y+Z},v.prototype.writeUIntBE=function(q,Y,Z,ye){if(q=+q,Y=Y|0,Z=Z|0,!ye){var be=Math.pow(2,8*Z)-1;H(this,q,Y,Z,be,0)}var Re=Z-1,Qe=1;for(this[Y+Re]=q&255;--Re>=0&&(Qe*=256);)this[Y+Re]=q/Qe&255;return Y+Z},v.prototype.writeUInt8=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,1,255,0),v.TYPED_ARRAY_SUPPORT||(q=Math.floor(q)),this[Y]=q&255,Y+1};function $(oe,q,Y,Z){q<0&&(q=65535+q+1);for(var ye=0,be=Math.min(oe.length-Y,2);ye<be;++ye)oe[Y+ye]=(q&255<<8*(Z?ye:1-ye))>>>(Z?ye:1-ye)*8}v.prototype.writeUInt16LE=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[Y]=q&255,this[Y+1]=q>>>8):$(this,q,Y,!0),Y+2},v.prototype.writeUInt16BE=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[Y]=q>>>8,this[Y+1]=q&255):$(this,q,Y,!1),Y+2};function re(oe,q,Y,Z){q<0&&(q=4294967295+q+1);for(var ye=0,be=Math.min(oe.length-Y,4);ye<be;++ye)oe[Y+ye]=q>>>(Z?ye:3-ye)*8&255}v.prototype.writeUInt32LE=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[Y+3]=q>>>24,this[Y+2]=q>>>16,this[Y+1]=q>>>8,this[Y]=q&255):re(this,q,Y,!0),Y+4},v.prototype.writeUInt32BE=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[Y]=q>>>24,this[Y+1]=q>>>16,this[Y+2]=q>>>8,this[Y+3]=q&255):re(this,q,Y,!1),Y+4},v.prototype.writeIntLE=function(q,Y,Z,ye){if(q=+q,Y=Y|0,!ye){var be=Math.pow(2,8*Z-1);H(this,q,Y,Z,be-1,-be)}var Re=0,Qe=1,rt=0;for(this[Y]=q&255;++Re<Z&&(Qe*=256);)q<0&&rt===0&&this[Y+Re-1]!==0&&(rt=1),this[Y+Re]=(q/Qe>>0)-rt&255;return Y+Z},v.prototype.writeIntBE=function(q,Y,Z,ye){if(q=+q,Y=Y|0,!ye){var be=Math.pow(2,8*Z-1);H(this,q,Y,Z,be-1,-be)}var Re=Z-1,Qe=1,rt=0;for(this[Y+Re]=q&255;--Re>=0&&(Qe*=256);)q<0&&rt===0&&this[Y+Re+1]!==0&&(rt=1),this[Y+Re]=(q/Qe>>0)-rt&255;return Y+Z},v.prototype.writeInt8=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,1,127,-128),v.TYPED_ARRAY_SUPPORT||(q=Math.floor(q)),q<0&&(q=255+q+1),this[Y]=q&255,Y+1},v.prototype.writeInt16LE=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[Y]=q&255,this[Y+1]=q>>>8):$(this,q,Y,!0),Y+2},v.prototype.writeInt16BE=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[Y]=q>>>8,this[Y+1]=q&255):$(this,q,Y,!1),Y+2},v.prototype.writeInt32LE=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,4,2147483647,-2147483648),v.TYPED_ARRAY_SUPPORT?(this[Y]=q&255,this[Y+1]=q>>>8,this[Y+2]=q>>>16,this[Y+3]=q>>>24):re(this,q,Y,!0),Y+4},v.prototype.writeInt32BE=function(q,Y,Z){return q=+q,Y=Y|0,Z||H(this,q,Y,4,2147483647,-2147483648),q<0&&(q=4294967295+q+1),v.TYPED_ARRAY_SUPPORT?(this[Y]=q>>>24,this[Y+1]=q>>>16,this[Y+2]=q>>>8,this[Y+3]=q&255):re(this,q,Y,!1),Y+4};function te(oe,q,Y,Z,ye,be){if(Y+Z>oe.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("Index out of range")}function ge(oe,q,Y,Z,ye){return ye||te(oe,q,Y,4,34028234663852886e22,-34028234663852886e22),k.write(oe,q,Y,Z,23,4),Y+4}v.prototype.writeFloatLE=function(q,Y,Z){return ge(this,q,Y,!0,Z)},v.prototype.writeFloatBE=function(q,Y,Z){return ge(this,q,Y,!1,Z)};function ve(oe,q,Y,Z,ye){return ye||te(oe,q,Y,8,17976931348623157e292,-17976931348623157e292),k.write(oe,q,Y,Z,52,8),Y+8}v.prototype.writeDoubleLE=function(q,Y,Z){return ve(this,q,Y,!0,Z)},v.prototype.writeDoubleBE=function(q,Y,Z){return ve(this,q,Y,!1,Z)},v.prototype.copy=function(q,Y,Z,ye){if(Z||(Z=0),!ye&&ye!==0&&(ye=this.length),Y>=q.length&&(Y=q.length),Y||(Y=0),ye>0&&ye<Z&&(ye=Z),ye===Z)return 0;if(q.length===0||this.length===0)return 0;if(Y<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("sourceStart out of bounds");if(ye<0)throw new RangeError("sourceEnd out of bounds");ye>this.length&&(ye=this.length),q.length-Y<ye-Z&&(ye=q.length-Y+Z);var be=ye-Z,Re;if(this===q&&Z<Y&&Y<ye)for(Re=be-1;Re>=0;--Re)q[Re+Y]=this[Re+Z];else if(be<1e3||!v.TYPED_ARRAY_SUPPORT)for(Re=0;Re<be;++Re)q[Re+Y]=this[Re+Z];else Uint8Array.prototype.set.call(q,this.subarray(Z,Z+be),Y);return be},v.prototype.fill=function(q,Y,Z,ye){if(typeof q=="string"){if(typeof Y=="string"?(ye=Y,Y=0,Z=this.length):typeof Z=="string"&&(ye=Z,Z=this.length),q.length===1){var be=q.charCodeAt(0);be<256&&(q=be)}if(ye!==void 0&&typeof ye!="string")throw new TypeError("encoding must be a string");if(typeof ye=="string"&&!v.isEncoding(ye))throw new TypeError("Unknown encoding: "+ye)}else typeof q=="number"&&(q=q&255);if(Y<0||this.length<Y||this.length<Z)throw new RangeError("Out of range index");if(Z<=Y)return this;Y=Y>>>0,Z=Z===void 0?this.length:Z>>>0,q||(q=0);var Re;if(typeof q=="number")for(Re=Y;Re<Z;++Re)this[Re]=q;else{var Qe=v.isBuffer(q)?q:ue(new v(q,ye).toString()),rt=Qe.length;for(Re=0;Re<Z-Y;++Re)this[Re+Y]=Qe[Re%rt]}return this};var de=/[^+\/0-9A-Za-z-_]/g;function De(oe){if(oe=Te(oe).replace(de,""),oe.length<2)return"";for(;oe.length%4!==0;)oe=oe+"=";return oe}function Te(oe){return oe.trim?oe.trim():oe.replace(/^\s+|\s+$/g,"")}function he(oe){return oe<16?"0"+oe.toString(16):oe.toString(16)}function ue(oe,q){q=q||Infinity;for(var Y,Z=oe.length,ye=null,be=[],Re=0;Re<Z;++Re){if(Y=oe.charCodeAt(Re),Y>55295&&Y<57344){if(!ye){if(Y>56319){(q-=3)>-1&&be.push(239,191,189);continue}else if(Re+1===Z){(q-=3)>-1&&be.push(239,191,189);continue}ye=Y;continue}if(Y<56320){(q-=3)>-1&&be.push(239,191,189),ye=Y;continue}Y=(ye-55296<<10|Y-56320)+65536}else ye&&((q-=3)>-1&&be.push(239,191,189));if(ye=null,Y<128){if((q-=1)<0)break;be.push(Y)}else if(Y<2048){if((q-=2)<0)break;be.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((q-=3)<0)break;be.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((q-=4)<0)break;be.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,Y&63|128)}else throw new Error("Invalid code point")}return be}function ie(oe){for(var q=[],Y=0;Y<oe.length;++Y)q.push(oe.charCodeAt(Y)&255);return q}function Se(oe,q){for(var Y,Z,ye,be=[],Re=0;Re<oe.length&&!((q-=2)<0);++Re)Y=oe.charCodeAt(Re),Z=Y>>8,ye=Y%256,be.push(ye),be.push(Z);return be}function ne(oe){return C.toByteArray(De(oe))}function ce(oe,q,Y,Z){for(var ye=0;ye<Z&&!(ye+Y>=q.length||ye>=oe.length);++ye)q[ye+Y]=oe[ye];return ye}function Oe(oe){return oe!==oe}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},F("buffer").Buffer)},{"base64-js":69,buffer:73,ieee754:195,isarray:198}],74:[function(F,Q,j){Q.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(F,Q,j){Q.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(F,Q,j){/*!
|
|
|
* copy-to - index.js
|
|
|
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var N=Array.prototype.slice;Q.exports=v;function v(k,y){if(!(this instanceof v))return new v(k,y);this.src=k,this._withAccess=y}v.prototype.withAccess=function(k){return this._withAccess=k!==!1,this},v.prototype.pick=function(k){return Array.isArray(k)||(k=N.call(arguments)),k.length&&(this.keys=k),this},v.prototype.to=function(k){if(k=k||{},!this.src)return k;var y=this.keys||Object.keys(this.src);if(!this._withAccess){for(var m=0;m<y.length;m++){if(S=y[m],k[S]!==void 0)continue;k[S]=this.src[S]}return k}for(var m=0;m<y.length;m++){var S=y[m];if(!C(k,S))continue;var b=this.src.__lookupGetter__(S),p=this.src.__lookupSetter__(S);b&&k.__defineGetter__(S,b),p&&k.__defineSetter__(S,p),!b&&!p&&(k[S]=this.src[S])}return k},v.prototype.toCover=function(k){for(var y=this.keys||Object.keys(this.src),m=0;m<y.length;m++){var S=y[m];delete k[S];var b=this.src.__lookupGetter__(S),p=this.src.__lookupSetter__(S);b&&k.__defineGetter__(S,b),p&&k.__defineSetter__(S,p),!b&&!p&&(k[S]=this.src[S])}},v.prototype.override=v.prototype.toCover,v.prototype.and=function(k){var y={};return this.to(y),this.src=k,this.to(y),this.src=y,this};function C(k,y){return k[y]===void 0&&k.__lookupGetter__(y)===void 0&&k.__lookupSetter__(y)===void 0}},{}],77:[function(F,Q,j){F("../../modules/es6.string.iterator"),F("../../modules/es6.array.from"),Q.exports=F("../../modules/_core").Array.from},{"../../modules/_core":99,"../../modules/es6.array.from":168,"../../modules/es6.string.iterator":180}],78:[function(F,Q,j){var N=F("../../modules/_core"),v=N.JSON||(N.JSON={stringify:JSON.stringify});Q.exports=function(k){return v.stringify.apply(v,arguments)}},{"../../modules/_core":99}],79:[function(F,Q,j){F("../../modules/es6.object.assign"),Q.exports=F("../../modules/_core").Object.assign},{"../../modules/_core":99,"../../modules/es6.object.assign":171}],80:[function(F,Q,j){F("../../modules/es6.object.create");var N=F("../../modules/_core").Object;Q.exports=function(C,k){return N.create(C,k)}},{"../../modules/_core":99,"../../modules/es6.object.create":172}],81:[function(F,Q,j){F("../../modules/es6.object.define-property");var N=F("../../modules/_core").Object;Q.exports=function(C,k,y){return N.defineProperty(C,k,y)}},{"../../modules/_core":99,"../../modules/es6.object.define-property":173}],82:[function(F,Q,j){F("../../modules/es7.object.entries"),Q.exports=F("../../modules/_core").Object.entries},{"../../modules/_core":99,"../../modules/es7.object.entries":182}],83:[function(F,Q,j){F("../../modules/es6.object.get-own-property-names");var N=F("../../modules/_core").Object;Q.exports=function(C){return N.getOwnPropertyNames(C)}},{"../../modules/_core":99,"../../modules/es6.object.get-own-property-names":174}],84:[function(F,Q,j){F("../../modules/es6.object.get-prototype-of"),Q.exports=F("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":99,"../../modules/es6.object.get-prototype-of":175}],85:[function(F,Q,j){F("../../modules/es6.object.keys"),Q.exports=F("../../modules/_core").Object.keys},{"../../modules/_core":99,"../../modules/es6.object.keys":176}],86:[function(F,Q,j){F("../modules/es6.object.to-string"),F("../modules/es6.string.iterator"),F("../modules/web.dom.iterable"),F("../modules/es6.promise"),F("../modules/es7.promise.finally"),F("../modules/es7.promise.try"),Q.exports=F("../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(F,Q,j){F("../modules/web.immediate"),Q.exports=F("../modules/_core").setImmediate},{"../modules/_core":99,"../modules/web.immediate":188}],88:[function(F,Q,j){F("../../modules/es6.string.from-code-point"),Q.exports=F("../../modules/_core").String.fromCodePoint},{"../../modules/_core":99,"../../modules/es6.string.from-code-point":179}],89:[function(F,Q,j){F("../../modules/es6.function.has-instance"),Q.exports=F("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":165,"../../modules/es6.function.has-instance":170}],90:[function(F,Q,j){F("../../modules/es6.symbol"),F("../../modules/es6.object.to-string"),F("../../modules/es7.symbol.async-iterator"),F("../../modules/es7.symbol.observable"),Q.exports=F("../../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(F,Q,j){F("../../modules/es6.string.iterator"),F("../../modules/web.dom.iterable"),Q.exports=F("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":165,"../../modules/es6.string.iterator":180,"../../modules/web.dom.iterable":187}],92:[function(F,Q,j){Q.exports=function(N){if(typeof N!="function")throw TypeError(N+" is not a function!");return N}},{}],93:[function(F,Q,j){Q.exports=function(){}},{}],94:[function(F,Q,j){Q.exports=function(N,v,C,k){if(!(N instanceof v)||k!==void 0&&k in N)throw TypeError(C+": incorrect invocation!");return N}},{}],95:[function(F,Q,j){var N=F("./_is-object");Q.exports=function(v){if(!N(v))throw TypeError(v+" is not an object!");return v}},{"./_is-object":119}],96:[function(F,Q,j){var N=F("./_to-iobject"),v=F("./_to-length"),C=F("./_to-absolute-index");Q.exports=function(k){return function(y,m,S){var b=N(y),p=v(b.length),d=C(S,p),t;if(k&&m!=m){for(;p>d;)if(t=b[d++],t!=t)return!0}else for(;p>d;d++)if((k||d in b)&&b[d]===m)return k||d||0;return!k&&-1}}},{"./_to-absolute-index":156,"./_to-iobject":158,"./_to-length":159}],97:[function(F,Q,j){var N=F("./_cof"),v=F("./_wks")("toStringTag"),C=N(function(){return arguments}())=="Arguments",k=function(y,m){try{return y[m]}catch(S){}};Q.exports=function(y){var m,S,b;return y===void 0?"Undefined":y===null?"Null":typeof(S=k(m=Object(y),v))=="string"?S:C?N(m):(b=N(m))=="Object"&&typeof m.callee=="function"?"Arguments":b}},{"./_cof":98,"./_wks":166}],98:[function(F,Q,j){var N={}.toString;Q.exports=function(v){return N.call(v).slice(8,-1)}},{}],99:[function(F,Q,j){var N=Q.exports={version:"2.6.11"};typeof __e=="number"&&(__e=N)},{}],100:[function(F,Q,j){"use strict";var N=F("./_object-dp"),v=F("./_property-desc");Q.exports=function(C,k,y){k in C?N.f(C,k,v(0,y)):C[k]=y}},{"./_object-dp":132,"./_property-desc":146}],101:[function(F,Q,j){var N=F("./_a-function");Q.exports=function(v,C,k){if(N(v),C===void 0)return v;switch(k){case 1:return function(y){return v.call(C,y)};case 2:return function(y,m){return v.call(C,y,m)};case 3:return function(y,m,S){return v.call(C,y,m,S)}}return function(){return v.apply(C,arguments)}}},{"./_a-function":92}],102:[function(F,Q,j){Q.exports=function(N){if(N==null)throw TypeError("Can't call method on "+N);return N}},{}],103:[function(F,Q,j){Q.exports=!F("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":108}],104:[function(F,Q,j){var N=F("./_is-object"),v=F("./_global").document,C=N(v)&&N(v.createElement);Q.exports=function(k){return C?v.createElement(k):{}}},{"./_global":110,"./_is-object":119}],105:[function(F,Q,j){Q.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],106:[function(F,Q,j){var N=F("./_object-keys"),v=F("./_object-gops"),C=F("./_object-pie");Q.exports=function(k){var y=N(k),m=v.f;if(m)for(var S=m(k),b=C.f,p=0,d;S.length>p;)b.call(k,d=S[p++])&&y.push(d);return y}},{"./_object-gops":137,"./_object-keys":140,"./_object-pie":141}],107:[function(F,Q,j){var N=F("./_global"),v=F("./_core"),C=F("./_ctx"),k=F("./_hide"),y=F("./_has"),m="prototype",S=function(b,p,d){var t=b&S.F,l=b&S.G,r=b&S.S,i=b&S.P,o=b&S.B,s=b&S.W,c=l?v:v[p]||(v[p]={}),a=c[m],u=l?N:r?N[p]:(N[p]||{})[m],f,w,_;l&&(d=p);for(f in d){if(w=!t&&u&&u[f]!==void 0,w&&y(c,f))continue;_=w?u[f]:d[f],c[f]=l&&typeof u[f]!="function"?d[f]:o&&w?C(_,N):s&&u[f]==_?function(h){var R=function(O,g,x){if(this instanceof h){switch(arguments.length){case 0:return new h;case 1:return new h(O);case 2:return new h(O,g)}return new h(O,g,x)}return h.apply(this,arguments)};return R[m]=h[m],R}(_):i&&typeof _=="function"?C(Function.call,_):_,i&&((c.virtual||(c.virtual={}))[f]=_,b&S.R&&a&&!a[f]&&k(a,f,_))}};S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128,Q.exports=S},{"./_core":99,"./_ctx":101,"./_global":110,"./_has":111,"./_hide":112}],108:[function(F,Q,j){Q.exports=function(N){try{return!!N()}catch(v){return!0}}},{}],109:[function(F,Q,j){var N=F("./_ctx"),v=F("./_iter-call"),C=F("./_is-array-iter"),k=F("./_an-object"),y=F("./_to-length"),m=F("./core.get-iterator-method"),S={},b={},j=Q.exports=function(p,d,t,l,r){var i=r?function(){return p}:m(p),o=N(t,l,d?2:1),s=0,c,a,u,f;if(typeof i!="function")throw TypeError(p+" is not iterable!");if(C(i)){for(c=y(p.length);c>s;s++)if(f=d?o(k(a=p[s])[0],a[1]):o(p[s]),f===S||f===b)return f}else for(u=i.call(p);!(a=u.next()).done;)if(f=v(u,o,a.value,d),f===S||f===b)return f};j.BREAK=S,j.RETURN=b},{"./_an-object":95,"./_ctx":101,"./_is-array-iter":117,"./_iter-call":120,"./_to-length":159,"./core.get-iterator-method":167}],110:[function(F,Q,j){var N=Q.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=N)},{}],111:[function(F,Q,j){var N={}.hasOwnProperty;Q.exports=function(v,C){return N.call(v,C)}},{}],112:[function(F,Q,j){var N=F("./_object-dp"),v=F("./_property-desc");Q.exports=F("./_descriptors")?function(C,k,y){return N.f(C,k,v(1,y))}:function(C,k,y){return C[k]=y,C}},{"./_descriptors":103,"./_object-dp":132,"./_property-desc":146}],113:[function(F,Q,j){var N=F("./_global").document;Q.exports=N&&N.documentElement},{"./_global":110}],114:[function(F,Q,j){Q.exports=!F("./_descriptors")&&!F("./_fails")(function(){return Object.defineProperty(F("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":103,"./_dom-create":104,"./_fails":108}],115:[function(F,Q,j){Q.exports=function(N,v,C){var k=C===void 0;switch(v.length){case 0:return k?N():N.call(C);case 1:return k?N(v[0]):N.call(C,v[0]);case 2:return k?N(v[0],v[1]):N.call(C,v[0],v[1]);case 3:return k?N(v[0],v[1],v[2]):N.call(C,v[0],v[1],v[2]);case 4:return k?N(v[0],v[1],v[2],v[3]):N.call(C,v[0],v[1],v[2],v[3])}return N.apply(C,v)}},{}],116:[function(F,Q,j){var N=F("./_cof");Q.exports=Object("z").propertyIsEnumerable(0)?Object:function(v){return N(v)=="String"?v.split(""):Object(v)}},{"./_cof":98}],117:[function(F,Q,j){var N=F("./_iterators"),v=F("./_wks")("iterator"),C=Array.prototype;Q.exports=function(k){return k!==void 0&&(N.Array===k||C[v]===k)}},{"./_iterators":125,"./_wks":166}],118:[function(F,Q,j){var N=F("./_cof");Q.exports=Array.isArray||function(C){return N(C)=="Array"}},{"./_cof":98}],119:[function(F,Q,j){Q.exports=function(N){return typeof N=="object"?N!==null:typeof N=="function"}},{}],120:[function(F,Q,j){var N=F("./_an-object");Q.exports=function(v,C,k,y){try{return y?C(N(k)[0],k[1]):C(k)}catch(S){var m=v.return;throw m!==void 0&&N(m.call(v)),S}}},{"./_an-object":95}],121:[function(F,Q,j){"use strict";var N=F("./_object-create"),v=F("./_property-desc"),C=F("./_set-to-string-tag"),k={};F("./_hide")(k,F("./_wks")("iterator"),function(){return this}),Q.exports=function(y,m,S){y.prototype=N(k,{next:v(1,S)}),C(y,m+" Iterator")}},{"./_hide":112,"./_object-create":131,"./_property-desc":146,"./_set-to-string-tag":150,"./_wks":166}],122:[function(F,Q,j){"use strict";var N=F("./_library"),v=F("./_export"),C=F("./_redefine"),k=F("./_hide"),y=F("./_iterators"),m=F("./_iter-create"),S=F("./_set-to-string-tag"),b=F("./_object-gpo"),p=F("./_wks")("iterator"),d=!([].keys&&"next"in[].keys()),t="@@iterator",l="keys",r="values",i=function(){return this};Q.exports=function(o,s,c,a,u,f,w){m(c,s,a);var _=function(z){if(!d&&z in g)return g[z];switch(z){case l:return function(){return new c(this,z)};case r:return function(){return new c(this,z)}}return function(){return new c(this,z)}},h=s+" Iterator",R=u==r,O=!1,g=o.prototype,x=g[p]||g[t]||u&&g[u],E=x||_(u),T=u?R?_("entries"):E:void 0,M=s=="Array"&&g.entries||x,L,A,V;if(M&&(V=b(M.call(new o)),V!==Object.prototype&&V.next&&(S(V,h,!0),!N&&typeof V[p]!="function"&&k(V,p,i))),R&&x&&x.name!==r&&(O=!0,E=function(){return x.call(this)}),(!N||w)&&(d||O||!g[p])&&k(g,p,E),y[s]=E,y[h]=i,u)if(L={values:R?E:_(r),keys:f?E:_(l),entries:T},w)for(A in L)A in g||C(g,A,L[A]);else v(v.P+v.F*(d||O),s,L);return L}},{"./_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(F,Q,j){var N=F("./_wks")("iterator"),v=!1;try{var C=[7][N]();C.return=function(){v=!0},Array.from(C,function(){throw 2})}catch(k){}Q.exports=function(k,y){if(!y&&!v)return!1;var m=!1;try{var S=[7],b=S[N]();b.next=function(){return{done:m=!0}},S[N]=function(){return b},k(S)}catch(p){}return m}},{"./_wks":166}],124:[function(F,Q,j){Q.exports=function(N,v){return{value:v,done:!!N}}},{}],125:[function(F,Q,j){Q.exports={}},{}],126:[function(F,Q,j){Q.exports=!0},{}],127:[function(F,Q,j){var N=F("./_uid")("meta"),v=F("./_is-object"),C=F("./_has"),k=F("./_object-dp").f,y=0,m=Object.isExtensible||function(){return!0},S=!F("./_fails")(function(){return m(Object.preventExtensions({}))}),b=function(r){k(r,N,{value:{i:"O"+ ++y,w:{}}})},p=function(r,i){if(!v(r))return typeof r=="symbol"?r:(typeof r=="string"?"S":"P")+r;if(!C(r,N)){if(!m(r))return"F";if(!i)return"E";b(r)}return r[N].i},d=function(r,i){if(!C(r,N)){if(!m(r))return!0;if(!i)return!1;b(r)}return r[N].w},t=function(r){return S&&l.NEED&&m(r)&&!C(r,N)&&b(r),r},l=Q.exports={KEY:N,NEED:!1,fastKey:p,getWeak:d,onFreeze:t}},{"./_fails":108,"./_has":111,"./_is-object":119,"./_object-dp":132,"./_uid":162}],128:[function(F,Q,j){var N=F("./_global"),v=F("./_task").set,C=N.MutationObserver||N.WebKitMutationObserver,k=N.process,y=N.Promise,m=F("./_cof")(k)=="process";Q.exports=function(){var S,b,p,d=function(){var i,o;for(m&&(i=k.domain)&&i.exit();S;){o=S.fn,S=S.next;try{o()}catch(s){throw S?p():b=void 0,s}}b=void 0,i&&i.enter()};if(m)p=function(){k.nextTick(d)};else if(C&&!(N.navigator&&N.navigator.standalone)){var t=!0,l=document.createTextNode("");new C(d).observe(l,{characterData:!0}),p=function(){l.data=t=!t}}else if(y&&y.resolve){var r=y.resolve(void 0);p=function(){r.then(d)}}else p=function(){v.call(N,d)};return function(i){var o={fn:i,next:void 0};b&&(b.next=o),S||(S=o,p()),b=o}}},{"./_cof":98,"./_global":110,"./_task":155}],129:[function(F,Q,j){"use strict";var N=F("./_a-function");function v(C){var k,y;this.promise=new C(function(m,S){if(k!==void 0||y!==void 0)throw TypeError("Bad Promise constructor");k=m,y=S}),this.resolve=N(k),this.reject=N(y)}Q.exports.f=function(C){return new v(C)}},{"./_a-function":92}],130:[function(F,Q,j){"use strict";var N=F("./_descriptors"),v=F("./_object-keys"),C=F("./_object-gops"),k=F("./_object-pie"),y=F("./_to-object"),m=F("./_iobject"),S=Object.assign;Q.exports=!S||F("./_fails")(function(){var b={},p={},d=Symbol(),t="abcdefghijklmnopqrst";return b[d]=7,t.split("").forEach(function(l){p[l]=l}),S({},b)[d]!=7||Object.keys(S({},p)).join("")!=t})?function(p,d){for(var t=y(p),l=arguments.length,r=1,i=C.f,o=k.f;l>r;)for(var s=m(arguments[r++]),c=i?v(s).concat(i(s)):v(s),a=c.length,u=0,f;a>u;)f=c[u++],(!N||o.call(s,f))&&(t[f]=s[f]);return t}:S},{"./_descriptors":103,"./_fails":108,"./_iobject":116,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_to-object":160}],131:[function(F,Q,j){var N=F("./_an-object"),v=F("./_object-dps"),C=F("./_enum-bug-keys"),k=F("./_shared-key")("IE_PROTO"),y=function(){},m="prototype",S=function(){var b=F("./_dom-create")("iframe"),p=C.length,d="<",t=">",l;for(b.style.display="none",F("./_html").appendChild(b),b.src="javascript:",l=b.contentWindow.document,l.open(),l.write(d+"script"+t+"document.F=Object"+d+"/script"+t),l.close(),S=l.F;p--;)delete S[m][C[p]];return S()};Q.exports=Object.create||function(p,d){var t;return p!==null?(y[m]=N(p),t=new y,y[m]=null,t[k]=p):t=S(),d===void 0?t:v(t,d)}},{"./_an-object":95,"./_dom-create":104,"./_enum-bug-keys":105,"./_html":113,"./_object-dps":133,"./_shared-key":151}],132:[function(F,Q,j){var N=F("./_an-object"),v=F("./_ie8-dom-define"),C=F("./_to-primitive"),k=Object.defineProperty;j.f=F("./_descriptors")?Object.defineProperty:function(m,S,b){if(N(m),S=C(S,!0),N(b),v)try{return k(m,S,b)}catch(p){}if("get"in b||"set"in b)throw TypeError("Accessors not supported!");return"value"in b&&(m[S]=b.value),m}},{"./_an-object":95,"./_descriptors":103,"./_ie8-dom-define":114,"./_to-primitive":161}],133:[function(F,Q,j){var N=F("./_object-dp"),v=F("./_an-object"),C=F("./_object-keys");Q.exports=F("./_descriptors")?Object.defineProperties:function(y,m){v(y);for(var S=C(m),b=S.length,p=0,d;b>p;)N.f(y,d=S[p++],m[d]);return y}},{"./_an-object":95,"./_descriptors":103,"./_object-dp":132,"./_object-keys":140}],134:[function(F,Q,j){var N=F("./_object-pie"),v=F("./_property-desc"),C=F("./_to-iobject"),k=F("./_to-primitive"),y=F("./_has"),m=F("./_ie8-dom-define"),S=Object.getOwnPropertyDescriptor;j.f=F("./_descriptors")?S:function(p,d){if(p=C(p),d=k(d,!0),m)try{return S(p,d)}catch(t){}if(y(p,d))return v(!N.f.call(p,d),p[d])}},{"./_descriptors":103,"./_has":111,"./_ie8-dom-define":114,"./_object-pie":141,"./_property-desc":146,"./_to-iobject":158,"./_to-primitive":161}],135:[function(F,Q,j){var N=F("./_to-iobject"),v=F("./_object-gopn").f,C={}.toString,k=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],y=function(m){try{return v(m)}catch(S){return k.slice()}};Q.exports.f=function(S){return k&&C.call(S)=="[object Window]"?y(S):v(N(S))}},{"./_object-gopn":136,"./_to-iobject":158}],136:[function(F,Q,j){var N=F("./_object-keys-internal"),v=F("./_enum-bug-keys").concat("length","prototype");j.f=Object.getOwnPropertyNames||function(k){return N(k,v)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],137:[function(F,Q,j){j.f=Object.getOwnPropertySymbols},{}],138:[function(F,Q,j){var N=F("./_has"),v=F("./_to-object"),C=F("./_shared-key")("IE_PROTO"),k=Object.prototype;Q.exports=Object.getPrototypeOf||function(y){return y=v(y),N(y,C)?y[C]:typeof y.constructor=="function"&&y instanceof y.constructor?y.constructor.prototype:y instanceof Object?k:null}},{"./_has":111,"./_shared-key":151,"./_to-object":160}],139:[function(F,Q,j){var N=F("./_has"),v=F("./_to-iobject"),C=F("./_array-includes")(!1),k=F("./_shared-key")("IE_PROTO");Q.exports=function(y,m){var S=v(y),b=0,p=[],d;for(d in S)d!=k&&(N(S,d)&&p.push(d));for(;m.length>b;)N(S,d=m[b++])&&(~C(p,d)||p.push(d));return p}},{"./_array-includes":96,"./_has":111,"./_shared-key":151,"./_to-iobject":158}],140:[function(F,Q,j){var N=F("./_object-keys-internal"),v=F("./_enum-bug-keys");Q.exports=Object.keys||function(k){return N(k,v)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],141:[function(F,Q,j){j.f={}.propertyIsEnumerable},{}],142:[function(F,Q,j){var N=F("./_export"),v=F("./_core"),C=F("./_fails");Q.exports=function(k,y){var m=(v.Object||{})[k]||Object[k],S={};S[k]=y(m),N(N.S+N.F*C(function(){m(1)}),"Object",S)}},{"./_core":99,"./_export":107,"./_fails":108}],143:[function(F,Q,j){var N=F("./_descriptors"),v=F("./_object-keys"),C=F("./_to-iobject"),k=F("./_object-pie").f;Q.exports=function(y){return function(m){for(var S=C(m),b=v(S),p=b.length,d=0,t=[],l;p>d;)l=b[d++],(!N||k.call(S,l))&&t.push(y?[l,S[l]]:S[l]);return t}}},{"./_descriptors":103,"./_object-keys":140,"./_object-pie":141,"./_to-iobject":158}],144:[function(F,Q,j){Q.exports=function(N){try{return{e:!1,v:N()}}catch(v){return{e:!0,v}}}},{}],145:[function(F,Q,j){var N=F("./_an-object"),v=F("./_is-object"),C=F("./_new-promise-capability");Q.exports=function(k,y){if(N(k),v(y)&&y.constructor===k)return y;var m=C.f(k),S=m.resolve;return S(y),m.promise}},{"./_an-object":95,"./_is-object":119,"./_new-promise-capability":129}],146:[function(F,Q,j){Q.exports=function(N,v){return{enumerable:!(N&1),configurable:!(N&2),writable:!(N&4),value:v}}},{}],147:[function(F,Q,j){var N=F("./_hide");Q.exports=function(v,C,k){for(var y in C)k&&v[y]?v[y]=C[y]:N(v,y,C[y]);return v}},{"./_hide":112}],148:[function(F,Q,j){Q.exports=F("./_hide")},{"./_hide":112}],149:[function(F,Q,j){"use strict";var N=F("./_global"),v=F("./_core"),C=F("./_object-dp"),k=F("./_descriptors"),y=F("./_wks")("species");Q.exports=function(m){var S=typeof v[m]=="function"?v[m]:N[m];k&&S&&!S[y]&&C.f(S,y,{configurable:!0,get:function(){return this}})}},{"./_core":99,"./_descriptors":103,"./_global":110,"./_object-dp":132,"./_wks":166}],150:[function(F,Q,j){var N=F("./_object-dp").f,v=F("./_has"),C=F("./_wks")("toStringTag");Q.exports=function(k,y,m){k&&!v(k=m?k:k.prototype,C)&&N(k,C,{configurable:!0,value:y})}},{"./_has":111,"./_object-dp":132,"./_wks":166}],151:[function(F,Q,j){var N=F("./_shared")("keys"),v=F("./_uid");Q.exports=function(C){return N[C]||(N[C]=v(C))}},{"./_shared":152,"./_uid":162}],152:[function(F,Q,j){var N=F("./_core"),v=F("./_global"),C="__core-js_shared__",k=v[C]||(v[C]={});(Q.exports=function(y,m){return k[y]||(k[y]=m!==void 0?m:{})})("versions",[]).push({version:N.version,mode:F("./_library")?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},{"./_core":99,"./_global":110,"./_library":126}],153:[function(F,Q,j){var N=F("./_an-object"),v=F("./_a-function"),C=F("./_wks")("species");Q.exports=function(k,y){var m=N(k).constructor,S;return m===void 0||(S=N(m)[C])==null?y:v(S)}},{"./_a-function":92,"./_an-object":95,"./_wks":166}],154:[function(F,Q,j){var N=F("./_to-integer"),v=F("./_defined");Q.exports=function(C){return function(k,y){var m=String(v(k)),S=N(y),b=m.length,p,d;return S<0||S>=b?C?"":void 0:(p=m.charCodeAt(S),p<55296||p>56319||S+1===b||(d=m.charCodeAt(S+1))<56320||d>57343?C?m.charAt(S):p:C?m.slice(S,S+2):(p-55296<<10)+(d-56320)+65536)}}},{"./_defined":102,"./_to-integer":157}],155:[function(F,Q,j){var N=F("./_ctx"),v=F("./_invoke"),C=F("./_html"),k=F("./_dom-create"),y=F("./_global"),m=y.process,S=y.setImmediate,b=y.clearImmediate,p=y.MessageChannel,d=y.Dispatch,t=0,l={},r="onreadystatechange",i,o,s,c=function(){var u=+this;if(l.hasOwnProperty(u)){var f=l[u];delete l[u],f()}},a=function(u){c.call(u.data)};(!S||!b)&&(S=function(f){for(var w=[],_=1;arguments.length>_;)w.push(arguments[_++]);return l[++t]=function(){v(typeof f=="function"?f:Function(f),w)},i(t),t},b=function(f){delete l[f]},F("./_cof")(m)=="process"?i=function(u){m.nextTick(N(c,u,1))}:d&&d.now?i=function(u){d.now(N(c,u,1))}:p?(o=new p,s=o.port2,o.port1.onmessage=a,i=N(s.postMessage,s,1)):y.addEventListener&&typeof postMessage=="function"&&!y.importScripts?(i=function(u){y.postMessage(u+"","*")},y.addEventListener("message",a,!1)):r in k("script")?i=function(u){C.appendChild(k("script"))[r]=function(){C.removeChild(this),c.call(u)}}:i=function(u){setTimeout(N(c,u,1),0)}),Q.exports={set:S,clear:b}},{"./_cof":98,"./_ctx":101,"./_dom-create":104,"./_global":110,"./_html":113,"./_invoke":115}],156:[function(F,Q,j){var N=F("./_to-integer"),v=Math.max,C=Math.min;Q.exports=function(k,y){return k=N(k),k<0?v(k+y,0):C(k,y)}},{"./_to-integer":157}],157:[function(F,Q,j){var N=Math.ceil,v=Math.floor;Q.exports=function(C){return isNaN(C=+C)?0:(C>0?v:N)(C)}},{}],158:[function(F,Q,j){var N=F("./_iobject"),v=F("./_defined");Q.exports=function(C){return N(v(C))}},{"./_defined":102,"./_iobject":116}],159:[function(F,Q,j){var N=F("./_to-integer"),v=Math.min;Q.exports=function(C){return C>0?v(N(C),9007199254740991):0}},{"./_to-integer":157}],160:[function(F,Q,j){var N=F("./_defined");Q.exports=function(v){return Object(N(v))}},{"./_defined":102}],161:[function(F,Q,j){var N=F("./_is-object");Q.exports=function(v,C){if(!N(v))return v;var k,y;if(C&&typeof(k=v.toString)=="function"&&!N(y=k.call(v)))return y;if(typeof(k=v.valueOf)=="function"&&!N(y=k.call(v)))return y;if(!C&&typeof(k=v.toString)=="function"&&!N(y=k.call(v)))return y;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":119}],162:[function(F,Q,j){var N=0,v=Math.random();Q.exports=function(C){return"Symbol(".concat(C===void 0?"":C,")_",(++N+v).toString(36))}},{}],163:[function(F,Q,j){var N=F("./_global"),v=N.navigator;Q.exports=v&&v.userAgent||""},{"./_global":110}],164:[function(F,Q,j){var N=F("./_global"),v=F("./_core"),C=F("./_library"),k=F("./_wks-ext"),y=F("./_object-dp").f;Q.exports=function(m){var S=v.Symbol||(v.Symbol=C?{}:N.Symbol||{});m.charAt(0)!="_"&&!(m in S)&&y(S,m,{value:k.f(m)})}},{"./_core":99,"./_global":110,"./_library":126,"./_object-dp":132,"./_wks-ext":165}],165:[function(F,Q,j){j.f=F("./_wks")},{"./_wks":166}],166:[function(F,Q,j){var N=F("./_shared")("wks"),v=F("./_uid"),C=F("./_global").Symbol,k=typeof C=="function",y=Q.exports=function(m){return N[m]||(N[m]=k&&C[m]||(k?C:v)("Symbol."+m))};y.store=N},{"./_global":110,"./_shared":152,"./_uid":162}],167:[function(F,Q,j){var N=F("./_classof"),v=F("./_wks")("iterator"),C=F("./_iterators");Q.exports=F("./_core").getIteratorMethod=function(k){if(k!=null)return k[v]||k["@@iterator"]||C[N(k)]}},{"./_classof":97,"./_core":99,"./_iterators":125,"./_wks":166}],168:[function(F,Q,j){"use strict";var N=F("./_ctx"),v=F("./_export"),C=F("./_to-object"),k=F("./_iter-call"),y=F("./_is-array-iter"),m=F("./_to-length"),S=F("./_create-property"),b=F("./core.get-iterator-method");v(v.S+v.F*!F("./_iter-detect")(function(p){Array.from(p)}),"Array",{from:function(d){var t=C(d),l=typeof this=="function"?this:Array,r=arguments.length,i=r>1?arguments[1]:void 0,o=i!==void 0,s=0,c=b(t),a,u,f,w;if(o&&(i=N(i,r>2?arguments[2]:void 0,2)),c!=null&&!(l==Array&&y(c)))for(w=c.call(t),u=new l;!(f=w.next()).done;s++)S(u,s,o?k(w,i,[f.value,s],!0):f.value);else for(a=m(t.length),u=new l(a);a>s;s++)S(u,s,o?i(t[s],s):t[s]);return u.length=s,u}})},{"./_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(F,Q,j){"use strict";var N=F("./_add-to-unscopables"),v=F("./_iter-step"),C=F("./_iterators"),k=F("./_to-iobject");Q.exports=F("./_iter-define")(Array,"Array",function(y,m){this._t=k(y),this._i=0,this._k=m},function(){var y=this._t,m=this._k,S=this._i++;return!y||S>=y.length?(this._t=void 0,v(1)):m=="keys"?v(0,S):m=="values"?v(0,y[S]):v(0,[S,y[S]])},"values"),C.Arguments=C.Array,N("keys"),N("values"),N("entries")},{"./_add-to-unscopables":93,"./_iter-define":122,"./_iter-step":124,"./_iterators":125,"./_to-iobject":158}],170:[function(F,Q,j){"use strict";var N=F("./_is-object"),v=F("./_object-gpo"),C=F("./_wks")("hasInstance"),k=Function.prototype;C in k||F("./_object-dp").f(k,C,{value:function(y){if(typeof this!="function"||!N(y))return!1;if(!N(this.prototype))return y instanceof this;for(;y=v(y);)if(this.prototype===y)return!0;return!1}})},{"./_is-object":119,"./_object-dp":132,"./_object-gpo":138,"./_wks":166}],171:[function(F,Q,j){var N=F("./_export");N(N.S+N.F,"Object",{assign:F("./_object-assign")})},{"./_export":107,"./_object-assign":130}],172:[function(F,Q,j){var N=F("./_export");N(N.S,"Object",{create:F("./_object-create")})},{"./_export":107,"./_object-create":131}],173:[function(F,Q,j){var N=F("./_export");N(N.S+N.F*!F("./_descriptors"),"Object",{defineProperty:F("./_object-dp").f})},{"./_descriptors":103,"./_export":107,"./_object-dp":132}],174:[function(F,Q,j){F("./_object-sap")("getOwnPropertyNames",function(){return F("./_object-gopn-ext").f})},{"./_object-gopn-ext":135,"./_object-sap":142}],175:[function(F,Q,j){var N=F("./_to-object"),v=F("./_object-gpo");F("./_object-sap")("getPrototypeOf",function(){return function(k){return v(N(k))}})},{"./_object-gpo":138,"./_object-sap":142,"./_to-object":160}],176:[function(F,Q,j){var N=F("./_to-object"),v=F("./_object-keys");F("./_object-sap")("keys",function(){return function(k){return v(N(k))}})},{"./_object-keys":140,"./_object-sap":142,"./_to-object":160}],177:[function(F,Q,j){arguments[4][71][0].apply(j,arguments)},{dup:71}],178:[function(F,Q,j){"use strict";var N=F("./_library"),v=F("./_global"),C=F("./_ctx"),k=F("./_classof"),y=F("./_export"),m=F("./_is-object"),S=F("./_a-function"),b=F("./_an-instance"),p=F("./_for-of"),d=F("./_species-constructor"),t=F("./_task").set,l=F("./_microtask")(),r=F("./_new-promise-capability"),i=F("./_perform"),o=F("./_user-agent"),s=F("./_promise-resolve"),c="Promise",a=v.TypeError,u=v.process,f=u&&u.versions,w=f&&f.v8||"",_=v[c],h=k(u)=="process",R=function(){},O,g,x,E,T=g=r.f,M=!!function(){try{var P=_.resolve(1),H=(P.constructor={})[F("./_wks")("species")]=function($){$(R,R)};return(h||typeof PromiseRejectionEvent=="function")&&P.then(R)instanceof H&&w.indexOf("6.6")!==0&&o.indexOf("Chrome/66")===-1}catch($){}}(),L=function(P){var H;return m(P)&&typeof(H=P.then)=="function"?H:!1},A=function(P,H){if(P._n)return;P._n=!0;var $=P._c;l(function(){for(var re=P._v,te=P._s==1,ge=0,ve=function(de){var De=te?de.ok:de.fail,Te=de.resolve,he=de.reject,ue=de.domain,ie,Se,ne;try{De?(te||(P._h==2&&W(P),P._h=1),De===!0?ie=re:(ue&&ue.enter(),ie=De(re),ue&&(ue.exit(),ne=!0)),ie===de.promise?he(a("Promise-chain cycle")):(Se=L(ie))?Se.call(ie,Te,he):Te(ie)):he(re)}catch(ce){ue&&!ne&&ue.exit(),he(ce)}};$.length>ge;)ve($[ge++]);P._c=[],P._n=!1,H&&!P._h&&V(P)})},V=function(P){t.call(v,function(){var H=P._v,$=z(P),re,te,ge;if($&&(re=i(function(){h?u.emit("unhandledRejection",H,P):(te=v.onunhandledrejection)?te({promise:P,reason:H}):(ge=v.console)&&ge.error&&ge.error("Unhandled promise rejection",H)}),P._h=h||z(P)?2:1),P._a=void 0,$&&re.e)throw re.v})},z=function(P){return P._h!==1&&(P._a||P._c).length===0},W=function(P){t.call(v,function(){var H;h?u.emit("rejectionHandled",P):(H=v.onrejectionhandled)&&H({promise:P,reason:P._v})})},G=function(P){var H=this;if(H._d)return;H._d=!0,H=H._w||H,H._v=P,H._s=2,H._a||(H._a=H._c.slice()),A(H,!0)},U=function(P){var H=this,$;if(H._d)return;H._d=!0,H=H._w||H;try{if(H===P)throw a("Promise can't be resolved itself");($=L(P))?l(function(){var re={_w:H,_d:!1};try{$.call(P,C(U,re,1),C(G,re,1))}catch(te){G.call(re,te)}}):(H._v=P,H._s=1,A(H,!1))}catch(re){G.call({_w:H,_d:!1},re)}};M||(_=function(H){b(this,_,c,"_h"),S(H),O.call(this);try{H(C(U,this,1),C(G,this,1))}catch($){G.call(this,$)}},O=function(H){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},O.prototype=F("./_redefine-all")(_.prototype,{then:function(H,$){var re=T(d(this,_));return re.ok=typeof H=="function"?H:!0,re.fail=typeof $=="function"&&$,re.domain=h?u.domain:void 0,this._c.push(re),this._a&&this._a.push(re),this._s&&A(this,!1),re.promise},catch:function(P){return this.then(void 0,P)}}),x=function(){var P=new O;this.promise=P,this.resolve=C(U,P,1),this.reject=C(G,P,1)},r.f=T=function(P){return P===_||P===E?new x(P):g(P)}),y(y.G+y.W+y.F*!M,{Promise:_}),F("./_set-to-string-tag")(_,c),F("./_set-species")(c),E=F("./_core")[c],y(y.S+y.F*!M,c,{reject:function(H){var $=T(this),re=$.reject;return re(H),$.promise}}),y(y.S+y.F*(N||!M),c,{resolve:function(H){return s(N&&this===E?_:this,H)}}),y(y.S+y.F*!(M&&F("./_iter-detect")(function(P){_.all(P).catch(R)})),c,{all:function(H){var $=this,re=T($),te=re.resolve,ge=re.reject,ve=i(function(){var de=[],De=0,Te=1;p(H,!1,function(he){var ue=De++,ie=!1;de.push(void 0),Te++,$.resolve(he).then(function(Se){if(ie)return;ie=!0,de[ue]=Se,--Te||te(de)},ge)}),--Te||te(de)});return ve.e&&ge(ve.v),re.promise},race:function(H){var $=this,re=T($),te=re.reject,ge=i(function(){p(H,!1,function(ve){$.resolve(ve).then(re.resolve,te)})});return ge.e&&te(ge.v),re.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(F,Q,j){var N=F("./_export"),v=F("./_to-absolute-index"),C=String.fromCharCode,k=String.fromCodePoint;N(N.S+N.F*(!!k&&k.length!=1),"String",{fromCodePoint:function(m){for(var S=[],b=arguments.length,p=0,d;b>p;){if(d=+arguments[p++],v(d,1114111)!==d)throw RangeError(d+" is not a valid code point");S.push(d<65536?C(d):C(((d-=65536)>>10)+55296,d%1024+56320))}return S.join("")}})},{"./_export":107,"./_to-absolute-index":156}],180:[function(F,Q,j){"use strict";var N=F("./_string-at")(!0);F("./_iter-define")(String,"String",function(v){this._t=String(v),this._i=0},function(){var v=this._t,C=this._i,k;return C>=v.length?{value:void 0,done:!0}:(k=N(v,C),this._i+=k.length,{value:k,done:!1})})},{"./_iter-define":122,"./_string-at":154}],181:[function(F,Q,j){"use strict";var N=F("./_global"),v=F("./_has"),C=F("./_descriptors"),k=F("./_export"),y=F("./_redefine"),m=F("./_meta").KEY,S=F("./_fails"),b=F("./_shared"),p=F("./_set-to-string-tag"),d=F("./_uid"),t=F("./_wks"),l=F("./_wks-ext"),r=F("./_wks-define"),i=F("./_enum-keys"),o=F("./_is-array"),s=F("./_an-object"),c=F("./_is-object"),a=F("./_to-object"),u=F("./_to-iobject"),f=F("./_to-primitive"),w=F("./_property-desc"),_=F("./_object-create"),h=F("./_object-gopn-ext"),R=F("./_object-gopd"),O=F("./_object-gops"),g=F("./_object-dp"),x=F("./_object-keys"),E=R.f,T=g.f,M=h.f,L=N.Symbol,A=N.JSON,V=A&&A.stringify,z="prototype",W=t("_hidden"),G=t("toPrimitive"),U={}.propertyIsEnumerable,P=b("symbol-registry"),H=b("symbols"),$=b("op-symbols"),re=Object[z],te=typeof L=="function"&&!!O.f,ge=N.QObject,ve=!ge||!ge[z]||!ge[z].findChild,de=C&&S(function(){return _(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a!=7})?function(be,Re,Qe){var rt=E(re,Re);rt&&delete re[Re],T(be,Re,Qe),rt&&be!==re&&T(re,Re,rt)}:T,De=function(be){var Re=H[be]=_(L[z]);return Re._k=be,Re},Te=te&&typeof L.iterator=="symbol"?function(be){return typeof be=="symbol"}:function(be){return be instanceof L},he=function(Re,Qe,rt){return Re===re&&he($,Qe,rt),s(Re),Qe=f(Qe,!0),s(rt),v(H,Qe)?(rt.enumerable?(v(Re,W)&&Re[W][Qe]&&(Re[W][Qe]=!1),rt=_(rt,{enumerable:w(0,!1)})):(v(Re,W)||T(Re,W,w(1,{})),Re[W][Qe]=!0),de(Re,Qe,rt)):T(Re,Qe,rt)},ue=function(Re,Qe){s(Re);for(var rt=i(Qe=u(Qe)),at=0,qe=rt.length,st;qe>at;)he(Re,st=rt[at++],Qe[st]);return Re},ie=function(Re,Qe){return Qe===void 0?_(Re):ue(_(Re),Qe)},Se=function(Re){var Qe=U.call(this,Re=f(Re,!0));return this===re&&v(H,Re)&&!v($,Re)?!1:Qe||!v(this,Re)||!v(H,Re)||v(this,W)&&this[W][Re]?Qe:!0},ne=function(Re,Qe){if(Re=u(Re),Qe=f(Qe,!0),Re===re&&v(H,Qe)&&!v($,Qe))return;var rt=E(Re,Qe);return rt&&v(H,Qe)&&!(v(Re,W)&&Re[W][Qe])&&(rt.enumerable=!0),rt},ce=function(Re){for(var Qe=M(u(Re)),rt=[],at=0,qe;Qe.length>at;)!v(H,qe=Qe[at++])&&qe!=W&&qe!=m&&rt.push(qe);return rt},Oe=function(Re){for(var Qe=Re===re,rt=M(Qe?$:u(Re)),at=[],qe=0,st;rt.length>qe;)v(H,st=rt[qe++])&&(Qe?v(re,st):!0)&&at.push(H[st]);return at};te||(L=function(){if(this instanceof L)throw TypeError("Symbol is not a constructor!");var Re=d(arguments.length>0?arguments[0]:void 0),Qe=function(rt){this===re&&Qe.call($,rt),v(this,W)&&v(this[W],Re)&&(this[W][Re]=!1),de(this,Re,w(1,rt))};return C&&ve&&de(re,Re,{configurable:!0,set:Qe}),De(Re)},y(L[z],"toString",function(){return this._k}),R.f=ne,g.f=he,F("./_object-gopn").f=h.f=ce,F("./_object-pie").f=Se,O.f=Oe,C&&!F("./_library")&&y(re,"propertyIsEnumerable",Se,!0),l.f=function(be){return De(t(be))}),k(k.G+k.W+k.F*!te,{Symbol:L});for(var oe="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),q=0;oe.length>q;)t(oe[q++]);for(var Y=x(t.store),Z=0;Y.length>Z;)r(Y[Z++]);k(k.S+k.F*!te,"Symbol",{for:function(be){return v(P,be+="")?P[be]:P[be]=L(be)},keyFor:function(Re){if(!Te(Re))throw TypeError(Re+" is not a symbol!");for(var Qe in P)if(P[Qe]===Re)return Qe},useSetter:function(){ve=!0},useSimple:function(){ve=!1}}),k(k.S+k.F*!te,"Object",{create:ie,defineProperty:he,defineProperties:ue,getOwnPropertyDescriptor:ne,getOwnPropertyNames:ce,getOwnPropertySymbols:Oe});var ye=S(function(){O.f(1)});k(k.S+k.F*ye,"Object",{getOwnPropertySymbols:function(Re){return O.f(a(Re))}}),A&&k(k.S+k.F*(!te||S(function(){var be=L();return V([be])!="[null]"||V({a:be})!="{}"||V(Object(be))!="{}"})),"JSON",{stringify:function(Re){for(var Qe=[Re],rt=1,at,qe;arguments.length>rt;)Qe.push(arguments[rt++]);return qe=at=Qe[1],!c(at)&&Re===void 0||Te(Re)?void 0:(o(at)||(at=function(st,lt){if(typeof qe=="function"&&(lt=qe.call(this,st,lt)),!Te(lt))return lt}),Qe[1]=at,V.apply(A,Qe))}}),L[z][G]||F("./_hide")(L[z],G,L[z].valueOf),p(L,"Symbol"),p(Math,"Math",!0),p(N.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(F,Q,j){var N=F("./_export"),v=F("./_object-to-array")(!0);N(N.S,"Object",{entries:function(k){return v(k)}})},{"./_export":107,"./_object-to-array":143}],183:[function(F,Q,j){"use strict";var N=F("./_export"),v=F("./_core"),C=F("./_global"),k=F("./_species-constructor"),y=F("./_promise-resolve");N(N.P+N.R,"Promise",{finally:function(m){var S=k(this,v.Promise||C.Promise),b=typeof m=="function";return this.then(b?function(p){return y(S,m()).then(function(){return p})}:m,b?function(p){return y(S,m()).then(function(){throw p})}:m)}})},{"./_core":99,"./_export":107,"./_global":110,"./_promise-resolve":145,"./_species-constructor":153}],184:[function(F,Q,j){"use strict";var N=F("./_export"),v=F("./_new-promise-capability"),C=F("./_perform");N(N.S,"Promise",{try:function(k){var y=v.f(this),m=C(k);return(m.e?y.reject:y.resolve)(m.v),y.promise}})},{"./_export":107,"./_new-promise-capability":129,"./_perform":144}],185:[function(F,Q,j){F("./_wks-define")("asyncIterator")},{"./_wks-define":164}],186:[function(F,Q,j){F("./_wks-define")("observable")},{"./_wks-define":164}],187:[function(F,Q,j){F("./es6.array.iterator");for(var N=F("./_global"),v=F("./_hide"),C=F("./_iterators"),k=F("./_wks")("toStringTag"),y="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(","),m=0;m<y.length;m++){var S=y[m],b=N[S],p=b&&b.prototype;p&&!p[k]&&v(p,k,S),C[S]=C.Array}},{"./_global":110,"./_hide":112,"./_iterators":125,"./_wks":166,"./es6.array.iterator":169}],188:[function(F,Q,j){var N=F("./_export"),v=F("./_task");N(N.G+N.B,{setImmediate:v.set,clearImmediate:v.clear})},{"./_export":107,"./_task":155}],189:[function(F,Q,j){(function(N){"use strict";var v=F("babel-runtime/helpers/typeof"),C=k(v);function k(f){return f&&f.__esModule?f:{default:f}}function y(f){return Array.isArray?Array.isArray(f):u(f)==="[object Array]"}j.isArray=y;function m(f){return typeof f=="boolean"}j.isBoolean=m;function S(f){return f===null}j.isNull=S;function b(f){return f==null}j.isNullOrUndefined=b;function p(f){return typeof f=="number"}j.isNumber=p;function d(f){return typeof f=="string"}j.isString=d;function t(f){return(typeof f=="undefined"?"undefined":(0,C.default)(f))==="symbol"}j.isSymbol=t;function l(f){return f===void 0}j.isUndefined=l;function r(f){return u(f)==="[object RegExp]"}j.isRegExp=r;function i(f){return(typeof f=="undefined"?"undefined":(0,C.default)(f))==="object"&&f!==null}j.isObject=i;function o(f){return u(f)==="[object Date]"}j.isDate=o;function s(f){return u(f)==="[object Error]"||f instanceof Error}j.isError=s;function c(f){return typeof f=="function"}j.isFunction=c;function a(f){return f===null||typeof f=="boolean"||typeof f=="number"||typeof f=="string"||(typeof f=="undefined"?"undefined":(0,C.default)(f))==="symbol"||typeof f=="undefined"}j.isPrimitive=a,j.isBuffer=N.isBuffer;function u(f){return Object.prototype.toString.call(f)}}).call(this,{isBuffer:F("../../is-buffer/index.js")})},{"../../is-buffer/index.js":197,"babel-runtime/helpers/typeof":67}],190:[function(F,Q,j){"use strict";var N=F("babel-runtime/helpers/typeof"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(k){"use strict";var y=function(){var d=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,l=/[^-+\dA-Z]/g;return function(r,i,o,s){if(arguments.length===1&&p(r)==="string"&&!/\d/.test(r)&&(i=r,r=void 0),r=r||new Date,r instanceof Date||(r=new Date(r)),isNaN(r))throw TypeError("Invalid date");i=String(y.masks[i]||i||y.masks.default);var c=i.slice(0,4);(c==="UTC:"||c==="GMT:")&&(i=i.slice(4),o=!0,c==="GMT:"&&(s=!0));var a=o?"getUTC":"get",u=r[a+"Date"](),f=r[a+"Day"](),w=r[a+"Month"](),_=r[a+"FullYear"](),h=r[a+"Hours"](),R=r[a+"Minutes"](),O=r[a+"Seconds"](),g=r[a+"Milliseconds"](),x=o?0:r.getTimezoneOffset(),E=S(r),T=b(r),M={d:u,dd:m(u),ddd:y.i18n.dayNames[f],dddd:y.i18n.dayNames[f+7],m:w+1,mm:m(w+1),mmm:y.i18n.monthNames[w],mmmm:y.i18n.monthNames[w+12],yy:String(_).slice(2),yyyy:_,h:h%12||12,hh:m(h%12||12),H:h,HH:m(h),M:R,MM:m(R),s:O,ss:m(O),l:m(g,3),L:m(Math.round(g/10)),t:h<12?"a":"p",tt:h<12?"am":"pm",T:h<12?"A":"P",TT:h<12?"AM":"PM",Z:s?"GMT":o?"UTC":(String(r).match(t)||[""]).pop().replace(l,""),o:(x>0?"-":"+")+m(Math.floor(Math.abs(x)/60)*100+Math.abs(x)%60,4),S:["th","st","nd","rd"][u%10>3?0:(u%100-u%10!=10)*u%10],W:E,N:T};return i.replace(d,function(L){return L in M?M[L]:L.slice(1,L.length-1)})}}();y.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"},y.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 m(d,t){for(d=String(d),t=t||2;d.length<t;)d="0"+d;return d}function S(d){var t=new Date(d.getFullYear(),d.getMonth(),d.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var l=new Date(t.getFullYear(),0,4);l.setDate(l.getDate()-(l.getDay()+6)%7+3);var r=t.getTimezoneOffset()-l.getTimezoneOffset();t.setHours(t.getHours()-r);var i=(t-l)/(864e5*7);return 1+Math.floor(i)}function b(d){var t=d.getDay();return t===0&&(t=7),t}function p(d){return d===null?"null":d===void 0?"undefined":(typeof d=="undefined"?"undefined":(0,v.default)(d))!=="object"?typeof d=="undefined"?"undefined":(0,v.default)(d):Array.isArray(d)?"array":{}.toString.call(d).slice(8,-1).toLowerCase()}typeof define=="function"&&define.amd?define(function(){return y}):(typeof j=="undefined"?"undefined":(0,v.default)(j))==="object"?Q.exports=y:k.dateFormat=y})(void 0)},{"babel-runtime/helpers/typeof":67}],191:[function(F,Q,j){/*!
|
|
|
* escape-html
|
|
|
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
|
* Copyright(c) 2015 Andreas Lubbe
|
|
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var N=/["'&<>]/;Q.exports=v;function v(C){var k=""+C,y=N.exec(k);if(!y)return k;var m,S="",b=0,p=0;for(b=y.index;b<k.length;b++){switch(k.charCodeAt(b)){case 34:m=""";break;case 38:m="&";break;case 39:m="'";break;case 60:m="<";break;case 62:m=">";break;default:continue}p!==b&&(S+=k.substring(p,b)),p=b+1,S+=m}return p!==b?S+k.substring(p,b):S}},{}],192:[function(F,Q,j){function N(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}Q.exports=N,N.EventEmitter=N,N.prototype._events=void 0,N.prototype._maxListeners=void 0,N.defaultMaxListeners=10,N.prototype.setMaxListeners=function(m){if(!C(m)||m<0||isNaN(m))throw TypeError("n must be a positive number");return this._maxListeners=m,this},N.prototype.emit=function(m){var S,b,p,d,t,l;if(this._events||(this._events={}),m==="error"&&(!this._events.error||k(this._events.error)&&!this._events.error.length)){if(S=arguments[1],S instanceof Error)throw S;var r=new Error('Uncaught, unspecified "error" event. ('+S+")");throw r.context=S,r}if(b=this._events[m],y(b))return!1;if(v(b))switch(arguments.length){case 1:b.call(this);break;case 2:b.call(this,arguments[1]);break;case 3:b.call(this,arguments[1],arguments[2]);break;default:d=Array.prototype.slice.call(arguments,1),b.apply(this,d)}else if(k(b))for(d=Array.prototype.slice.call(arguments,1),l=b.slice(),p=l.length,t=0;t<p;t++)l[t].apply(this,d);return!0},N.prototype.addListener=function(m,S){var b;if(!v(S))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",m,v(S.listener)?S.listener:S),this._events[m]?k(this._events[m])?this._events[m].push(S):this._events[m]=[this._events[m],S]:this._events[m]=S,k(this._events[m])&&!this._events[m].warned&&(y(this._maxListeners)?b=N.defaultMaxListeners:b=this._maxListeners,b&&b>0&&this._events[m].length>b&&(this._events[m].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[m].length),typeof console.trace=="function"&&console.trace())),this},N.prototype.on=N.prototype.addListener,N.prototype.once=function(m,S){if(!v(S))throw TypeError("listener must be a function");var b=!1;function p(){this.removeListener(m,p),b||(b=!0,S.apply(this,arguments))}return p.listener=S,this.on(m,p),this},N.prototype.removeListener=function(m,S){var b,p,d,t;if(!v(S))throw TypeError("listener must be a function");if(!this._events||!this._events[m])return this;if(b=this._events[m],d=b.length,p=-1,b===S||v(b.listener)&&b.listener===S)delete this._events[m],this._events.removeListener&&this.emit("removeListener",m,S);else if(k(b)){for(t=d;t-- >0;)if(b[t]===S||b[t].listener&&b[t].listener===S){p=t;break}if(p<0)return this;b.length===1?(b.length=0,delete this._events[m]):b.splice(p,1),this._events.removeListener&&this.emit("removeListener",m,S)}return this},N.prototype.removeAllListeners=function(m){var S,b;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[m]&&delete this._events[m],this;if(arguments.length===0){for(S in this._events){if(S==="removeListener")continue;this.removeAllListeners(S)}return this.removeAllListeners("removeListener"),this._events={},this}if(b=this._events[m],v(b))this.removeListener(m,b);else if(b)for(;b.length;)this.removeListener(m,b[b.length-1]);return delete this._events[m],this},N.prototype.listeners=function(m){var S;return!this._events||!this._events[m]?S=[]:v(this._events[m])?S=[this._events[m]]:S=this._events[m].slice(),S},N.prototype.listenerCount=function(m){if(this._events){var S=this._events[m];if(v(S))return 1;if(S)return S.length}return 0},N.listenerCount=function(m,S){return m.listenerCount(S)};function v(m){return typeof m=="function"}function C(m){return typeof m=="number"}function k(m){return typeof m=="object"&&m!==null}function y(m){return m===void 0}},{}],193:[function(F,Q,j){var N=F("http"),v=Q.exports;for(var C in N)N.hasOwnProperty(C)&&(v[C]=N[C]);v.request=function(k,y){return k||(k={}),k.scheme="https",k.protocol="https:",N.request.call(this,k,y)}},{http:231}],194:[function(F,Q,j){/*!
|
|
|
* humanize-ms - index.js
|
|
|
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
|
|
|
* MIT Licensed
|
|
|
*/"use strict";var N=F("util"),v=F("ms");Q.exports=function(C){if(typeof C=="number")return C;var k=v(C);if(k===void 0){var y=new Error(N.format("humanize-ms(%j) result undefined",C));console.warn(y.stack)}return k}},{ms:204,util:243}],195:[function(F,Q,j){j.read=function(N,v,C,k,y){var m,S,b=y*8-k-1,p=(1<<b)-1,d=p>>1,t=-7,l=C?y-1:0,r=C?-1:1,i=N[v+l];for(l+=r,m=i&(1<<-t)-1,i>>=-t,t+=b;t>0;m=m*256+N[v+l],l+=r,t-=8);for(S=m&(1<<-t)-1,m>>=-t,t+=k;t>0;S=S*256+N[v+l],l+=r,t-=8);if(m===0)m=1-d;else{if(m===p)return S?NaN:(i?-1:1)*Infinity;S=S+Math.pow(2,k),m=m-d}return(i?-1:1)*S*Math.pow(2,m-k)},j.write=function(N,v,C,k,y,m){var S,b,p,d=m*8-y-1,t=(1<<d)-1,l=t>>1,r=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=k?0:m-1,o=k?1:-1,s=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===Infinity?(b=isNaN(v)?1:0,S=t):(S=Math.floor(Math.log(v)/Math.LN2),v*(p=Math.pow(2,-S))<1&&(S--,p*=2),S+l>=1?v+=r/p:v+=r*Math.pow(2,1-l),v*p>=2&&(S++,p/=2),S+l>=t?(b=0,S=t):S+l>=1?(b=(v*p-1)*Math.pow(2,y),S=S+l):(b=v*Math.pow(2,l-1)*Math.pow(2,y),S=0));y>=8;N[C+i]=b&255,i+=o,b/=256,y-=8);for(S=S<<y|b,d+=y;d>0;N[C+i]=S&255,i+=o,S/=256,d-=8);N[C+i-o]|=s*128}},{}],196:[function(F,Q,j){typeof Object.create=="function"?Q.exports=function(v,C){C&&(v.super_=C,v.prototype=Object.create(C.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}))}:Q.exports=function(v,C){if(C){v.super_=C;var k=function(){};k.prototype=C.prototype,v.prototype=new k,v.prototype.constructor=v}}},{}],197:[function(F,Q,j){/*!
|
|
|
* Determine if an object is a Buffer
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
|
* @license MIT
|
|
|
*/Q.exports=function(C){return C!=null&&(N(C)||v(C)||!!C._isBuffer)};function N(C){return!!C.constructor&&typeof C.constructor.isBuffer=="function"&&C.constructor.isBuffer(C)}function v(C){return typeof C.readFloatLE=="function"&&typeof C.slice=="function"&&N(C.slice(0,0))}},{}],198:[function(F,Q,j){var N={}.toString;Q.exports=Array.isArray||function(v){return N.call(v)=="[object Array]"}},{}],199:[function(require,module,exports){(function(global){(function(F,Q){typeof exports=="object"&&typeof module!="undefined"?module.exports=Q(F):typeof define=="function"&&define.amd?define(Q):Q(F)})(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(F){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(F){for(var Q={},j=0,N=F.length;j<N;j++)Q[F.charAt(j)]=j;return Q}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(F){if(F.length<2){var Q=F.charCodeAt(0);return Q<128?F:Q<2048?fromCharCode(192|Q>>>6)+fromCharCode(128|Q&63):fromCharCode(224|Q>>>12&15)+fromCharCode(128|Q>>>6&63)+fromCharCode(128|Q&63)}else{var Q=65536+(F.charCodeAt(0)-55296)*1024+(F.charCodeAt(1)-56320);return fromCharCode(240|Q>>>18&7)+fromCharCode(128|Q>>>12&63)+fromCharCode(128|Q>>>6&63)+fromCharCode(128|Q&63)}},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(F){return F.replace(re_utob,cb_utob)},cb_encode=function(F){var Q=[0,2,1][F.length%3],j=F.charCodeAt(0)<<16|(F.length>1?F.charCodeAt(1):0)<<8|(F.length>2?F.charCodeAt(2):0),N=[b64chars.charAt(j>>>18),b64chars.charAt(j>>>12&63),Q>=2?"=":b64chars.charAt(j>>>6&63),Q>=1?"=":b64chars.charAt(j&63)];return N.join("")},btoa=global.btoa?function(F){return global.btoa(F)}:function(F){return F.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(F){var Q=Object.prototype.toString.call(F)==="[object Uint8Array]";return Q?F.toString("base64"):btoa(utob(String(F)))},encode=function(F,Q){return Q?_encode(String(F)).replace(/[+\/]/g,function(j){return j=="+"?"-":"_"}).replace(/=/g,""):_encode(F)},encodeURI=function(F){return encode(F,!0)},re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(F){switch(F.length){case 4:var Q=(7&F.charCodeAt(0))<<18|(63&F.charCodeAt(1))<<12|(63&F.charCodeAt(2))<<6|63&F.charCodeAt(3),j=Q-65536;return fromCharCode((j>>>10)+55296)+fromCharCode((j&1023)+56320);case 3:return fromCharCode((15&F.charCodeAt(0))<<12|(63&F.charCodeAt(1))<<6|63&F.charCodeAt(2));default:return fromCharCode((31&F.charCodeAt(0))<<6|63&F.charCodeAt(1))}},btou=function(F){return F.replace(re_btou,cb_btou)},cb_decode=function(F){var Q=F.length,j=Q%4,N=(Q>0?b64tab[F.charAt(0)]<<18:0)|(Q>1?b64tab[F.charAt(1)]<<12:0)|(Q>2?b64tab[F.charAt(2)]<<6:0)|(Q>3?b64tab[F.charAt(3)]:0),v=[fromCharCode(N>>>16),fromCharCode(N>>>8&255),fromCharCode(N&255)];return v.length-=[0,0,2,1][j],v.join("")},_atob=global.atob?function(F){return global.atob(F)}:function(F){return F.replace(/\S{1,4}/g,cb_decode)},atob=function(F){return _atob(String(F).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(F){return(F.constructor===buffer.constructor?F:buffer.from(F,"base64")).toString()}:function(F){return(F.constructor===buffer.constructor?F:new buffer(F,"base64")).toString()}:function(F){return btou(_atob(F))},decode=function(F){return _decode(String(F).replace(/[-_]/g,function(Q){return Q=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var F=global.Base64;return global.Base64=_Base64,F};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(F){return{value:F,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(F){return encode(this,F)})),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(F,Q,j){/*!
|
|
|
* merge-descriptors
|
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
|
* MIT Licensed
|
|
|
*/"use strict";Q.exports=v;var N=Object.prototype.hasOwnProperty;function v(C,k,y){if(!C)throw new TypeError("argument dest is required");if(!k)throw new TypeError("argument src is required");return y===void 0&&(y=!0),Object.getOwnPropertyNames(k).forEach(function(S){if(!y&&N.call(C,S))return;var b=Object.getOwnPropertyDescriptor(k,S);Object.defineProperty(C,S,b)}),C}},{}],201:[function(F,Q,j){"use strict";function N(){this._types=Object.create(null),this._extensions=Object.create(null);for(var v=0;v<arguments.length;v++)this.define(arguments[v]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}N.prototype.define=function(v,C){for(var k in v){var y=v[k].map(function(b){return b.toLowerCase()});k=k.toLowerCase();for(var m=0;m<y.length;m++){var S=y[m];if(S[0]=="*")continue;if(!C&&S in this._types)throw new Error('Attempt to change mapping for "'+S+'" extension from "'+this._types[S]+'" to "'+k+'". Pass `force=true` to allow this, otherwise remove "'+S+'" from the list of extensions for "'+k+'".');this._types[S]=k}if(C||!this._extensions[k]){var S=y[0];this._extensions[k]=S[0]!="*"?S:S.substr(1)}}},N.prototype.getType=function(v){v=String(v);var C=v.replace(/^.*[/\\]/,"").toLowerCase(),k=C.replace(/^.*\./,"").toLowerCase(),y=C.length<v.length,m=k.length<C.length-1;return(m||!y)&&this._types[k]||null},N.prototype.getExtension=function(v){return v=/^\s*([^;\s]*)/.test(v)&&RegExp.$1,v&&this._extensions[v.toLowerCase()]||null},Q.exports=N},{}],202:[function(F,Q,j){"use strict";var N=F("./Mime");Q.exports=new N(F("./types/standard"))},{"./Mime":201,"./types/standard":203}],203:[function(F,Q,j){Q.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(F,Q,j){var N=1e3,v=N*60,C=v*60,k=C*24,y=k*7,m=k*365.25;Q.exports=function(t,l){l=l||{};var r=typeof t;if(r==="string"&&t.length>0)return S(t);if(r==="number"&&isFinite(t))return l.long?p(t):b(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function S(t){if(t=String(t),t.length>100)return;var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!l)return;var r=parseFloat(l[1]),i=(l[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*m;case"weeks":case"week":case"w":return r*y;case"days":case"day":case"d":return r*k;case"hours":case"hour":case"hrs":case"hr":case"h":return r*C;case"minutes":case"minute":case"mins":case"min":case"m":return r*v;case"seconds":case"second":case"secs":case"sec":case"s":return r*N;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function b(t){var l=Math.abs(t);return l>=k?Math.round(t/k)+"d":l>=C?Math.round(t/C)+"h":l>=v?Math.round(t/v)+"m":l>=N?Math.round(t/N)+"s":t+"ms"}function p(t){var l=Math.abs(t);return l>=k?d(t,l,k,"day"):l>=C?d(t,l,C,"hour"):l>=v?d(t,l,v,"minute"):l>=N?d(t,l,N,"second"):t+" ms"}function d(t,l,r,i){var o=l>=r*1.5;return Math.round(t/r)+" "+i+(o?"s":"")}},{}],205:[function(F,Q,j){(function(N){function v(m,S){for(var b=0,p=m.length-1;p>=0;p--){var d=m[p];d==="."?m.splice(p,1):d===".."?(m.splice(p,1),b++):b&&(m.splice(p,1),b--)}if(S)for(;b--;b)m.unshift("..");return m}j.resolve=function(){for(var m="",S=!1,b=arguments.length-1;b>=-1&&!S;b--){var p=b>=0?arguments[b]:N.cwd();if(typeof p!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!p)continue;m=p+"/"+m,S=p.charAt(0)==="/"}return m=v(k(m.split("/"),function(d){return!!d}),!S).join("/"),(S?"/":"")+m||"."},j.normalize=function(m){var S=j.isAbsolute(m),b=y(m,-1)==="/";return m=v(k(m.split("/"),function(p){return!!p}),!S).join("/"),!m&&!S&&(m="."),m&&b&&(m+="/"),(S?"/":"")+m},j.isAbsolute=function(m){return m.charAt(0)==="/"},j.join=function(){var m=Array.prototype.slice.call(arguments,0);return j.normalize(k(m,function(S,b){if(typeof S!="string")throw new TypeError("Arguments to path.join must be strings");return S}).join("/"))},j.relative=function(m,S){m=j.resolve(m).substr(1),S=j.resolve(S).substr(1);function b(o){for(var s=0;s<o.length&&!(o[s]!=="");s++);for(var c=o.length-1;c>=0&&!(o[c]!=="");c--);return s>c?[]:o.slice(s,c-s+1)}for(var p=b(m.split("/")),d=b(S.split("/")),t=Math.min(p.length,d.length),l=t,r=0;r<t;r++)if(p[r]!==d[r]){l=r;break}for(var i=[],r=l;r<p.length;r++)i.push("..");return i=i.concat(d.slice(l)),i.join("/")},j.sep="/",j.delimiter=":",j.dirname=function(m){if(typeof m!="string"&&(m=m+""),m.length===0)return".";for(var S=m.charCodeAt(0),b=S===47,p=-1,d=!0,t=m.length-1;t>=1;--t)if(S=m.charCodeAt(t),S===47){if(!d){p=t;break}}else d=!1;return p===-1?b?"/":".":b&&p===1?"/":m.slice(0,p)};function C(m){typeof m!="string"&&(m=m+"");var S=0,b=-1,p=!0,d;for(d=m.length-1;d>=0;--d)if(m.charCodeAt(d)===47){if(!p){S=d+1;break}}else b===-1&&(p=!1,b=d+1);return b===-1?"":m.slice(S,b)}j.basename=function(m,S){var b=C(m);return S&&b.substr(-1*S.length)===S&&(b=b.substr(0,b.length-S.length)),b},j.extname=function(m){typeof m!="string"&&(m=m+"");for(var S=-1,b=0,p=-1,d=!0,t=0,l=m.length-1;l>=0;--l){var r=m.charCodeAt(l);if(r===47){if(!d){b=l+1;break}continue}p===-1&&(d=!1,p=l+1),r===46?S===-1?S=l:t!==1&&(t=1):S!==-1&&(t=-1)}return S===-1||p===-1||t===0||t===1&&S===p-1&&S===b+1?"":m.slice(S,p)};function k(m,S){if(m.filter)return m.filter(S);for(var b=[],p=0;p<m.length;p++)S(m[p],p,m)&&b.push(m[p]);return b}var y="ab".substr(-1)==="b"?function(m,S,b){return m.substr(S,b)}:function(m,S,b){return S<0&&(S=m.length+S),m.substr(S,b)}}).call(this,F("_process"))},{_process:208}],206:[function(F,Q,j){(function(N){/*!
|
|
|
* 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 v={function:!0,object:!0},C=v[typeof window]&&window||this,k=C,y=v[typeof j]&&j,m=v[typeof Q]&&Q&&!Q.nodeType&&Q,S=y&&m&&typeof N=="object"&&N;S&&(S.global===S||S.window===S||S.self===S)&&(C=S);var b=Math.pow(2,53)-1,p=/\bOpera/,d=this,t=Object.prototype,l=t.hasOwnProperty,r=t.toString;function i(g){return g=String(g),g.charAt(0).toUpperCase()+g.slice(1)}function o(g,x,E){var T={"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 x&&E&&/^Win/i.test(g)&&!/^Windows Phone /i.test(g)&&(T=T[/[\d.]+$/.exec(g)])&&(g="Windows "+T),g=String(g),x&&E&&(g=g.replace(RegExp(x,"i"),E)),g=c(g.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]),g}function s(g,x){var E=-1,T=g?g.length:0;if(typeof T=="number"&&T>-1&&T<=b)for(;++E<T;)x(g[E],E,g);else a(g,x)}function c(g){return g=h(g),/^(?:webOS|i(?:OS|P))/.test(g)?g:i(g)}function a(g,x){for(var E in g)l.call(g,E)&&x(g[E],E,g)}function u(g){return g==null?i(g):r.call(g).slice(8,-1)}function f(g,x){var E=g!=null?typeof g[x]:"number";return!/^(?:boolean|number|string|undefined)$/.test(E)&&(E=="object"?!!g[x]:!0)}function w(g){return String(g).replace(/([ -])(?!$)/g,"$1?")}function _(g,x){var E=null;return s(g,function(T,M){E=x(E,T,M,g)}),E}function h(g){return String(g).replace(/^ +| +$/g,"")}function R(g){var x=C,E=g&&typeof g=="object"&&u(g)!="String";E&&(x=g,g=null);var T=x.navigator||{},M=T.userAgent||"";g||(g=M);var L=E||d==k,A=E?!!T.likeChrome:/\bChrome\b/.test(g)&&!/internal|\n/i.test(r.toString()),V="Object",z=E?V:"ScriptBridgingProxyObject",W=E?V:"Environment",G=E&&x.java?"JavaPackage":u(x.java),U=E?V:"RuntimeObject",P=/\bJava/.test(G)&&x.java,H=P&&u(x.environment)==W,$=P?"a":"\u03B1",re=P?"b":"\u03B2",te=x.document||{},ge=x.operamini||x.opera,ve=p.test(ve=E&&ge?ge["[[Class]]"]:u(ge))?ve:ge=null,de,De=g,Te=[],he=null,ue=g==M,ie=ue&&ge&&typeof ge.version=="function"&&ge.version(),Se,ne=Y([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),ce=ye(["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"]),Oe=Re([{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"]),oe=Z({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=be(["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 Y(qe){return _(qe,function(st,lt){return st||RegExp("\\b"+(lt.pattern||w(lt))+"\\b","i").exec(g)&&(lt.label||lt)})}function Z(qe){return _(qe,function(st,lt,je){return st||(lt[Oe]||lt[/^[a-z]+(?: +[a-z]+\b)*/i.exec(Oe)]||RegExp("\\b"+w(je)+"(?:\\b|\\w*\\d)","i").exec(g))&&je})}function ye(qe){return _(qe,function(st,lt){return st||RegExp("\\b"+(lt.pattern||w(lt))+"\\b","i").exec(g)&&(lt.label||lt)})}function be(qe){return _(qe,function(st,lt){var je=lt.pattern||w(lt);return!st&&(st=RegExp("\\b"+je+"(?:/[\\d.]+|[ \\w.]*)","i").exec(g))&&(st=o(st,je,lt.label||lt)),st})}function Re(qe){return _(qe,function(st,lt){var je=lt.pattern||w(lt);return!st&&(st=RegExp("\\b"+je+" *\\d+[.\\w_]*","i").exec(g)||RegExp("\\b"+je+" *\\w+-[\\w]*","i").exec(g)||RegExp("\\b"+je+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(g))&&((st=String(lt.label&&!RegExp(je,"i").test(lt.label)?lt.label:st).split("/"))[1]&&!/[\d.]+/.test(st[0])&&(st[0]+=" "+st[1]),lt=lt.label||lt,st=c(st[0].replace(RegExp(je,"i"),lt).replace(RegExp("; *(?:"+lt+"[_-])?","i")," ").replace(RegExp("("+lt+")[-_.]?(\\w)","i"),"$1 $2"))),st})}function Qe(qe){return _(qe,function(st,lt){return st||(RegExp(lt+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(g)||0)[1]||null})}function rt(){return this.description||""}if(ne&&(ne=[ne]),oe&&!Oe&&(Oe=Re([oe])),(de=/\bGoogle TV\b/.exec(Oe))&&(Oe=de[0]),/\bSimulator\b/i.test(g)&&(Oe=(Oe?Oe+" ":"")+"Simulator"),ce=="Opera Mini"&&/\bOPiOS\b/.test(g)&&Te.push("running in Turbo/Uncompressed mode"),ce=="IE"&&/\blike iPhone OS\b/.test(g)?(de=R(g.replace(/like iPhone OS/,"")),oe=de.manufacturer,Oe=de.product):/^iP/.test(Oe)?(ce||(ce="Safari"),q="iOS"+((de=/ OS ([\d_]+)/i.exec(g))?" "+de[1].replace(/_/g,"."):"")):ce=="Konqueror"&&!/buntu/i.test(q)?q="Kubuntu":oe&&oe!="Google"&&(/Chrome/.test(ce)&&!/\bMobile Safari\b/i.test(g)||/\bVita\b/.test(Oe))||/\bAndroid\b/.test(q)&&/^Chrome/.test(ce)&&/\bVersion\//i.test(g)?(ce="Android Browser",q=/\bAndroid\b/.test(q)?q:"Android"):ce=="Silk"?(/\bMobi/i.test(g)||(q="Android",Te.unshift("desktop mode")),/Accelerated *= *true/i.test(g)&&Te.unshift("accelerated")):ce=="PaleMoon"&&(de=/\bFirefox\/([\d.]+)\b/.exec(g))?Te.push("identifying as Firefox "+de[1]):ce=="Firefox"&&(de=/\b(Mobile|Tablet|TV)\b/i.exec(g))?(q||(q="Firefox OS"),Oe||(Oe=de[1])):!ce||(de=!/\bMinefield\b/i.test(g)&&/\b(?:Firefox|Safari)\b/.exec(ce))?(ce&&!Oe&&/[\/,]|^[^(]+?\)/.test(g.slice(g.indexOf(de+"/")+8))&&(ce=null),(de=Oe||oe||q)&&(Oe||oe||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(q))&&(ce=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(q)?q:de)+" Browser")):ce=="Electron"&&(de=(/\bChrome\/([\d.]+)\b/.exec(g)||0)[1])&&Te.push("Chromium "+de),ie||(ie=Qe(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",w(ce),"(?:Firefox|Minefield|NetFront)"])),(de=ne=="iCab"&&parseFloat(ie)>3&&"WebKit"||/\bOpera\b/.test(ce)&&(/\bOPR\b/.test(g)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(g)&&!/^(?:Trident|EdgeHTML)$/.test(ne)&&"WebKit"||!ne&&/\bMSIE\b/i.test(g)&&(q=="Mac OS"?"Tasman":"Trident")||ne=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(ce)&&"NetFront")&&(ne=[de]),ce=="IE"&&(de=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(g)||0)[1])?(ce+=" Mobile",q="Windows Phone "+(/\+$/.test(de)?de:de+".x"),Te.unshift("desktop mode")):/\bWPDesktop\b/i.test(g)?(ce="IE Mobile",q="Windows Phone 8.x",Te.unshift("desktop mode"),ie||(ie=(/\brv:([\d.]+)/.exec(g)||0)[1])):ce!="IE"&&ne=="Trident"&&(de=/\brv:([\d.]+)/.exec(g))&&(ce&&Te.push("identifying as "+ce+(ie?" "+ie:"")),ce="IE",ie=de[1]),ue){if(f(x,"global"))if(P&&(de=P.lang.System,De=de.getProperty("os.arch"),q=q||de.getProperty("os.name")+" "+de.getProperty("os.version")),H){try{ie=x.require("ringo/engine").version.join("."),ce="RingoJS"}catch(qe){(de=x.system)&&de.global.system==x.system&&(ce="Narwhal",q||(q=de[0].os||null))}ce||(ce="Rhino")}else typeof x.process=="object"&&!x.process.browser&&(de=x.process)&&(typeof de.versions=="object"&&(typeof de.versions.electron=="string"?(Te.push("Node "+de.versions.node),ce="Electron",ie=de.versions.electron):typeof de.versions.nw=="string"&&(Te.push("Chromium "+ie,"Node "+de.versions.node),ce="NW.js",ie=de.versions.nw)),ce||(ce="Node.js",De=de.arch,q=de.platform,ie=/[\d.]+/.exec(de.version),ie=ie?ie[0]:null));else u(de=x.runtime)==z?(ce="Adobe AIR",q=de.flash.system.Capabilities.os):u(de=x.phantom)==U?(ce="PhantomJS",ie=(de=de.version||null)&&de.major+"."+de.minor+"."+de.patch):typeof te.documentMode=="number"&&(de=/\bTrident\/(\d+)/i.exec(g))?(ie=[ie,te.documentMode],(de=+de[1]+4)!=ie[1]&&(Te.push("IE "+ie[1]+" mode"),ne&&(ne[1]=""),ie[1]=de),ie=ce=="IE"?String(ie[1].toFixed(1)):ie[0]):typeof te.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ce)&&(Te.push("masking as "+ce+" "+ie),ce="IE",ie="11.0",ne=["Trident"],q="Windows");q=q&&c(q)}if(ie&&(de=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(ie)||/(?:alpha|beta)(?: ?\d)?/i.exec(g+";"+(ue&&T.appMinorVersion))||/\bMinefield\b/i.test(g)&&"a")&&(he=/b/i.test(de)?"beta":"alpha",ie=ie.replace(RegExp(de+"\\+?$"),"")+(he=="beta"?re:$)+(/\d+\+?/.exec(de)||"")),ce=="Fennec"||ce=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(q))ce="Firefox Mobile";else if(ce=="Maxthon"&&ie)ie=ie.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(Oe))Oe=="Xbox 360"&&(q=null),Oe=="Xbox 360"&&/\bIEMobile\b/.test(g)&&Te.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(ce)||ce&&!Oe&&!/Browser|Mobi/.test(ce))&&(q=="Windows CE"||/Mobi/i.test(g)))ce+=" Mobile";else if(ce=="IE"&&ue)try{x.external===null&&Te.unshift("platform preview")}catch(qe){Te.unshift("embedded")}else(/\bBlackBerry\b/.test(Oe)||/\bBB10\b/.test(g))&&(de=(RegExp(Oe.replace(/ +/g," *")+"/([.\\d]+)","i").exec(g)||0)[1]||ie)?(de=[de,/BB10/.test(g)],q=(de[1]?(Oe=null,oe="BlackBerry"):"Device Software")+" "+de[0],ie=null):this!=a&&Oe!="Wii"&&(ue&&ge||/Opera/.test(ce)&&/\b(?:MSIE|Firefox)\b/i.test(g)||ce=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(q)||ce=="IE"&&(q&&!/^Win/.test(q)&&ie>5.5||/\bWindows XP\b/.test(q)&&ie>8||ie==8&&!/\bTrident\b/.test(g)))&&!p.test(de=R.call(a,g.replace(p,"")+";"))&&de.name&&(de="ing as "+de.name+((de=de.version)?" "+de:""),p.test(ce)?(/\bIE\b/.test(de)&&q=="Mac OS"&&(q=null),de="identify"+de):(de="mask"+de,ve?ce=c(ve.replace(/([a-z])([A-Z])/g,"$1 $2")):ce="Opera",/\bIE\b/.test(de)&&(q=null),ue||(ie=null)),ne=["Presto"],Te.push(de));(de=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(g)||0)[1])&&(de=[parseFloat(de.replace(/\.(\d)$/,".0$1")),de],ce=="Safari"&&de[1].slice(-1)=="+"?(ce="WebKit Nightly",he="alpha",ie=de[1].slice(0,-1)):(ie==de[1]||ie==(de[2]=(/\bSafari\/([\d.]+\+?)/i.exec(g)||0)[1]))&&(ie=null),de[1]=(/\bChrome\/([\d.]+)/i.exec(g)||0)[1],de[0]==537.36&&de[2]==537.36&&parseFloat(de[1])>=28&&ne=="WebKit"&&(ne=["Blink"]),!ue||!A&&!de[1]?(ne&&(ne[1]="like Safari"),de=(de=de[0],de<400?1:de<500?2:de<526?3:de<533?4:de<534?"4+":de<535?5:de<537?6:de<538?7:de<601?8:"8")):(ne&&(ne[1]="like Chrome"),de=de[1]||(de=de[0],de<530?1:de<532?2:de<532.05?3:de<533?4:de<534.03?5:de<534.07?6:de<534.1?7:de<534.13?8:de<534.16?9:de<534.24?10:de<534.3?11:de<535.01?12:de<535.02?"13+":de<535.07?15:de<535.11?16:de<535.19?17:de<536.05?18:de<536.1?19:de<537.01?20:de<537.11?"21+":de<537.13?23:de<537.18?24:de<537.24?25:de<537.36?26:ne!="Blink"?"27":"28")),ne&&(ne[1]+=" "+(de+=typeof de=="number"?".x":/[.+]/.test(de)?"":"+")),ce=="Safari"&&(!ie||parseInt(ie)>45)&&(ie=de)),ce=="Opera"&&(de=/\bzbov|zvav$/.exec(q))?(ce+=" ",Te.unshift("desktop mode"),de=="zvav"?(ce+="Mini",ie=null):ce+="Mobile",q=q.replace(RegExp(" *"+de+"$"),"")):ce=="Safari"&&/\bChrome\b/.exec(ne&&ne[1])&&(Te.unshift("desktop mode"),ce="Chrome Mobile",ie=null,/\bOS X\b/.test(q)?(oe="Apple",q="iOS 4.3+"):q=null),ie&&ie.indexOf(de=/[\d.]+$/.exec(q))==0&&g.indexOf("/"+de+"-")>-1&&(q=h(q.replace(de,""))),ne&&!/\b(?:Avant|Nook)\b/.test(ce)&&(/Browser|Lunascape|Maxthon/.test(ce)||ce!="Safari"&&/^iOS/.test(q)&&/\bSafari\b/.test(ne[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(ce)&&ne[1])&&((de=ne[ne.length-1])&&Te.push(de)),Te.length&&(Te=["("+Te.join("; ")+")"]),oe&&Oe&&Oe.indexOf(oe)<0&&Te.push("on "+oe),Oe&&Te.push((/^on /.test(Te[Te.length-1])?"":"on ")+Oe),q&&(de=/ ([\d.+]+)$/.exec(q),Se=de&&q.charAt(q.length-de[0].length-1)=="/",q={architecture:32,family:de&&!Se?q.replace(de[0],""):q,version:de?de[1]:null,toString:function(){var qe=this.version;return this.family+(qe&&!Se?" "+qe:"")+(this.architecture==64?" 64-bit":"")}}),(de=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(De))&&!/\bi686\b/i.test(De)?(q&&(q.architecture=64,q.family=q.family.replace(RegExp(" *"+de),"")),ce&&(/\bWOW64\b/i.test(g)||ue&&/\w(?:86|32)$/.test(T.cpuClass||T.platform)&&!/\bWin64; x64\b/i.test(g))&&Te.unshift("32-bit")):q&&/^OS X/.test(q.family)&&ce=="Chrome"&&parseFloat(ie)>=39&&(q.architecture=64),g||(g=null);var at={};return at.description=g,at.layout=ne&&ne[0],at.manufacturer=oe,at.name=ce,at.prerelease=he,at.product=Oe,at.ua=g,at.version=ce&&ie,at.os=q||{architecture:null,family:null,version:null,toString:function(){return"null"}},at.parse=R,at.toString=rt,at.version&&Te.unshift(ie),at.name&&Te.unshift(ce),q&&ce&&!(q==String(q).split(" ")[0]&&(q==ce.split(" ")[0]||Oe))&&Te.push(Oe?"("+q+")":"on "+q),Te.length&&(at.description=Te.join(" ")),at}var O=R();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(C.platform=O,define(function(){return O})):y&&m?a(O,function(g,x){y[x]=g}):C.platform=O}).call(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],207:[function(F,Q,j){(function(N){"use strict";typeof N=="undefined"||!N.version||N.version.indexOf("v0.")===0||N.version.indexOf("v1.")===0&&N.version.indexOf("v1.8.")!==0?Q.exports={nextTick:v}:Q.exports=N;function v(C,k,y,m){if(typeof C!="function")throw new TypeError('"callback" argument must be a function');var S=arguments.length,b,p;switch(S){case 0:case 1:return N.nextTick(C);case 2:return N.nextTick(function(){C.call(null,k)});case 3:return N.nextTick(function(){C.call(null,k,y)});case 4:return N.nextTick(function(){C.call(null,k,y,m)});default:for(b=new Array(S-1),p=0;p<b.length;)b[p++]=arguments[p];return N.nextTick(function(){C.apply(null,b)})}}}).call(this,F("_process"))},{_process:208}],208:[function(F,Q,j){var N=Q.exports={},v,C;function k(){throw new Error("setTimeout has not been defined")}function y(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?v=setTimeout:v=k}catch(s){v=k}try{typeof clearTimeout=="function"?C=clearTimeout:C=y}catch(s){C=y}})();function m(s){if(v===setTimeout)return setTimeout(s,0);if((v===k||!v)&&setTimeout)return v=setTimeout,setTimeout(s,0);try{return v(s,0)}catch(c){try{return v.call(null,s,0)}catch(a){return v.call(this,s,0)}}}function S(s){if(C===clearTimeout)return clearTimeout(s);if((C===y||!C)&&clearTimeout)return C=clearTimeout,clearTimeout(s);try{return C(s)}catch(c){try{return C.call(null,s)}catch(a){return C.call(this,s)}}}var b=[],p=!1,d,t=-1;function l(){if(!p||!d)return;p=!1,d.length?b=d.concat(b):t=-1,b.length&&r()}function r(){if(p)return;var s=m(l);p=!0;for(var c=b.length;c;){for(d=b,b=[];++t<c;)d&&d[t].run();t=-1,c=b.length}d=null,p=!1,S(s)}N.nextTick=function(s){var c=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)c[a-1]=arguments[a];b.push(new i(s,c)),b.length===1&&!p&&m(r)};function i(s,c){this.fun=s,this.array=c}i.prototype.run=function(){this.fun.apply(null,this.array)},N.title="browser",N.browser=!0,N.env={},N.argv=[],N.version="",N.versions={};function o(){}N.on=o,N.addListener=o,N.once=o,N.off=o,N.removeListener=o,N.removeAllListeners=o,N.emit=o,N.prependListener=o,N.prependOnceListener=o,N.listeners=function(s){return[]},N.binding=function(s){throw new Error("process.binding is not supported")},N.cwd=function(){return"/"},N.chdir=function(s){throw new Error("process.chdir is not supported")},N.umask=function(){return 0}},{}],209:[function(F,Q,j){(function(N){/*! https://mths.be/punycode v1.4.1 by @mathias */(function(v){var C=typeof j=="object"&&j&&!j.nodeType&&j,k=typeof Q=="object"&&Q&&!Q.nodeType&&Q,y=typeof N=="object"&&N;(y.global===y||y.window===y||y.self===y)&&(v=y);var m,S=2147483647,b=36,p=1,d=26,t=38,l=700,r=72,i=128,o="-",s=/^xn--/,c=/[^\x20-\x7E]/,a=/[\x2E\u3002\uFF0E\uFF61]/g,u={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=b-p,w=Math.floor,_=String.fromCharCode,h;function R(G){throw new RangeError(u[G])}function O(G,U){for(var P=G.length,H=[];P--;)H[P]=U(G[P]);return H}function g(G,U){var P=G.split("@"),H="";P.length>1&&(H=P[0]+"@",G=P[1]),G=G.replace(a,".");var $=G.split("."),re=O($,U).join(".");return H+re}function x(G){for(var U=[],P=0,H=G.length,$,re;P<H;)$=G.charCodeAt(P++),$>=55296&&$<=56319&&P<H?(re=G.charCodeAt(P++),(re&64512)==56320?U.push((($&1023)<<10)+(re&1023)+65536):(U.push($),P--)):U.push($);return U}function E(G){return O(G,function(U){var P="";return U>65535&&(U-=65536,P+=_(U>>>10&1023|55296),U=56320|U&1023),P+=_(U),P}).join("")}function T(G){return G-48<10?G-22:G-65<26?G-65:G-97<26?G-97:b}function M(G,U){return G+22+75*(G<26)-((U!=0)<<5)}function L(G,U,P){var H=0;for(G=P?w(G/l):G>>1,G+=w(G/U);G>f*d>>1;H+=b)G=w(G/f);return w(H+(f+1)*G/(G+t))}function A(G){var U=[],P=G.length,H,$=0,re=i,te=r,ge,ve,de,De,Te,he,ue,ie,Se;for(ge=G.lastIndexOf(o),ge<0&&(ge=0),ve=0;ve<ge;++ve)G.charCodeAt(ve)>=128&&R("not-basic"),U.push(G.charCodeAt(ve));for(de=ge>0?ge+1:0;de<P;){for(De=$,Te=1,he=b;!(de>=P&&R("invalid-input"),ue=T(G.charCodeAt(de++)),(ue>=b||ue>w((S-$)/Te))&&R("overflow"),$+=ue*Te,ie=he<=te?p:he>=te+d?d:he-te,ue<ie);he+=b)Se=b-ie,Te>w(S/Se)&&R("overflow"),Te*=Se;H=U.length+1,te=L($-De,H,De==0),w($/H)>S-re&&R("overflow"),re+=w($/H),$%=H,U.splice($++,0,re)}return E(U)}function V(G){var U,P,H,$,re,te,ge,ve,de,De,Te,he=[],ue,ie,Se,ne;for(G=x(G),ue=G.length,U=i,P=0,re=r,te=0;te<ue;++te)Te=G[te],Te<128&&he.push(_(Te));for(H=$=he.length,$&&he.push(o);H<ue;){for(ge=S,te=0;te<ue;++te)Te=G[te],Te>=U&&Te<ge&&(ge=Te);for(ie=H+1,ge-U>w((S-P)/ie)&&R("overflow"),P+=(ge-U)*ie,U=ge,te=0;te<ue;++te)if(Te=G[te],Te<U&&++P>S&&R("overflow"),Te==U){for(ve=P,de=b;!(De=de<=re?p:de>=re+d?d:de-re,ve<De);de+=b)ne=ve-De,Se=b-De,he.push(_(M(De+ne%Se,0))),ve=w(ne/Se);he.push(_(M(ve,0))),re=L(P,ie,H==$),P=0,++H}++P,++U}return he.join("")}function z(G){return g(G,function(U){return s.test(U)?A(U.slice(4).toLowerCase()):U})}function W(G){return g(G,function(U){return c.test(U)?"xn--"+V(U):U})}if(m={version:"1.4.1",ucs2:{decode:x,encode:E},decode:A,encode:V,toASCII:W,toUnicode:z},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return m});else if(C&&k)if(Q.exports==C)k.exports=m;else for(h in m)m.hasOwnProperty(h)&&(C[h]=m[h]);else v.punycode=m})(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],210:[function(F,Q,j){"use strict";function N(C,k){return Object.prototype.hasOwnProperty.call(C,k)}Q.exports=function(C,k,y,m){k=k||"&",y=y||"=";var S={};if(typeof C!="string"||C.length===0)return S;var b=/\+/g;C=C.split(k);var p=1e3;m&&typeof m.maxKeys=="number"&&(p=m.maxKeys);var d=C.length;p>0&&d>p&&(d=p);for(var t=0;t<d;++t){var l=C[t].replace(b,"%20"),r=l.indexOf(y),i,o,s,c;r>=0?(i=l.substr(0,r),o=l.substr(r+1)):(i=l,o=""),s=decodeURIComponent(i),c=decodeURIComponent(o),N(S,s)?v(S[s])?S[s].push(c):S[s]=[S[s],c]:S[s]=c}return S};var v=Array.isArray||function(C){return Object.prototype.toString.call(C)==="[object Array]"}},{}],211:[function(F,Q,j){"use strict";var N=function(y){switch(typeof y){case"string":return y;case"boolean":return y?"true":"false";case"number":return isFinite(y)?y:"";default:return""}};Q.exports=function(y,m,S,b){return m=m||"&",S=S||"=",y===null&&(y=void 0),typeof y=="object"?C(k(y),function(p){var d=encodeURIComponent(N(p))+S;return v(y[p])?C(y[p],function(t){return d+encodeURIComponent(N(t))}).join(m):d+encodeURIComponent(N(y[p]))}).join(m):b?encodeURIComponent(N(b))+S+encodeURIComponent(N(y)):""};var v=Array.isArray||function(y){return Object.prototype.toString.call(y)==="[object Array]"};function C(y,m){if(y.map)return y.map(m);for(var S=[],b=0;b<y.length;b++)S.push(m(y[b],b));return S}var k=Object.keys||function(y){var m=[];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&m.push(S);return m}},{}],212:[function(F,Q,j){"use strict";j.decode=j.parse=F("./decode"),j.encode=j.stringify=F("./encode")},{"./decode":210,"./encode":211}],213:[function(F,Q,j){Q.exports=F("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":214}],214:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=y(N),C=F("babel-runtime/core-js/object/keys"),k=y(C);function y(c){return c&&c.__esModule?c:{default:c}}var m=F("process-nextick-args"),S=k.default||function(c){var a=[];for(var u in c)a.push(u);return a};Q.exports=i;var b=(0,v.default)(F("core-util-is"));b.inherits=F("inherits");var p=F("./_stream_readable"),d=F("./_stream_writable");b.inherits(i,p);for(var t=S(d.prototype),l=0;l<t.length;l++){var r=t[l];i.prototype[r]||(i.prototype[r]=d.prototype[r])}function i(c){if(!(this instanceof i))return new i(c);p.call(this,c),d.call(this,c),c&&c.readable===!1&&(this.readable=!1),c&&c.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,c&&c.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",o)}Object.defineProperty(i.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function o(){if(this.allowHalfOpen||this._writableState.ended)return;m.nextTick(s,this)}function s(c){c.end()}Object.defineProperty(i.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(a){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=a,this._writableState.destroyed=a}}),i.prototype._destroy=function(c,a){this.push(null),this.end(),m.nextTick(a,c)}},{"./_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(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(S){return S&&S.__esModule?S:{default:S}}Q.exports=m;var k=F("./_stream_transform"),y=(0,v.default)(F("core-util-is"));y.inherits=F("inherits"),y.inherits(m,k);function m(S){if(!(this instanceof m))return new m(S);k.call(this,S)}m.prototype._transform=function(S,b,p){p(null,S)}},{"./_stream_transform":217,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],216:[function(F,Q,j){(function(N,v){"use strict";var C=F("babel-runtime/core-js/object/get-prototype-of"),k=S(C),y=F("babel-runtime/core-js/object/create"),m=S(y);function S(ne){return ne&&ne.__esModule?ne:{default:ne}}var b=F("process-nextick-args");Q.exports=x;var p=F("isarray"),d;x.ReadableState=g;var t=F("events").EventEmitter,l=function(ce,Oe){return ce.listeners(Oe).length},r=F("./internal/streams/stream"),i=F("safe-buffer").Buffer,o=v.Uint8Array||function(){};function s(ne){return i.from(ne)}function c(ne){return i.isBuffer(ne)||ne instanceof o}var a=(0,m.default)(F("core-util-is"));a.inherits=F("inherits");var u=F("util"),f=void 0;u&&u.debuglog?f=u.debuglog("stream"):f=function(){};var w=F("./internal/streams/BufferList"),_=F("./internal/streams/destroy"),h;a.inherits(x,r);var R=["error","close","destroy","pause","resume"];function O(ne,ce,Oe){if(typeof ne.prependListener=="function")return ne.prependListener(ce,Oe);!ne._events||!ne._events[ce]?ne.on(ce,Oe):p(ne._events[ce])?ne._events[ce].unshift(Oe):ne._events[ce]=[Oe,ne._events[ce]]}function g(ne,ce){d=d||F("./_stream_duplex"),ne=ne||{};var Oe=ce instanceof d;this.objectMode=!!ne.objectMode,Oe&&(this.objectMode=this.objectMode||!!ne.readableObjectMode);var oe=ne.highWaterMark,q=ne.readableHighWaterMark,Y=this.objectMode?16:16*1024;oe||oe===0?this.highWaterMark=oe:Oe&&(q||q===0)?this.highWaterMark=q:this.highWaterMark=Y,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=ne.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ne.encoding&&(h||(h=F("string_decoder/").StringDecoder),this.decoder=new h(ne.encoding),this.encoding=ne.encoding)}function x(ne){if(d=d||F("./_stream_duplex"),!(this instanceof x))return new x(ne);this._readableState=new g(ne,this),this.readable=!0,ne&&(typeof ne.read=="function"&&(this._read=ne.read),typeof ne.destroy=="function"&&(this._destroy=ne.destroy)),r.call(this)}Object.defineProperty(x.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ce){if(!this._readableState)return;this._readableState.destroyed=ce}}),x.prototype.destroy=_.destroy,x.prototype._undestroy=_.undestroy,x.prototype._destroy=function(ne,ce){this.push(null),ce(ne)},x.prototype.push=function(ne,ce){var Oe=this._readableState,oe;return Oe.objectMode?oe=!0:typeof ne=="string"&&(ce=ce||Oe.defaultEncoding,ce!==Oe.encoding&&(ne=i.from(ne,ce),ce=""),oe=!0),E(this,ne,ce,!1,oe)},x.prototype.unshift=function(ne){return E(this,ne,null,!0,!1)};function E(ne,ce,Oe,oe,q){var Y=ne._readableState;if(ce===null)Y.reading=!1,W(ne,Y);else{var Z;q||(Z=M(Y,ce)),Z?ne.emit("error",Z):Y.objectMode||ce&&ce.length>0?(typeof ce!="string"&&!Y.objectMode&&(0,k.default)(ce)!==i.prototype&&(ce=s(ce)),oe?Y.endEmitted?ne.emit("error",new Error("stream.unshift() after end event")):T(ne,Y,ce,!0):Y.ended?ne.emit("error",new Error("stream.push() after EOF")):(Y.reading=!1,Y.decoder&&!Oe?(ce=Y.decoder.write(ce),Y.objectMode||ce.length!==0?T(ne,Y,ce,!1):P(ne,Y)):T(ne,Y,ce,!1))):oe||(Y.reading=!1)}return L(Y)}function T(ne,ce,Oe,oe){ce.flowing&&ce.length===0&&!ce.sync?(ne.emit("data",Oe),ne.read(0)):(ce.length+=ce.objectMode?1:Oe.length,oe?ce.buffer.unshift(Oe):ce.buffer.push(Oe),ce.needReadable&&G(ne)),P(ne,ce)}function M(ne,ce){var Oe;return!c(ce)&&typeof ce!="string"&&ce!==void 0&&!ne.objectMode&&(Oe=new TypeError("Invalid non-string/buffer chunk")),Oe}function L(ne){return!ne.ended&&(ne.needReadable||ne.length<ne.highWaterMark||ne.length===0)}x.prototype.isPaused=function(){return this._readableState.flowing===!1},x.prototype.setEncoding=function(ne){return h||(h=F("string_decoder/").StringDecoder),this._readableState.decoder=new h(ne),this._readableState.encoding=ne,this};var A=8388608;function V(ne){return ne>=A?ne=A:(ne--,ne|=ne>>>1,ne|=ne>>>2,ne|=ne>>>4,ne|=ne>>>8,ne|=ne>>>16,ne++),ne}function z(ne,ce){return ne<=0||ce.length===0&&ce.ended?0:ce.objectMode?1:ne!==ne?ce.flowing&&ce.length?ce.buffer.head.data.length:ce.length:(ne>ce.highWaterMark&&(ce.highWaterMark=V(ne)),ne<=ce.length?ne:ce.ended?ce.length:(ce.needReadable=!0,0))}x.prototype.read=function(ne){f("read",ne),ne=parseInt(ne,10);var ce=this._readableState,Oe=ne;if(ne!==0&&(ce.emittedReadable=!1),ne===0&&ce.needReadable&&(ce.length>=ce.highWaterMark||ce.ended))return f("read: emitReadable",ce.length,ce.ended),ce.length===0&&ce.ended?ue(this):G(this),null;if(ne=z(ne,ce),ne===0&&ce.ended)return ce.length===0&&ue(this),null;var oe=ce.needReadable;f("need readable",oe),(ce.length===0||ce.length-ne<ce.highWaterMark)&&(oe=!0,f("length less than watermark",oe)),ce.ended||ce.reading?(oe=!1,f("reading or ended",oe)):oe&&(f("do read"),ce.reading=!0,ce.sync=!0,ce.length===0&&(ce.needReadable=!0),this._read(ce.highWaterMark),ce.sync=!1,ce.reading||(ne=z(Oe,ce)));var q;return ne>0?q=de(ne,ce):q=null,q===null?(ce.needReadable=!0,ne=0):ce.length-=ne,ce.length===0&&(ce.ended||(ce.needReadable=!0),Oe!==ne&&ce.ended&&ue(this)),q!==null&&this.emit("data",q),q};function W(ne,ce){if(ce.ended)return;if(ce.decoder){var Oe=ce.decoder.end();Oe&&Oe.length&&(ce.buffer.push(Oe),ce.length+=ce.objectMode?1:Oe.length)}ce.ended=!0,G(ne)}function G(ne){var ce=ne._readableState;ce.needReadable=!1,ce.emittedReadable||(f("emitReadable",ce.flowing),ce.emittedReadable=!0,ce.sync?b.nextTick(U,ne):U(ne))}function U(ne){f("emit readable"),ne.emit("readable"),ve(ne)}function P(ne,ce){ce.readingMore||(ce.readingMore=!0,b.nextTick(H,ne,ce))}function H(ne,ce){for(var Oe=ce.length;!ce.reading&&!ce.flowing&&!ce.ended&&ce.length<ce.highWaterMark&&!(f("maybeReadMore read 0"),ne.read(0),Oe===ce.length);)Oe=ce.length;ce.readingMore=!1}x.prototype._read=function(ne){this.emit("error",new Error("_read() is not implemented"))},x.prototype.pipe=function(ne,ce){var Oe=this,oe=this._readableState;switch(oe.pipesCount){case 0:oe.pipes=ne;break;case 1:oe.pipes=[oe.pipes,ne];break;default:oe.pipes.push(ne);break}oe.pipesCount+=1,f("pipe count=%d opts=%j",oe.pipesCount,ce);var q=(!ce||ce.end!==!1)&&ne!==N.stdout&&ne!==N.stderr,Y=q?ye:je;oe.endEmitted?b.nextTick(Y):Oe.once("end",Y),ne.on("unpipe",Z);function Z(Ie,tt){f("onunpipe"),Ie===Oe&&(tt&&tt.hasUnpiped===!1&&(tt.hasUnpiped=!0,Qe()))}function ye(){f("onend"),ne.end()}var be=$(Oe);ne.on("drain",be);var Re=!1;function Qe(){f("cleanup"),ne.removeListener("close",st),ne.removeListener("finish",lt),ne.removeListener("drain",be),ne.removeListener("error",qe),ne.removeListener("unpipe",Z),Oe.removeListener("end",ye),Oe.removeListener("end",je),Oe.removeListener("data",at),Re=!0,oe.awaitDrain&&(!ne._writableState||ne._writableState.needDrain)&&be()}var rt=!1;Oe.on("data",at);function at(Ie){f("ondata"),rt=!1;var tt=ne.write(Ie);tt===!1&&!rt&&((oe.pipesCount===1&&oe.pipes===ne||oe.pipesCount>1&&Se(oe.pipes,ne)!==-1)&&!Re&&(f("false write response, pause",Oe._readableState.awaitDrain),Oe._readableState.awaitDrain++,rt=!0),Oe.pause())}function qe(Ie){f("onerror",Ie),je(),ne.removeListener("error",qe),l(ne,"error")===0&&ne.emit("error",Ie)}O(ne,"error",qe);function st(){ne.removeListener("finish",lt),je()}ne.once("close",st);function lt(){f("onfinish"),ne.removeListener("close",st),je()}ne.once("finish",lt);function je(){f("unpipe"),Oe.unpipe(ne)}return ne.emit("pipe",Oe),oe.flowing||(f("pipe resume"),Oe.resume()),ne};function $(ne){return function(){var ce=ne._readableState;f("pipeOnDrain",ce.awaitDrain),ce.awaitDrain&&ce.awaitDrain--,ce.awaitDrain===0&&l(ne,"data")&&(ce.flowing=!0,ve(ne))}}x.prototype.unpipe=function(ne){var ce=this._readableState,Oe={hasUnpiped:!1};if(ce.pipesCount===0)return this;if(ce.pipesCount===1)return ne&&ne!==ce.pipes?this:(ne||(ne=ce.pipes),ce.pipes=null,ce.pipesCount=0,ce.flowing=!1,ne&&ne.emit("unpipe",this,Oe),this);if(!ne){var oe=ce.pipes,q=ce.pipesCount;ce.pipes=null,ce.pipesCount=0,ce.flowing=!1;for(var Y=0;Y<q;Y++)oe[Y].emit("unpipe",this,Oe);return this}var Z=Se(ce.pipes,ne);return Z===-1?this:(ce.pipes.splice(Z,1),ce.pipesCount-=1,ce.pipesCount===1&&(ce.pipes=ce.pipes[0]),ne.emit("unpipe",this,Oe),this)},x.prototype.on=function(ne,ce){var Oe=r.prototype.on.call(this,ne,ce);if(ne==="data")this._readableState.flowing!==!1&&this.resume();else if(ne==="readable"){var oe=this._readableState;!oe.endEmitted&&!oe.readableListening&&(oe.readableListening=oe.needReadable=!0,oe.emittedReadable=!1,oe.reading?oe.length&&G(this):b.nextTick(re,this))}return Oe},x.prototype.addListener=x.prototype.on;function re(ne){f("readable nexttick read 0"),ne.read(0)}x.prototype.resume=function(){var ne=this._readableState;return ne.flowing||(f("resume"),ne.flowing=!0,te(this,ne)),this};function te(ne,ce){ce.resumeScheduled||(ce.resumeScheduled=!0,b.nextTick(ge,ne,ce))}function ge(ne,ce){ce.reading||(f("resume read 0"),ne.read(0)),ce.resumeScheduled=!1,ce.awaitDrain=0,ne.emit("resume"),ve(ne),ce.flowing&&!ce.reading&&ne.read(0)}x.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function ve(ne){var ce=ne._readableState;for(f("flow",ce.flowing);ce.flowing&&ne.read()!==null;);}x.prototype.wrap=function(ne){var ce=this,Oe=this._readableState,oe=!1;ne.on("end",function(){if(f("wrapped end"),Oe.decoder&&!Oe.ended){var Z=Oe.decoder.end();Z&&Z.length&&ce.push(Z)}ce.push(null)}),ne.on("data",function(Z){if(f("wrapped data"),Oe.decoder&&(Z=Oe.decoder.write(Z)),Oe.objectMode&&Z==null)return;if(!Oe.objectMode&&(!Z||!Z.length))return;var ye=ce.push(Z);ye||(oe=!0,ne.pause())});for(var q in ne)this[q]===void 0&&typeof ne[q]=="function"&&(this[q]=function(Z){return function(){return ne[Z].apply(ne,arguments)}}(q));for(var Y=0;Y<R.length;Y++)ne.on(R[Y],this.emit.bind(this,R[Y]));return this._read=function(Z){f("wrapped _read",Z),oe&&(oe=!1,ne.resume())},this},Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),x._fromList=de;function de(ne,ce){if(ce.length===0)return null;var Oe;return ce.objectMode?Oe=ce.buffer.shift():!ne||ne>=ce.length?(ce.decoder?Oe=ce.buffer.join(""):ce.buffer.length===1?Oe=ce.buffer.head.data:Oe=ce.buffer.concat(ce.length),ce.buffer.clear()):Oe=De(ne,ce.buffer,ce.decoder),Oe}function De(ne,ce,Oe){var oe;return ne<ce.head.data.length?(oe=ce.head.data.slice(0,ne),ce.head.data=ce.head.data.slice(ne)):ne===ce.head.data.length?oe=ce.shift():oe=Oe?Te(ne,ce):he(ne,ce),oe}function Te(ne,ce){var Oe=ce.head,oe=1,q=Oe.data;for(ne-=q.length;Oe=Oe.next;){var Y=Oe.data,Z=ne>Y.length?Y.length:ne;if(Z===Y.length?q+=Y:q+=Y.slice(0,ne),ne-=Z,ne===0){Z===Y.length?(++oe,Oe.next?ce.head=Oe.next:ce.head=ce.tail=null):(ce.head=Oe,Oe.data=Y.slice(Z));break}++oe}return ce.length-=oe,q}function he(ne,ce){var Oe=i.allocUnsafe(ne),oe=ce.head,q=1;for(oe.data.copy(Oe),ne-=oe.data.length;oe=oe.next;){var Y=oe.data,Z=ne>Y.length?Y.length:ne;if(Y.copy(Oe,Oe.length-ne,0,Z),ne-=Z,ne===0){Z===Y.length?(++q,oe.next?ce.head=oe.next:ce.head=ce.tail=null):(ce.head=oe,oe.data=Y.slice(Z));break}++q}return ce.length-=q,Oe}function ue(ne){var ce=ne._readableState;if(ce.length>0)throw new Error('"endReadable()" called on non-empty stream');ce.endEmitted||(ce.ended=!0,b.nextTick(ie,ce,ne))}function ie(ne,ce){!ne.endEmitted&&ne.length===0&&(ne.endEmitted=!0,ce.readable=!1,ce.emit("end"))}function Se(ne,ce){for(var Oe=0,oe=ne.length;Oe<oe;Oe++)if(ne[Oe]===ce)return Oe;return-1}}).call(this,F("_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(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(d){return d&&d.__esModule?d:{default:d}}Q.exports=S;var k=F("./_stream_duplex"),y=(0,v.default)(F("core-util-is"));y.inherits=F("inherits"),y.inherits(S,k);function m(d,t){var l=this._transformState;l.transforming=!1;var r=l.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));l.writechunk=null,l.writecb=null,t!=null&&this.push(t),r(d);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function S(d){if(!(this instanceof S))return new S(d);k.call(this,d),this._transformState={afterTransform:m.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",b)}function b(){var d=this;typeof this._flush=="function"?this._flush(function(t,l){p(d,t,l)}):p(this,null,null)}S.prototype.push=function(d,t){return this._transformState.needTransform=!1,k.prototype.push.call(this,d,t)},S.prototype._transform=function(d,t,l){throw new Error("_transform() is not implemented")},S.prototype._write=function(d,t,l){var r=this._transformState;if(r.writecb=l,r.writechunk=d,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},S.prototype._read=function(d){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},S.prototype._destroy=function(d,t){var l=this;k.prototype._destroy.call(this,d,function(r){t(r),l.emit("close")})};function p(d,t,l){if(t)return d.emit("error",t);if(l!=null&&d.push(l),d._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(d._transformState.transforming)throw new Error("Calling transform done when still transforming");return d.push(null)}},{"./_stream_duplex":214,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],218:[function(F,Q,j){(function(N,v){"use strict";var C=F("babel-runtime/core-js/object/define-property"),k=r(C),y=F("babel-runtime/core-js/symbol/has-instance"),m=r(y),S=F("babel-runtime/core-js/symbol"),b=r(S),p=F("babel-runtime/core-js/object/create"),d=r(p),t=F("babel-runtime/core-js/set-immediate"),l=r(t);function r(he){return he&&he.__esModule?he:{default:he}}var i=F("process-nextick-args");Q.exports=M;function o(he,ue,ie){this.chunk=he,this.encoding=ue,this.callback=ie,this.next=null}function s(he){var ue=this;this.next=null,this.entry=null,this.finish=function(){Te(ue,he)}}var c=!N.browser&&["v0.10","v0.9."].indexOf(N.version.slice(0,5))>-1?l.default:i.nextTick,a;M.WritableState=E;var u=(0,d.default)(F("core-util-is"));u.inherits=F("inherits");var f={deprecate:F("util-deprecate")},w=F("./internal/streams/stream"),_=F("safe-buffer").Buffer,h=v.Uint8Array||function(){};function R(he){return _.from(he)}function O(he){return _.isBuffer(he)||he instanceof h}var g=F("./internal/streams/destroy");u.inherits(M,w);function x(){}function E(he,ue){a=a||F("./_stream_duplex"),he=he||{};var ie=ue instanceof a;this.objectMode=!!he.objectMode,ie&&(this.objectMode=this.objectMode||!!he.writableObjectMode);var Se=he.highWaterMark,ne=he.writableHighWaterMark,ce=this.objectMode?16:16*1024;Se||Se===0?this.highWaterMark=Se:ie&&(ne||ne===0)?this.highWaterMark=ne:this.highWaterMark=ce,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 Oe=he.decodeStrings===!1;this.decodeStrings=!Oe,this.defaultEncoding=he.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(oe){P(ue,oe)},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 s(this)}E.prototype.getBuffer=function(){for(var ue=this.bufferedRequest,ie=[];ue;)ie.push(ue),ue=ue.next;return ie},function(){try{Object.defineProperty(E.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(he){}}();var T;typeof b.default=="function"&&m.default&&typeof Function.prototype[m.default]=="function"?(T=Function.prototype[m.default],(0,k.default)(M,m.default,{value:function(ue){return T.call(this,ue)?!0:this!==M?!1:ue&&ue._writableState instanceof E}})):T=function(ue){return ue instanceof this};function M(he){if(a=a||F("./_stream_duplex"),!T.call(M,this)&&!(this instanceof a))return new M(he);this._writableState=new E(he,this),this.writable=!0,he&&(typeof he.write=="function"&&(this._write=he.write),typeof he.writev=="function"&&(this._writev=he.writev),typeof he.destroy=="function"&&(this._destroy=he.destroy),typeof he.final=="function"&&(this._final=he.final)),w.call(this)}M.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function L(he,ue){var ie=new Error("write after end");he.emit("error",ie),i.nextTick(ue,ie)}function A(he,ue,ie,Se){var ne=!0,ce=!1;return ie===null?ce=new TypeError("May not write null values to stream"):typeof ie!="string"&&ie!==void 0&&!ue.objectMode&&(ce=new TypeError("Invalid non-string/buffer chunk")),ce&&(he.emit("error",ce),i.nextTick(Se,ce),ne=!1),ne}M.prototype.write=function(he,ue,ie){var Se=this._writableState,ne=!1,ce=!Se.objectMode&&O(he);return ce&&!_.isBuffer(he)&&(he=R(he)),typeof ue=="function"&&(ie=ue,ue=null),ce?ue="buffer":ue||(ue=Se.defaultEncoding),typeof ie!="function"&&(ie=x),Se.ended?L(this,ie):(ce||A(this,Se,he,ie))&&(Se.pendingcb++,ne=z(this,Se,ce,he,ue,ie)),ne},M.prototype.cork=function(){var he=this._writableState;he.corked++},M.prototype.uncork=function(){var he=this._writableState;he.corked&&(he.corked--,!he.writing&&!he.corked&&!he.finished&&!he.bufferProcessing&&he.bufferedRequest&&re(this,he))},M.prototype.setDefaultEncoding=function(ue){if(typeof ue=="string"&&(ue=ue.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ue+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+ue);return this._writableState.defaultEncoding=ue,this};function V(he,ue,ie){return!he.objectMode&&he.decodeStrings!==!1&&typeof ue=="string"&&(ue=_.from(ue,ie)),ue}Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function z(he,ue,ie,Se,ne,ce){if(!ie){var Oe=V(ue,Se,ne);Se!==Oe&&(ie=!0,ne="buffer",Se=Oe)}var oe=ue.objectMode?1:Se.length;ue.length+=oe;var q=ue.length<ue.highWaterMark;if(q||(ue.needDrain=!0),ue.writing||ue.corked){var Y=ue.lastBufferedRequest;ue.lastBufferedRequest={chunk:Se,encoding:ne,isBuf:ie,callback:ce,next:null},Y?Y.next=ue.lastBufferedRequest:ue.bufferedRequest=ue.lastBufferedRequest,ue.bufferedRequestCount+=1}else W(he,ue,!1,oe,Se,ne,ce);return q}function W(he,ue,ie,Se,ne,ce,Oe){ue.writelen=Se,ue.writecb=Oe,ue.writing=!0,ue.sync=!0,ie?he._writev(ne,ue.onwrite):he._write(ne,ce,ue.onwrite),ue.sync=!1}function G(he,ue,ie,Se,ne){--ue.pendingcb,ie?(i.nextTick(ne,Se),i.nextTick(de,he,ue),he._writableState.errorEmitted=!0,he.emit("error",Se)):(ne(Se),he._writableState.errorEmitted=!0,he.emit("error",Se),de(he,ue))}function U(he){he.writing=!1,he.writecb=null,he.length-=he.writelen,he.writelen=0}function P(he,ue){var ie=he._writableState,Se=ie.sync,ne=ie.writecb;if(U(ie),ue)G(he,ie,Se,ue,ne);else{var ce=te(ie);!ce&&!ie.corked&&!ie.bufferProcessing&&ie.bufferedRequest&&re(he,ie),Se?c(H,he,ie,ce,ne):H(he,ie,ce,ne)}}function H(he,ue,ie,Se){ie||$(he,ue),ue.pendingcb--,Se(),de(he,ue)}function $(he,ue){ue.length===0&&ue.needDrain&&(ue.needDrain=!1,he.emit("drain"))}function re(he,ue){ue.bufferProcessing=!0;var ie=ue.bufferedRequest;if(he._writev&&ie&&ie.next){var Se=ue.bufferedRequestCount,ne=new Array(Se),ce=ue.corkedRequestsFree;ce.entry=ie;for(var Oe=0,oe=!0;ie;)ne[Oe]=ie,ie.isBuf||(oe=!1),ie=ie.next,Oe+=1;ne.allBuffers=oe,W(he,ue,!0,ue.length,ne,"",ce.finish),ue.pendingcb++,ue.lastBufferedRequest=null,ce.next?(ue.corkedRequestsFree=ce.next,ce.next=null):ue.corkedRequestsFree=new s(ue),ue.bufferedRequestCount=0}else{for(;ie;){var q=ie.chunk,Y=ie.encoding,Z=ie.callback,ye=ue.objectMode?1:q.length;if(W(he,ue,!1,ye,q,Y,Z),ie=ie.next,ue.bufferedRequestCount--,ue.writing)break}ie===null&&(ue.lastBufferedRequest=null)}ue.bufferedRequest=ie,ue.bufferProcessing=!1}M.prototype._write=function(he,ue,ie){ie(new Error("_write() is not implemented"))},M.prototype._writev=null,M.prototype.end=function(he,ue,ie){var Se=this._writableState;typeof he=="function"?(ie=he,he=null,ue=null):typeof ue=="function"&&(ie=ue,ue=null),he!=null&&this.write(he,ue),Se.corked&&(Se.corked=1,this.uncork()),!Se.ending&&!Se.finished&&De(this,Se,ie)};function te(he){return he.ending&&he.length===0&&he.bufferedRequest===null&&!he.finished&&!he.writing}function ge(he,ue){he._final(function(ie){ue.pendingcb--,ie&&he.emit("error",ie),ue.prefinished=!0,he.emit("prefinish"),de(he,ue)})}function ve(he,ue){!ue.prefinished&&!ue.finalCalled&&(typeof he._final=="function"?(ue.pendingcb++,ue.finalCalled=!0,i.nextTick(ge,he,ue)):(ue.prefinished=!0,he.emit("prefinish")))}function de(he,ue){var ie=te(ue);return ie&&(ve(he,ue),ue.pendingcb===0&&(ue.finished=!0,he.emit("finish"))),ie}function De(he,ue,ie){ue.ending=!0,de(he,ue),ie&&(ue.finished?i.nextTick(ie):he.once("finish",ie)),ue.ended=!0,he.writable=!1}function Te(he,ue,ie){var Se=he.entry;for(he.entry=null;Se;){var ne=Se.callback;ue.pendingcb--,ne(ie),Se=Se.next}ue.corkedRequestsFree?ue.corkedRequestsFree.next=he:ue.corkedRequestsFree=he}Object.defineProperty(M.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ue){if(!this._writableState)return;this._writableState.destroyed=ue}}),M.prototype.destroy=g.destroy,M.prototype._undestroy=g.undestroy,M.prototype._destroy=function(he,ue){this.end(),ue(he)}}).call(this,F("_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(F,Q,j){"use strict";function N(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}var v=F("safe-buffer").Buffer,C=F("util");function k(y,m,S){y.copy(m,S)}Q.exports=function(){function y(){N(this,y),this.head=null,this.tail=null,this.length=0}return y.prototype.push=function(S){var b={data:S,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length},y.prototype.unshift=function(S){var b={data:S,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length},y.prototype.shift=function(){if(this.length===0)return;var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S},y.prototype.clear=function(){this.head=this.tail=null,this.length=0},y.prototype.join=function(S){if(this.length===0)return"";for(var b=this.head,p=""+b.data;b=b.next;)p+=S+b.data;return p},y.prototype.concat=function(S){if(this.length===0)return v.alloc(0);if(this.length===1)return this.head.data;for(var b=v.allocUnsafe(S>>>0),p=this.head,d=0;p;)k(p.data,b,d),d+=p.data.length,p=p.next;return b},y}(),C&&C.inspect&&C.inspect.custom&&(Q.exports.prototype[C.inspect.custom]=function(){var y=C.inspect({length:this.length});return this.constructor.name+" "+y})},{"safe-buffer":228,util:71}],220:[function(F,Q,j){"use strict";var N=F("process-nextick-args");function v(y,m){var S=this,b=this._readableState&&this._readableState.destroyed,p=this._writableState&&this._writableState.destroyed;return b||p?(m?m(y):y&&(!this._writableState||!this._writableState.errorEmitted)&&N.nextTick(k,this,y),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(y||null,function(d){!m&&d?(N.nextTick(k,S,d),S._writableState&&(S._writableState.errorEmitted=!0)):m&&m(d)}),this)}function C(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function k(y,m){y.emit("error",m)}Q.exports={destroy:v,undestroy:C}},{"process-nextick-args":207}],221:[function(F,Q,j){"use strict";Q.exports=F("events").EventEmitter},{events:192}],222:[function(F,Q,j){Q.exports=F("./readable").PassThrough},{"./readable":223}],223:[function(F,Q,j){j=Q.exports=F("./lib/_stream_readable.js"),j.Stream=j,j.Readable=j,j.Writable=F("./lib/_stream_writable.js"),j.Duplex=F("./lib/_stream_duplex.js"),j.Transform=F("./lib/_stream_transform.js"),j.PassThrough=F("./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(F,Q,j){Q.exports=F("./readable").Transform},{"./readable":223}],225:[function(F,Q,j){Q.exports=F("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":218}],226:[function(F,Q,j){var N=function(){return this}()||Function("return this")(),v=N.regeneratorRuntime&&Object.getOwnPropertyNames(N).indexOf("regeneratorRuntime")>=0,C=v&&N.regeneratorRuntime;if(N.regeneratorRuntime=void 0,Q.exports=F("./runtime"),v)N.regeneratorRuntime=C;else try{delete N.regeneratorRuntime}catch(k){N.regeneratorRuntime=void 0}},{"./runtime":227}],227:[function(F,Q,j){!function(N){"use strict";var v=Object.prototype,C=v.hasOwnProperty,k,y=typeof Symbol=="function"?Symbol:{},m=y.iterator||"@@iterator",S=y.asyncIterator||"@@asyncIterator",b=y.toStringTag||"@@toStringTag",p=typeof Q=="object",d=N.regeneratorRuntime;if(d){p&&(Q.exports=d);return}d=N.regeneratorRuntime=p?Q.exports:{};function t(z,W,G,U){var P=W&&W.prototype instanceof a?W:a,H=Object.create(P.prototype),$=new L(U||[]);return H._invoke=x(z,G,$),H}d.wrap=t;function l(z,W,G){try{return{type:"normal",arg:z.call(W,G)}}catch(U){return{type:"throw",arg:U}}}var r="suspendedStart",i="suspendedYield",o="executing",s="completed",c={};function a(){}function u(){}function f(){}var w={};w[m]=function(){return this};var _=Object.getPrototypeOf,h=_&&_(_(A([])));h&&h!==v&&C.call(h,m)&&(w=h);var R=f.prototype=a.prototype=Object.create(w);u.prototype=R.constructor=f,f.constructor=u,f[b]=u.displayName="GeneratorFunction";function O(z){["next","throw","return"].forEach(function(W){z[W]=function(G){return this._invoke(W,G)}})}d.isGeneratorFunction=function(z){var W=typeof z=="function"&&z.constructor;return W?W===u||(W.displayName||W.name)==="GeneratorFunction":!1},d.mark=function(z){return Object.setPrototypeOf?Object.setPrototypeOf(z,f):(z.__proto__=f,b in z||(z[b]="GeneratorFunction")),z.prototype=Object.create(R),z},d.awrap=function(z){return{__await:z}};function g(z){function W(P,H,$,re){var te=l(z[P],z,H);if(te.type==="throw")re(te.arg);else{var ge=te.arg,ve=ge.value;return ve&&typeof ve=="object"&&C.call(ve,"__await")?Promise.resolve(ve.__await).then(function(de){W("next",de,$,re)},function(de){W("throw",de,$,re)}):Promise.resolve(ve).then(function(de){ge.value=de,$(ge)},re)}}var G;function U(P,H){function $(){return new Promise(function(re,te){W(P,H,re,te)})}return G=G?G.then($,$):$()}this._invoke=U}O(g.prototype),g.prototype[S]=function(){return this},d.AsyncIterator=g,d.async=function(z,W,G,U){var P=new g(t(z,W,G,U));return d.isGeneratorFunction(W)?P:P.next().then(function(H){return H.done?H.value:P.next()})};function x(z,W,G){var U=r;return function(H,$){if(U===o)throw new Error("Generator is already running");if(U===s){if(H==="throw")throw $;return V()}for(G.method=H,G.arg=$;;){var re=G.delegate;if(re){var te=E(re,G);if(te){if(te===c)continue;return te}}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(U===r)throw U=s,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);U=o;var ge=l(z,W,G);if(ge.type==="normal"){if(U=G.done?s:i,ge.arg===c)continue;return{value:ge.arg,done:G.done}}else ge.type==="throw"&&(U=s,G.method="throw",G.arg=ge.arg)}}}function E(z,W){var G=z.iterator[W.method];if(G===k){if(W.delegate=null,W.method==="throw"){if(z.iterator.return&&(W.method="return",W.arg=k,E(z,W),W.method==="throw"))return c;W.method="throw",W.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var U=l(G,z.iterator,W.arg);if(U.type==="throw")return W.method="throw",W.arg=U.arg,W.delegate=null,c;var P=U.arg;if(!P)return W.method="throw",W.arg=new TypeError("iterator result is not an object"),W.delegate=null,c;if(P.done)W[z.resultName]=P.value,W.next=z.nextLoc,W.method!=="return"&&(W.method="next",W.arg=k);else return P;return W.delegate=null,c}O(R),R[b]="Generator",R[m]=function(){return this},R.toString=function(){return"[object Generator]"};function T(z){var W={tryLoc:z[0]};1 in z&&(W.catchLoc=z[1]),2 in z&&(W.finallyLoc=z[2],W.afterLoc=z[3]),this.tryEntries.push(W)}function M(z){var W=z.completion||{};W.type="normal",delete W.arg,z.completion=W}function L(z){this.tryEntries=[{tryLoc:"root"}],z.forEach(T,this),this.reset(!0)}d.keys=function(z){var W=[];for(var G in z)W.push(G);return W.reverse(),function U(){for(;W.length;){var P=W.pop();if(P in z)return U.value=P,U.done=!1,U}return U.done=!0,U}};function A(z){if(z){var W=z[m];if(W)return W.call(z);if(typeof z.next=="function")return z;if(!isNaN(z.length)){var G=-1,U=function P(){for(;++G<z.length;)if(C.call(z,G))return P.value=z[G],P.done=!1,P;return P.value=k,P.done=!0,P};return U.next=U}}return{next:V}}d.values=A;function V(){return{value:k,done:!0}}L.prototype={constructor:L,reset:function(z){if(this.prev=0,this.next=0,this.sent=this._sent=k,this.done=!1,this.delegate=null,this.method="next",this.arg=k,this.tryEntries.forEach(M),!z)for(var W in this)W.charAt(0)==="t"&&C.call(this,W)&&!isNaN(+W.slice(1))&&(this[W]=k)},stop:function(){this.done=!0;var z=this.tryEntries[0],W=z.completion;if(W.type==="throw")throw W.arg;return this.rval},dispatchException:function(z){if(this.done)throw z;var W=this;function G(te,ge){return H.type="throw",H.arg=z,W.next=te,ge&&(W.method="next",W.arg=k),!!ge}for(var U=this.tryEntries.length-1;U>=0;--U){var P=this.tryEntries[U],H=P.completion;if(P.tryLoc==="root")return G("end");if(P.tryLoc<=this.prev){var $=C.call(P,"catchLoc"),re=C.call(P,"finallyLoc");if($&&re){if(this.prev<P.catchLoc)return G(P.catchLoc,!0);if(this.prev<P.finallyLoc)return G(P.finallyLoc)}else if($){if(this.prev<P.catchLoc)return G(P.catchLoc,!0)}else if(re){if(this.prev<P.finallyLoc)return G(P.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(z,W){for(var G=this.tryEntries.length-1;G>=0;--G){var U=this.tryEntries[G];if(U.tryLoc<=this.prev&&C.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var P=U;break}}P&&(z==="break"||z==="continue")&&P.tryLoc<=W&&W<=P.finallyLoc&&(P=null);var H=P?P.completion:{};return H.type=z,H.arg=W,P?(this.method="next",this.next=P.finallyLoc,c):this.complete(H)},complete:function(z,W){if(z.type==="throw")throw z.arg;return z.type==="break"||z.type==="continue"?this.next=z.arg:z.type==="return"?(this.rval=this.arg=z.arg,this.method="return",this.next="end"):z.type==="normal"&&W&&(this.next=W),c},finish:function(z){for(var W=this.tryEntries.length-1;W>=0;--W){var G=this.tryEntries[W];if(G.finallyLoc===z)return this.complete(G.completion,G.afterLoc),M(G),c}},catch:function(z){for(var W=this.tryEntries.length-1;W>=0;--W){var G=this.tryEntries[W];if(G.tryLoc===z){var U=G.completion;if(U.type==="throw"){var P=U.arg;M(G)}return P}}throw new Error("illegal catch attempt")},delegateYield:function(z,W,G){return this.delegate={iterator:A(z),resultName:W,nextLoc:G},this.method==="next"&&(this.arg=k),c}}}(function(){return this}()||Function("return this")())},{}],228:[function(F,Q,j){var N=F("buffer"),v=N.Buffer;function C(y,m){for(var S in y)m[S]=y[S]}v.from&&v.alloc&&v.allocUnsafe&&v.allocUnsafeSlow?Q.exports=N:(C(N,j),j.Buffer=k);function k(y,m,S){return v(y,m,S)}C(v,k),k.from=function(y,m,S){if(typeof y=="number")throw new TypeError("Argument must not be a number");return v(y,m,S)},k.alloc=function(y,m,S){if(typeof y!="number")throw new TypeError("Argument must be a number");var b=v(y);return m!==void 0?typeof S=="string"?b.fill(m,S):b.fill(m):b.fill(0),b},k.allocUnsafe=function(y){if(typeof y!="number")throw new TypeError("Argument must be a number");return v(y)},k.allocUnsafeSlow=function(y){if(typeof y!="number")throw new TypeError("Argument must be a number");return N.SlowBuffer(y)}},{buffer:73}],229:[function(F,Q,j){(function(N){"use strict";var v=F("babel-runtime/core-js/string/from-code-point"),C=i(v),k=F("babel-runtime/core-js/json/stringify"),y=i(k),m=F("babel-runtime/helpers/typeof"),S=i(m),b=F("babel-runtime/core-js/object/define-property"),p=i(b),d=F("babel-runtime/core-js/object/keys"),t=i(d),l=F("babel-runtime/core-js/object/create"),r=i(l);function i(o){return o&&o.__esModule?o:{default:o}}(function(o){o.parser=function(Y,Z){return new c(Y,Z)},o.SAXParser=c,o.SAXStream=R,o.createStream=h,o.MAX_BUFFER_LENGTH=64*1024;var s=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];o.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function c(Y,Z){if(!(this instanceof c))return new c(Y,Z);var ye=this;u(ye),ye.q=ye.c="",ye.bufferCheckPosition=o.MAX_BUFFER_LENGTH,ye.opt=Z||{},ye.opt.lowercase=ye.opt.lowercase||ye.opt.lowercasetags,ye.looseCase=ye.opt.lowercase?"toLowerCase":"toUpperCase",ye.tags=[],ye.closed=ye.closedRoot=ye.sawRoot=!1,ye.tag=ye.error=null,ye.strict=!!Y,ye.noscript=!!(Y||ye.opt.noscript),ye.state=H.BEGIN,ye.strictEntities=ye.opt.strictEntities,ye.ENTITIES=ye.strictEntities?(0,r.default)(o.XML_ENTITIES):(0,r.default)(o.ENTITIES),ye.attribList=[],ye.opt.xmlns&&(ye.ns=(0,r.default)(T)),ye.trackPosition=ye.opt.position!==!1,ye.trackPosition&&(ye.position=ye.line=ye.column=0),re(ye,"onready")}r.default||(Object.create=function(Y){function Z(){}Z.prototype=Y;var ye=new Z;return ye}),t.default||(Object.keys=function(Y){var Z=[];for(var ye in Y)Y.hasOwnProperty(ye)&&Z.push(ye);return Z});function a(Y){for(var Z=Math.max(o.MAX_BUFFER_LENGTH,10),ye=0,be=0,Re=s.length;be<Re;be++){var Qe=Y[s[be]].length;if(Qe>Z)switch(s[be]){case"textNode":ge(Y);break;case"cdata":te(Y,"oncdata",Y.cdata),Y.cdata="";break;case"script":te(Y,"onscript",Y.script),Y.script="";break;default:de(Y,"Max buffer length exceeded: "+s[be])}ye=Math.max(ye,Qe)}var rt=o.MAX_BUFFER_LENGTH-ye;Y.bufferCheckPosition=rt+Y.position}function u(Y){for(var Z=0,ye=s.length;Z<ye;Z++)Y[s[Z]]=""}function f(Y){ge(Y),Y.cdata!==""&&(te(Y,"oncdata",Y.cdata),Y.cdata=""),Y.script!==""&&(te(Y,"onscript",Y.script),Y.script="")}c.prototype={end:function(){De(this)},write:q,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){f(this)}};var w;try{w=F("stream").Stream}catch(Y){w=function(){}}var _=o.EVENTS.filter(function(Y){return Y!=="error"&&Y!=="end"});function h(Y,Z){return new R(Y,Z)}function R(Y,Z){if(!(this instanceof R))return new R(Y,Z);w.apply(this),this._parser=new c(Y,Z),this.writable=!0,this.readable=!0;var ye=this;this._parser.onend=function(){ye.emit("end")},this._parser.onerror=function(be){ye.emit("error",be),ye._parser.error=null},this._decoder=null,_.forEach(function(be){(0,p.default)(ye,"on"+be,{get:function(){return ye._parser["on"+be]},set:function(Qe){if(!Qe)return ye.removeAllListeners(be),ye._parser["on"+be]=Qe,Qe;ye.on(be,Qe)},enumerable:!0,configurable:!1})})}R.prototype=(0,r.default)(w.prototype,{constructor:{value:R}}),R.prototype.write=function(Y){if(typeof N=="function"&&typeof N.isBuffer=="function"&&N.isBuffer(Y)){if(!this._decoder){var Z=F("string_decoder").StringDecoder;this._decoder=new Z("utf8")}Y=this._decoder.write(Y)}return this._parser.write(Y.toString()),this.emit("data",Y),!0},R.prototype.end=function(Y){return Y&&Y.length&&this.write(Y),this._parser.end(),!0},R.prototype.on=function(Y,Z){var ye=this;return!ye._parser["on"+Y]&&_.indexOf(Y)!==-1&&(ye._parser["on"+Y]=function(){var be=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);be.splice(0,0,Y),ye.emit.apply(ye,be)}),w.prototype.on.call(ye,Y,Z)};var O="[CDATA[",g="DOCTYPE",x="http://www.w3.org/XML/1998/namespace",E="http://www.w3.org/2000/xmlns/",T={xml:x,xmlns:E},M=/[:_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]/,L=/[:_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-]/,A=/[#:_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]/,V=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function z(Y){return Y===" "||Y===`
|
|
|
`||Y==="\r"||Y===" "}function W(Y){return Y==='"'||Y==="'"}function G(Y){return Y===">"||z(Y)}function U(Y,Z){return Y.test(Z)}function P(Y,Z){return!U(Y,Z)}var H=0;o.STATE={BEGIN:H++,BEGIN_WHITESPACE:H++,TEXT:H++,TEXT_ENTITY:H++,OPEN_WAKA:H++,SGML_DECL:H++,SGML_DECL_QUOTED:H++,DOCTYPE:H++,DOCTYPE_QUOTED:H++,DOCTYPE_DTD:H++,DOCTYPE_DTD_QUOTED:H++,COMMENT_STARTING:H++,COMMENT:H++,COMMENT_ENDING:H++,COMMENT_ENDED:H++,CDATA:H++,CDATA_ENDING:H++,CDATA_ENDING_2:H++,PROC_INST:H++,PROC_INST_BODY:H++,PROC_INST_ENDING:H++,OPEN_TAG:H++,OPEN_TAG_SLASH:H++,ATTRIB:H++,ATTRIB_NAME:H++,ATTRIB_NAME_SAW_WHITE:H++,ATTRIB_VALUE:H++,ATTRIB_VALUE_QUOTED:H++,ATTRIB_VALUE_CLOSED:H++,ATTRIB_VALUE_UNQUOTED:H++,ATTRIB_VALUE_ENTITY_Q:H++,ATTRIB_VALUE_ENTITY_U:H++,CLOSE_TAG:H++,CLOSE_TAG_SAW_WHITE:H++,SCRIPT:H++,SCRIPT_ENDING:H++},o.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},o.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,t.default)(o.ENTITIES).forEach(function(Y){var Z=o.ENTITIES[Y],ye=typeof Z=="number"?String.fromCharCode(Z):Z;o.ENTITIES[Y]=ye});for(var $ in o.STATE)o.STATE[o.STATE[$]]=$;H=o.STATE;function re(Y,Z,ye){Y[Z]&&Y[Z](ye)}function te(Y,Z,ye){Y.textNode&&ge(Y),re(Y,Z,ye)}function ge(Y){Y.textNode=ve(Y.opt,Y.textNode),Y.textNode&&re(Y,"ontext",Y.textNode),Y.textNode=""}function ve(Y,Z){return Y.trim&&(Z=Z.trim()),Y.normalize&&(Z=Z.replace(/\s+/g," ")),Z}function de(Y,Z){return ge(Y),Y.trackPosition&&(Z+=`
|
|
|
Line: `+Y.line+`
|
|
|
Column: `+Y.column+`
|
|
|
Char: `+Y.c),Z=new Error(Z),Y.error=Z,re(Y,"onerror",Z),Y}function De(Y){return Y.sawRoot&&!Y.closedRoot&&Te(Y,"Unclosed root tag"),Y.state!==H.BEGIN&&Y.state!==H.BEGIN_WHITESPACE&&Y.state!==H.TEXT&&de(Y,"Unexpected end"),ge(Y),Y.c="",Y.closed=!0,re(Y,"onend"),c.call(Y,Y.strict,Y.opt),Y}function Te(Y,Z){if((typeof Y=="undefined"?"undefined":(0,S.default)(Y))!=="object"||!(Y instanceof c))throw new Error("bad call to strictFail");Y.strict&&de(Y,Z)}function he(Y){Y.strict||(Y.tagName=Y.tagName[Y.looseCase]());var Z=Y.tags[Y.tags.length-1]||Y,ye=Y.tag={name:Y.tagName,attributes:{}};Y.opt.xmlns&&(ye.ns=Z.ns),Y.attribList.length=0,te(Y,"onopentagstart",ye)}function ue(Y,Z){var ye=Y.indexOf(":"),be=ye<0?["",Y]:Y.split(":"),Re=be[0],Qe=be[1];return Z&&Y==="xmlns"&&(Re="xmlns",Qe=""),{prefix:Re,local:Qe}}function ie(Y){if(Y.strict||(Y.attribName=Y.attribName[Y.looseCase]()),Y.attribList.indexOf(Y.attribName)!==-1||Y.tag.attributes.hasOwnProperty(Y.attribName)){Y.attribName=Y.attribValue="";return}if(Y.opt.xmlns){var Z=ue(Y.attribName,!0),ye=Z.prefix,be=Z.local;if(ye==="xmlns")if(be==="xml"&&Y.attribValue!==x)Te(Y,"xml: prefix must be bound to "+x+`
|
|
|
Actual: `+Y.attribValue);else if(be==="xmlns"&&Y.attribValue!==E)Te(Y,"xmlns: prefix must be bound to "+E+`
|
|
|
Actual: `+Y.attribValue);else{var Re=Y.tag,Qe=Y.tags[Y.tags.length-1]||Y;Re.ns===Qe.ns&&(Re.ns=(0,r.default)(Qe.ns)),Re.ns[be]=Y.attribValue}Y.attribList.push([Y.attribName,Y.attribValue])}else Y.tag.attributes[Y.attribName]=Y.attribValue,te(Y,"onattribute",{name:Y.attribName,value:Y.attribValue});Y.attribName=Y.attribValue=""}function Se(Y,Z){if(Y.opt.xmlns){var ye=Y.tag,be=ue(Y.tagName);ye.prefix=be.prefix,ye.local=be.local,ye.uri=ye.ns[be.prefix]||"",ye.prefix&&!ye.uri&&(Te(Y,"Unbound namespace prefix: "+(0,y.default)(Y.tagName)),ye.uri=be.prefix);var Re=Y.tags[Y.tags.length-1]||Y;ye.ns&&Re.ns!==ye.ns&&(0,t.default)(ye.ns).forEach(function(ze){te(Y,"onopennamespace",{prefix:ze,uri:ye.ns[ze]})});for(var Qe=0,rt=Y.attribList.length;Qe<rt;Qe++){var at=Y.attribList[Qe],qe=at[0],st=at[1],lt=ue(qe,!0),je=lt.prefix,Ie=lt.local,tt=je===""?"":ye.ns[je]||"",ot={name:qe,value:st,prefix:je,local:Ie,uri:tt};je&&je!=="xmlns"&&!tt&&(Te(Y,"Unbound namespace prefix: "+(0,y.default)(je)),ot.uri=je),Y.tag.attributes[qe]=ot,te(Y,"onattribute",ot)}Y.attribList.length=0}Y.tag.isSelfClosing=!!Z,Y.sawRoot=!0,Y.tags.push(Y.tag),te(Y,"onopentag",Y.tag),Z||(!Y.noscript&&Y.tagName.toLowerCase()==="script"?Y.state=H.SCRIPT:Y.state=H.TEXT,Y.tag=null,Y.tagName=""),Y.attribName=Y.attribValue="",Y.attribList.length=0}function ne(Y){if(!Y.tagName){Te(Y,"Weird empty close tag."),Y.textNode+="</>",Y.state=H.TEXT;return}if(Y.script){if(Y.tagName!=="script"){Y.script+="</"+Y.tagName+">",Y.tagName="",Y.state=H.SCRIPT;return}te(Y,"onscript",Y.script),Y.script=""}var Z=Y.tags.length,ye=Y.tagName;Y.strict||(ye=ye[Y.looseCase]());for(var be=ye;Z--;){var Re=Y.tags[Z];if(Re.name!==be)Te(Y,"Unexpected close tag");else break}if(Z<0){Te(Y,"Unmatched closing tag: "+Y.tagName),Y.textNode+="</"+Y.tagName+">",Y.state=H.TEXT;return}Y.tagName=ye;for(var Qe=Y.tags.length;Qe-- >Z;){var rt=Y.tag=Y.tags.pop();Y.tagName=Y.tag.name,te(Y,"onclosetag",Y.tagName);var at={};for(var qe in rt.ns)at[qe]=rt.ns[qe];var st=Y.tags[Y.tags.length-1]||Y;Y.opt.xmlns&&rt.ns!==st.ns&&(0,t.default)(rt.ns).forEach(function(lt){var je=rt.ns[lt];te(Y,"onclosenamespace",{prefix:lt,uri:je})})}Z===0&&(Y.closedRoot=!0),Y.tagName=Y.attribValue=Y.attribName="",Y.attribList.length=0,Y.state=H.TEXT}function ce(Y){var Z=Y.entity,ye=Z.toLowerCase(),be,Re="";return Y.ENTITIES[Z]?Y.ENTITIES[Z]:Y.ENTITIES[ye]?Y.ENTITIES[ye]:(Z=ye,Z.charAt(0)==="#"&&(Z.charAt(1)==="x"?(Z=Z.slice(2),be=parseInt(Z,16),Re=be.toString(16)):(Z=Z.slice(1),be=parseInt(Z,10),Re=be.toString(10))),Z=Z.replace(/^0+/,""),isNaN(be)||Re.toLowerCase()!==Z?(Te(Y,"Invalid character entity"),"&"+Y.entity+";"):(0,C.default)(be))}function Oe(Y,Z){Z==="<"?(Y.state=H.OPEN_WAKA,Y.startTagPosition=Y.position):z(Z)||(Te(Y,"Non-whitespace before first tag."),Y.textNode=Z,Y.state=H.TEXT)}function oe(Y,Z){var ye="";return Z<Y.length&&(ye=Y.charAt(Z)),ye}function q(Y){var Z=this;if(this.error)throw this.error;if(Z.closed)return de(Z,"Cannot write after close. Assign an onready handler.");if(Y===null)return De(Z);(typeof Y=="undefined"?"undefined":(0,S.default)(Y))==="object"&&(Y=Y.toString());for(var ye=0,be="";!(be=oe(Y,ye++),Z.c=be,!be);){Z.trackPosition&&(Z.position++,be===`
|
|
|
`?(Z.line++,Z.column=0):Z.column++);switch(Z.state){case H.BEGIN:if(Z.state=H.BEGIN_WHITESPACE,be==="\uFEFF")continue;Oe(Z,be);continue;case H.BEGIN_WHITESPACE:Oe(Z,be);continue;case H.TEXT:if(Z.sawRoot&&!Z.closedRoot){for(var Re=ye-1;be&&be!=="<"&&be!=="&";)be=oe(Y,ye++),be&&Z.trackPosition&&(Z.position++,be===`
|
|
|
`?(Z.line++,Z.column=0):Z.column++);Z.textNode+=Y.substring(Re,ye-1)}be==="<"&&!(Z.sawRoot&&Z.closedRoot&&!Z.strict)?(Z.state=H.OPEN_WAKA,Z.startTagPosition=Z.position):(!z(be)&&(!Z.sawRoot||Z.closedRoot)&&Te(Z,"Text data outside of root node."),be==="&"?Z.state=H.TEXT_ENTITY:Z.textNode+=be);continue;case H.SCRIPT:be==="<"?Z.state=H.SCRIPT_ENDING:Z.script+=be;continue;case H.SCRIPT_ENDING:be==="/"?Z.state=H.CLOSE_TAG:(Z.script+="<"+be,Z.state=H.SCRIPT);continue;case H.OPEN_WAKA:if(be==="!")Z.state=H.SGML_DECL,Z.sgmlDecl="";else if(!z(be))if(U(M,be))Z.state=H.OPEN_TAG,Z.tagName=be;else if(be==="/")Z.state=H.CLOSE_TAG,Z.tagName="";else if(be==="?")Z.state=H.PROC_INST,Z.procInstName=Z.procInstBody="";else{if(Te(Z,"Unencoded <"),Z.startTagPosition+1<Z.position){var Qe=Z.position-Z.startTagPosition;be=new Array(Qe).join(" ")+be}Z.textNode+="<"+be,Z.state=H.TEXT}continue;case H.SGML_DECL:(Z.sgmlDecl+be).toUpperCase()===O?(te(Z,"onopencdata"),Z.state=H.CDATA,Z.sgmlDecl="",Z.cdata=""):Z.sgmlDecl+be==="--"?(Z.state=H.COMMENT,Z.comment="",Z.sgmlDecl=""):(Z.sgmlDecl+be).toUpperCase()===g?(Z.state=H.DOCTYPE,(Z.doctype||Z.sawRoot)&&Te(Z,"Inappropriately located doctype declaration"),Z.doctype="",Z.sgmlDecl=""):be===">"?(te(Z,"onsgmldeclaration",Z.sgmlDecl),Z.sgmlDecl="",Z.state=H.TEXT):(W(be)&&(Z.state=H.SGML_DECL_QUOTED),Z.sgmlDecl+=be);continue;case H.SGML_DECL_QUOTED:be===Z.q&&(Z.state=H.SGML_DECL,Z.q=""),Z.sgmlDecl+=be;continue;case H.DOCTYPE:be===">"?(Z.state=H.TEXT,te(Z,"ondoctype",Z.doctype),Z.doctype=!0):(Z.doctype+=be,be==="["?Z.state=H.DOCTYPE_DTD:W(be)&&(Z.state=H.DOCTYPE_QUOTED,Z.q=be));continue;case H.DOCTYPE_QUOTED:Z.doctype+=be,be===Z.q&&(Z.q="",Z.state=H.DOCTYPE);continue;case H.DOCTYPE_DTD:Z.doctype+=be,be==="]"?Z.state=H.DOCTYPE:W(be)&&(Z.state=H.DOCTYPE_DTD_QUOTED,Z.q=be);continue;case H.DOCTYPE_DTD_QUOTED:Z.doctype+=be,be===Z.q&&(Z.state=H.DOCTYPE_DTD,Z.q="");continue;case H.COMMENT:be==="-"?Z.state=H.COMMENT_ENDING:Z.comment+=be;continue;case H.COMMENT_ENDING:be==="-"?(Z.state=H.COMMENT_ENDED,Z.comment=ve(Z.opt,Z.comment),Z.comment&&te(Z,"oncomment",Z.comment),Z.comment=""):(Z.comment+="-"+be,Z.state=H.COMMENT);continue;case H.COMMENT_ENDED:be!==">"?(Te(Z,"Malformed comment"),Z.comment+="--"+be,Z.state=H.COMMENT):Z.state=H.TEXT;continue;case H.CDATA:be==="]"?Z.state=H.CDATA_ENDING:Z.cdata+=be;continue;case H.CDATA_ENDING:be==="]"?Z.state=H.CDATA_ENDING_2:(Z.cdata+="]"+be,Z.state=H.CDATA);continue;case H.CDATA_ENDING_2:be===">"?(Z.cdata&&te(Z,"oncdata",Z.cdata),te(Z,"onclosecdata"),Z.cdata="",Z.state=H.TEXT):be==="]"?Z.cdata+="]":(Z.cdata+="]]"+be,Z.state=H.CDATA);continue;case H.PROC_INST:be==="?"?Z.state=H.PROC_INST_ENDING:z(be)?Z.state=H.PROC_INST_BODY:Z.procInstName+=be;continue;case H.PROC_INST_BODY:if(!Z.procInstBody&&z(be))continue;be==="?"?Z.state=H.PROC_INST_ENDING:Z.procInstBody+=be;continue;case H.PROC_INST_ENDING:be===">"?(te(Z,"onprocessinginstruction",{name:Z.procInstName,body:Z.procInstBody}),Z.procInstName=Z.procInstBody="",Z.state=H.TEXT):(Z.procInstBody+="?"+be,Z.state=H.PROC_INST_BODY);continue;case H.OPEN_TAG:U(L,be)?Z.tagName+=be:(he(Z),be===">"?Se(Z):be==="/"?Z.state=H.OPEN_TAG_SLASH:(z(be)||Te(Z,"Invalid character in tag name"),Z.state=H.ATTRIB));continue;case H.OPEN_TAG_SLASH:be===">"?(Se(Z,!0),ne(Z)):(Te(Z,"Forward-slash in opening tag not followed by >"),Z.state=H.ATTRIB);continue;case H.ATTRIB:if(z(be))continue;be===">"?Se(Z):be==="/"?Z.state=H.OPEN_TAG_SLASH:U(M,be)?(Z.attribName=be,Z.attribValue="",Z.state=H.ATTRIB_NAME):Te(Z,"Invalid attribute name");continue;case H.ATTRIB_NAME:be==="="?Z.state=H.ATTRIB_VALUE:be===">"?(Te(Z,"Attribute without value"),Z.attribValue=Z.attribName,ie(Z),Se(Z)):z(be)?Z.state=H.ATTRIB_NAME_SAW_WHITE:U(L,be)?Z.attribName+=be:Te(Z,"Invalid attribute name");continue;case H.ATTRIB_NAME_SAW_WHITE:if(be==="=")Z.state=H.ATTRIB_VALUE;else{if(z(be))continue;Te(Z,"Attribute without value"),Z.tag.attributes[Z.attribName]="",Z.attribValue="",te(Z,"onattribute",{name:Z.attribName,value:""}),Z.attribName="",be===">"?Se(Z):U(M,be)?(Z.attribName=be,Z.state=H.ATTRIB_NAME):(Te(Z,"Invalid attribute name"),Z.state=H.ATTRIB)}continue;case H.ATTRIB_VALUE:if(z(be))continue;W(be)?(Z.q=be,Z.state=H.ATTRIB_VALUE_QUOTED):(Te(Z,"Unquoted attribute value"),Z.state=H.ATTRIB_VALUE_UNQUOTED,Z.attribValue=be);continue;case H.ATTRIB_VALUE_QUOTED:if(be!==Z.q){be==="&"?Z.state=H.ATTRIB_VALUE_ENTITY_Q:Z.attribValue+=be;continue}ie(Z),Z.q="",Z.state=H.ATTRIB_VALUE_CLOSED;continue;case H.ATTRIB_VALUE_CLOSED:z(be)?Z.state=H.ATTRIB:be===">"?Se(Z):be==="/"?Z.state=H.OPEN_TAG_SLASH:U(M,be)?(Te(Z,"No whitespace between attributes"),Z.attribName=be,Z.attribValue="",Z.state=H.ATTRIB_NAME):Te(Z,"Invalid attribute name");continue;case H.ATTRIB_VALUE_UNQUOTED:if(!G(be)){be==="&"?Z.state=H.ATTRIB_VALUE_ENTITY_U:Z.attribValue+=be;continue}ie(Z),be===">"?Se(Z):Z.state=H.ATTRIB;continue;case H.CLOSE_TAG:if(Z.tagName)be===">"?ne(Z):U(L,be)?Z.tagName+=be:Z.script?(Z.script+="</"+Z.tagName,Z.tagName="",Z.state=H.SCRIPT):(z(be)||Te(Z,"Invalid tagname in closing tag"),Z.state=H.CLOSE_TAG_SAW_WHITE);else{if(z(be))continue;P(M,be)?Z.script?(Z.script+="</"+be,Z.state=H.SCRIPT):Te(Z,"Invalid tagname in closing tag."):Z.tagName=be}continue;case H.CLOSE_TAG_SAW_WHITE:if(z(be))continue;be===">"?ne(Z):Te(Z,"Invalid characters in closing tag");continue;case H.TEXT_ENTITY:case H.ATTRIB_VALUE_ENTITY_Q:case H.ATTRIB_VALUE_ENTITY_U:var rt,at;switch(Z.state){case H.TEXT_ENTITY:rt=H.TEXT,at="textNode";break;case H.ATTRIB_VALUE_ENTITY_Q:rt=H.ATTRIB_VALUE_QUOTED,at="attribValue";break;case H.ATTRIB_VALUE_ENTITY_U:rt=H.ATTRIB_VALUE_UNQUOTED,at="attribValue";break}be===";"?(Z[at]+=ce(Z),Z.entity="",Z.state=rt):U(Z.entity.length?V:A,be)?Z.entity+=be:(Te(Z,"Invalid character in entity name"),Z[at]+="&"+Z.entity+be,Z.entity="",Z.state=rt);continue;default:throw new Error(Z,"Unknown state: "+Z.state)}}return Z.position>=Z.bufferCheckPosition&&a(Z),Z}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */C.default||function(){var Y=String.fromCharCode,Z=Math.floor,ye=function(){var Re=16384,Qe=[],rt,at,qe=-1,st=arguments.length;if(!st)return"";for(var lt="";++qe<st;){var je=Number(arguments[qe]);if(!isFinite(je)||je<0||je>1114111||Z(je)!==je)throw RangeError("Invalid code point: "+je);je<=65535?Qe.push(je):(je-=65536,rt=(je>>10)+55296,at=je%1024+56320,Qe.push(rt,at)),(qe+1===st||Qe.length>Re)&&(lt+=Y.apply(null,Qe),Qe.length=0)}return lt};p.default?Object.defineProperty(String,"fromCodePoint",{value:ye,configurable:!0,writable:!0}):String.fromCodePoint=ye}()})(typeof j=="undefined"?(void 0).sax={}:j)}).call(this,F("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(F,Q,j){Q.exports=C;var N=F("events").EventEmitter,v=F("inherits");v(C,N),C.Readable=F("readable-stream/readable.js"),C.Writable=F("readable-stream/writable.js"),C.Duplex=F("readable-stream/duplex.js"),C.Transform=F("readable-stream/transform.js"),C.PassThrough=F("readable-stream/passthrough.js"),C.Stream=C;function C(){N.call(this)}C.prototype.pipe=function(k,y){var m=this;function S(i){k.writable&&(k.write(i)===!1&&m.pause&&m.pause())}m.on("data",S);function b(){m.readable&&m.resume&&m.resume()}k.on("drain",b),!k._isStdio&&(!y||y.end!==!1)&&(m.on("end",d),m.on("close",t));var p=!1;function d(){if(p)return;p=!0,k.end()}function t(){if(p)return;p=!0,typeof k.destroy=="function"&&k.destroy()}function l(i){if(r(),N.listenerCount(this,"error")===0)throw i}m.on("error",l),k.on("error",l);function r(){m.removeListener("data",S),k.removeListener("drain",b),m.removeListener("end",d),m.removeListener("close",t),m.removeListener("error",l),k.removeListener("error",l),m.removeListener("end",r),m.removeListener("close",r),k.removeListener("close",r)}return m.on("end",r),m.on("close",r),k.on("close",r),k.emit("pipe",m),k}},{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(F,Q,j){(function(N){var v=F("./lib/request"),C=F("./lib/response"),k=F("xtend"),y=F("builtin-status-codes"),m=F("url"),S=j;S.request=function(b,p){typeof b=="string"?b=m.parse(b):b=k(b);var d=N.location.protocol.search(/^https?:$/)===-1?"http:":"",t=b.protocol||d,l=b.hostname||b.host,r=b.port,i=b.path||"/";l&&l.indexOf(":")!==-1&&(l="["+l+"]"),b.url=(l?t+"//"+l:"")+(r?":"+r:"")+i,b.method=(b.method||"GET").toUpperCase(),b.headers=b.headers||{};var o=new v(b);return p&&o.on("response",p),o},S.get=function(p,d){var t=S.request(p,d);return t.end(),t},S.ClientRequest=v,S.IncomingMessage=C.IncomingMessage,S.Agent=function(){},S.Agent.defaultMaxSockets=4,S.globalAgent=new S.Agent,S.STATUS_CODES=y,S.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(F,Q,j){(function(N){"use strict";j.fetch=S(N.fetch)&&S(N.ReadableStream),j.writableStream=S(N.WritableStream),j.abortController=S(N.AbortController),j.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),j.blobConstructor=!0}catch(b){}var v;function C(){if(v!==void 0)return v;if(N.XMLHttpRequest){v=new N.XMLHttpRequest;try{v.open("GET",N.XDomainRequest?"/":"https://example.com")}catch(b){v=null}}else v=null;return v}function k(b){var p=C();if(!p)return!1;try{return p.responseType=b,p.responseType===b}catch(d){}return!1}var y=typeof N.ArrayBuffer!="undefined",m=y&&S(N.ArrayBuffer.prototype.slice);j.arraybuffer=j.fetch||y&&k("arraybuffer"),j.msstream=!j.fetch&&m&&k("ms-stream"),j.mozchunkedarraybuffer=!j.fetch&&y&&k("moz-chunked-arraybuffer"),j.overrideMimeType=j.fetch||(C()?S(C().overrideMimeType):!1),j.vbArray=S(N.VBArray);function S(b){return typeof b=="function"}v=null}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],233:[function(F,Q,j){(function(N,v,C){"use strict";var k=F("babel-runtime/core-js/object/keys"),y=m(k);function m(a){return a&&a.__esModule?a:{default:a}}var S=F("./capability"),b=F("inherits"),p=F("./response"),d=F("readable-stream"),t=F("to-arraybuffer"),l=p.IncomingMessage,r=p.readyStates;function i(a,u){return S.fetch&&u?"fetch":S.mozchunkedarraybuffer?"moz-chunked-arraybuffer":S.msstream?"ms-stream":S.arraybuffer&&a?"arraybuffer":S.vbArray&&a?"text:vbarray":"text"}var o=Q.exports=function(a){var u=this;d.Writable.call(u),u._opts=a,u._body=[],u._headers={},a.auth&&u.setHeader("Authorization","Basic "+new C(a.auth).toString("base64")),(0,y.default)(a.headers).forEach(function(_){u.setHeader(_,a.headers[_])});var f,w=!0;if(a.mode==="disable-fetch"||"requestTimeout"in a&&!S.abortController)w=!1,f=!0;else if(a.mode==="prefer-streaming")f=!1;else if(a.mode==="allow-wrong-content-type")f=!S.overrideMimeType;else if(!a.mode||a.mode==="default"||a.mode==="prefer-fast")f=!0;else throw new Error("Invalid value for opts.mode");u._mode=i(f,w),u._fetchTimer=null,u.on("finish",function(){u._onFinish()})};b(o,d.Writable),o.prototype.setHeader=function(a,u){var f=this,w=a.toLowerCase();if(c.indexOf(w)!==-1)return;f._headers[w]={name:a,value:u}},o.prototype.getHeader=function(a){var u=this._headers[a.toLowerCase()];return u?u.value:null},o.prototype.removeHeader=function(a){var u=this;delete u._headers[a.toLowerCase()]},o.prototype._onFinish=function(){var a=this;if(a._destroyed)return;var u=a._opts,f=a._headers,w=null;u.method!=="GET"&&u.method!=="HEAD"&&(S.arraybuffer?w=t(C.concat(a._body)):S.blobConstructor?w=new v.Blob(a._body.map(function(x){return t(x)}),{type:(f["content-type"]||{}).value||""}):w=C.concat(a._body).toString());var _=[];if((0,y.default)(f).forEach(function(x){var E=f[x].name,T=f[x].value;Array.isArray(T)?T.forEach(function(M){_.push([E,M])}):_.push([E,T])}),a._mode==="fetch"){var h=null,R=null;if(S.abortController){var O=new AbortController;h=O.signal,a._fetchAbortController=O,"requestTimeout"in u&&u.requestTimeout!==0&&(a._fetchTimer=v.setTimeout(function(){a.emit("requestTimeout"),a._fetchAbortController&&a._fetchAbortController.abort()},u.requestTimeout))}v.fetch(a._opts.url,{method:a._opts.method,headers:_,body:w||void 0,mode:"cors",credentials:u.withCredentials?"include":"same-origin",signal:h}).then(function(x){a._fetchResponse=x,a._connect()},function(x){v.clearTimeout(a._fetchTimer),a._destroyed||a.emit("error",x)})}else{var g=a._xhr=new v.XMLHttpRequest;try{g.open(a._opts.method,a._opts.url,!0)}catch(x){N.nextTick(function(){a.emit("error",x)});return}"responseType"in g&&(g.responseType=a._mode.split(":")[0]),"withCredentials"in g&&(g.withCredentials=!!u.withCredentials),a._mode==="text"&&"overrideMimeType"in g&&g.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in u&&(g.timeout=u.requestTimeout,g.ontimeout=function(){a.emit("requestTimeout")}),_.forEach(function(x){g.setRequestHeader(x[0],x[1])}),a._response=null,g.onreadystatechange=function(){switch(g.readyState){case r.LOADING:case r.DONE:a._onXHRProgress();break}},a._mode==="moz-chunked-arraybuffer"&&(g.onprogress=function(){a._onXHRProgress()}),g.onerror=function(){if(a._destroyed)return;a.emit("error",new Error("XHR error"))};try{g.send(w)}catch(x){N.nextTick(function(){a.emit("error",x)});return}}};function s(a){try{var u=a.status;return u!==null&&u!==0}catch(f){return!1}}o.prototype._onXHRProgress=function(){var a=this;if(!s(a._xhr)||a._destroyed)return;a._response||a._connect(),a._response._onXHRProgress()},o.prototype._connect=function(){var a=this;if(a._destroyed)return;a._response=new l(a._xhr,a._fetchResponse,a._mode,a._fetchTimer),a._response.on("error",function(u){a.emit("error",u)}),a.emit("response",a._response)},o.prototype._write=function(a,u,f){var w=this;w._body.push(a),f()},o.prototype.abort=o.prototype.destroy=function(){var a=this;a._destroyed=!0,v.clearTimeout(a._fetchTimer),a._response&&(a._response._destroyed=!0),a._xhr?a._xhr.abort():a._fetchAbortController&&a._fetchAbortController.abort()},o.prototype.end=function(a,u,f){var w=this;typeof a=="function"&&(f=a,a=void 0),d.Writable.prototype.end.call(w,a,u,f)},o.prototype.flushHeaders=function(){},o.prototype.setTimeout=function(){},o.prototype.setNoDelay=function(){},o.prototype.setSocketKeepAlive=function(){};var c=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,F("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},F("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(F,Q,j){(function(N,v,C){"use strict";var k=F("babel-runtime/core-js/promise"),y=m(k);function m(l){return l&&l.__esModule?l:{default:l}}var S=F("./capability"),b=F("inherits"),p=F("readable-stream"),d=j.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},t=j.IncomingMessage=function(l,r,i,o){var s=this;if(p.Readable.call(s),s._mode=i,s.headers={},s.rawHeaders=[],s.trailers={},s.rawTrailers=[],s.on("end",function(){N.nextTick(function(){s.emit("close")})}),i==="fetch"){var c=function h(){u.read().then(function(R){if(s._destroyed)return;if(R.done){v.clearTimeout(o),s.push(null);return}s.push(new C(R.value)),h()}).catch(function(R){v.clearTimeout(o),s._destroyed||s.emit("error",R)})};if(s._fetchResponse=r,s.url=r.url,s.statusCode=r.status,s.statusMessage=r.statusText,r.headers.forEach(function(h,R){s.headers[R.toLowerCase()]=h,s.rawHeaders.push(R,h)}),S.writableStream){var a=new WritableStream({write:function(R){return new y.default(function(O,g){s._destroyed?g():s.push(new C(R))?O():s._resumeFetch=O})},close:function(){v.clearTimeout(o),s._destroyed||s.push(null)},abort:function(R){s._destroyed||s.emit("error",R)}});try{r.body.pipeTo(a).catch(function(h){v.clearTimeout(o),s._destroyed||s.emit("error",h)});return}catch(h){}}var u=r.body.getReader();c()}else{s._xhr=l,s._pos=0,s.url=l.responseURL,s.statusCode=l.status,s.statusMessage=l.statusText;var f=l.getAllResponseHeaders().split(/\r?\n/);if(f.forEach(function(h){var R=h.match(/^([^:]+):\s*(.*)/);if(R){var O=R[1].toLowerCase();O==="set-cookie"?(s.headers[O]===void 0&&(s.headers[O]=[]),s.headers[O].push(R[2])):s.headers[O]!==void 0?s.headers[O]+=", "+R[2]:s.headers[O]=R[2],s.rawHeaders.push(R[1],R[2])}}),s._charset="x-user-defined",!S.overrideMimeType){var w=s.rawHeaders["mime-type"];if(w){var _=w.match(/;\s*charset=([^;])(;|$)/);_&&(s._charset=_[1].toLowerCase())}s._charset||(s._charset="utf-8")}}};b(t,p.Readable),t.prototype._read=function(){var l=this,r=l._resumeFetch;r&&(l._resumeFetch=null,r())},t.prototype._onXHRProgress=function(){var l=this,r=l._xhr,i=null;switch(l._mode){case"text:vbarray":if(r.readyState!==d.DONE)break;try{i=new v.VBArray(r.responseBody).toArray()}catch(u){}if(i!==null){l.push(new C(i));break}case"text":try{i=r.responseText}catch(u){l._mode="text:vbarray";break}if(i.length>l._pos){var o=i.substr(l._pos);if(l._charset==="x-user-defined"){for(var s=new C(o.length),c=0;c<o.length;c++)s[c]=o.charCodeAt(c)&255;l.push(s)}else l.push(o,l._charset);l._pos=i.length}break;case"arraybuffer":if(r.readyState!==d.DONE||!r.response)break;i=r.response,l.push(new C(new Uint8Array(i)));break;case"moz-chunked-arraybuffer":if(i=r.response,r.readyState!==d.LOADING||!i)break;l.push(new C(new Uint8Array(i)));break;case"ms-stream":if(i=r.response,r.readyState!==d.LOADING)break;var a=new v.MSStreamReader;a.onprogress=function(){a.result.byteLength>l._pos&&(l.push(new C(new Uint8Array(a.result.slice(l._pos)))),l._pos=a.result.byteLength)},a.onload=function(){l.push(null)},a.readAsArrayBuffer(i);break}l._xhr.readyState===d.DONE&&l._mode!=="ms-stream"&&l.push(null)}}).call(this,F("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},F("buffer").Buffer)},{"./capability":232,_process:208,"babel-runtime/core-js/promise":61,buffer:73,inherits:196,"readable-stream":223}],235:[function(F,Q,j){"use strict";var N=F("safe-buffer").Buffer,v=N.isEncoding||function(a){a=""+a;switch(a&&a.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 C(a){if(!a)return"utf8";for(var u;;)switch(a){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 a;default:if(u)return;a=(""+a).toLowerCase(),u=!0}}function k(a){var u=C(a);if(typeof u!="string"&&(N.isEncoding===v||!v(a)))throw new Error("Unknown encoding: "+a);return u||a}j.StringDecoder=y;function y(a){this.encoding=k(a);var u;switch(this.encoding){case"utf16le":this.text=l,this.end=r,u=4;break;case"utf8":this.fillLast=p,u=4;break;case"base64":this.text=i,this.end=o,u=3;break;default:this.write=s,this.end=c;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=N.allocUnsafe(u)}y.prototype.write=function(a){if(a.length===0)return"";var u,f;if(this.lastNeed){if(u=this.fillLast(a),u===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;return f<a.length?u?u+this.text(a,f):this.text(a,f):u||""},y.prototype.end=t,y.prototype.text=d,y.prototype.fillLast=function(a){if(this.lastNeed<=a.length)return a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,a.length),this.lastNeed-=a.length};function m(a){return a<=127?0:a>>5===6?2:a>>4===14?3:a>>3===30?4:a>>6===2?-1:-2}function S(a,u,f){var w=u.length-1;if(w<f)return 0;var _=m(u[w]);return _>=0?(_>0&&(a.lastNeed=_-1),_):--w<f||_===-2?0:(_=m(u[w]),_>=0?(_>0&&(a.lastNeed=_-2),_):--w<f||_===-2?0:(_=m(u[w]),_>=0?(_>0&&(_===2?_=0:a.lastNeed=_-3),_):0))}function b(a,u,f){if((u[0]&192)!==128)return a.lastNeed=0,"\uFFFD";if(a.lastNeed>1&&u.length>1){if((u[1]&192)!==128)return a.lastNeed=1,"\uFFFD";if(a.lastNeed>2&&u.length>2&&(u[2]&192)!==128)return a.lastNeed=2,"\uFFFD"}}function p(a){var u=this.lastTotal-this.lastNeed,f=b(this,a,u);if(f!==void 0)return f;if(this.lastNeed<=a.length)return a.copy(this.lastChar,u,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,u,0,a.length),this.lastNeed-=a.length}function d(a,u){var f=S(this,a,u);if(!this.lastNeed)return a.toString("utf8",u);this.lastTotal=f;var w=a.length-(f-this.lastNeed);return a.copy(this.lastChar,0,w),a.toString("utf8",u,w)}function t(a){var u=a&&a.length?this.write(a):"";return this.lastNeed?u+"\uFFFD":u}function l(a,u){if((a.length-u)%2===0){var f=a.toString("utf16le",u);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",u,a.length-1)}function r(a){var u=a&&a.length?this.write(a):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return u+this.lastChar.toString("utf16le",0,f)}return u}function i(a,u){var f=(a.length-u)%3;return f===0?a.toString("base64",u):(this.lastNeed=3-f,this.lastTotal=3,f===1?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",u,a.length-f))}function o(a){var u=a&&a.length?this.write(a):"";return this.lastNeed?u+this.lastChar.toString("base64",0,3-this.lastNeed):u}function s(a){return a.toString(this.encoding)}function c(a){return a&&a.length?this.write(a):""}},{"safe-buffer":228}],236:[function(F,Q,j){(function(N,v){var C=F("process/browser.js").nextTick,k=Function.prototype.apply,y=Array.prototype.slice,m={},S=0;j.setTimeout=function(){return new b(k.call(setTimeout,window,arguments),clearTimeout)},j.setInterval=function(){return new b(k.call(setInterval,window,arguments),clearInterval)},j.clearTimeout=j.clearInterval=function(p){p.close()};function b(p,d){this._id=p,this._clearFn=d}b.prototype.unref=b.prototype.ref=function(){},b.prototype.close=function(){this._clearFn.call(window,this._id)},j.enroll=function(p,d){clearTimeout(p._idleTimeoutId),p._idleTimeout=d},j.unenroll=function(p){clearTimeout(p._idleTimeoutId),p._idleTimeout=-1},j._unrefActive=j.active=function(p){clearTimeout(p._idleTimeoutId);var d=p._idleTimeout;d>=0&&(p._idleTimeoutId=setTimeout(function(){p._onTimeout&&p._onTimeout()},d))},j.setImmediate=typeof N=="function"?N:function(p){var d=S++,t=arguments.length<2?!1:y.call(arguments,1);return m[d]=!0,C(function(){m[d]&&(t?p.apply(null,t):p.call(null),j.clearImmediate(d))}),d},j.clearImmediate=typeof v=="function"?v:function(p){delete m[p]}}).call(this,F("timers").setImmediate,F("timers").clearImmediate)},{"process/browser.js":208,timers:236}],237:[function(F,Q,j){var N=F("buffer").Buffer;Q.exports=function(v){if(v instanceof Uint8Array){if(v.byteOffset===0&&v.byteLength===v.buffer.byteLength)return v.buffer;if(typeof v.buffer.slice=="function")return v.buffer.slice(v.byteOffset,v.byteOffset+v.byteLength)}if(N.isBuffer(v)){for(var C=new Uint8Array(v.length),k=v.length,y=0;y<k;y++)C[y]=v[y];return C.buffer}else throw new Error("Argument must be a Buffer")}},{buffer:73}],238:[function(F,Q,j){"use strict";var N=F("punycode"),v=F("./util");j.parse=u,j.resolve=w,j.resolveObject=_,j.format=f,j.Url=C;function C(){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 k=/^([a-z0-9.+-]+:)/i,y=/:[0-9]*$/,m=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,S=["<",">",'"',"`"," ","\r",`
|
|
|
`," "],b=["{","}","|","\\","^","`"].concat(S),p=["'"].concat(b),d=["%","/","?",";","#"].concat(p),t=["/","?","#"],l=255,r=/^[+a-z0-9A-Z_-]{0,63}$/,i=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,o={javascript:!0,"javascript:":!0},s={javascript:!0,"javascript:":!0},c={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},a=F("querystring");function u(h,R,O){if(h&&v.isObject(h)&&h instanceof C)return h;var g=new C;return g.parse(h,R,O),g}C.prototype.parse=function(h,R,O){if(!v.isString(h))throw new TypeError("Parameter 'url' must be a string, not "+typeof h);var g=h.indexOf("?"),x=g!==-1&&g<h.indexOf("#")?"?":"#",E=h.split(x),T=/\\/g;E[0]=E[0].replace(T,"/"),h=E.join(x);var M=h;if(M=M.trim(),!O&&h.split("#").length===1){var L=m.exec(M);if(L)return this.path=M,this.href=M,this.pathname=L[1],L[2]?(this.search=L[2],R?this.query=a.parse(this.search.substr(1)):this.query=this.search.substr(1)):R&&(this.search="",this.query={}),this}var A=k.exec(M);if(A){A=A[0];var V=A.toLowerCase();this.protocol=V,M=M.substr(A.length)}if(O||A||M.match(/^\/\/[^@\/]+@[^@\/]+/)){var z=M.substr(0,2)==="//";z&&!(A&&s[A])&&(M=M.substr(2),this.slashes=!0)}if(!s[A]&&(z||A&&!c[A])){for(var W=-1,G=0;G<t.length;G++){var U=M.indexOf(t[G]);U!==-1&&(W===-1||U<W)&&(W=U)}var P,H;W===-1?H=M.lastIndexOf("@"):H=M.lastIndexOf("@",W),H!==-1&&(P=M.slice(0,H),M=M.slice(H+1),this.auth=decodeURIComponent(P)),W=-1;for(var G=0;G<d.length;G++){var U=M.indexOf(d[G]);U!==-1&&(W===-1||U<W)&&(W=U)}W===-1&&(W=M.length),this.host=M.slice(0,W),M=M.slice(W),this.parseHost(),this.hostname=this.hostname||"";var $=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!$)for(var re=this.hostname.split(/\./),G=0,te=re.length;G<te;G++){var ge=re[G];if(!ge)continue;if(!ge.match(r)){for(var ve="",de=0,De=ge.length;de<De;de++)ge.charCodeAt(de)>127?ve+="x":ve+=ge[de];if(!ve.match(r)){var Te=re.slice(0,G),he=re.slice(G+1),ue=ge.match(i);ue&&(Te.push(ue[1]),he.unshift(ue[2])),he.length&&(M="/"+he.join(".")+M),this.hostname=Te.join(".");break}}}this.hostname.length>l?this.hostname="":this.hostname=this.hostname.toLowerCase(),$||(this.hostname=N.toASCII(this.hostname));var ie=this.port?":"+this.port:"",Se=this.hostname||"";this.host=Se+ie,this.href+=this.host,$&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),M[0]!=="/"&&(M="/"+M))}if(!o[V])for(var G=0,te=p.length;G<te;G++){var ne=p[G];if(M.indexOf(ne)===-1)continue;var ce=encodeURIComponent(ne);ce===ne&&(ce=escape(ne)),M=M.split(ne).join(ce)}var Oe=M.indexOf("#");Oe!==-1&&(this.hash=M.substr(Oe),M=M.slice(0,Oe));var oe=M.indexOf("?");if(oe!==-1?(this.search=M.substr(oe),this.query=M.substr(oe+1),R&&(this.query=a.parse(this.query)),M=M.slice(0,oe)):R&&(this.search="",this.query={}),M&&(this.pathname=M),c[V]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ie=this.pathname||"",q=this.search||"";this.path=ie+q}return this.href=this.format(),this};function f(h){return v.isString(h)&&(h=u(h)),h instanceof C?h.format():C.prototype.format.call(h)}C.prototype.format=function(){var h=this.auth||"";h&&(h=encodeURIComponent(h),h=h.replace(/%3A/i,":"),h+="@");var R=this.protocol||"",O=this.pathname||"",g=this.hash||"",x=!1,E="";this.host?x=h+this.host:this.hostname&&(x=h+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(x+=":"+this.port)),this.query&&v.isObject(this.query)&&Object.keys(this.query).length&&(E=a.stringify(this.query));var T=this.search||E&&"?"+E||"";return R&&R.substr(-1)!==":"&&(R+=":"),this.slashes||(!R||c[R])&&x!==!1?(x="//"+(x||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):x||(x=""),g&&g.charAt(0)!=="#"&&(g="#"+g),T&&T.charAt(0)!=="?"&&(T="?"+T),O=O.replace(/[?#]/g,function(M){return encodeURIComponent(M)}),T=T.replace("#","%23"),R+x+O+T+g};function w(h,R){return u(h,!1,!0).resolve(R)}C.prototype.resolve=function(h){return this.resolveObject(u(h,!1,!0)).format()};function _(h,R){return h?u(h,!1,!0).resolveObject(R):R}C.prototype.resolveObject=function(h){if(v.isString(h)){var R=new C;R.parse(h,!1,!0),h=R}for(var O=new C,g=Object.keys(this),x=0;x<g.length;x++){var E=g[x];O[E]=this[E]}if(O.hash=h.hash,h.href==="")return O.href=O.format(),O;if(h.slashes&&!h.protocol){for(var T=Object.keys(h),M=0;M<T.length;M++){var L=T[M];L!=="protocol"&&(O[L]=h[L])}return c[O.protocol]&&O.hostname&&!O.pathname&&(O.path=O.pathname="/"),O.href=O.format(),O}if(h.protocol&&h.protocol!==O.protocol){if(!c[h.protocol]){for(var A=Object.keys(h),V=0;V<A.length;V++){var z=A[V];O[z]=h[z]}return O.href=O.format(),O}if(O.protocol=h.protocol,!h.host&&!s[h.protocol]){for(var te=(h.pathname||"").split("/");te.length&&!(h.host=te.shift()););h.host||(h.host=""),h.hostname||(h.hostname=""),te[0]!==""&&te.unshift(""),te.length<2&&te.unshift(""),O.pathname=te.join("/")}else O.pathname=h.pathname;if(O.search=h.search,O.query=h.query,O.host=h.host||"",O.auth=h.auth,O.hostname=h.hostname||h.host,O.port=h.port,O.pathname||O.search){var W=O.pathname||"",G=O.search||"";O.path=W+G}return O.slashes=O.slashes||h.slashes,O.href=O.format(),O}var U=O.pathname&&O.pathname.charAt(0)==="/",P=h.host||h.pathname&&h.pathname.charAt(0)==="/",H=P||U||O.host&&h.pathname,$=H,re=O.pathname&&O.pathname.split("/")||[],te=h.pathname&&h.pathname.split("/")||[],ge=O.protocol&&!c[O.protocol];if(ge&&(O.hostname="",O.port=null,O.host&&(re[0]===""?re[0]=O.host:re.unshift(O.host)),O.host="",h.protocol&&(h.hostname=null,h.port=null,h.host&&(te[0]===""?te[0]=h.host:te.unshift(h.host)),h.host=null),H=H&&(te[0]===""||re[0]==="")),P)O.host=h.host||h.host===""?h.host:O.host,O.hostname=h.hostname||h.hostname===""?h.hostname:O.hostname,O.search=h.search,O.query=h.query,re=te;else if(te.length)re||(re=[]),re.pop(),re=re.concat(te),O.search=h.search,O.query=h.query;else if(!v.isNullOrUndefined(h.search)){if(ge){O.hostname=O.host=re.shift();var ve=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;ve&&(O.auth=ve.shift(),O.host=O.hostname=ve.shift())}return O.search=h.search,O.query=h.query,(!v.isNull(O.pathname)||!v.isNull(O.search))&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!re.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var de=re.slice(-1)[0],De=(O.host||h.host||re.length>1)&&(de==="."||de==="..")||de==="",Te=0,he=re.length;he>=0;he--)de=re[he],de==="."?re.splice(he,1):de===".."?(re.splice(he,1),Te++):Te&&(re.splice(he,1),Te--);if(!H&&!$)for(;Te--;Te)re.unshift("..");H&&re[0]!==""&&(!re[0]||re[0].charAt(0)!=="/")&&re.unshift(""),De&&re.join("/").substr(-1)!=="/"&&re.push("");var ue=re[0]===""||re[0]&&re[0].charAt(0)==="/";if(ge){O.hostname=O.host=ue?"":re.length?re.shift():"";var ve=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;ve&&(O.auth=ve.shift(),O.host=O.hostname=ve.shift())}return H=H||O.host&&re.length,H&&!ue&&re.unshift(""),re.length?O.pathname=re.join("/"):(O.pathname=null,O.path=null),(!v.isNull(O.pathname)||!v.isNull(O.search))&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=h.auth||O.auth,O.slashes=O.slashes||h.slashes,O.href=O.format(),O},C.prototype.parseHost=function(){var h=this.host,R=y.exec(h);R&&(R=R[0],R!==":"&&(this.port=R.substr(1)),h=h.substr(0,h.length-R.length)),h&&(this.hostname=h)}},{"./util":239,punycode:209,querystring:212}],239:[function(F,Q,j){"use strict";Q.exports={isString:function(N){return typeof N=="string"},isObject:function(N){return typeof N=="object"&&N!==null},isNull:function(N){return N===null},isNullOrUndefined:function(N){return N==null}}},{}],240:[function(F,Q,j){(function(N){Q.exports=v;function v(k,y){if(C("noDeprecation"))return k;var m=!1;function S(){if(!m){if(C("throwDeprecation"))throw new Error(y);C("traceDeprecation")?console.trace(y):console.warn(y),m=!0}return k.apply(this,arguments)}return S}function C(k){try{if(!N.localStorage)return!1}catch(m){return!1}var y=N.localStorage[k];return y==null?!1:String(y).toLowerCase()==="true"}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],241:[function(F,Q,j){typeof Object.create=="function"?Q.exports=function(v,C){v.super_=C,v.prototype=Object.create(C.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}})}:Q.exports=function(v,C){v.super_=C;var k=function(){};k.prototype=C.prototype,v.prototype=new k,v.prototype.constructor=v}},{}],242:[function(F,Q,j){Q.exports=function(v){return v&&typeof v=="object"&&typeof v.copy=="function"&&typeof v.fill=="function"&&typeof v.readUInt8=="function"}},{}],243:[function(F,Q,j){(function(N,v){var C=/%[sdj%]/g;j.format=function(W){if(!w(W)){for(var G=[],U=0;U<arguments.length;U++)G.push(m(arguments[U]));return G.join(" ")}for(var U=1,P=arguments,H=P.length,$=String(W).replace(C,function(te){if(te==="%%")return"%";if(U>=H)return te;switch(te){case"%s":return String(P[U++]);case"%d":return Number(P[U++]);case"%j":try{return JSON.stringify(P[U++])}catch(ge){return"[Circular]"}default:return te}}),re=P[U];U<H;re=P[++U])a(re)||!O(re)?$+=" "+re:$+=" "+m(re);return $},j.deprecate=function(W,G){if(h(v.process))return function(){return j.deprecate(W,G).apply(this,arguments)};if(N.noDeprecation===!0)return W;var U=!1;function P(){if(!U){if(N.throwDeprecation)throw new Error(G);N.traceDeprecation?console.trace(G):console.error(G),U=!0}return W.apply(this,arguments)}return P};var k={},y;j.debuglog=function(W){if(h(y)&&(y=N.env.NODE_DEBUG||""),W=W.toUpperCase(),!k[W])if(new RegExp("\\b"+W+"\\b","i").test(y)){var G=N.pid;k[W]=function(){var U=j.format.apply(j,arguments);console.error("%s %d: %s",W,G,U)}}else k[W]=function(){};return k[W]};function m(W,G){var U={seen:[],stylize:b};return arguments.length>=3&&(U.depth=arguments[2]),arguments.length>=4&&(U.colors=arguments[3]),c(G)?U.showHidden=G:G&&j._extend(U,G),h(U.showHidden)&&(U.showHidden=!1),h(U.depth)&&(U.depth=2),h(U.colors)&&(U.colors=!1),h(U.customInspect)&&(U.customInspect=!0),U.colors&&(U.stylize=S),d(U,W,U.depth)}j.inspect=m,m.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]},m.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function S(W,G){var U=m.styles[G];return U?"["+m.colors[U][0]+"m"+W+"["+m.colors[U][1]+"m":W}function b(W,G){return W}function p(W){var G={};return W.forEach(function(U,P){G[U]=!0}),G}function d(W,G,U){if(W.customInspect&&G&&E(G.inspect)&&G.inspect!==j.inspect&&!(G.constructor&&G.constructor.prototype===G)){var P=G.inspect(U,W);return w(P)||(P=d(W,P,U)),P}var H=t(W,G);if(H)return H;var $=Object.keys(G),re=p($);if(W.showHidden&&($=Object.getOwnPropertyNames(G)),x(G)&&($.indexOf("message")>=0||$.indexOf("description")>=0))return l(G);if($.length===0){if(E(G)){var te=G.name?": "+G.name:"";return W.stylize("[Function"+te+"]","special")}if(R(G))return W.stylize(RegExp.prototype.toString.call(G),"regexp");if(g(G))return W.stylize(Date.prototype.toString.call(G),"date");if(x(G))return l(G)}var ge="",ve=!1,de=["{","}"];if(s(G)&&(ve=!0,de=["[","]"]),E(G)){var De=G.name?": "+G.name:"";ge=" [Function"+De+"]"}if(R(G)&&(ge=" "+RegExp.prototype.toString.call(G)),g(G)&&(ge=" "+Date.prototype.toUTCString.call(G)),x(G)&&(ge=" "+l(G)),$.length===0&&(!ve||G.length==0))return de[0]+ge+de[1];if(U<0)return R(G)?W.stylize(RegExp.prototype.toString.call(G),"regexp"):W.stylize("[Object]","special");W.seen.push(G);var Te;return ve?Te=r(W,G,U,re,$):Te=$.map(function(he){return i(W,G,U,re,he,ve)}),W.seen.pop(),o(Te,ge,de)}function t(W,G){if(h(G))return W.stylize("undefined","undefined");if(w(G)){var U="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return W.stylize(U,"string")}if(f(G))return W.stylize(""+G,"number");if(c(G))return W.stylize(""+G,"boolean");if(a(G))return W.stylize("null","null")}function l(W){return"["+Error.prototype.toString.call(W)+"]"}function r(W,G,U,P,H){for(var $=[],re=0,te=G.length;re<te;++re)z(G,String(re))?$.push(i(W,G,U,P,String(re),!0)):$.push("");return H.forEach(function(ge){ge.match(/^\d+$/)||$.push(i(W,G,U,P,ge,!0))}),$}function i(W,G,U,P,H,$){var re,te,ge;if(ge=Object.getOwnPropertyDescriptor(G,H)||{value:G[H]},ge.get?ge.set?te=W.stylize("[Getter/Setter]","special"):te=W.stylize("[Getter]","special"):ge.set&&(te=W.stylize("[Setter]","special")),z(P,H)||(re="["+H+"]"),te||(W.seen.indexOf(ge.value)<0?(a(U)?te=d(W,ge.value,null):te=d(W,ge.value,U-1),te.indexOf(`
|
|
|
`)>-1&&($?te=te.split(`
|
|
|
`).map(function(ve){return" "+ve}).join(`
|
|
|
`).substr(2):te=`
|
|
|
`+te.split(`
|
|
|
`).map(function(ve){return" "+ve}).join(`
|
|
|
`))):te=W.stylize("[Circular]","special")),h(re)){if($&&H.match(/^\d+$/))return te;re=JSON.stringify(""+H),re.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(re=re.substr(1,re.length-2),re=W.stylize(re,"name")):(re=re.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),re=W.stylize(re,"string"))}return re+": "+te}function o(W,G,U){var P=0,H=W.reduce(function($,re){return P++,re.indexOf(`
|
|
|
`)>=0&&P++,$+re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return H>60?U[0]+(G===""?"":G+`
|
|
|
`)+" "+W.join(`,
|
|
|
`)+" "+U[1]:U[0]+G+" "+W.join(", ")+" "+U[1]}function s(W){return Array.isArray(W)}j.isArray=s;function c(W){return typeof W=="boolean"}j.isBoolean=c;function a(W){return W===null}j.isNull=a;function u(W){return W==null}j.isNullOrUndefined=u;function f(W){return typeof W=="number"}j.isNumber=f;function w(W){return typeof W=="string"}j.isString=w;function _(W){return typeof W=="symbol"}j.isSymbol=_;function h(W){return W===void 0}j.isUndefined=h;function R(W){return O(W)&&M(W)==="[object RegExp]"}j.isRegExp=R;function O(W){return typeof W=="object"&&W!==null}j.isObject=O;function g(W){return O(W)&&M(W)==="[object Date]"}j.isDate=g;function x(W){return O(W)&&(M(W)==="[object Error]"||W instanceof Error)}j.isError=x;function E(W){return typeof W=="function"}j.isFunction=E;function T(W){return W===null||typeof W=="boolean"||typeof W=="number"||typeof W=="string"||typeof W=="symbol"||typeof W=="undefined"}j.isPrimitive=T,j.isBuffer=F("./support/isBuffer");function M(W){return Object.prototype.toString.call(W)}function L(W){return W<10?"0"+W.toString(10):W.toString(10)}var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var W=new Date,G=[L(W.getHours()),L(W.getMinutes()),L(W.getSeconds())].join(":");return[W.getDate(),A[W.getMonth()],G].join(" ")}j.log=function(){console.log("%s - %s",V(),j.format.apply(j,arguments))},j.inherits=F("inherits"),j._extend=function(W,G){if(!G||!O(G))return W;for(var U=Object.keys(G),P=U.length;P--;)W[U[P]]=G[U[P]];return W};function z(W,G){return Object.prototype.hasOwnProperty.call(W,G)}}).call(this,F("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":242,_process:208,inherits:241}],244:[function(F,Q,j){"use strict";(function(){"use strict";j.stripBOM=function(N){return N[0]==="\uFEFF"?N.substring(1):N}}).call(void 0)},{}],245:[function(F,Q,j){"use strict";var N=F("babel-runtime/helpers/typeof"),v=y(N),C=F("babel-runtime/core-js/object/keys"),k=y(C);function y(m){return m&&m.__esModule?m:{default:m}}(function(){"use strict";var m,S,b,p,d,t={}.hasOwnProperty;m=F("xmlbuilder"),S=F("./defaults").defaults,p=function(r){return typeof r=="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)},d=function(r){return"<![CDATA["+b(r)+"]]>"},b=function(r){return r.replace("]]>","]]]]><![CDATA[>")},j.Builder=function(){function l(r){var i,o,s;this.options={},o=S["0.2"];for(i in o){if(!t.call(o,i))continue;s=o[i],this.options[i]=s}for(i in r){if(!t.call(r,i))continue;s=r[i],this.options[i]=s}}return l.prototype.buildObject=function(r){var i,o,s,c,a;return i=this.options.attrkey,o=this.options.charkey,(0,k.default)(r).length===1&&this.options.rootName===S["0.2"].rootName?(a=(0,k.default)(r)[0],r=r[a]):a=this.options.rootName,s=function(u){return function(f,w){var _,h,R,O,g,x;if((typeof w=="undefined"?"undefined":(0,v.default)(w))!=="object")u.options.cdata&&p(w)?f.raw(d(w)):f.txt(w);else if(Array.isArray(w))for(O in w){if(!t.call(w,O))continue;h=w[O];for(g in h)R=h[g],f=s(f.ele(g),R).up()}else for(g in w){if(!t.call(w,g))continue;if(h=w[g],g===i){if((typeof h=="undefined"?"undefined":(0,v.default)(h))==="object")for(_ in h)x=h[_],f=f.att(_,x)}else if(g===o)u.options.cdata&&p(h)?f=f.raw(d(h)):f=f.txt(h);else if(Array.isArray(h))for(O in h){if(!t.call(h,O))continue;R=h[O],typeof R=="string"?u.options.cdata&&p(R)?f=f.ele(g).raw(d(R)).up():f=f.ele(g,R).up():f=s(f.ele(g),R).up()}else(typeof h=="undefined"?"undefined":(0,v.default)(h))==="object"?f=s(f.ele(g),h).up():typeof h=="string"&&u.options.cdata&&p(h)?f=f.ele(g).raw(d(h)).up():(h==null&&(h=""),f=f.ele(g,h.toString()).up())}return f}}(this),c=m.create(a,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),s(c,r).end(this.options.renderOpts)},l}()}).call(void 0)},{"./defaults":246,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,xmlbuilder:282}],246:[function(F,Q,j){"use strict";(function(){j.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(F,Q,j){"use strict";var N=F("babel-runtime/core-js/promise"),v=p(N),C=F("babel-runtime/core-js/object/get-own-property-names"),k=p(C),y=F("babel-runtime/core-js/object/keys"),m=p(y),S=F("babel-runtime/helpers/typeof"),b=p(S);function p(d){return d&&d.__esModule?d:{default:d}}(function(){"use strict";var d,t,l,r,i,o,s,c,a=function(_,h){return function(){return _.apply(h,arguments)}},u=function(_,h){for(var R in h)f.call(h,R)&&(_[R]=h[R]);function O(){this.constructor=_}return O.prototype=h.prototype,_.prototype=new O,_.__super__=h.prototype,_},f={}.hasOwnProperty;s=F("sax"),l=F("events"),d=F("./bom"),o=F("./processors"),c=F("timers").setImmediate,t=F("./defaults").defaults,r=function(_){return(typeof _=="undefined"?"undefined":(0,b.default)(_))==="object"&&_!=null&&(0,m.default)(_).length===0},i=function(_,h,R){var O,g,x;for(O=0,g=_.length;O<g;O++)x=_[O],h=x(h,R);return h},j.Parser=function(w){u(_,w);function _(h){this.parseStringPromise=a(this.parseStringPromise,this),this.parseString=a(this.parseString,this),this.reset=a(this.reset,this),this.assignOrPush=a(this.assignOrPush,this),this.processAsync=a(this.processAsync,this);var R,O,g;if(!(this instanceof j.Parser))return new j.Parser(h);this.options={},O=t["0.2"];for(R in O){if(!f.call(O,R))continue;g=O[R],this.options[R]=g}for(R in h){if(!f.call(h,R))continue;g=h[R],this.options[R]=g}this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(o.normalize)),this.reset()}return _.prototype.processAsync=function(){var h,R;try{return this.remaining.length<=this.options.chunkSize?(h=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(h),this.saxParser.close()):(h=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(h),c(this.processAsync))}catch(O){if(R=O,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(R)}},_.prototype.assignOrPush=function(h,R,O){return R in h?(h[R]instanceof Array||(h[R]=[h[R]]),h[R].push(O)):this.options.explicitArray?h[R]=[O]:h[R]=O},_.prototype.reset=function(){var h,R,O,g;return this.removeAllListeners(),this.saxParser=s.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(x){return function(E){if(x.saxParser.resume(),!x.saxParser.errThrown)return x.saxParser.errThrown=!0,x.emit("error",E)}}(this),this.saxParser.onend=function(x){return function(){if(!x.saxParser.ended)return x.saxParser.ended=!0,x.emit("end",x.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,g=[],h=this.options.attrkey,R=this.options.charkey,this.saxParser.onopentag=function(x){return function(E){var T,M,L,A,V;if(L={},L[R]="",!x.options.ignoreAttrs){V=E.attributes;for(T in V){if(!f.call(V,T))continue;!(h in L)&&!x.options.mergeAttrs&&(L[h]={}),M=x.options.attrValueProcessors?i(x.options.attrValueProcessors,E.attributes[T],T):E.attributes[T],A=x.options.attrNameProcessors?i(x.options.attrNameProcessors,T):T,x.options.mergeAttrs?x.assignOrPush(L,A,M):L[h][A]=M}}return L["#name"]=x.options.tagNameProcessors?i(x.options.tagNameProcessors,E.name):E.name,x.options.xmlns&&(L[x.options.xmlnskey]={uri:E.uri,local:E.local}),g.push(L)}}(this),this.saxParser.onclosetag=function(x){return function(){var E,T,M,L,A,V,z,W,G,U;if(V=g.pop(),A=V["#name"],(!x.options.explicitChildren||!x.options.preserveChildrenOrder)&&delete V["#name"],V.cdata===!0&&(E=V.cdata,delete V.cdata),G=g[g.length-1],V[R].match(/^\s*$/)&&!E?(T=V[R],delete V[R]):(x.options.trim&&(V[R]=V[R].trim()),x.options.normalize&&(V[R]=V[R].replace(/\s{2,}/g," ").trim()),V[R]=x.options.valueProcessors?i(x.options.valueProcessors,V[R],A):V[R],(0,m.default)(V).length===1&&R in V&&!x.EXPLICIT_CHARKEY&&(V=V[R])),r(V)&&(V=x.options.emptyTag!==""?x.options.emptyTag:T),x.options.validator!=null&&(U="/"+function(){var P,H,$;for($=[],P=0,H=g.length;P<H;P++)L=g[P],$.push(L["#name"]);return $}().concat(A).join("/"),function(){var P;try{return V=x.options.validator(U,G&&G[A],V)}catch(H){return P=H,x.emit("error",P)}}()),x.options.explicitChildren&&!x.options.mergeAttrs&&(typeof V=="undefined"?"undefined":(0,b.default)(V))==="object"){if(!x.options.preserveChildrenOrder)L={},x.options.attrkey in V&&(L[x.options.attrkey]=V[x.options.attrkey],delete V[x.options.attrkey]),!x.options.charsAsChildren&&x.options.charkey in V&&(L[x.options.charkey]=V[x.options.charkey],delete V[x.options.charkey]),(0,k.default)(V).length>0&&(L[x.options.childkey]=V),V=L;else if(G){G[x.options.childkey]=G[x.options.childkey]||[],z={};for(M in V){if(!f.call(V,M))continue;z[M]=V[M]}G[x.options.childkey].push(z),delete V["#name"],(0,m.default)(V).length===1&&R in V&&!x.EXPLICIT_CHARKEY&&(V=V[R])}}return g.length>0?x.assignOrPush(G,A,V):(x.options.explicitRoot&&(W=V,V={},V[A]=W),x.resultObject=V,x.saxParser.ended=!0,x.emit("end",x.resultObject))}}(this),O=function(x){return function(E){var T,M;if(M=g[g.length-1],M)return M[R]+=E,x.options.explicitChildren&&x.options.preserveChildrenOrder&&x.options.charsAsChildren&&(x.options.includeWhiteChars||E.replace(/\\n/g,"").trim()!=="")&&(M[x.options.childkey]=M[x.options.childkey]||[],T={"#name":"__text__"},T[R]=E,x.options.normalize&&(T[R]=T[R].replace(/\s{2,}/g," ").trim()),M[x.options.childkey].push(T)),M}}(this),this.saxParser.ontext=O,this.saxParser.oncdata=function(x){return function(E){var T;if(T=O(E),T)return T.cdata=!0}}(this)},_.prototype.parseString=function(h,R){var O;R!=null&&typeof R=="function"&&(this.on("end",function(g){return this.reset(),R(null,g)}),this.on("error",function(g){return this.reset(),R(g)}));try{return h=h.toString(),h.trim()===""?(this.emit("end",null),!0):(h=d.stripBOM(h),this.options.async?(this.remaining=h,c(this.processAsync),this.saxParser):this.saxParser.write(h).close())}catch(g){if(O=g,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw O}else return this.emit("error",O),this.saxParser.errThrown=!0}},_.prototype.parseStringPromise=function(h){return new v.default(function(R){return function(O,g){return R.parseString(h,function(x,E){return x?g(x):O(E)})}}(this))},_}(l),j.parseString=function(w,_,h){var R,O,g;return h!=null?(typeof h=="function"&&(R=h),(typeof _=="undefined"?"undefined":(0,b.default)(_))==="object"&&(O=_)):(typeof _=="function"&&(R=_),O={}),g=new j.Parser(O),g.parseString(w,R)},j.parseStringPromise=function(w,_){var h,R;return(typeof _=="undefined"?"undefined":(0,b.default)(_))==="object"&&(h=_),R=new j.Parser(h),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(F,Q,j){"use strict";(function(){"use strict";var N;N=new RegExp(/(?!xmlns)^.*:/),j.normalize=function(v){return v.toLowerCase()},j.firstCharLowerCase=function(v){return v.charAt(0).toLowerCase()+v.slice(1)},j.stripPrefix=function(v){return v.replace(N,"")},j.parseNumbers=function(v){return isNaN(v)||(v=v%1===0?parseInt(v,10):parseFloat(v)),v},j.parseBooleans=function(v){return/^(?:true|false)$/i.test(v)&&(v=v.toLowerCase()==="true"),v}}).call(void 0)},{}],249:[function(F,Q,j){"use strict";(function(){"use strict";var N,v,C,k,y=function(b,p){for(var d in p)m.call(p,d)&&(b[d]=p[d]);function t(){this.constructor=b}return t.prototype=p.prototype,b.prototype=new t,b.__super__=p.prototype,b},m={}.hasOwnProperty;v=F("./defaults"),N=F("./builder"),C=F("./parser"),k=F("./processors"),j.defaults=v.defaults,j.processors=k,j.ValidationError=function(S){y(b,S);function b(p){this.message=p}return b}(Error),j.Builder=N.Builder,j.Parser=C.Parser,j.parseString=C.parseString,j.parseStringPromise=C.parseStringPromise}).call(void 0)},{"./builder":245,"./defaults":246,"./parser":247,"./processors":248}],250:[function(F,Q,j){"use strict";(function(){Q.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(void 0)},{}],251:[function(F,Q,j){"use strict";(function(){Q.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(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/get-prototype-of"),v=S(N),C=F("babel-runtime/helpers/typeof"),k=S(C),y=F("babel-runtime/core-js/object/assign"),m=S(y);function S(b){return b&&b.__esModule?b:{default:b}}(function(){var b,p,d,t,l,r,i,o=[].slice,s={}.hasOwnProperty;b=function(){var a,u,f,w,_,h;if(h=arguments[0],_=2<=arguments.length?o.call(arguments,1):[],l(m.default))m.default.apply(null,arguments);else for(a=0,f=_.length;a<f;a++)if(w=_[a],w!=null)for(u in w){if(!s.call(w,u))continue;h[u]=w[u]}return h},l=function(a){return!!a&&Object.prototype.toString.call(a)==="[object Function]"},r=function(a){var u;return!!a&&((u=typeof a=="undefined"?"undefined":(0,k.default)(a))==="function"||u==="object")},d=function(a){return l(Array.isArray)?Array.isArray(a):Object.prototype.toString.call(a)==="[object Array]"},t=function(a){var u;if(d(a))return!a.length;for(u in a){if(!s.call(a,u))continue;return!1}return!0},i=function(a){var u,f;return r(a)&&(f=(0,v.default)(a))&&(u=f.constructor)&&typeof u=="function"&&u instanceof u&&Function.prototype.toString.call(u)===Function.prototype.toString.call(Object)},p=function(a){return l(a.valueOf)?a.valueOf():a},Q.exports.assign=b,Q.exports.isFunction=l,Q.exports.isObject=r,Q.exports.isArray=d,Q.exports.isEmpty=t,Q.exports.isPlainObject=i,Q.exports.getValue=p}).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(F,Q,j){"use strict";(function(){Q.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(void 0)},{}],254:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k,y,m;k=F("./NodeType"),m=F("./XMLNode"),Q.exports=y=function(){function S(b,p,d){if(this.parent=b,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),p==null)throw new Error("Missing attribute name. "+this.debugInfo(p));this.name=this.stringify.name(p),this.value=this.stringify.attValue(d),this.type=k.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(S.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(S.prototype,"textContent",{get:function(){return this.value},set:function(p){return this.value=p||""}}),Object.defineProperty(S.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(S.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(S.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(S.prototype,"specified",{get:function(){return!0}}),S.prototype.clone=function(){return(0,v.default)(this)},S.prototype.toString=function(b){return this.options.writer.attribute(this,this.options.writer.filterOptions(b))},S.prototype.debugInfo=function(b){return b=b||this.name,b==null?"parent: <"+this.parent.name+">":"attribute: {"+b+"}, parent: <"+this.parent.name+">"},S.prototype.isEqualNode=function(b){return b.namespaceURI!==this.namespaceURI||(b.prefix!==this.prefix||b.localName!==this.localName)?!1:!(b.value!==this.value)},S}()}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],255:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k,y,m,S=function(d,t){for(var l in t)b.call(t,l)&&(d[l]=t[l]);function r(){this.constructor=d}return r.prototype=t.prototype,d.prototype=new r,d.__super__=t.prototype,d},b={}.hasOwnProperty;k=F("./NodeType"),m=F("./XMLCharacterData"),Q.exports=y=function(p){S(d,p);function d(t,l){if(d.__super__.constructor.call(this,t),l==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=k.CData,this.value=this.stringify.cdata(l)}return d.prototype.clone=function(){return(0,v.default)(this)},d.prototype.toString=function(t){return this.options.writer.cdata(this,this.options.writer.filterOptions(t))},d}(m)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],256:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k,y,m=function(p,d){for(var t in d)S.call(d,t)&&(p[t]=d[t]);function l(){this.constructor=p}return l.prototype=d.prototype,p.prototype=new l,p.__super__=d.prototype,p},S={}.hasOwnProperty;y=F("./XMLNode"),Q.exports=k=function(b){m(p,b);function p(d){p.__super__.constructor.call(this,d),this.value=""}return Object.defineProperty(p.prototype,"data",{get:function(){return this.value},set:function(t){return this.value=t||""}}),Object.defineProperty(p.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(p.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}}),p.prototype.clone=function(){return(0,v.default)(this)},p.prototype.substringData=function(d,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.appendData=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.insertData=function(d,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.deleteData=function(d,t){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.replaceData=function(d,t,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.isEqualNode=function(d){return p.__super__.isEqualNode.apply(this,arguments).isEqualNode(d)?!(d.data!==this.data):!1},p}(y)}).call(void 0)},{"./XMLNode":273,"babel-runtime/core-js/object/create":55}],257:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k,y,m,S=function(d,t){for(var l in t)b.call(t,l)&&(d[l]=t[l]);function r(){this.constructor=d}return r.prototype=t.prototype,d.prototype=new r,d.__super__=t.prototype,d},b={}.hasOwnProperty;k=F("./NodeType"),y=F("./XMLCharacterData"),Q.exports=m=function(p){S(d,p);function d(t,l){if(d.__super__.constructor.call(this,t),l==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=k.Comment,this.value=this.stringify.comment(l)}return d.prototype.clone=function(){return(0,v.default)(this)},d.prototype.toString=function(t){return this.options.writer.comment(this,this.options.writer.filterOptions(t))},d}(y)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],258:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/keys"),v=y(N),C=F("babel-runtime/core-js/object/create"),k=y(C);function y(m){return m&&m.__esModule?m:{default:m}}(function(){var m,S,b;S=F("./XMLDOMErrorHandler"),b=F("./XMLDOMStringList"),Q.exports=m=function(){function p(){var d;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new S,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=d=(0,k.default)(this.defaultParams)}return Object.defineProperty(p.prototype,"parameterNames",{get:function(){return new b((0,v.default)(this.defaultParams))}}),p.prototype.getParameter=function(d){return this.params.hasOwnProperty(d)?this.params[d]:null},p.prototype.canSetParameter=function(d,t){return!0},p.prototype.setParameter=function(d,t){return t!=null?this.params[d]=t:delete this.params[d]},p}()}).call(void 0)},{"./XMLDOMErrorHandler":259,"./XMLDOMStringList":261,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60}],259:[function(F,Q,j){"use strict";(function(){var N;Q.exports=N=function(){function v(){}return v.prototype.handleError=function(C){throw new Error(C)},v}()}).call(void 0)},{}],260:[function(F,Q,j){"use strict";(function(){var N;Q.exports=N=function(){function v(){}return v.prototype.hasFeature=function(C,k){return!0},v.prototype.createDocumentType=function(C,k,y){throw new Error("This DOM method is not implemented.")},v.prototype.createDocument=function(C,k,y){throw new Error("This DOM method is not implemented.")},v.prototype.createHTMLDocument=function(C){throw new Error("This DOM method is not implemented.")},v.prototype.getFeature=function(C,k){throw new Error("This DOM method is not implemented.")},v}()}).call(void 0)},{}],261:[function(F,Q,j){"use strict";(function(){var N;Q.exports=N=function(){function v(C){this.arr=C||[]}return Object.defineProperty(v.prototype,"length",{get:function(){return this.arr.length}}),v.prototype.item=function(C){return this.arr[C]||null},v.prototype.contains=function(C){return this.arr.indexOf(C)!==-1},v}()}).call(void 0)},{}],262:[function(F,Q,j){"use strict";(function(){var N,v,C,k=function(S,b){for(var p in b)y.call(b,p)&&(S[p]=b[p]);function d(){this.constructor=S}return d.prototype=b.prototype,S.prototype=new d,S.__super__=b.prototype,S},y={}.hasOwnProperty;C=F("./XMLNode"),N=F("./NodeType"),Q.exports=v=function(m){k(S,m);function S(b,p,d,t,l,r){if(S.__super__.constructor.call(this,b),p==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(d==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(p));if(!t)throw new Error("Missing DTD attribute type. "+this.debugInfo(p));if(!l)throw new Error("Missing DTD attribute default. "+this.debugInfo(p));if(l.indexOf("#")!==0&&(l="#"+l),!l.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(p));if(r&&!l.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(p));this.elementName=this.stringify.name(p),this.type=N.AttributeDeclaration,this.attributeName=this.stringify.name(d),this.attributeType=this.stringify.dtdAttType(t),r&&(this.defaultValue=this.stringify.dtdAttDefault(r)),this.defaultValueType=l}return S.prototype.toString=function(b){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(b))},S}(C)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],263:[function(F,Q,j){"use strict";(function(){var N,v,C,k=function(S,b){for(var p in b)y.call(b,p)&&(S[p]=b[p]);function d(){this.constructor=S}return d.prototype=b.prototype,S.prototype=new d,S.__super__=b.prototype,S},y={}.hasOwnProperty;C=F("./XMLNode"),N=F("./NodeType"),Q.exports=v=function(m){k(S,m);function S(b,p,d){if(S.__super__.constructor.call(this,b),p==null)throw new Error("Missing DTD element name. "+this.debugInfo());d||(d="(#PCDATA)"),Array.isArray(d)&&(d="("+d.join(",")+")"),this.name=this.stringify.name(p),this.type=N.ElementDeclaration,this.value=this.stringify.dtdElementValue(d)}return S.prototype.toString=function(b){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(b))},S}(C)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],264:[function(F,Q,j){"use strict";(function(){var N,v,C,k,y=function(b,p){for(var d in p)m.call(p,d)&&(b[d]=p[d]);function t(){this.constructor=b}return t.prototype=p.prototype,b.prototype=new t,b.__super__=p.prototype,b},m={}.hasOwnProperty;k=F("./Utility").isObject,C=F("./XMLNode"),N=F("./NodeType"),Q.exports=v=function(S){y(b,S);function b(p,d,t,l){if(b.__super__.constructor.call(this,p),t==null)throw new Error("Missing DTD entity name. "+this.debugInfo(t));if(l==null)throw new Error("Missing DTD entity value. "+this.debugInfo(t));if(this.pe=!!d,this.name=this.stringify.name(t),this.type=N.EntityDeclaration,!k(l))this.value=this.stringify.dtdEntityValue(l),this.internal=!0;else{if(!l.pubID&&!l.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(t));if(l.pubID&&!l.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(t));if(this.internal=!1,l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID)),l.nData!=null&&(this.nData=this.stringify.dtdNData(l.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(t))}}return Object.defineProperty(b.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(b.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(b.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(b.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(b.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(b.prototype,"xmlVersion",{get:function(){return null}}),b.prototype.toString=function(p){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(p))},b}(C)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],265:[function(F,Q,j){"use strict";(function(){var N,v,C,k=function(S,b){for(var p in b)y.call(b,p)&&(S[p]=b[p]);function d(){this.constructor=S}return d.prototype=b.prototype,S.prototype=new d,S.__super__=b.prototype,S},y={}.hasOwnProperty;C=F("./XMLNode"),N=F("./NodeType"),Q.exports=v=function(m){k(S,m);function S(b,p,d){if(S.__super__.constructor.call(this,b),p==null)throw new Error("Missing DTD notation name. "+this.debugInfo(p));if(!d.pubID&&!d.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(p));this.name=this.stringify.name(p),this.type=N.NotationDeclaration,d.pubID!=null&&(this.pubID=this.stringify.dtdPubID(d.pubID)),d.sysID!=null&&(this.sysID=this.stringify.dtdSysID(d.sysID))}return Object.defineProperty(S.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(S.prototype,"systemId",{get:function(){return this.sysID}}),S.prototype.toString=function(b){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(b))},S}(C)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],266:[function(F,Q,j){"use strict";(function(){var N,v,C,k,y=function(b,p){for(var d in p)m.call(p,d)&&(b[d]=p[d]);function t(){this.constructor=b}return t.prototype=p.prototype,b.prototype=new t,b.__super__=p.prototype,b},m={}.hasOwnProperty;k=F("./Utility").isObject,C=F("./XMLNode"),N=F("./NodeType"),Q.exports=v=function(S){y(b,S);function b(p,d,t,l){var r;b.__super__.constructor.call(this,p),k(d)&&(r=d,d=r.version,t=r.encoding,l=r.standalone),d||(d="1.0"),this.type=N.Declaration,this.version=this.stringify.xmlVersion(d),t!=null&&(this.encoding=this.stringify.xmlEncoding(t)),l!=null&&(this.standalone=this.stringify.xmlStandalone(l))}return b.prototype.toString=function(p){return this.options.writer.declaration(this,this.options.writer.filterOptions(p))},b}(C)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],267:[function(F,Q,j){"use strict";(function(){var N,v,C,k,y,m,S,b,p,d=function(r,i){for(var o in i)t.call(i,o)&&(r[o]=i[o]);function s(){this.constructor=r}return s.prototype=i.prototype,r.prototype=new s,r.__super__=i.prototype,r},t={}.hasOwnProperty;p=F("./Utility").isObject,b=F("./XMLNode"),N=F("./NodeType"),v=F("./XMLDTDAttList"),k=F("./XMLDTDEntity"),C=F("./XMLDTDElement"),y=F("./XMLDTDNotation"),S=F("./XMLNamedNodeMap"),Q.exports=m=function(l){d(r,l);function r(i,o,s){var c,a,u,f,w,_;if(r.__super__.constructor.call(this,i),this.type=N.DocType,i.children){for(f=i.children,a=0,u=f.length;a<u;a++)if(c=f[a],c.type===N.Element){this.name=c.name;break}}this.documentObject=i,p(o)&&(w=o,o=w.pubID,s=w.sysID),s==null&&(_=[o,s],s=_[0],o=_[1]),o!=null&&(this.pubID=this.stringify.dtdPubID(o)),s!=null&&(this.sysID=this.stringify.dtdSysID(s))}return Object.defineProperty(r.prototype,"entities",{get:function(){var o,s,c,a,u;for(a={},u=this.children,s=0,c=u.length;s<c;s++)o=u[s],o.type===N.EntityDeclaration&&!o.pe&&(a[o.name]=o);return new S(a)}}),Object.defineProperty(r.prototype,"notations",{get:function(){var o,s,c,a,u;for(a={},u=this.children,s=0,c=u.length;s<c;s++)o=u[s],o.type===N.NotationDeclaration&&(a[o.name]=o);return new S(a)}}),Object.defineProperty(r.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(r.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(r.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),r.prototype.element=function(i,o){var s;return s=new C(this,i,o),this.children.push(s),this},r.prototype.attList=function(i,o,s,c,a){var u;return u=new v(this,i,o,s,c,a),this.children.push(u),this},r.prototype.entity=function(i,o){var s;return s=new k(this,!1,i,o),this.children.push(s),this},r.prototype.pEntity=function(i,o){var s;return s=new k(this,!0,i,o),this.children.push(s),this},r.prototype.notation=function(i,o){var s;return s=new y(this,i,o),this.children.push(s),this},r.prototype.toString=function(i){return this.options.writer.docType(this,this.options.writer.filterOptions(i))},r.prototype.ele=function(i,o){return this.element(i,o)},r.prototype.att=function(i,o,s,c,a){return this.attList(i,o,s,c,a)},r.prototype.ent=function(i,o){return this.entity(i,o)},r.prototype.pent=function(i,o){return this.pEntity(i,o)},r.prototype.not=function(i,o){return this.notation(i,o)},r.prototype.up=function(){return this.root()||this.documentObject},r.prototype.isEqualNode=function(i){return r.__super__.isEqualNode.apply(this,arguments).isEqualNode(i)?i.name!==this.name||i.publicId!==this.publicId?!1:!(i.systemId!==this.systemId):!1},r}(b)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLNamedNodeMap":272,"./XMLNode":273}],268:[function(F,Q,j){"use strict";(function(){var N,v,C,k,y,m,S,b,p=function(l,r){for(var i in r)d.call(r,i)&&(l[i]=r[i]);function o(){this.constructor=l}return o.prototype=r.prototype,l.prototype=new o,l.__super__=r.prototype,l},d={}.hasOwnProperty;b=F("./Utility").isPlainObject,C=F("./XMLDOMImplementation"),v=F("./XMLDOMConfiguration"),y=F("./XMLNode"),N=F("./NodeType"),S=F("./XMLStringifier"),m=F("./XMLStringWriter"),Q.exports=k=function(t){p(l,t);function l(r){l.__super__.constructor.call(this,null),this.name="#document",this.type=N.Document,this.documentURI=null,this.domConfig=new v,r||(r={}),r.writer||(r.writer=new m),this.options=r,this.stringify=new S(r)}return Object.defineProperty(l.prototype,"implementation",{value:new C}),Object.defineProperty(l.prototype,"doctype",{get:function(){var i,o,s,c;for(c=this.children,o=0,s=c.length;o<s;o++)if(i=c[o],i.type===N.DocType)return i;return null}}),Object.defineProperty(l.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(l.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(l.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(l.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===N.Declaration?this.children[0].encoding:null}}),Object.defineProperty(l.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===N.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(l.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===N.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(l.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(l.prototype,"origin",{get:function(){return null}}),Object.defineProperty(l.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(l.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(l.prototype,"contentType",{get:function(){return null}}),l.prototype.end=function(r){var i;return i={},r?b(r)&&(i=r,r=this.options.writer):r=this.options.writer,r.document(this,r.filterOptions(i))},l.prototype.toString=function(r){return this.options.writer.document(this,this.options.writer.filterOptions(r))},l.prototype.createElement=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createTextNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createComment=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createCDATASection=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createProcessingInstruction=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createAttribute=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createEntityReference=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.importNode=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createElementNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.getElementById=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.adoptNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.renameNode=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.getElementsByClassName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createEvent=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createNodeIterator=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},l.prototype.createTreeWalker=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},l}(y)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDOMConfiguration":258,"./XMLDOMImplementation":260,"./XMLNode":273,"./XMLStringWriter":278,"./XMLStringifier":279}],269:[function(F,Q,j){"use strict";(function(){var N,v,C,k,y,m,S,b,p,d,t,l,r,i,o,s,c,a,u,f,w,_,h,R,O={}.hasOwnProperty;R=F("./Utility"),_=R.isObject,w=R.isFunction,h=R.isPlainObject,f=R.getValue,N=F("./NodeType"),l=F("./XMLDocument"),i=F("./XMLElement"),k=F("./XMLCData"),y=F("./XMLComment"),s=F("./XMLRaw"),u=F("./XMLText"),o=F("./XMLProcessingInstruction"),d=F("./XMLDeclaration"),t=F("./XMLDocType"),m=F("./XMLDTDAttList"),b=F("./XMLDTDEntity"),S=F("./XMLDTDElement"),p=F("./XMLDTDNotation"),C=F("./XMLAttribute"),a=F("./XMLStringifier"),c=F("./XMLStringWriter"),v=F("./WriterState"),Q.exports=r=function(){function g(x,E,T){var M;this.name="?xml",this.type=N.Document,x||(x={}),M={},x.writer?h(x.writer)&&(M=x.writer,x.writer=new c):x.writer=new c,this.options=x,this.writer=x.writer,this.writerOptions=this.writer.filterOptions(M),this.stringify=new a(x),this.onDataCallback=E||function(){},this.onEndCallback=T||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return g.prototype.createChildNode=function(x){var E,T,M,L,A,V,z,W;switch(x.type){case N.CData:this.cdata(x.value);break;case N.Comment:this.comment(x.value);break;case N.Element:M={},z=x.attribs;for(T in z){if(!O.call(z,T))continue;E=z[T],M[T]=E.value}this.node(x.name,M);break;case N.Dummy:this.dummy();break;case N.Raw:this.raw(x.value);break;case N.Text:this.text(x.value);break;case N.ProcessingInstruction:this.instruction(x.target,x.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+x.constructor.name)}for(W=x.children,A=0,V=W.length;A<V;A++)L=W[A],this.createChildNode(L),L.type===N.Element&&this.up();return this},g.prototype.dummy=function(){return this},g.prototype.node=function(x,E,T){var M;if(x==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(x));return this.openCurrent(),x=f(x),E==null&&(E={}),E=f(E),_(E)||(M=[E,T],T=M[0],E=M[1]),this.currentNode=new i(this,x,E),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,T!=null&&this.text(T),this},g.prototype.element=function(x,E,T){var M,L,A,V,z,W;if(this.currentNode&&this.currentNode.type===N.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(x)||_(x)||w(x))for(V=this.options.noValidation,this.options.noValidation=!0,W=new l(this.options).element("TEMP_ROOT"),W.element(x),this.options.noValidation=V,z=W.children,L=0,A=z.length;L<A;L++)M=z[L],this.createChildNode(M),M.type===N.Element&&this.up();else this.node(x,E,T);return this},g.prototype.attribute=function(x,E){var T,M;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(x));if(x!=null&&(x=f(x)),_(x))for(T in x){if(!O.call(x,T))continue;M=x[T],this.attribute(T,M)}else w(E)&&(E=E.apply()),this.options.keepNullAttributes&&E==null?this.currentNode.attribs[x]=new C(this,x,""):E!=null&&(this.currentNode.attribs[x]=new C(this,x,E));return this},g.prototype.text=function(x){var E;return this.openCurrent(),E=new u(this,x),this.onData(this.writer.text(E,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.prototype.cdata=function(x){var E;return this.openCurrent(),E=new k(this,x),this.onData(this.writer.cdata(E,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.prototype.comment=function(x){var E;return this.openCurrent(),E=new y(this,x),this.onData(this.writer.comment(E,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.prototype.raw=function(x){var E;return this.openCurrent(),E=new s(this,x),this.onData(this.writer.raw(E,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.prototype.instruction=function(x,E){var T,M,L,A,V;if(this.openCurrent(),x!=null&&(x=f(x)),E!=null&&(E=f(E)),Array.isArray(x))for(T=0,A=x.length;T<A;T++)M=x[T],this.instruction(M);else if(_(x))for(M in x){if(!O.call(x,M))continue;L=x[M],this.instruction(M,L)}else w(E)&&(E=E.apply()),V=new o(this,x,E),this.onData(this.writer.processingInstruction(V,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},g.prototype.declaration=function(x,E,T){var M;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return M=new d(this,x,E,T),this.onData(this.writer.declaration(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.prototype.doctype=function(x,E,T){if(this.openCurrent(),x==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 t(this,E,T),this.currentNode.rootNodeName=x,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},g.prototype.dtdElement=function(x,E){var T;return this.openCurrent(),T=new S(this,x,E),this.onData(this.writer.dtdElement(T,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.prototype.attList=function(x,E,T,M,L){var A;return this.openCurrent(),A=new m(this,x,E,T,M,L),this.onData(this.writer.dtdAttList(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.prototype.entity=function(x,E){var T;return this.openCurrent(),T=new b(this,!1,x,E),this.onData(this.writer.dtdEntity(T,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.prototype.pEntity=function(x,E){var T;return this.openCurrent(),T=new b(this,!0,x,E),this.onData(this.writer.dtdEntity(T,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.prototype.notation=function(x,E){var T;return this.openCurrent(),T=new p(this,x,E),this.onData(this.writer.dtdNotation(T,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},g.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},g.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},g.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},g.prototype.openNode=function(x){var E,T,M,L;if(!x.isOpen){if(!this.root&&this.currentLevel===0&&x.type===N.Element&&(this.root=x),T="",x.type===N.Element){this.writerOptions.state=v.OpenTag,T=this.writer.indent(x,this.writerOptions,this.currentLevel)+"<"+x.name,L=x.attribs;for(M in L){if(!O.call(L,M))continue;E=L[M],T+=this.writer.attribute(E,this.writerOptions,this.currentLevel)}T+=(x.children?">":"/>")+this.writer.endline(x,this.writerOptions,this.currentLevel),this.writerOptions.state=v.InsideTag}else this.writerOptions.state=v.OpenTag,T=this.writer.indent(x,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+x.rootNodeName,x.pubID&&x.sysID?T+=' PUBLIC "'+x.pubID+'" "'+x.sysID+'"':x.sysID&&(T+=' SYSTEM "'+x.sysID+'"'),x.children?(T+=" [",this.writerOptions.state=v.InsideTag):(this.writerOptions.state=v.CloseTag,T+=">"),T+=this.writer.endline(x,this.writerOptions,this.currentLevel);return this.onData(T,this.currentLevel),x.isOpen=!0}},g.prototype.closeNode=function(x){var E;if(!x.isClosed)return E="",this.writerOptions.state=v.CloseTag,x.type===N.Element?E=this.writer.indent(x,this.writerOptions,this.currentLevel)+"</"+x.name+">"+this.writer.endline(x,this.writerOptions,this.currentLevel):E=this.writer.indent(x,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(x,this.writerOptions,this.currentLevel),this.writerOptions.state=v.None,this.onData(E,this.currentLevel),x.isClosed=!0},g.prototype.onData=function(x,E){return this.documentStarted=!0,this.onDataCallback(x,E+1)},g.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},g.prototype.debugInfo=function(x){return x==null?"":"node: <"+x+">"},g.prototype.ele=function(){return this.element.apply(this,arguments)},g.prototype.nod=function(x,E,T){return this.node(x,E,T)},g.prototype.txt=function(x){return this.text(x)},g.prototype.dat=function(x){return this.cdata(x)},g.prototype.com=function(x){return this.comment(x)},g.prototype.ins=function(x,E){return this.instruction(x,E)},g.prototype.dec=function(x,E,T){return this.declaration(x,E,T)},g.prototype.dtd=function(x,E,T){return this.doctype(x,E,T)},g.prototype.e=function(x,E,T){return this.element(x,E,T)},g.prototype.n=function(x,E,T){return this.node(x,E,T)},g.prototype.t=function(x){return this.text(x)},g.prototype.d=function(x){return this.cdata(x)},g.prototype.c=function(x){return this.comment(x)},g.prototype.r=function(x){return this.raw(x)},g.prototype.i=function(x,E){return this.instruction(x,E)},g.prototype.att=function(){return this.currentNode&&this.currentNode.type===N.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},g.prototype.a=function(){return this.currentNode&&this.currentNode.type===N.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},g.prototype.ent=function(x,E){return this.entity(x,E)},g.prototype.pent=function(x,E){return this.pEntity(x,E)},g.prototype.not=function(x,E){return this.notation(x,E)},g}()}).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(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k,y,m,S=function(d,t){for(var l in t)b.call(t,l)&&(d[l]=t[l]);function r(){this.constructor=d}return r.prototype=t.prototype,d.prototype=new r,d.__super__=t.prototype,d},b={}.hasOwnProperty;m=F("./XMLNode"),k=F("./NodeType"),Q.exports=y=function(p){S(d,p);function d(t){d.__super__.constructor.call(this,t),this.type=k.Dummy}return d.prototype.clone=function(){return(0,v.default)(this)},d.prototype.toString=function(t){return""},d}(m)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],271:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k,y,m,S,b,p,d,t,l,r=function(s,c){for(var a in c)i.call(c,a)&&(s[a]=c[a]);function u(){this.constructor=s}return u.prototype=c.prototype,s.prototype=new u,s.__super__=c.prototype,s},i={}.hasOwnProperty;l=F("./Utility"),t=l.isObject,d=l.isFunction,p=l.getValue,b=F("./XMLNode"),k=F("./NodeType"),y=F("./XMLAttribute"),S=F("./XMLNamedNodeMap"),Q.exports=m=function(o){r(s,o);function s(c,a,u){var f,w,_,h;if(s.__super__.constructor.call(this,c),a==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(a),this.type=k.Element,this.attribs={},this.schemaTypeInfo=null,u!=null&&this.attribute(u),c.type===k.Document&&(this.isRoot=!0,this.documentObject=c,c.rootObject=this,c.children)){for(h=c.children,w=0,_=h.length;w<_;w++)if(f=h[w],f.type===k.DocType){f.name=this.name;break}}}return Object.defineProperty(s.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(s.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(s.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(s.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(s.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(s.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(s.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(s.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new S(this.attribs)),this.attributeMap}}),s.prototype.clone=function(){var c,a,u,f;u=(0,v.default)(this),u.isRoot&&(u.documentObject=null),u.attribs={},f=this.attribs;for(a in f){if(!i.call(f,a))continue;c=f[a],u.attribs[a]=c.clone()}return u.children=[],this.children.forEach(function(w){var _;return _=w.clone(),_.parent=u,u.children.push(_)}),u},s.prototype.attribute=function(c,a){var u,f;if(c!=null&&(c=p(c)),t(c))for(u in c){if(!i.call(c,u))continue;f=c[u],this.attribute(u,f)}else d(a)&&(a=a.apply()),this.options.keepNullAttributes&&a==null?this.attribs[c]=new y(this,c,""):a!=null&&(this.attribs[c]=new y(this,c,a));return this},s.prototype.removeAttribute=function(c){var a,u,f;if(c==null)throw new Error("Missing attribute name. "+this.debugInfo());if(c=p(c),Array.isArray(c))for(u=0,f=c.length;u<f;u++)a=c[u],delete this.attribs[a];else delete this.attribs[c];return this},s.prototype.toString=function(c){return this.options.writer.element(this,this.options.writer.filterOptions(c))},s.prototype.att=function(c,a){return this.attribute(c,a)},s.prototype.a=function(c,a){return this.attribute(c,a)},s.prototype.getAttribute=function(c){return this.attribs.hasOwnProperty(c)?this.attribs[c].value:null},s.prototype.setAttribute=function(c,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getAttributeNode=function(c){return this.attribs.hasOwnProperty(c)?this.attribs[c]:null},s.prototype.setAttributeNode=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.removeAttributeNode=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getElementsByTagName=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getAttributeNS=function(c,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.setAttributeNS=function(c,a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.removeAttributeNS=function(c,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getAttributeNodeNS=function(c,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.setAttributeNodeNS=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getElementsByTagNameNS=function(c,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.hasAttribute=function(c){return this.attribs.hasOwnProperty(c)},s.prototype.hasAttributeNS=function(c,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.setIdAttribute=function(c,a){return this.attribs.hasOwnProperty(c)?this.attribs[c].isId:a},s.prototype.setIdAttributeNS=function(c,a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.setIdAttributeNode=function(c,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getElementsByTagName=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getElementsByTagNameNS=function(c,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.getElementsByClassName=function(c){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.isEqualNode=function(c){var a,u,f;if(!s.__super__.isEqualNode.apply(this,arguments).isEqualNode(c))return!1;if(c.namespaceURI!==this.namespaceURI)return!1;if(c.prefix!==this.prefix)return!1;if(c.localName!==this.localName)return!1;if(c.attribs.length!==this.attribs.length)return!1;for(a=u=0,f=this.attribs.length-1;0<=f?u<=f:u>=f;a=0<=f?++u:--u)if(!this.attribs[a].isEqualNode(c.attribs[a]))return!1;return!0},s}(b)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLAttribute":254,"./XMLNamedNodeMap":272,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],272:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/keys"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k;Q.exports=k=function(){function y(m){this.nodes=m}return Object.defineProperty(y.prototype,"length",{get:function(){return(0,v.default)(this.nodes).length||0}}),y.prototype.clone=function(){return this.nodes=null},y.prototype.getNamedItem=function(m){return this.nodes[m]},y.prototype.setNamedItem=function(m){var S;return S=this.nodes[m.nodeName],this.nodes[m.nodeName]=m,S||null},y.prototype.removeNamedItem=function(m){var S;return S=this.nodes[m],delete this.nodes[m],S||null},y.prototype.item=function(m){return this.nodes[(0,v.default)(this.nodes)[m]]||null},y.prototype.getNamedItemNS=function(m,S){throw new Error("This DOM method is not implemented.")},y.prototype.setNamedItemNS=function(m){throw new Error("This DOM method is not implemented.")},y.prototype.removeNamedItemNS=function(m,S){throw new Error("This DOM method is not implemented.")},y}()}).call(void 0)},{"babel-runtime/core-js/object/keys":60}],273:[function(F,Q,j){"use strict";(function(){var N,v,C,k,y,m,S,b,p,d,t,l,r,i,o,s,c,a,u,f={}.hasOwnProperty;u=F("./Utility"),a=u.isObject,c=u.isFunction,s=u.isEmpty,o=u.getValue,b=null,C=null,k=null,y=null,m=null,r=null,i=null,l=null,S=null,v=null,t=null,p=null,N=null,Q.exports=d=function(){function w(_){this.parent=_,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,b||(b=F("./XMLElement"),C=F("./XMLCData"),k=F("./XMLComment"),y=F("./XMLDeclaration"),m=F("./XMLDocType"),r=F("./XMLRaw"),i=F("./XMLText"),l=F("./XMLProcessingInstruction"),S=F("./XMLDummy"),v=F("./NodeType"),t=F("./XMLNodeList"),p=F("./XMLNamedNodeMap"),N=F("./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 t(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 h;return h=this.parent.children.indexOf(this),this.parent.children[h-1]||null}}),Object.defineProperty(w.prototype,"nextSibling",{get:function(){var h;return h=this.parent.children.indexOf(this),this.parent.children[h+1]||null}}),Object.defineProperty(w.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(w.prototype,"textContent",{get:function(){var h,R,O,g,x;if(this.nodeType===v.Element||this.nodeType===v.DocumentFragment){for(x="",g=this.children,R=0,O=g.length;R<O;R++)h=g[R],h.textContent&&(x+=h.textContent);return x}else return null},set:function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),w.prototype.setParent=function(_){var h,R,O,g,x;for(this.parent=_,_&&(this.options=_.options,this.stringify=_.stringify),g=this.children,x=[],R=0,O=g.length;R<O;R++)h=g[R],x.push(h.setParent(this));return x},w.prototype.element=function(_,h,R){var O,g,x,E,T,M,L,A,V,z,W;if(M=null,h===null&&R==null&&(V=[{},null],h=V[0],R=V[1]),h==null&&(h={}),h=o(h),a(h)||(z=[h,R],R=z[0],h=z[1]),_!=null&&(_=o(_)),Array.isArray(_))for(x=0,L=_.length;x<L;x++)g=_[x],M=this.element(g);else if(c(_))M=this.element(_.apply());else if(a(_))for(T in _){if(!f.call(_,T))continue;if(W=_[T],c(W)&&(W=W.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&T.indexOf(this.stringify.convertAttKey)===0)M=this.attribute(T.substr(this.stringify.convertAttKey.length),W);else if(!this.options.separateArrayItems&&Array.isArray(W)&&s(W))M=this.dummy();else if(a(W)&&s(W))M=this.element(T);else if(!this.options.keepNullNodes&&W==null)M=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(W))for(E=0,A=W.length;E<A;E++)g=W[E],O={},O[T]=g,M=this.element(O);else a(W)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&T.indexOf(this.stringify.convertTextKey)===0?M=this.element(W):(M=this.element(T),M.element(W)):M=this.element(T,W)}else!this.options.keepNullNodes&&R===null?M=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&_.indexOf(this.stringify.convertTextKey)===0?M=this.text(R):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&_.indexOf(this.stringify.convertCDataKey)===0?M=this.cdata(R):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&_.indexOf(this.stringify.convertCommentKey)===0?M=this.comment(R):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&_.indexOf(this.stringify.convertRawKey)===0?M=this.raw(R):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&_.indexOf(this.stringify.convertPIKey)===0?M=this.instruction(_.substr(this.stringify.convertPIKey.length),R):M=this.node(_,h,R);if(M==null)throw new Error("Could not create any elements with: "+_+". "+this.debugInfo());return M},w.prototype.insertBefore=function(_,h,R){var O,g,x,E,T;if(_!=null?_.type:void 0)return x=_,E=h,x.setParent(this),E?(g=children.indexOf(E),T=children.splice(g),children.push(x),Array.prototype.push.apply(children,T)):children.push(x),x;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(_));return g=this.parent.children.indexOf(this),T=this.parent.children.splice(g),O=this.parent.element(_,h,R),Array.prototype.push.apply(this.parent.children,T),O},w.prototype.insertAfter=function(_,h,R){var O,g,x;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(_));return g=this.parent.children.indexOf(this),x=this.parent.children.splice(g+1),O=this.parent.element(_,h,R),Array.prototype.push.apply(this.parent.children,x),O},w.prototype.remove=function(){var _,h;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return _=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[_,_-_+1].concat(h=[])),this.parent},w.prototype.node=function(_,h,R){var O,g;return _!=null&&(_=o(_)),h||(h={}),h=o(h),a(h)||(g=[h,R],R=g[0],h=g[1]),O=new b(this,_,h),R!=null&&O.text(R),this.children.push(O),O},w.prototype.text=function(_){var h;return a(_)&&this.element(_),h=new i(this,_),this.children.push(h),this},w.prototype.cdata=function(_){var h;return h=new C(this,_),this.children.push(h),this},w.prototype.comment=function(_){var h;return h=new k(this,_),this.children.push(h),this},w.prototype.commentBefore=function(_){var h,R,O;return R=this.parent.children.indexOf(this),O=this.parent.children.splice(R),h=this.parent.comment(_),Array.prototype.push.apply(this.parent.children,O),this},w.prototype.commentAfter=function(_){var h,R,O;return R=this.parent.children.indexOf(this),O=this.parent.children.splice(R+1),h=this.parent.comment(_),Array.prototype.push.apply(this.parent.children,O),this},w.prototype.raw=function(_){var h;return h=new r(this,_),this.children.push(h),this},w.prototype.dummy=function(){var _;return _=new S(this),_},w.prototype.instruction=function(_,h){var R,O,g,x,E;if(_!=null&&(_=o(_)),h!=null&&(h=o(h)),Array.isArray(_))for(x=0,E=_.length;x<E;x++)R=_[x],this.instruction(R);else if(a(_))for(R in _){if(!f.call(_,R))continue;O=_[R],this.instruction(R,O)}else c(h)&&(h=h.apply()),g=new l(this,_,h),this.children.push(g);return this},w.prototype.instructionBefore=function(_,h){var R,O,g;return O=this.parent.children.indexOf(this),g=this.parent.children.splice(O),R=this.parent.instruction(_,h),Array.prototype.push.apply(this.parent.children,g),this},w.prototype.instructionAfter=function(_,h){var R,O,g;return O=this.parent.children.indexOf(this),g=this.parent.children.splice(O+1),R=this.parent.instruction(_,h),Array.prototype.push.apply(this.parent.children,g),this},w.prototype.declaration=function(_,h,R){var O,g;return O=this.document(),g=new y(O,_,h,R),O.children.length===0?O.children.unshift(g):O.children[0].type===v.Declaration?O.children[0]=g:O.children.unshift(g),O.root()||O},w.prototype.dtd=function(_,h){var R,O,g,x,E,T,M,L,A,V;for(O=this.document(),g=new m(O,_,h),A=O.children,x=E=0,M=A.length;E<M;x=++E)if(R=A[x],R.type===v.DocType)return O.children[x]=g,g;for(V=O.children,x=T=0,L=V.length;T<L;x=++T)if(R=V[x],R.isRoot)return O.children.splice(x,0,g),g;return O.children.push(g),g},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 _;for(_=this;_;){if(_.type===v.Document)return _.rootObject;if(_.isRoot)return _;_=_.parent}},w.prototype.document=function(){var _;for(_=this;_;){if(_.type===v.Document)return _;_=_.parent}},w.prototype.end=function(_){return this.document().end(_)},w.prototype.prev=function(){var _;if(_=this.parent.children.indexOf(this),_<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[_-1]},w.prototype.next=function(){var _;if(_=this.parent.children.indexOf(this),_===-1||_===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[_+1]},w.prototype.importDocument=function(_){var h;return h=_.root().clone(),h.parent=this,h.isRoot=!1,this.children.push(h),this},w.prototype.debugInfo=function(_){var h,R;return _=_||this.name,_==null&&!((h=this.parent)!=null?h.name:void 0)?"":_==null?"parent: <"+this.parent.name+">":((R=this.parent)!=null?R.name:void 0)?"node: <"+_+">, parent: <"+this.parent.name+">":"node: <"+_+">"},w.prototype.ele=function(_,h,R){return this.element(_,h,R)},w.prototype.nod=function(_,h,R){return this.node(_,h,R)},w.prototype.txt=function(_){return this.text(_)},w.prototype.dat=function(_){return this.cdata(_)},w.prototype.com=function(_){return this.comment(_)},w.prototype.ins=function(_,h){return this.instruction(_,h)},w.prototype.doc=function(){return this.document()},w.prototype.dec=function(_,h,R){return this.declaration(_,h,R)},w.prototype.e=function(_,h,R){return this.element(_,h,R)},w.prototype.n=function(_,h,R){return this.node(_,h,R)},w.prototype.t=function(_){return this.text(_)},w.prototype.d=function(_){return this.cdata(_)},w.prototype.c=function(_){return this.comment(_)},w.prototype.r=function(_){return this.raw(_)},w.prototype.i=function(_,h){return this.instruction(_,h)},w.prototype.u=function(){return this.up()},w.prototype.importXMLBuilder=function(_){return this.importDocument(_)},w.prototype.replaceChild=function(_,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.removeChild=function(_){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.appendChild=function(_){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.hasChildNodes=function(){return this.children.length!==0},w.prototype.cloneNode=function(_){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(_,h){return!0},w.prototype.hasAttributes=function(){return this.attribs.length!==0},w.prototype.compareDocumentPosition=function(_){var h,R;return h=this,h===_?0:this.document()!==_.document()?(R=N.Disconnected|N.ImplementationSpecific,Math.random()<.5?R|=N.Preceding:R|=N.Following,R):h.isAncestor(_)?N.Contains|N.Preceding:h.isDescendant(_)?N.Contains|N.Following:h.isPreceding(_)?N.Preceding:N.Following},w.prototype.isSameNode=function(_){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.lookupPrefix=function(_){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isDefaultNamespace=function(_){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.lookupNamespaceURI=function(_){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isEqualNode=function(_){var h,R,O;if(_.nodeType!==this.nodeType)return!1;if(_.children.length!==this.children.length)return!1;for(h=R=0,O=this.children.length-1;0<=O?R<=O:R>=O;h=0<=O?++R:--R)if(!this.children[h].isEqualNode(_.children[h]))return!1;return!0},w.prototype.getFeature=function(_,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.setUserData=function(_,h,R){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.getUserData=function(_){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.contains=function(_){return _?_===this||this.isDescendant(_):!1},w.prototype.isDescendant=function(_){var h,R,O,g,x;for(x=this.children,O=0,g=x.length;O<g;O++){if(h=x[O],_===h)return!0;if(R=h.isDescendant(_),R)return!0}return!1},w.prototype.isAncestor=function(_){return _.isDescendant(this)},w.prototype.isPreceding=function(_){var h,R;return h=this.treePosition(_),R=this.treePosition(this),h===-1||R===-1?!1:h<R},w.prototype.isFollowing=function(_){var h,R;return h=this.treePosition(_),R=this.treePosition(this),h===-1||R===-1?!1:h>R},w.prototype.treePosition=function(_){var h,R;return R=0,h=!1,this.foreachTreeNode(this.document(),function(O){if(R++,!h&&O===_)return h=!0}),h?R:-1},w.prototype.foreachTreeNode=function(_,h){var R,O,g,x,E;for(_||(_=this.document()),x=_.children,O=0,g=x.length;O<g;O++){if(R=x[O],E=h(R))return E;if(E=this.foreachTreeNode(R,h),E)return E}},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(F,Q,j){"use strict";(function(){var N;Q.exports=N=function(){function v(C){this.nodes=C}return Object.defineProperty(v.prototype,"length",{get:function(){return this.nodes.length||0}}),v.prototype.clone=function(){return this.nodes=null},v.prototype.item=function(C){return this.nodes[C]||null},v}()}).call(void 0)},{}],275:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k,y,m,S=function(d,t){for(var l in t)b.call(t,l)&&(d[l]=t[l]);function r(){this.constructor=d}return r.prototype=t.prototype,d.prototype=new r,d.__super__=t.prototype,d},b={}.hasOwnProperty;k=F("./NodeType"),y=F("./XMLCharacterData"),Q.exports=m=function(p){S(d,p);function d(t,l,r){if(d.__super__.constructor.call(this,t),l==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=k.ProcessingInstruction,this.target=this.stringify.insTarget(l),this.name=this.target,r&&(this.value=this.stringify.insValue(r))}return d.prototype.clone=function(){return(0,v.default)(this)},d.prototype.toString=function(t){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(t))},d.prototype.isEqualNode=function(t){return d.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)?!(t.target!==this.target):!1},d}(y)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],276:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k,y,m,S=function(d,t){for(var l in t)b.call(t,l)&&(d[l]=t[l]);function r(){this.constructor=d}return r.prototype=t.prototype,d.prototype=new r,d.__super__=t.prototype,d},b={}.hasOwnProperty;k=F("./NodeType"),y=F("./XMLNode"),Q.exports=m=function(p){S(d,p);function d(t,l){if(d.__super__.constructor.call(this,t),l==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=k.Raw,this.value=this.stringify.raw(l)}return d.prototype.clone=function(){return(0,v.default)(this)},d.prototype.toString=function(t){return this.options.writer.raw(this,this.options.writer.filterOptions(t))},d}(y)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],277:[function(F,Q,j){"use strict";(function(){var N,v,C,k,y=function(b,p){for(var d in p)m.call(p,d)&&(b[d]=p[d]);function t(){this.constructor=b}return t.prototype=p.prototype,b.prototype=new t,b.__super__=p.prototype,b},m={}.hasOwnProperty;N=F("./NodeType"),k=F("./XMLWriterBase"),v=F("./WriterState"),Q.exports=C=function(S){y(b,S);function b(p,d){this.stream=p,b.__super__.constructor.call(this,d)}return b.prototype.endline=function(p,d,t){return p.isLastRootNode&&d.state===v.CloseTag?"":b.__super__.endline.call(this,p,d,t)},b.prototype.document=function(p,d){var t,l,r,i,o,s,c,a,u;for(c=p.children,l=r=0,o=c.length;r<o;l=++r)t=c[l],t.isLastRootNode=l===p.children.length-1;for(d=this.filterOptions(d),a=p.children,u=[],i=0,s=a.length;i<s;i++)t=a[i],u.push(this.writeChildNode(t,d,0));return u},b.prototype.attribute=function(p,d,t){return this.stream.write(b.__super__.attribute.call(this,p,d,t))},b.prototype.cdata=function(p,d,t){return this.stream.write(b.__super__.cdata.call(this,p,d,t))},b.prototype.comment=function(p,d,t){return this.stream.write(b.__super__.comment.call(this,p,d,t))},b.prototype.declaration=function(p,d,t){return this.stream.write(b.__super__.declaration.call(this,p,d,t))},b.prototype.docType=function(p,d,t){var l,r,i,o;if(t||(t=0),this.openNode(p,d,t),d.state=v.OpenTag,this.stream.write(this.indent(p,d,t)),this.stream.write("<!DOCTYPE "+p.root().name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(p,d,t)),d.state=v.InsideTag,o=p.children,r=0,i=o.length;r<i;r++)l=o[r],this.writeChildNode(l,d,t+1);d.state=v.CloseTag,this.stream.write("]")}return d.state=v.CloseTag,this.stream.write(d.spaceBeforeSlash+">"),this.stream.write(this.endline(p,d,t)),d.state=v.None,this.closeNode(p,d,t)},b.prototype.element=function(p,d,t){var l,r,i,o,s,c,a,u,f,w;t||(t=0),this.openNode(p,d,t),d.state=v.OpenTag,this.stream.write(this.indent(p,d,t)+"<"+p.name),f=p.attribs;for(a in f){if(!m.call(f,a))continue;l=f[a],this.attribute(l,d,t)}if(i=p.children.length,o=i===0?null:p.children[0],i===0||p.children.every(function(_){return(_.type===N.Text||_.type===N.Raw)&&_.value===""}))d.allowEmpty?(this.stream.write(">"),d.state=v.CloseTag,this.stream.write("</"+p.name+">")):(d.state=v.CloseTag,this.stream.write(d.spaceBeforeSlash+"/>"));else if(d.pretty&&i===1&&(o.type===N.Text||o.type===N.Raw)&&o.value!=null)this.stream.write(">"),d.state=v.InsideTag,d.suppressPrettyCount++,u=!0,this.writeChildNode(o,d,t+1),d.suppressPrettyCount--,u=!1,d.state=v.CloseTag,this.stream.write("</"+p.name+">");else{for(this.stream.write(">"+this.endline(p,d,t)),d.state=v.InsideTag,w=p.children,s=0,c=w.length;s<c;s++)r=w[s],this.writeChildNode(r,d,t+1);d.state=v.CloseTag,this.stream.write(this.indent(p,d,t)+"</"+p.name+">")}return this.stream.write(this.endline(p,d,t)),d.state=v.None,this.closeNode(p,d,t)},b.prototype.processingInstruction=function(p,d,t){return this.stream.write(b.__super__.processingInstruction.call(this,p,d,t))},b.prototype.raw=function(p,d,t){return this.stream.write(b.__super__.raw.call(this,p,d,t))},b.prototype.text=function(p,d,t){return this.stream.write(b.__super__.text.call(this,p,d,t))},b.prototype.dtdAttList=function(p,d,t){return this.stream.write(b.__super__.dtdAttList.call(this,p,d,t))},b.prototype.dtdElement=function(p,d,t){return this.stream.write(b.__super__.dtdElement.call(this,p,d,t))},b.prototype.dtdEntity=function(p,d,t){return this.stream.write(b.__super__.dtdEntity.call(this,p,d,t))},b.prototype.dtdNotation=function(p,d,t){return this.stream.write(b.__super__.dtdNotation.call(this,p,d,t))},b}(k)}).call(void 0)},{"./NodeType":251,"./WriterState":253,"./XMLWriterBase":281}],278:[function(F,Q,j){"use strict";(function(){var N,v,C=function(m,S){for(var b in S)k.call(S,b)&&(m[b]=S[b]);function p(){this.constructor=m}return p.prototype=S.prototype,m.prototype=new p,m.__super__=S.prototype,m},k={}.hasOwnProperty;v=F("./XMLWriterBase"),Q.exports=N=function(y){C(m,y);function m(S){m.__super__.constructor.call(this,S)}return m.prototype.document=function(S,b){var p,d,t,l,r;for(b=this.filterOptions(b),l="",r=S.children,d=0,t=r.length;d<t;d++)p=r[d],l+=this.writeChildNode(p,b,0);return b.pretty&&l.slice(-b.newline.length)===b.newline&&(l=l.slice(0,-b.newline.length)),l},m}(v)}).call(void 0)},{"./XMLWriterBase":281}],279:[function(F,Q,j){"use strict";(function(){var N,v=function(y,m){return function(){return y.apply(m,arguments)}},C={}.hasOwnProperty;Q.exports=N=function(){function k(y){this.assertLegalName=v(this.assertLegalName,this),this.assertLegalChar=v(this.assertLegalChar,this);var m,S,b;y||(y={}),this.options=y,this.options.version||(this.options.version="1.0"),S=y.stringify||{};for(m in S){if(!C.call(S,m))continue;b=S[m],this[m]=b}}return k.prototype.name=function(y){return this.options.noValidation?y:this.assertLegalName(""+y||"")},k.prototype.text=function(y){return this.options.noValidation?y:this.assertLegalChar(this.textEscape(""+y||""))},k.prototype.cdata=function(y){return this.options.noValidation?y:(y=""+y||"",y=y.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(y))},k.prototype.comment=function(y){if(this.options.noValidation)return y;if(y=""+y||"",y.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+y);return this.assertLegalChar(y)},k.prototype.raw=function(y){return this.options.noValidation?y:""+y||""},k.prototype.attValue=function(y){return this.options.noValidation?y:this.assertLegalChar(this.attEscape(y=""+y||""))},k.prototype.insTarget=function(y){return this.options.noValidation?y:this.assertLegalChar(""+y||"")},k.prototype.insValue=function(y){if(this.options.noValidation)return y;if(y=""+y||"",y.match(/\?>/))throw new Error("Invalid processing instruction value: "+y);return this.assertLegalChar(y)},k.prototype.xmlVersion=function(y){if(this.options.noValidation)return y;if(y=""+y||"",!y.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+y);return y},k.prototype.xmlEncoding=function(y){if(this.options.noValidation)return y;if(y=""+y||"",!y.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+y);return this.assertLegalChar(y)},k.prototype.xmlStandalone=function(y){return this.options.noValidation?y:y?"yes":"no"},k.prototype.dtdPubID=function(y){return this.options.noValidation?y:this.assertLegalChar(""+y||"")},k.prototype.dtdSysID=function(y){return this.options.noValidation?y:this.assertLegalChar(""+y||"")},k.prototype.dtdElementValue=function(y){return this.options.noValidation?y:this.assertLegalChar(""+y||"")},k.prototype.dtdAttType=function(y){return this.options.noValidation?y:this.assertLegalChar(""+y||"")},k.prototype.dtdAttDefault=function(y){return this.options.noValidation?y:this.assertLegalChar(""+y||"")},k.prototype.dtdEntityValue=function(y){return this.options.noValidation?y:this.assertLegalChar(""+y||"")},k.prototype.dtdNData=function(y){return this.options.noValidation?y:this.assertLegalChar(""+y||"")},k.prototype.convertAttKey="@",k.prototype.convertPIKey="?",k.prototype.convertTextKey="#text",k.prototype.convertCDataKey="#cdata",k.prototype.convertCommentKey="#comment",k.prototype.convertRawKey="#raw",k.prototype.assertLegalChar=function(y){var m,S;if(this.options.noValidation)return y;if(m="",this.options.version==="1.0"){if(m=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,S=y.match(m))throw new Error("Invalid character in string: "+y+" at index "+S.index)}else if(this.options.version==="1.1"&&(m=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,S=y.match(m)))throw new Error("Invalid character in string: "+y+" at index "+S.index);return y},k.prototype.assertLegalName=function(y){var m;if(this.options.noValidation)return y;if(this.assertLegalChar(y),m=/^([: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])*$/,!y.match(m))throw new Error("Invalid character in name");return y},k.prototype.textEscape=function(y){var m;return this.options.noValidation?y:(m=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,y.replace(m,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},k.prototype.attEscape=function(y){var m;return this.options.noValidation?y:(m=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,y.replace(m,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},k}()}).call(void 0)},{}],280:[function(F,Q,j){"use strict";var N=F("babel-runtime/core-js/object/create"),v=C(N);function C(k){return k&&k.__esModule?k:{default:k}}(function(){var k,y,m,S=function(d,t){for(var l in t)b.call(t,l)&&(d[l]=t[l]);function r(){this.constructor=d}return r.prototype=t.prototype,d.prototype=new r,d.__super__=t.prototype,d},b={}.hasOwnProperty;k=F("./NodeType"),y=F("./XMLCharacterData"),Q.exports=m=function(p){S(d,p);function d(t,l){if(d.__super__.constructor.call(this,t),l==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=k.Text,this.value=this.stringify.text(l)}return Object.defineProperty(d.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(d.prototype,"wholeText",{get:function(){var l,r,i;for(i="",r=this.previousSibling;r;)i=r.data+i,r=r.previousSibling;for(i+=this.data,l=this.nextSibling;l;)i=i+l.data,l=l.nextSibling;return i}}),d.prototype.clone=function(){return(0,v.default)(this)},d.prototype.toString=function(t){return this.options.writer.text(this,this.options.writer.filterOptions(t))},d.prototype.splitText=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.replaceWholeText=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},d}(y)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],281:[function(F,Q,j){"use strict";(function(){var N,v,C,k,y,m,S,b,p,d,t,l,r,i,o,s,c,a={}.hasOwnProperty;c=F("./Utility").assign,N=F("./NodeType"),p=F("./XMLDeclaration"),d=F("./XMLDocType"),C=F("./XMLCData"),k=F("./XMLComment"),l=F("./XMLElement"),i=F("./XMLRaw"),o=F("./XMLText"),r=F("./XMLProcessingInstruction"),t=F("./XMLDummy"),y=F("./XMLDTDAttList"),m=F("./XMLDTDElement"),S=F("./XMLDTDEntity"),b=F("./XMLDTDNotation"),v=F("./WriterState"),Q.exports=s=function(){function u(f){var w,_,h;f||(f={}),this.options=f,_=f.writer||{};for(w in _){if(!a.call(_,w))continue;h=_[w],this["_"+w]=this[w],this[w]=h}}return u.prototype.filterOptions=function(f){var w,_,h,R,O,g,x,E;return f||(f={}),f=c({},this.options,f),w={writer:this},w.pretty=f.pretty||!1,w.allowEmpty=f.allowEmpty||!1,w.indent=(_=f.indent)!=null?_:" ",w.newline=(h=f.newline)!=null?h:`
|
|
|
`,w.offset=(R=f.offset)!=null?R:0,w.dontPrettyTextNodes=(O=(g=f.dontPrettyTextNodes)!=null?g:f.dontprettytextnodes)!=null?O:0,w.spaceBeforeSlash=(x=(E=f.spaceBeforeSlash)!=null?E:f.spacebeforeslash)!=null?x:"",w.spaceBeforeSlash===!0&&(w.spaceBeforeSlash=" "),w.suppressPrettyCount=0,w.user={},w.state=v.None,w},u.prototype.indent=function(f,w,_){var h;return!w.pretty||w.suppressPrettyCount?"":w.pretty&&(h=(_||0)+w.offset+1,h>0)?new Array(h).join(w.indent):""},u.prototype.endline=function(f,w,_){return!w.pretty||w.suppressPrettyCount?"":w.newline},u.prototype.attribute=function(f,w,_){var h;return this.openAttribute(f,w,_),h=" "+f.name+'="'+f.value+'"',this.closeAttribute(f,w,_),h},u.prototype.cdata=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_)+"<![CDATA[",w.state=v.InsideTag,h+=f.value,w.state=v.CloseTag,h+="]]>"+this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.comment=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_)+"<!-- ",w.state=v.InsideTag,h+=f.value,w.state=v.CloseTag,h+=" -->"+this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.declaration=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_)+"<?xml",w.state=v.InsideTag,h+=' version="'+f.version+'"',f.encoding!=null&&(h+=' encoding="'+f.encoding+'"'),f.standalone!=null&&(h+=' standalone="'+f.standalone+'"'),w.state=v.CloseTag,h+=w.spaceBeforeSlash+"?>",h+=this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.docType=function(f,w,_){var h,R,O,g,x;if(_||(_=0),this.openNode(f,w,_),w.state=v.OpenTag,g=this.indent(f,w,_),g+="<!DOCTYPE "+f.root().name,f.pubID&&f.sysID?g+=' PUBLIC "'+f.pubID+'" "'+f.sysID+'"':f.sysID&&(g+=' SYSTEM "'+f.sysID+'"'),f.children.length>0){for(g+=" [",g+=this.endline(f,w,_),w.state=v.InsideTag,x=f.children,R=0,O=x.length;R<O;R++)h=x[R],g+=this.writeChildNode(h,w,_+1);w.state=v.CloseTag,g+="]"}return w.state=v.CloseTag,g+=w.spaceBeforeSlash+">",g+=this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),g},u.prototype.element=function(f,w,_){var h,R,O,g,x,E,T,M,L,A,V,z,W,G;_||(_=0),A=!1,V="",this.openNode(f,w,_),w.state=v.OpenTag,V+=this.indent(f,w,_)+"<"+f.name,z=f.attribs;for(L in z){if(!a.call(z,L))continue;h=z[L],V+=this.attribute(h,w,_)}if(O=f.children.length,g=O===0?null:f.children[0],O===0||f.children.every(function(U){return(U.type===N.Text||U.type===N.Raw)&&U.value===""}))w.allowEmpty?(V+=">",w.state=v.CloseTag,V+="</"+f.name+">"+this.endline(f,w,_)):(w.state=v.CloseTag,V+=w.spaceBeforeSlash+"/>"+this.endline(f,w,_));else if(w.pretty&&O===1&&(g.type===N.Text||g.type===N.Raw)&&g.value!=null)V+=">",w.state=v.InsideTag,w.suppressPrettyCount++,A=!0,V+=this.writeChildNode(g,w,_+1),w.suppressPrettyCount--,A=!1,w.state=v.CloseTag,V+="</"+f.name+">"+this.endline(f,w,_);else{if(w.dontPrettyTextNodes){for(W=f.children,x=0,T=W.length;x<T;x++)if(R=W[x],(R.type===N.Text||R.type===N.Raw)&&R.value!=null){w.suppressPrettyCount++,A=!0;break}}for(V+=">"+this.endline(f,w,_),w.state=v.InsideTag,G=f.children,E=0,M=G.length;E<M;E++)R=G[E],V+=this.writeChildNode(R,w,_+1);w.state=v.CloseTag,V+=this.indent(f,w,_)+"</"+f.name+">",A&&w.suppressPrettyCount--,V+=this.endline(f,w,_),w.state=v.None}return this.closeNode(f,w,_),V},u.prototype.writeChildNode=function(f,w,_){switch(f.type){case N.CData:return this.cdata(f,w,_);case N.Comment:return this.comment(f,w,_);case N.Element:return this.element(f,w,_);case N.Raw:return this.raw(f,w,_);case N.Text:return this.text(f,w,_);case N.ProcessingInstruction:return this.processingInstruction(f,w,_);case N.Dummy:return"";case N.Declaration:return this.declaration(f,w,_);case N.DocType:return this.docType(f,w,_);case N.AttributeDeclaration:return this.dtdAttList(f,w,_);case N.ElementDeclaration:return this.dtdElement(f,w,_);case N.EntityDeclaration:return this.dtdEntity(f,w,_);case N.NotationDeclaration:return this.dtdNotation(f,w,_);default:throw new Error("Unknown XML node type: "+f.constructor.name)}},u.prototype.processingInstruction=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_)+"<?",w.state=v.InsideTag,h+=f.target,f.value&&(h+=" "+f.value),w.state=v.CloseTag,h+=w.spaceBeforeSlash+"?>",h+=this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.raw=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_),w.state=v.InsideTag,h+=f.value,w.state=v.CloseTag,h+=this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.text=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_),w.state=v.InsideTag,h+=f.value,w.state=v.CloseTag,h+=this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.dtdAttList=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_)+"<!ATTLIST",w.state=v.InsideTag,h+=" "+f.elementName+" "+f.attributeName+" "+f.attributeType,f.defaultValueType!=="#DEFAULT"&&(h+=" "+f.defaultValueType),f.defaultValue&&(h+=' "'+f.defaultValue+'"'),w.state=v.CloseTag,h+=w.spaceBeforeSlash+">"+this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.dtdElement=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_)+"<!ELEMENT",w.state=v.InsideTag,h+=" "+f.name+" "+f.value,w.state=v.CloseTag,h+=w.spaceBeforeSlash+">"+this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.dtdEntity=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_)+"<!ENTITY",w.state=v.InsideTag,f.pe&&(h+=" %"),h+=" "+f.name,f.value?h+=' "'+f.value+'"':(f.pubID&&f.sysID?h+=' PUBLIC "'+f.pubID+'" "'+f.sysID+'"':f.sysID&&(h+=' SYSTEM "'+f.sysID+'"'),f.nData&&(h+=" NDATA "+f.nData)),w.state=v.CloseTag,h+=w.spaceBeforeSlash+">"+this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.dtdNotation=function(f,w,_){var h;return this.openNode(f,w,_),w.state=v.OpenTag,h=this.indent(f,w,_)+"<!NOTATION",w.state=v.InsideTag,h+=" "+f.name,f.pubID&&f.sysID?h+=' PUBLIC "'+f.pubID+'" "'+f.sysID+'"':f.pubID?h+=' PUBLIC "'+f.pubID+'"':f.sysID&&(h+=' SYSTEM "'+f.sysID+'"'),w.state=v.CloseTag,h+=w.spaceBeforeSlash+">"+this.endline(f,w,_),w.state=v.None,this.closeNode(f,w,_),h},u.prototype.openNode=function(f,w,_){},u.prototype.closeNode=function(f,w,_){},u.prototype.openAttribute=function(f,w,_){},u.prototype.closeAttribute=function(f,w,_){},u}()}).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(F,Q,j){"use strict";(function(){var N,v,C,k,y,m,S,b,p,d;d=F("./Utility"),b=d.assign,p=d.isFunction,C=F("./XMLDOMImplementation"),k=F("./XMLDocument"),y=F("./XMLDocumentCB"),S=F("./XMLStringWriter"),m=F("./XMLStreamWriter"),N=F("./NodeType"),v=F("./WriterState"),Q.exports.create=function(t,l,r,i){var o,s;if(t==null)throw new Error("Root element needs a name.");return i=b({},l,r,i),o=new k(i),s=o.element(t),i.headless||(o.declaration(i),(i.pubID!=null||i.sysID!=null)&&o.dtd(i)),s},Q.exports.begin=function(t,l,r){var i;return p(t)&&(i=[t,l],l=i[0],r=i[1],t={}),l?new y(t,l,r):new k(t)},Q.exports.stringWriter=function(t){return new S(t)},Q.exports.streamWriter=function(t,l){return new m(t,l)},Q.exports.implementation=new C,Q.exports.nodeType=N,Q.exports.writerState=v}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLDOMImplementation":260,"./XMLDocument":268,"./XMLDocumentCB":269,"./XMLStreamWriter":277,"./XMLStringWriter":278}],283:[function(F,Q,j){Q.exports=v;var N=Object.prototype.hasOwnProperty;function v(){for(var C={},k=0;k<arguments.length;k++){var y=arguments[k];for(var m in y)N.call(y,m)&&(C[m]=y[m])}return C}},{}],284:[function(F,Q,j){"use strict";var N=F("buffer").Buffer,v=F("./sha"),C=F("./md5"),k={sha1:v,md5:C},y=64,m=N.alloc(y);m.fill(0);function S(d,t,l){N.isBuffer(t)||(t=N.from(t)),N.isBuffer(l)||(l=N.from(l)),t.length>y?t=d(t):t.length<y&&(t=N.concat([t,m],y));for(var r=N.alloc(y),i=N.alloc(y),o=0;o<y;o++)r[o]=t[o]^54,i[o]=t[o]^92;var s=d(N.concat([r,l]));return d(N.concat([i,s]))}function b(d,t){d=d||"sha1";var l=k[d],r=[],i=0;return l||p("algorithm:",d,"is not yet supported"),{update:function(s){return N.isBuffer(s)||(s=N.from(s)),r.push(s),i+=s.length,this},digest:function(s){var c=N.concat(r),a=t?S(l,t,c):l(c);return r=null,s?a.toString(s):a}}}function p(){var d=[].slice.call(arguments).join(" ");throw new Error([d,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
|
`))}j.createHash=function(d){return b(d)},j.createHmac=function(d,t){return b(d,t)},j.createCredentials=function(){p("sorry,createCredentials is not implemented yet")},j.createCipher=function(){p("sorry,createCipher is not implemented yet")},j.createCipheriv=function(){p("sorry,createCipheriv is not implemented yet")},j.createDecipher=function(){p("sorry,createDecipher is not implemented yet")},j.createDecipheriv=function(){p("sorry,createDecipheriv is not implemented yet")},j.createSign=function(){p("sorry,createSign is not implemented yet")},j.createVerify=function(){p("sorry,createVerify is not implemented yet")},j.createDiffieHellman=function(){p("sorry,createDiffieHellman is not implemented yet")},j.pbkdf2=function(){p("sorry,pbkdf2 is not implemented yet")}},{"./md5":286,"./sha":287,buffer:73}],285:[function(F,Q,j){"use strict";var N=F("buffer").Buffer,v=4,C=N.alloc(v);C.fill(0);var k=8;function y(b,p){if(b.length%v!==0){var d=b.length+(v-b.length%v);b=N.concat([b,C],d)}for(var t=[],l=p?b.readInt32BE:b.readInt32LE,r=0;r<b.length;r+=v)t.push(l.call(b,r));return t}function m(b,p,d){for(var t=N.alloc(p),l=d?t.writeInt32BE:t.writeInt32LE,r=0;r<b.length;r++)l.call(t,b[r],r*4,!0);return t}function S(b,p,d,t){N.isBuffer(b)||(b=N.from(b));var l=p(y(b,t),b.length*k);return m(l,d,t)}Q.exports={hash:S}},{buffer:73}],286:[function(F,Q,j){"use strict";var N=F("./helpers");function v(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function C(t,l){t[l>>5]|=128<<l%32,t[(l+64>>>9<<4)+14]=l;for(var r=1732584193,i=-271733879,o=-1732584194,s=271733878,c=0;c<t.length;c+=16){var a=r,u=i,f=o,w=s;r=y(r,i,o,s,t[c+0],7,-680876936),s=y(s,r,i,o,t[c+1],12,-389564586),o=y(o,s,r,i,t[c+2],17,606105819),i=y(i,o,s,r,t[c+3],22,-1044525330),r=y(r,i,o,s,t[c+4],7,-176418897),s=y(s,r,i,o,t[c+5],12,1200080426),o=y(o,s,r,i,t[c+6],17,-1473231341),i=y(i,o,s,r,t[c+7],22,-45705983),r=y(r,i,o,s,t[c+8],7,1770035416),s=y(s,r,i,o,t[c+9],12,-1958414417),o=y(o,s,r,i,t[c+10],17,-42063),i=y(i,o,s,r,t[c+11],22,-1990404162),r=y(r,i,o,s,t[c+12],7,1804603682),s=y(s,r,i,o,t[c+13],12,-40341101),o=y(o,s,r,i,t[c+14],17,-1502002290),i=y(i,o,s,r,t[c+15],22,1236535329),r=m(r,i,o,s,t[c+1],5,-165796510),s=m(s,r,i,o,t[c+6],9,-1069501632),o=m(o,s,r,i,t[c+11],14,643717713),i=m(i,o,s,r,t[c+0],20,-373897302),r=m(r,i,o,s,t[c+5],5,-701558691),s=m(s,r,i,o,t[c+10],9,38016083),o=m(o,s,r,i,t[c+15],14,-660478335),i=m(i,o,s,r,t[c+4],20,-405537848),r=m(r,i,o,s,t[c+9],5,568446438),s=m(s,r,i,o,t[c+14],9,-1019803690),o=m(o,s,r,i,t[c+3],14,-187363961),i=m(i,o,s,r,t[c+8],20,1163531501),r=m(r,i,o,s,t[c+13],5,-1444681467),s=m(s,r,i,o,t[c+2],9,-51403784),o=m(o,s,r,i,t[c+7],14,1735328473),i=m(i,o,s,r,t[c+12],20,-1926607734),r=S(r,i,o,s,t[c+5],4,-378558),s=S(s,r,i,o,t[c+8],11,-2022574463),o=S(o,s,r,i,t[c+11],16,1839030562),i=S(i,o,s,r,t[c+14],23,-35309556),r=S(r,i,o,s,t[c+1],4,-1530992060),s=S(s,r,i,o,t[c+4],11,1272893353),o=S(o,s,r,i,t[c+7],16,-155497632),i=S(i,o,s,r,t[c+10],23,-1094730640),r=S(r,i,o,s,t[c+13],4,681279174),s=S(s,r,i,o,t[c+0],11,-358537222),o=S(o,s,r,i,t[c+3],16,-722521979),i=S(i,o,s,r,t[c+6],23,76029189),r=S(r,i,o,s,t[c+9],4,-640364487),s=S(s,r,i,o,t[c+12],11,-421815835),o=S(o,s,r,i,t[c+15],16,530742520),i=S(i,o,s,r,t[c+2],23,-995338651),r=b(r,i,o,s,t[c+0],6,-198630844),s=b(s,r,i,o,t[c+7],10,1126891415),o=b(o,s,r,i,t[c+14],15,-1416354905),i=b(i,o,s,r,t[c+5],21,-57434055),r=b(r,i,o,s,t[c+12],6,1700485571),s=b(s,r,i,o,t[c+3],10,-1894986606),o=b(o,s,r,i,t[c+10],15,-1051523),i=b(i,o,s,r,t[c+1],21,-2054922799),r=b(r,i,o,s,t[c+8],6,1873313359),s=b(s,r,i,o,t[c+15],10,-30611744),o=b(o,s,r,i,t[c+6],15,-1560198380),i=b(i,o,s,r,t[c+13],21,1309151649),r=b(r,i,o,s,t[c+4],6,-145523070),s=b(s,r,i,o,t[c+11],10,-1120210379),o=b(o,s,r,i,t[c+2],15,718787259),i=b(i,o,s,r,t[c+9],21,-343485551),r=p(r,a),i=p(i,u),o=p(o,f),s=p(s,w)}return Array(r,i,o,s)}function k(t,l,r,i,o,s){return p(d(p(p(l,t),p(i,s)),o),r)}function y(t,l,r,i,o,s,c){return k(l&r|~l&i,t,l,o,s,c)}function m(t,l,r,i,o,s,c){return k(l&i|r&~i,t,l,o,s,c)}function S(t,l,r,i,o,s,c){return k(l^r^i,t,l,o,s,c)}function b(t,l,r,i,o,s,c){return k(r^(l|~i),t,l,o,s,c)}function p(t,l){var r=(t&65535)+(l&65535),i=(t>>16)+(l>>16)+(r>>16);return i<<16|r&65535}function d(t,l){return t<<l|t>>>32-l}Q.exports=function(l){return N.hash(l,C,16)}},{"./helpers":285}],287:[function(F,Q,j){"use strict";var N=F("./helpers");function v(S,b){S[b>>5]|=128<<24-b%32,S[(b+64>>9<<4)+15]=b;for(var p=Array(80),d=1732584193,t=-271733879,l=-1732584194,r=271733878,i=-1009589776,o=0;o<S.length;o+=16){for(var s=d,c=t,a=l,u=r,f=i,w=0;w<80;w++){w<16?p[w]=S[o+w]:p[w]=m(p[w-3]^p[w-8]^p[w-14]^p[w-16],1);var _=y(y(m(d,5),C(w,t,l,r)),y(y(i,p[w]),k(w)));i=r,r=l,l=m(t,30),t=d,d=_}d=y(d,s),t=y(t,c),l=y(l,a),r=y(r,u),i=y(i,f)}return Array(d,t,l,r,i)}function C(S,b,p,d){return S<20?b&p|~b&d:S<40?b^p^d:S<60?b&p|b&d|p&d:b^p^d}function k(S){return S<20?1518500249:S<40?1859775393:S<60?-1894007588:-899497514}function y(S,b){var p=(S&65535)+(b&65535),d=(S>>16)+(b>>16)+(p>>16);return d<<16|p&65535}function m(S,b){return S<<b|S>>>32-b}Q.exports=function(b){return N.hash(b,v,20,!0)}},{"./helpers":285}],288:[function(F,Q,j){"use strict";Q.exports=function(){return function(){}}},{}],289:[function(F,Q,j){(function(N){"use strict";var v=F("babel-runtime/helpers/typeof"),C=k(v);function k(d){return d&&d.__esModule?d:{default:d}}var y=F("stream"),m=y.Stream,S=F("../lib/common/utils/isArray"),b=S.isArray;Q.exports.string=function(t){return typeof t=="string"},Q.exports.array=b,Q.exports.buffer=N.isBuffer;function p(d){return d instanceof m}Q.exports.writableStream=function(t){return p(t)&&typeof t._write=="function"&&(0,C.default)(t._writableState)==="object"}}).call(this,{isBuffer:F("../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(F,Q,j){"use strict";j.encodeURIComponent=function(N){try{return encodeURIComponent(N)}catch(v){return N}},j.escape=F("escape-html"),j.timestamp=function(v){if(v){var C=v;return typeof C=="string"&&(C=Number(C)),String(v).length===10&&(C*=1e3),new Date(C)}return Math.round(Date.now()/1e3)}},{"escape-html":191}],291:[function(F,Q,j){(function(N,v){"use strict";var C=F("babel-runtime/core-js/json/stringify"),k=S(C),y=F("babel-runtime/helpers/typeof"),m=S(y);function S(w){return w&&w.__esModule?w:{default:w}}var b=F("util"),p=F("url"),d=F("http"),t=F("https"),l=F("debug")("urllib"),r=F("humanize-ms"),i,o=0,s=Math.pow(2,31)-10,c=/^https?:\/\//i;function a(w,_){return w===void 0?_:w}function u(w,_){return function(h,R,O){if(h)return _(h);w({data:R,status:O.statusCode,headers:O.headers,res:O})}}j.TIMEOUTS=[r("300s"),r("300s")];var f=["json","text"];j.request=function(_,h,R){return arguments.length===2&&typeof h=="function"&&(R=h,h=null),typeof R=="function"?j.requestWithCallback(_,h,R):(i||(i=F("any-promise")),new i(function(O,g){j.requestWithCallback(_,h,u(O,g))}))},j.requestWithCallback=function(_,h,R){if(!_||typeof _!="string"&&(typeof _=="undefined"?"undefined":(0,m.default)(_))!=="object"){var O=b.format("expect request url to be a string or a http request options, but got %j",_);throw new Error(O)}arguments.length===2&&typeof h=="function"&&(R=h,h=null),h=h||{},o>=s&&(o=0);var g=++o;h.requestUrls=h.requestUrls||[];var x={requestId:g,url:_,args:h,ctx:h.ctx};h.emitter&&h.emitter.emit("request",x),h.timeout=h.timeout||j.TIMEOUTS,h.maxRedirects=h.maxRedirects||10,h.streaming=h.streaming||h.customResponse;var E=Date.now(),T;typeof _=="string"?(c.test(_)||(_="http://"+_),T=p.parse(_)):T=_;var M=(h.type||h.method||T.method||"GET").toUpperCase(),L=T.port||80,A=d,V=a(h.agent,j.agent),z=h.fixJSONCtlChars;T.protocol==="https:"&&(A=t,V=a(h.httpsAgent,j.httpsAgent),T.port||(L=443));var W={host:T.hostname||T.host||"localhost",path:T.path||"/",method:M,port:L,agent:V,headers:h.headers||{},lookup:h.lookup};Array.isArray(h.timeout)?W.requestTimeout=h.timeout[h.timeout.length-1]:typeof h.timeout!="undefined"&&(W.requestTimeout=h.timeout);for(var G=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],U=0;U<G.length;U++){var P=G[U];h.hasOwnProperty(P)&&(W[P]=h[P])}W.rejectUnauthorized===!1&&!W.hasOwnProperty("secureOptions")&&(W.secureOptions=F("constants").SSL_OP_NO_TLSv1_2);var H=h.auth||T.auth;H&&(W.auth=H);var $=h.content||h.data,re=M==="GET"||M==="HEAD"||h.dataAsQueryString;if(!h.content&&($&&!(typeof $=="string"||v.isBuffer($))))if(re)$=h.nestedQuerystring?qs.stringify($):querystring.stringify($);else{var te=W.headers["Content-Type"]||W.headers["content-type"];te||(h.contentType==="json"?te="application/json":te="application/x-www-form-urlencoded",W.headers["Content-Type"]=te),parseContentType(te).type==="application/json"?$=(0,k.default)($):$=h.nestedQuerystring?qs.stringify($):querystring.stringify($)}re&&$&&(W.path+=(T.query?"&":"?")+$,$=null);var ge=0;if($){var ve=$.length;v.isBuffer($)||(ve=v.byteLength($)),ge=W.headers["Content-Length"]=ve}h.dataType==="json"&&(W.headers.Accept="application/json"),typeof h.beforeRequest=="function"&&h.beforeRequest(W);var de=null,De=null,Te=null,he=!1,ue=!1,ie=0,Se=-1,ne=!1,ce="",Oe="",oe=null;h.timing&&(oe={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0});function q(){de&&(clearTimeout(de),de=null)}function Y(){De&&(clearTimeout(De),De=null)}function Z(Ie,tt,ot){if(Y(),!R){console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),g,N.pid,W.method,_),Ie&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
|
stack: %s`,Date(),g,N.pid,Ie.name,Ie.message,Ie.stack);return}var ze=R;R=null;var Ze={};if(ot&&(Se=ot.statusCode,Ze=ot.headers),Se===401&&Ze["www-authenticate"]&&(!h.headers||!h.headers.Authorization)&&h.digestAuth){var Ne=Ze["www-authenticate"];if(Ne.indexOf("Digest ")>=0)return l("Request#%d %s: got digest auth header WWW-Authenticate: %s",g,_,Ne),h.headers=h.headers||{},h.headers.Authorization=digestAuthHeader(W.method,W.path,Ne,h.digestAuth),l("Request#%d %s: auth with digest header: %s",g,_,h.headers.Authorization),ot.headers["set-cookie"]&&(h.headers.Cookie=ot.headers["set-cookie"].join(";")),j.requestWithCallback(_,h,ze)}var Ae=Date.now()-E;oe&&(oe.contentDownload=Ae),l("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Ae,ie,Se,W.method,W.host,W.path,ue,oe);var Me={status:Se,statusCode:Se,headers:Ze,size:ie,aborted:ne,rt:Ae,keepAliveSocket:ue,data:tt,requestUrls:h.requestUrls,timing:oe,remoteAddress:ce,remotePort:Oe};if(Ie){var Ee="";V&&typeof V.getCurrentStatus=="function"&&(Ee=", agent status: "+(0,k.default)(V.getCurrentStatus())),Ie.message+=", "+W.method+" "+_+" "+Se+" (connected: "+he+", keepalive socket: "+ue+Ee+`)
|
|
|
headers: `+(0,k.default)(Ze),Ie.data=tt,Ie.path=W.path,Ie.status=Se,Ie.headers=Ze,Ie.res=Me}ze(Ie,tt,h.streaming?ot:Me),h.emitter&&(x.url=_,x.socket=lt&<.connection,x.options=W,x.size=ge,h.emitter.emit("response",{requestId:g,error:Ie,ctx:h.ctx,req:x,res:Me}))}function ye(Ie){var tt=null;if(h.followRedirect&&statuses.redirect[Ie.statusCode]){h._followRedirectCount=(h._followRedirectCount||0)+1;var ot=Ie.headers.location;if(!ot)tt=new Error("Got statusCode "+Ie.statusCode+" but cannot resolve next location from headers"),tt.name="FollowRedirectError";else if(h._followRedirectCount>h.maxRedirects)tt=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+_),tt.name="MaxRedirectError";else{var ze=h.formatRedirectUrl?h.formatRedirectUrl(_,ot):p.resolve(_,ot);l("Request#%d %s: `redirected` from %s to %s",g,W.path,_,ze),Y(),h.headers&&h.headers.Host&&c.test(ot)&&(h.headers.Host=null);var Ze=R;return R=null,j.requestWithCallback(ze,h,Ze),{redirect:!0,error:null}}}return{redirect:!1,error:tt}}!W.headers["User-Agent"]&&!W.headers["user-agent"]&&(W.headers["User-Agent"]=navigator.userAgent),h.gzip&&(!W.headers["Accept-Encoding"]&&!W.headers["accept-encoding"]&&(W.headers["Accept-Encoding"]="gzip"));function be(Ie,tt,ot){var ze=Ie.headers["content-encoding"];return ot(null,tt,ze)}var Re=h.writeStream;l("Request#%d %s %s with headers %j, options.path: %s",g,M,_,W.headers,W.path),h.requestUrls.push(_);function Qe(Ie){if(oe&&(oe.waiting=Date.now()-E),l("Request#%d %s `req response` event emit: status %d, headers: %j",g,_,Ie.statusCode,Ie.headers),h.streaming){var tt=ye(Ie);if(tt.redirect){Ie.resume();return}return tt.error?(Ie.resume(),Z(tt.error,null,Ie)):Z(null,null,Ie)}if(Ie.on("close",function(){l("Request#%d %s: `res close` event emit, total size %d",g,_,ie)}),Ie.on("error",function(){l("Request#%d %s: `res error` event emit, total size %d",g,_,ie)}),Ie.on("aborted",function(){ne=!0,l("Request#%d %s: `res aborted` event emit, total size %d",g,_,ie)}),Re){var tt=ye(Ie);if(tt.redirect){Ie.resume();return}return tt.error?(Ie.resume(),Re.end(),Z(tt.error,null,Ie)):(h.consumeWriteStream===!1?Ie.on("end",Z.bind(null,null,null,Ie)):isNode010||isNode012?first([[Re,"close"],[Ie,"aborted"]],function(Ze,Ne,Ae){l("Request#%d %s: writeStream or res %s event emitted",g,_,Ae),Z(Te||null,null,Ie)}):Re.on("close",function(){l("Request#%d %s: writeStream close event emitted",g,_),Z(Te||null,null,Ie)}),Ie.pipe(Re))}var ot=[];Ie.on("data",function(ze){l("Request#%d %s: `res data` event emit, size %d",g,_,ze.length),ie+=ze.length,ot.push(ze)}),Ie.on("end",function(){var ze=v.concat(ot,ie);if(l("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",g,_,ie,Ie._dumped),Te)return Z(Te,ze,Ie);var Ze=ye(Ie);if(Ze.error)return Z(Ze.error,ze,Ie);if(Ze.redirect)return;be(Ie,ze,function(Ne,Ae,Me){if(Ne)return Z(Ne,ze,Ie);if(!Me&&f.indexOf(h.dataType)>=0){try{Ae=decodeBodyByCharset(Ae,Ie)}catch(Ce){return l("decodeBodyByCharset error: %s",Ce),Z(null,Ae,Ie)}if(h.dataType==="json")if(ie===0)Ae=null;else{var Ee=parseJSON(Ae,z);Ee.error?Ne=Ee.error:Ae=Ee.data}}ne&&l("Request#%d %s: Remote socket was terminated before `response.end()` was called",g,_),Z(Ne,Ae,Ie)})})}var rt,at;Array.isArray(h.timeout)?(rt=r(h.timeout[0]),at=r(h.timeout[1])):rt=at=r(h.timeout),l("ConnectTimeout: %d, ResponseTimeout: %d",rt,at);function qe(){l("Connect timer ticking, timeout: %d",rt),de=setTimeout(function(){de=null,Se===-1&&(Se=-2);var Ie="Connect timeout for "+rt+"ms",tt="ConnectionTimeoutError";lt.socket||(tt="SocketAssignTimeoutError",Ie+=", working sockets is full"),Te=new Error(Ie),Te.name=tt,Te.requestId=g,l("ConnectTimeout: Request#%d %s %s: %s, connected: %s",g,_,Te.name,Ie,he),je()},rt)}function st(){l("Response timer ticking, timeout: %d",at),De=setTimeout(function(){De=null;var Ie="Response timeout for "+at+"ms",tt="ResponseTimeoutError";Te=new Error(Ie),Te.name=tt,Te.requestId=g,l("ResponseTimeout: Request#%d %s %s: %s, connected: %s",g,_,Te.name,Ie,he),je()},at)}var lt;W.mode=h.mode?h.mode:"";try{lt=A.request(W,Qe)}catch(Ie){return Z(Ie)}typeof window=="undefined"?qe():lt.on("requestTimeout",function(){Se===-1&&(Se=-2);var Ie="Connect timeout for "+rt+"ms",tt="ConnectionTimeoutError";Te=new Error(Ie),Te.name=tt,Te.requestId=g,je()});function je(){l("Request#%d %s abort, connected: %s",g,_,he),lt.socket||(Te.noSocket=!0,Z(Te)),lt.abort()}return oe&<.on("finish",function(){oe.requestSent=Date.now()-E}),lt.once("socket",function(Ie){oe&&(oe.queuing=Date.now()-E),isNode010&&Ie.socket&&(Ie=Ie.socket);var tt=Ie.readyState;if(tt==="opening"){Ie.once("lookup",function(ot,ze,Ze){l("Request#%d %s lookup: %s, %s, %s",g,_,ot,ze,Ze),oe&&(oe.dnslookup=Date.now()-E),ze&&(ce=ze)}),Ie.once("connect",function(){oe&&(oe.connected=Date.now()-E),q(),st(),l("Request#%d %s new socket connected",g,_),he=!0,ce||(ce=Ie.remoteAddress),Oe=Ie.remotePort});return}l("Request#%d %s reuse socket connected, readyState: %s",g,_,tt),he=!0,ue=!0,ce||(ce=Ie.remoteAddress),Oe=Ie.remotePort,q(),st()}),lt.on("error",function(Ie){(Ie.name==="Error"||Ie.name==="TypeError")&&(Ie.name=he?"ResponseError":"RequestError"),Ie.message+=' (req "error")',l("Request#%d %s `req error` event emit, %s: %s",g,_,Ie.name,Ie.message),Z(Te||Ie)}),Re&&Re.once("error",function(Ie){Ie.message+=' (writeStream "error")',Te=Ie,l("Request#%d %s `writeStream error` event emit, %s: %s",g,_,Ie.name,Ie.message),je()}),h.stream?(h.stream.pipe(lt),h.stream.once("error",function(Ie){Ie.message+=' (stream "error")',Te=Ie,l("Request#%d %s `readStream error` event emit, %s: %s",g,_,Ie.name,Ie.message),je()})):lt.end($),lt.requestId=g,lt}}).call(this,F("_process"),F("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"))},n6Qo:function(F,Q,j){"use strict";j.d(Q,"a",function(){return b});var N=j("cDcd"),v=j("biw7"),C=j("fyJ8");function k(p){var d=p.className,t=p.index,l=p.children,r=p.colSpan,i=p.rowSpan,o=N.useContext(v.a),s=o.prefixCls,c=o.fixedInfoList,a=c[t];return N.createElement(C.a,Object.assign({className:d,index:t,component:"td",prefixCls:s,record:null,dataIndex:null,render:function(){return{children:l,props:{colSpan:r,rowSpan:i}}}},a))}function y(p){return N.createElement("tr",Object.assign({},p))}function m(p){var d=p.children,t=N.useContext(v.a),l=t.prefixCls;return N.createElement("tfoot",{className:"".concat(l,"-summary")},d)}var S=Q.b=m,b={Cell:k,Row:y}},nj2k:function(F,Q,j){F.exports=j.p+"static/nodata.c3b0b86c.svg"},oRuE:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.pad.Iso10126={pad:function(v,C){var k=C*4,y=k-v.sigBytes%k;v.concat(N.lib.WordArray.random(y-1)).concat(N.lib.WordArray.create([y<<24],1))},unpad:function(v){var C=v.words[v.sigBytes-1>>>2]&255;v.sigBytes-=C}},N.pad.Iso10126})},osHv:function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){"use strict";var v=N.Pos;function C(c,a){return c.line-a.line||c.ch-a.ch}var k="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",y=k+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+k+"]["+y+"]*)","g");function S(c,a,u,f){this.line=a,this.ch=u,this.cm=c,this.text=c.getLine(a),this.min=f?Math.max(f.from,c.firstLine()):c.firstLine(),this.max=f?Math.min(f.to-1,c.lastLine()):c.lastLine()}function b(c,a){var u=c.cm.getTokenTypeAt(v(c.line,a));return u&&/\btag\b/.test(u)}function p(c){return c.line>=c.max?void 0:(c.ch=0,c.text=c.cm.getLine(++c.line),!0)}function d(c){return c.line<=c.min?void 0:(c.text=c.cm.getLine(--c.line),c.ch=c.text.length,!0)}function t(c){for(;;){var a=c.text.indexOf(">",c.ch);if(a==-1){if(p(c))continue;return}if(!b(c,a+1)){c.ch=a+1;continue}var u=c.text.lastIndexOf("/",a),f=u>-1&&!/\S/.test(c.text.slice(u+1,a));return c.ch=a+1,f?"selfClose":"regular"}}function l(c){for(;;){var a=c.ch?c.text.lastIndexOf("<",c.ch-1):-1;if(a==-1){if(d(c))continue;return}if(!b(c,a+1)){c.ch=a;continue}m.lastIndex=a,c.ch=a;var u=m.exec(c.text);if(u&&u.index==a)return u}}function r(c){for(;;){m.lastIndex=c.ch;var a=m.exec(c.text);if(!a){if(p(c))continue;return}if(!b(c,a.index+1)){c.ch=a.index+1;continue}return c.ch=a.index+a[0].length,a}}function i(c){for(;;){var a=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(a==-1){if(d(c))continue;return}if(!b(c,a+1)){c.ch=a;continue}var u=c.text.lastIndexOf("/",a),f=u>-1&&!/\S/.test(c.text.slice(u+1,a));return c.ch=a+1,f?"selfClose":"regular"}}function o(c,a){for(var u=[];;){var f=r(c),w,_=c.line,h=c.ch-(f?f[0].length:0);if(!f||!(w=t(c)))return;if(w=="selfClose")continue;if(f[1]){for(var R=u.length-1;R>=0;--R)if(u[R]==f[2]){u.length=R;break}if(R<0&&(!a||a==f[2]))return{tag:f[2],from:v(_,h),to:v(c.line,c.ch)}}else u.push(f[2])}}function s(c,a){for(var u=[];;){var f=i(c);if(!f)return;if(f=="selfClose"){l(c);continue}var w=c.line,_=c.ch,h=l(c);if(!h)return;if(h[1])u.push(h[2]);else{for(var R=u.length-1;R>=0;--R)if(u[R]==h[2]){u.length=R;break}if(R<0&&(!a||a==h[2]))return{tag:h[2],from:v(c.line,c.ch),to:v(w,_)}}}}N.registerHelper("fold","xml",function(c,a){for(var u=new S(c,a.line,0);;){var f=r(u);if(!f||u.line!=a.line)return;var w=t(u);if(!w)return;if(!f[1]&&w!="selfClose"){var _=v(u.line,u.ch),h=o(u,f[2]);return h&&C(h.from,_)>0?{from:_,to:h.from}:null}}}),N.findMatchingTag=function(c,a,u){var f=new S(c,a.line,a.ch,u);if(f.text.indexOf(">")==-1&&f.text.indexOf("<")==-1)return;var w=t(f),_=w&&v(f.line,f.ch),h=w&&l(f);if(!w||!h||C(f,a)>0)return;var R={from:v(f.line,f.ch),to:_,tag:h[2]};return w=="selfClose"?{open:R,close:null,at:"open"}:h[1]?{open:s(f,h[2]),close:R,at:"close"}:(f=new S(c,_.line,_.ch,u),{open:R,close:o(f,h[2]),at:"open"})},N.findEnclosingTag=function(c,a,u,f){for(var w=new S(c,a.line,a.ch,u);;){var _=s(w,f);if(!_)break;var h=new S(c,a.line,a.ch,u),R=o(h,_.tag);if(R)return{open:_,close:R}}},N.scanForClosingTag=function(c,a,u,f){var w=new S(c,a.line,a.ch,f?{from:0,to:f}:null);return o(w,u)}})},p5ED:function(F,Q,j){"use strict";var N=j("+L6B"),v=j("2/Rp"),C=j("5Dmo"),k=j("3S7+"),y=j("k1fw"),m=j("tJVT"),S=j("cDcd"),b=j.n(S),p=j("vHTk"),d=j.n(p),t=j("yEEn"),l=j("ZW9T"),r=j("1vsH");Q.a=function(i){var o=i.name,s=i.data,c=i.theme,a=i.type,u=i.filename,f=i.monacoEditor,w=i.className,_=i.style,h=i.close,R=i.onClose,O=i.hasMask,g=Object(S.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),x=Object(m.a)(g,2),E=x[0],T=x[1],M=Object(S.useState)(""),L=Object(m.a)(M,2),A=L[0],V=L[1],z,W=1024*1024,G=10*W,U=Object(S.useRef)();a==="office"&&(z=Object(r.V)(s).filesize,z>G&&(a="other")),u&&(f.filename=u),Object(S.useEffect)(function(){var $,re,te=($=document.cookie)===null||$===void 0||((re=$.replace(/\s/g,""))===null||re===void 0)?void 0:re.split(";");te==null||te.map(function(ge){var ve=ge.split("=");ve[0]==="_educoder_session"&&V(ve[1])})},[]);var P=function(){if(s.startsWith("http")||s.startsWith("/")){H();return}Object(r.z)(u||"educoder",s,u)},H=function(){Object(r.x)(u||o,s)};return console.log("data:",s,"fileanme:",u," name:",o),b.a.createElement("div",{style:Object(y.a)({},_||{}),className:"".concat(O&&d.a.bgBlack," ").concat(a?d.a.wrp:"hide")},h&&b.a.createElement("div",{className:d.a.close,ref:U},b.a.createElement(k.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},b.a.createElement("span",{onClick:H},b.a.createElement("i",{className:"icon-quxiaozhiding"}))),b.a.createElement(k.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},b.a.createElement("span",{className:"",onClick:R},b.a.createElement("i",{className:"icon-guanbi1"})))),b.a.createElement("div",{className:"".concat(d.a[w]," ").concat(w," ").concat(d.a.monaco," ").concat(a==="txt"?"show":"hide")},a==="txt"&&b.a.createElement(l.b,f)),a==="audio"&&b.a.createElement("audio",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?s:"data:audio/mp3;base64,").concat(s),autoPlay:!0}),a==="video"&&b.a.createElement(b.a.Fragment,null,s!=null&&s.startsWith("/")?b.a.createElement("video",{controls:!0,src:"".concat(s),autoPlay:!0}):b.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(s),autoPlay:!0})),a==="html"&&b.a.createElement("iframe",{src:s+"&disposition=inline"}),a==="pdf"&&b.a.createElement("embed",{className:d.a.embed,src:s}),a==="image"&&b.a.createElement(b.a.Fragment,null,b.a.createElement("img",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(s)})),a==="other"&&b.a.createElement("div",null,b.a.createElement(v.a,{type:"primary",size:"large",onClick:P},b.a.createElement(t.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(a==="download"||a==="office")&&b.a.createElement(v.a,{type:"primary",size:"large",onClick:P},b.a.createElement(t.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(F,Q,j){},pA7S:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("ETIr"),j("cv67"),j("K3mO"),j("OLod"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.WordArray,y=C.BlockCipher,m=v.algo,S=[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],b=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{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}],t=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=m.DES=y.extend({_doReset:function(){for(var s=this._key,c=s.words,a=[],u=0;u<56;u++){var f=S[u]-1;a[u]=c[f>>>5]>>>31-f%32&1}for(var w=this._subKeys=[],_=0;_<16;_++){for(var h=w[_]=[],R=p[_],u=0;u<24;u++)h[u/6|0]|=a[(b[u]-1+R)%28]<<31-u%6,h[4+(u/6|0)]|=a[28+(b[u+24]-1+R)%28]<<31-u%6;h[0]=h[0]<<1|h[0]>>>31;for(var u=1;u<7;u++)h[u]=h[u]>>>(u-1)*4+3;h[7]=h[7]<<5|h[7]>>>27}for(var O=this._invSubKeys=[],u=0;u<16;u++)O[u]=w[15-u]},encryptBlock:function(s,c){this._doCryptBlock(s,c,this._subKeys)},decryptBlock:function(s,c){this._doCryptBlock(s,c,this._invSubKeys)},_doCryptBlock:function(s,c,a){this._lBlock=s[c],this._rBlock=s[c+1],r.call(this,4,252645135),r.call(this,16,65535),i.call(this,2,858993459),i.call(this,8,16711935),r.call(this,1,1431655765);for(var u=0;u<16;u++){for(var f=a[u],w=this._lBlock,_=this._rBlock,h=0,R=0;R<8;R++)h|=d[R][((_^f[R])&t[R])>>>0];this._lBlock=_,this._rBlock=w^h}var O=this._lBlock;this._lBlock=this._rBlock,this._rBlock=O,r.call(this,1,1431655765),i.call(this,8,16711935),i.call(this,2,858993459),r.call(this,16,65535),r.call(this,4,252645135),s[c]=this._lBlock,s[c+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function r(s,c){var a=(this._lBlock>>>s^this._rBlock)&c;this._rBlock^=a,this._lBlock^=a<<s}function i(s,c){var a=(this._rBlock>>>s^this._lBlock)&c;this._lBlock^=a,this._rBlock^=a<<s}v.DES=y._createHelper(l);var o=m.TripleDES=y.extend({_doReset:function(){var s=this._key,c=s.words;if(c.length!==2&&c.length!==4&&c.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var a=c.slice(0,2),u=c.length<4?c.slice(0,2):c.slice(2,4),f=c.length<6?c.slice(0,2):c.slice(4,6);this._des1=l.createEncryptor(k.create(a)),this._des2=l.createEncryptor(k.create(u)),this._des3=l.createEncryptor(k.create(f))},encryptBlock:function(s,c){this._des1.encryptBlock(s,c),this._des2.decryptBlock(s,c),this._des3.encryptBlock(s,c)},decryptBlock:function(s,c){this._des3.decryptBlock(s,c),this._des2.encryptBlock(s,c),this._des1.decryptBlock(s,c)},keySize:192/32,ivSize:64/32,blockSize:64/32});v.TripleDES=y._createHelper(o)}(),N.TripleDES})},psGv:function(F,Q,j){var N,v;(function(){var C;(function(){"use strict";var S=[,,function(t){function l(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}l.prototype.clone_empty=function(){var o=new l(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},l.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},l.prototype.has_match=function(o){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(o))return!0;return!1},l.prototype.set_indent=function(o,s){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},l.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},l.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},l.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},l.prototype.is_empty=function(){return this.__items.length===0},l.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},l.prototype.push=function(o){this.__items.push(o);var s=o.lastIndexOf(`
|
|
|
`);s!==-1?this.__character_count=o.length-s:this.__character_count+=o.length},l.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},l.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},l.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},l.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},l.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function r(o,s){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),s=s||"",o.indent_level>0&&(s=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}r.prototype.get_indent_size=function(o,s){var c=this.__base_string_length;return s=s||0,o<0&&(c=0),c+=o*this.__indent_size,c+=s,c},r.prototype.get_indent_string=function(o,s){var c=this.__base_string;return s=s||0,o<0&&(o=0,c=""),s+=o*this.__indent_size,this.__ensure_cache(s),c+=this.__cache[s],c},r.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},r.prototype.__add_column=function(){var o=this.__cache.length,s=0,c="";this.__indent_size&&o>=this.__indent_size&&(s=Math.floor(o/this.__indent_size),o-=s*this.__indent_size,c=new Array(s+1).join(this.__indent_string)),o&&(c+=new Array(o+1).join(" ")),this.__cache.push(c)};function i(o,s){this.__indent_cache=new r(o,s),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new l(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(o,s){return this.__indent_cache.get_indent_string(o,s)},i.prototype.get_indent_size=function(o,s){return this.__indent_cache.get_indent_size(o,s)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(o){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
|
|
|
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
|
|
|
`);return o!==`
|
|
|
`&&(c=c.replace(/[\n]/g,o)),c},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(o,s){return o=o||0,s=s||0,this.next_line.set_indent(o,s),this.__lines.length>1?(this.current_line.set_indent(o,s),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(o){for(var s=0;s<o.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(o){for(var s=this.__lines.length;o<s;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(o,s){for(var c=this.__lines.length-2;c>=0;){var a=this.__lines[c];if(a.is_empty())break;if(a.item(0).indexOf(o)!==0&&a.item(-1)!==s){this.__lines.splice(c+1,0,new l(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},t.exports.Output=i},function(t){function l(r,i,o,s){this.type=r,this.text=i,this.comments_before=null,this.newlines=o||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}t.exports.Token=l},,,function(t){function l(o,s){this.raw_options=r(o,s),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}l.prototype._get_array=function(o,s){var c=this.raw_options[o],a=s||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(a=c.concat()):typeof c=="string"&&(a=c.split(/[^a-zA-Z0-9_\/\-]+/)),a},l.prototype._get_boolean=function(o,s){var c=this.raw_options[o],a=c===void 0?!!s:!!c;return a},l.prototype._get_characters=function(o,s){var c=this.raw_options[o],a=s||"";return typeof c=="string"&&(a=c.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),a},l.prototype._get_number=function(o,s){var c=this.raw_options[o];s=parseInt(s,10),isNaN(s)&&(s=0);var a=parseInt(c,10);return isNaN(a)&&(a=s),a},l.prototype._get_selection=function(o,s,c){var a=this._get_selection_list(o,s,c);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
|
`+s+`
|
|
|
You passed in: '`+this.raw_options[o]+"'");return a[0]},l.prototype._get_selection_list=function(o,s,c){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[s[0]],!this._is_valid_selection(c,s))throw new Error("Invalid Default Value!");var a=this._get_array(o,c);if(!this._is_valid_selection(a,s))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
|
`+s+`
|
|
|
You passed in: '`+this.raw_options[o]+"'");return a},l.prototype._is_valid_selection=function(o,s){return o.length&&s.length&&!o.some(function(c){return s.indexOf(c)===-1})};function r(o,s){var c={};o=i(o);var a;for(a in o)a!==s&&(c[a]=o[a]);if(s&&o[s])for(a in o[s])c[a]=o[s][a];return c}function i(o){var s={},c;for(c in o){var a=c.replace(/-/g,"_");s[a]=o[c]}return s}t.exports.Options=l,t.exports.normalizeOpts=i,t.exports.mergeOpts=r},,function(t){var l=RegExp.prototype.hasOwnProperty("sticky");function r(i){this.__input=i||"",this.__input_length=this.__input.length,this.__position=0}r.prototype.restart=function(){this.__position=0},r.prototype.back=function(){this.__position>0&&(this.__position-=1)},r.prototype.hasNext=function(){return this.__position<this.__input_length},r.prototype.next=function(){var i=null;return this.hasNext()&&(i=this.__input.charAt(this.__position),this.__position+=1),i},r.prototype.peek=function(i){var o=null;return i=i||0,i+=this.__position,i>=0&&i<this.__input_length&&(o=this.__input.charAt(i)),o},r.prototype.__match=function(i,o){i.lastIndex=o;var s=i.exec(this.__input);return s&&!(l&&i.sticky)&&(s.index!==o&&(s=null)),s},r.prototype.test=function(i,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(i,o):!1},r.prototype.testChar=function(i,o){var s=this.peek(o);return i.lastIndex=0,s!==null&&i.test(s)},r.prototype.match=function(i){var o=this.__match(i,this.__position);return o?this.__position+=o[0].length:o=null,o},r.prototype.read=function(i,o,s){var c="",a;return i&&(a=this.match(i),a&&(c+=a[0])),o&&(a||!i)&&(c+=this.readUntil(o,s)),c},r.prototype.readUntil=function(i,o){var s="",c=this.__position;i.lastIndex=this.__position;var a=i.exec(this.__input);return a?(c=a.index,o&&(c+=a[0].length)):c=this.__input_length,s=this.__input.substring(this.__position,c),this.__position=c,s},r.prototype.readUntilAfter=function(i){return this.readUntil(i,!0)},r.prototype.get_regexp=function(i,o){var s=null,c="g";return o&&l&&(c="y"),typeof i=="string"&&i!==""?s=new RegExp(i,c):i&&(s=new RegExp(i.source,c)),s},r.prototype.get_literal_regexp=function(i){return RegExp(i.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},r.prototype.peekUntilAfter=function(i){var o=this.__position,s=this.readUntilAfter(i);return this.__position=o,s},r.prototype.lookBack=function(i){var o=this.__position-1;return o>=i.length&&this.__input.substring(o-i.length,o).toLowerCase()===i},t.exports.InputScanner=r},function(t,l,r){var i=r(8).InputScanner,o=r(3).Token,s=r(10).TokenStream,c=r(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(f,w){this._input=new i(f),this._options=w||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new c(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var f,w=new o(a.START,""),_=null,h=[],R=new s;w.type!==a.EOF;){for(f=this._get_next_token(w,_);this._is_comment(f);)R.add(f),f=this._get_next_token(w,_);R.isEmpty()||(f.comments_before=R,R=new s),f.parent=_,this._is_opening(f)?(h.push(_),_=f):_&&this._is_closing(f,_)&&(f.opened=_,_.closed=f,_=h.pop(),f.parent=_),f.previous=w,w.next=f,this.__tokens.add(f),w=f}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(f,w){this._readWhitespace();var _=this._input.read(/.+/g);return _?this._create_token(a.RAW,_):this._create_token(a.EOF,"")},u.prototype._is_comment=function(f){return!1},u.prototype._is_opening=function(f){return!1},u.prototype._is_closing=function(f,w){return!1},u.prototype._create_token=function(f,w){var _=new o(f,w,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return _},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=u,t.exports.TOKEN=a},function(t){function l(r){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=r}l.prototype.restart=function(){this.__position=0},l.prototype.isEmpty=function(){return this.__tokens_length===0},l.prototype.hasNext=function(){return this.__position<this.__tokens_length},l.prototype.next=function(){var r=null;return this.hasNext()&&(r=this.__tokens[this.__position],this.__position+=1),r},l.prototype.peek=function(r){var i=null;return r=r||0,r+=this.__position,r>=0&&r<this.__tokens_length&&(i=this.__tokens[r]),i},l.prototype.add=function(r){this.__parent_token&&(r.parent=this.__parent_token),this.__tokens.push(r),this.__tokens_length+=1},t.exports.TokenStream=l},function(t,l,r){var i=r(12).Pattern;function o(s,c){i.call(this,s,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new i,o.prototype.__set_whitespace_patterns=function(s,c){s+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+c+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+c+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var c=this.__split(this._newline_regexp,s);this.newline_count=c.length-1,this.whitespace_before_token=c[this.newline_count]}return s},o.prototype.matching=function(s,c){var a=this._create();return a.__set_whitespace_patterns(s,c),a._update(),a},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(s,c){s.lastIndex=0;for(var a=0,u=[],f=s.exec(c);f;)u.push(c.substring(a,f.index)),a=f.index+f[0].length,f=s.exec(c);return a<c.length?u.push(c.substring(a,c.length)):u.push(""),u},t.exports.WhitespacePattern=o},function(t){function l(r,i){this._input=r,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,i&&(this._starting_pattern=this._input.get_regexp(i._starting_pattern,!0),this._match_pattern=this._input.get_regexp(i._match_pattern,!0),this._until_pattern=this._input.get_regexp(i._until_pattern),this._until_after=i._until_after)}l.prototype.read=function(){var r=this._input.read(this._starting_pattern);return(!this._starting_pattern||r)&&(r+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),r},l.prototype.read_match=function(){return this._input.match(this._match_pattern)},l.prototype.until_after=function(r){var i=this._create();return i._until_after=!0,i._until_pattern=this._input.get_regexp(r),i._update(),i},l.prototype.until=function(r){var i=this._create();return i._until_after=!1,i._until_pattern=this._input.get_regexp(r),i._update(),i},l.prototype.starting_with=function(r){var i=this._create();return i._starting_pattern=this._input.get_regexp(r,!0),i._update(),i},l.prototype.matching=function(r){var i=this._create();return i._match_pattern=this._input.get_regexp(r,!0),i._update(),i},l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){},t.exports.Pattern=l},function(t){function l(r,i){r=typeof r=="string"?r:r.source,i=typeof i=="string"?i:i.source,this.__directives_block_pattern=new RegExp(r+/ beautify( \w+[:]\w+)+ /.source+i,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(r+/\sbeautify\signore:end\s/.source+i,"g")}l.prototype.get_directives=function(r){if(!r.match(this.__directives_block_pattern))return null;var i={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(r);o;)i[o[1]]=o[2],o=this.__directive_pattern.exec(r);return i},l.prototype.readIgnored=function(r){return r.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=l},function(t,l,r){var i=r(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(c,a){i.call(this,c,a),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var u=new i(c);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new i,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(c){var a=this._create();return a._disabled[c]=!0,a._update(),a},s.prototype.read_options=function(c){var a=this._create();for(var u in o)a._disabled[u]=c.templating.indexOf(u)===-1;return a._update(),a},s.prototype.exclude=function(c){var a=this._create();return a._excluded[c]=!0,a._update(),a},s.prototype.read=function(){var c="";this._match_pattern?c=this._input.read(this._starting_pattern):c=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),c+=a,a=this._read_template();return this._until_after&&(c+=this._input.readUntilAfter(this._until_pattern)),c},s.prototype.__set_templated_pattern=function(){var c=[];this._disabled.php||c.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||c.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||c.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(c.push(this.__patterns.django._starting_pattern.source),c.push(this.__patterns.django_value._starting_pattern.source),c.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||c.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&c.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+c.join("|")+")")},s.prototype._read_template=function(){var c="",a=this._input.peek();if(a==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(c=c||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(c=c||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(c=c||this.__patterns.handlebars_comment.read(),c=c||this.__patterns.handlebars_unescaped.read(),c=c||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(c=c||this.__patterns.django_value.read()),this._excluded.django||(c=c||this.__patterns.django_comment.read(),c=c||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(c=c||this.__patterns.smarty_comment.read(),c=c||this.__patterns.smarty_literal.read(),c=c||this.__patterns.smarty.read()));return c},t.exports.TemplatablePattern=s},,,,function(t,l,r){var i=r(19).Beautifier,o=r(20).Options;function s(c,a,u,f){var w=new i(c,a,u,f);return w.beautify()}t.exports=s,t.exports.defaultOptions=function(){return new o}},function(t,l,r){var i=r(20).Options,o=r(2).Output,s=r(21).Tokenizer,c=r(21).TOKEN,a=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,f=function(M,L){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=M.max_preserve_newlines,this.preserve_newlines=M.preserve_newlines,this._output=new o(M,L)};f.prototype.current_line_has_match=function(M){return this._output.current_line.has_match(M)},f.prototype.set_space_before_token=function(M,L){this._output.space_before_token=M,this._output.non_breaking_space=L},f.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},f.prototype.add_raw_token=function(M){this._output.add_raw_token(M)},f.prototype.print_preserved_newlines=function(M){var L=0;M.type!==c.TEXT&&M.previous.type!==c.TEXT&&(L=M.newlines?1:0),this.preserve_newlines&&(L=M.newlines<this.max_preserve_newlines+1?M.newlines:this.max_preserve_newlines+1);for(var A=0;A<L;A++)this.print_newline(A>0);return L!==0},f.prototype.traverse_whitespace=function(M){return M.whitespace_before||M.newlines?(this.print_preserved_newlines(M)||(this._output.space_before_token=!0),!0):!1},f.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},f.prototype.print_newline=function(M){this._output.add_new_line(M)},f.prototype.print_token=function(M){M.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(M.text))},f.prototype.indent=function(){this.indent_level++},f.prototype.get_full_indent=function(M){return M=this.indent_level+(M||0),M<1?"":this._output.get_indent_string(M)};var w=function(M){for(var L=null,A=M.next;A.type!==c.EOF&&M.closed!==A;){if(A.type===c.ATTRIBUTE&&A.text==="type"){A.next&&A.next.type===c.EQUALS&&A.next.next&&A.next.next.type===c.VALUE&&(L=A.next.next.text);break}A=A.next}return L},_=function(M,L){var A=null,V=null;return L.closed?(M==="script"?A="text/javascript":M==="style"&&(A="text/css"),A=w(L)||A,A.search("text/css")>-1?V="css":A.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?V="javascript":A.search(/(text|application|dojo)\/(x-)?(html)/)>-1?V="html":A.search(/test\/null/)>-1&&(V="null"),V):null};function h(M,L){return L.indexOf(M)!==-1}function R(M,L,A){this.parent=M||null,this.tag=L?L.tag_name:"",this.indent_level=A||0,this.parser_token=L||null}function O(M){this._printer=M,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(M){var L=new R(this._current_frame,M,this._printer.indent_level);this._current_frame=L},O.prototype._try_pop_frame=function(M){var L=null;return M&&(L=M.parser_token,this._printer.indent_level=M.indent_level,this._current_frame=M.parent),L},O.prototype._get_frame=function(M,L){for(var A=this._current_frame;A&&!(M.indexOf(A.tag)!==-1);){if(L&&L.indexOf(A.tag)!==-1){A=null;break}A=A.parent}return A},O.prototype.try_pop=function(M,L){var A=this._get_frame([M],L);return this._try_pop_frame(A)},O.prototype.indent_to_tag=function(M){var L=this._get_frame(M);L&&(this._printer.indent_level=L.indent_level)};function g(M,L,A,V){this._source_text=M||"",L=L||{},this._js_beautify=A,this._css_beautify=V,this._tag_stack=null;var z=new i(L,"html");this._options=z,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}g.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var M=this._source_text,L=this._options.eol;this._options.eol==="auto"&&(L=`
|
|
|
`,M&&a.test(M)&&(L=M.match(a)[0])),M=M.replace(u,`
|
|
|
`);var A=M.match(/^[\t ]*/)[0],V={text:"",type:""},z=new x,W=new f(this._options,A),G=new s(M,this._options).tokenize();this._tag_stack=new O(W);for(var U=null,P=G.next();P.type!==c.EOF;)P.type===c.TAG_OPEN||P.type===c.COMMENT?(U=this._handle_tag_open(W,P,z,V),z=U):P.type===c.ATTRIBUTE||P.type===c.EQUALS||P.type===c.VALUE||P.type===c.TEXT&&!z.tag_complete?U=this._handle_inside_tag(W,P,z,G):P.type===c.TAG_CLOSE?U=this._handle_tag_close(W,P,z):P.type===c.TEXT?U=this._handle_text(W,P,z):W.add_raw_token(P),V=U,P=G.next();var H=W._output.get_code(L);return H},g.prototype._handle_tag_close=function(M,L,A){var V={text:L.text,type:L.type};return M.alignment_size=0,A.tag_complete=!0,M.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),A.is_unformatted?M.add_raw_token(L):(A.tag_start_char==="<"&&(M.set_space_before_token(L.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&A.has_wrapped_attrs&&M.print_newline(!1)),M.print_token(L)),A.indent_content&&!(A.is_unformatted||A.is_content_unformatted)&&(M.indent(),A.indent_content=!1),!A.is_inline_element&&!(A.is_unformatted||A.is_content_unformatted)&&M.set_wrap_point(),V},g.prototype._handle_inside_tag=function(M,L,A,V){var z=A.has_wrapped_attrs,W={text:L.text,type:L.type};if(M.set_space_before_token(L.newlines||L.whitespace_before!=="",!0),A.is_unformatted)M.add_raw_token(L);else if(A.tag_start_char==="{"&&L.type===c.TEXT)M.print_preserved_newlines(L)?(L.newlines=0,M.add_raw_token(L)):M.print_token(L);else{if(L.type===c.ATTRIBUTE?(M.set_space_before_token(!0),A.attr_count+=1):(L.type===c.EQUALS||L.type===c.VALUE&&L.previous.type===c.EQUALS)&&M.set_space_before_token(!1),L.type===c.ATTRIBUTE&&A.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(M.traverse_whitespace(L),z=z||L.newlines!==0),this._is_wrap_attributes_force)){var G=A.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&A.attr_count===1){var U=!0,P=0,H;do{if(H=V.peek(P),H.type===c.ATTRIBUTE){U=!1;break}P+=1}while(P<4&&H.type!==c.EOF&&H.type!==c.TAG_CLOSE);G=!U}G&&(M.print_newline(!1),z=!0)}M.print_token(L),z=z||M.previous_token_wrapped(),A.has_wrapped_attrs=z}return W},g.prototype._handle_text=function(M,L,A){var V={text:L.text,type:"TK_CONTENT"};return A.custom_beautifier_name?this._print_custom_beatifier_text(M,L,A):A.is_unformatted||A.is_content_unformatted?M.add_raw_token(L):(M.traverse_whitespace(L),M.print_token(L)),V},g.prototype._print_custom_beatifier_text=function(M,L,A){var V=this;if(L.text!==""){var z=L.text,W,G=1,U="",P="";A.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?W=this._js_beautify:A.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?W=this._css_beautify:A.custom_beautifier_name==="html"&&(W=function(ve,de){var De=new g(ve,de,V._js_beautify,V._css_beautify);return De.beautify()}),this._options.indent_scripts==="keep"?G=0:this._options.indent_scripts==="separate"&&(G=-M.indent_level);var H=M.get_full_indent(G);if(z=z.replace(/\n[ \t]*$/,""),A.custom_beautifier_name!=="html"&&z[0]==="<"&&z.match(/^(<!--|<!\[CDATA\[)/)){var $=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(z);if(!$){M.add_raw_token(L);return}U=H+$[1]+`
|
|
|
`,z=$[4],$[5]&&(P=H+$[5]),z=z.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(`
|
|
|
`)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(L.whitespace_before=$[0]))}if(z)if(W){var re=function(){this.eol=`
|
|
|
`};re.prototype=this._options.raw_options;var te=new re;z=W(H+z,te)}else{var ge=L.whitespace_before;ge&&(z=z.replace(new RegExp(`
|
|
|
(`+ge+")?","g"),`
|
|
|
`)),z=H+z.replace(/\n/g,`
|
|
|
`+H)}U&&(z?z=U+z+`
|
|
|
`+P:z=U+P),M.print_newline(!1),z&&(L.text=z,L.whitespace_before="",L.newlines=0,M.add_raw_token(L),M.print_newline(!0))}},g.prototype._handle_tag_open=function(M,L,A,V){var z=this._get_tag_open_token(L);return(A.is_unformatted||A.is_content_unformatted)&&!A.is_empty_element&&L.type===c.TAG_OPEN&&L.text.indexOf("</")===0?(M.add_raw_token(L),z.start_tag_token=this._tag_stack.try_pop(z.tag_name)):(M.traverse_whitespace(L),this._set_tag_position(M,L,z,A,V),z.is_inline_element||M.set_wrap_point(),M.print_token(L)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(z.alignment_size=L.text.length+1),!z.tag_complete&&!z.is_unformatted&&(M.alignment_size=z.alignment_size),z};var x=function(M,L){if(this.parent=M||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!L)this.tag_complete=!0;else{var A;this.tag_start_char=L.text[0],this.text=L.text,this.tag_start_char==="<"?(A=L.text.match(/^<([^\s>]*)/),this.tag_check=A?A[1]:""):(A=L.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=A?A[1]:"",(L.text.startsWith("{{#>")||L.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&L.next!==null?this.tag_check=L.next.text.split(" ")[0]:this.tag_check=L.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),L.type===c.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||L.closed&&L.closed.text==="/>";var V=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(V=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(V)))}};g.prototype._get_tag_open_token=function(M){var L=new x(this._tag_stack.get_parser_token(),M);return L.alignment_size=this._options.wrap_attributes_indent_size,L.is_end_tag=L.is_end_tag||h(L.tag_check,this._options.void_elements),L.is_empty_element=L.tag_complete||L.is_start_tag&&L.is_end_tag,L.is_unformatted=!L.tag_complete&&h(L.tag_check,this._options.unformatted),L.is_content_unformatted=!L.is_empty_element&&h(L.tag_check,this._options.content_unformatted),L.is_inline_element=h(L.tag_name,this._options.inline)||L.tag_name.includes("-")||L.tag_start_char==="{",L},g.prototype._set_tag_position=function(M,L,A,V,z){if(A.is_empty_element||(A.is_end_tag?A.start_tag_token=this._tag_stack.try_pop(A.tag_name):(this._do_optional_end_element(A)&&(A.is_inline_element||M.print_newline(!1)),this._tag_stack.record_tag(A),(A.tag_name==="script"||A.tag_name==="style")&&!(A.is_unformatted||A.is_content_unformatted)&&(A.custom_beautifier_name=_(A.tag_check,L)))),h(A.tag_check,this._options.extra_liners)&&(M.print_newline(!1),M._output.just_added_blankline()||M.print_newline(!0)),A.is_empty_element){if(A.tag_start_char==="{"&&A.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),A.indent_content=!0;var W=M.current_line_has_match(/{{#if/);W||M.print_newline(!1)}A.tag_name==="!--"&&z.type===c.TAG_CLOSE&&V.is_end_tag&&A.text.indexOf(`
|
|
|
`)===-1||(A.is_inline_element||A.is_unformatted||M.print_newline(!1),this._calcluate_parent_multiline(M,A))}else if(A.is_end_tag){var G=!1;G=A.start_tag_token&&A.start_tag_token.multiline_content,G=G||!A.is_inline_element&&!(V.is_inline_element||V.is_unformatted)&&!(z.type===c.TAG_CLOSE&&A.start_tag_token===V)&&z.type!=="TK_CONTENT",(A.is_content_unformatted||A.is_unformatted)&&(G=!1),G&&M.print_newline(!1)}else A.indent_content=!A.custom_beautifier_name,A.tag_start_char==="<"&&(A.tag_name==="html"?A.indent_content=this._options.indent_inner_html:A.tag_name==="head"?A.indent_content=this._options.indent_head_inner_html:A.tag_name==="body"&&(A.indent_content=this._options.indent_body_inner_html)),!(A.is_inline_element||A.is_unformatted)&&(z.type!=="TK_CONTENT"||A.is_content_unformatted)&&M.print_newline(!1),this._calcluate_parent_multiline(M,A)},g.prototype._calcluate_parent_multiline=function(M,L){L.parent&&M._output.just_added_newline()&&!((L.is_inline_element||L.is_unformatted)&&L.parent.is_inline_element)&&(L.parent.multiline_content=!0)};var E=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],T=["a","audio","del","ins","map","noscript","video"];g.prototype._do_optional_end_element=function(M){var L=null;if(M.is_empty_element||!M.is_start_tag||!M.parent)return;if(M.tag_name==="body")L=L||this._tag_stack.try_pop("head");else if(M.tag_name==="li")L=L||this._tag_stack.try_pop("li",["ol","ul"]);else if(M.tag_name==="dd"||M.tag_name==="dt")L=L||this._tag_stack.try_pop("dt",["dl"]),L=L||this._tag_stack.try_pop("dd",["dl"]);else if(M.parent.tag_name==="p"&&E.indexOf(M.tag_name)!==-1){var A=M.parent.parent;(!A||T.indexOf(A.tag_name)===-1)&&(L=L||this._tag_stack.try_pop("p"))}else M.tag_name==="rp"||M.tag_name==="rt"?(L=L||this._tag_stack.try_pop("rt",["ruby","rtc"]),L=L||this._tag_stack.try_pop("rp",["ruby","rtc"])):M.tag_name==="optgroup"?L=L||this._tag_stack.try_pop("optgroup",["select"]):M.tag_name==="option"?L=L||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):M.tag_name==="colgroup"?L=L||this._tag_stack.try_pop("caption",["table"]):M.tag_name==="thead"?(L=L||this._tag_stack.try_pop("caption",["table"]),L=L||this._tag_stack.try_pop("colgroup",["table"])):M.tag_name==="tbody"||M.tag_name==="tfoot"?(L=L||this._tag_stack.try_pop("caption",["table"]),L=L||this._tag_stack.try_pop("colgroup",["table"]),L=L||this._tag_stack.try_pop("thead",["table"]),L=L||this._tag_stack.try_pop("tbody",["table"])):M.tag_name==="tr"?(L=L||this._tag_stack.try_pop("caption",["table"]),L=L||this._tag_stack.try_pop("colgroup",["table"]),L=L||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(M.tag_name==="th"||M.tag_name==="td")&&(L=L||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),L=L||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return M.parent=this._tag_stack.get_parser_token(),L},t.exports.Beautifier=g},function(t,l,r){var i=r(6).Options;function o(s){i.call(this,s,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new i,t.exports.Options=o},function(t,l,r){var i=r(9).Tokenizer,o=r(9).TOKEN,s=r(13).Directives,c=r(14).TemplatablePattern,a=r(12).Pattern,u={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},f=new s(/<\!--/,/-->/),w=function(_,h){i.call(this,_,h),this._current_tag_name="";var R=new c(this._input).read_options(this._options),O=new a(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var g=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(g).until_after(g)}};w.prototype=new i,w.prototype._is_comment=function(_){return!1},w.prototype._is_opening=function(_){return _.type===u.TAG_OPEN},w.prototype._is_closing=function(_,h){return _.type===u.TAG_CLOSE&&h&&((_.text===">"||_.text==="/>")&&h.text[0]==="<"||_.text==="}}"&&h.text[0]==="{"&&h.text[1]==="{")},w.prototype._reset=function(){this._current_tag_name=""},w.prototype._get_next_token=function(_,h){var R=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(u.EOF,""):(R=R||this._read_open_handlebars(O,h),R=R||this._read_attribute(O,_,h),R=R||this._read_close(O,h),R=R||this._read_raw_content(O,_,h),R=R||this._read_content_word(O),R=R||this._read_comment_or_cdata(O),R=R||this._read_processing(O),R=R||this._read_open(O,h),R=R||this._create_token(u.UNKNOWN,this._input.next()),R)},w.prototype._read_comment_or_cdata=function(_){var h=null,R=null,O=null;if(_==="<"){var g=this._input.peek(1);g==="!"&&(R=this.__patterns.comment.read(),R?(O=f.get_directives(R),O&&O.ignore==="start"&&(R+=f.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(h=this._create_token(u.COMMENT,R),h.directives=O)}return h},w.prototype._read_processing=function(_){var h=null,R=null,O=null;if(_==="<"){var g=this._input.peek(1);(g==="!"||g==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(h=this._create_token(u.COMMENT,R),h.directives=O)}return h},w.prototype._read_open=function(_,h){var R=null,O=null;return h||_==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),O=this._create_token(u.TAG_OPEN,R)),O},w.prototype._read_open_handlebars=function(_,h){var R=null,O=null;return h||this._options.indent_handlebars&&_==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),O=this._create_token(u.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),O=this._create_token(u.TAG_OPEN,R))),O},w.prototype._read_close=function(_,h){var R=null,O=null;return h&&(h.text[0]==="<"&&(_===">"||_==="/"&&this._input.peek(1)===">")?(R=this._input.next(),_==="/"&&(R+=this._input.next()),O=this._create_token(u.TAG_CLOSE,R)):h.text[0]==="{"&&_==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(u.TAG_CLOSE,"}}"))),O},w.prototype._read_attribute=function(_,h,R){var O=null,g="";if(R&&R.text[0]==="<")if(_==="=")O=this._create_token(u.EQUALS,this._input.next());else if(_==='"'||_==="'"){var x=this._input.next();_==='"'?x+=this.__patterns.double_quote.read():x+=this.__patterns.single_quote.read(),O=this._create_token(u.VALUE,x)}else g=this.__patterns.attribute.read(),g&&(h.type===u.EQUALS?O=this._create_token(u.VALUE,g):O=this._create_token(u.ATTRIBUTE,g));return O},w.prototype._is_content_unformatted=function(_){return this._options.void_elements.indexOf(_)===-1&&(this._options.content_unformatted.indexOf(_)!==-1||this._options.unformatted.indexOf(_)!==-1)},w.prototype._read_raw_content=function(_,h,R){var O="";if(R&&R.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(h.type===u.TAG_CLOSE&&h.opened.text[0]==="<"&&h.text[0]!=="/"){var g=h.opened.text.substr(1).toLowerCase();if(g==="script"||g==="style"){var x=this._read_comment_or_cdata(_);if(x)return x.type=u.TEXT,x;O=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(g)&&(O=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(u.TEXT,O):null},w.prototype._read_content_word=function(_){var h="";if(this._options.unformatted_content_delimiter&&(_===this._options.unformatted_content_delimiter[0]&&(h=this.__patterns.unformatted_content_delimiter.read())),h||(h=this.__patterns.word.read()),h)return this._create_token(u.TEXT,h)},t.exports.Tokenizer=w,t.exports.TOKEN=u}],b={};function p(t){var l=b[t];if(l!==void 0)return l.exports;var r=b[t]={exports:{}};return S[t](r,r.exports,p),r.exports}var d=p(18);C=d})();var k=C;if(!0)!(N=[j,j("6UM0"),j("TXwP")],v=function(S){var b=j("6UM0"),p=j("TXwP");return{html_beautify:function(d,t){return k(d,t,b.js_beautify,p.css_beautify)}}}.apply(Q,N),v!==void 0&&(F.exports=v));else var y,m})()},qBft:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.pad.AnsiX923={pad:function(v,C){var k=v.sigBytes,y=C*4,m=y-k%y,S=k+m-1;v.clamp(),v.words[S>>>2]|=m<<24-S%4*8,v.sigBytes+=m},unpad:function(v){var C=v.words[v.sigBytes-1>>>2]&255;v.sigBytes-=C}},N.pad.Ansix923})},qM6L:function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.WordArray,y=v.enc,m=y.Utf16=y.Utf16BE={stringify:function(b){for(var p=b.words,d=b.sigBytes,t=[],l=0;l<d;l+=2){var r=p[l>>>2]>>>16-l%4*8&65535;t.push(String.fromCharCode(r))}return t.join("")},parse:function(b){for(var p=b.length,d=[],t=0;t<p;t++)d[t>>>1]|=b.charCodeAt(t)<<16-t%2*16;return k.create(d,p*2)}};y.Utf16LE={stringify:function(b){for(var p=b.words,d=b.sigBytes,t=[],l=0;l<d;l+=2){var r=S(p[l>>>2]>>>16-l%4*8&65535);t.push(String.fromCharCode(r))}return t.join("")},parse:function(b){for(var p=b.length,d=[],t=0;t<p;t++)d[t>>>1]|=S(b.charCodeAt(t)<<16-t%2*16);return k.create(d,p*2)}};function S(b){return b<<8&4278255360|b>>>8&16711935}}(),N.enc.Utf16})},qu8F:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){/** @preserve
|
|
|
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
|
* derived from CryptoJS.mode.CTR
|
|
|
* Jan Hruby jhruby.web@gmail.com
|
|
|
*/return N.mode.CTRGladman=function(){var v=N.lib.BlockCipherMode.extend();function C(m){if((m>>24&255)===255){var S=m>>16&255,b=m>>8&255,p=m&255;S===255?(S=0,b===255?(b=0,p===255?p=0:++p):++b):++S,m=0,m+=S<<16,m+=b<<8,m+=p}else m+=1<<24;return m}function k(m){return(m[0]=C(m[0]))===0&&(m[1]=C(m[1])),m}var y=v.Encryptor=v.extend({processBlock:function(m,S){var b=this._cipher,p=b.blockSize,d=this._iv,t=this._counter;d&&(t=this._counter=d.slice(0),this._iv=void 0),k(t);var l=t.slice(0);b.encryptBlock(l,0);for(var r=0;r<p;r++)m[S+r]^=l[r]}});return v.Decryptor=y,v}(),N.mode.CTRGladman})},"rAM+":function(F,Q,j){"use strict";j.d(Q,"a",function(){return v});var N=j("Qw5x");function v(C,k){var y;if(typeof Symbol=="undefined"||C[Symbol.iterator]==null){if(Array.isArray(C)||(y=Object(N.a)(C))||k&&C&&typeof C.length=="number"){y&&(C=y);var m=0,S=function(){};return{s:S,n:function(){return m>=C.length?{done:!0}:{done:!1,value:C[m++]}},e:function(l){throw l},f:S}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b=!0,p=!1,d;return{s:function(){y=C[Symbol.iterator]()},n:function(){var l=y.next();return b=l.done,l},e:function(l){p=!0,d=l},f:function(){try{!b&&y.return!=null&&y.return()}finally{if(p)throw d}}}}},rUJ1:function(F,Q){const j=/[&<>"']/,N=/[&<>"']/g,v=/[<>"']|&(?!#?\w+;)/,C=/[<>"']|&(?!#?\w+;)/g,k={"&":"&","<":"<",">":">",'"':""","'":"'"},y=O=>k[O];function m(O,g){if(g){if(j.test(O))return O.replace(N,y)}else if(v.test(O))return O.replace(C,y);return O}const S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function b(O){return O.replace(S,(g,x)=>(x=x.toLowerCase(),x==="colon"?":":x.charAt(0)==="#"?x.charAt(1)==="x"?String.fromCharCode(parseInt(x.substring(2),16)):String.fromCharCode(+x.substring(1)):""))}const p=/(^|[^\[])\^/g;function d(O,g){O=O.source||O,g=g||"";const x={replace:(E,T)=>(T=T.source||T,T=T.replace(p,"$1"),O=O.replace(E,T),x),getRegex:()=>new RegExp(O,g)};return x}const t=/[^\w:]/g,l=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function r(O,g,x){if(O){let E;try{E=decodeURIComponent(b(x)).replace(t,"").toLowerCase()}catch(T){return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}g&&!l.test(x)&&(x=a(g,x));try{x=encodeURI(x).replace(/%25/g,"%")}catch(E){return null}return x}const i={},o=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(O,g){i[" "+O]||(o.test(O)?i[" "+O]=O+"/":i[" "+O]=_(O,"/",!0)),O=i[" "+O];const x=O.indexOf(":")===-1;return g.substring(0,2)==="//"?x?g:O.replace(s,"$1")+g:g.charAt(0)==="/"?x?g:O.replace(c,"$1")+g:O+g}const u={exec:function(){}};function f(O){let g=1,x,E;for(;g<arguments.length;g++){x=arguments[g];for(E in x)Object.prototype.hasOwnProperty.call(x,E)&&(O[E]=x[E])}return O}function w(O,g){const x=O.replace(/\|/g,(M,L,A)=>{let V=!1,z=L;for(;--z>=0&&A[z]==="\\";)V=!V;return V?"|":" |"}),E=x.split(/ \|/);let T=0;if(E.length>g)E.splice(g);else for(;E.length<g;)E.push("");for(;T<E.length;T++)E[T]=E[T].trim().replace(/\\\|/g,"|");return E}function _(O,g,x){const E=O.length;if(E===0)return"";let T=0;for(;T<E;){const M=O.charAt(E-T-1);if(M===g&&!x)T++;else if(M!==g&&x)T++;else break}return O.substr(0,E-T)}function h(O,g){if(O.indexOf(g[1])===-1)return-1;const x=O.length;let E=0,T=0;for(;T<x;T++)if(O[T]==="\\")T++;else if(O[T]===g[0])E++;else if(O[T]===g[1]&&(E--,E<0))return T;return-1}function R(O){O&&O.sanitize&&!O.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")}F.exports={escape:m,unescape:b,edit:d,cleanUrl:r,resolveUrl:a,noopTest:u,merge:f,splitCells:w,rtrim:_,findClosingBracket:h,checkSanitizeDeprecation:R}},rWjI:function(F,Q,j){"use strict";j.r(Q),j.d(Q,"Types",function(){return Et});var N=j("P2fV"),v=j("NJEC"),C=j("CiB2"),k=j("DYRE"),y=j("zeV3"),m=j("sRBo"),S=j("kaz8"),b=j("7Kak"),p=j("9yH6"),d=j("giR+"),t=j("fyUT"),l=j("OaEy"),r=j("2fM7"),i=j("oBTY"),o=j("rAM+"),s=j("T2oS"),c=j("W9HT"),a=j("g9YV"),u=j("wCAj"),f=j("+L6B"),w=j("2/Rp"),_=j("14J3"),h=j("BMrR"),R=j("jCWc"),O=j("kPKH"),g=j("miYZ"),x=j("tsqr"),E=j("9og8"),T=j("y8nQ"),M=j("Vl3Y"),L=j("tJVT"),A=j("k1fw"),V=j("fu2T"),z=j("gK9i"),W=j("2qtc"),G=j("kLXV"),U=j("5NDa"),P=j("5rEg"),H=j("WmNS"),$=j.n(H),re=j("cDcd"),te=j.n(re),ge=j("eRFJ"),ve=j.n(ge),de=j("jrin"),De,Te=r.a.Option,he;(function(Ct){Ct[Ct.language=0]="language",Ct[Ct.difficulty=1]="difficulty",Ct[Ct.category=2]="category",Ct[Ct.openOrNot=3]="openOrNot"})(he||(he={}));var ue=(De={},Object(de.a)(De,he.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(de.a)(De,he.difficulty,[{title:"\u7B80\u5355",key:1},{title:"\u9002\u4E2D",key:2},{title:"\u56F0\u96BE",key:3}]),Object(de.a)(De,he.category,[{title:"\u7A0B\u5E8F\u8BBE\u8BA1",key:1},{title:"\u7B97\u6CD5",key:2}]),Object(de.a)(De,he.openOrNot,[{title:"\u516C\u5F00",key:1},{title:"\u79C1\u6709",key:0}]),De);function ie(Ct){return ue[Ct].map(function(Dt){return te.a.createElement(Te,{key:Dt.title,value:Dt.key}," ",Dt.title," ")})}function Se(Ct,Dt){Ct.map(function(wt){var wr=wt.id,Cr=wt.name,Jt=wt.sub_disciplines,Ut={value:wr,label:Cr};Dt.push(Ut),Jt&&Jt.length>0&&(Ut.children=[],Se(Jt,Ut.children))})}function ne(Ct,Dt){for(var wt=[],wr=0;wr<Ct.length;wr++){var Cr,Jt=Ct[wr];if(((Cr=Jt.sub_disciplines)===null||Cr===void 0?void 0:Cr.length)>0){wt[0]=Jt.id;for(var Ut=0;Ut<Jt.sub_disciplines.length;Ut++){var Or=Jt.sub_disciplines[Ut];if(Or.id===Dt)return wt[1]=Or.id,[wt,Or.tag_disciplines||Or.sub_disciplines||[]]}}}return[wt,[]]}var ce=j("Ty5D"),Oe=j("9kvl"),oe=j("J66h"),q=j("GIiI"),Y=j("2BaD"),Z=j("Ot1p"),ye=j("ErOA");function be(Ct){return Object(ye.f)("practices.json",Ct)}function Re(){return Object(ye.c)("problems/new.json")}function Qe(Ct){return Object(ye.c)("practices/".concat(Ct,"/edit.json"))}function rt(Ct,Dt){return Object(ye.g)("practices/".concat(Ct),Dt)}function at(Ct,Dt){return Object(ye.f)("exercises/".concat(Ct,"/exercise_questions.json"),Dt)}function qe(Ct,Dt){return Object(ye.g)("exercise_questions/".concat(Ct,".json"),Dt)}var st=j("cDPC"),lt=j("bbsP"),je=j("/wGt"),Ie=j("0Owb"),tt=j("ZW9T"),ot=j("ZD9Y"),ze=j("M8RZ"),Ze=j("bCnd"),Ne=j("1T2W"),Ae=j.n(Ne),Me={theme:Object(Ze.a)("cmCodeMode","vs-dark"),fontSize:Object(Ze.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(Ze.a)("cmTabToSpace",!0)},Ee;(function(Ct){Ct[Ct.set_font_size=0]="set_font_size",Ct[Ct.set_theme=1]="set_theme",Ct[Ct.on_tab_to_space=2]="on_tab_to_space",Ct[Ct.set_show_editor_setting=3]="set_show_editor_setting"})(Ee||(Ee={}));function Ce(Ct,Dt){switch(Dt.type){case Ee.set_show_editor_setting:return Object(A.a)(Object(A.a)({},Ct),{},{showEditorSetting:Dt.payload});case Ee.set_theme:return Object(A.a)(Object(A.a)({},Ct),{},{theme:Dt.payload});case Ee.set_font_size:return Object(A.a)(Object(A.a)({},Ct),{},{fontSize:Dt.payload});case Ee.on_tab_to_space:return Object(A.a)(Object(A.a)({},Ct),{},{tabToSpace:Dt.payload});default:throw new Error}}var ke=function(Ct){var Dt=Ct.value,wt=Ct.onChange,wr=Ct.language,Cr=Ct.onLanguage,Jt=Ct.languageItems,Ut=Ct.ActionBarRender,Or=Ut===void 0?function(me){return te.a.createElement(Fe,{languageItems:Jt,onLanguage:Cr,language:wr,onShowCodeSetting:me})}:Ut,un=Object(re.useReducer)(Ce,Me),Nr=Object(L.a)(un,2),bt=Nr[0],Bt=Nr[1],Jr=bt.theme,on=bt.fontSize,Ln=bt.showEditorSetting,Sn=bt.tabToSpace;console.log(Dt,wr,"value");var le={onFontSizeChange:function(ae){Bt({type:Ee.set_font_size,payload:ae}),Object(Ze.b)("cmFontSize",ae)},tabToSpace:Sn,cmFontSize:on,className:"oj",cmCodeMode:Jr,onTabToSpace:function(ae){Bt({type:Ee.on_tab_to_space,payload:ae}),Object(Ze.b)("cmTabToSpace",ae)},onCodeModeChange:function(ae){Bt({type:Ee.set_theme,payload:ae}),Object(Ze.b)("cmCodeMode",ae)}};function K(){Bt({type:Ee.set_show_editor_setting,payload:!1})}function X(){Bt({type:Ee.set_show_editor_setting,payload:!0})}var ee={value:Dt,language:wr,onChange:wt,theme:Jr,height:"calc(100% - 56px)",options:{fontSize:on,insertSpaces:Sn}};return te.a.createElement(re.Fragment,null,te.a.createElement("div",{className:Ae.a["code-panel-container"]},Or(X),te.a.createElement(tt.b,Object(Ie.a)({key:wr},ee))),te.a.createElement(ze.a,null,te.a.createElement(je.a,{className:"oj",title:null,placement:"right",closable:!1,visible:Ln,onClose:K},te.a.createElement(ot.a,le))))};function Fe(Ct){var Dt=Ct.languageItems,wt=Ct.language,wr=Ct.onShowCodeSetting,Cr=Ct.onLanguage;return te.a.createElement("div",{className:Ae.a["action-oj-bar"]},Dt==null?void 0:Dt.map(function(Jt){return te.a.createElement("div",{className:wt===(Jt==null?void 0:Jt.language)?Ae.a.active:"",onClick:function(){return Cr(Jt==null?void 0:Jt.language)},key:Jt==null?void 0:Jt.language},Jt==null?void 0:Jt.language)}),te.a.createElement("a",{onClick:wr},te.a.createElement("i",{className:"iconfont icon-shezhi"})))}var Be=j("Znn+"),et=j("ZTPi"),ct=j("L9qf"),yt=j.n(ct),ft=function(Dt){var wt=Dt.visible,wr=Dt.onOK,Cr=Dt.onCancel,Jt=Object(re.useState)(!1),Ut=Object(L.a)(Jt,2),Or=Ut[0],un=Ut[1],Nr=Object(re.useState)(!1),bt=Object(L.a)(Nr,2),Bt=bt[0],Jr=bt[1],on=Object(re.useState)("1"),Ln=Object(L.a)(on,2),Sn=Ln[0],le=Ln[1],K=Object(re.useState)(""),X=Object(L.a)(K,2),ee=X[0],me=X[1],ae=Object(re.useState)([]),Ke=Object(L.a)(ae,2),pt=Ke[0],Ot=Ke[1],Ht=function(){var zr=Object(E.a)($.a.mark(function or(){var Qr;return $.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:if(ee){zt.next=3;break}return x.b.warn("\u9898\u76EE".concat(nn,"\u4E0D\u80FD\u4E3A\u7A7A")),zt.abrupt("return");case 3:return Jr(!0),zt.next=6,Object(ye.a)("/api/tag_disciplines.json",{method:"post",body:{target:wt,name:ee}});case 6:if(Qr=zt.sent,!((Qr==null?void 0:Qr.status)===0)){zt.next=10;break}return wr(),zt.abrupt("return");case 10:Jr(!1);case 11:case"end":return zt.stop()}},or)}));return function(){return zr.apply(this,arguments)}}(),vt=function(){var zr=Object(E.a)($.a.mark(function or(){var Qr,Cn,zt=arguments;return $.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return Qr=zt.length>0&&zt[0]!==void 0?zt[0]:"",un(!0),fr.next=4,Object(ye.a)("/api/tag_disciplines.json",{method:"get",params:{target:wt,search:Qr}});case 4:Cn=fr.sent,Ot(Cn.tag_disciplines||[]),un(!1);case 7:case"end":return fr.stop()}},or)}));return function(){return zr.apply(this,arguments)}}(),Xt=function(or){var Qr=or.name;G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u91CD\u547D\u540D",content:te.a.createElement("div",null,te.a.createElement(P.a,{defaultValue:Qr,placeholder:"\u8BF7\u8F93\u5165".concat(nn,"\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57"),maxLength:20,onChange:function(zt){Qr=zt.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Cn=Object(E.a)($.a.mark(function pr(){var fr;return $.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:if(Qr){Er.next=3;break}return x.b.warn("\u9898\u76EE".concat(nn,"\u4E0D\u80FD\u4E3A\u7A7A")),Er.abrupt("return",Promise.reject());case 3:return Er.next=5,Object(ye.a)("/api/tag_disciplines/".concat(or.id,"/rename.json"),{method:"post",body:{id:or.id,name:Qr}});case 5:fr=Er.sent,(fr==null?void 0:fr.status)===0&&vt();case 7:case"end":return Er.stop()}},pr)}));function zt(){return Cn.apply(this,arguments)}return zt}()})},qt=function(or){G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,width:570,title:"\u5220\u9664",content:wt==="practice"?te.a.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u6765\u6E90\u201C",te.a.createElement("span",{className:"c-light-primary"},or.name),"\u201D\u5220\u9664\u5417\uFF1F",te.a.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u6765\u6E90\u8FDB\u884C\u6E05\u9664\u3002"):te.a.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u77E5\u8BC6\u70B9\u201C",te.a.createElement("span",{className:"c-light-primary"},or.name),"\u201D\u5220\u9664\u5417\uFF1F",te.a.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u77E5\u8BC6\u70B9\u8FDB\u884C\u6E05\u9664\u3002"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Qr=Object(E.a)($.a.mark(function zt(){var pr;return $.a.wrap(function(jr){for(;;)switch(jr.prev=jr.next){case 0:return jr.next=2,Object(ye.a)("/api/tag_disciplines/".concat(or.id,".json"),{method:"delete",body:{id:or.id}});case 2:pr=jr.sent,(pr==null?void 0:pr.status)===0&&vt();case 4:case"end":return jr.stop()}},zt)}));function Cn(){return Qr.apply(this,arguments)}return Cn}()})},Hr=function(or){vt(or)},nn=wt==="practice"?"\u77E5\u8BC6\u70B9":"\u6765\u6E90";return te.a.createElement(G.a,{afterClose:function(){Jr(!1),un(!1),me(""),le("1"),Ot([])},centered:!0,keyboard:!1,width:600,title:"".concat(nn,"\u7BA1\u7406"),visible:!!wt,className:yt.a.customModal,footer:null,onCancel:Cr},te.a.createElement("section",{className:yt.a.wrap},te.a.createElement(et.a,{activeKey:Sn,onChange:function(or){me(""),le(or),vt()}},te.a.createElement(et.a.TabPane,{tab:"\u65B0\u589E".concat(nn),key:"1"},te.a.createElement(P.a,{value:ee,onChange:function(or){return me(or.target.value)},className:yt.a.in,placeholder:"\u8F93\u5165".concat(nn,"\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57"),maxLength:20}),te.a.createElement("div",{className:yt.a.btns},te.a.createElement(w.a,{onClick:Cr,className:"mr20"},"\u53D6\u6D88 "),te.a.createElement(w.a,{loading:Bt,onClick:Ht,type:"primary"},"\u786E\u8BA4\u65B0\u5EFA"))),te.a.createElement(et.a.TabPane,{tab:"\u5DF2\u6709".concat(nn),key:"2"},te.a.createElement(P.a.Search,{allowClear:!0,onSearch:Hr,value:ee,onChange:function(or){return me(or.target.value)},className:yt.a.in,placeholder:"\u8F93\u5165".concat(nn,"\u540D\u79F0\u8FDB\u884C\u67E5\u8BE2")}),te.a.createElement(u.a,{dataSource:pt,bordered:!1,loading:Or,scroll:pt.length>7?{y:300}:{},style:{padding:"0 40px 20px 40px"},columns:[{title:"".concat(nn,"\u540D\u79F0"),dataIndex:"name",ellipsis:!0},{title:"\u64CD\u4F5C",dataIndex:"action",width:120,render:function(or,Qr){return te.a.createElement("span",null,te.a.createElement("span",{onClick:function(){return Xt(Qr)},className:"current mr10 c-light-primary"},"\u91CD\u547D\u540D"),te.a.createElement("span",{onClick:function(){return qt(Qr)},className:"current c-grey-666"},"\u5220\u9664"))}}],pagination:!1})))))},mt=ft,It=j("m3rI"),At=j("B7Ph"),_t=j("wd/R"),Vt=j.n(_t),Kt=j("1vsH"),tr=j("9Bee"),rr=j("xKgJ"),Wt=P.a.TextArea,Lt=G.a.confirm,nr=z.a.Panel,dt={loading:!0,user:null,status:0,data:void 0,lastedUpdateTime:0},Et;(function(Ct){Ct[Ct.SET_INITAL_DATA=0]="SET_INITAL_DATA",Ct[Ct.SET_LOADING=1]="SET_LOADING",Ct[Ct.SET_STATUS=2]="SET_STATUS"})(Et||(Et={}));var jt="#### \u9898\u76EE\u63CF\u8FF0\n\u73B0\u6709\u4E00\u4E2A\u6574\u578B\u6570\u7EC4 `nums`\uFF0C\u8BF7\u7F16\u5199\u7A0B\u5E8F\u5C06\u6570\u7EC4 `nums` \u4E2D\u7684\u6240\u6709 `$$0$$` \u79FB\u52A8\u5230\u6570\u7EC4\u7684\u672B\u5C3E\uFF0C\u4F46\u4E0D\u6539\u53D8\u975E\u96F6\u5143\u7D20\u5728\u6570\u7EC4\u4E2D\u7684\u76F8\u5BF9\u4F4D\u7F6E\u3002\u8BF7\u5728\u539F\u6570\u7EC4 `nums` \u4E0A\u8FDB\u884C\u64CD\u4F5C\u3002\n#### \u8F93\u5165\u8F93\u51FA\u683C\u5F0F\n**\u8F93\u5165\u683C\u5F0F**\n\u7B2C\u4E00\u884C\u6709\u4E00\u4E2A\u6574\u6570 `numsSize`\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u5927\u5C0F\uFF1B\n\u7B2C\u4E8C\u884C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n**\u8F93\u51FA\u683C\u5F0F**\n\u4E00\u884C\u8F93\u51FA\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B1\n**\u8F93\u5165**\n`4`\n`0 1 2 3`\n**\u8F93\u51FA**\n`1 2 3 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B2\n**\u8F93\u5165**\n`5`\n`1 1 0 1 0`\n**\u8F93\u51FA**\n`1 1 1 0 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8BF4\u660E\u63D0\u793A\n-`1\u2264n\u2264100`";function kt(Ct,Dt){switch(Dt.type){case Et.SET_INITAL_DATA:return Object(A.a)(Object(A.a)({},Ct),Dt.payload);case Et.SET_LOADING:return Object(A.a)(Object(A.a)({},Ct),{},{loading:Dt.payload});case Et.SET_STATUS:return Object(A.a)(Object(A.a)({},Ct),{},{status:Dt.payload});default:throw new Error}}var hr=Q.default=function(){var Ct,Dt,wt,wr=Object(ce.h)(),Cr=Object(ce.g)(),Jt=Object(ce.i)(),Ut=Jt.id,Or=M.a.useForm(),un=Object(L.a)(Or,1),Nr=un[0],bt=Object(re.useState)(),Bt=Object(L.a)(bt,2),Jr=Bt[0],on=Bt[1],Ln=Object(re.useState)(!1),Sn=Object(L.a)(Ln,2),le=Sn[0],K=Sn[1],X=Object(re.useState)([]),ee=Object(L.a)(X,2),me=ee[0],ae=ee[1],Ke=Object(re.useState)([]),pt=Object(L.a)(Ke,2),Ot=pt[0],Ht=pt[1],vt=Object(re.useState)([]),Xt=Object(L.a)(vt,2),qt=Xt[0],Hr=Xt[1],nn=Object(re.useState)([]),zr=Object(L.a)(nn,2),or=zr[0],Qr=zr[1],Cn=Object(re.useState)([]),zt=Object(L.a)(Cn,2),pr=zt[0],fr=zt[1],jr=Object(re.useState)("C"),Er=Object(L.a)(jr,2),li=Er[0],On=Er[1],Ui=Object(re.useReducer)(kt,dt),Bi=Object(L.a)(Ui,2),qn=Bi[0],sn=Bi[1],Si=qn.loading,dn=qn.data,Yn=qn.user,Zr=qn.status,cr=dn==null?void 0:dn.hack_sets,tn=dn==null||((Ct=dn.hack)===null||Ct===void 0)?void 0:Ct.test_set_average,br=Object(re.useState)(!1),hn=Object(L.a)(br,2),Fr=hn[0],mi=hn[1],_n=Object(re.useRef)([]),Un=Object(re.useState)(!1),Di=Object(L.a)(Un,2),ui=Di[0],bi=Di[1],ei=Object(re.useState)(!1),ti=Object(L.a)(ei,2),ji=ti[0],ci=ti[1],_i=Object(re.useRef)(!0),Hi=Object(re.useState)({}),di=Object(L.a)(Hi,2),qr=di[0],Yt=di[1];Object(re.useEffect)(function(){return Object(Oe.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(Oe.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(Oe.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(Oe.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(re.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)});var sr=function(){var lr=Object(E.a)($.a.mark(function Ft(){var mr,vr;return $.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(ye.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice"}});case 2:return mr=Ir.sent,Ir.next=5,Object(ye.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice_source"}});case 5:vr=Ir.sent,Ht(mr.tag_disciplines||[]),Hr(vr.tag_disciplines||[]);case 8:case"end":return Ir.stop()}},Ft)}));return function(){return lr.apply(this,arguments)}}(),Qt=[{language:"C",code:""},{language:"C++",code:""},{language:"Java",code:""},{language:"Python",code:""}],gr=Object(re.useCallback)(Object(E.a)($.a.mark(function lr(){var Ft,mr,vr,rn,Ir,An,En,Li,Hn,Gn,Jn,$i,Pe,Xe,Je,Ue,_e,Le,we,He,Ge,$e,Ye,nt,ht,St,Tt;return $.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:if(sn({type:Et.SET_LOADING,payload:!0}),!Ut){er.next=19;break}return er.next=4,Qe(Ut);case 4:Ft=er.sent,mr=Ft.user,vr=Ft.language,rn=Ft.practice_sets,Ir=Ft.practice_codes,An=Ft.description,En=Ft.difficulty,Li=Ft.name,Hn=Ft.open_or_not,Gn=Ft.time_limit,Jn=Ft.test_set_average,$i=Ft.test_set_score,Pe=Ft.status,Xe=Ft.tag_discipline_ids,Je=Ft.source_discipline_ids,Ue=Ft.item_banks_group_id,_e=Ft.is_file,Le=_e===void 0?!1:_e,we=Ft.hide_actual_output,He=Ft.review_privilege,Ge=Ft.review_description,$e={review_privilege:He,status:Pe,review_description:Ge,name:Li},Yt($e),mi(we),Ye=Le?[{input:"",output:"",score:100,position:1}]:rn,Le?(ae(rn),Nr.setFieldsValue({hack_sets:Ye})):ae([]),nt={loading:!0,user:mr,status:Pe,data:{hack:{difficulty:En,name:Li,description:An,open_or_not:Hn,time_limit:Gn,test_set_average:Jn,test_set_score:$i,tag_discipline_ids:Xe,source_discipline_ids:Je,is_file:Le},hack_sets:Ye}},sn({type:Et.SET_INITAL_DATA,payload:nt}),on({hack:{difficulty:En,name:Li,description:An,open_or_not:Hn,time_limit:Gn,test_set_average:Jn,test_set_score:$i,tag_discipline_ids:Xe,source_discipline_ids:Je,is_file:Le}}),ht=Ir==null?void 0:Ir.map(function(yr){return Object(A.a)(Object(A.a)({},yr),{},{code:oe.Base64.decode(yr==null?void 0:yr.code)})}),fr(ht),_n.current=ht,er.next=27;break;case 19:return er.next=21,Re();case 21:St=er.sent,Tt=St.user,sn({type:Et.SET_INITAL_DATA,payload:{loading:!0,status:0,user:Tt,data:{hack:{difficulty:"",time_limit:3,description:jt,test_set_score:!0,test_set_average:!0,open_or_not:!0,name:"",is_file:!1},hack_sets:[{input:"",output:"",score:100,position:1}]}}}),on({hack:{difficulty:"",time_limit:3,description:"",test_set_average:!0,open_or_not:!0,name:"",is_file:!1}}),fr(Qt),_n.current=Qt;case 27:sn({type:Et.SET_LOADING,payload:!1});case 28:case"end":return er.stop()}},lr)})),[Ut]);Object(re.useEffect)(function(){try{gr(),sr()}catch(lr){console.log(lr,"----")}},[]);function Lr(lr,Ft){return Kr.apply(this,arguments)}function Kr(){return Kr=Object(E.a)($.a.mark(function lr(Ft,mr){var vr,rn,Ir,An,En,Li,Hn,Gn,Jn,$i,Pe,Xe,Je,Ue,_e,Le,we,He;return $.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:rn=Object(A.a)({},Ft),Ir=rn.hack_sets,An=rn.hack,An.hide_actual_output=Fr,En=[],Li=[],Hn=0,Gn=An!=null&&An.is_file?me.map(function(Ye,nt){return Object(A.a)(Object(A.a)({},Ye),{},{position:nt+1})}):Ir.map(function(Ye){return Object(A.a)(Object(A.a)({},Ye),{},{is_file:!1})}),Jn=Object(o.a)(Gn);try{for(Jn.s();!($i=Jn.n()).done;)Pe=$i.value,Hn+=Pe.score,Pe.id&&Pe.id>=0?En.push(Pe):Li.push(Pe)}catch(Ye){Jn.e(Ye)}finally{Jn.f()}if(Gn!=null&&Gn.length){$e.next=11;break}return x.b.error("\u6D4B\u8BD5\u96C6\u4E0D\u80FD\u4E3A\u7A7A"),$e.abrupt("return");case 11:if(!(Hn!==100&&!An.test_set_score)){$e.next=14;break}return x.b.error("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),$e.abrupt("return");case 14:if(!(Gn!=null&&Gn.some(function(Ye){return!Ye.output}))){$e.next=17;break}return x.b.error("\u6D4B\u8BD5\u96C6\u8F93\u51FA\u4E0D\u80FD\u4E3A\u7A7A"),$e.abrupt("return");case 17:if(_i.current?bi(!0):ci(!0),Je=pr==null?void 0:pr.map(function(Ye){return Object(A.a)(Object(A.a)({},Ye),{},{code:oe.Base64.encode(Ye==null?void 0:Ye.code)})}),!Ut){$e.next=25;break}return $e.next=22,rt(Ut,{practice:An,practice_codes:Je,practice_sets:Li,update_practice_sets:En});case 22:Xe=$e.sent,$e.next=28;break;case 25:return $e.next=27,be({practice:An,practice_codes:Je,practice_sets:Gn,publish:!_i.current});case 27:Xe=$e.sent;case 28:if(bi(!1),ci(!1),!(((vr=Xe)===null||vr===void 0?void 0:vr.status)===0)){$e.next=46;break}if(!((Ue=Xe)!==null&&Ue!==void 0&&(_e=Ue.similar_practice)!==null&&_e!==void 0&&_e.length)){$e.next=35;break}return K(!0),Qr((Le=Xe)===null||Le===void 0?void 0:Le.similar_practice),$e.abrupt("return");case 35:if(!Ut){$e.next=44;break}if(x.b.success("\u4FDD\u5B58\u6210\u529F"),_i.current){$e.next=42;break}return $e.next=40,Object(ye.a)("/api/practices/".concat(Ut,"/start"),{method:"get"});case 40:we=$e.sent,(we==null?void 0:we.status)===0&&Cr.push("/problems/".concat(we==null?void 0:we.identifier,"/oj/").concat(Ut));case 42:$e.next=46;break;case 44:x.b.success("\u65B0\u5EFA\u6210\u529F"),Cr.replace("/problems/".concat((He=Xe)===null||He===void 0?void 0:He.identifier,"/ojedit"));case 46:case"end":return $e.stop()}},lr)})),Kr.apply(this,arguments)}function Ar(){Cr.replace("/problems")}var gn=function(Ft){var mr=Math.floor(100/Ft.length),vr=mr+100%Ft.length;Ft=Ft.map(function(rn,Ir){return Ir===Ft.length-1?Object(A.a)(Object(A.a)({},rn),{},{score:vr}):Object(A.a)(Object(A.a)({},rn),{},{score:mr})}),ae(Ft)};function $n(lr){lr.target.value||gn(me),sn({type:Et.SET_INITAL_DATA,payload:{data:Object(A.a)(Object(A.a)({},dn),{},{hack:Object(A.a)(Object(A.a)({},dn.hack),{},{test_set_score:lr.target.value})})}})}function xr(lr){sn({type:Et.SET_INITAL_DATA,payload:{data:Object(A.a)(Object(A.a)({},dn),{},{hack:Object(A.a)(Object(A.a)({},dn.hack),{},{is_file:lr.target.value})})}})}function Ei(lr){mi(lr.target.checked)}function Vr(lr){var Ft=lr.target.value;Ft&&gn(me),sn({type:Et.SET_INITAL_DATA,payload:{data:Object(A.a)(Object(A.a)({},dn),{},{hack:Object(A.a)(Object(A.a)({},dn.hack),{},{test_set_average:Ft})})}})}function jn(){var lr=Nr.getFieldValue("hack_sets"),Ft=lr.length+1,mr=Math.floor(100/Ft),vr=100%Ft;lr.map(function(rn,Ir){return tn&&(rn.score=mr),rn.position=Ir+1,rn}),lr.push({input:"",output:"",position:Ft,score:tn?mr+vr:0}),Nr.setFieldsValue({hack_sets:lr}),sn({type:Et.SET_INITAL_DATA,payload:{data:Object(A.a)(Object(A.a)({},dn),{},{hack_sets:lr})}})}Object(re.useEffect)(function(){if(tn){var lr=cr==null?void 0:cr.length,Ft=Math.floor(100/lr),mr=100%lr;cr==null||cr.map(function(vr,rn){return vr.score=Ft,vr.position=rn+1,rn===lr-1&&(vr.score=Ft+mr),vr}),sn({type:Et.SET_INITAL_DATA,payload:{data:Object(A.a)(Object(A.a)({},dn),{},{hack_sets:cr})}}),Nr.setFieldsValue({hack_sets:cr})}},[tn]);function Bn(lr){var Ft=Nr.getFieldValue("hack_sets"),mr=(Ft==null?void 0:Ft.length)-1,vr=Math.ceil(100/mr),rn=100%mr;Ft.splice(lr,1),Ft==null||Ft.map(function(Ir,An){return tn&&(Ir.score=vr,An===mr-1&&(Ir.score=vr+rn)),Ir.position=An+1,Ir}),sn({type:Et.SET_INITAL_DATA,payload:{data:Object(A.a)(Object(A.a)({},dn),{},{hack_sets:Ft})}}),Nr.setFieldsValue({hack_sets:Ft})}function gi(lr){On(lr)}var ua=function(Ft){var mr,vr=(mr=_n.current)===null||mr===void 0?void 0:mr.findIndex(function(rn){return rn.language===li});_n.current[vr].code=Ft,fr(_n.current)},Xr=function(Ft){on(Object(A.a)({},Nr.getFieldsValue()))},Mr=function(){var lr=Object(E.a)($.a.mark(function Ft(mr){var vr;return $.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(ye.a)("/api/practices/".concat(mr,"/start"),{method:"get"});case 2:vr=Ir.sent,(vr==null?void 0:vr.status)===0&&Object(Kt.U)("/problems/".concat(vr==null?void 0:vr.identifier,"/oj/").concat(mr));case 4:case"end":return Ir.stop()}},Ft)}));return function(mr){return lr.apply(this,arguments)}}(),Rr=function(){var lr=Object(E.a)($.a.mark(function Ft(){var mr,vr,rn,Ir,An,En;return $.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.next=2,Qe(Ut);case 2:mr=Hn.sent,vr=mr.name,rn=mr.status,Ir=mr.review_privilege,An=mr.review_description,En={review_privilege:Ir,status:rn,review_description:An,name:vr},Yt(En);case 6:case"end":return Hn.stop()}},Ft)}));return function(){return lr.apply(this,arguments)}}(),hi=function(){var Ft="";G.a.confirm({icon:null,width:700,className:"custom-modal-divider",centered:!0,title:"\u4E0D\u901A\u8FC7\u539F\u56E0",content:te.a.createElement("div",{className:"mt20"},te.a.createElement(Z.a,{className:ve.a.MdEditor,defaultValue:Ft,onChange:function(vr){Ft=vr}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var mr=Object(E.a)($.a.mark(function rn(){var Ir;return $.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(Ft){En.next=3;break}return x.b.warn("\u4E0D\u901A\u8FC7\u539F\u56E0\u4E0D\u80FD\u4E3A\u7A7A"),En.abrupt("return",Promise.reject());case 3:return En.next=5,Object(ye.a)("/api/practices/".concat(Ut,"/review.json"),{method:"post",body:{op:"fail",description:Ft}});case 5:Ir=En.sent,(Ir==null?void 0:Ir.status)===0&&(x.b.success("\u63D0\u4EA4\u6210\u529F"),Rr());case 7:case"end":return En.stop()}},rn)}));function vr(){return mr.apply(this,arguments)}return vr}()})},Xi=function(){var lr=Object(E.a)($.a.mark(function Ft(){return $.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u63D0\u793A",content:"\u786E\u8BA4\u5C06\u9898\u76EE\u300A".concat(qr==null?void 0:qr.name,"\u300B\u7684\u5BA1\u6838\u901A\u8FC7\u5417\uFF1F"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var rn=Object(E.a)($.a.mark(function An(){var En;return $.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.next=2,Object(ye.a)("/api/practices/".concat(Ut,"/review.json"),{method:"post",body:{op:"pass"}});case 2:En=Hn.sent,(En==null?void 0:En.status)===0&&(x.b.success("\u63D0\u4EA4\u6210\u529F"),Rr());case 4:case"end":return Hn.stop()}},An)}));function Ir(){return rn.apply(this,arguments)}return Ir}()});case 1:case"end":return vr.stop()}},Ft)}));return function(){return lr.apply(this,arguments)}}(),Yi=function(){var Ft=G.a.confirm({icon:null,width:700,className:"".concat(ve.a.cusModal," custom-modal-divider"),centered:!0,title:te.a.createElement(h.a,null,te.a.createElement(O.a,{flex:"1"},"\u4E0D\u901A\u8FC7\u539F\u56E0"),te.a.createElement(O.a,null,te.a.createElement("span",{className:"iconfont icon-guanbi7 font12 current c-grey-c",onClick:function(){return Ft.destroy()}}))),content:te.a.createElement("div",null,te.a.createElement(tr.a,{className:"mt20",value:(qr==null?void 0:qr.review_description)||""}))})};return te.a.createElement(c.a,{spinning:Si,size:"large",className:ve.a["oj-custom-large-spin"]},dn?te.a.createElement(re.Fragment,null,te.a.createElement("header",{className:ve.a.header},te.a.createElement("div",null,te.a.createElement("img",{src:"".concat(It.a.IMG_SERVER,"/images/").concat(Yn==null?void 0:Yn.image_url),alt:"user",width:30}),te.a.createElement("span",null,Yn==null?void 0:Yn.name)),te.a.createElement("h2",null," ",dn==null||((Dt=dn.hack)===null||Dt===void 0)?void 0:Dt.name," "),Ut?te.a.createElement("a",{className:ve.a.btn_back,onClick:Ar}," ",te.a.createElement(q.a,null),"\u9000\u51FA"):null),te.a.createElement(M.a,{form:Nr,initialValues:dn,layout:"vertical",className:ve.a["oj-form-container"],onValuesChange:Xr,onFinish:Lr},te.a.createElement(st.a,{hideResize:!0,className:ve.a["oj-problems"],leftChild:te.a.createElement(Nn,{formValue:Jr,onRemoveTestCase:Bn,onAddTestCase:jn,hack:dn.hack,onChangeScore:$n,onChangehide:Ei,onChangeAverage:Vr,onChangeFile:xr,uploadData:me,setUploadData:ae,handleUploadRatio:gn,ischecked:Fr,pointData:Ot,sourceData:qt,getPointData:sr,id:Ut}),rightChild:te.a.createElement(ke,{value:pr==null||((wt=pr.find(function(lr){return lr.language===li}))===null||wt===void 0)?void 0:wt.code,onChange:ua,onLanguage:gi,languageItems:pr,language:li})}),te.a.createElement("div",{className:ve.a.footer},!!Ut&&te.a.createElement("div",{className:ve.a.result},te.a.createElement("span",null,"\u5BA1\u6838\u7ED3\u679C:"),qr!=null&&qr.review_privilege?te.a.createElement(te.a.Fragment,null,te.a.createElement("div",{onClick:Xi,className:ve.a.pass},"\u901A\u8FC7"),te.a.createElement("div",{onClick:hi,className:ve.a.noPass},"\u4E0D\u901A\u8FC7")):te.a.createElement(te.a.Fragment,null,(qr==null?void 0:qr.status)===0&&te.a.createElement("div",{className:ve.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u53D1\u5E03"),(qr==null?void 0:qr.status)===1&&te.a.createElement("div",{className:ve.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5DF2\u516C\u5F00"),(qr==null?void 0:qr.status)===2&&te.a.createElement("div",{className:ve.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u5BA1\u6279"),(qr==null?void 0:qr.status)===3&&te.a.createElement("div",{className:ve.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u4E2D"),(qr==null?void 0:qr.status)===4&&te.a.createElement("div",{className:ve.a.passText},te.a.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u5B8C\u6210\u5F85\u516C\u5F00"),(qr==null?void 0:qr.status)===5&&te.a.createElement("div",{className:ve.a.noPassText},te.a.createElement("i",{className:"iconfont icon-weitongguo1"}),"\u5BA1\u6838\u4E0D\u901A\u8FC7",te.a.createElement("span",{onClick:Yi},"\u67E5\u770B\u539F\u56E0")))),te.a.createElement(w.a,{type:"primary",ghost:!0,onClick:Ar},"\u9000\u51FA\u7F16\u8F91"),te.a.createElement(w.a,{disabled:ji,loading:ui,type:"primary",onClick:function(){_i.current=!0,Nr.submit()}},"\u4FDD\u5B58 "),Ut?te.a.createElement(w.a,{disabled:ui,loading:ji,style:{background:"#2FC25B",border:0},type:"primary",onClick:function(){_i.current=!1,Nr.submit()}},"\u7ACB\u5373\u4F53\u9A8C"):te.a.createElement(w.a,{disabled:ui,loading:ji,type:"primary",onClick:function(){_i.current=!1,Nr.submit()}},"\u4FDD\u5B58\u5E76\u53D1\u5E03\u5BA1\u6838")))):null,te.a.createElement(G.a,{centered:!0,destroyOnClose:!0,footer:null,visible:le,onCancel:function(){return K(!1)},title:"\u76F8\u4F3C\u6027\u68C0\u6D4B",width:"600px"},te.a.createElement("div",null,te.a.createElement("p",{className:"font14"},"\u7ECF\u7CFB\u7EDF\u68C0\u6D4B\u53D1\u73B0\uFF0C\u672C\u9898\u76EE\u4E0E\u7CFB\u7EDF\u4E2D\u5DF2\u521B\u5EFA\u7684\u9898\u76EE\u9AD8\u5EA6\u96F7\u540C\uFF0C\u8BF7\u8C03\u6574\u9898\u76EE\u540E\u518D\u8FDB\u884C\u4FDD\u5B58"),te.a.createElement(u.a,{dataSource:or,bordered:!1,scroll:or.length>7?{y:300}:{},columns:[{title:"\u76F8\u4F3C\u9898\u9898\u76EE",dataIndex:"name",ellipsis:!0,render:function(Ft,mr){return te.a.createElement("span",{onClick:function(){return Mr(mr==null?void 0:mr.identifier)},style:{textDecorationLine:"underline"},className:"current c-light-primary"},Ft)}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"create_time",width:170,render:function(Ft){var mr;return(mr=Vt()(Ft))===null||mr===void 0?void 0:mr.format("YYYY-MM-DD HH:mm")}}],pagination:!1}))))};function Nn(Ct){var Dt,wt,wr=Ct.ischecked,Cr=Ct.formValue,Jt=Ct.hack,Ut=Ct.onChangeAverage,Or=Ct.onChangeScore,un=Ct.onChangehide,Nr=Ct.onChangeFile,bt=Ct.onAddTestCase,Bt=Ct.onRemoveTestCase,Jr=Ct.uploadData,on=Ct.setUploadData,Ln=Ct.handleUploadRatio,Sn=Ct.pointData,le=Ct.sourceData,K=Ct.getPointData,X=Ct.id,ee=Jt.test_set_average,me=Jt.test_set_score,ae=Object(re.useState)(!1),Ke=Object(L.a)(ae,2),pt=Ke[0],Ot=Ke[1],Ht=Object(re.useState)(!1),vt=Object(L.a)(Ht,2),Xt=vt[0],qt=vt[1],Hr=function(pr,fr){var jr=Object(i.a)(Jr);jr.splice(fr,1),ee?Ln(jr):on(jr)},nn=function(pr,fr){console.log(pr,fr);var jr=Jr.map(function(Er,li){return li===fr?Object(A.a)(Object(A.a)({},Er),{},{score:pr.target.value?Number(pr.target.value):0}):Er});on(jr)},zr=function(pr){var fr=Jr.concat(pr);Jt.test_set_average?Ln(fr):on(fr)};function or(zt){zt.stopPropagation()}function Qr(){if(Object(rr.v)()){qt("practice");return}var zt="";G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",content:te.a.createElement("div",null,te.a.createElement(P.a,{placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:function(fr){zt=fr.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var pr=Object(E.a)($.a.mark(function jr(){var Er;return $.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,Object(ye.a)("/api/tag_disciplines.json",{method:"post",body:{target:"practice",name:zt}});case 2:Er=On.sent,(Er==null?void 0:Er.status)===0&&K();case 4:case"end":return On.stop()}},jr)}));function fr(){return pr.apply(this,arguments)}return fr}()})}function Cn(){if(Object(rr.v)()){qt("practice_source");return}var zt="";G.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u6765\u6E90",content:te.a.createElement("div",null,te.a.createElement(P.a,{placeholder:"\u8BF7\u8F93\u5165\u6765\u6E90\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:function(fr){zt=fr.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var pr=Object(E.a)($.a.mark(function jr(){var Er;return $.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,Object(ye.a)("/api/tag_disciplines.json",{method:"post",body:{target:"practice_source",name:zt}});case 2:Er=On.sent,(Er==null?void 0:Er.status)===0&&K();case 4:case"end":return On.stop()}},jr)}));function fr(){return pr.apply(this,arguments)}return fr}()})}return te.a.createElement("div",{className:ve.a["oj-left-panel"]},te.a.createElement("div",{className:ve.a["oj-form-info"]},te.a.createElement(M.a.Item,{label:"\u9898\u76EE\u540D\u79F0",name:["hack","name"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0"}],className:ve.a.inputOne},te.a.createElement(P.a,{bordered:!1,maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0",suffix:te.a.createElement("span",null,(Cr==null||((Dt=Cr.hack)===null||Dt===void 0||((wt=Dt.name)===null||wt===void 0))?void 0:wt.length)||0,"/",te.a.createElement("span",{className:"c-grey-999"},"60"))})),te.a.createElement(M.a.Item,{name:["hack","description"],valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},te.a.createElement(Z.a,{placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u63CF\u8FF0\u2026",miniToolbar:!0,id:"moop_cases_content",noStorage:!0,height:200})),te.a.createElement("div",{className:ve.a.row},te.a.createElement("div",{className:ve.a.a},te.a.createElement(M.a.Item,{label:"\u96BE\u6613\u5EA6",name:["hack","difficulty"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},te.a.createElement(r.a,null,ie(he.difficulty)))),te.a.createElement("div",{className:ve.a.b},te.a.createElement(M.a.Item,{label:"\u9898\u76EE\u6765\u6E90",name:["hack","source_discipline_ids"]},te.a.createElement(r.a,{placeholder:"\u9009\u62E9\u9898\u76EE\u6765\u6E90",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:function(pr){return pr.parentNode}},le.map(function(zt){return te.a.createElement(r.a.Option,{key:zt.id,value:zt.id},zt.name)}))),te.a.createElement(w.a,{style:{padding:"0 18px"},type:"primary",ghost:!0,onClick:function(){return Cn()}},Object(rr.v)()?"\u6765\u6E90\u7BA1\u7406":"\u65B0\u5EFA\u6765\u6E90"))),te.a.createElement("div",{className:ve.a.row},te.a.createElement("div",{className:ve.a.b,style:{width:"100%",marginLeft:0}},te.a.createElement(M.a.Item,{label:"\u77E5\u8BC6\u70B9",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9"}],name:["hack","tag_discipline_ids"]},te.a.createElement(r.a,{placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:function(pr){return pr.parentNode}},Sn.map(function(zt){return te.a.createElement(r.a.Option,{key:zt.id,value:zt.id},zt.name)}))),te.a.createElement(w.a,{type:"primary",ghost:!0,onClick:function(){return Qr()}},Object(rr.v)()?"\u77E5\u8BC6\u70B9\u7BA1\u7406":"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))),te.a.createElement("div",{className:ve.a.field},te.a.createElement(M.a.Item,{label:"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236",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"}],className:ve.a.inputTwo,extra:te.a.createElement("span",{style:{position:"absolute",left:200,top:11,color:"#333"}},"\u79D2",te.a.createElement("span",{className:"ml5 c-grey-999"},"(\u4EE3\u7801\u6267\u884C\u6240\u5141\u8BB8\u7684\u6700\u5927\u65F6\u957F)"))},te.a.createElement(t.a,{style:{width:185},min:3}))),te.a.createElement("div",{className:"tst-case-info"},te.a.createElement("h3",{className:"flex-container",style:{justifyContent:"space-between"}}," ","\u6D4B\u8BD5\u7528\u4F8B\u4E0E\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219",!Jt.is_file&&te.a.createElement(w.a,{style:{height:40},type:"primary",ghost:!0,onClick:bt},"\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B")),te.a.createElement(M.a.Item,{name:["hack","test_set_score"]},te.a.createElement(p.a.Group,{onChange:Or},te.a.createElement(p.a,{value:!0},"\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6",te.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")),te.a.createElement(p.a,{value:!1},"\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6",te.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")))),te.a.createElement(S.a,{style:{marginBottom:"5px"},checked:wr,onChange:un},"\u9690\u85CF\u5B9E\u9645\u8F93\u51FA \uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u5B66\u751F\u505A\u9898\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"),te.a.createElement(M.a.Item,{className:ve.a.testJi,name:["hack","is_file"],label:"\u7528\u4F8B\u7C7B\u578B:"},te.a.createElement(p.a.Group,{onChange:Nr},te.a.createElement(y.a,{direction:"horizontal"},te.a.createElement(p.a,{value:!1},"\u6587\u672C"),te.a.createElement(p.a,{value:!0},"\u6587\u4EF6")))),!Jt.test_set_score&&te.a.createElement(M.a.Item,{name:["hack","test_set_average"],label:"\u7CFB\u7EDF\u8BC4\u5206\u5360\u6BD4"},te.a.createElement(p.a.Group,{onChange:Ut},te.a.createElement(p.a,{value:!0},"\u5747\u5206\u6BD4\u4F8B"),te.a.createElement(p.a,{value:!1},"\u81EA\u5B9A\u4E49\u6BD4\u4F8B"))),Jt.is_file&&te.a.createElement("div",{className:ve.a.upBtn},te.a.createElement(w.a,{ghost:!0,type:"primary",className:"mb20",onClick:function(){return Ot(!0)}},"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"),te.a.createElement(At.a,{disabled:Jt==null?void 0:Jt.test_set_average,inputChange:nn,showScore:!Jt.test_set_score,data:Jr,onRemove:Hr})),!Jt.is_file&&te.a.createElement(M.a.List,{name:"hack_sets"},function(zt,pr){return Object(C.a)(pr),te.a.createElement(z.a,{accordion:!0},zt.map(function(fr,jr){return te.a.createElement(nr,{key:"".concat(fr.key,"--").concat(jr),header:te.a.createElement("a",{className:ve.a["test-case-name"]},te.a.createElement("span",null,"\u6D4B\u8BD5\u7528\u4F8B",jr+1),me?null:te.a.createElement(te.a.Fragment,null,te.a.createElement(M.a.Item,{name:[fr.name,"score"],fieldKey:[fr.fieldKey,"score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D4B\u8BD5\u96C6".concat(jr+1,"\u8BC4\u5206")}]},te.a.createElement(t.a,{onClick:or,min:0,max:100,disabled:ee})),te.a.createElement("span",null,"%"))),extra:jr>0?te.a.createElement("div",{onClick:or},te.a.createElement(v.a,{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u5B9A\u5220\u9664\u6D4B\u8BD5\u96C6\b"+(jr+1),onConfirm:function(){Bt(jr)}},te.a.createElement(Y.a,{className:ve.a["btn-remove-case"]}))):null},te.a.createElement(M.a.Item,{label:"\u8F93\u5165",name:[fr.name,"input"],fieldKey:[fr.fieldKey,"input"]},te.a.createElement(Wt,null)),te.a.createElement(M.a.Item,{label:"\u8F93\u51FA",name:[fr.name,"output"],fieldKey:[fr.fieldKey,"output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},te.a.createElement(Wt,null)))}))}))),te.a.createElement(At.b,{rootIdentifier:X,visible:pt,onClose:function(){return Ot(!1)},onOK:zr}),te.a.createElement(mt,{visible:Xt,onCancel:function(){qt(!1),K()},onOK:function(){qt(!1),K()}}))}},rdUC:function(F,Q,j){var N=j("MFOe"),v=N.Global;F.exports={name:"localStorage",read:k,write:y,each:m,remove:S,clearAll:b};function C(){return v.localStorage}function k(p){return C().getItem(p)}function y(p,d){return C().setItem(p,d)}function m(p){for(var d=C().length-1;d>=0;d--){var t=C().key(d);p(k(t),t)}}function S(p){return C().removeItem(p)}function b(){return C().clear()}},sR1s:function(F,Q,j){"use strict";j.d(Q,"b",function(){return k}),j.d(Q,"a",function(){return y}),j.d(Q,"c",function(){return m}),j.d(Q,"d",function(){return S});var N=j("U8pU"),v="RC_TABLE_KEY";function C(b){return b==null?[]:Array.isArray(b)?b:[b]}function k(b,p){if(!p&&typeof p!="number")return b;for(var d=C(p),t=b,l=0;l<d.length;l+=1){if(!t)return null;var r=d[l];t=t[r]}return t}function y(b){var p=[],d={};return b.forEach(function(t){for(var l=t||{},r=l.key,i=l.dataIndex,o=r||C(i).join("-")||v;d[o];)o="".concat(o,"_next");d[o]=!0,p.push(o)}),p}function m(){var b={};function p(r,i){i&&Object.keys(i).forEach(function(o){var s=i[o];s&&Object(N.a)(s)==="object"?(r[o]=r[o]||{},p(r[o],s)):r[o]=s})}for(var d=arguments.length,t=new Array(d),l=0;l<d;l++)t[l]=arguments[l];return t.forEach(function(r){p(b,r)}),b}function S(b){return b!=null}},sboe:function(F,Q,j){"use strict";j.d(Q,"a",function(){return C});var N=j("cDcd"),v=j.n(N),C=N.createContext(null)},t23M:function(F,Q,j){"use strict";var N=j("VTBJ"),v=j("1OyB"),C=j("vuIU"),k=j("Ji7U"),y=j("LK+K"),m=j("cDcd"),S=j.n(m),b=j("m+aA"),p=j("Zm9Q"),d=j("Kwbf"),t=j("c+Xe"),l=j("bdgK"),r="rc-observer-key",i=function(o){Object(k.a)(c,o);var s=Object(y.a)(c);function c(){var a;return Object(v.a)(this,c),a=s.apply(this,arguments),a.resizeObserver=null,a.childNode=null,a.currentElement=null,a.state={width:0,height:0,offsetHeight:0,offsetWidth:0},a.onResize=function(u){var f=a.props.onResize,w=u[0].target,_=w.getBoundingClientRect(),h=_.width,R=_.height,O=w.offsetWidth,g=w.offsetHeight,x=Math.floor(h),E=Math.floor(R);if(a.state.width!==x||a.state.height!==E||a.state.offsetWidth!==O||a.state.offsetHeight!==g){var T={width:x,height:E,offsetWidth:O,offsetHeight:g};a.setState(T),f&&Promise.resolve().then(function(){f(Object(N.a)(Object(N.a)({},T),{},{offsetWidth:O,offsetHeight:g}))})}},a.setChildNode=function(u){a.childNode=u},a}return Object(C.a)(c,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var u=this.props.disabled;if(u){this.destroyObserver();return}var f=Object(b.a)(this.childNode||this),w=f!==this.currentElement;w&&(this.destroyObserver(),this.currentElement=f),!this.resizeObserver&&f&&(this.resizeObserver=new l.default(this.onResize),this.resizeObserver.observe(f))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var u=this.props.children,f=Object(p.a)(u);if(f.length>1)Object(d.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(f.length===0)return Object(d.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var w=f[0];if(m.isValidElement(w)&&Object(t.c)(w)){var _=w.ref;f[0]=m.cloneElement(w,{ref:Object(t.a)(_,this.setChildNode)})}return f.length===1?f[0]:f.map(function(h,R){return!m.isValidElement(h)||"key"in h&&h.key!==null?h:m.cloneElement(h,{key:"".concat(r,"-").concat(R)})})}}]),c}(m.Component);i.displayName="ResizeObserver",Q.a=i},uGsb:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("MlIO"),j("1uat"))})(this,function(N){return function(){var v=N,C=v.x64,k=C.Word,y=C.WordArray,m=v.algo,S=m.SHA512,b=m.SHA384=S.extend({_doReset:function(){this._hash=new y.init([new k.init(3418070365,3238371032),new k.init(1654270250,914150663),new k.init(2438529370,812702999),new k.init(355462360,4144912697),new k.init(1731405415,4290775857),new k.init(2394180231,1750603025),new k.init(3675008525,1694076839),new k.init(1203062813,3204075428)])},_doFinalize:function(){var p=S._doFinalize.call(this);return p.sigBytes-=16,p}});v.SHA384=S._createHelper(b),v.HmacSHA384=S._createHmacHelper(b)}(),N.SHA384})},uGxW:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.pad.NoPadding={pad:function(){},unpad:function(){}},N.pad.NoPadding})},uQRt:function(F,Q,j){F.exports=N;function N(){return j("gaXo"),{}}},ulZh:function(F,Q,j){typeof window!="undefined"&&function(v,C){F.exports=C()}(this,function(){return function(N){var v={};function C(k){if(v[k])return v[k].exports;var y=v[k]={i:k,l:!1,exports:{}};return N[k].call(y.exports,y,y.exports,C),y.l=!0,y.exports}return C.m=N,C.c=v,C.d=function(k,y,m){C.o(k,y)||Object.defineProperty(k,y,{enumerable:!0,get:m})},C.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},C.t=function(k,y){if(y&1&&(k=C(k)),y&8)return k;if(y&4&&typeof k=="object"&&k&&k.__esModule)return k;var m=Object.create(null);if(C.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:k}),y&2&&typeof k!="string")for(var S in k)C.d(m,S,function(b){return k[b]}.bind(null,S));return m},C.n=function(k){var y=k&&k.__esModule?function(){return k.default}:function(){return k};return C.d(y,"a",y),y},C.o=function(k,y){return Object.prototype.hasOwnProperty.call(k,y)},C.p="/dist/",C(C.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(N,v,C){"use strict";var k=Object.prototype.hasOwnProperty,y="~";function m(){}Object.create&&(m.prototype=Object.create(null),new m().__proto__||(y=!1));function S(t,l,r){this.fn=t,this.context=l,this.once=r||!1}function b(t,l,r,i,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new S(r,i||t,o),c=y?y+l:l;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function p(t,l){--t._eventsCount===0?t._events=new m:delete t._events[l]}function d(){this._events=new m,this._eventsCount=0}d.prototype.eventNames=function(){var l=[],r,i;if(this._eventsCount===0)return l;for(i in r=this._events)k.call(r,i)&&l.push(y?i.slice(1):i);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(r)):l},d.prototype.listeners=function(l){var r=y?y+l:l,i=this._events[r];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,s=i.length,c=new Array(s);o<s;o++)c[o]=i[o].fn;return c},d.prototype.listenerCount=function(l){var r=y?y+l:l,i=this._events[r];return i?i.fn?1:i.length:0},d.prototype.emit=function(l,r,i,o,s,c){var a=y?y+l:l;if(!this._events[a])return!1;var u=this._events[a],f=arguments.length,w,_;if(u.fn){u.once&&this.removeListener(l,u.fn,void 0,!0);switch(f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,r),!0;case 3:return u.fn.call(u.context,r,i),!0;case 4:return u.fn.call(u.context,r,i,o),!0;case 5:return u.fn.call(u.context,r,i,o,s),!0;case 6:return u.fn.call(u.context,r,i,o,s,c),!0}for(_=1,w=new Array(f-1);_<f;_++)w[_-1]=arguments[_];u.fn.apply(u.context,w)}else{var h=u.length,R;for(_=0;_<h;_++){u[_].once&&this.removeListener(l,u[_].fn,void 0,!0);switch(f){case 1:u[_].fn.call(u[_].context);break;case 2:u[_].fn.call(u[_].context,r);break;case 3:u[_].fn.call(u[_].context,r,i);break;case 4:u[_].fn.call(u[_].context,r,i,o);break;default:if(!w)for(R=1,w=new Array(f-1);R<f;R++)w[R-1]=arguments[R];u[_].fn.apply(u[_].context,w)}}}return!0},d.prototype.on=function(l,r,i){return b(this,l,r,i,!1)},d.prototype.once=function(l,r,i){return b(this,l,r,i,!0)},d.prototype.removeListener=function(l,r,i,o){var s=y?y+l:l;if(!this._events[s])return this;if(!r)return p(this,s),this;var c=this._events[s];if(c.fn)c.fn===r&&(!o||c.once)&&(!i||c.context===i)&&p(this,s);else{for(var a=0,u=[],f=c.length;a<f;a++)(c[a].fn!==r||o&&!c[a].once||i&&c[a].context!==i)&&u.push(c[a]);u.length?this._events[s]=u.length===1?u[0]:u:p(this,s)}return this},d.prototype.removeAllListeners=function(l){var r;return l?(r=y?y+l:l,this._events[r]&&p(this,r)):(this._events=new m,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prefixed=y,d.EventEmitter=d,N.exports=d},"./node_modules/url-toolkit/src/url-toolkit.js":function(N,v,C){(function(k){var y=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,m=/^([^\/?#]*)([^]*)$/,S=/(?:\/|^)\.(?=\/)/g,b=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,p={buildAbsoluteURL:function(d,t,l){if(l=l||{},d=d.trim(),t=t.trim(),!t){if(!l.alwaysNormalize)return d;var r=p.parseURL(d);if(!r)throw new Error("Error trying to parse base URL.");return r.path=p.normalizePath(r.path),p.buildURLFromParts(r)}var i=p.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return l.alwaysNormalize?(i.path=p.normalizePath(i.path),p.buildURLFromParts(i)):t;var o=p.parseURL(d);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var s=m.exec(o.path);o.netLoc=s[1],o.path=s[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(c.netLoc=o.netLoc,i.path[0]!=="/"))if(!i.path)c.path=o.path,i.params||(c.params=o.params,i.query||(c.query=o.query));else{var a=o.path,u=a.substring(0,a.lastIndexOf("/")+1)+i.path;c.path=p.normalizePath(u)}return c.path===null&&(c.path=l.alwaysNormalize?p.normalizePath(i.path):i.path),p.buildURLFromParts(c)},parseURL:function(d){var t=y.exec(d);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(d){for(d=d.split("").reverse().join("").replace(S,"");d.length!==(d=d.replace(b,"")).length;);return d.split("").reverse().join("")},buildURLFromParts:function(d){return d.scheme+d.netLoc+d.path+d.params+d.query+d.fragment}};N.exports=p})(this)},"./node_modules/webworkify-webpack/index.js":function(N,v,C){function k(l){var r={};function i(s){if(r[s])return r[s].exports;var c=r[s]={i:s,l:!1,exports:{}};return l[s].call(c.exports,c,c.exports,i),c.l=!0,c.exports}i.m=l,i.c=r,i.i=function(s){return s},i.d=function(s,c,a){i.o(s,c)||Object.defineProperty(s,c,{configurable:!1,enumerable:!0,get:a})},i.r=function(s){Object.defineProperty(s,"__esModule",{value:!0})},i.n=function(s){var c=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(c,"a",c),c},i.o=function(s,c){return Object.prototype.hasOwnProperty.call(s,c)},i.p="/",i.oe=function(s){throw console.error(s),s};var o=i(i.s=ENTRY_MODULE);return o.default||o}var y="[\\.|\\-|\\+|\\w|/|@]+",m="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+y+").*?\\)";function S(l){return(l+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function b(l){return!isNaN(1*l)}function p(l,r,i){var o={};o[i]=[];var s=r.toString(),c=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return o;for(var a=c[1],u=new RegExp("(\\\\n|\\W)"+S(a)+m,"g"),f;f=u.exec(s);){if(f[3]==="dll-reference")continue;o[i].push(f[3])}for(u=new RegExp("\\("+S(a)+'\\("(dll-reference\\s('+y+'))"\\)\\)'+m,"g");f=u.exec(s);)l[f[2]]||(o[i].push(f[1]),l[f[2]]=C(f[1]).m),o[f[2]]=o[f[2]]||[],o[f[2]].push(f[4]);for(var w=Object.keys(o),_=0;_<w.length;_++)for(var h=0;h<o[w[_]].length;h++)b(o[w[_]][h])&&(o[w[_]][h]=1*o[w[_]][h]);return o}function d(l){var r=Object.keys(l);return r.reduce(function(i,o){return i||l[o].length>0},!1)}function t(l,r){for(var i={main:[r]},o={main:[]},s={main:{}};d(i);)for(var c=Object.keys(i),a=0;a<c.length;a++){var u=c[a],f=i[u],w=f.pop();if(s[u]=s[u]||{},s[u][w]||!l[u][w])continue;s[u][w]=!0,o[u]=o[u]||[],o[u].push(w);for(var _=p(l,l[u][w],u),h=Object.keys(_),R=0;R<h.length;R++)i[h[R]]=i[h[R]]||[],i[h[R]]=i[h[R]].concat(_[h[R]])}return o}N.exports=function(l,r){r=r||{};var i={main:C.m},o=r.all?{main:Object.keys(i.main)}:t(i,l),s="";Object.keys(o).filter(function(w){return w!=="main"}).forEach(function(w){for(var _=0;o[w][_];)_++;o[w].push(_),i[w][_]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+w+" = ("+k.toString().replace("ENTRY_MODULE",JSON.stringify(_))+")({"+o[w].map(function(h){return""+JSON.stringify(h)+": "+i[w][h].toString()}).join(",")+`});
|
|
|
`}),s=s+"new (("+k.toString().replace("ENTRY_MODULE",JSON.stringify(l))+")({"+o.main.map(function(w){return""+JSON.stringify(w)+": "+i.main[w].toString()}).join(",")+"}))(self);";var c=new window.Blob([s],{type:"text/javascript"});if(r.bare)return c;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,u=a.createObjectURL(c),f=new window.Worker(u);return f.objectURL=u,f}},"./src/config.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"hlsDefaultConfig",function(){return R}),C.d(v,"mergeConfig",function(){return g}),C.d(v,"enableStreamingMode",function(){return x});var k=C("./src/controller/abr-controller.ts"),y=C("./src/controller/audio-stream-controller.ts"),m=C("./src/controller/audio-track-controller.ts"),S=C("./src/controller/subtitle-stream-controller.ts"),b=C("./src/controller/subtitle-track-controller.ts"),p=C("./src/controller/buffer-controller.ts"),d=C("./src/controller/timeline-controller.ts"),t=C("./src/controller/cap-level-controller.ts"),l=C("./src/controller/fps-controller.ts"),r=C("./src/controller/eme-controller.ts"),i=C("./src/controller/cmcd-controller.ts"),o=C("./src/utils/xhr-loader.ts"),s=C("./src/utils/fetch-loader.ts"),c=C("./src/utils/cues.ts"),a=C("./src/utils/mediakeys-helper.ts"),u=C("./src/utils/logger.ts");function f(){return f=Object.assign||function(E){for(var T=1;T<arguments.length;T++){var M=arguments[T];for(var L in M)Object.prototype.hasOwnProperty.call(M,L)&&(E[L]=M[L])}return E},f.apply(this,arguments)}function w(E,T){var M=Object.keys(E);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(E);T&&(L=L.filter(function(A){return Object.getOwnPropertyDescriptor(E,A).enumerable})),M.push.apply(M,L)}return M}function _(E){for(var T=1;T<arguments.length;T++){var M=arguments[T]!=null?arguments[T]:{};T%2?w(Object(M),!0).forEach(function(L){h(E,L,M[L])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(M)):w(Object(M)).forEach(function(L){Object.defineProperty(E,L,Object.getOwnPropertyDescriptor(M,L))})}return E}function h(E,T,M){return T in E?Object.defineProperty(E,T,{value:M,enumerable:!0,configurable:!0,writable:!0}):E[T]=M,E}var R=_(_({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:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:k.default,bufferController:p.default,capLevelController:t.default,fpsController:l.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:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:S.SubtitleStreamController,subtitleTrackController:b.default,timelineController:d.TimelineController,audioStreamController:y.default,audioTrackController:m.default,emeController:r.default,cmcdController:i.default});function O(){return{cueHandler:c.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 g(E,T){if((T.liveSyncDurationCount||T.liveMaxLatencyDurationCount)&&(T.liveSyncDuration||T.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(T.liveMaxLatencyDurationCount!==void 0&&(T.liveSyncDurationCount===void 0||T.liveMaxLatencyDurationCount<=T.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(T.liveMaxLatencyDuration!==void 0&&(T.liveSyncDuration===void 0||T.liveMaxLatencyDuration<=T.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return f({},E,T)}function x(E){var T=E.loader;if(T!==s.default&&T!==o.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),E.progressive=!1;else{var M=Object(s.fetchSupported)();M&&(E.loader=s.default,E.progressive=!0,E.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/polyfills/number.ts"),y=C("./src/utils/ewma-bandwidth-estimator.ts"),m=C("./src/events.ts"),S=C("./src/utils/buffer-helper.ts"),b=C("./src/errors.ts"),p=C("./src/types/loader.ts"),d=C("./src/utils/logger.ts");function t(i,o){for(var s=0;s<o.length;s++){var c=o[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(i,c.key,c)}}function l(i,o,s){return o&&t(i.prototype,o),s&&t(i,s),i}var r=function(){function i(s){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=s;var c=s.config;this.bwEstimator=new y.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var o=i.prototype;return o.registerListeners=function(){var c=this.hls;c.on(m.Events.FRAG_LOADING,this.onFragLoading,this),c.on(m.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(m.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(m.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(m.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var c=this.hls;c.off(m.Events.FRAG_LOADING,this.onFragLoading,this),c.off(m.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(m.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(m.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(m.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(c,a){var u=a.frag;if(u.type===p.PlaylistLevelType.MAIN&&!this.timer){var f;this.fragCurrent=u,this.partCurrent=(f=a.part)!=null?f:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(c,a){var u=this.hls.config;a.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var c=this.fragCurrent,a=this.partCurrent,u=this.hls,f=u.autoLevelEnabled,w=u.config,_=u.media;if(!c||!_)return;var h=a?a.stats:c.stats,R=a?a.duration:c.duration;if(h.aborted){d.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!f||_.paused||!_.playbackRate||!_.readyState)return;var O=performance.now()-h.loading.start,g=Math.abs(_.playbackRate);if(O<=500*R/g)return;var x=u.levels,E=u.minAutoLevel,T=x[c.level],M=h.total||Math.max(h.loaded,Math.round(R*T.maxBitrate/8)),L=Math.max(1,h.bwEstimate?h.bwEstimate/8:h.loaded*1e3/O),A=(M-h.loaded)/L,V=_.currentTime,z=(S.BufferHelper.bufferInfo(_,V,w.maxBufferHole).end-V)/g;if(z>=2*R/g||A<=z)return;var W=Number.POSITIVE_INFINITY,G;for(G=c.level-1;G>E;G--){var U=x[G].maxBitrate;if(W=R*U/(8*.8*L),W<z)break}if(W>=A)return;var P=this.bwEstimator.getEstimate();d.logger.warn("Fragment "+c.sn+(a?" part "+a.index:"")+" of level "+c.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
|
|
|
Current BW estimate: `+(Object(k.isFiniteNumber)(P)?(P/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+A.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+W.toFixed(3)+` s
|
|
|
Time to underbuffer: `+z.toFixed(3)+" s"),u.nextLoadLevel=G,this.bwEstimator.sample(O,h.loaded),this.clearTimer(),c.loader&&(this.fragCurrent=this.partCurrent=null,c.loader.abort()),u.trigger(m.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,part:a,stats:h})},o.onFragLoaded=function(c,a){var u=a.frag,f=a.part;if(u.type===p.PlaylistLevelType.MAIN&&Object(k.isFiniteNumber)(u.sn)){var w=f?f.stats:u.stats,_=f?f.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var h=this.hls.levels[u.level],R=(h.loaded?h.loaded.bytes:0)+w.loaded,O=(h.loaded?h.loaded.duration:0)+_;h.loaded={bytes:R,duration:O},h.realBitrate=Math.round(8*R/O)}if(u.bitrateTest){var g={stats:w,frag:u,part:f,id:u.type};this.onFragBuffered(m.Events.FRAG_BUFFERED,g),u.bitrateTest=!1}}},o.onFragBuffered=function(c,a){var u=a.frag,f=a.part,w=f?f.stats:u.stats;if(w.aborted)return;if(u.type!==p.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var _=w.parsing.end-w.loading.start;this.bwEstimator.sample(_,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=_/1e3:this.bitrateTestDelay=0},o.onError=function(c,a){switch(a.details){case b.ErrorDetails.FRAG_LOAD_ERROR:case b.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var c=this.fragCurrent,a=this.partCurrent,u=this.hls,f=u.maxAutoLevel,w=u.config,_=u.minAutoLevel,h=u.media,R=a?a.duration:c?c.duration:0,O=h?h.currentTime:0,g=h&&h.playbackRate!==0?Math.abs(h.playbackRate):1,x=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,E=(S.BufferHelper.bufferInfo(h,O,w.maxBufferHole).end-O)/g,T=this.findBestLevel(x,_,f,E,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(T>=0)return T;d.logger.trace((E?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var M=R?Math.min(R,w.maxStarvationDelay):w.maxStarvationDelay,L=w.abrBandWidthFactor,A=w.abrBandWidthUpFactor;if(!E){var V=this.bitrateTestDelay;if(V){var z=R?Math.min(R,w.maxLoadingDelay):w.maxLoadingDelay;M=z-V,d.logger.trace("bitrate test took "+Math.round(1e3*V)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*M)+" ms"),L=A=1}}return T=this.findBestLevel(x,_,f,E+M,L,A),Math.max(T,0)},o.findBestLevel=function(c,a,u,f,w,_){for(var h,R=this.fragCurrent,O=this.partCurrent,g=this.lastLoadedFragLevel,x=this.hls.levels,E=x[g],T=!!(E!=null&&(h=E.details)!==null&&h!==void 0&&h.live),M=E==null?void 0:E.codecSet,L=O?O.duration:R?R.duration:0,A=u;A>=a;A--){var V=x[A];if(!V||M&&V.codecSet!==M)continue;var z=V.details,W=(O?z==null?void 0:z.partTarget:z==null?void 0:z.averagetargetduration)||L,G=void 0;A<=g?G=w*c:G=_*c;var U=x[A].maxBitrate,P=U*W/G;if(d.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+A+"/"+Math.round(G)+"/"+U+"/"+W+"/"+f+"/"+P),G>U&&(!P||T&&!this.bitrateTestDelay||P<f))return A}return-1},l(i,[{key:"nextAutoLevel",get:function(){var c=this._nextAutoLevel,a=this.bwEstimator;if(c!==-1&&(!a||!a.canEstimate()))return c;var u=this.getNextABRAutoLevel();return c!==-1&&(u=Math.min(c,u)),u},set:function(c){this._nextAutoLevel=c}}]),i}();v.default=r},"./src/controller/audio-stream-controller.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/polyfills/number.ts"),y=C("./src/controller/base-stream-controller.ts"),m=C("./src/events.ts"),S=C("./src/utils/buffer-helper.ts"),b=C("./src/controller/fragment-tracker.ts"),p=C("./src/types/level.ts"),d=C("./src/types/loader.ts"),t=C("./src/loader/fragment.ts"),l=C("./src/demux/chunk-cache.ts"),r=C("./src/demux/transmuxer-interface.ts"),i=C("./src/types/transmuxer.ts"),o=C("./src/controller/fragment-finders.ts"),s=C("./src/utils/discontinuities.ts"),c=C("./src/errors.ts"),a=C("./src/utils/logger.ts");function u(){return u=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var g=arguments[O];for(var x in g)Object.prototype.hasOwnProperty.call(g,x)&&(R[x]=g[x])}return R},u.apply(this,arguments)}function f(R,O){R.prototype=Object.create(O.prototype),R.prototype.constructor=R,w(R,O)}function w(R,O){return w=Object.setPrototypeOf||function(x,E){return x.__proto__=E,x},w(R,O)}var _=100,h=function(R){f(O,R);function O(x,E){var T;return T=R.call(this,x,E,"[audio-stream-controller]")||this,T.videoBuffer=null,T.videoTrackCC=-1,T.waitingVideoCC=-1,T.audioSwitch=!1,T.trackId=-1,T.waitingData=null,T.mainDetails=null,T.bufferFlushed=!1,T._registerListeners(),T}var g=O.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var E=this.hls;E.on(m.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(m.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(m.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(m.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(m.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),E.on(m.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(m.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.on(m.Events.ERROR,this.onError,this),E.on(m.Events.BUFFER_RESET,this.onBufferReset,this),E.on(m.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(m.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(m.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.on(m.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var E=this.hls;E.off(m.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(m.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(m.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(m.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(m.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),E.off(m.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(m.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.off(m.Events.ERROR,this.onError,this),E.off(m.Events.BUFFER_RESET,this.onBufferReset,this),E.off(m.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(m.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(m.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.off(m.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onInitPtsFound=function(E,T){var M=T.frag,L=T.id,A=T.initPTS;if(L==="main"){var V=M.cc;this.initPTS[M.cc]=A,this.log("InitPTS for cc: "+V+" found from main: "+A),this.videoTrackCC=V,this.state===y.State.WAITING_INIT_PTS&&this.tick()}},g.startLoad=function(E){if(!this.levels){this.startPosition=E,this.state=y.State.STOPPED;return}var T=this.lastCurrentTime;this.stopLoad(),this.setInterval(_),this.fragLoadError=0,T>0&&E===-1?(this.log("Override startPosition with lastCurrentTime @"+T.toFixed(3)),this.state=y.State.IDLE):(this.loadedmetadata=!1,this.state=y.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()},g.doTick=function(){switch(this.state){case y.State.IDLE:this.doTickIdle();break;case y.State.WAITING_TRACK:{var E,T=this.levels,M=this.trackId,L=T==null||((E=T[M])===null||E===void 0)?void 0:E.details;if(L){if(this.waitForCdnTuneIn(L))break;this.state=y.State.WAITING_INIT_PTS}break}case y.State.FRAG_LOADING_WAITING_RETRY:{var A,V=performance.now(),z=this.retryDate;(!z||V>=z||(A=this.media)!==null&&A!==void 0&&A.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=y.State.IDLE);break}case y.State.WAITING_INIT_PTS:{var W=this.waitingData;if(W){var G=W.frag,U=W.part,P=W.cache,H=W.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=y.State.FRAG_LOADING;var $=P.flush(),re={frag:G,part:U,payload:$,networkDetails:null};this._handleFragmentLoadProgress(re),H&&R.prototype._handleFragmentLoadComplete.call(this,re)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var te=this.getLoadPosition(),ge=S.BufferHelper.bufferInfo(this.mediaBuffer,te,this.config.maxBufferHole),ve=Object(o.fragmentWithinToleranceTest)(ge.end,this.config.maxFragLookUpTolerance,G);ve<0&&(a.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+ge.end+" is needed"),this.clearWaitingFragment())}}else this.state=y.State.IDLE}}this.onTickEnd()},g.clearWaitingFragment=function(){var E=this.waitingData;E&&(this.fragmentTracker.removeFragment(E.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=y.State.IDLE)},g.onTickEnd=function(){var E=this.media;if(!E||!E.readyState)return;var T=this.mediaBuffer?this.mediaBuffer:E,M=T.buffered;!this.loadedmetadata&&M.length&&(this.loadedmetadata=!0),this.lastCurrentTime=E.currentTime},g.doTickIdle=function(){var E,T,M=this.hls,L=this.levels,A=this.media,V=this.trackId,z=M.config;if(!L||!L[V])return;if(!A&&(this.startFragRequested||!z.startFragPrefetch))return;var W=L[V],G=W.details;if(!G||G.live&&this.levelLastLoaded!==V||this.waitForCdnTuneIn(G)){this.state=y.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,t.ElementaryStreamTypes.AUDIO,d.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,d.PlaylistLevelType.AUDIO);if(U===null)return;var P=U.len,H=this.getMaxBufferLength(),$=this.audioSwitch;if(P>=H&&!$)return;if(!$&&this._streamEnded(U,G)){M.trigger(m.Events.BUFFER_EOS,{type:"audio"}),this.state=y.State.ENDED;return}var re=G.fragments,te=re[0].start,ge=U.end;if($){var ve=this.getLoadPosition();ge=ve,G.PTSKnown&&ve<te&&((U.end>te||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),A.currentTime=te+.05))}var de=this.getNextFragment(ge,G);if(!de){this.bufferFlushed=!0;return}((E=de.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((T=de.decryptdata)!==null&&T!==void 0&&T.key)?this.loadKey(de,G):this.loadFragment(de,G,ge)},g.getMaxBufferLength=function(){var E=R.prototype.getMaxBufferLength.call(this),T=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,d.PlaylistLevelType.MAIN);return T===null?E:Math.max(E,T.len)},g.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},g.onAudioTracksUpdated=function(E,T){var M=T.audioTracks;this.resetTransmuxer(),this.levels=M.map(function(L){return new p.Level(L)})},g.onAudioTrackSwitching=function(E,T){var M=!!T.url;this.trackId=T.id;var L=this.fragCurrent;L!=null&&L.loader&&L.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),M?this.setInterval(_):this.resetTransmuxer(),M?(this.audioSwitch=!0,this.state=y.State.IDLE):this.state=y.State.STOPPED,this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},g.onLevelLoaded=function(E,T){this.mainDetails=T.details},g.onAudioTrackLoaded=function(E,T){var M,L=this.levels,A=T.details,V=T.id;if(!L){this.warn("Audio tracks were reset while loading level "+V);return}this.log("Track "+V+" loaded ["+A.startSN+","+A.endSN+"],duration:"+A.totalduration);var z=L[V],W=0;if(A.live||(M=z.details)!==null&&M!==void 0&&M.live){var G=this.mainDetails;if(A.fragments[0]||(A.deltaUpdateFailed=!0),A.deltaUpdateFailed||!G)return;!z.details&&A.hasProgramDateTime&&G.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(A,G),W=A.fragments[0].start):W=this.alignPlaylists(A,z.details)}z.details=A,this.levelLastLoaded=V,!this.startFragRequested&&(this.mainDetails||!A.live)&&this.setStartPosition(z.details,W),this.state===y.State.WAITING_TRACK&&!this.waitForCdnTuneIn(A)&&(this.state=y.State.IDLE),this.tick()},g._handleFragmentLoadProgress=function(E){var T,M=E.frag,L=E.part,A=E.payload,V=this.config,z=this.trackId,W=this.levels;if(!W){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+M.sn+" of level "+M.level+" will not be buffered");return}var G=W[z];console.assert(G,"Audio track is defined on fragment load progress");var U=G.details;console.assert(U,"Audio track details are defined on fragment load progress");var P=V.defaultAudioCodec||G.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new r.default(this.hls,d.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[M.cc],re=(T=M.initSegment)===null||T===void 0?void 0:T.data;if($!==void 0){var te=!1,ge=L?L.index:-1,ve=ge!==-1,de=new i.ChunkMetadata(M.level,M.sn,M.stats.chunkCount,A.byteLength,ge,ve);H.push(A,re,P,"",M,L,U.totalduration,te,de,$)}else{a.logger.log("Unknown video PTS for cc "+M.cc+", waiting for video PTS before demuxing audio frag "+M.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+z);var De=this.waitingData=this.waitingData||{frag:M,part:L,cache:new l.default,complete:!1},Te=De.cache;Te.push(new Uint8Array(A)),this.waitingVideoCC=this.videoTrackCC,this.state=y.State.WAITING_INIT_PTS}},g._handleFragmentLoadComplete=function(E){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,E)},g.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},g.onBufferCreated=function(E,T){var M=T.tracks.audio;M&&(this.mediaBuffer=M.buffer),T.tracks.video&&(this.videoBuffer=T.tracks.video.buffer)},g.onFragBuffered=function(E,T){var M=T.frag,L=T.part;if(M.type!==d.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(M)){this.warn("Fragment "+M.sn+(L?" p: "+L.index:"")+" of level "+M.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}M.sn!=="initSegment"&&(this.fragPrevious=M,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(m.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(M,L)},g.onError=function(E,T){switch(T.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:this.onFragmentOrKeyLoadError(d.PlaylistLevelType.AUDIO,T);break;case c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==y.State.ERROR&&this.state!==y.State.STOPPED&&(this.state=T.fatal?y.State.ERROR:y.State.IDLE,this.warn(T.details+" while loading frag, switching to "+this.state+" state"));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(T.parent==="audio"&&(this.state===y.State.PARSING||this.state===y.State.PARSED)){var M=!0,L=this.getFwdBufferInfo(this.mediaBuffer,d.PlaylistLevelType.AUDIO);L&&L.len>.5&&(M=!this.reduceMaxBufferLength(L.len)),M&&(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}},g.onBufferFlushed=function(E,T){var M=T.type;M===t.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},g._handleTransmuxComplete=function(E){var T,M="audio",L=this.hls,A=E.remuxResult,V=E.chunkMeta,z=this.getCurrentContext(V);if(!z){this.warn("The loading context changed while buffering fragment "+V.sn+" of level "+V.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(V.level);return}var W=z.frag,G=z.part,U=A.audio,P=A.text,H=A.id3,$=A.initSegment;if(this.fragContextChanged(W))return;if(this.state=y.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,W,V),L.trigger(m.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:M,tracks:$.tracks})),U){var re=U.startPTS,te=U.endPTS,ge=U.startDTS,ve=U.endDTS;G&&(G.elementaryStreams[t.ElementaryStreamTypes.AUDIO]={startPTS:re,endPTS:te,startDTS:ge,endDTS:ve}),W.setElementaryStreamInfo(t.ElementaryStreamTypes.AUDIO,re,te,ge,ve),this.bufferFragmentData(U,W,G,V)}if(H!=null&&(T=H.samples)!==null&&T!==void 0&&T.length){var de=u({frag:W,id:M},H);L.trigger(m.Events.FRAG_PARSING_METADATA,de)}if(P){var De=u({frag:W,id:M},P);L.trigger(m.Events.FRAG_PARSING_USERDATA,De)}},g._bufferInitSegment=function(E,T,M){if(this.state!==y.State.PARSING)return;E.video&&delete E.video;var L=E.audio;if(!L)return;L.levelCodec=L.codec,L.id="audio",this.log("Init audio buffer, container:"+L.container+", codecs[parsed]=["+L.codec+"]"),this.hls.trigger(m.Events.BUFFER_CODECS,E);var A=L.initSegment;if(A!=null&&A.byteLength){var V={type:"audio",frag:T,part:null,chunkMeta:M,parent:T.type,data:A};this.hls.trigger(m.Events.BUFFER_APPENDING,V)}this.tick()},g.loadFragment=function(E,T,M){var L=this.fragmentTracker.getState(E);this.fragCurrent=E,(this.audioSwitch||L===b.FragmentState.NOT_LOADED||L===b.FragmentState.PARTIAL)&&(E.sn==="initSegment"?this._loadInitSegment(E):T.live&&!Object(k.isFiniteNumber)(this.initPTS[E.cc])?(this.log("Waiting for video PTS in continuity counter "+E.cc+" of live stream before loading audio fragment "+E.sn+" of level "+this.trackId),this.state=y.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,E,T,M)))},g.completeAudioSwitch=function(){var E=this.hls,T=this.media,M=this.trackId;T&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,E.trigger(m.Events.AUDIO_TRACK_SWITCHED,{id:M})},O}(y.default);v.default=h},"./src/controller/audio-track-controller.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/events.ts"),y=C("./src/errors.ts"),m=C("./src/controller/base-playlist-controller.ts"),S=C("./src/types/loader.ts");function b(r,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,s.key,s)}}function p(r,i,o){return i&&b(r.prototype,i),o&&b(r,o),r}function d(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,t(r,i)}function t(r,i){return t=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s},t(r,i)}var l=function(r){d(i,r);function i(s){var c;return c=r.call(this,s,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var o=i.prototype;return o.registerListeners=function(){var c=this.hls;c.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(k.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var c=this.hls;c.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),c.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(k.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,r.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(c,a){this.tracks=a.audioTracks||[]},o.onAudioTrackLoaded=function(c,a){var u=a.id,f=a.details,w=this.tracksInGroup[u];if(!w){this.warn("Invalid audio track id "+u);return}var _=w.details;w.details=a.details,this.log("audioTrack "+u+" loaded ["+f.startSN+"-"+f.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,a,_))},o.onLevelLoading=function(c,a){this.switchLevel(a.level)},o.onLevelSwitching=function(c,a){this.switchLevel(a.level)},o.switchLevel=function(c){var a=this.hls.levels[c];if(!(a!=null&&a.audioGroupIds))return;var u=a.audioGroupIds[a.urlId];if(this.groupId!==u){this.groupId=u;var f=this.tracks.filter(function(_){return!u||_.groupId===u});this.selectDefaultTrack&&!f.some(function(_){return _.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var w={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(k.Events.AUDIO_TRACKS_UPDATED,w),this.selectInitialTrack()}},o.onError=function(c,a){if(r.prototype.onError.call(this,c,a),a.fatal||!a.context)return;a.context.type===S.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},o.setAudioTrack=function(c){var a=this.tracksInGroup;if(c<0||c>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=a[this.trackId];this.log("Now switching to audio-track index "+c);var f=a[c],w=f.id,_=f.groupId,h=_===void 0?"":_,R=f.name,O=f.type,g=f.url;if(this.trackId=c,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:h,name:R,type:O,url:g}),f.details&&!f.details.live)return;var x=this.switchParams(f.url,u==null?void 0:u.details);this.loadPlaylist(x)},o.selectInitialTrack=function(){var c=this.tracksInGroup;console.assert(c.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,u=this.findTrackId(a)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(c){for(var a=this.tracksInGroup,u=0;u<a.length;u++){var f=a[u];if((!this.selectDefaultTrack||f.default)&&(!c||c===f.name))return f.id}return-1},o.loadPlaylist=function(c){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var u=a.id,f=a.groupId,w=a.url;if(c)try{w=c.addDirectives(w)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(k.Events.AUDIO_TRACK_LOADING,{url:w,id:u,groupId:f,deliveryDirectives:c||null})}},p(i,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),i}(m.default);v.default=l},"./src/controller/base-playlist-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return p});var k=C("./src/polyfills/number.ts"),y=C("./src/types/level.ts"),m=C("./src/controller/level-helper.ts"),S=C("./src/utils/logger.ts"),b=C("./src/errors.ts"),p=function(){function d(l,r){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=S.logger.log.bind(S.logger,r+":"),this.warn=S.logger.warn.bind(S.logger,r+":"),this.hls=l}var t=d.prototype;return t.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},t.onError=function(r,i){i.fatal&&i.type===b.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},t.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},t.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},t.stopLoad=function(){this.canLoad=!1,this.clearTimer()},t.switchParams=function(r,i){var o=i==null?void 0:i.renditionReports;if(o)for(var s=0;s<o.length;s++){var c=o[s],a=""+c.URI;if(a===r.substr(-a.length)){var u=parseInt(c["LAST-MSN"]),f=parseInt(c["LAST-PART"]);if(i&&this.hls.config.lowLatencyMode){var w=Math.min(i.age-i.partTarget,i.targetduration);f!==void 0&&w>i.partTarget&&(f+=1)}if(Object(k.isFiniteNumber)(u))return new y.HlsUrlParameters(u,Object(k.isFiniteNumber)(f)?f:void 0,y.HlsSkip.No)}}},t.loadPlaylist=function(r){},t.shouldLoadTrack=function(r){return this.canLoad&&r&&!!r.url&&(!r.details||r.details.live)},t.playlistLoaded=function(r,i,o){var s=this,c=i.details,a=i.stats,u=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(c.advancedDateTime=Date.now()-u,c.live||o!=null&&o.live){if(c.reloaded(o),o&&this.log("live playlist "+r+" "+(c.advanced?"REFRESHED "+c.lastPartSn+"-"+c.lastPartIndex:"MISSED")),o&&c.fragments.length>0&&Object(m.mergeDetails)(o,c),!this.canLoad||!c.live)return;var f,w=void 0,_=void 0;if(c.canBlockReload&&c.endSN&&c.advanced){var h=this.hls.config.lowLatencyMode,R=c.lastPartSn,O=c.endSN,g=c.lastPartIndex,x=g!==-1,E=R===O,T=h?0:g;x?(w=E?O+1:R,_=E?T:g+1):w=O+1;var M=c.age,L=M+c.ageHeader,A=Math.min(L-c.partTarget,c.targetduration*1.5);if(A>0){if(o&&A>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+A+" with playlist age: "+c.age),A=0;else{var V=Math.floor(A/c.targetduration);if(w+=V,_!==void 0){var z=Math.round(A%c.targetduration/c.partTarget);_+=z}this.log("CDN Tune-in age: "+c.ageHeader+"s last advanced "+M.toFixed(2)+"s goal: "+A+" skip sn "+V+" to part "+_)}c.tuneInGoal=A}if(f=this.getDeliveryDirectives(c,i.deliveryDirectives,w,_),h||!E){this.loadPlaylist(f);return}}else f=this.getDeliveryDirectives(c,i.deliveryDirectives,w,_);var W=Object(m.computeReloadInterval)(c,a);w!==void 0&&c.canBlockReload&&(W-=c.partTarget||1),this.log("reload live playlist "+r+" in "+Math.round(W)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(f)},W)}else this.clearTimer()},t.getDeliveryDirectives=function(r,i,o,s){var c=Object(y.getSkipValue)(r,o);return i!=null&&i.skip&&r.deltaUpdateFailed&&(o=i.msn,s=i.part,c=y.HlsSkip.No),new y.HlsUrlParameters(o,s,c)},t.retryLoadingOrFail=function(r){var i=this,o=this.hls.config,s=this.retryCount<o.levelLoadingMaxRetry;if(s){var c;if(this.retryCount++,r.details.indexOf("LoadTimeOut")>-1&&(c=r.context)!==null&&c!==void 0&&c.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+r.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return i.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+r.details+'"')}}else this.warn('cannot recover from error "'+r.details+'"'),this.clearTimer(),r.fatal=!0;return s},d}()},"./src/controller/base-stream-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"State",function(){return O}),C.d(v,"default",function(){return g});var k=C("./src/polyfills/number.ts"),y=C("./src/task-loop.ts"),m=C("./src/controller/fragment-tracker.ts"),S=C("./src/utils/buffer-helper.ts"),b=C("./src/utils/logger.ts"),p=C("./src/events.ts"),d=C("./src/errors.ts"),t=C("./src/types/transmuxer.ts"),l=C("./src/utils/mp4-tools.ts"),r=C("./src/utils/discontinuities.ts"),i=C("./src/controller/fragment-finders.ts"),o=C("./src/controller/level-helper.ts"),s=C("./src/loader/fragment-loader.ts"),c=C("./src/crypt/decrypter.ts"),a=C("./src/utils/time-ranges.ts"),u=C("./src/types/loader.ts");function f(x,E){for(var T=0;T<E.length;T++){var M=E[T];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(x,M.key,M)}}function w(x,E,T){return E&&f(x.prototype,E),T&&f(x,T),x}function _(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function h(x,E){x.prototype=Object.create(E.prototype),x.prototype.constructor=x,R(x,E)}function R(x,E){return R=Object.setPrototypeOf||function(M,L){return M.__proto__=L,M},R(x,E)}var O={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"},g=function(x){h(E,x);function E(M,L,A){var V;return V=x.call(this)||this,V.hls=void 0,V.fragPrevious=null,V.fragCurrent=null,V.fragmentTracker=void 0,V.transmuxer=null,V._state=O.STOPPED,V.media=void 0,V.mediaBuffer=void 0,V.config=void 0,V.bitrateTest=!1,V.lastCurrentTime=0,V.nextLoadPosition=0,V.startPosition=0,V.loadedmetadata=!1,V.fragLoadError=0,V.retryDate=0,V.levels=null,V.fragmentLoader=void 0,V.levelLastLoaded=null,V.startFragRequested=!1,V.decrypter=void 0,V.initPTS=[],V.onvseeking=null,V.onvended=null,V.logPrefix="",V.log=void 0,V.warn=void 0,V.logPrefix=A,V.log=b.logger.log.bind(b.logger,A+":"),V.warn=b.logger.warn.bind(b.logger,A+":"),V.hls=M,V.fragmentLoader=new s.default(M.config),V.fragmentTracker=L,V.config=M.config,V.decrypter=new c.default(M,M.config),M.on(p.Events.KEY_LOADED,V.onKeyLoaded,_(V)),V}var T=E.prototype;return T.doTick=function(){this.onTickEnd()},T.onTickEnd=function(){},T.startLoad=function(L){},T.stopLoad=function(){this.fragmentLoader.abort();var L=this.fragCurrent;L&&this.fragmentTracker.removeFragment(L),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},T._streamEnded=function(L,A){var V=this.fragCurrent,z=this.fragmentTracker;if(!A.live&&V&&V.sn===A.endSN&&!L.nextStart){var W=z.getState(V);return W===m.FragmentState.PARTIAL||W===m.FragmentState.OK}return!1},T.onMediaAttached=function(L,A){var V=this.media=this.mediaBuffer=A.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),V.addEventListener("seeking",this.onvseeking),V.addEventListener("ended",this.onvended);var z=this.config;this.levels&&z.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(z.startPosition)},T.onMediaDetaching=function(){var L=this.media;L!=null&&L.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),L&&(L.removeEventListener("seeking",this.onvseeking),L.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},T.onMediaSeeking=function(){var L=this.config,A=this.fragCurrent,V=this.media,z=this.mediaBuffer,W=this.state,G=V?V.currentTime:0,U=S.BufferHelper.bufferInfo(z||V,G,L.maxBufferHole);if(this.log("media seeking to "+(Object(k.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+W),W===O.ENDED)this.resetLoadingState();else if(A&&!U.len){var P=L.maxFragLookUpTolerance,H=A.start-P,$=A.start+A.duration+P,re=G>$;(G<H||re)&&(re&&A.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),A.loader.abort()),this.resetLoadingState())}V&&(this.lastCurrentTime=G),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},T.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},T.onKeyLoaded=function(L,A){if(this.state!==O.KEY_LOADING||A.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var V=this.levels[A.frag.level].details;V&&this.loadFragment(A.frag,V,A.frag.start)},T.onHandlerDestroying=function(){this.stopLoad(),x.prototype.onHandlerDestroying.call(this)},T.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(p.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,x.prototype.onHandlerDestroyed.call(this)},T.loadKey=function(L,A){this.log("Loading key for "+L.sn+" of ["+A.startSN+"-"+A.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+L.level),this.state=O.KEY_LOADING,this.fragCurrent=L,this.hls.trigger(p.Events.KEY_LOADING,{frag:L})},T.loadFragment=function(L,A,V){this._loadFragForPlayback(L,A,V)},T._loadFragForPlayback=function(L,A,V){var z=this,W=function(U){if(z.fragContextChanged(L)){z.warn("Fragment "+L.sn+(U.part?" p: "+U.part.index:"")+" of level "+L.level+" was dropped during download."),z.fragmentTracker.removeFragment(L);return}L.stats.chunkCount++,z._handleFragmentLoadProgress(U)};this._doFragLoad(L,A,V,W).then(function(G){if(!G)return;z.fragLoadError=0;var U=z.state;if(z.fragContextChanged(L)){(U===O.FRAG_LOADING||U===O.BACKTRACKING||!z.fragCurrent&&U===O.PARSING)&&(z.fragmentTracker.removeFragment(L),z.state=O.IDLE);return}if("payload"in G&&(z.log("Loaded fragment "+L.sn+" of level "+L.level),z.hls.trigger(p.Events.FRAG_LOADED,G),z.state===O.BACKTRACKING)){z.fragmentTracker.backtrack(L,G),z.resetFragmentLoading(L);return}z._handleFragmentLoadComplete(G)}).catch(function(G){z.warn(G),z.resetFragmentLoading(L)})},T.flushMainBuffer=function(L,A,V){if(V===void 0&&(V=null),!(L-A))return;var z={startOffset:L,endOffset:A,type:V};this.fragLoadError=0,this.hls.trigger(p.Events.BUFFER_FLUSHING,z)},T._loadInitSegment=function(L){var A=this;this._doFragLoad(L).then(function(V){if(!V||A.fragContextChanged(L)||!A.levels)throw new Error("init load aborted");return V}).then(function(V){var z=A.hls,W=V.payload,G=L.decryptdata;if(W&&W.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var U=self.performance.now();return A.decrypter.webCryptoDecrypt(new Uint8Array(W),G.key.buffer,G.iv.buffer).then(function(P){var H=self.performance.now();return z.trigger(p.Events.FRAG_DECRYPTED,{frag:L,payload:P,stats:{tstart:U,tdecrypt:H}}),V.payload=P,V})}return V}).then(function(V){var z=A.fragCurrent,W=A.hls,G=A.levels;if(!G)throw new Error("init load aborted, missing levels");var U=G[L.level].details;console.assert(U,"Level details are defined when init segment is loaded");var P=L.stats;A.state=O.IDLE,A.fragLoadError=0,L.data=new Uint8Array(V.payload),P.parsing.start=P.buffering.start=self.performance.now(),P.parsing.end=P.buffering.end=self.performance.now(),V.frag===z&&W.trigger(p.Events.FRAG_BUFFERED,{stats:P,frag:z,part:null,id:L.type}),A.tick()}).catch(function(V){A.warn(V),A.resetFragmentLoading(L)})},T.fragContextChanged=function(L){var A=this.fragCurrent;return!L||!A||L.level!==A.level||L.sn!==A.sn||L.urlId!==A.urlId},T.fragBufferedComplete=function(L,A){var V=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+L.type+" sn: "+L.sn+(A?" part: "+A.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+L.level+" "+a.default.toString(S.BufferHelper.getBuffered(V))),this.state=O.IDLE,this.tick()},T._handleFragmentLoadComplete=function(L){var A=this.transmuxer;if(!A)return;var V=L.frag,z=L.part,W=L.partsLoaded,G=!W||W.length===0||W.some(function(P){return!P}),U=new t.ChunkMetadata(V.level,V.sn,V.stats.chunkCount+1,0,z?z.index:-1,!G);A.flush(U)},T._handleFragmentLoadProgress=function(L){},T._doFragLoad=function(L,A,V,z){var W=this;if(V===void 0&&(V=null),!this.levels)throw new Error("frag load aborted, missing levels");if(V=Math.max(L.start,V||0),this.config.lowLatencyMode&&A){var G=A.partList;if(G&&z){V>L.end&&A.fragmentHint&&(L=A.fragmentHint);var U=this.getNextPart(G,L,V);if(U>-1){var P=G[U];return this.log("Loading part sn: "+L.sn+" p: "+P.index+" cc: "+L.cc+" of playlist ["+A.startSN+"-"+A.endSN+"] parts [0-"+U+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+L.level+", target: "+parseFloat(V.toFixed(3))),this.nextLoadPosition=P.start+P.duration,this.state=O.FRAG_LOADING,this.hls.trigger(p.Events.FRAG_LOADING,{frag:L,part:G[U],targetBufferTime:V}),this.doFragPartsLoad(L,G,U,z).catch(function(H){return W.handleFragLoadError(H)})}else if(!L.url||this.loadedEndOfParts(G,V))return Promise.resolve(null)}}return this.log("Loading fragment "+L.sn+" cc: "+L.cc+" "+(A?"of ["+A.startSN+"-"+A.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+L.level+", target: "+parseFloat(V.toFixed(3))),Object(k.isFiniteNumber)(L.sn)&&!this.bitrateTest&&(this.nextLoadPosition=L.start+L.duration),this.state=O.FRAG_LOADING,this.hls.trigger(p.Events.FRAG_LOADING,{frag:L,targetBufferTime:V}),this.fragmentLoader.load(L,z).catch(function(H){return W.handleFragLoadError(H)})},T.doFragPartsLoad=function(L,A,V,z){var W=this;return new Promise(function(G,U){var P=[],H=function $(re){var te=A[re];W.fragmentLoader.loadPart(L,te,z).then(function(ge){P[te.index]=ge;var ve=ge.part;W.hls.trigger(p.Events.FRAG_LOADED,ge);var de=A[re+1];if(de&&de.fragment===L)$(re+1);else return G({frag:L,part:ve,partsLoaded:P})}).catch(U)};H(V)})},T.handleFragLoadError=function(L){var A=L.data;return A&&A.details===d.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(A.frag,A.part):this.hls.trigger(p.Events.ERROR,A),null},T._handleTransmuxerFlush=function(L){var A=this.getCurrentContext(L);if(!A||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var V=A.frag,z=A.part,W=A.level,G=self.performance.now();V.stats.parsing.end=G,z&&(z.stats.parsing.end=G),this.updateLevelTiming(V,z,W,L.partial)},T.getCurrentContext=function(L){var A=this.levels,V=L.level,z=L.sn,W=L.part;if(!A||!A[V])return this.warn("Levels object was unset while buffering fragment "+z+" of level "+V+". The current chunk will not be buffered."),null;var G=A[V],U=W>-1?Object(o.getPartWith)(G,z,W):null,P=U?U.fragment:Object(o.getFragmentWithSN)(G,z,this.fragCurrent);return P?{frag:P,part:U,level:G}:null},T.bufferFragmentData=function(L,A,V,z){if(!L||this.state!==O.PARSING)return;var W=L.data1,G=L.data2,U=W;if(W&&G&&(U=Object(l.appendUint8Array)(W,G)),!U||!U.length)return;var P={type:L.type,frag:A,part:V,chunkMeta:z,parent:A.type,data:U};this.hls.trigger(p.Events.BUFFER_APPENDING,P),L.dropped&&L.independent&&!V&&this.flushBufferGap(A)},T.flushBufferGap=function(L){var A=this.media;if(!A)return;if(!S.BufferHelper.isBuffered(A,A.currentTime)){this.flushMainBuffer(0,L.start);return}var V=A.currentTime,z=S.BufferHelper.bufferInfo(A,V,0),W=L.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,W*.25),U=Math.max(Math.min(L.start-G,z.end-G),V+G);L.start-U>G&&this.flushMainBuffer(U,L.start)},T.getFwdBufferInfo=function(L,A){var V=this.config,z=this.getLoadPosition();if(!Object(k.isFiniteNumber)(z))return null;var W=S.BufferHelper.bufferInfo(L,z,V.maxBufferHole);if(W.len===0&&W.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(z,A);if(G&&W.nextStart<G.end)return S.BufferHelper.bufferInfo(L,z,Math.max(W.nextStart,V.maxBufferHole))}return W},T.getMaxBufferLength=function(L){var A=this.config,V;return L?V=Math.max(8*A.maxBufferSize/L,A.maxBufferLength):V=A.maxBufferLength,Math.min(V,A.maxMaxBufferLength)},T.reduceMaxBufferLength=function(L){var A=this.config,V=L||A.maxBufferLength;return A.maxMaxBufferLength>=V?(A.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+A.maxMaxBufferLength+"s"),!0):!1},T.getNextFragment=function(L,A){var V,z,W=A.fragments,G=W.length;if(!G)return null;var U=this.config,P=W[0].start,H;if(A.live){var $=U.initialLiveManifestSize;if(G<$)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+$+")"),null;!A.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(A,W),this.startPosition=H?this.hls.liveSyncPosition||H.start:L)}else L<=P&&(H=W[0]);if(!H){var re=U.lowLatencyMode?A.partEnd:A.fragmentEnd;H=this.getFragmentAtPosition(L,re,A)}return(V=H)!==null&&V!==void 0&&V.initSegment&&!((z=H)!==null&&z!==void 0&&z.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},T.getNextPart=function(L,A,V){for(var z=-1,W=!1,G=!0,U=0,P=L.length;U<P;U++){var H=L[U];if(G=G&&!H.independent,z>-1&&V<H.start)break;var $=H.loaded;!$&&(W||H.independent||G)&&H.fragment===A&&(z=U),W=$}return z},T.loadedEndOfParts=function(L,A){var V=L[L.length-1];return V&&A>V.start&&V.loaded},T.getInitialLiveFragment=function(L,A){var V=this.fragPrevious,z=null;if(V){if(L.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+V.programDateTime),z=Object(i.findFragmentByPDT)(A,V.endProgramDateTime,this.config.maxFragLookUpTolerance)),!z){var W=V.sn+1;if(W>=L.startSN&&W<=L.endSN){var G=A[W-L.startSN];V.cc===G.cc&&(z=G,this.log("Live playlist, switching playlist, load frag with next SN: "+z.sn))}z||(z=Object(i.findFragWithCC)(A,V.cc),z&&this.log("Live playlist, switching playlist, load frag with same CC: "+z.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(z=this.getFragmentAtPosition(U,this.bitrateTest?L.fragmentEnd:L.edge,L))}return z},T.getFragmentAtPosition=function(L,A,V){var z=this.config,W=this.fragPrevious,G=V.fragments,U=V.endSN,P=V.fragmentHint,H=z.maxFragLookUpTolerance,$=!!(z.lowLatencyMode&&V.partList&&P);$&&P&&!this.bitrateTest&&(G=G.concat(P),U=P.sn);var re;if(L<A){var te=L>A-H?0:H;re=Object(i.findFragmentByPTS)(W,G,L,te)}else re=G[G.length-1];if(re){var ge=re.sn-V.startSN,ve=W&&re.level===W.level,de=G[ge+1],De=this.fragmentTracker.getState(re);if(De===m.FragmentState.BACKTRACKED){re=null;for(var Te=ge;G[Te]&&this.fragmentTracker.getState(G[Te])===m.FragmentState.BACKTRACKED;)W?re=G[Te--]:re=G[--Te];re||(re=de)}else W&&re.sn===W.sn&&!$&&(ve&&(re.sn<U&&this.fragmentTracker.getState(de)!==m.FragmentState.OK?(this.log("SN "+re.sn+" just loaded, load next one: "+de.sn),re=de):re=null))}return re},T.synchronizeToLiveEdge=function(L){var A=this.config,V=this.media;if(!V)return;var z=this.hls.liveSyncPosition,W=V.currentTime,G=L.fragments[0].start,U=L.edge,P=W>=G-A.maxFragLookUpTolerance&&W<=U;if(z!==null&&V.duration>z&&(W<z||!P)){var H=A.liveMaxLatencyDuration!==void 0?A.liveMaxLatencyDuration:A.liveMaxLatencyDurationCount*L.targetduration;(!P&&V.readyState<4||W<U-H)&&(this.loadedmetadata||(this.nextLoadPosition=z),V.readyState&&(this.warn("Playback: "+W.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+z.toFixed(3)),V.currentTime=z))}},T.alignPlaylists=function(L,A){var V=this.levels,z=this.levelLastLoaded,W=this.fragPrevious,G=z!==null?V[z]:null,U=L.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var P=L.fragments[0].start,H=!A,$=L.alignedSliding&&Object(k.isFiniteNumber)(P);if(H||!$&&!P){Object(r.alignStream)(W,G,L);var re=L.fragments[0].start;return this.log("Live playlist sliding: "+re.toFixed(2)+" start-sn: "+(A?A.startSN:"na")+"->"+L.startSN+" prev-sn: "+(W?W.sn:"na")+" fragments: "+U),re}return P},T.waitForCdnTuneIn=function(L){var A=3;return L.live&&L.canBlockReload&&L.tuneInGoal>Math.max(L.partHoldBack,L.partTarget*A)},T.setStartPosition=function(L,A){var V=this.startPosition;if(V<A&&(V=-1),V===-1||this.lastCurrentTime===-1){var z=L.startTimeOffset;Object(k.isFiniteNumber)(z)?(V=A+z,z<0&&(V+=L.totalduration),V=Math.min(Math.max(A,V),A+L.totalduration),this.log("Start time offset "+z+" found in playlist, adjust startPosition to "+V),this.startPosition=V):L.live?V=this.hls.liveSyncPosition||A:this.startPosition=V=0,this.lastCurrentTime=V}this.nextLoadPosition=V},T.getLoadPosition=function(){var L=this.media,A=0;return this.loadedmetadata&&L?A=L.currentTime:this.nextLoadPosition&&(A=this.nextLoadPosition),A},T.handleFragLoadAborted=function(L,A){this.transmuxer&&L.sn!=="initSegment"&&L.stats.aborted&&(this.warn("Fragment "+L.sn+(A?" part"+A.index:"")+" of level "+L.level+" was aborted"),this.resetFragmentLoading(L))},T.resetFragmentLoading=function(L){(!this.fragCurrent||!this.fragContextChanged(L))&&(this.state=O.IDLE)},T.onFragmentOrKeyLoadError=function(L,A){if(A.fatal)return;var V=A.frag;if(!V||V.type!==L)return;var z=this.fragCurrent;console.assert(z&&V.sn===z.sn&&V.level===z.level&&V.urlId===z.urlId,"Frag load error must match current frag to retry");var W=this.config;if(this.fragLoadError+1<=W.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(V.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*W.fragLoadingRetryDelay,W.fragLoadingMaxRetryTimeout);this.warn("Fragment "+V.sn+" of "+L+" "+V.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else A.levelRetry?(L===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(b.logger.error(A.details+" reaches max retry, redispatch as fatal ..."),A.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},T.afterBufferFlushed=function(L,A,V){if(!L)return;var z=S.BufferHelper.getBuffered(L);this.fragmentTracker.detectEvictedFragments(A,z,V),this.state===O.ENDED&&this.resetLoadingState()},T.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},T.resetLiveStartWhenNotLoaded=function(L){if(!this.loadedmetadata){this.startFragRequested=!1;var A=this.levels?this.levels[L].details:null;if(A!=null&&A.live)return this.startPosition=-1,this.setStartPosition(A,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},T.updateLevelTiming=function(L,A,V,z){var W=this,G=V.details;console.assert(!!G,"level.details must be defined");var U=Object.keys(L.elementaryStreams).reduce(function(P,H){var $=L.elementaryStreams[H];if($){var re=$.endPTS-$.startPTS;if(re<=0)return W.warn("Could not parse fragment "+L.sn+" "+H+" duration reliably ("+re+") resetting transmuxer to fallback to playlist timing"),W.resetTransmuxer(),P||!1;var te=z?0:Object(o.updateFragPTSDTS)(G,L,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return W.hls.trigger(p.Events.LEVEL_PTS_UPDATED,{details:G,level:V,drift:te,type:H,frag:L,start:$.startPTS,end:$.endPTS}),!0}return P},!1);U?(this.state=O.PARSED,this.hls.trigger(p.Events.FRAG_PARSED,{frag:L,part:A})):this.resetLoadingState()},T.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},w(E,[{key:"state",get:function(){return this._state},set:function(L){var A=this._state;A!==L&&(this._state=L,this.log(A+"->"+L))}}]),E}(y.default)},"./src/controller/buffer-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return i});var k=C("./src/polyfills/number.ts"),y=C("./src/events.ts"),m=C("./src/utils/logger.ts"),S=C("./src/errors.ts"),b=C("./src/utils/buffer-helper.ts"),p=C("./src/utils/mediasource-helper.ts"),d=C("./src/loader/fragment.ts"),t=C("./src/controller/buffer-operation-queue.ts"),l=Object(p.getMediaSource)(),r=/([ha]vc.)(?:\.[^.,]+)+/,i=function(){function o(c){var a=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 u=a.hls,f=a.media,w=a.mediaSource;m.logger.log("[buffer-controller]: Media source opened"),f&&(a.updateMediaElementDuration(),u.trigger(y.Events.MEDIA_ATTACHED,{media:f})),w&&w.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){m.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){m.logger.log("[buffer-controller]: Media source ended")},this.hls=c,this._initSourceBuffer(),this.registerListeners()}var s=o.prototype;return s.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},s.destroy=function(){this.unregisterListeners(),this.details=null},s.registerListeners=function(){var a=this.hls;a.on(y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(y.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(y.Events.BUFFER_RESET,this.onBufferReset,this),a.on(y.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(y.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(y.Events.BUFFER_EOS,this.onBufferEos,this),a.on(y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(y.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(y.Events.FRAG_PARSED,this.onFragParsed,this),a.on(y.Events.FRAG_CHANGED,this.onFragChanged,this)},s.unregisterListeners=function(){var a=this.hls;a.off(y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(y.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(y.Events.BUFFER_RESET,this.onBufferReset,this),a.off(y.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(y.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(y.Events.BUFFER_EOS,this.onBufferEos,this),a.off(y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(y.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(y.Events.FRAG_PARSED,this.onFragParsed,this),a.off(y.Events.FRAG_CHANGED,this.onFragChanged,this)},s._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new t.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},s.onManifestParsed=function(a,u){var f=2;(u.audio&&!u.video||!u.altAudio)&&(f=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=f,this.details=null,m.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(a,u){var f=this.media=u.media;if(f&&l){var w=this.mediaSource=new l;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),f.src=self.URL.createObjectURL(w),this._objectUrl=f.src}},s.onMediaDetaching=function(){var a=this.media,u=this.mediaSource,f=this._objectUrl;if(u){if(m.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(w){m.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(f&&self.URL.revokeObjectURL(f),a.src===f?(a.removeAttribute("src"),a.load()):m.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(y.Events.MEDIA_DETACHED,void 0)},s.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(u){var f=a.sourceBuffer[u];try{f&&(a.removeBufferListeners(u),a.mediaSource&&a.mediaSource.removeSourceBuffer(f),a.sourceBuffer[u]=void 0)}catch(w){m.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",w)}}),this._initSourceBuffer()},s.onBufferCodecs=function(a,u){var f=this,w=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(_){if(w){var h=f.tracks[_];if(h&&typeof h.buffer.changeType=="function"){var R=u[_],O=R.codec,g=R.levelCodec,x=R.container,E=(h.levelCodec||h.codec).replace(r,"$1"),T=(g||O).replace(r,"$1");if(E!==T){var M=x+";codecs="+(g||O);f.appendChangeType(_,M)}}}else f.pendingTracks[_]=u[_]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},s.appendChangeType=function(a,u){var f=this,w=this.operationQueue,_={execute:function(){var R=f.sourceBuffer[a];R&&(m.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+u),R.changeType(u)),w.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(R){m.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",R)}};w.append(_,a)},s.onBufferAppending=function(a,u){var f=this,w=this.hls,_=this.operationQueue,h=this.tracks,R=u.data,O=u.type,g=u.frag,x=u.part,E=u.chunkMeta,T=E.buffering[O],M=self.performance.now();T.start=M;var L=g.stats.buffering,A=x?x.stats.buffering:null;L.start===0&&(L.start=M),A&&A.start===0&&(A.start=M);var V=h.audio,z=O==="audio"&&E.id===1&&(V==null?void 0:V.container)==="audio/mpeg",W={execute:function(){if(T.executeStart=self.performance.now(),z){var U=f.sourceBuffer[O];if(U){var P=g.start-U.timestampOffset;Math.abs(P)>=.1&&(m.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+g.start+" (delta: "+P+") sn: "+g.sn+")"),U.timestampOffset=g.start)}}f.appendExecutor(R,O)},onStart:function(){},onComplete:function(){var U=self.performance.now();T.executeEnd=T.end=U,L.first===0&&(L.first=U),A&&A.first===0&&(A.first=U);var P=f.sourceBuffer,H={};for(var $ in P)H[$]=b.BufferHelper.getBuffered(P[$]);f.appendError=0,f.hls.trigger(y.Events.BUFFER_APPENDED,{type:O,frag:g,part:x,chunkMeta:E,parent:g.type,timeRanges:H})},onError:function(U){m.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",U);var P={type:S.ErrorTypes.MEDIA_ERROR,parent:g.type,details:S.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?P.details=S.ErrorDetails.BUFFER_FULL_ERROR:(f.appendError++,P.details=S.ErrorDetails.BUFFER_APPEND_ERROR,f.appendError>w.config.appendErrorMaxRetry&&(m.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),P.fatal=!0)),w.trigger(y.Events.ERROR,P)}};_.append(W,O)},s.onBufferFlushing=function(a,u){var f=this,w=this.operationQueue,_=function(R){return{execute:f.removeExecutor.bind(f,R,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(y.Events.BUFFER_FLUSHED,{type:R})},onError:function(g){m.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",g)}}};u.type?w.append(_(u.type),u.type):this.getSourceBufferTypes().forEach(function(h){w.append(_(h),h)})},s.onFragParsed=function(a,u){var f=this,w=u.frag,_=u.part,h=[],R=_?_.elementaryStreams:w.elementaryStreams;R[d.ElementaryStreamTypes.AUDIOVIDEO]?h.push("audiovideo"):(R[d.ElementaryStreamTypes.AUDIO]&&h.push("audio"),R[d.ElementaryStreamTypes.VIDEO]&&h.push("video"));var O=function(){var x=self.performance.now();w.stats.buffering.end=x,_&&(_.stats.buffering.end=x);var E=_?_.stats:w.stats;f.hls.trigger(y.Events.FRAG_BUFFERED,{frag:w,part:_,stats:E,id:w.type})};h.length===0&&m.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(O,h)},s.onFragChanged=function(a,u){this.flushBackBuffer()},s.onBufferEos=function(a,u){var f=this,w=this.getSourceBufferTypes().reduce(function(_,h){var R=f.sourceBuffer[h];return(!u.type||u.type===h)&&(R&&!R.ended&&(R.ended=!0,m.logger.log("[buffer-controller]: "+h+" sourceBuffer now EOS"))),_&&!!(!R||R.ended)},!0);w&&this.blockBuffers(function(){var _=f.mediaSource;if(!_||_.readyState!=="open")return;_.endOfStream()})},s.onLevelUpdated=function(a,u){var f=u.details;if(!f.fragments.length)return;this.details=f,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},s.flushBackBuffer=function(){var a=this.hls,u=this.details,f=this.media,w=this.sourceBuffer;if(!f||u===null)return;var _=this.getSourceBufferTypes();if(!_.length)return;var h=u.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(k.isFiniteNumber)(h)||h<0)return;var R=f.currentTime,O=u.levelTargetDuration,g=Math.max(h,O),x=Math.floor(R/O)*O-g;_.forEach(function(E){var T=w[E];if(T){var M=b.BufferHelper.getBuffered(T);M.length>0&&x>M.start(0)&&(a.trigger(y.Events.BACK_BUFFER_REACHED,{bufferEnd:x}),u.live&&a.trigger(y.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:x}),a.trigger(y.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:x,type:E}))}})},s.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,u=this.hls,f=this.media,w=this.mediaSource,_=a.fragments[0].start+a.totalduration,h=f.duration,R=Object(k.isFiniteNumber)(w.duration)?w.duration:0;a.live&&u.config.liveDurationInfinity?(m.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(a)):(_>R&&_>h||!Object(k.isFiniteNumber)(h))&&(m.logger.log("[buffer-controller]: Updating Media Source duration to "+_.toFixed(3)),w.duration=_)},s.updateSeekableRange=function(a){var u=this.mediaSource,f=a.fragments,w=f.length;if(w&&a.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var _=Math.max(0,f[0].start),h=Math.max(_,_+a.totalduration);u.setLiveSeekableRange(_,h)}},s.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,u=this.operationQueue,f=this.pendingTracks,w=Object.keys(f).length;if(w&&!a||w===2){this.createSourceBuffers(f),this.pendingTracks={};var _=this.getSourceBufferTypes();if(_.length===0){this.hls.trigger(y.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}_.forEach(function(h){u.executeNext(h)})}},s.createSourceBuffers=function(a){var u=this.sourceBuffer,f=this.mediaSource;if(!f)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var _ in a)if(!u[_]){var h=a[_];if(!h)throw Error("source buffer exists for track "+_+", however track does not");var R=h.levelCodec||h.codec,O=h.container+";codecs="+R;m.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var g=u[_]=f.addSourceBuffer(O),x=_;this.addBufferListener(x,"updatestart",this._onSBUpdateStart),this.addBufferListener(x,"updateend",this._onSBUpdateEnd),this.addBufferListener(x,"error",this._onSBUpdateError),this.tracks[_]={buffer:g,codec:R,container:h.container,levelCodec:h.levelCodec,id:h.id},w++}catch(E){m.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+E.message),this.hls.trigger(y.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:E,mimeType:O})}}w&&this.hls.trigger(y.Events.BUFFER_CREATED,{tracks:this.tracks})},s._onSBUpdateStart=function(a){var u=this.operationQueue,f=u.current(a);f.onStart()},s._onSBUpdateEnd=function(a){var u=this.operationQueue,f=u.current(a);f.onComplete(),u.shiftAndExecuteNext(a)},s._onSBUpdateError=function(a,u){m.logger.error("[buffer-controller]: "+a+" SourceBuffer error",u),this.hls.trigger(y.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var f=this.operationQueue.current(a);f&&f.onError(u)},s.removeExecutor=function(a,u,f){var w=this.media,_=this.mediaSource,h=this.operationQueue,R=this.sourceBuffer,O=R[a];if(!w||!_||!O){m.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(a);return}var g=Object(k.isFiniteNumber)(w.duration)?w.duration:Infinity,x=Object(k.isFiniteNumber)(_.duration)?_.duration:Infinity,E=Math.max(0,u),T=Math.min(f,g,x);T>E?(m.logger.log("[buffer-controller]: Removing ["+E+","+T+"] from the "+a+" SourceBuffer"),console.assert(!O.updating,a+" sourceBuffer must not be updating"),O.remove(E,T)):h.shiftAndExecuteNext(a)},s.appendExecutor=function(a,u){var f=this.operationQueue,w=this.sourceBuffer,_=w[u];if(!_){m.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(u);return}_.ended=!1,console.assert(!_.updating,u+" sourceBuffer must not be updating"),_.appendBuffer(a)},s.blockBuffers=function(a,u){var f=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){m.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var w=this.operationQueue,_=u.map(function(h){return w.appendBlocker(h)});Promise.all(_).then(function(){a(),u.forEach(function(h){var R=f.sourceBuffer[h];(!R||!R.updating)&&w.shiftAndExecuteNext(h)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(a,u,f){var w=this.sourceBuffer[a];if(!w)return;var _=f.bind(this,a);this.listeners[a].push({event:u,listener:_}),w.addEventListener(u,_)},s.removeBufferListeners=function(a){var u=this.sourceBuffer[a];if(!u)return;this.listeners[a].forEach(function(f){u.removeEventListener(f.event,f.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return y});var k=C("./src/utils/logger.ts"),y=function(){function m(b){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=b}var S=m.prototype;return S.append=function(p,d){var t=this.queues[d];t.push(p),t.length===1&&this.buffers[d]&&this.executeNext(d)},S.insertAbort=function(p,d){var t=this.queues[d];t.unshift(p),this.executeNext(d)},S.appendBlocker=function(p){var d,t=new Promise(function(r){d=r}),l={execute:d,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(l,p),t},S.executeNext=function(p){var d=this.buffers,t=this.queues,l=d[p],r=t[p];if(r.length){var i=r[0];try{i.execute()}catch(o){k.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),i.onError(o),(!l||!l.updating)&&(r.shift(),this.executeNext(p))}}},S.shiftAndExecuteNext=function(p){this.queues[p].shift(),this.executeNext(p)},S.current=function(p){return this.queues[p][0]},m}()},"./src/controller/cap-level-controller.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/events.ts");function y(b,p){for(var d=0;d<p.length;d++){var t=p[d];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(b,t.key,t)}}function m(b,p,d){return p&&y(b.prototype,p),d&&y(b,d),b}var S=function(){function b(d){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=d,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var p=b.prototype;return p.setStreamController=function(t){this.streamController=t},p.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},p.registerListeners=function(){var t=this.hls;t.on(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},p.unregisterListener=function(){var t=this.hls;t.off(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},p.onFpsDropLevelCapping=function(t,l){b.isLevelAllowed(l.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(l.droppedLevel)},p.onMediaAttaching=function(t,l){this.media=l.media instanceof HTMLVideoElement?l.media:null},p.onManifestParsed=function(t,l){var r=this.hls;this.restrictedLevels=[],this.firstLevel=l.firstLevel,r.config.capLevelToPlayerSize&&l.video&&this.startCapping()},p.onBufferCodecs=function(t,l){var r=this.hls;r.config.capLevelToPlayerSize&&l.video&&this.startCapping()},p.onMediaDetaching=function(){this.stopCapping()},p.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var l=this.hls;l.autoLevelCapping=this.getMaxLevel(t.length-1),l.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=l.autoLevelCapping}}},p.getMaxLevel=function(t){var l=this,r=this.hls.levels;if(!r.length)return-1;var i=r.filter(function(o,s){return b.isLevelAllowed(s,l.restrictedLevels)&&s<=t});return this.clientRect=null,b.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},p.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()},p.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},p.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,l={width:0,height:0};if(t){var r=t.getBoundingClientRect();l.width=r.width,l.height=r.height,!l.width&&!l.height&&(l.width=r.right-r.left||t.width||0,l.height=r.bottom-r.top||t.height||0)}return this.clientRect=l,l},b.isLevelAllowed=function(t,l){return l===void 0&&(l=[]),l.indexOf(t)===-1},b.getMaxLevelByMediaSize=function(t,l,r){if(!t||!t.length)return-1;for(var i=function(u,f){return f?u.width!==f.width||u.height!==f.height:!0},o=t.length-1,s=0;s<t.length;s+=1){var c=t[s];if((c.width>=l||c.height>=r)&&i(c,t[s+1])){o=s;break}}return o},m(b,[{key:"mediaWidth",get:function(){return this.getDimensions().width*b.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*b.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var t=1;try{t=self.devicePixelRatio}catch(l){}return t}}]),b}();v.default=S},"./src/controller/cmcd-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return i});var k=C("./src/events.ts"),y=C("./src/types/cmcd.ts"),m=C("./src/utils/buffer-helper.ts"),S=C("./src/utils/logger.ts");function b(o,s){for(var c=0;c<s.length;c++){var a=s[c];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function p(o,s,c){return s&&b(o.prototype,s),c&&b(o,c),o}function d(o,s){var c=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(c)return(c=c.call(o)).next.bind(c);if(Array.isArray(o)||(c=t(o))||s&&o&&typeof o.length=="number"){c&&(o=c);var a=0;return function(){return a>=o.length?{done:!0}:{done:!1,value:o[a++]}}}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 t(o,s){if(!o)return;if(typeof o=="string")return l(o,s);var c=Object.prototype.toString.call(o).slice(8,-1);if(c==="Object"&&o.constructor&&(c=o.constructor.name),c==="Map"||c==="Set")return Array.from(o);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return l(o,s)}function l(o,s){(s==null||s>o.length)&&(s=o.length);for(var c=0,a=new Array(s);c<s;c++)a[c]=o[c];return a}function r(){return r=Object.assign||function(o){for(var s=1;s<arguments.length;s++){var c=arguments[s];for(var a in c)Object.prototype.hasOwnProperty.call(c,a)&&(o[a]=c[a])}return o},r.apply(this,arguments)}var i=function(){function o(c){var a=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(){a.initialized&&(a.starved=!0),a.buffering=!0},this.onPlaying=function(){a.initialized||(a.initialized=!0),a.buffering=!1},this.applyPlaylistData=function(w){try{a.apply(w,{ot:y.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(_){S.logger.warn("Could not generate manifest CMCD data.",_)}},this.applyFragmentData=function(w){try{var _=w.frag,h=a.hls.levels[_.level],R=a.getObjectType(_),O={d:_.duration*1e3,ot:R};(R===y.CMCDObjectType.VIDEO||R===y.CMCDObjectType.AUDIO||R==y.CMCDObjectType.MUXED)&&(O.br=h.bitrate/1e3,O.tb=a.getTopBandwidth(R),O.bl=a.getBufferLength(R)),a.apply(w,O)}catch(g){S.logger.warn("Could not generate segment CMCD data.",g)}},this.hls=c;var u=this.config=c.config,f=u.cmcd;f!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=f.sessionId||o.uuid(),this.cid=f.contentId,this.useHeaders=f.useHeaders===!0,this.registerListeners())}var s=o.prototype;return s.registerListeners=function(){var a=this.hls;a.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var a=this.hls;a.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},s.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},s.onMediaAttached=function(a,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},s.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},s.onBufferCreated=function(a,u){var f,w;this.audioBuffer=(f=u.tracks.audio)===null||f===void 0?void 0:f.buffer,this.videoBuffer=(w=u.tracks.video)===null||w===void 0?void 0:w.buffer},s.createData=function(){var a;return{v:y.CMCDVersion,sf:y.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(a=this.media)===null||a===void 0?void 0:a.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},s.apply=function(a,u){u===void 0&&(u={}),r(u,this.createData());var f=u.ot===y.CMCDObjectType.INIT||u.ot===y.CMCDObjectType.VIDEO||u.ot===y.CMCDObjectType.MUXED;if(this.starved&&f&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var w=o.toHeaders(u);if(!Object.keys(w).length)return;a.headers||(a.headers={}),r(a.headers,w)}else{var _=o.toQuery(u);if(!_)return;a.url=o.appendQueryToUri(a.url,_)}},s.getObjectType=function(a){var u=a.type;return u==="subtitle"?y.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?y.CMCDObjectType.INIT:u==="audio"?y.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?y.CMCDObjectType.VIDEO:y.CMCDObjectType.MUXED:void 0},s.getTopBandwidth=function(a){for(var u=0,f=a===y.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,w=d(f),_;!(_=w()).done;){var h=_.value;h.bitrate>u&&(u=h.bitrate)}return u>0?u:NaN},s.getBufferLength=function(a){var u=this.hls.media,f=a===y.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!f||!u)return NaN;var w=m.BufferHelper.bufferInfo(f,u.currentTime,this.config.maxBufferHole);return w.len*1e3},s.createPlaylistLoader=function(){var a=this.config.pLoader,u=this.applyPlaylistData,f=a||this.config.loader;return function(){function w(h){this.loader=void 0,this.loader=new f(h)}var _=w.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(R,O,g){u(R),this.loader.load(R,O,g)},p(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},s.createFragmentLoader=function(){var a=this.config.fLoader,u=this.applyFragmentData,f=a||this.config.loader;return function(){function w(h){this.loader=void 0,this.loader=new f(h)}var _=w.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(R,O,g){u(R),this.loader.load(R,O,g)},p(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},o.uuid=function(){var a=URL.createObjectURL(new Blob),u=a.toString();return URL.revokeObjectURL(a),u.substr(u.lastIndexOf("/")+1)},o.serialize=function(a){for(var u=[],f=function(z){return!Number.isNaN(z)&&z!=null&&z!==""&&z!==!1},w=function(z){return Math.round(z)},_=function(z){return w(z/100)*100},h=function(z){return encodeURIComponent(z)},R={br:w,d:w,bl:_,dl:_,mtp:_,nor:h,rtp:_,tb:w},O=Object.keys(a||{}).sort(),g=d(O),x;!(x=g()).done;){var E=x.value,T=a[E];if(!f(T))continue;if(E==="v"&&T===1)continue;if(E=="pr"&&T===1)continue;var M=R[E];M&&(T=M(T));var L=typeof T,A=void 0;E==="ot"||E==="sf"||E==="st"?A=E+"="+T:L==="boolean"?A=E:L==="number"?A=E+"="+T:A=E+"="+JSON.stringify(T),u.push(A)}return u.join(",")},o.toHeaders=function(a){for(var u=Object.keys(a),f={},w=["Object","Request","Session","Status"],_=[{},{},{},{}],h={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,O=u;R<O.length;R++){var g=O[R],x=h[g]!=null?h[g]:1;_[x][g]=a[g]}for(var E=0;E<_.length;E++){var T=o.serialize(_[E]);T&&(f["CMCD-"+w[E]]=T)}return f},o.toQuery=function(a){return"CMCD="+encodeURIComponent(o.serialize(a))},o.appendQueryToUri=function(a,u){if(!u)return a;var f=a.includes("?")?"&":"?";return""+a+f+u},o}()},"./src/controller/eme-controller.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/events.ts"),y=C("./src/errors.ts"),m=C("./src/utils/logger.ts"),S=C("./src/utils/mediakeys-helper.ts");function b(i,o){for(var s=0;s<o.length;s++){var c=o[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(i,c.key,c)}}function p(i,o,s){return o&&b(i.prototype,o),s&&b(i,s),i}var d=3,t=function(o,s,c){var a={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(u){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:c.audioRobustness||""})}),s.forEach(function(u){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:c.videoRobustness||""})}),[a]},l=function(o,s,c,a){switch(o){case S.KeySystems.WIDEVINE:return t(s,c,a);default:throw new Error("Unknown key-system: "+o)}},r=function(){function i(s){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=s,this._config=s.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 o=i.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(c){switch(c){case S.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+c+'"')},o._attemptKeySystemAccess=function(c,a,u){var f=this,w=l(c,a,u,this._drmSystemOptions);m.logger.log("Requesting encrypted media key-system access");var _=this.requestMediaKeySystemAccess(c,w);this.mediaKeysPromise=_.then(function(h){return f._onMediaKeySystemAccessObtained(c,h)}),_.catch(function(h){m.logger.error('Failed to obtain key-system "'+c+'" access:',h)})},o._onMediaKeySystemAccessObtained=function(c,a){var u=this;m.logger.log('Access for key-system "'+c+'" obtained');var f={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:c};this._mediaKeysList.push(f);var w=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(_){return f.mediaKeys=_,m.logger.log('Media-keys created for key-system "'+c+'"'),u._onMediaKeysCreated(),_});return w.catch(function(_){m.logger.error("Failed to create media-keys:",_)}),w},o._onMediaKeysCreated=function(){var c=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),c._onNewMediaKeySession(a.mediaKeysSession))})},o._onNewMediaKeySession=function(c){var a=this;m.logger.log("New key-system session "+c.sessionId),c.addEventListener("message",function(u){a._onKeySessionMessage(c,u.message)},!1)},o._onKeySessionMessage=function(c,a){m.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(u){m.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),c.update(u)})},o.onMediaEncrypted=function(c){var a=this;if(m.logger.log('Media is encrypted using "'+c.initDataType+'" init data type'),!this.mediaKeysPromise){m.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.KEY_SYSTEM_ERROR,details:y.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(w){if(!a._media)return;a._attemptSetMediaKeys(w),a._generateRequestWithPreferredKeySession(c.initDataType,c.initData)};this.mediaKeysPromise.then(u).catch(u)},o._attemptSetMediaKeys=function(c){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){m.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.KEY_SYSTEM_ERROR,details:y.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}m.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(c,a){var u=this,f=this._mediaKeysList[0];if(!f){m.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.KEY_SYSTEM_ERROR,details:y.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(f.mediaKeysSessionInitialized){m.logger.warn("Key-Session already initialized but requested again");return}var w=f.mediaKeysSession;if(!w){m.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.KEY_SYSTEM_ERROR,details:y.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){m.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.KEY_SYSTEM_ERROR,details:y.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}m.logger.log('Generating key-session request for "'+c+'" init data type'),f.mediaKeysSessionInitialized=!0,w.generateRequest(c,a).then(function(){m.logger.debug("Key-session generation succeeded")}).catch(function(_){m.logger.error("Error generating key-session request:",_),u.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.KEY_SYSTEM_ERROR,details:y.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(c,a,u){var f=new XMLHttpRequest;f.responseType="arraybuffer",f.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,f,c,a,u);var w=this._licenseXhrSetup;if(w)try{w.call(this.hls,f,c),w=void 0}catch(_){m.logger.error(_)}try{f.readyState||f.open("POST",c,!0),w&&w.call(this.hls,f,c)}catch(_){throw new Error("issue setting up KeySystem license XHR "+_)}return f},o._onLicenseRequestReadyStageChange=function(c,a,u,f){switch(c.readyState){case 4:if(c.status===200){this._requestLicenseFailureCount=0,m.logger.log("License request succeeded");var w=c.response,_=this._licenseResponseCallback;if(_)try{w=_.call(this.hls,c,a)}catch(R){m.logger.error(R)}f(w)}else{if(m.logger.error("License Request XHR failed ("+a+"). Status: "+c.status+" ("+c.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>d){this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.KEY_SYSTEM_ERROR,details:y.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var h=d-this._requestLicenseFailureCount+1;m.logger.warn("Retrying license request, "+h+" attempts left"),this._requestLicense(u,f)}break}},o._generateLicenseRequestChallenge=function(c,a){switch(c.mediaKeySystemDomain){case S.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+c.mediaKeySystemDomain)},o._requestLicense=function(c,a){m.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){m.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.KEY_SYSTEM_ERROR,details:y.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var f=this.getLicenseServerUrl(u.mediaKeySystemDomain),w=this._createLicenseXhr(f,c,a);m.logger.log("Sending license request to URL: "+f);var _=this._generateLicenseRequestChallenge(u,c);w.send(_)}catch(h){m.logger.error("Failure requesting DRM license: "+h),this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.KEY_SYSTEM_ERROR,details:y.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(c,a){if(!this._emeEnabled)return;var u=a.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var c=this._media,a=this._mediaKeysList;if(!c)return;c.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return c.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(c,a){if(!this._emeEnabled)return;var u=a.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),f=a.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(S.KeySystems.WIDEVINE,u,f)},p(i,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),i}();v.default=r},"./src/controller/fps-controller.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/events.ts"),y=C("./src/utils/logger.ts"),m=function(){function S(p){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=p,this.registerListeners()}var b=S.prototype;return b.setStreamController=function(d){this.streamController=d},b.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},b.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching)},b.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},b.onMediaAttaching=function(d,t){var l=this.hls.config;if(l.capLevelOnFPSDrop){var r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),l.fpsDroppedMonitoringPeriod)}},b.checkFPS=function(d,t,l){var r=performance.now();if(t){if(this.lastTime){var i=r-this.lastTime,o=l-this.lastDroppedFrames,s=t-this.lastDecodedFrames,c=1e3*o/i,a=this.hls;if(a.trigger(k.Events.FPS_DROP,{currentDropped:o,currentDecoded:s,totalDroppedFrames:l}),c>0&&o>a.config.fpsDroppedMonitoringThreshold*s){var u=a.currentLevel;y.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=u)&&(u=u-1,a.trigger(k.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:a.currentLevel}),a.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=l,this.lastDecodedFrames=t}},b.checkFPSInterval=function(){var d=this.media;if(d)if(this.isVideoPlaybackQualityAvailable){var t=d.getVideoPlaybackQuality();this.checkFPS(d,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(d,d.webkitDecodedFrameCount,d.webkitDroppedFrameCount)},S}();v.default=m},"./src/controller/fragment-finders.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"findFragmentByPDT",function(){return m}),C.d(v,"findFragmentByPTS",function(){return S}),C.d(v,"fragmentWithinToleranceTest",function(){return b}),C.d(v,"pdtWithinToleranceTest",function(){return p}),C.d(v,"findFragWithCC",function(){return d});var k=C("./src/polyfills/number.ts"),y=C("./src/utils/binary-search.ts");function m(t,l,r){if(l===null||!Array.isArray(t)||!t.length||!Object(k.isFiniteNumber)(l))return null;var i=t[0].programDateTime;if(l<(i||0))return null;var o=t[t.length-1].endProgramDateTime;if(l>=(o||0))return null;r=r||0;for(var s=0;s<t.length;++s){var c=t[s];if(p(l,r,c))return c}return null}function S(t,l,r,i){r===void 0&&(r=0),i===void 0&&(i=0);var o=null;if(t?o=l[t.sn-l[0].sn+1]||null:r===0&&l[0].start===0&&(o=l[0]),o&&b(r,i,o)===0)return o;var s=y.default.search(l,b.bind(null,r,i));return s||o}function b(t,l,r){t===void 0&&(t=0),l===void 0&&(l=0);var i=Math.min(l,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=t?1:r.start-i>t&&r.start?-1:0}function p(t,l,r){var i=Math.min(l,r.duration+(r.deltaPTS?r.deltaPTS:0))*1e3,o=r.endProgramDateTime||0;return o-i>t}function d(t,l){return y.default.search(t,function(r){return r.cc<l?1:r.cc>l?-1:0})}},"./src/controller/fragment-tracker.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"FragmentState",function(){return m}),C.d(v,"FragmentTracker",function(){return S});var k=C("./src/events.ts"),y=C("./src/types/loader.ts"),m;(function(d){d.NOT_LOADED="NOT_LOADED",d.BACKTRACKED="BACKTRACKED",d.APPENDING="APPENDING",d.PARTIAL="PARTIAL",d.OK="OK"})(m||(m={}));var S=function(){function d(l){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=l,this._registerListeners()}var t=d.prototype;return t._registerListeners=function(){var r=this.hls;r.on(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),r.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.on(k.Events.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var r=this.hls;r.off(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),r.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.off(k.Events.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},t.getAppendedFrag=function(r,i){if(i===y.PlaylistLevelType.MAIN){var o=this.activeFragment,s=this.activeParts;if(!o)return null;if(s)for(var c=s.length;c--;){var a=s[c],u=a?a.end:o.appendedPTS;if(a.start<=r&&u!==void 0&&r<=u)return c>9&&(this.activeParts=s.slice(c-9)),a}else if(o.start<=r&&o.appendedPTS!==void 0&&r<=o.appendedPTS)return o}return this.getBufferedFrag(r,i)},t.getBufferedFrag=function(r,i){for(var o=this.fragments,s=Object.keys(o),c=s.length;c--;){var a=o[s[c]];if((a==null?void 0:a.body.type)===i&&a.buffered){var u=a.body;if(u.start<=r&&r<=u.end)return u}}return null},t.detectEvictedFragments=function(r,i,o){var s=this;Object.keys(this.fragments).forEach(function(c){var a=s.fragments[c];if(!a)return;if(!a.buffered){a.body.type===o&&s.removeFragment(a.body);return}var u=a.range[r];if(!u)return;u.time.some(function(f){var w=!s.isTimeBuffered(f.startPTS,f.endPTS,i);return w&&s.removeFragment(a.body),w})})},t.detectPartialFragments=function(r){var i=this,o=this.timeRanges,s=r.frag,c=r.part;if(!o||s.sn==="initSegment")return;var a=p(s),u=this.fragments[a];if(!u)return;Object.keys(o).forEach(function(f){var w=s.elementaryStreams[f];if(!w)return;var _=o[f],h=c!==null||w.partial===!0;u.range[f]=i.getBufferedTimes(s,c,h,_)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},t.fragBuffered=function(r){var i=p(r),o=this.fragments[i];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},t.getBufferedTimes=function(r,i,o,s){for(var c={time:[],partial:o},a=i?i.start:r.start,u=i?i.end:r.end,f=r.minEndPTS||u,w=r.maxStartPTS||a,_=0;_<s.length;_++){var h=s.start(_)-this.bufferPadding,R=s.end(_)+this.bufferPadding;if(w>=h&&f<=R){c.time.push({startPTS:Math.max(a,s.start(_)),endPTS:Math.min(u,s.end(_))});break}else if(a<R&&u>h)c.partial=!0,c.time.push({startPTS:Math.max(a,s.start(_)),endPTS:Math.min(u,s.end(_))});else if(u<=h)break}return c},t.getPartialFragment=function(r){var i=null,o,s,c,a=0,u=this.bufferPadding,f=this.fragments;return Object.keys(f).forEach(function(w){var _=f[w];if(!_)return;b(_)&&(s=_.body.start-u,c=_.body.end+u,r>=s&&r<=c&&(o=Math.min(r-s,c-r),a<=o&&(i=_.body,a=o)))}),i},t.getState=function(r){var i=p(r),o=this.fragments[i];return o?o.buffered?b(o)?m.PARTIAL:m.OK:o.backtrack?m.BACKTRACKED:m.APPENDING:m.NOT_LOADED},t.backtrack=function(r,i){var o=p(r),s=this.fragments[o];if(!s||s.backtrack)return null;var c=s.backtrack=i||s.loaded;return s.loaded=null,c},t.getBacktrackData=function(r){var i=p(r),o=this.fragments[i];if(o){var s,c=o.backtrack;if(c!=null&&(s=c.payload)!==null&&s!==void 0&&s.byteLength)return c;this.removeFragment(r)}return null},t.isTimeBuffered=function(r,i,o){for(var s,c,a=0;a<o.length;a++){if(s=o.start(a)-this.bufferPadding,c=o.end(a)+this.bufferPadding,r>=s&&i<=c)return!0;if(i<=s)return!1}return!1},t.onFragLoaded=function(r,i){var o=i.frag,s=i.part;if(o.sn==="initSegment"||o.bitrateTest||s)return;var c=p(o);this.fragments[c]={body:o,loaded:i,backtrack:null,buffered:!1,range:Object.create(null)}},t.onBufferAppended=function(r,i){var o=this,s=i.frag,c=i.part,a=i.timeRanges;if(s.type===y.PlaylistLevelType.MAIN)if(this.activeFragment=s,c){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(c)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(f){var w=a[f];if(o.detectEvictedFragments(f,w),!c)for(var _=0;_<w.length;_++)s.appendedPTS=Math.max(w.end(_),s.appendedPTS||0)})},t.onFragBuffered=function(r,i){this.detectPartialFragments(i)},t.hasFragment=function(r){var i=p(r);return!!this.fragments[i]},t.removeFragmentsInRange=function(r,i,o){var s=this;Object.keys(this.fragments).forEach(function(c){var a=s.fragments[c];if(!a)return;if(a.buffered){var u=a.body;u.type===o&&u.start<i&&u.end>r&&s.removeFragment(u)}})},t.removeFragment=function(r){var i=p(r);r.stats.loaded=0,r.clearElementaryStreamInfo(),delete this.fragments[i]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},d}();function b(d){var t,l;return d.buffered&&(((t=d.range.video)===null||t===void 0?void 0:t.partial)||((l=d.range.audio)===null||l===void 0?void 0:l.partial))}function p(d){return d.type+"_"+d.level+"_"+d.urlId+"_"+d.sn}},"./src/controller/gap-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"STALL_MINIMUM_DURATION_MS",function(){return b}),C.d(v,"MAX_START_GAP_JUMP",function(){return p}),C.d(v,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return d}),C.d(v,"SKIP_BUFFER_RANGE_START",function(){return t}),C.d(v,"default",function(){return l});var k=C("./src/utils/buffer-helper.ts"),y=C("./src/errors.ts"),m=C("./src/events.ts"),S=C("./src/utils/logger.ts"),b=250,p=2,d=.1,t=.05,l=function(){function r(o,s,c,a){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=o,this.media=s,this.fragmentTracker=c,this.hls=a}var i=r.prototype;return i.destroy=function(){this.hls=this.fragmentTracker=this.media=null},i.poll=function(s){var c=this.config,a=this.media,u=this.stalled,f=a.currentTime,w=a.seeking,_=this.seeking&&!w,h=!this.seeking&&w;if(this.seeking=w,f!==s){if(this.moved=!0,u!==null){if(this.stallReported){var R=self.performance.now()-u;S.logger.warn("playback not stuck anymore @"+f+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((h||_)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!k.BufferHelper.getBuffered(a).length)return;var O=k.BufferHelper.bufferInfo(a,f,0),g=O.len>0,x=O.nextStart||0;if(!g&&!x)return;if(w){var E=O.len>p,T=!x||x-f>p&&!this.fragmentTracker.getPartialFragment(f);if(E||T)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var M,L=Math.max(x,O.start||0)-f,A=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,V=A==null||((M=A.details)===null||M===void 0)?void 0:M.live,z=V?A.details.targetduration*2:p;if(L>0&&L<=z){this._trySkipBufferHole(null);return}}var W=self.performance.now();if(u===null){this.stalled=W;return}var G=W-u;!w&&G>=b&&this._reportStall(O.len);var U=k.BufferHelper.bufferInfo(a,f,c.maxBufferHole);this._tryFixBufferStall(U,G)},i._tryFixBufferStall=function(s,c){var a=this.config,u=this.fragmentTracker,f=this.media,w=f.currentTime,_=u.getPartialFragment(w);if(_){var h=this._trySkipBufferHole(_);if(h)return}s.len>a.maxBufferHole&&c>a.highBufferWatchdogPeriod*1e3&&(S.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},i._reportStall=function(s){var c=this.hls,a=this.media,u=this.stallReported;u||(this.stallReported=!0,S.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+s+")"),c.trigger(m.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:s}))},i._trySkipBufferHole=function(s){for(var c=this.config,a=this.hls,u=this.media,f=u.currentTime,w=0,_=k.BufferHelper.getBuffered(u),h=0;h<_.length;h++){var R=_.start(h);if(f+c.maxBufferHole>=w&&f<R){var O=Math.max(R+t,u.currentTime+d);return S.logger.warn("skipping hole, adjusting currentTime from "+f+" to "+O),this.moved=!0,this.stalled=null,u.currentTime=O,s&&a.trigger(m.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+f+" to "+O,frag:s}),O}w=_.end(h)}return 0},i._tryNudgeBuffer=function(){var s=this.config,c=this.hls,a=this.media,u=a.currentTime,f=(this.nudgeRetry||0)+1;if(this.nudgeRetry=f,f<s.nudgeMaxRetry){var w=u+f*s.nudgeOffset;S.logger.warn("Nudging 'currentTime' from "+u+" to "+w),a.currentTime=w,c.trigger(m.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else S.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+s.nudgeMaxRetry+" nudges"),c.trigger(m.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},r}()},"./src/controller/id3-track-controller.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/events.ts"),y=C("./src/utils/texttrack-utils.ts"),m=C("./src/demux/id3.ts"),S=.25,b=function(){function p(t){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=t,this._registerListeners()}var d=p.prototype;return d.destroy=function(){this._unregisterListeners()},d._registerListeners=function(){var l=this.hls;l.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),l.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},d._unregisterListeners=function(){var l=this.hls;l.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),l.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},d.onMediaAttached=function(l,r){this.media=r.media},d.onMediaDetaching=function(){if(!this.id3Track)return;Object(y.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},d.getID3Track=function(l){if(!this.media)return;for(var r=0;r<l.length;r++){var i=l[r];if(i.kind==="metadata"&&i.label==="id3")return Object(y.sendAddTrackEvent)(i,this.media),i}return this.media.addTextTrack("metadata","id3")},d.onFragParsingMetadata=function(l,r){if(!this.media)return;var i=r.frag,o=r.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var s=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,c=0;c<o.length;c++){var a=m.getID3Frames(o[c].data);if(a){var u=o[c].pts,f=c<o.length-1?o[c+1].pts:i.end,w=f-u;w<=0&&(f=u+S);for(var _=0;_<a.length;_++){var h=a[_];if(!m.isTimeStampFrame(h)){var R=new s(u,f,"");R.value=h,this.id3Track.addCue(R)}}}}},d.onBufferFlushing=function(l,r){var i=r.startOffset,o=r.endOffset,s=r.type;if(!s||s==="audio"){var c=this.id3Track;c&&Object(y.removeCuesInRange)(c,i,o)}},p}();v.default=b},"./src/controller/latency-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return p});var k=C("./src/errors.ts"),y=C("./src/events.ts"),m=C("./src/utils/logger.ts");function S(d,t){for(var l=0;l<t.length;l++){var r=t[l];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(d,r.key,r)}}function b(d,t,l){return t&&S(d.prototype,t),l&&S(d,l),d}var p=function(){function d(l){var r=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 r.timeupdate()},this.hls=l,this.config=l.config,this.registerListeners()}var t=d.prototype;return t.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},t.registerListeners=function(){this.hls.on(y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(y.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(y.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(y.Events.ERROR,this.onError,this)},t.unregisterListeners=function(){this.hls.off(y.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(y.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(y.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(y.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(y.Events.ERROR,this.onError)},t.onMediaAttached=function(r,i){this.media=i.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},t.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},t.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},t.onLevelUpdated=function(r,i){var o=i.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},t.onError=function(r,i){if(i.details!==k.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,m.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},t.timeupdate=function(){var r=this.media,i=this.levelDetails;if(!r||!i)return;this.currentTime=r.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var s=this.config,c=s.lowLatencyMode,a=s.maxLiveSyncPlaybackRate;if(!c||a===1)return;var u=this.targetLatency;if(u===null)return;var f=o-u,w=Math.min(this.maxLatency,u+i.targetduration),_=f<w;if(i.live&&_&&f>.05&&this.forwardBufferLength>1){var h=Math.min(2,Math.max(1,a)),R=Math.round(2/(1+Math.exp(-.75*f-this.edgeStalled))*20)/20;r.playbackRate=Math.min(h,Math.max(1,R))}else r.playbackRate!==1&&r.playbackRate!==0&&(r.playbackRate=1)},t.estimateLiveEdge=function(){var r=this.levelDetails;return r===null?null:r.edge+r.age},t.computeLatency=function(){var r=this.estimateLiveEdge();return r===null?null:r-this.currentTime},b(d,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var r=this.config,i=this.levelDetails;return r.liveMaxLatencyDuration!==void 0?r.liveMaxLatencyDuration:i?r.liveMaxLatencyDurationCount*i.targetduration:0}},{key:"targetLatency",get:function(){var r=this.levelDetails;if(r===null)return null;var i=r.holdBack,o=r.partHoldBack,s=r.targetduration,c=this.config,a=c.liveSyncDuration,u=c.liveSyncDurationCount,f=c.lowLatencyMode,w=this.hls.userConfig,_=f&&o||i;(w.liveSyncDuration||w.liveSyncDurationCount||_===0)&&(_=a!==void 0?a:u*s);var h=s,R=1;return _+Math.min(this.stallCount*R,h)}},{key:"liveSyncPosition",get:function(){var r=this.estimateLiveEdge(),i=this.targetLatency,o=this.levelDetails;if(r===null||i===null||o===null)return null;var s=o.edge,c=r-i-this.edgeStalled,a=s-o.totalduration,u=s-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(a,c),u)}},{key:"drift",get:function(){var r=this.levelDetails;return r===null?1:r.drift}},{key:"edgeStalled",get:function(){var r=this.levelDetails;if(r===null)return 0;var i=(this.config.lowLatencyMode&&r.partTarget||r.targetduration)*3;return Math.max(r.age-i,0)}},{key:"forwardBufferLength",get:function(){var r=this.media,i=this.levelDetails;if(!r||!i)return 0;var o=r.buffered.length;return o?r.buffered.end(o-1):i.edge-this.currentTime}}]),d}()},"./src/controller/level-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return c});var k=C("./src/types/level.ts"),y=C("./src/events.ts"),m=C("./src/errors.ts"),S=C("./src/utils/codecs.ts"),b=C("./src/controller/level-helper.ts"),p=C("./src/controller/base-playlist-controller.ts"),d=C("./src/types/loader.ts");function t(){return t=Object.assign||function(a){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var w in f)Object.prototype.hasOwnProperty.call(f,w)&&(a[w]=f[w])}return a},t.apply(this,arguments)}function l(a,u){for(var f=0;f<u.length;f++){var w=u[f];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(a,w.key,w)}}function r(a,u,f){return u&&l(a.prototype,u),f&&l(a,f),a}function i(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,o(a,u)}function o(a,u){return o=Object.setPrototypeOf||function(w,_){return w.__proto__=_,w},o(a,u)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(a){i(u,a);function u(w){var _;return _=a.call(this,w,"[level-controller]")||this,_._levels=[],_._firstLevel=-1,_._startLevel=void 0,_.currentLevelIndex=-1,_.manualLevelIndex=-1,_.onParsedComplete=void 0,_._registerListeners(),_}var f=u.prototype;return f._registerListeners=function(){var _=this.hls;_.on(y.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.on(y.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(y.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(y.Events.FRAG_LOADED,this.onFragLoaded,this),_.on(y.Events.ERROR,this.onError,this)},f._unregisterListeners=function(){var _=this.hls;_.off(y.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.off(y.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(y.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(y.Events.FRAG_LOADED,this.onFragLoaded,this),_.off(y.Events.ERROR,this.onError,this)},f.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},f.startLoad=function(){var _=this._levels;_.forEach(function(h){h.loadError=0}),a.prototype.startLoad.call(this)},f.onManifestLoaded=function(_,h){var R=[],O=[],g=[],x,E={},T,M=!1,L=!1,A=!1;if(h.levels.forEach(function(G){var U=G.attrs;M=M||!!(G.width&&G.height),L=L||!!G.videoCodec,A=A||!!G.audioCodec,s&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var P=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;T=E[P],T?T.url.push(G.url):(T=new k.Level(G),E[P]=T,R.push(T)),U&&(U.AUDIO&&Object(b.addGroupId)(T,"audio",U.AUDIO),U.SUBTITLES&&Object(b.addGroupId)(T,"text",U.SUBTITLES))}),(M||L)&&A&&(R=R.filter(function(G){var U=G.videoCodec,P=G.width,H=G.height;return!!U||!!(P&&H)})),R=R.filter(function(G){var U=G.audioCodec,P=G.videoCodec;return(!U||Object(S.isCodecSupportedInMp4)(U,"audio"))&&(!P||Object(S.isCodecSupportedInMp4)(P,"video"))}),h.audioTracks&&(O=h.audioTracks.filter(function(G){return!G.audioCodec||Object(S.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(b.assignTrackIdsByGroup)(O)),h.subtitles&&(g=h.subtitles,Object(b.assignTrackIdsByGroup)(g)),R.length>0){x=R[0].bitrate,R.sort(function(G,U){return G.bitrate-U.bitrate}),this._levels=R;for(var V=0;V<R.length;V++)if(R[V].bitrate===x){this._firstLevel=V,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+x);break}var z=A&&!L,W={levels:R,audioTracks:O,subtitleTracks:g,firstLevel:this._firstLevel,stats:h.stats,audio:A,video:L,altAudio:!z&&O.some(function(G){return!!G.url})};this.hls.trigger(y.Events.MANIFEST_PARSED,W),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(y.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:h.url,reason:"no level with compatible codecs found in manifest"})},f.onError=function(_,h){if(a.prototype.onError.call(this,_,h),h.fatal)return;var R=h.context,O=this._levels[this.currentLevelIndex];if(R&&(R.type===d.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&R.groupId===O.audioGroupIds[O.urlId]||R.type===d.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&R.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var g=!1,x=!0,E;switch(h.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:if(h.frag){var T=this._levels[h.frag.level];T?(T.fragmentError++,T.fragmentError>this.hls.config.fragLoadingMaxRetry&&(E=h.frag.level)):E=h.frag.level}break;case m.ErrorDetails.LEVEL_LOAD_ERROR:case m.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(x=!1),E=R.level),g=!0;break;case m.ErrorDetails.REMUX_ALLOC_ERROR:E=h.level,g=!0;break}E!==void 0&&this.recoverLevel(h,E,g,x)},f.recoverLevel=function(_,h,R,O){var g=_.details,x=this._levels[h];if(x.loadError++,R){var E=this.retryLoadingOrFail(_);if(E)_.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var T=x.url.length;if(T>1&&x.loadError<T)_.levelRetry=!0,this.redundantFailover(h);else if(this.manualLevelIndex===-1){var M=h===0?this._levels.length-1:h-1;this.currentLevelIndex!==M&&this._levels[M].loadError===0&&(this.warn(g+": switch to "+M),_.levelRetry=!0,this.hls.nextAutoLevel=M)}}},f.redundantFailover=function(_){var h=this._levels[_],R=h.url.length;if(R>1){var O=(h.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(g){g.urlId=O}),this.level=_}},f.onFragLoaded=function(_,h){var R=h.frag;if(R!==void 0&&R.type===d.PlaylistLevelType.MAIN){var O=this._levels[R.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},f.onLevelLoaded=function(_,h){var R,O=h.level,g=h.details,x=this._levels[O];if(!x){var E;this.warn("Invalid level index "+O),(E=h.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(g.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(x.fragmentError===0&&(x.loadError=0,this.retryCount=0),this.playlistLoaded(O,h,x.details)):(R=h.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(g.deltaUpdateFailed=!0)},f.onAudioTrackSwitched=function(_,h){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var O=-1,g=this.hls.audioTracks[h.id].groupId,x=0;x<R.audioGroupIds.length;x++)if(R.audioGroupIds[x]===g){O=x;break}O!==R.urlId&&(R.urlId=O,this.startLoad())}},f.loadPlaylist=function(_){var h=this.currentLevelIndex,R=this._levels[h];if(this.canLoad&&R&&R.url.length>0){var O=R.urlId,g=R.url[O];if(_)try{g=_.addDirectives(g)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Attempt loading level index "+h+(_?" at sn "+_.msn+" part "+_.part:"")+" with URL-id "+O+" "+g),this.clearTimer(),this.hls.trigger(y.Events.LEVEL_LOADING,{url:g,level:h,id:O,deliveryDirectives:_||null})}},f.removeLevel=function(_,h){var R=function(x,E){return E!==h},O=this._levels.filter(function(g,x){return x!==_?!0:g.url.length>1&&h!==void 0?(g.url=g.url.filter(R),g.audioGroupIds&&(g.audioGroupIds=g.audioGroupIds.filter(R)),g.textGroupIds&&(g.textGroupIds=g.textGroupIds.filter(R)),g.urlId=0,!0):!1}).map(function(g,x){var E=g.details;return E!=null&&E.fragments&&E.fragments.forEach(function(T){T.level=x}),g});this._levels=O,this.hls.trigger(y.Events.LEVELS_UPDATED,{levels:O})},r(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(_){var h,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===_&&(h=R[_])!==null&&h!==void 0&&h.details)return;if(_<0||_>=R.length){var O=_<0;if(this.hls.trigger(y.Events.ERROR,{type:m.ErrorTypes.OTHER_ERROR,details:m.ErrorDetails.LEVEL_SWITCH_ERROR,level:_,fatal:O,reason:"invalid level idx"}),O)return;_=Math.min(_,R.length-1)}this.clearTimer();var g=this.currentLevelIndex,x=R[g],E=R[_];this.log("switching to level "+_+" from "+g),this.currentLevelIndex=_;var T=t({},E,{level:_,maxBitrate:E.maxBitrate,uri:E.uri,urlId:E.urlId});delete T._urlId,this.hls.trigger(y.Events.LEVEL_SWITCHING,T);var M=E.details;if(!M||M.live){var L=this.switchParams(E.uri,x==null?void 0:x.details);this.loadPlaylist(L)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(_){this.manualLevelIndex=_,this._startLevel===void 0&&(this._startLevel=_),_!==-1&&(this.level=_)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(_){this._firstLevel=_}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var _=this.hls.config.startLevel;return _!==void 0?_:this._firstLevel}else return this._startLevel},set:function(_){this._startLevel=_}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(_){this.level=_,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=_)}}]),u}(p.default)},"./src/controller/level-helper.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"addGroupId",function(){return m}),C.d(v,"assignTrackIdsByGroup",function(){return S}),C.d(v,"updatePTS",function(){return b}),C.d(v,"updateFragPTSDTS",function(){return d}),C.d(v,"mergeDetails",function(){return t}),C.d(v,"mapPartIntersection",function(){return l}),C.d(v,"mapFragmentIntersection",function(){return r}),C.d(v,"adjustSliding",function(){return i}),C.d(v,"addSliding",function(){return o}),C.d(v,"computeReloadInterval",function(){return s}),C.d(v,"getFragmentWithSN",function(){return c}),C.d(v,"getPartWith",function(){return a});var k=C("./src/polyfills/number.ts"),y=C("./src/utils/logger.ts");function m(u,f,w){switch(f){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(w);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(w);break}}function S(u){var f={};u.forEach(function(w){var _=w.groupId||"";w.id=f[_]=f[_]||0,f[_]++})}function b(u,f,w){var _=u[f],h=u[w];p(_,h)}function p(u,f){var w=f.startPTS;if(Object(k.isFiniteNumber)(w)){var _=0,h;f.sn>u.sn?(_=w-u.start,h=u):(_=u.start-w,h=f),h.duration!==_&&(h.duration=_)}else if(f.sn>u.sn){var R=u.cc===f.cc;R&&u.minEndPTS?f.start=u.start+(u.minEndPTS-u.start):f.start=u.start+u.duration}else f.start=Math.max(u.start-f.duration,0)}function d(u,f,w,_,h,R){var O=_-w;O<=0&&(y.logger.warn("Fragment should have a positive duration",f),_=w+f.duration,R=h+f.duration);var g=w,x=_,E=f.startPTS,T=f.endPTS;if(Object(k.isFiniteNumber)(E)){var M=Math.abs(E-w);Object(k.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(M,f.deltaPTS):f.deltaPTS=M,g=Math.max(w,E),w=Math.min(w,E),h=Math.min(h,f.startDTS),x=Math.min(_,T),_=Math.max(_,T),R=Math.max(R,f.endDTS)}f.duration=_-w;var L=w-f.start;f.appendedPTS=_,f.start=f.startPTS=w,f.maxStartPTS=g,f.startDTS=h,f.endPTS=_,f.minEndPTS=x,f.endDTS=R;var A=f.sn;if(!u||A<u.startSN||A>u.endSN)return 0;var V,z=A-u.startSN,W=u.fragments;for(W[z]=f,V=z;V>0;V--)p(W[V],W[V-1]);for(V=z;V<W.length-1;V++)p(W[V],W[V+1]);return u.fragmentHint&&p(W[W.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,L}function t(u,f){for(var w=null,_=u.fragments,h=_.length-1;h>=0;h--){var R=_[h].initSegment;if(R){w=R;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var O=0,g;if(r(u,f,function(V,z){V.relurl&&(O=V.cc-z.cc),Object(k.isFiniteNumber)(V.startPTS)&&Object(k.isFiniteNumber)(V.endPTS)&&(z.start=z.startPTS=V.startPTS,z.startDTS=V.startDTS,z.appendedPTS=V.appendedPTS,z.maxStartPTS=V.maxStartPTS,z.endPTS=V.endPTS,z.endDTS=V.endDTS,z.minEndPTS=V.minEndPTS,z.duration=V.endPTS-V.startPTS,z.duration&&(g=z),f.PTSKnown=f.alignedSliding=!0),z.elementaryStreams=V.elementaryStreams,z.loader=V.loader,z.stats=V.stats,z.urlId=V.urlId,V.initSegment&&(z.initSegment=V.initSegment,w=V.initSegment)}),w){var x=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments;x.forEach(function(V){var z;(!V.initSegment||V.initSegment.relurl===((z=w)===null||z===void 0?void 0:z.relurl))&&(V.initSegment=w)})}if(f.skippedSegments&&(f.deltaUpdateFailed=f.fragments.some(function(V){return!V}),f.deltaUpdateFailed)){y.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var E=f.skippedSegments;E--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}var T=f.fragments;if(O){y.logger.warn("discontinuity sliding from playlist, take drift into account");for(var M=0;M<T.length;M++)T[M].cc+=O}f.skippedSegments&&(f.startCC=f.fragments[0].cc),l(u.partList,f.partList,function(V,z){z.elementaryStreams=V.elementaryStreams,z.stats=V.stats}),g?d(f,g,g.startPTS,g.endPTS,g.startDTS,g.endDTS):i(u,f),T.length&&(f.totalduration=f.edge-T[0].start),f.driftStartTime=u.driftStartTime,f.driftStart=u.driftStart;var L=f.advancedDateTime;if(f.advanced&&L){var A=f.edge;f.driftStart||(f.driftStartTime=L,f.driftStart=A),f.driftEndTime=L,f.driftEnd=A}else f.driftEndTime=u.driftEndTime,f.driftEnd=u.driftEnd,f.advancedDateTime=u.advancedDateTime}function l(u,f,w){if(u&&f)for(var _=0,h=0,R=u.length;h<=R;h++){var O=u[h],g=f[h+_];O&&g&&O.index===g.index&&O.fragment.sn===g.fragment.sn?w(O,g):_--}}function r(u,f,w){for(var _=f.skippedSegments,h=Math.max(u.startSN,f.startSN)-f.startSN,R=(u.fragmentHint?1:0)+(_?f.endSN:Math.min(u.endSN,f.endSN))-f.startSN,O=f.startSN-u.startSN,g=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,x=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,E=h;E<=R;E++){var T=x[O+E],M=g[E];_&&!M&&E<_&&(M=f.fragments[E]=T),T&&M&&w(T,M)}}function i(u,f){var w=f.startSN+f.skippedSegments-u.startSN,_=u.fragments;if(w<0||w>=_.length)return;o(f,_[w].start)}function o(u,f){if(f){for(var w=u.fragments,_=u.skippedSegments;_<w.length;_++)w[_].start+=f;u.fragmentHint&&(u.fragmentHint.start+=f)}}function s(u,f){var w=1e3*u.levelTargetDuration,_=w/2,h=u.age,R=h>0&&h<w*3,O=f.loading.end-f.loading.start,g,x=u.availabilityDelay;if(u.updated===!1)if(R){var E=333*u.misses;g=Math.max(Math.min(_,O*2),E),u.availabilityDelay=(u.availabilityDelay||0)+g}else g=_;else R?(x=Math.min(x||w/2,h),u.availabilityDelay=x,g=x+w-h):g=w-O;return Math.round(g)}function c(u,f,w){if(!u||!u.details)return null;var _=u.details,h=_.fragments[f-_.startSN];return h||(h=_.fragmentHint,h&&h.sn===f?h:f<_.startSN&&w&&w.sn===f?w:null)}function a(u,f,w){if(!u||!u.details)return null;var _=u.details.partList;if(_)for(var h=_.length;h--;){var R=_[h];if(R.index===w&&R.fragment.sn===f)return R}return null}},"./src/controller/stream-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return _});var k=C("./src/polyfills/number.ts"),y=C("./src/controller/base-stream-controller.ts"),m=C("./src/is-supported.ts"),S=C("./src/events.ts"),b=C("./src/utils/buffer-helper.ts"),p=C("./src/controller/fragment-tracker.ts"),d=C("./src/types/loader.ts"),t=C("./src/loader/fragment.ts"),l=C("./src/demux/transmuxer-interface.ts"),r=C("./src/types/transmuxer.ts"),i=C("./src/controller/gap-controller.ts"),o=C("./src/errors.ts"),s=C("./src/utils/logger.ts");function c(h,R){for(var O=0;O<R.length;O++){var g=R[O];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}function a(h,R,O){return R&&c(h.prototype,R),O&&c(h,O),h}function u(h,R){h.prototype=Object.create(R.prototype),h.prototype.constructor=h,f(h,R)}function f(h,R){return f=Object.setPrototypeOf||function(g,x){return g.__proto__=x,g},f(h,R)}var w=100,_=function(h){u(R,h);function R(g,x){var E;return E=h.call(this,g,x,"[stream-controller]")||this,E.audioCodecSwap=!1,E.gapController=null,E.level=-1,E._forceStartLoad=!1,E.altAudio=!1,E.audioOnly=!1,E.fragPlaying=null,E.onvplaying=null,E.onvseeked=null,E.fragLastKbps=0,E.stalled=!1,E.couldBacktrack=!1,E.audioCodecSwitch=!1,E.videoBuffer=null,E._registerListeners(),E}var O=R.prototype;return O._registerListeners=function(){var x=this.hls;x.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.on(S.Events.LEVEL_LOADING,this.onLevelLoading,this),x.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(S.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),x.on(S.Events.ERROR,this.onError,this),x.on(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(S.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(S.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(S.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),x.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var x=this.hls;x.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(S.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),x.off(S.Events.ERROR,this.onError,this),x.off(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(S.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(S.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(S.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),x.off(S.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(x){if(this.levels){var E=this.lastCurrentTime,T=this.hls;if(this.stopLoad(),this.setInterval(w),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var M=T.startLevel;M===-1&&(T.config.testBandwidth?(M=0,this.bitrateTest=!0):M=T.nextAutoLevel),this.level=T.nextLoadLevel=M,this.loadedmetadata=!1}E>0&&x===-1&&(this.log("Override startPosition with lastCurrentTime @"+E.toFixed(3)),x=E),this.state=y.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()}else this._forceStartLoad=!0,this.state=y.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,h.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case y.State.IDLE:this.doTickIdle();break;case y.State.WAITING_LEVEL:{var x,E=this.levels,T=this.level,M=E==null||((x=E[T])===null||x===void 0)?void 0:x.details;if(M&&(!M.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(M))break;this.state=y.State.IDLE;break}break}case y.State.FRAG_LOADING_WAITING_RETRY:{var L,A=self.performance.now(),V=this.retryDate;(!V||A>=V||(L=this.media)!==null&&L!==void 0&&L.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=y.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){h.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var x,E,T=this.hls,M=this.levelLastLoaded,L=this.levels,A=this.media,V=T.config,z=T.nextLoadLevel;if(M===null||!A&&(this.startFragRequested||!V.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!L||!L[z])return;var W=L[z];this.level=T.nextLoadLevel=z;var G=W.details;if(!G||this.state===y.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==z){this.state=y.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:A,d.PlaylistLevelType.MAIN);if(U===null)return;var P=U.len,H=this.getMaxBufferLength(W.maxBitrate);if(P>=H)return;if(this._streamEnded(U,G)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(S.Events.BUFFER_EOS,$),this.state=y.State.ENDED;return}var re=U.end,te=this.getNextFragment(re,G);if(this.couldBacktrack&&!this.fragPrevious&&te&&te.sn!=="initSegment"){var ge=te.sn-G.startSN;ge>1&&(te=G.fragments[ge-1],this.fragmentTracker.removeFragment(te))}if(te&&this.fragmentTracker.getState(te)===p.FragmentState.OK&&this.nextLoadPosition>re){var ve=this.audioOnly&&!this.altAudio?t.ElementaryStreamTypes.AUDIO:t.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(A,ve,d.PlaylistLevelType.MAIN),te=this.getNextFragment(this.nextLoadPosition,G)}if(!te)return;te.initSegment&&!te.initSegment.data&&!this.bitrateTest&&(te=te.initSegment),((x=te.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((E=te.decryptdata)!==null&&E!==void 0&&E.key)?this.loadKey(te,G):this.loadFragment(te,G,re)},O.loadFragment=function(x,E,T){var M,L=this.fragmentTracker.getState(x);if(this.fragCurrent=x,L===p.FragmentState.BACKTRACKED){var A=this.fragmentTracker.getBacktrackData(x);if(A){this._handleFragmentLoadProgress(A),this._handleFragmentLoadComplete(A);return}else L=p.FragmentState.NOT_LOADED}L===p.FragmentState.NOT_LOADED||L===p.FragmentState.PARTIAL?x.sn==="initSegment"?this._loadInitSegment(x):this.bitrateTest?(x.bitrateTest=!0,this.log("Fragment "+x.sn+" of level "+x.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(x)):(this.startFragRequested=!0,h.prototype.loadFragment.call(this,x,E,T)):L===p.FragmentState.APPENDING?this.reduceMaxBufferLength(x.duration)&&this.fragmentTracker.removeFragment(x):((M=this.media)===null||M===void 0?void 0:M.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(x){var E=this.fragmentTracker.getAppendedFrag(x,d.PlaylistLevelType.MAIN);return E&&"fragment"in E?E.fragment:E},O.getBufferedFrag=function(x){return this.fragmentTracker.getBufferedFrag(x,d.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(x){return x?this.getBufferedFrag(x.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var x=this.levels,E=this.media;if(E!=null&&E.readyState){var T,M=this.getAppendedFrag(E.currentTime);if(M&&M.start>1&&this.flushMainBuffer(0,M.start-1),!E.paused&&x){var L=this.hls.nextLoadLevel,A=x[L],V=this.fragLastKbps;V&&this.fragCurrent?T=this.fragCurrent.duration*A.maxBitrate/(1e3*V)+1:T=0}else T=0;var z=this.getBufferedFrag(E.currentTime+T);if(z){var W=this.followingBufferedFrag(z);if(W){this.abortCurrentFrag();var G=W.maxStartPTS?W.maxStartPTS:W.start,U=W.duration,P=Math.max(z.end,G+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(P,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var x=this.fragCurrent;this.fragCurrent=null,x!=null&&x.loader&&x.loader.abort(),this.state===y.State.KEY_LOADING&&(this.state=y.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(x,E){h.prototype.flushMainBuffer.call(this,x,E,this.altAudio?"video":null)},O.onMediaAttached=function(x,E){h.prototype.onMediaAttached.call(this,x,E);var T=E.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),T.addEventListener("playing",this.onvplaying),T.addEventListener("seeked",this.onvseeked),this.gapController=new i.default(this.config,T,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var x=this.media;x&&(x.removeEventListener("playing",this.onvplaying),x.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),h.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var x=this.media,E=x?x.currentTime:null;Object(k.isFiniteNumber)(E)&&this.log("Media seeked to "+E.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(S.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(x,E){var T=!1,M=!1,L;E.levels.forEach(function(A){L=A.audioCodec,L&&(L.indexOf("mp4a.40.2")!==-1&&(T=!0),L.indexOf("mp4a.40.5")!==-1&&(M=!0))}),this.audioCodecSwitch=T&&M&&!Object(m.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=E.levels,this.startFragRequested=!1},O.onLevelLoading=function(x,E){var T=this.levels;if(!T||this.state!==y.State.IDLE)return;var M=T[E.level];(!M.details||M.details.live&&this.levelLastLoaded!==E.level||this.waitForCdnTuneIn(M.details))&&(this.state=y.State.WAITING_LEVEL)},O.onLevelLoaded=function(x,E){var T,M=this.levels,L=E.level,A=E.details,V=A.totalduration;if(!M){this.warn("Levels were reset while loading level "+L);return}this.log("Level "+L+" loaded ["+A.startSN+","+A.endSN+"], cc ["+A.startCC+", "+A.endCC+"] duration:"+V);var z=this.fragCurrent;z&&(this.state===y.State.FRAG_LOADING||this.state===y.State.FRAG_LOADING_WAITING_RETRY)&&(z.level!==E.level&&z.loader&&(this.state=y.State.IDLE,z.loader.abort()));var W=M[L],G=0;if(A.live||(T=W.details)!==null&&T!==void 0&&T.live){if(A.fragments[0]||(A.deltaUpdateFailed=!0),A.deltaUpdateFailed)return;G=this.alignPlaylists(A,W.details)}if(W.details=A,this.levelLastLoaded=L,this.hls.trigger(S.Events.LEVEL_UPDATED,{details:A,level:L}),this.state===y.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(A))return;this.state=y.State.IDLE}this.startFragRequested?A.live&&this.synchronizeToLiveEdge(A):this.setStartPosition(A,G),this.tick()},O._handleFragmentLoadProgress=function(x){var E,T=x.frag,M=x.part,L=x.payload,A=this.levels;if(!A){this.warn("Levels were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var V=A[T.level],z=V.details;if(!z){this.warn("Dropping fragment "+T.sn+" of level "+T.level+" after level details were reset");return}var W=V.videoCodec,G=z.PTSKnown||!z.live,U=(E=T.initSegment)===null||E===void 0?void 0:E.data,P=this._getAudioCodec(V),H=this.transmuxer=this.transmuxer||new l.default(this.hls,d.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=M?M.index:-1,re=$!==-1,te=new r.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,L.byteLength,$,re),ge=this.initPTS[T.cc];H.push(L,U,P,W,T,M,z.totalduration,G,te,ge)},O.onAudioTrackSwitching=function(x,E){var T=this.altAudio,M=!!E.url,L=E.id;if(!M){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var A=this.fragCurrent;A!=null&&A.loader&&(this.log("Switching to main audio track, cancel main fragment load"),A.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var V=this.hls;T&&V.trigger(S.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),V.trigger(S.Events.AUDIO_TRACK_SWITCHED,{id:L})}},O.onAudioTrackSwitched=function(x,E){var T=E.id,M=!!this.hls.audioTracks[T].url;if(M){var L=this.videoBuffer;L&&this.mediaBuffer!==L&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=L)}this.altAudio=M,this.tick()},O.onBufferCreated=function(x,E){var T=E.tracks,M,L,A=!1;for(var V in T){var z=T[V];if(z.id==="main"){if(L=V,M=z,V==="video"){var W=T[V];W&&(this.videoBuffer=W.buffer)}}else A=!0}A&&M?(this.log("Alternate track found, use "+L+".buffered to schedule main fragment loading"),this.mediaBuffer=M.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(x,E){var T=E.frag,M=E.part;if(T&&T.type!==d.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(M?" p: "+M.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state),this.state===y.State.PARSED&&(this.state=y.State.IDLE);return}var L=M?M.stats:T.stats;this.fragLastKbps=Math.round(8*L.total/(L.buffering.end-L.loading.first)),T.sn!=="initSegment"&&(this.fragPrevious=T),this.fragBufferedComplete(T,M)},O.onError=function(x,E){switch(E.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(d.PlaylistLevelType.MAIN,E);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==y.State.ERROR&&(E.fatal?(this.warn(""+E.details),this.state=y.State.ERROR):!E.levelRetry&&this.state===y.State.WAITING_LEVEL&&(this.state=y.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(E.parent==="main"&&(this.state===y.State.PARSING||this.state===y.State.PARSED)){var T=!0,M=this.getFwdBufferInfo(this.media,d.PlaylistLevelType.MAIN);M&&M.len>.5&&(T=!this.reduceMaxBufferLength(M.len)),T&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var x=this.media,E=this.gapController;if(!x||!E||!x.readyState)return;var T=b.BufferHelper.getBuffered(x);!this.loadedmetadata&&T.length?(this.loadedmetadata=!0,this.seekToStartPos()):E.poll(this.lastCurrentTime),this.lastCurrentTime=x.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=y.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(x,E){var T=E.type;if(T!==t.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var M=(T===t.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(M,T,d.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(x,E){this.levels=E.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var x=this.media,E=x.currentTime,T=this.startPosition;if(T>=0&&E<T){if(x.seeking){s.logger.log("could not seek to "+T+", already seeking at "+E);return}var M=b.BufferHelper.getBuffered(x),L=M.length?M.start(0):0,A=L-T;A>0&&(A<this.config.maxBufferHole||A<this.config.maxFragLookUpTolerance)&&(s.logger.log("adjusting start position by "+A+" to match buffer start"),T+=A,this.startPosition=T),this.log("seek to target start position "+T+" from current time "+E),x.currentTime=T}},O._getAudioCodec=function(x){var E=this.config.defaultAudioCodec||x.audioCodec;return this.audioCodecSwap&&E&&(this.log("Swapping audio codec"),E.indexOf("mp4a.40.5")!==-1?E="mp4a.40.2":E="mp4a.40.5"),E},O._loadBitrateTestFrag=function(x){var E=this;this._doFragLoad(x).then(function(T){var M=E.hls;if(!T||M.nextLoadLevel||E.fragContextChanged(x))return;E.fragLoadError=0,E.state=y.State.IDLE,E.startFragRequested=!1,E.bitrateTest=!1;var L=x.stats;L.parsing.start=L.parsing.end=L.buffering.start=L.buffering.end=self.performance.now(),M.trigger(S.Events.FRAG_LOADED,T)})},O._handleTransmuxComplete=function(x){var E,T="main",M=this.hls,L=x.remuxResult,A=x.chunkMeta,V=this.getCurrentContext(A);if(!V){this.warn("The loading context changed while buffering fragment "+A.sn+" of level "+A.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(A.level);return}var z=V.frag,W=V.part,G=V.level,U=L.video,P=L.text,H=L.id3,$=L.initSegment,re=this.altAudio?void 0:L.audio;if(this.fragContextChanged(z))return;if(this.state=y.State.PARSING,$){$.tracks&&(this._bufferInitSegment(G,$.tracks,z,A),M.trigger(S.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:T,tracks:$.tracks}));var te=$.initPTS,ge=$.timescale;Object(k.isFiniteNumber)(te)&&(this.initPTS[z.cc]=te,M.trigger(S.Events.INIT_PTS_FOUND,{frag:z,id:T,initPTS:te,timescale:ge}))}if(U&&L.independent!==!1){if(G.details){var ve=U.startPTS,de=U.endPTS,De=U.startDTS,Te=U.endDTS;if(W)W.elementaryStreams[U.type]={startPTS:ve,endPTS:de,startDTS:De,endDTS:Te};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var he=this.getLoadPosition()+this.config.maxBufferHole;if(he<ve){this.backtrack(z);return}z.setElementaryStreamInfo(U.type,z.start,de,z.start,Te,!0)}z.setElementaryStreamInfo(U.type,ve,de,De,Te),this.bufferFragmentData(U,z,W,A)}}else if(L.independent===!1){this.backtrack(z);return}if(re){var ue=re.startPTS,ie=re.endPTS,Se=re.startDTS,ne=re.endDTS;W&&(W.elementaryStreams[t.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:ie,startDTS:Se,endDTS:ne}),z.setElementaryStreamInfo(t.ElementaryStreamTypes.AUDIO,ue,ie,Se,ne),this.bufferFragmentData(re,z,W,A)}if(H!=null&&(E=H.samples)!==null&&E!==void 0&&E.length){var ce={frag:z,id:T,samples:H.samples};M.trigger(S.Events.FRAG_PARSING_METADATA,ce)}if(P){var Oe={frag:z,id:T,samples:P.samples};M.trigger(S.Events.FRAG_PARSING_USERDATA,Oe)}},O._bufferInitSegment=function(x,E,T,M){var L=this;if(this.state!==y.State.PARSING)return;this.audioOnly=!!E.audio&&!E.video,this.altAudio&&!this.audioOnly&&delete E.audio;var A=E.audio,V=E.video,z=E.audiovideo;if(A){var W=x.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(W&&(W.indexOf("mp4a.40.5")!==-1?W="mp4a.40.2":W="mp4a.40.5"),A.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(W="mp4a.40.5")),G.indexOf("android")!==-1&&A.container!=="audio/mpeg"&&(W="mp4a.40.2",this.log("Android: force audio codec to "+W)),x.audioCodec&&x.audioCodec!==W&&this.log('Swapping manifest audio codec "'+x.audioCodec+'" for "'+W+'"'),A.levelCodec=W,A.id="main",this.log("Init audio buffer, container:"+A.container+", codecs[selected/level/parsed]=["+(W||"")+"/"+(x.audioCodec||"")+"/"+A.codec+"]")}V&&(V.levelCodec=x.videoCodec,V.id="main",this.log("Init video buffer, container:"+V.container+", codecs[level/parsed]=["+(x.videoCodec||"")+"/"+V.codec+"]")),z&&this.log("Init audiovideo buffer, container:"+z.container+", codecs[level/parsed]=["+(x.attrs.CODECS||"")+"/"+z.codec+"]"),this.hls.trigger(S.Events.BUFFER_CODECS,E),Object.keys(E).forEach(function(U){var P=E[U],H=P.initSegment;H!=null&&H.byteLength&&L.hls.trigger(S.Events.BUFFER_APPENDING,{type:U,data:H,frag:T,part:null,chunkMeta:M,parent:T.type})}),this.tick()},O.backtrack=function(x){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(x);var E=this.fragmentTracker.backtrack(x);this.fragPrevious=null,this.nextLoadPosition=x.start,E?this.resetFragmentLoading(x):this.state=y.State.BACKTRACKING},O.checkFragmentChanged=function(){var x=this.media,E=null;if(x&&x.readyState>1&&x.seeking===!1){var T=x.currentTime;if(b.BufferHelper.isBuffered(x,T)?E=this.getAppendedFrag(T):b.BufferHelper.isBuffered(x,T+.1)&&(E=this.getAppendedFrag(T+.1)),E){var M=this.fragPlaying,L=E.level;(!M||E.sn!==M.sn||M.level!==L||E.urlId!==M.urlId)&&(this.hls.trigger(S.Events.FRAG_CHANGED,{frag:E}),(!M||M.level!==L)&&this.hls.trigger(S.Events.LEVEL_SWITCHED,{level:L}),this.fragPlaying=E)}}},a(R,[{key:"nextLevel",get:function(){var x=this.nextBufferedFrag;return x?x.level:-1}},{key:"currentLevel",get:function(){var x=this.media;if(x){var E=this.getAppendedFrag(x.currentTime);if(E)return E.level}return-1}},{key:"nextBufferedFrag",get:function(){var x=this.media;if(x){var E=this.getAppendedFrag(x.currentTime);return this.followingBufferedFrag(E)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(y.default)},"./src/controller/subtitle-stream-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"SubtitleStreamController",function(){return u});var k=C("./src/events.ts"),y=C("./src/utils/logger.ts"),m=C("./src/utils/buffer-helper.ts"),S=C("./src/controller/fragment-finders.ts"),b=C("./src/utils/discontinuities.ts"),p=C("./src/controller/level-helper.ts"),d=C("./src/controller/fragment-tracker.ts"),t=C("./src/controller/base-stream-controller.ts"),l=C("./src/types/loader.ts"),r=C("./src/types/level.ts");function i(f,w){for(var _=0;_<w.length;_++){var h=w[_];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(f,h.key,h)}}function o(f,w,_){return w&&i(f.prototype,w),_&&i(f,_),f}function s(f,w){f.prototype=Object.create(w.prototype),f.prototype.constructor=f,c(f,w)}function c(f,w){return c=Object.setPrototypeOf||function(h,R){return h.__proto__=R,h},c(f,w)}var a=500,u=function(f){s(w,f);function w(h,R){var O;return O=f.call(this,h,R,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var _=w.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var R=this.hls;R.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(k.Events.ERROR,this.onError,this),R.on(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_._unregisterListeners=function(){var R=this.hls;R.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(k.Events.ERROR,this.onError,this),R.off(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_.startLoad=function(){this.stopLoad(),this.state=t.State.IDLE,this.setInterval(a),this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},_.onLevelLoaded=function(R,O){this.mainDetails=O.details},_.onSubtitleFragProcessed=function(R,O){var g=O.frag,x=O.success;if(this.fragPrevious=g,this.state=t.State.IDLE,!x)return;var E=this.tracksBuffered[this.currentTrackId];if(!E)return;for(var T,M=g.start,L=0;L<E.length;L++)if(M>=E[L].start&&M<=E[L].end){T=E[L];break}var A=g.start+g.duration;T?T.end=A:(T={start:M,end:A},E.push(T)),this.fragmentTracker.fragBuffered(g)},_.onBufferFlushing=function(R,O){var g=O.startOffset,x=O.endOffset;if(g===0&&x!==Number.POSITIVE_INFINITY){var E=this.currentTrackId,T=this.levels;if(!T.length||!T[E]||!T[E].details)return;var M=T[E].details,L=M.targetduration,A=x-L;if(A<=0)return;O.endOffsetSubtitles=Math.max(0,A),this.tracksBuffered.forEach(function(V){for(var z=0;z<V.length;){if(V[z].end<=A){V.shift();continue}else if(V[z].start<A)V[z].start=A;else break;z++}}),this.fragmentTracker.removeFragmentsInRange(g,A,l.PlaylistLevelType.SUBTITLE)}},_.onError=function(R,O){var g,x=O.frag;if(!x||x.type!==l.PlaylistLevelType.SUBTITLE)return;(g=this.fragCurrent)!==null&&g!==void 0&&g.loader&&this.fragCurrent.loader.abort(),this.state=t.State.IDLE},_.onSubtitleTracksUpdated=function(R,O){var g=this,x=O.subtitleTracks;this.tracksBuffered=[],this.levels=x.map(function(E){return new r.Level(E)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(E){g.tracksBuffered[E.id]=[]}),this.mediaBuffer=null},_.onSubtitleTrackSwitch=function(R,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var g=this.levels[this.currentTrackId];g!=null&&g.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,g&&this.setInterval(a)},_.onSubtitleTrackLoaded=function(R,O){var g,x=O.details,E=O.id,T=this.currentTrackId,M=this.levels;if(!M.length)return;var L=M[T];if(E>=M.length||E!==T||!L)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,x.live||(g=L.details)!==null&&g!==void 0&&g.live){var A=this.mainDetails;if(x.deltaUpdateFailed||!A)return;var V=A.fragments[0];if(!L.details)x.hasProgramDateTime&&A.hasProgramDateTime?Object(b.alignMediaPlaylistByPDT)(x,A):V&&Object(p.addSliding)(x,V.start);else{var z=this.alignPlaylists(x,L.details);z===0&&V&&Object(p.addSliding)(x,V.start)}}if(L.details=x,this.levelLastLoaded=E,this.tick(),x.live&&!this.fragCurrent&&this.media&&this.state===t.State.IDLE){var W=Object(S.findFragmentByPTS)(null,x.fragments,this.media.currentTime,0);W||(this.warn("Subtitle playlist not aligned with playback"),L.details=void 0)}},_._handleFragmentLoadComplete=function(R){var O=R.frag,g=R.payload,x=O.decryptdata,E=this.hls;if(this.fragContextChanged(O))return;if(g&&g.byteLength>0&&x&&x.key&&x.iv&&x.method==="AES-128"){var T=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(g),x.key.buffer,x.iv.buffer).then(function(M){var L=performance.now();E.trigger(k.Events.FRAG_DECRYPTED,{frag:O,payload:M,stats:{tstart:T,tdecrypt:L}})})}},_.doTick=function(){if(!this.media){this.state=t.State.IDLE;return}if(this.state===t.State.IDLE){var R,O=this.currentTrackId,g=this.levels;if(!g.length||!g[O]||!g[O].details)return;var x=g[O].details,E=x.targetduration,T=this.config,M=this.media,L=m.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,M.currentTime-E,T.maxBufferHole),A=L.end,V=L.len,z=this.getMaxBufferLength()+E;if(V>z)return;console.assert(x,"Subtitle track details are defined on idle subtitle stream controller tick");var W=x.fragments,G=W.length,U=x.edge,P,H=this.fragPrevious;if(A<U){var $=T.maxFragLookUpTolerance;H&&x.hasProgramDateTime&&(P=Object(S.findFragmentByPDT)(W,H.endProgramDateTime,$)),P||(P=Object(S.findFragmentByPTS)(H,W,A,$),!P&&H&&H.start<W[0].start&&(P=W[0]))}else P=W[G-1];(R=P)!==null&&R!==void 0&&R.encrypted?(y.logger.log("Loading key for "+P.sn),this.state=t.State.KEY_LOADING,this.hls.trigger(k.Events.KEY_LOADING,{frag:P})):P&&this.fragmentTracker.getState(P)===d.FragmentState.NOT_LOADED&&this.loadFragment(P,x,A)}},_.loadFragment=function(R,O,g){this.fragCurrent=R,f.prototype.loadFragment.call(this,R,O,g)},o(w,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),w}(t.default)},"./src/controller/subtitle-track-controller.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/events.ts"),y=C("./src/utils/texttrack-utils.ts"),m=C("./src/controller/base-playlist-controller.ts"),S=C("./src/types/loader.ts");function b(i,o){for(var s=0;s<o.length;s++){var c=o[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(i,c.key,c)}}function p(i,o,s){return o&&b(i.prototype,o),s&&b(i,s),i}function d(i,o){i.prototype=Object.create(o.prototype),i.prototype.constructor=i,t(i,o)}function t(i,o){return t=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},t(i,o)}var l=function(i){d(o,i);function o(c){var a;return a=i.call(this,c,"[subtitle-track-controller]")||this,a.media=null,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.selectDefaultTrack=!0,a.queuedDefaultTrack=-1,a.trackChangeListener=function(){return a.onTextTracksChanged()},a.asyncPollTrackChange=function(){return a.pollTrackChange(0)},a.useTextTrackPolling=!1,a.subtitlePollingInterval=-1,a.subtitleDisplay=!0,a.registerListeners(),a}var s=o.prototype;return s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,i.prototype.destroy.call(this)},s.registerListeners=function(){var a=this.hls;a.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(k.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var a=this.hls;a.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(k.Events.ERROR,this.onError,this)},s.onMediaAttached=function(a,u){if(this.media=u.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)},s.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},s.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 a=r(this.media.textTracks);a.forEach(function(u){Object(y.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},s.onManifestParsed=function(a,u){this.tracks=u.subtitleTracks},s.onSubtitleTrackLoaded=function(a,u){var f=u.id,w=u.details,_=this.trackId,h=this.tracksInGroup[_];if(!h){this.warn("Invalid subtitle track id "+f);return}var R=h.details;h.details=u.details,this.log("subtitle track "+f+" loaded ["+w.startSN+"-"+w.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,u,R))},s.onLevelLoading=function(a,u){this.switchLevel(u.level)},s.onLevelSwitching=function(a,u){this.switchLevel(u.level)},s.switchLevel=function(a){var u=this.hls.levels[a];if(!(u!=null&&u.textGroupIds))return;var f=u.textGroupIds[u.urlId];if(this.groupId!==f){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,_=this.tracks.filter(function(O){return!f||O.groupId===f});this.tracksInGroup=_;var h=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=f;var R={subtitleTracks:_};this.log("Updating subtitle tracks, "+_.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(k.Events.SUBTITLE_TRACKS_UPDATED,R),h!==-1&&this.setSubtitleTrack(h,w)}},s.findTrackId=function(a){for(var u=this.tracksInGroup,f=0;f<u.length;f++){var w=u[f];if((!this.selectDefaultTrack||w.default)&&(!a||a===w.name))return w.id}return-1},s.onError=function(a,u){if(i.prototype.onError.call(this,a,u),u.fatal||!u.context)return;u.context.type===S.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},s.loadPlaylist=function(a){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var f=u.id,w=u.groupId,_=u.url;if(a)try{_=a.addDirectives(_)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(k.Events.SUBTITLE_TRACK_LOADING,{url:_,id:f,groupId:w,deliveryDirectives:a||null})}},s.toggleTrackModes=function(a){var u=this,f=this.media,w=this.subtitleDisplay,_=this.trackId;if(!f)return;var h=r(f.textTracks),R=h.filter(function(x){return x.groupId===u.groupId});if(a===-1)[].slice.call(h).forEach(function(x){x.mode="disabled"});else{var O=R[_];O&&(O.mode="disabled")}var g=R[a];g&&(g.mode=w?"showing":"hidden")},s.setSubtitleTrack=function(a,u){var f,w=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(f=w[a])!==null&&f!==void 0&&f.details)||a<-1||a>=w.length)return;this.clearTimer();var _=w[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,_){var h=_.id,R=_.groupId,O=R===void 0?"":R,g=_.name,x=_.type,E=_.url;this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:h,groupId:O,name:g,type:x,url:E});var T=this.switchParams(_.url,u==null?void 0:u.details);this.loadPlaylist(T)}else this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:a})},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,u=r(this.media.textTracks),f=0;f<u.length;f++)if(u[f].mode==="hidden")a=f;else if(u[f].mode==="showing"){a=f;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},p(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,u)}}]),o}(m.default);function r(i){for(var o=[],s=0;s<i.length;s++){var c=i[s];c.kind==="subtitles"&&c.label&&o.push(i[s])}return o}v.default=l},"./src/controller/timeline-controller.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"TimelineController",function(){return r});var k=C("./src/polyfills/number.ts"),y=C("./src/events.ts"),m=C("./src/utils/cea-608-parser.ts"),S=C("./src/utils/output-filter.ts"),b=C("./src/utils/webvtt-parser.ts"),p=C("./src/utils/texttrack-utils.ts"),d=C("./src/utils/imsc1-ttml-parser.ts"),t=C("./src/types/loader.ts"),l=C("./src/utils/logger.ts"),r=function(){function c(u){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=s(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var f=new S.default(this,"textTrack1"),w=new S.default(this,"textTrack2"),_=new S.default(this,"textTrack3"),h=new S.default(this,"textTrack4");this.cea608Parser1=new m.default(1,f,w),this.cea608Parser2=new m.default(3,_,h)}u.on(y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(y.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(y.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(y.Events.FRAG_LOADING,this.onFragLoading,this),u.on(y.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(y.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(y.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(y.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(y.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.on(y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=c.prototype;return a.destroy=function(){var f=this.hls;f.off(y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(y.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(y.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.off(y.Events.FRAG_LOADING,this.onFragLoading,this),f.off(y.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(y.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.off(y.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.off(y.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(y.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.off(y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(f,w,_,h,R){for(var O=!1,g=R.length;g--;){var x=R[g],E=o(x[0],x[1],w,_);if(E>=0&&(x[0]=Math.min(x[0],w),x[1]=Math.max(x[1],_),O=!0,E/(_-w)>.5))return}if(O||R.push([w,_]),this.config.renderTextTracksNatively){var T=this.captionsTracks[f];this.Cues.newCue(T,w,_,h)}else{var M=this.Cues.newCue(null,w,_,h);this.hls.trigger(y.Events.CUES_PARSED,{type:"captions",cues:M,track:f})}},a.onInitPtsFound=function(f,w){var _=this,h=w.frag,R=w.id,O=w.initPTS,g=w.timescale,x=this.unparsedVttFrags;R==="main"&&(this.initPTS[h.cc]=O,this.timescale[h.cc]=g),x.length&&(this.unparsedVttFrags=[],x.forEach(function(E){_.onFragLoaded(y.Events.FRAG_LOADED,E)}))},a.getExistingTrack=function(f){var w=this.media;if(w)for(var _=0;_<w.textTracks.length;_++){var h=w.textTracks[_];if(h[f])return h}return null},a.createCaptionsTrack=function(f){this.config.renderTextTracksNatively?this.createNativeTrack(f):this.createNonNativeTrack(f)},a.createNativeTrack=function(f){if(this.captionsTracks[f])return;var w=this.captionsProperties,_=this.captionsTracks,h=this.media,R=w[f],O=R.label,g=R.languageCode,x=this.getExistingTrack(f);if(x)_[f]=x,Object(p.clearCurrentCues)(_[f]),Object(p.sendAddTrackEvent)(_[f],h);else{var E=this.createTextTrack("captions",O,g);E&&(E[f]=!0,_[f]=E)}},a.createNonNativeTrack=function(f){if(this.nonNativeCaptionsTracks[f])return;var w=this.captionsProperties[f];if(!w)return;var _=w.label,h={_id:f,label:_,kind:"captions",default:w.media?!!w.media.default:!1,closedCaptions:w.media};this.nonNativeCaptionsTracks[f]=h,this.hls.trigger(y.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[h]})},a.createTextTrack=function(f,w,_){var h=this.media;return h?h.addTextTrack(f,w,_):void 0},a.onMediaAttaching=function(f,w){this.media=w.media,this._cleanTracks()},a.onMediaDetaching=function(){var f=this.captionsTracks;Object.keys(f).forEach(function(w){Object(p.clearCurrentCues)(f[w]),delete f[w]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),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())},a._cleanTracks=function(){var f=this.media;if(!f)return;var w=f.textTracks;if(w)for(var _=0;_<w.length;_++)Object(p.clearCurrentCues)(w[_])},a.onSubtitleTracksUpdated=function(f,w){var _=this;this.textTracks=[];var h=w.subtitleTracks||[],R=h.some(function(E){return E.textCodec===d.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var O=this.tracks&&h&&this.tracks.length===h.length;if(this.tracks=h||[],this.config.renderTextTracksNatively){var g=this.media?this.media.textTracks:[];this.tracks.forEach(function(E,T){var M;if(T<g.length){for(var L=null,A=0;A<g.length;A++)if(i(g[A],E)){L=g[A];break}L&&(M=L)}M?Object(p.clearCurrentCues)(M):(M=_.createTextTrack("subtitles",E.name,E.lang),M&&(M.mode="disabled")),M&&(M.groupId=E.groupId,_.textTracks.push(M))})}else if(!O&&this.tracks&&this.tracks.length){var x=this.tracks.map(function(E){return{label:E.name,kind:E.type.toLowerCase(),default:E.default,subtitleTrack:E}});this.hls.trigger(y.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:x})}}},a.onManifestLoaded=function(f,w){var _=this;this.config.enableCEA708Captions&&w.captions&&w.captions.forEach(function(h){var R=/(?:CC|SERVICE)([1-4])/.exec(h.instreamId);if(!R)return;var O="textTrack"+R[1],g=_.captionsProperties[O];if(!g)return;g.label=h.name,h.lang&&(g.languageCode=h.lang),g.media=h})},a.onFragLoading=function(f,w){var _=this.cea608Parser1,h=this.cea608Parser2,R=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(_&&h))return;if(w.frag.type===t.PlaylistLevelType.MAIN){var g,x,E=w.frag.sn,T=(g=w==null||((x=w.part)===null||x===void 0)?void 0:x.index)!=null?g:-1;E===R+1||E===R&&T===O+1||(_.reset(),h.reset()),this.lastSn=E,this.lastPartIndex=T}},a.onFragLoaded=function(f,w){var _=w.frag,h=w.payload,R=this.initPTS,O=this.unparsedVttFrags;if(_.type===t.PlaylistLevelType.SUBTITLE)if(h.byteLength){if(!Object(k.isFiniteNumber)(R[_.cc])){O.push(w),R.length&&this.hls.trigger(y.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Missing initial subtitle PTS")});return}var g=_.decryptdata;if(g==null||g.key==null||g.method!=="AES-128"){var x=this.tracks[_.level],E=this.vttCCs;E[_.cc]||(E[_.cc]={start:_.start,prevCC:this.prevCC,new:!0},this.prevCC=_.cc),x&&x.textCodec===d.IMSC1_CODEC?this._parseIMSC1(_,h):this._parseVTTs(_,h,E)}}else this.hls.trigger(y.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(f,w){var _=this,h=this.hls;Object(d.parseIMSC1)(w,this.initPTS[f.cc],this.timescale[f.cc],function(R){_._appendCues(R,f.level),h.trigger(y.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(R){l.logger.log("Failed to parse IMSC1: "+R),h.trigger(y.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:R})})},a._parseVTTs=function(f,w,_){var h=this,R=this.hls;Object(b.parseWebVTT)(w,this.initPTS[f.cc],this.timescale[f.cc],_,f.cc,f.start,function(O){h._appendCues(O,f.level),R.trigger(y.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(O){h._fallbackToIMSC1(f,w),l.logger.log("Failed to parse VTT cue: "+O),R.trigger(y.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:O})})},a._fallbackToIMSC1=function(f,w){var _=this,h=this.tracks[f.level];h.textCodec||Object(d.parseIMSC1)(w,this.initPTS[f.cc],this.timescale[f.cc],function(){h.textCodec=d.IMSC1_CODEC,_._parseIMSC1(f,w)},function(){h.textCodec="wvtt"})},a._appendCues=function(f,w){var _=this.hls;if(this.config.renderTextTracksNatively){var h=this.textTracks[w];if(h.mode==="disabled")return;f.forEach(function(g){return Object(p.addCueToTrack)(h,g)})}else{var R=this.tracks[w],O=R.default?"default":"subtitles"+w;_.trigger(y.Events.CUES_PARSED,{type:"subtitles",cues:f,track:O})}},a.onFragDecrypted=function(f,w){var _=w.frag;if(_.type===t.PlaylistLevelType.SUBTITLE){if(!Object(k.isFiniteNumber)(this.initPTS[_.cc])){this.unparsedVttFrags.push(w);return}this.onFragLoaded(y.Events.FRAG_LOADED,w)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(f,w){var _=this.cea608Parser1,h=this.cea608Parser2;if(!this.enabled||!(_&&h))return;for(var R=0;R<w.samples.length;R++){var O=w.samples[R].bytes;if(O){var g=this.extractCea608Data(O);_.addData(w.samples[R].pts,g[0]),h.addData(w.samples[R].pts,g[1])}}},a.onBufferFlushing=function(f,w){var _=w.startOffset,h=w.endOffset,R=w.endOffsetSubtitles,O=w.type,g=this.media;if(!g||g.currentTime<h)return;if(!O||O==="video"){var x=this.captionsTracks;Object.keys(x).forEach(function(T){return Object(p.removeCuesInRange)(x[T],_,h)})}if(this.config.renderTextTracksNatively&&(_===0&&R!==void 0)){var E=this.textTracks;Object.keys(E).forEach(function(T){return Object(p.removeCuesInRange)(E[T],_,R)})}},a.extractCea608Data=function(f){for(var w=f[0]&31,_=2,h=[[],[]],R=0;R<w;R++){var O=f[_++],g=127&f[_++],x=127&f[_++],E=(4&O)!==0,T=3&O;if(g===0&&x===0)continue;E&&((T===0||T===1)&&(h[T].push(g),h[T].push(x)))}return h},c}();function i(c,a){return c&&c.label===a.name&&!(c.textTrack1||c.textTrack2)}function o(c,a,u,f){return Math.min(a,f)-Math.max(c,u)}function s(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return k});var k=function(){function y(S,b){this.subtle=void 0,this.aesIV=void 0,this.subtle=S,this.aesIV=b}var m=y.prototype;return m.decrypt=function(b,p){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},p,b)},y}()},"./src/crypt/aes-decryptor.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"removePadding",function(){return y}),C.d(v,"default",function(){return m});var k=C("./src/utils/typed-array.ts");function y(S){var b=S.byteLength,p=b&&new DataView(S.buffer).getUint8(b-1);return p?Object(k.sliceUint8)(S,0,b-p):S}var m=function(){function S(){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 b=S.prototype;return b.uint8ArrayToUint32Array_=function(d){for(var t=new DataView(d),l=new Uint32Array(4),r=0;r<4;r++)l[r]=t.getUint32(r*4);return l},b.initTable=function(){var d=this.sBox,t=this.invSBox,l=this.subMix,r=l[0],i=l[1],o=l[2],s=l[3],c=this.invSubMix,a=c[0],u=c[1],f=c[2],w=c[3],_=new Uint32Array(256),h=0,R=0,O=0;for(O=0;O<256;O++)O<128?_[O]=O<<1:_[O]=O<<1^283;for(O=0;O<256;O++){var g=R^R<<1^R<<2^R<<3^R<<4;g=g>>>8^g&255^99,d[h]=g,t[g]=h;var x=_[h],E=_[x],T=_[E],M=_[g]*257^g*16843008;r[h]=M<<24|M>>>8,i[h]=M<<16|M>>>16,o[h]=M<<8|M>>>24,s[h]=M,M=T*16843009^E*65537^x*257^h*16843008,a[g]=M<<24|M>>>8,u[g]=M<<16|M>>>16,f[g]=M<<8|M>>>24,w[g]=M,h?(h=x^_[_[_[T^x]]],R^=_[_[R]]):h=R=1}},b.expandKey=function(d){for(var t=this.uint8ArrayToUint32Array_(d),l=!0,r=0;r<t.length&&l;)l=t[r]===this.key[r],r++;if(l)return;this.key=t;var i=this.keySize=t.length;if(i!==4&&i!==6&&i!==8)throw new Error("Invalid aes key size="+i);var o=this.ksRows=(i+6+1)*4,s,c,a=this.keySchedule=new Uint32Array(o),u=this.invKeySchedule=new Uint32Array(o),f=this.sBox,w=this.rcon,_=this.invSubMix,h=_[0],R=_[1],O=_[2],g=_[3],x,E;for(s=0;s<o;s++){if(s<i){x=a[s]=t[s];continue}E=x,s%i===0?(E=E<<8|E>>>24,E=f[E>>>24]<<24|f[E>>>16&255]<<16|f[E>>>8&255]<<8|f[E&255],E^=w[s/i|0]<<24):i>6&&s%i===4&&(E=f[E>>>24]<<24|f[E>>>16&255]<<16|f[E>>>8&255]<<8|f[E&255]),a[s]=x=(a[s-i]^E)>>>0}for(c=0;c<o;c++)s=o-c,c&3?E=a[s]:E=a[s-4],c<4||s<=4?u[c]=E:u[c]=h[f[E>>>24]]^R[f[E>>>16&255]]^O[f[E>>>8&255]]^g[f[E&255]],u[c]=u[c]>>>0},b.networkToHostOrderSwap=function(d){return d<<24|(d&65280)<<8|(d&16711680)>>8|d>>>24},b.decrypt=function(d,t,l){for(var r=this.keySize+6,i=this.invKeySchedule,o=this.invSBox,s=this.invSubMix,c=s[0],a=s[1],u=s[2],f=s[3],w=this.uint8ArrayToUint32Array_(l),_=w[0],h=w[1],R=w[2],O=w[3],g=new Int32Array(d),x=new Int32Array(g.length),E,T,M,L,A,V,z,W,G,U,P,H,$,re,te=this.networkToHostOrderSwap;t<g.length;){for(G=te(g[t]),U=te(g[t+1]),P=te(g[t+2]),H=te(g[t+3]),A=G^i[0],V=H^i[1],z=P^i[2],W=U^i[3],$=4,re=1;re<r;re++)E=c[A>>>24]^a[V>>16&255]^u[z>>8&255]^f[W&255]^i[$],T=c[V>>>24]^a[z>>16&255]^u[W>>8&255]^f[A&255]^i[$+1],M=c[z>>>24]^a[W>>16&255]^u[A>>8&255]^f[V&255]^i[$+2],L=c[W>>>24]^a[A>>16&255]^u[V>>8&255]^f[z&255]^i[$+3],A=E,V=T,z=M,W=L,$=$+4;E=o[A>>>24]<<24^o[V>>16&255]<<16^o[z>>8&255]<<8^o[W&255]^i[$],T=o[V>>>24]<<24^o[z>>16&255]<<16^o[W>>8&255]<<8^o[A&255]^i[$+1],M=o[z>>>24]<<24^o[W>>16&255]<<16^o[A>>8&255]<<8^o[V&255]^i[$+2],L=o[W>>>24]<<24^o[A>>16&255]<<16^o[V>>8&255]<<8^o[z&255]^i[$+3],x[t]=te(E^_),x[t+1]=te(L^h),x[t+2]=te(M^R),x[t+3]=te(T^O),_=G,h=U,R=P,O=H,t=t+4}return x.buffer},S}()},"./src/crypt/decrypter.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return t});var k=C("./src/crypt/aes-crypto.ts"),y=C("./src/crypt/fast-aes-key.ts"),m=C("./src/crypt/aes-decryptor.ts"),S=C("./src/utils/logger.ts"),b=C("./src/utils/mp4-tools.ts"),p=C("./src/utils/typed-array.ts"),d=16,t=function(){function l(i,o,s){var c=s===void 0?{}:s,a=c.removePKCS7Padding,u=a===void 0?!0:a;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=i,this.config=o,this.removePKCS7Padding=u,u)try{var f=self.crypto;f&&(this.subtle=f.subtle||f.webkitSubtle)}catch(w){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var r=l.prototype;return r.destroy=function(){this.observer=null},r.isSync=function(){return this.config.enableSoftwareAES},r.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var s=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(m.removePadding)(s):s},r.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},r.decrypt=function(o,s,c,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),s,c);var u=this.flush();u&&a(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),s,c).then(a)},r.softwareDecrypt=function(o,s,c){var a=this.currentIV,u=this.currentResult,f=this.remainderData;this.logOnce("JS AES decrypt"),f&&(o=Object(b.appendUint8Array)(f,o),this.remainderData=null);var w=this.getValidChunk(o);if(!w.length)return null;a&&(c=a);var _=this.softwareDecrypter;_||(_=this.softwareDecrypter=new m.default),_.expandKey(s);var h=u;return this.currentResult=_.decrypt(w.buffer,0,c),this.currentIV=Object(p.sliceUint8)(w,-16).buffer,h||null},r.webCryptoDecrypt=function(o,s,c){var a=this,u=this.subtle;return(this.key!==s||!this.fastAesKey)&&(this.key=s,this.fastAesKey=new y.default(u,s)),this.fastAesKey.expandKey().then(function(f){if(!u)return Promise.reject(new Error("web crypto not initialized"));var w=new k.default(u,c);return w.decrypt(o.buffer,f)}).catch(function(f){return a.onWebCryptoError(f,o,s,c)})},r.onWebCryptoError=function(o,s,c,a){return S.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,c,a)},r.getValidChunk=function(o){var s=o,c=o.length-o.length%d;return c!==o.length&&(s=Object(p.sliceUint8)(o,0,c),this.remainderData=Object(p.sliceUint8)(o,c)),s},r.logOnce=function(o){if(!this.logEnabled)return;S.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},l}()},"./src/crypt/fast-aes-key.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return k});var k=function(){function y(S,b){this.subtle=void 0,this.key=void 0,this.subtle=S,this.key=b}var m=y.prototype;return m.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},y}()},"./src/demux/aacdemuxer.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/demux/base-audio-demuxer.ts"),y=C("./src/demux/adts.ts"),m=C("./src/utils/logger.ts"),S=C("./src/demux/id3.ts");function b(t,l){t.prototype=Object.create(l.prototype),t.prototype.constructor=t,p(t,l)}function p(t,l){return p=Object.setPrototypeOf||function(i,o){return i.__proto__=o,i},p(t,l)}var d=function(t){b(l,t);function l(i,o){var s;return s=t.call(this)||this,s.observer=void 0,s.config=void 0,s.observer=i,s.config=o,s}var r=l.prototype;return r.resetInitSegment=function(o,s,c){t.prototype.resetInitSegment.call(this,o,s,c),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:c,inputTimeScale:9e4,dropped:0}},l.probe=function(o){if(!o)return!1;for(var s=S.getID3Data(o,0)||[],c=s.length,a=o.length;c<a;c++)if(y.probe(o,c))return m.logger.log("ADTS sync word found !"),!0;return!1},r.canParse=function(o,s){return y.canParse(o,s)},r.appendFrame=function(o,s,c){y.initTrackConfig(o,this.observer,s,c,o.manifestCodec);var a=y.appendFrame(o,s,c,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},l}(k.default);d.minProbeByteLength=9,v.default=d},"./src/demux/adts.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"getAudioConfig",function(){return S}),C.d(v,"isHeaderPattern",function(){return b}),C.d(v,"getHeaderLength",function(){return p}),C.d(v,"getFullFrameLength",function(){return d}),C.d(v,"canGetFrameLength",function(){return t}),C.d(v,"isHeader",function(){return l}),C.d(v,"canParse",function(){return r}),C.d(v,"probe",function(){return i}),C.d(v,"initTrackConfig",function(){return o}),C.d(v,"getFrameDuration",function(){return s}),C.d(v,"parseFrameHeader",function(){return c}),C.d(v,"appendFrame",function(){return a});var k=C("./src/utils/logger.ts"),y=C("./src/errors.ts"),m=C("./src/events.ts");function S(u,f,w,_){var h,R,O,g,x=navigator.userAgent.toLowerCase(),E=_,T=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];h=((f[w+2]&192)>>>6)+1;var M=(f[w+2]&60)>>>2;if(M>T.length-1){u.trigger(m.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+M});return}return O=(f[w+2]&1)<<2,O|=(f[w+3]&192)>>>6,k.logger.log("manifest codec:"+_+", ADTS type:"+h+", samplingIndex:"+M),/firefox/i.test(x)?M>=6?(h=5,g=new Array(4),R=M-3):(h=2,g=new Array(2),R=M):x.indexOf("android")!==-1?(h=2,g=new Array(2),R=M):(h=5,g=new Array(4),_&&(_.indexOf("mp4a.40.29")!==-1||_.indexOf("mp4a.40.5")!==-1)||!_&&M>=6?R=M-3:((_&&_.indexOf("mp4a.40.2")!==-1&&(M>=6&&O===1||/vivaldi/i.test(x))||!_&&O===1)&&(h=2,g=new Array(2)),R=M)),g[0]=h<<3,g[0]|=(M&14)>>1,g[1]|=(M&1)<<7,g[1]|=O<<3,h===5&&(g[1]|=(R&14)>>1,g[2]=(R&1)<<7,g[2]|=2<<2,g[3]=0),{config:g,samplerate:T[M],channelCount:O,codec:"mp4a.40."+h,manifestCodec:E}}function b(u,f){return u[f]===255&&(u[f+1]&246)===240}function p(u,f){return u[f+1]&1?7:9}function d(u,f){return(u[f+3]&3)<<11|u[f+4]<<3|(u[f+5]&224)>>>5}function t(u,f){return f+5<u.length}function l(u,f){return f+1<u.length&&b(u,f)}function r(u,f){return t(u,f)&&b(u,f)&&d(u,f)<=u.length-f}function i(u,f){if(l(u,f)){var w=p(u,f);if(f+w>=u.length)return!1;var _=d(u,f);if(_<=w)return!1;var h=f+_;return h===u.length||l(u,h)}return!1}function o(u,f,w,_,h){if(!u.samplerate){var R=S(f,w,_,h);if(!R)return;u.config=R.config,u.samplerate=R.samplerate,u.channelCount=R.channelCount,u.codec=R.codec,u.manifestCodec=R.manifestCodec,k.logger.log("parsed codec:"+u.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function s(u){return 1024*9e4/u}function c(u,f,w,_,h){var R=p(u,f),O=d(u,f);if(O-=R,O>0){var g=w+_*h;return{headerLength:R,frameLength:O,stamp:g}}}function a(u,f,w,_,h){var R=s(u.samplerate),O=c(f,w,_,h,R);if(O){var g=O.frameLength,x=O.headerLength,E=O.stamp,T=x+g,M=Math.max(0,w+T-f.length),L;M?(L=new Uint8Array(T-x),L.set(f.subarray(w+x,f.length),0)):L=f.subarray(w+x,w+T);var A={unit:L,pts:E};return M||u.samples.push(A),{sample:A,length:T,missing:M}}}},"./src/demux/base-audio-demuxer.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"initPTSFn",function(){return d});var k=C("./src/polyfills/number.ts"),y=C("./src/demux/id3.ts"),m=C("./src/demux/dummy-demuxed-track.ts"),S=C("./src/utils/mp4-tools.ts"),b=C("./src/utils/typed-array.ts"),p=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var l=t.prototype;return l.resetInitSegment=function(i,o,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},l.resetTimeStamp=function(){},l.resetContiguity=function(){},l.canParse=function(i,o){return!1},l.appendFrame=function(i,o,s){},l.demux=function(i,o){this.cachedData&&(i=Object(S.appendUint8Array)(this.cachedData,i),this.cachedData=null);var s=y.getID3Data(i,0),c=s?s.length:0,a,u,f=this._audioTrack,w=this._id3Track,_=s?y.getTimeStamp(s):void 0,h=i.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=d(_,o)),s&&s.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),u=this.initPTS;c<h;){if(this.canParse(i,c)){var R=this.appendFrame(f,i,c);R?(this.frameIndex++,u=R.sample.pts,c+=R.length,a=c):c=h}else y.canParse(i,c)?(s=y.getID3Data(i,c),w.samples.push({pts:u,dts:u,data:s}),c+=s.length,a=c):c++;if(c===h&&a!==h){var O=Object(b.sliceUint8)(i,a);this.cachedData?this.cachedData=Object(S.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:f,avcTrack:Object(m.dummyTrack)(),id3Track:w,textTrack:Object(m.dummyTrack)()}},l.demuxSampleAes=function(i,o,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},l.flush=function(i){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(m.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(m.dummyTrack)()}},l.destroy=function(){},t}(),d=function(l,r){return Object(k.isFiniteNumber)(l)?l*90:r*9e4};v.default=p},"./src/demux/chunk-cache.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return k});var k=function(){function m(){this.chunks=[],this.dataLength=0}var S=m.prototype;return S.push=function(p){this.chunks.push(p),this.dataLength+=p.length},S.flush=function(){var p=this.chunks,d=this.dataLength,t;if(p.length)p.length===1?t=p[0]:t=y(p,d);else return new Uint8Array(0);return this.reset(),t},S.reset=function(){this.chunks.length=0,this.dataLength=0},m}();function y(m,S){for(var b=new Uint8Array(S),p=0,d=0;d<m.length;d++){var t=m[d];b.set(t,p),p+=t.length}return b}},"./src/demux/dummy-demuxed-track.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"dummyTrack",function(){return k});function k(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/utils/logger.ts"),y=function(){function m(b){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=b,this.bytesAvailable=b.byteLength,this.word=0,this.bitsAvailable=0}var S=m.prototype;return S.loadWord=function(){var p=this.data,d=this.bytesAvailable,t=p.byteLength-d,l=new Uint8Array(4),r=Math.min(4,d);if(r===0)throw new Error("no bytes available");l.set(p.subarray(t,t+r)),this.word=new DataView(l.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r},S.skipBits=function(p){var d;this.bitsAvailable>p?(this.word<<=p,this.bitsAvailable-=p):(p-=this.bitsAvailable,d=p>>3,p-=d>>3,this.bytesAvailable-=d,this.loadWord(),this.word<<=p,this.bitsAvailable-=p)},S.readBits=function(p){var d=Math.min(this.bitsAvailable,p),t=this.word>>>32-d;return p>32&&k.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=d,this.bitsAvailable>0?this.word<<=d:this.bytesAvailable>0&&this.loadWord(),d=p-d,d>0&&this.bitsAvailable?t<<d|this.readBits(d):t},S.skipLZ=function(){var p;for(p=0;p<this.bitsAvailable;++p)if((this.word&2147483648>>>p)!==0)return this.word<<=p,this.bitsAvailable-=p,p;return this.loadWord(),p+this.skipLZ()},S.skipUEG=function(){this.skipBits(1+this.skipLZ())},S.skipEG=function(){this.skipBits(1+this.skipLZ())},S.readUEG=function(){var p=this.skipLZ();return this.readBits(p+1)-1},S.readEG=function(){var p=this.readUEG();return 1&p?1+p>>>1:-1*(p>>>1)},S.readBoolean=function(){return this.readBits(1)===1},S.readUByte=function(){return this.readBits(8)},S.readUShort=function(){return this.readBits(16)},S.readUInt=function(){return this.readBits(32)},S.skipScalingList=function(p){for(var d=8,t=8,l,r=0;r<p;r++)t!==0&&(l=this.readEG(),t=(d+l+256)%256),d=t===0?d:t},S.readSPS=function(){var p=0,d=0,t=0,l=0,r,i,o,s=this.readUByte.bind(this),c=this.readBits.bind(this),a=this.readUEG.bind(this),u=this.readBoolean.bind(this),f=this.skipBits.bind(this),w=this.skipEG.bind(this),_=this.skipUEG.bind(this),h=this.skipScalingList.bind(this);s();var R=s();if(c(5),f(3),s(),_(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var O=a();if(O===3&&f(1),_(),_(),f(1),u())for(i=O!==3?8:12,o=0;o<i;o++)u()&&(o<6?h(16):h(64))}_();var g=a();if(g===0)a();else if(g===1)for(f(1),w(),w(),r=a(),o=0;o<r;o++)w();_(),f(1);var x=a(),E=a(),T=c(1);T===0&&f(1),f(1),u()&&(p=a(),d=a(),t=a(),l=a());var M=[1,1];if(u()&&u()){var L=s();switch(L){case 1:M=[1,1];break;case 2:M=[12,11];break;case 3:M=[10,11];break;case 4:M=[16,11];break;case 5:M=[40,33];break;case 6:M=[24,11];break;case 7:M=[20,11];break;case 8:M=[32,11];break;case 9:M=[80,33];break;case 10:M=[18,11];break;case 11:M=[15,11];break;case 12:M=[64,33];break;case 13:M=[160,99];break;case 14:M=[4,3];break;case 15:M=[3,2];break;case 16:M=[2,1];break;case 255:{M=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((x+1)*16-p*2-d*2),height:(2-T)*(E+1)*16-(T?2:4)*(t+l),pixelRatio:M}},S.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},m}();v.default=y},"./src/demux/id3.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"isHeader",function(){return k}),C.d(v,"isFooter",function(){return y}),C.d(v,"getID3Data",function(){return m}),C.d(v,"canParse",function(){return b}),C.d(v,"getTimeStamp",function(){return p}),C.d(v,"isTimeStampFrame",function(){return d}),C.d(v,"getID3Frames",function(){return l}),C.d(v,"decodeFrame",function(){return r}),C.d(v,"utf8ArrayToStr",function(){return a}),C.d(v,"testables",function(){return u});var k=function(h,R){return R+10<=h.length&&(h[R]===73&&h[R+1]===68&&h[R+2]===51&&(h[R+3]<255&&h[R+4]<255&&(h[R+6]<128&&h[R+7]<128&&h[R+8]<128&&h[R+9]<128)))},y=function(h,R){return R+10<=h.length&&(h[R]===51&&h[R+1]===68&&h[R+2]===73&&(h[R+3]<255&&h[R+4]<255&&(h[R+6]<128&&h[R+7]<128&&h[R+8]<128&&h[R+9]<128)))},m=function(h,R){for(var O=R,g=0;k(h,R);){g+=10;var x=S(h,R+6);g+=x,y(h,R+10)&&(g+=10),R+=g}return g>0?h.subarray(O,O+g):void 0},S=function(h,R){var O=0;return O=(h[R]&127)<<21,O|=(h[R+1]&127)<<14,O|=(h[R+2]&127)<<7,O|=h[R+3]&127,O},b=function(h,R){return k(h,R)&&S(h,R+6)+10<=h.length-R},p=function(h){for(var R=l(h),O=0;O<R.length;O++){var g=R[O];if(d(g))return c(g)}return},d=function(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"},t=function(h){var R=String.fromCharCode(h[0],h[1],h[2],h[3]),O=S(h,4),g=10;return{type:R,size:O,data:h.subarray(g,g+O)}},l=function(h){for(var R=0,O=[];k(h,R);){var g=S(h,R+6);R+=10;for(var x=R+g;R+8<x;){var E=t(h.subarray(R)),T=r(E);T&&O.push(T),R+=E.size+10}y(h,R)&&(R+=10)}return O},r=function(h){return h.type==="PRIV"?i(h):h.type[0]==="W"?s(h):o(h)},i=function(h){if(h.size<2)return;var R=a(h.data,!0),O=new Uint8Array(h.data.subarray(R.length+1));return{key:h.type,info:R,data:O.buffer}},o=function(h){if(h.size<2)return;if(h.type==="TXXX"){var R=1,O=a(h.data.subarray(R),!0);R+=O.length+1;var g=a(h.data.subarray(R));return{key:h.type,info:O,data:g}}var x=a(h.data.subarray(1));return{key:h.type,data:x}},s=function(h){if(h.type==="WXXX"){if(h.size<2)return;var R=1,O=a(h.data.subarray(R),!0);R+=O.length+1;var g=a(h.data.subarray(R));return{key:h.type,info:O,data:g}}var x=a(h.data);return{key:h.type,data:x}},c=function(h){if(h.data.byteLength===8){var R=new Uint8Array(h.data),O=R[3]&1,g=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return g/=45,O&&(g+=4772185884e-2),Math.round(g)}return},a=function(h,R){R===void 0&&(R=!1);var O=w();if(O){var g=O.decode(h);if(R){var x=g.indexOf("\0");return x!==-1?g.substring(0,x):g}return g.replace(/\0/g,"")}for(var E=h.length,T,M,L,A="",V=0;V<E;){if(T=h[V++],T===0&&R)return A;if(T===0||T===3)continue;switch(T>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:A+=String.fromCharCode(T);break;case 12:case 13:M=h[V++],A+=String.fromCharCode((T&31)<<6|M&63);break;case 14:M=h[V++],L=h[V++],A+=String.fromCharCode((T&15)<<12|(M&63)<<6|(L&63)<<0);break;default:}}return A},u={decodeTextFrame:o},f;function w(){return!f&&typeof self.TextDecoder!="undefined"&&(f=new self.TextDecoder("utf-8")),f}},"./src/demux/mp3demuxer.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/demux/base-audio-demuxer.ts"),y=C("./src/demux/id3.ts"),m=C("./src/utils/logger.ts"),S=C("./src/demux/mpegaudio.ts");function b(t,l){t.prototype=Object.create(l.prototype),t.prototype.constructor=t,p(t,l)}function p(t,l){return p=Object.setPrototypeOf||function(i,o){return i.__proto__=o,i},p(t,l)}var d=function(t){b(l,t);function l(){return t.apply(this,arguments)||this}var r=l.prototype;return r.resetInitSegment=function(o,s,c){t.prototype.resetInitSegment.call(this,o,s,c),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:c,inputTimeScale:9e4,dropped:0}},l.probe=function(o){if(!o)return!1;for(var s=y.getID3Data(o,0)||[],c=s.length,a=o.length;c<a;c++)if(S.probe(o,c))return m.logger.log("MPEG Audio sync word found !"),!0;return!1},r.canParse=function(o,s){return S.canParse(o,s)},r.appendFrame=function(o,s,c){return this.initPTS===null?void 0:S.appendFrame(o,s,c,this.initPTS,this.frameIndex)},l}(k.default);d.minProbeByteLength=4,v.default=d},"./src/demux/mp4demuxer.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/utils/mp4-tools.ts"),y=C("./src/demux/dummy-demuxed-track.ts"),m=function(){function S(p,d){this.remainderData=null,this.config=void 0,this.config=d}var b=S.prototype;return b.resetTimeStamp=function(){},b.resetInitSegment=function(){},b.resetContiguity=function(){},S.probe=function(d){return Object(k.findBox)({data:d,start:0,end:Math.min(d.length,16384)},["moof"]).length>0},b.demux=function(d){var t=d,l=Object(y.dummyTrack)();if(this.config.progressive){this.remainderData&&(t=Object(k.appendUint8Array)(this.remainderData,d));var r=Object(k.segmentValidRange)(t);this.remainderData=r.remainder,l.samples=r.valid||new Uint8Array}else l.samples=t;return{audioTrack:Object(y.dummyTrack)(),avcTrack:l,id3Track:Object(y.dummyTrack)(),textTrack:Object(y.dummyTrack)()}},b.flush=function(){var d=Object(y.dummyTrack)();return d.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(y.dummyTrack)(),avcTrack:d,id3Track:Object(y.dummyTrack)(),textTrack:Object(y.dummyTrack)()}},b.demuxSampleAes=function(d,t,l){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},b.destroy=function(){},S}();m.minProbeByteLength=1024,v.default=m},"./src/demux/mpegaudio.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"appendFrame",function(){return p}),C.d(v,"parseHeader",function(){return d}),C.d(v,"isHeaderPattern",function(){return t}),C.d(v,"isHeader",function(){return l}),C.d(v,"canParse",function(){return r}),C.d(v,"probe",function(){return i});var k=null,y=[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],m=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],S=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],b=[0,1,1,4];function p(o,s,c,a,u){if(c+24>s.length)return;var f=d(s,c);if(f&&c+f.frameLength<=s.length){var w=f.samplesPerFrame*9e4/f.sampleRate,_=a+u*w,h={unit:s.subarray(c,c+f.frameLength),pts:_,dts:_};return o.config=[],o.channelCount=f.channelCount,o.samplerate=f.sampleRate,o.samples.push(h),{sample:h,length:f.frameLength,missing:0}}}function d(o,s){var c=o[s+1]>>3&3,a=o[s+1]>>1&3,u=o[s+2]>>4&15,f=o[s+2]>>2&3;if(c!==1&&u!==0&&u!==15&&f!==3){var w=o[s+2]>>1&1,_=o[s+3]>>6,h=c===3?3-a:a===3?3:4,R=y[h*14+u-1]*1e3,O=c===3?0:c===2?1:2,g=m[O*3+f],x=_===3?1:2,E=S[c][a],T=b[a],M=E*8*T,L=Math.floor(E*R/g+w)*T;if(k===null){var A=navigator.userAgent||"",V=A.match(/Chrome\/(\d+)/i);k=V?parseInt(V[1]):0}var z=!!k&&k<=87;return z&&a===2&&R>=224e3&&_===0&&(o[s+3]=o[s+3]|128),{sampleRate:g,channelCount:x,frameLength:L,samplesPerFrame:M}}}function t(o,s){return o[s]===255&&(o[s+1]&224)===224&&(o[s+1]&6)!==0}function l(o,s){return s+1<o.length&&t(o,s)}function r(o,s){var c=4;return t(o,s)&&c<=o.length-s}function i(o,s){if(s+1<o.length&&t(o,s)){var c=4,a=d(o,s),u=c;a!=null&&a.frameLength&&(u=a.frameLength);var f=s+u;return f===o.length||l(o,f)}return!1}},"./src/demux/sample-aes.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/crypt/decrypter.ts"),y=C("./src/demux/tsdemuxer.ts"),m=function(){function S(p,d,t){this.keyData=void 0,this.decrypter=void 0,this.keyData=t,this.decrypter=new k.default(p,d,{removePKCS7Padding:!1})}var b=S.prototype;return b.decryptBuffer=function(d,t){this.decrypter.decrypt(d,this.keyData.key.buffer,this.keyData.iv.buffer,t)},b.decryptAacSample=function(d,t,l,r){var i=d[t].unit,o=i.subarray(16,i.length-i.length%16),s=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),c=this;this.decryptBuffer(s,function(a){var u=new Uint8Array(a);i.set(u,16),r||c.decryptAacSamples(d,t+1,l)})},b.decryptAacSamples=function(d,t,l){for(;;t++){if(t>=d.length){l();return}if(d[t].unit.length<32)continue;var r=this.decrypter.isSync();if(this.decryptAacSample(d,t,l,r),!r)return}},b.getAvcEncryptedData=function(d){for(var t=Math.floor((d.length-48)/160)*16+16,l=new Int8Array(t),r=0,i=32;i<=d.length-16;i+=160,r+=16)l.set(d.subarray(i,i+16),r);return l},b.getAvcDecryptedUnit=function(d,t){for(var l=new Uint8Array(t),r=0,i=32;i<=d.length-16;i+=160,r+=16)d.set(l.subarray(r,r+16),i);return d},b.decryptAvcSample=function(d,t,l,r,i,o){var s=Object(y.discardEPB)(i.data),c=this.getAvcEncryptedData(s),a=this;this.decryptBuffer(c.buffer,function(u){i.data=a.getAvcDecryptedUnit(s,u),o||a.decryptAvcSamples(d,t,l+1,r)})},b.decryptAvcSamples=function(d,t,l,r){if(d instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,l=0){if(t>=d.length){r();return}for(var i=d[t].units;!(l>=i.length);l++){var o=i[l];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(d,t,l,r,o,s),!s)return}}},S}();v.default=m},"./src/demux/transmuxer-interface.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return i});var k=C("./node_modules/webworkify-webpack/index.js"),y=C.n(k),m=C("./src/events.ts"),S=C("./src/demux/transmuxer.ts"),b=C("./src/utils/logger.ts"),p=C("./src/errors.ts"),d=C("./src/utils/mediasource-helper.ts"),t=C("./node_modules/eventemitter3/index.js"),l=C.n(t),r=Object(d.getMediaSource)()||{isTypeSupported:function(){return!1}},i=function(){function o(c,a,u,f){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=c,this.id=a,this.onTransmuxComplete=u,this.onFlush=f;var _=c.config,h=function(E,T){T=T||{},T.frag=w.frag,T.id=w.id,c.trigger(E,T)};this.observer=new t.EventEmitter,this.observer.on(m.Events.FRAG_DECRYPTED,h),this.observer.on(m.Events.ERROR,h);var R={mp4:r.isTypeSupported("video/mp4"),mpeg:r.isTypeSupported("audio/mpeg"),mp3:r.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(_.enableWorker&&typeof Worker!="undefined"){b.logger.log("demuxing in webworker");var g;try{g=this.worker=k("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(x){c.trigger(m.Events.ERROR,{type:p.ErrorTypes.OTHER_ERROR,details:p.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(x.message+" ("+x.filename+":"+x.lineno+")")})},g.postMessage({cmd:"init",typeSupported:R,vendor:O,id:a,config:JSON.stringify(_)})}catch(x){b.logger.warn("Error in worker:",x),b.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new S.default(this.observer,R,_,O,a),this.worker=null}}else this.transmuxer=new S.default(this.observer,R,_,O,a)}var s=o.prototype;return s.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var f=this.observer;f&&f.removeAllListeners(),this.observer=null},s.push=function(a,u,f,w,_,h,R,O,g,x){var E=this;g.transmuxing.start=self.performance.now();var T=this.transmuxer,M=this.worker,L=h?h.start:_.start,A=_.decryptdata,V=this.frag,z=!(V&&_.cc===V.cc),W=!(V&&g.level===V.level),G=V?g.sn-V.sn:-1,U=this.part?g.part-this.part.index:1,P=!W&&(G===1||G===0&&U===1),H=self.performance.now();(W||G||_.stats.parsing.start===0)&&(_.stats.parsing.start=H),h&&(U||!P)&&(h.stats.parsing.start=H);var $=new S.TransmuxState(z,P,O,W,L);if(!P||z){b.logger.log("[transmuxer-interface, "+_.type+"]: Starting new transmux session for sn: "+g.sn+" p: "+g.part+" level: "+g.level+" id: "+g.id+`
|
|
|
discontinuity: `+z+`
|
|
|
trackSwitch: `+W+`
|
|
|
contiguous: `+P+`
|
|
|
accurateTimeOffset: `+O+`
|
|
|
timeOffset: `+L);var re=new S.TransmuxConfig(f,w,u,R,x);this.configureTransmuxer(re)}if(this.frag=_,this.part=h,M)M.postMessage({cmd:"demux",data:a,decryptdata:A,chunkMeta:g,state:$},a instanceof ArrayBuffer?[a]:[]);else if(T){var te=T.push(a,A,g,$);Object(S.isPromise)(te)?te.then(function(ge){E.handleTransmuxComplete(ge)}):this.handleTransmuxComplete(te)}},s.flush=function(a){var u=this;a.transmuxing.start=self.performance.now();var f=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:a});else if(f){var _=f.flush(a);Object(S.isPromise)(_)?_.then(function(h){u.handleFlushResult(h,a)}):this.handleFlushResult(_,a)}},s.handleFlushResult=function(a,u){var f=this;a.forEach(function(w){f.handleTransmuxComplete(w)}),this.onFlush(u)},s.onWorkerMessage=function(a){var u=a.data,f=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,f.trigger(u.event,u.data);break}}},s.configureTransmuxer=function(a){var u=this.worker,f=this.transmuxer;u?u.postMessage({cmd:"configure",config:a}):f&&f.configure(a)},s.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},o}()},"./src/demux/transmuxer-worker.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return p});var k=C("./src/demux/transmuxer.ts"),y=C("./src/events.ts"),m=C("./src/utils/logger.ts"),S=C("./node_modules/eventemitter3/index.js"),b=C.n(S);function p(i){var o=new S.EventEmitter,s=function(a,u){i.postMessage({event:a,data:u})};o.on(y.Events.FRAG_DECRYPTED,s),o.on(y.Events.ERROR,s),i.addEventListener("message",function(c){var a=c.data;switch(a.cmd){case"init":{var u=JSON.parse(a.config);i.transmuxer=new k.default(o,a.typeSupported,u,a.vendor,a.id),Object(m.enableLogs)(u.debug),s("init",null);break}case"configure":{i.transmuxer.configure(a.config);break}case"demux":{var f=i.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(k.isPromise)(f)?f.then(function(h){d(i,h)}):d(i,f);break}case"flush":{var w=a.chunkMeta,_=i.transmuxer.flush(w);Object(k.isPromise)(_)?_.then(function(h){l(i,h,w)}):l(i,_,w);break}default:break}})}function d(i,o){if(r(o.remuxResult))return;var s=[],c=o.remuxResult,a=c.audio,u=c.video;a&&t(s,a),u&&t(s,u),i.postMessage({event:"transmuxComplete",data:o},s)}function t(i,o){o.data1&&i.push(o.data1.buffer),o.data2&&i.push(o.data2.buffer)}function l(i,o,s){o.forEach(function(c){d(i,c)}),i.postMessage({event:"flush",data:s})}function r(i){return!i.audio&&!i.video&&!i.text&&!i.id3&&!i.initSegment}},"./src/demux/transmuxer.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return u}),C.d(v,"isPromise",function(){return _}),C.d(v,"TransmuxConfig",function(){return h}),C.d(v,"TransmuxState",function(){return R});var k=C("./src/events.ts"),y=C("./src/errors.ts"),m=C("./src/crypt/decrypter.ts"),S=C("./src/demux/aacdemuxer.ts"),b=C("./src/demux/mp4demuxer.ts"),p=C("./src/demux/tsdemuxer.ts"),d=C("./src/demux/mp3demuxer.ts"),t=C("./src/remux/mp4-remuxer.ts"),l=C("./src/remux/passthrough-remuxer.ts"),r=C("./src/demux/chunk-cache.ts"),i=C("./src/utils/mp4-tools.ts"),o=C("./src/utils/logger.ts"),s;try{s=self.performance.now.bind(self.performance)}catch(O){o.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var c=[{demux:p.default,remux:t.default},{demux:b.default,remux:l.default},{demux:S.default,remux:t.default},{demux:d.default,remux:t.default}],a=1024;c.forEach(function(O){var g=O.demux;a=Math.max(a,g.minProbeByteLength)});var u=function(){function O(x,E,T,M,L){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 r.default,this.observer=x,this.typeSupported=E,this.config=T,this.vendor=M,this.id=L}var g=O.prototype;return g.configure=function(E){this.transmuxConfig=E,this.decrypter&&this.decrypter.reset()},g.push=function(E,T,M,L){var A=this,V=M.transmuxing;V.executeStart=s();var z=new Uint8Array(E),W=this.cache,G=this.config,U=this.currentTransmuxState,P=this.transmuxConfig;L&&(this.currentTransmuxState=L);var H=f(z,T);if(H&&H.method==="AES-128"){var $=this.getDecrypter();if(G.enableSoftwareAES){var re=$.softwareDecrypt(z,H.key.buffer,H.iv.buffer);if(!re)return V.executeEnd=s(),w(M);z=new Uint8Array(re)}else return this.decryptionPromise=$.webCryptoDecrypt(z,H.key.buffer,H.iv.buffer).then(function(q){var Y=A.push(q,null,M);return A.decryptionPromise=null,Y}),this.decryptionPromise}var te=L||U,ge=te.contiguous,ve=te.discontinuity,de=te.trackSwitch,De=te.accurateTimeOffset,Te=te.timeOffset,he=P.audioCodec,ue=P.videoCodec,ie=P.defaultInitPts,Se=P.duration,ne=P.initSegmentData;if((ve||de)&&this.resetInitSegment(ne,he,ue,Se),ve&&this.resetInitialTimestamp(ie),ge||this.resetContiguity(),this.needsProbing(z,ve,de)){if(W.dataLength){var ce=W.flush();z=Object(i.appendUint8Array)(ce,z)}this.configureTransmuxer(z,P)}var Oe=this.transmux(z,H,Te,De,M),oe=this.currentTransmuxState;return oe.contiguous=!0,oe.discontinuity=!1,oe.trackSwitch=!1,V.executeEnd=s(),Oe},g.flush=function(E){var T=this,M=E.transmuxing;M.executeStart=s();var L=this.decrypter,A=this.cache,V=this.currentTransmuxState,z=this.decryptionPromise;if(z)return z.then(function(){return T.flush(E)});var W=[],G=V.timeOffset;if(L){var U=L.flush();U&&W.push(this.push(U,null,E))}var P=A.dataLength;A.reset();var H=this.demuxer,$=this.remuxer;if(!H||!$)return P>=a&&this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),M.executeEnd=s(),[w(E)];var re=H.flush(G);return _(re)?re.then(function(te){return T.flushRemux(W,te,E),W}):(this.flushRemux(W,re,E),W)},g.flushRemux=function(E,T,M){var L=T.audioTrack,A=T.avcTrack,V=T.id3Track,z=T.textTrack,W=this.currentTransmuxState,G=W.accurateTimeOffset,U=W.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+M.sn+(M.part>-1?" p: "+M.part:"")+" of level "+M.level);var P=this.remuxer.remux(L,A,V,z,U,G,!0,this.id);E.push({remuxResult:P,chunkMeta:M}),M.transmuxing.executeEnd=s()},g.resetInitialTimestamp=function(E){var T=this.demuxer,M=this.remuxer;if(!T||!M)return;T.resetTimeStamp(E),M.resetTimeStamp(E)},g.resetContiguity=function(){var E=this.demuxer,T=this.remuxer;if(!E||!T)return;E.resetContiguity(),T.resetNextTimestamp()},g.resetInitSegment=function(E,T,M,L){var A=this.demuxer,V=this.remuxer;if(!A||!V)return;A.resetInitSegment(T,M,L),V.resetInitSegment(E,T,M)},g.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},g.transmux=function(E,T,M,L,A){var V;return T&&T.method==="SAMPLE-AES"?V=this.transmuxSampleAes(E,T,M,L,A):V=this.transmuxUnencrypted(E,M,L,A),V},g.transmuxUnencrypted=function(E,T,M,L){var A=this.demuxer.demux(E,T,!1,!this.config.progressive),V=A.audioTrack,z=A.avcTrack,W=A.id3Track,G=A.textTrack,U=this.remuxer.remux(V,z,W,G,T,M,!1,this.id);return{remuxResult:U,chunkMeta:L}},g.transmuxSampleAes=function(E,T,M,L,A){var V=this;return this.demuxer.demuxSampleAes(E,T,M).then(function(z){var W=V.remuxer.remux(z.audioTrack,z.avcTrack,z.id3Track,z.textTrack,M,L,!1,V.id);return{remuxResult:W,chunkMeta:A}})},g.configureTransmuxer=function(E,T){for(var M=this.config,L=this.observer,A=this.typeSupported,V=this.vendor,z=T.audioCodec,W=T.defaultInitPts,G=T.duration,U=T.initSegmentData,P=T.videoCodec,H,$=0,re=c.length;$<re;$++)if(c[$].demux.probe(E)){H=c[$];break}H||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:b.default,remux:l.default});var te=this.demuxer,ge=this.remuxer,ve=H.remux,de=H.demux;(!ge||!(ge instanceof ve))&&(this.remuxer=new ve(L,M,A,V)),(!te||!(te instanceof de))&&(this.demuxer=new de(L,M,A),this.probe=de.probe),this.resetInitSegment(U,z,P,G),this.resetInitialTimestamp(W)},g.needsProbing=function(E,T,M){return!this.demuxer||!this.remuxer||T||M},g.getDecrypter=function(){var E=this.decrypter;return E||(E=this.decrypter=new m.default(this.observer,this.config)),E},O}();function f(O,g){var x=null;return O.byteLength>0&&g!=null&&g.key!=null&&g.iv!==null&&g.method!=null&&(x=g),x}var w=function(g){return{remuxResult:{},chunkMeta:g}};function _(O){return"then"in O&&O.then instanceof Function}var h=function(g,x,E,T,M){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=g,this.videoCodec=x,this.initSegmentData=E,this.duration=T,this.defaultInitPts=M},R=function(g,x,E,T,M){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=g,this.contiguous=x,this.accurateTimeOffset=E,this.trackSwitch=T,this.timeOffset=M}},"./src/demux/tsdemuxer.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"discardEPB",function(){return w});var k=C("./src/demux/adts.ts"),y=C("./src/demux/mpegaudio.ts"),m=C("./src/demux/exp-golomb.ts"),S=C("./src/demux/id3.ts"),b=C("./src/demux/sample-aes.ts"),p=C("./src/events.ts"),d=C("./src/utils/mp4-tools.ts"),t=C("./src/utils/logger.ts"),l=C("./src/errors.ts"),r={video:1,audio:2,id3:3,text:4},i=function(){function _(R,O,g){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=O,this.typeSupported=g}_.probe=function(O){var g=_.syncOffset(O);return g<0?!1:(g&&t.logger.warn("MPEG2-TS detected but first sync word found @ offset "+g+", junk ahead ?"),!0)},_.syncOffset=function(O){for(var g=Math.min(1e3,O.length-3*188),x=0;x<g;){if(O[x]===71&&O[x+188]===71&&O[x+2*188]===71)return x;x++}return-1},_.createTrack=function(O,g){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:r[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?g:void 0}};var h=_.prototype;return h.resetInitSegment=function(O,g,x){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=_.createTrack("video",x),this._audioTrack=_.createTrack("audio",x),this._id3Track=_.createTrack("id3",x),this._txtTrack=_.createTrack("text",x),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=g,this._duration=x},h.resetTimeStamp=function(){},h.resetContiguity=function(){var O=this._audioTrack,g=this._avcTrack,x=this._id3Track;O&&(O.pesData=null),g&&(g.pesData=null),x&&(x.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},h.demux=function(O,g,x,E){x===void 0&&(x=!1),E===void 0&&(E=!1),x||(this.sampleAes=null);var T,M=this._avcTrack,L=this._audioTrack,A=this._id3Track,V=M.pid,z=M.pesData,W=L.pid,G=A.pid,U=L.pesData,P=A.pesData,H=!1,$=this.pmtParsed,re=this._pmtId,te=O.length;if(this.remainderData&&(O=Object(d.appendUint8Array)(this.remainderData,O),te=O.length,this.remainderData=null),te<188&&!E)return this.remainderData=O,{audioTrack:L,avcTrack:M,id3Track:A,textTrack:this._txtTrack};var ge=Math.max(0,_.syncOffset(O));te-=(te+ge)%188,te<O.byteLength&&!E&&(this.remainderData=new Uint8Array(O.buffer,te,O.buffer.byteLength-te));for(var ve=ge;ve<te;ve+=188)if(O[ve]===71){var de=!!(O[ve+1]&64),De=((O[ve+1]&31)<<8)+O[ve+2],Te=(O[ve+3]&48)>>4,he=void 0;if(Te>1){if(he=ve+5+O[ve+4],he===ve+188)continue}else he=ve+4;switch(De){case V:de&&(z&&(T=a(z))&&this.parseAVCPES(T,!1),z={data:[],size:0}),z&&(z.data.push(O.subarray(he,ve+188)),z.size+=ve+188-he);break;case W:de&&(U&&(T=a(U))&&(L.isAAC?this.parseAACPES(T):this.parseMPEGPES(T)),U={data:[],size:0}),U&&(U.data.push(O.subarray(he,ve+188)),U.size+=ve+188-he);break;case G:de&&(P&&(T=a(P))&&this.parseID3PES(T),P={data:[],size:0}),P&&(P.data.push(O.subarray(he,ve+188)),P.size+=ve+188-he);break;case 0:de&&(he+=O[he]+1),re=this._pmtId=s(O,he);break;case re:{de&&(he+=O[he]+1);var ue=c(O,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,x);V=ue.avc,V>0&&(M.pid=V),W=ue.audio,W>0&&(L.pid=W,L.isAAC=ue.isAAC),G=ue.id3,G>0&&(A.pid=G),H&&!$&&(t.logger.log("reparse from beginning"),H=!1,ve=ge-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(p.Events.ERROR,p.Events.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});M.pesData=z,L.pesData=U,A.pesData=P;var ie={audioTrack:L,avcTrack:M,id3Track:A,textTrack:this._txtTrack};return E&&this.extractRemainingSamples(ie),ie},h.flush=function(){var O=this.remainderData;this.remainderData=null;var g;return O?g=this.demux(O,-1,!1,!0):g={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(g),this.sampleAes?this.decrypt(g,this.sampleAes):g},h.extractRemainingSamples=function(O){var g=O.audioTrack,x=O.avcTrack,E=O.id3Track,T=x.pesData,M=g.pesData,L=E.pesData,A;T&&(A=a(T))?(this.parseAVCPES(A,!0),x.pesData=null):x.pesData=T,M&&(A=a(M))?(g.isAAC?this.parseAACPES(A):this.parseMPEGPES(A),g.pesData=null):(M!=null&&M.size&&t.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=M),L&&(A=a(L))?(this.parseID3PES(A),E.pesData=null):E.pesData=L},h.demuxSampleAes=function(O,g,x){var E=this.demux(O,x,!0,!this.config.progressive),T=this.sampleAes=new b.default(this.observer,this.config,g);return this.decrypt(E,T)},h.decrypt=function(O,g){return new Promise(function(x){var E=O.audioTrack,T=O.avcTrack;E.samples&&E.isAAC?g.decryptAacSamples(E.samples,0,function(){T.samples?g.decryptAvcSamples(T.samples,0,0,function(){x(O)}):x(O)}):T.samples&&g.decryptAvcSamples(T.samples,0,0,function(){x(O)})})},h.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},h.parseAVCPES=function(O,g){var x=this,E=this._avcTrack,T=this.parseAVCNALu(O.data),M=!1,L=this.avcSample,A,V=!1;O.data=null,L&&T.length&&!E.audFound&&(u(L,E),L=this.avcSample=o(!1,O.pts,O.dts,"")),T.forEach(function(z){switch(z.type){case 1:{A=!0,L||(L=x.avcSample=o(!0,O.pts,O.dts,"")),M&&(L.debug+="NDR "),L.frame=!0;var W=z.data;if(V&&W.length>4){var G=new m.default(W).readSliceType();(G===2||G===4||G===7||G===9)&&(L.key=!0)}break}case 5:A=!0,L||(L=x.avcSample=o(!0,O.pts,O.dts,"")),M&&(L.debug+="IDR "),L.key=!0,L.frame=!0;break;case 6:{A=!0,M&&L&&(L.debug+="SEI ");var U=new m.default(w(z.data));U.readUByte();for(var P=0,H=0,$=!1,re=0;!$&&U.bytesAvailable>1;){P=0;do re=U.readUByte(),P+=re;while(re===255);H=0;do re=U.readUByte(),H+=re;while(re===255);if(P===4&&U.bytesAvailable!==0){$=!0;var te=U.readUByte();if(te===181){var ge=U.readUShort();if(ge===49){var ve=U.readUInt();if(ve===1195456820){var de=U.readUByte();if(de===3){for(var De=U.readUByte(),Te=U.readUByte(),he=31&De,ue=[De,Te],ie=0;ie<he;ie++)ue.push(U.readUByte()),ue.push(U.readUByte()),ue.push(U.readUByte());f(x._txtTrack.samples,{type:3,pts:O.pts,bytes:ue})}}}}}else if(P===5&&U.bytesAvailable!==0){if($=!0,H>16){for(var Se=[],ne=0;ne<16;ne++)Se.push(U.readUByte().toString(16)),(ne===3||ne===5||ne===7||ne===9)&&Se.push("-");for(var ce=H-16,Oe=new Uint8Array(ce),oe=0;oe<ce;oe++)Oe[oe]=U.readUByte();f(x._txtTrack.samples,{pts:O.pts,payloadType:P,uuid:Se.join(""),userData:Object(S.utf8ArrayToStr)(Oe),userDataBytes:Oe})}}else if(H<U.bytesAvailable)for(var q=0;q<H;q++)U.readUByte()}break}case 7:if(A=!0,V=!0,M&&L&&(L.debug+="SPS "),!E.sps){var Y=new m.default(z.data),Z=Y.readSPS();E.width=Z.width,E.height=Z.height,E.pixelRatio=Z.pixelRatio,E.sps=[z.data],E.duration=x._duration;for(var ye=z.data.subarray(1,4),be="avc1.",Re=0;Re<3;Re++){var Qe=ye[Re].toString(16);Qe.length<2&&(Qe="0"+Qe),be+=Qe}E.codec=be}break;case 8:A=!0,M&&L&&(L.debug+="PPS "),E.pps||(E.pps=[z.data]);break;case 9:A=!1,E.audFound=!0,L&&u(L,E),L=x.avcSample=o(!1,O.pts,O.dts,M?"AUD ":"");break;case 12:A=!1;break;default:A=!1,L&&(L.debug+="unknown NAL "+z.type+" ");break}if(L&&A){var rt=L.units;rt.push(z)}}),g&&L&&(u(L,E),this.avcSample=null)},h.getLastNalUnit=function(){var O,g=this.avcSample,x;if(!g||g.units.length===0){var E=this._avcTrack.samples;g=E[E.length-1]}if((O=g)!==null&&O!==void 0&&O.units){var T=g.units;x=T[T.length-1]}return x},h.parseAVCNALu=function(O){var g=O.byteLength,x=this._avcTrack,E=x.naluState||0,T=E,M=[],L=0,A,V,z,W=-1,G=0;for(E===-1&&(W=0,G=O[0]&31,E=0,L=1);L<g;){if(A=O[L++],!E){E=A?0:1;continue}if(E===1){E=A?0:2;continue}if(!A)E=3;else if(A===1){if(W>=0){var U={data:O.subarray(W,L-E-1),type:G};M.push(U)}else{var P=this.getLastNalUnit();if(P&&(T&&L<=4-T&&(P.state&&(P.data=P.data.subarray(0,P.data.byteLength-T))),V=L-E-1,V>0)){var H=new Uint8Array(P.data.byteLength+V);H.set(P.data,0),H.set(O.subarray(0,V),P.data.byteLength),P.data=H,P.state=0}}L<g?(z=O[L]&31,W=L,G=z,E=0):E=-1}else E=0}if(W>=0&&E>=0){var $={data:O.subarray(W,g),type:G,state:E};M.push($)}if(M.length===0){var re=this.getLastNalUnit();if(re){var te=new Uint8Array(re.data.byteLength+O.byteLength);te.set(re.data,0),te.set(O,re.data.byteLength),re.data=te}}return x.naluState=E,M},h.parseAACPES=function(O){var g=0,x=this._audioTrack,E=this.aacOverFlow,T=O.data;if(E){this.aacOverFlow=null;var M=E.sample.unit.byteLength,L=Math.min(E.missing,M),A=M-L;E.sample.unit.set(T.subarray(0,L),A),x.samples.push(E.sample),g=E.missing}var V,z;for(V=g,z=T.length;V<z-1&&!k.isHeader(T,V);V++);if(V!==g){var W,G;if(V<z-1?(W="AAC PES did not start with ADTS header,offset:"+V,G=!1):(W="no ADTS header found in AAC PES",G=!0),t.logger.warn("parsing error:"+W),this.observer.emit(p.Events.ERROR,p.Events.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:W}),G)return}k.initTrackConfig(x,this.observer,T,V,this.audioCodec);var U;if(O.pts!==void 0)U=O.pts;else if(E){var P=k.getFrameDuration(x.samplerate);U=E.sample.pts+P}else{t.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;V<z;)if(k.isHeader(T,V)){if(V+5<z){var $=k.appendFrame(x,T,V,U,H);if($)if($.missing)this.aacOverFlow=$;else{V+=$.length,H++;continue}}break}else V++},h.parseMPEGPES=function(O){var g=O.data,x=g.length,E=0,T=0,M=O.pts;if(M===void 0){t.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;T<x;)if(y.isHeader(g,T)){var L=y.appendFrame(this._audioTrack,g,T,M,E);if(L)T+=L.length,E++;else break}else T++},h.parseID3PES=function(O){if(O.pts===void 0){t.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},_}();i.minProbeByteLength=188;function o(_,h,R,O){return{key:_,frame:!1,pts:h,dts:R,units:[],debug:O,length:0}}function s(_,h){return(_[h+10]&31)<<8|_[h+11]}function c(_,h,R,O){var g={audio:-1,avc:-1,id3:-1,isAAC:!0},x=(_[h+1]&15)<<8|_[h+2],E=h+3+x-4,T=(_[h+10]&15)<<8|_[h+11];for(h+=12+T;h<E;){var M=(_[h+1]&31)<<8|_[h+2];switch(_[h]){case 207:if(!O){t.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:g.audio===-1&&(g.audio=M);break;case 21:g.id3===-1&&(g.id3=M);break;case 219:if(!O){t.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:g.avc===-1&&(g.avc=M);break;case 3:case 4:R?g.audio===-1&&(g.audio=M,g.isAAC=!1):t.logger.log("MPEG audio found, not supported in this browser");break;case 36:t.logger.warn("Unsupported HEVC stream type found");break;default:break}h+=((_[h+3]&15)<<8|_[h+4])+5}return g}function a(_){var h=0,R,O,g,x,E,T=_.data;if(!_||_.size===0)return null;for(;T[0].length<19&&T.length>1;){var M=new Uint8Array(T[0].length+T[1].length);M.set(T[0]),M.set(T[1],T[0].length),T[0]=M,T.splice(1,1)}R=T[0];var L=(R[0]<<16)+(R[1]<<8)+R[2];if(L===1){if(O=(R[4]<<8)+R[5],O&&O>_.size-6)return null;var A=R[7];A&192&&(x=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,A&64?(E=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,x-E>60*9e4&&(t.logger.warn(Math.round((x-E)/9e4)+"s delta between PTS and DTS, align them"),x=E)):E=x),g=R[8];var V=g+9;if(_.size<=V)return null;_.size-=V;for(var z=new Uint8Array(_.size),W=0,G=T.length;W<G;W++){R=T[W];var U=R.byteLength;if(V)if(V>U){V-=U;continue}else R=R.subarray(V),U-=V,V=0;z.set(R,h),h+=U}return O&&(O-=g+3),{data:z,pts:x,dts:E,len:O}}return null}function u(_,h){if(_.units.length&&_.frame){if(_.pts===void 0){var R=h.samples,O=R.length;if(O){var g=R[O-1];_.pts=g.pts,_.dts=g.dts}else{h.dropped++;return}}h.samples.push(_)}_.debug.length&&t.logger.log(_.pts+"/"+_.dts+":"+_.debug)}function f(_,h){var R=_.length;if(R>0){if(h.pts>=_[R-1].pts)_.push(h);else for(var O=R-1;O>=0;O--)if(h.pts<_[O].pts){_.splice(O,0,h);break}}else _.push(h)}function w(_){for(var h=_.byteLength,R=[],O=1;O<h-2;)_[O]===0&&_[O+1]===0&&_[O+2]===3?(R.push(O+2),O+=2):O++;if(R.length===0)return _;var g=h-R.length,x=new Uint8Array(g),E=0;for(O=0;O<g;E++,O++)E===R[0]&&(E++,R.shift()),x[O]=_[E];return x}v.default=i},"./src/errors.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"ErrorTypes",function(){return k}),C.d(v,"ErrorDetails",function(){return y});var k;(function(m){m.NETWORK_ERROR="networkError",m.MEDIA_ERROR="mediaError",m.KEY_SYSTEM_ERROR="keySystemError",m.MUX_ERROR="muxError",m.OTHER_ERROR="otherError"})(k||(k={}));var y;(function(m){m.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",m.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",m.KEY_SYSTEM_NO_SESSION="keySystemNoSession",m.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",m.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",m.MANIFEST_LOAD_ERROR="manifestLoadError",m.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",m.MANIFEST_PARSING_ERROR="manifestParsingError",m.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",m.LEVEL_EMPTY_ERROR="levelEmptyError",m.LEVEL_LOAD_ERROR="levelLoadError",m.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",m.LEVEL_SWITCH_ERROR="levelSwitchError",m.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",m.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",m.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",m.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",m.FRAG_LOAD_ERROR="fragLoadError",m.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",m.FRAG_DECRYPT_ERROR="fragDecryptError",m.FRAG_PARSING_ERROR="fragParsingError",m.REMUX_ALLOC_ERROR="remuxAllocError",m.KEY_LOAD_ERROR="keyLoadError",m.KEY_LOAD_TIMEOUT="keyLoadTimeOut",m.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",m.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",m.BUFFER_APPEND_ERROR="bufferAppendError",m.BUFFER_APPENDING_ERROR="bufferAppendingError",m.BUFFER_STALLED_ERROR="bufferStalledError",m.BUFFER_FULL_ERROR="bufferFullError",m.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",m.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",m.INTERNAL_EXCEPTION="internalException",m.INTERNAL_ABORTED="aborted",m.UNKNOWN="unknown"})(y||(y={}))},"./src/events.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"Events",function(){return k});var k;(function(y){y.MEDIA_ATTACHING="hlsMediaAttaching",y.MEDIA_ATTACHED="hlsMediaAttached",y.MEDIA_DETACHING="hlsMediaDetaching",y.MEDIA_DETACHED="hlsMediaDetached",y.BUFFER_RESET="hlsBufferReset",y.BUFFER_CODECS="hlsBufferCodecs",y.BUFFER_CREATED="hlsBufferCreated",y.BUFFER_APPENDING="hlsBufferAppending",y.BUFFER_APPENDED="hlsBufferAppended",y.BUFFER_EOS="hlsBufferEos",y.BUFFER_FLUSHING="hlsBufferFlushing",y.BUFFER_FLUSHED="hlsBufferFlushed",y.MANIFEST_LOADING="hlsManifestLoading",y.MANIFEST_LOADED="hlsManifestLoaded",y.MANIFEST_PARSED="hlsManifestParsed",y.LEVEL_SWITCHING="hlsLevelSwitching",y.LEVEL_SWITCHED="hlsLevelSwitched",y.LEVEL_LOADING="hlsLevelLoading",y.LEVEL_LOADED="hlsLevelLoaded",y.LEVEL_UPDATED="hlsLevelUpdated",y.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",y.LEVELS_UPDATED="hlsLevelsUpdated",y.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",y.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",y.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",y.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",y.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",y.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",y.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",y.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",y.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",y.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",y.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",y.CUES_PARSED="hlsCuesParsed",y.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",y.INIT_PTS_FOUND="hlsInitPtsFound",y.FRAG_LOADING="hlsFragLoading",y.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",y.FRAG_LOADED="hlsFragLoaded",y.FRAG_DECRYPTED="hlsFragDecrypted",y.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",y.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",y.FRAG_PARSING_METADATA="hlsFragParsingMetadata",y.FRAG_PARSED="hlsFragParsed",y.FRAG_BUFFERED="hlsFragBuffered",y.FRAG_CHANGED="hlsFragChanged",y.FPS_DROP="hlsFpsDrop",y.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",y.ERROR="hlsError",y.DESTROYING="hlsDestroying",y.KEY_LOADING="hlsKeyLoading",y.KEY_LOADED="hlsKeyLoaded",y.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",y.BACK_BUFFER_REACHED="hlsBackBufferReached"})(k||(k={}))},"./src/hls.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return _});var k=C("./node_modules/url-toolkit/src/url-toolkit.js"),y=C.n(k),m=C("./src/loader/playlist-loader.ts"),S=C("./src/loader/key-loader.ts"),b=C("./src/controller/id3-track-controller.ts"),p=C("./src/controller/latency-controller.ts"),d=C("./src/controller/level-controller.ts"),t=C("./src/controller/fragment-tracker.ts"),l=C("./src/controller/stream-controller.ts"),r=C("./src/is-supported.ts"),i=C("./src/utils/logger.ts"),o=C("./src/config.ts"),s=C("./node_modules/eventemitter3/index.js"),c=C.n(s),a=C("./src/events.ts"),u=C("./src/errors.ts");function f(h,R){for(var O=0;O<R.length;O++){var g=R[O];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}function w(h,R,O){return R&&f(h.prototype,R),O&&f(h,O),h}var _=function(){h.isSupported=function(){return Object(r.isSupported)()};function h(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new s.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 g=this.config=Object(o.mergeConfig)(h.DefaultConfig,O);this.userConfig=O,Object(i.enableLogs)(g.debug),this._autoLevelCapping=-1,g.progressive&&Object(o.enableStreamingMode)(g);var x=g.abrController,E=g.bufferController,T=g.capLevelController,M=g.fpsController,L=this.abrController=new x(this),A=this.bufferController=new E(this),V=this.capLevelController=new T(this),z=new M(this),W=new m.default(this),G=new S.default(this),U=new b.default(this),P=this.levelController=new d.default(this),H=new t.FragmentTracker(this),$=this.streamController=new l.default(this,H);V.setStreamController($),z.setStreamController($);var re=[P,$];this.networkControllers=re;var te=[W,G,L,A,V,z,U,H];this.audioTrackController=this.createController(g.audioTrackController,null,re),this.createController(g.audioStreamController,H,re),this.subtitleTrackController=this.createController(g.subtitleTrackController,null,re),this.createController(g.subtitleStreamController,H,re),this.createController(g.timelineController,null,te),this.emeController=this.createController(g.emeController,null,te),this.cmcdController=this.createController(g.cmcdController,null,te),this.latencyController=this.createController(p.default,null,te),this.coreComponents=te}var R=h.prototype;return R.createController=function(g,x,E){if(g){var T=x?new g(this,x):new g(this);return E&&E.push(T),T}return null},R.on=function(g,x,E){E===void 0&&(E=this),this._emitter.on(g,x,E)},R.once=function(g,x,E){E===void 0&&(E=this),this._emitter.once(g,x,E)},R.removeAllListeners=function(g){this._emitter.removeAllListeners(g)},R.off=function(g,x,E,T){E===void 0&&(E=this),this._emitter.off(g,x,E,T)},R.listeners=function(g){return this._emitter.listeners(g)},R.emit=function(g,x,E){return this._emitter.emit(g,x,E)},R.trigger=function(g,x){if(this.config.debug)return this.emit(g,g,x);try{return this.emit(g,g,x)}catch(E){i.logger.error("An internal error happened while handling event "+g+'. Error message: "'+E.message+'". Here is a stacktrace:',E),this.trigger(a.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:g,error:E})}return!1},R.listenerCount=function(g){return this._emitter.listenerCount(g)},R.destroy=function(){i.logger.log("destroy"),this.trigger(a.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(g){return g.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(g){return g.destroy()}),this.coreComponents.length=0},R.attachMedia=function(g){i.logger.log("attachMedia"),this._media=g,this.trigger(a.Events.MEDIA_ATTACHING,{media:g})},R.detachMedia=function(){i.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(g){this.stopLoad();var x=this.media,E=this.url,T=this.url=k.buildAbsoluteURL(self.location.href,g,{alwaysNormalize:!0});i.logger.log("loadSource:"+T),x&&E&&E!==T&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(x)),this.trigger(a.Events.MANIFEST_LOADING,{url:g})},R.startLoad=function(g){g===void 0&&(g=-1),i.logger.log("startLoad("+g+")"),this.networkControllers.forEach(function(x){x.startLoad(g)})},R.stopLoad=function(){i.logger.log("stopLoad"),this.networkControllers.forEach(function(g){g.stopLoad()})},R.swapAudioCodec=function(){i.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){i.logger.log("recoverMediaError");var g=this._media;this.detachMedia(),g&&this.attachMedia(g)},R.removeLevel=function(g,x){x===void 0&&(x=0),this.levelController.removeLevel(g,x)},w(h,[{key:"levels",get:function(){var g=this.levelController.levels;return g||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(g){i.logger.log("set currentLevel:"+g),this.loadLevel=g,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(g){i.logger.log("set nextLevel:"+g),this.levelController.manualLevel=g,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(g){i.logger.log("set loadLevel:"+g),this.levelController.manualLevel=g}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(g){this.levelController.nextLoadLevel=g}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(g){i.logger.log("set firstLevel:"+g),this.levelController.firstLevel=g}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(g){i.logger.log("set startLevel:"+g),g!==-1&&(g=Math.max(g,this.minAutoLevel)),this.levelController.startLevel=g}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(g){var x=!!g;x!==this.config.capLevelToPlayerSize&&(x?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=x)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(g){this._autoLevelCapping!==g&&(i.logger.log("set autoLevelCapping:"+g),this._autoLevelCapping=g)}},{key:"bandwidthEstimate",get:function(){var g=this.abrController.bwEstimator;return g?g.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var g=this.levels,x=this.config.minAutoBitrate;if(!g)return 0;for(var E=g.length,T=0;T<E;T++)if(g[T].maxBitrate>x)return T;return 0}},{key:"maxAutoLevel",get:function(){var g=this.levels,x=this.autoLevelCapping,E;return x===-1&&g&&g.length?E=g.length-1:E=x,E}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(g){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,g)}},{key:"audioTracks",get:function(){var g=this.audioTrackController;return g?g.audioTracks:[]}},{key:"audioTrack",get:function(){var g=this.audioTrackController;return g?g.audioTrack:-1},set:function(g){var x=this.audioTrackController;x&&(x.audioTrack=g)}},{key:"subtitleTracks",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTrack:-1},set:function(g){var x=this.subtitleTrackController;x&&(x.subtitleTrack=g)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var g=this.subtitleTrackController;return g?g.subtitleDisplay:!1},set:function(g){var x=this.subtitleTrackController;x&&(x.subtitleDisplay=g)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(g){this.config.lowLatencyMode=g}},{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 a.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return h.defaultConfig?h.defaultConfig:o.hlsDefaultConfig},set:function(g){h.defaultConfig=g}}]),h}();_.defaultConfig=void 0},"./src/is-supported.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"isSupported",function(){return m}),C.d(v,"changeTypeSupported",function(){return S});var k=C("./src/utils/mediasource-helper.ts");function y(){return self.SourceBuffer||self.WebKitSourceBuffer}function m(){var b=Object(k.getMediaSource)();if(!b)return!1;var p=y(),d=b&&typeof b.isTypeSupported=="function"&&b.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),t=!p||p.prototype&&typeof p.prototype.appendBuffer=="function"&&typeof p.prototype.remove=="function";return!!d&&!!t}function S(){var b,p=y();return typeof(p==null||((b=p.prototype)===null||b===void 0)?void 0:b.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return i}),C.d(v,"LoadError",function(){return s});var k=C("./src/polyfills/number.ts"),y=C("./src/errors.ts");function m(c,a){c.prototype=Object.create(a.prototype),c.prototype.constructor=c,t(c,a)}function S(c){var a=typeof Map=="function"?new Map:void 0;return S=function(f){if(f===null||!d(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(f))return a.get(f);a.set(f,w)}function w(){return b(f,arguments,l(this).constructor)}return w.prototype=Object.create(f.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),t(w,f)},S(c)}function b(c,a,u){return p()?b=Reflect.construct:b=function(w,_,h){var R=[null];R.push.apply(R,_);var O=Function.bind.apply(w,R),g=new O;return h&&t(g,h.prototype),g},b.apply(null,arguments)}function p(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(c){return!1}}function d(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function t(c,a){return t=Object.setPrototypeOf||function(f,w){return f.__proto__=w,f},t(c,a)}function l(c){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},l(c)}var r=Math.pow(2,17),i=function(){function c(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var a=c.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(f,w){var _=this,h=f.url;if(!h)return Promise.reject(new s({type:y.ErrorTypes.NETWORK_ERROR,details:y.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,networkDetails:null},"Fragment does not have a "+(h?"part list":"url")));this.abort();var R=this.config,O=R.fLoader,g=R.loader;return new Promise(function(x,E){_.loader&&_.loader.destroy();var T=_.loader=f.loader=O?new O(R):new g(R),M=o(f),L={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:r};f.stats=T.stats,T.load(M,L,{onSuccess:function(V,z,W,G){_.resetLoader(f,T),x({frag:f,part:null,payload:V.data,networkDetails:G})},onError:function(V,z,W){_.resetLoader(f,T),E(new s({type:y.ErrorTypes.NETWORK_ERROR,details:y.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,response:V,networkDetails:W}))},onAbort:function(V,z,W){_.resetLoader(f,T),E(new s({type:y.ErrorTypes.NETWORK_ERROR,details:y.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,networkDetails:W}))},onTimeout:function(V,z,W){_.resetLoader(f,T),E(new s({type:y.ErrorTypes.NETWORK_ERROR,details:y.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,networkDetails:W}))},onProgress:function(V,z,W,G){w&&w({frag:f,part:null,payload:W,networkDetails:G})}})})},a.loadPart=function(f,w,_){var h=this;this.abort();var R=this.config,O=R.fLoader,g=R.loader;return new Promise(function(x,E){h.loader&&h.loader.destroy();var T=h.loader=f.loader=O?new O(R):new g(R),M=o(f,w),L={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:r};w.stats=T.stats,T.load(M,L,{onSuccess:function(V,z,W,G){h.resetLoader(f,T),h.updateStatsFromPart(f,w);var U={frag:f,part:w,payload:V.data,networkDetails:G};_(U),x(U)},onError:function(V,z,W){h.resetLoader(f,T),E(new s({type:y.ErrorTypes.NETWORK_ERROR,details:y.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,part:w,response:V,networkDetails:W}))},onAbort:function(V,z,W){f.stats.aborted=w.stats.aborted,h.resetLoader(f,T),E(new s({type:y.ErrorTypes.NETWORK_ERROR,details:y.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,part:w,networkDetails:W}))},onTimeout:function(V,z,W){h.resetLoader(f,T),E(new s({type:y.ErrorTypes.NETWORK_ERROR,details:y.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,part:w,networkDetails:W}))}})})},a.updateStatsFromPart=function(f,w){var _=f.stats,h=w.stats,R=h.total;if(_.loaded+=h.loaded,R){var O=Math.round(f.duration/w.duration),g=Math.min(Math.round(_.loaded/R),O),x=O-g,E=x*Math.round(_.loaded/g);_.total=_.loaded+E}else _.total=Math.max(_.loaded,_.total);var T=_.loading,M=h.loading;T.start?T.first+=M.first-M.start:(T.start=M.start,T.first=M.first),T.end=M.end},a.resetLoader=function(f,w){f.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},c}();function o(c,a){a===void 0&&(a=null);var u=a||c,f={frag:c,part:a,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},w=u.byteRangeStartOffset,_=u.byteRangeEndOffset;return Object(k.isFiniteNumber)(w)&&Object(k.isFiniteNumber)(_)&&(f.rangeStart=w,f.rangeEnd=_),f}var s=function(c){m(a,c);function a(u){for(var f,w=arguments.length,_=new Array(w>1?w-1:0),h=1;h<w;h++)_[h-1]=arguments[h];return f=c.call.apply(c,[this].concat(_))||this,f.data=void 0,f.data=u,f}return a}(S(Error))},"./src/loader/fragment.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"ElementaryStreamTypes",function(){return i}),C.d(v,"BaseSegment",function(){return o}),C.d(v,"Fragment",function(){return s}),C.d(v,"Part",function(){return c});var k=C("./src/polyfills/number.ts"),y=C("./node_modules/url-toolkit/src/url-toolkit.js"),m=C.n(y),S=C("./src/utils/logger.ts"),b=C("./src/loader/level-key.ts"),p=C("./src/loader/load-stats.ts");function d(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,t(a,u)}function t(a,u){return t=Object.setPrototypeOf||function(w,_){return w.__proto__=_,w},t(a,u)}function l(a,u){for(var f=0;f<u.length;f++){var w=u[f];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(a,w.key,w)}}function r(a,u,f){return u&&l(a.prototype,u),f&&l(a,f),a}var i;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(i||(i={}));var o=function(){function a(f){var w;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(w={},w[i.AUDIO]=null,w[i.VIDEO]=null,w[i.AUDIOVIDEO]=null,w),this.baseurl=f}var u=a.prototype;return u.setByteRange=function(w,_){var h=w.split("@",2),R=[];h.length===1?R[0]=_?_.byteRangeEndOffset:0:R[0]=parseInt(h[1]),R[1]=parseInt(h[0])+R[0],this._byteRange=R},r(a,[{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(y.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(w){this._url=w}}]),a}(),s=function(a){d(u,a);function u(w,_){var h;return h=a.call(this,_)||this,h._decryptdata=null,h.rawProgramDateTime=null,h.programDateTime=null,h.tagList=[],h.duration=0,h.sn=0,h.levelkey=void 0,h.type=void 0,h.loader=null,h.level=-1,h.cc=0,h.startPTS=void 0,h.endPTS=void 0,h.appendedPTS=void 0,h.startDTS=void 0,h.endDTS=void 0,h.start=0,h.deltaPTS=void 0,h.maxStartPTS=void 0,h.minEndPTS=void 0,h.stats=new p.LoadStats,h.urlId=0,h.data=void 0,h.bitrateTest=!1,h.title=null,h.initSegment=null,h.type=w,h}var f=u.prototype;return f.createInitializationVector=function(_){for(var h=new Uint8Array(16),R=12;R<16;R++)h[R]=_>>8*(15-R)&255;return h},f.setDecryptDataFromLevelKey=function(_,h){var R=_;return(_==null?void 0:_.method)==="AES-128"&&_.uri&&!_.iv&&(R=b.LevelKey.fromURI(_.uri),R.method=_.method,R.iv=this.createInitializationVector(h),R.keyFormat="identity"),R},f.setElementaryStreamInfo=function(_,h,R,O,g,x){x===void 0&&(x=!1);var E=this.elementaryStreams,T=E[_];if(!T){E[_]={startPTS:h,endPTS:R,startDTS:O,endDTS:g,partial:x};return}T.startPTS=Math.min(T.startPTS,h),T.endPTS=Math.max(T.endPTS,R),T.startDTS=Math.min(T.startDTS,O),T.endDTS=Math.max(T.endDTS,g)},f.clearElementaryStreamInfo=function(){var _=this.elementaryStreams;_[i.AUDIO]=null,_[i.VIDEO]=null,_[i.AUDIOVIDEO]=null},r(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var _=this.sn;typeof _!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&S.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),_=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,_)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(k.isFiniteNumber)(this.programDateTime))return null;var _=Object(k.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+_*1e3}},{key:"encrypted",get:function(){var _;return!!((_=this.decryptdata)!==null&&_!==void 0&&_.keyFormat&&this.decryptdata.uri)}}]),u}(o),c=function(a){d(u,a);function u(f,w,_,h,R){var O;O=a.call(this,_)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new p.LoadStats,O.duration=f.decimalFloatingPoint("DURATION"),O.gap=f.bool("GAP"),O.independent=f.bool("INDEPENDENT"),O.relurl=f.enumeratedString("URI"),O.fragment=w,O.index=h;var g=f.enumeratedString("BYTERANGE");return g&&O.setByteRange(g,R),R&&(O.fragOffset=R.fragOffset+R.duration),O}return r(u,[{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)}}]),u}(o)},"./src/loader/key-loader.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return S});var k=C("./src/events.ts"),y=C("./src/errors.ts"),m=C("./src/utils/logger.ts"),S=function(){function b(d){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=d,this._registerListeners()}var p=b.prototype;return p._registerListeners=function(){this.hls.on(k.Events.KEY_LOADING,this.onKeyLoading,this)},p._unregisterListeners=function(){this.hls.off(k.Events.KEY_LOADING,this.onKeyLoading)},p.destroy=function(){this._unregisterListeners();for(var t in this.loaders){var l=this.loaders[t];l&&l.destroy()}this.loaders={}},p.onKeyLoading=function(t,l){var r=l.frag,i=r.type,o=this.loaders[i];if(!r.decryptdata){m.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=r.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(o&&(m.logger.warn("abort previous key loader for type:"+i),o.abort()),!s){m.logger.warn("key uri is falsy");return}var a=c.loader,u=r.loader=this.loaders[i]=new a(c);this.decrypturl=s,this.decryptkey=null;var f={url:s,frag:r,responseType:"arraybuffer"},w={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(f,w,_)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(k.Events.KEY_LOADED,{frag:r}))},p.loadsuccess=function(t,l,r){var i=r.frag;if(!i.decryptdata){m.logger.error("after key load, decryptdata unset");return}this.decryptkey=i.decryptdata.key=new Uint8Array(t.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(k.Events.KEY_LOADED,{frag:i})},p.loaderror=function(t,l){var r=l.frag,i=r.loader;i&&i.abort(),delete this.loaders[r.type],this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.NETWORK_ERROR,details:y.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:t})},p.loadtimeout=function(t,l){var r=l.frag,i=r.loader;i&&i.abort(),delete this.loaders[r.type],this.hls.trigger(k.Events.ERROR,{type:y.ErrorTypes.NETWORK_ERROR,details:y.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},b}()},"./src/loader/level-details.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"LevelDetails",function(){return b});var k=C("./src/polyfills/number.ts");function y(p,d){for(var t=0;t<d.length;t++){var l=d[t];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}function m(p,d,t){return d&&y(p.prototype,d),t&&y(p,t),p}var S=10,b=function(){function p(t){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=t}var d=p.prototype;return d.reloaded=function(l){if(!l){this.advanced=!0,this.updated=!0;return}var r=this.lastPartSn-l.lastPartSn,i=this.lastPartIndex-l.lastPartIndex;this.updated=this.endSN!==l.endSN||!!i||!!r,this.advanced=this.endSN>l.endSN||r>0||r===0&&i>0,this.updated||this.advanced?this.misses=Math.floor(l.misses*.6):this.misses=l.misses+1,this.availabilityDelay=l.availabilityDelay},m(p,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(k.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||S}},{key:"drift",get:function(){var l=this.driftEndTime-this.driftStartTime;if(l>0){var r=this.driftEnd-this.driftStart;return r*1e3/l}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var l;return(l=this.fragments)!==null&&l!==void 0&&l.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 l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),p}()},"./src/loader/level-key.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"LevelKey",function(){return b});var k=C("./node_modules/url-toolkit/src/url-toolkit.js"),y=C.n(k);function m(p,d){for(var t=0;t<d.length;t++){var l=d[t];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}function S(p,d,t){return d&&m(p.prototype,d),t&&m(p,t),p}var b=function(){p.fromURL=function(t,l){return new p(t,l)},p.fromURI=function(t){return new p(t)};function p(d,t){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,t?this._uri=Object(k.buildAbsoluteURL)(d,t,{alwaysNormalize:!0}):this._uri=d}return S(p,[{key:"uri",get:function(){return this._uri}}]),p}()},"./src/loader/load-stats.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"LoadStats",function(){return k});var k=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(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return u});var k=C("./src/polyfills/number.ts"),y=C("./node_modules/url-toolkit/src/url-toolkit.js"),m=C.n(y),S=C("./src/loader/fragment.ts"),b=C("./src/loader/level-details.ts"),p=C("./src/loader/level-key.ts"),d=C("./src/utils/attr-list.ts"),t=C("./src/utils/logger.ts"),l=C("./src/utils/codecs.ts"),r=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,i=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),s=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("|")),c=/\.(mp4|m4s|m4v|m4a)$/i;function a(R){var O,g;return c.test((O=(g=y.parseURL(R))===null||g===void 0?void 0:g.path)!=null?O:"")}var u=function(){function R(){}return R.findGroup=function(g,x){for(var E=0;E<g.length;E++){var T=g[E];if(T.id===x)return T}},R.convertAVC1ToAVCOTI=function(g){var x=g.split(".");if(x.length>2){var E=x.shift()+".";return E+=parseInt(x.shift()).toString(16),E+=("000"+parseInt(x.shift()).toString(16)).substr(-4),E}return g},R.resolve=function(g,x){return y.buildAbsoluteURL(x,g,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(g,x){var E=[],T={},M=!1;r.lastIndex=0;for(var L;(L=r.exec(g))!=null;)if(L[1]){var A=new d.AttrList(L[1]),V={attrs:A,bitrate:A.decimalInteger("AVERAGE-BANDWIDTH")||A.decimalInteger("BANDWIDTH"),name:A.NAME,url:R.resolve(L[2],x)},z=A.decimalResolution("RESOLUTION");z&&(V.width=z.width,V.height=z.height),f((A.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),V),V.videoCodec&&V.videoCodec.indexOf("avc1")!==-1&&(V.videoCodec=R.convertAVC1ToAVCOTI(V.videoCodec)),E.push(V)}else if(L[3]){var W=new d.AttrList(L[3]);W["DATA-ID"]&&(M=!0,T[W["DATA-ID"]]=W)}return{levels:E,sessionData:M?T:null}},R.parseMasterPlaylistMedia=function(g,x,E,T){T===void 0&&(T=[]);var M,L=[],A=0;for(i.lastIndex=0;(M=i.exec(g))!==null;){var V=new d.AttrList(M[1]);if(V.TYPE===E){var z={attrs:V,bitrate:0,id:A++,groupId:V["GROUP-ID"],instreamId:V["INSTREAM-ID"],name:V.NAME||V.LANGUAGE||"",type:E,default:V.bool("DEFAULT"),autoselect:V.bool("AUTOSELECT"),forced:V.bool("FORCED"),lang:V.LANGUAGE,url:V.URI?R.resolve(V.URI,x):""};if(T.length){var W=R.findGroup(T,z.groupId)||T[0];w(z,W,"audioCodec"),w(z,W,"textCodec")}L.push(z)}}return L},R.parseLevelPlaylist=function(g,x,E,T,M){var L=new b.LevelDetails(x),A=L.fragments,V=null,z=0,W=0,G=0,U=0,P=null,H=new S.Fragment(T,x),$,re,te,ge=-1,ve=!1;for(o.lastIndex=0,L.m3u8=g;($=o.exec(g))!==null;){ve&&(ve=!1,H=new S.Fragment(T,x),H.start=G,H.sn=z,H.cc=U,H.level=E,V&&(H.initSegment=V,H.rawProgramDateTime=V.rawProgramDateTime));var de=$[1];if(de){H.duration=parseFloat(de);var De=(" "+$[2]).slice(1);H.title=De||null,H.tagList.push(De?["INF",de,De]:["INF",de])}else if($[3])Object(k.isFiniteNumber)(H.duration)&&(H.start=G,te&&(H.levelkey=te),H.sn=z,H.level=E,H.cc=U,H.urlId=M,A.push(H),H.relurl=(" "+$[3]).slice(1),h(H,P),P=H,G+=H.duration,z++,W=0,ve=!0);else if($[4]){var Te=(" "+$[4]).slice(1);P?H.setByteRange(Te,P):H.setByteRange(Te)}else if($[5])H.rawProgramDateTime=(" "+$[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),ge===-1&&(ge=A.length);else{if($=$[0].match(s),!$){t.logger.warn("No matches on slow regex match for level playlist!");continue}for(re=1;re<$.length&&!(typeof $[re]!="undefined");re++);var he=(" "+$[re]).slice(1),ue=(" "+$[re+1]).slice(1),ie=$[re+2]?(" "+$[re+2]).slice(1):"";switch(he){case"PLAYLIST-TYPE":L.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":z=L.startSN=parseInt(ue);break;case"SKIP":{var Se=new d.AttrList(ue),ne=Se.decimalInteger("SKIPPED-SEGMENTS");if(Object(k.isFiniteNumber)(ne)){L.skippedSegments=ne;for(var ce=ne;ce--;)A.unshift(null);z+=ne}var Oe=Se.enumeratedString("RECENTLY-REMOVED-DATERANGES");Oe&&(L.recentlyRemovedDateranges=Oe.split(" "));break}case"TARGETDURATION":L.targetduration=parseFloat(ue);break;case"VERSION":L.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":L.live=!1;break;case"#":(ue||ie)&&H.tagList.push(ie?[ue,ie]:[ue]);break;case"DIS":U++;case"GAP":H.tagList.push([he]);break;case"BITRATE":H.tagList.push([he,ue]);break;case"DISCONTINUITY-SEQ":U=parseInt(ue);break;case"KEY":{var oe,q=new d.AttrList(ue),Y=q.enumeratedString("METHOD"),Z=q.URI,ye=q.hexadecimalInteger("IV"),be=q.enumeratedString("KEYFORMATVERSIONS"),Re=q.enumeratedString("KEYID"),Qe=(oe=q.enumeratedString("KEYFORMAT"))!=null?oe:"identity",rt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(rt.indexOf(Qe)>-1){t.logger.warn("Keyformat "+Qe+" is not supported from the manifest");continue}else if(Qe!=="identity")continue;Y&&(te=p.LevelKey.fromURL(x,Z),Z&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Y)>=0&&(te.method=Y,te.keyFormat=Qe,Re&&(te.keyID=Re),be&&(te.keyFormatVersions=be),te.iv=ye));break}case"START":{var at=new d.AttrList(ue),qe=at.decimalFloatingPoint("TIME-OFFSET");Object(k.isFiniteNumber)(qe)&&(L.startTimeOffset=qe);break}case"MAP":{var st=new d.AttrList(ue);H.relurl=st.URI,st.BYTERANGE&&H.setByteRange(st.BYTERANGE),H.level=E,H.sn="initSegment",te&&(H.levelkey=te),H.initSegment=null,V=H,ve=!0;break}case"SERVER-CONTROL":{var lt=new d.AttrList(ue);L.canBlockReload=lt.bool("CAN-BLOCK-RELOAD"),L.canSkipUntil=lt.optionalFloat("CAN-SKIP-UNTIL",0),L.canSkipDateRanges=L.canSkipUntil>0&<.bool("CAN-SKIP-DATERANGES"),L.partHoldBack=lt.optionalFloat("PART-HOLD-BACK",0),L.holdBack=lt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var je=new d.AttrList(ue);L.partTarget=je.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ie=L.partList;Ie||(Ie=L.partList=[]);var tt=W>0?Ie[Ie.length-1]:void 0,ot=W++,ze=new S.Part(new d.AttrList(ue),H,x,ot,tt);Ie.push(ze),H.duration+=ze.duration;break}case"PRELOAD-HINT":{var Ze=new d.AttrList(ue);L.preloadHint=Ze;break}case"RENDITION-REPORT":{var Ne=new d.AttrList(ue);L.renditionReports=L.renditionReports||[],L.renditionReports.push(Ne);break}default:t.logger.warn("line parsed but not handled: "+$);break}}}P&&!P.relurl?(A.pop(),G-=P.duration,L.partList&&(L.fragmentHint=P)):L.partList&&(h(H,P),H.cc=U,L.fragmentHint=H);var Ae=A.length,Me=A[0],Ee=A[Ae-1];if(G+=L.skippedSegments*L.targetduration,G>0&&Ae&&Ee){L.averagetargetduration=G/Ae;var Ce=Ee.sn;L.endSN=Ce!=="initSegment"?Ce:0,Me&&(L.startCC=Me.cc,Me.initSegment||L.fragments.every(function(ke){return ke.relurl&&a(ke.relurl)})&&(t.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new S.Fragment(T,x),H.relurl=Ee.relurl,H.level=E,H.sn="initSegment",Me.initSegment=H,L.needSidxRanges=!0))}else L.endSN=0,L.startCC=0;return L.fragmentHint&&(G+=L.fragmentHint.duration),L.totalduration=G,L.endCC=U,ge>0&&_(A,ge),L},R}();function f(R,O){["video","audio","text"].forEach(function(g){var x=R.filter(function(T){return Object(l.isCodecType)(T,g)});if(x.length){var E=x.filter(function(T){return T.lastIndexOf("avc1",0)===0||T.lastIndexOf("mp4a",0)===0});O[g+"Codec"]=E.length>0?E[0]:x[0],R=R.filter(function(T){return x.indexOf(T)===-1})}}),O.unknownCodecs=R}function w(R,O,g){var x=O[g];x&&(R[g]=x)}function _(R,O){for(var g=R[O],x=O;x--;){var E=R[x];if(!E)return;E.programDateTime=g.programDateTime-E.duration*1e3,g=E}}function h(R,O){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):O!=null&&O.programDateTime&&(R.programDateTime=O.endProgramDateTime),Object(k.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/polyfills/number.ts"),y=C("./src/events.ts"),m=C("./src/errors.ts"),S=C("./src/utils/logger.ts"),b=C("./src/utils/mp4-tools.ts"),p=C("./src/loader/m3u8-parser.ts"),d=C("./src/types/loader.ts"),t=C("./src/utils/attr-list.ts");function l(o){var s=o.type;switch(s){case d.PlaylistContextType.AUDIO_TRACK:return d.PlaylistLevelType.AUDIO;case d.PlaylistContextType.SUBTITLE_TRACK:return d.PlaylistLevelType.SUBTITLE;default:return d.PlaylistLevelType.MAIN}}function r(o,s){var c=o.url;return(c===void 0||c.indexOf("data:")===0)&&(c=s.url),c}var i=function(){function o(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var s=o.prototype;return s.registerListeners=function(){var a=this.hls;a.on(y.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(y.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(y.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(y.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.unregisterListeners=function(){var a=this.hls;a.off(y.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(y.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(y.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(y.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.createInternalLoader=function(a){var u=this.hls.config,f=u.pLoader,w=u.loader,_=f||w,h=new _(u);return a.loader=h,this.loaders[a.type]=h,h},s.getInternalLoader=function(a){return this.loaders[a.type]},s.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},s.destroyInternalLoaders=function(){for(var a in this.loaders){var u=this.loaders[a];u&&u.destroy(),this.resetInternalLoader(a)}},s.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},s.onManifestLoading=function(a,u){var f=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:d.PlaylistContextType.MANIFEST,url:f,deliveryDirectives:null})},s.onLevelLoading=function(a,u){var f=u.id,w=u.level,_=u.url,h=u.deliveryDirectives;this.load({id:f,groupId:null,level:w,responseType:"text",type:d.PlaylistContextType.LEVEL,url:_,deliveryDirectives:h})},s.onAudioTrackLoading=function(a,u){var f=u.id,w=u.groupId,_=u.url,h=u.deliveryDirectives;this.load({id:f,groupId:w,level:null,responseType:"text",type:d.PlaylistContextType.AUDIO_TRACK,url:_,deliveryDirectives:h})},s.onSubtitleTrackLoading=function(a,u){var f=u.id,w=u.groupId,_=u.url,h=u.deliveryDirectives;this.load({id:f,groupId:w,level:null,responseType:"text",type:d.PlaylistContextType.SUBTITLE_TRACK,url:_,deliveryDirectives:h})},s.load=function(a){var u,f=this.hls.config,w=this.getInternalLoader(a);if(w){var _=w.context;if(_&&_.url===a.url){S.logger.trace("[playlist-loader]: playlist request ongoing");return}S.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),w.abort()}var h,R,O,g;switch(a.type){case d.PlaylistContextType.MANIFEST:h=f.manifestLoadingMaxRetry,R=f.manifestLoadingTimeOut,O=f.manifestLoadingRetryDelay,g=f.manifestLoadingMaxRetryTimeout;break;case d.PlaylistContextType.LEVEL:case d.PlaylistContextType.AUDIO_TRACK:case d.PlaylistContextType.SUBTITLE_TRACK:h=0,R=f.levelLoadingTimeOut;break;default:h=f.levelLoadingMaxRetry,R=f.levelLoadingTimeOut,O=f.levelLoadingRetryDelay,g=f.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(a),(u=a.deliveryDirectives)!==null&&u!==void 0&&u.part){var x;if(a.type===d.PlaylistContextType.LEVEL&&a.level!==null?x=this.hls.levels[a.level].details:a.type===d.PlaylistContextType.AUDIO_TRACK&&a.id!==null?x=this.hls.audioTracks[a.id].details:a.type===d.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(x=this.hls.subtitleTracks[a.id].details),x){var E=x.partTarget,T=x.targetduration;E&&T&&(R=Math.min(Math.max(E*3,T*.8)*1e3,R))}}var M={timeout:R,maxRetry:h,retryDelay:O,maxRetryDelay:g,highWaterMark:0},L={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(a,M,L)},s.loadsuccess=function(a,u,f,w){if(w===void 0&&(w=null),f.isSidxRequest){this.handleSidxRequest(a,f),this.handlePlaylistLoaded(a,u,f,w);return}this.resetInternalLoader(f.type);var _=a.data;if(_.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,f,"no EXTM3U delimiter",w);return}u.parsing.start=performance.now(),_.indexOf("#EXTINF:")>0||_.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,u,f,w):this.handleMasterPlaylist(a,u,f,w)},s.loaderror=function(a,u,f){f===void 0&&(f=null),this.handleNetworkError(u,f,!1,a)},s.loadtimeout=function(a,u,f){f===void 0&&(f=null),this.handleNetworkError(u,f,!0)},s.handleMasterPlaylist=function(a,u,f,w){var _=this.hls,h=a.data,R=r(a,f),O=p.default.parseMasterPlaylist(h,R),g=O.levels,x=O.sessionData;if(!g.length){this.handleManifestParsingError(a,f,"no level found in manifest",w);return}var E=g.map(function(z){return{id:z.attrs.AUDIO,audioCodec:z.audioCodec}}),T=g.map(function(z){return{id:z.attrs.SUBTITLES,textCodec:z.textCodec}}),M=p.default.parseMasterPlaylistMedia(h,R,"AUDIO",E),L=p.default.parseMasterPlaylistMedia(h,R,"SUBTITLES",T),A=p.default.parseMasterPlaylistMedia(h,R,"CLOSED-CAPTIONS");if(M.length){var V=M.some(function(z){return!z.url});!V&&g[0].audioCodec&&!g[0].attrs.AUDIO&&(S.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),M.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new t.AttrList({}),bitrate:0,url:""}))}_.trigger(y.Events.MANIFEST_LOADED,{levels:g,audioTracks:M,subtitles:L,captions:A,url:R,stats:u,networkDetails:w,sessionData:x})},s.handleTrackOrLevelPlaylist=function(a,u,f,w){var _=this.hls,h=f.id,R=f.level,O=f.type,g=r(a,f),x=Object(k.isFiniteNumber)(h)?h:0,E=Object(k.isFiniteNumber)(R)?R:x,T=l(f),M=p.default.parseLevelPlaylist(a.data,g,E,T,x);if(!M.fragments.length){_.trigger(y.Events.ERROR,{type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:typeof f.level=="number"?f.level:void 0});return}if(O===d.PlaylistContextType.MANIFEST){var L={attrs:new t.AttrList({}),bitrate:0,details:M,name:"",url:g};_.trigger(y.Events.MANIFEST_LOADED,{levels:[L],audioTracks:[],url:g,stats:u,networkDetails:w,sessionData:null})}if(u.parsing.end=performance.now(),M.needSidxRanges){var A,V=(A=M.fragments[0].initSegment)===null||A===void 0?void 0:A.url;this.load({url:V,isSidxRequest:!0,type:O,level:R,levelDetails:M,id:h,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}f.levelDetails=M,this.handlePlaylistLoaded(a,u,f,w)},s.handleSidxRequest=function(a,u){var f=Object(b.parseSegmentIndex)(new Uint8Array(a.data));if(!f)return;var w=f.references,_=u.levelDetails;w.forEach(function(h,R){var O=h.info,g=_.fragments[R];g.byteRange.length===0&&g.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),g.initSegment&&g.initSegment.setByteRange(String(f.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(a,u,f,w){this.hls.trigger(y.Events.ERROR,{type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===d.PlaylistContextType.MANIFEST,url:a.url,reason:f,response:a,context:u,networkDetails:w})},s.handleNetworkError=function(a,u,f,w){f===void 0&&(f=!1),S.logger.warn("[playlist-loader]: A network "+(f?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var _=m.ErrorDetails.UNKNOWN,h=!1,R=this.getInternalLoader(a);switch(a.type){case d.PlaylistContextType.MANIFEST:_=f?m.ErrorDetails.MANIFEST_LOAD_TIMEOUT:m.ErrorDetails.MANIFEST_LOAD_ERROR,h=!0;break;case d.PlaylistContextType.LEVEL:_=f?m.ErrorDetails.LEVEL_LOAD_TIMEOUT:m.ErrorDetails.LEVEL_LOAD_ERROR,h=!1;break;case d.PlaylistContextType.AUDIO_TRACK:_=f?m.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case d.PlaylistContextType.SUBTITLE_TRACK:_=f?m.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:m.ErrorDetails.SUBTITLE_LOAD_ERROR,h=!1;break}R&&this.resetInternalLoader(a.type);var O={type:m.ErrorTypes.NETWORK_ERROR,details:_,fatal:h,url:a.url,loader:R,context:a,networkDetails:u};w&&(O.response=w),this.hls.trigger(y.Events.ERROR,O)},s.handlePlaylistLoaded=function(a,u,f,w){var _=f.type,h=f.level,R=f.id,O=f.groupId,g=f.loader,x=f.levelDetails,E=f.deliveryDirectives;if(!(x!=null&&x.targetduration)){this.handleManifestParsingError(a,f,"invalid target duration",w);return}if(!g)return;x.live&&(g.getCacheAge&&(x.ageHeader=g.getCacheAge()||0),(!g.getCacheAge||isNaN(x.ageHeader))&&(x.ageHeader=0));switch(_){case d.PlaylistContextType.MANIFEST:case d.PlaylistContextType.LEVEL:this.hls.trigger(y.Events.LEVEL_LOADED,{details:x,level:h||0,id:R||0,stats:u,networkDetails:w,deliveryDirectives:E});break;case d.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(y.Events.AUDIO_TRACK_LOADED,{details:x,id:R||0,groupId:O||"",stats:u,networkDetails:w,deliveryDirectives:E});break;case d.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(y.Events.SUBTITLE_TRACK_LOADED,{details:x,id:R||0,groupId:O||"",stats:u,networkDetails:w,deliveryDirectives:E});break}},o}();v.default=i},"./src/polyfills/number.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"isFiniteNumber",function(){return k}),C.d(v,"MAX_SAFE_INTEGER",function(){return y});var k=Number.isFinite||function(m){return typeof m=="number"&&isFinite(m)},y=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(N,v,C){"use strict";C.r(v);var k=function(){function y(){}return y.getSilentFrame=function(S,b){switch(S){case"mp4a.40.2":if(b===1)return new Uint8Array([0,200,0,128,35,128]);if(b===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(b===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(b===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(b===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(b===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(b===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(b===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(b===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},y}();v.default=k},"./src/remux/mp4-generator.ts":function(N,v,C){"use strict";C.r(v);var k=Math.pow(2,32)-1,y=function(){function m(){}return m.init=function(){m.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 b;for(b in m.types)m.types.hasOwnProperty(b)&&(m.types[b]=[b.charCodeAt(0),b.charCodeAt(1),b.charCodeAt(2),b.charCodeAt(3)]);var p=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]),d=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]);m.HDLR_TYPES={video:p,audio:d};var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),l=new Uint8Array([0,0,0,0,0,0,0,0]);m.STTS=m.STSC=m.STCO=l,m.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),m.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),m.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),m.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var r=new Uint8Array([105,115,111,109]),i=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);m.FTYP=m.box(m.types.ftyp,r,o,r,i),m.DINF=m.box(m.types.dinf,m.box(m.types.dref,t))},m.box=function(b){for(var p=8,d=arguments.length,t=new Array(d>1?d-1:0),l=1;l<d;l++)t[l-1]=arguments[l];for(var r=t.length,i=r;r--;)p+=t[r].byteLength;var o=new Uint8Array(p);for(o[0]=p>>24&255,o[1]=p>>16&255,o[2]=p>>8&255,o[3]=p&255,o.set(b,4),r=0,p=8;r<i;r++)o.set(t[r],p),p+=t[r].byteLength;return o},m.hdlr=function(b){return m.box(m.types.hdlr,m.HDLR_TYPES[b])},m.mdat=function(b){return m.box(m.types.mdat,b)},m.mdhd=function(b,p){p*=b;var d=Math.floor(p/(k+1)),t=Math.floor(p%(k+1));return m.box(m.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,b>>24&255,b>>16&255,b>>8&255,b&255,d>>24,d>>16&255,d>>8&255,d&255,t>>24,t>>16&255,t>>8&255,t&255,85,196,0,0]))},m.mdia=function(b){return m.box(m.types.mdia,m.mdhd(b.timescale,b.duration),m.hdlr(b.type),m.minf(b))},m.mfhd=function(b){return m.box(m.types.mfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255]))},m.minf=function(b){return b.type==="audio"?m.box(m.types.minf,m.box(m.types.smhd,m.SMHD),m.DINF,m.stbl(b)):m.box(m.types.minf,m.box(m.types.vmhd,m.VMHD),m.DINF,m.stbl(b))},m.moof=function(b,p,d){return m.box(m.types.moof,m.mfhd(b),m.traf(d,p))},m.moov=function(b){for(var p=b.length,d=[];p--;)d[p]=m.trak(b[p]);return m.box.apply(null,[m.types.moov,m.mvhd(b[0].timescale,b[0].duration)].concat(d).concat(m.mvex(b)))},m.mvex=function(b){for(var p=b.length,d=[];p--;)d[p]=m.trex(b[p]);return m.box.apply(null,[m.types.mvex].concat(d))},m.mvhd=function(b,p){p*=b;var d=Math.floor(p/(k+1)),t=Math.floor(p%(k+1)),l=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,b>>24&255,b>>16&255,b>>8&255,b&255,d>>24,d>>16&255,d>>8&255,d&255,t>>24,t>>16&255,t>>8&255,t&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 m.box(m.types.mvhd,l)},m.sdtp=function(b){var p=b.samples||[],d=new Uint8Array(4+p.length),t,l;for(t=0;t<p.length;t++)l=p[t].flags,d[t+4]=l.dependsOn<<4|l.isDependedOn<<2|l.hasRedundancy;return m.box(m.types.sdtp,d)},m.stbl=function(b){return m.box(m.types.stbl,m.stsd(b),m.box(m.types.stts,m.STTS),m.box(m.types.stsc,m.STSC),m.box(m.types.stsz,m.STSZ),m.box(m.types.stco,m.STCO))},m.avc1=function(b){var p=[],d=[],t,l,r;for(t=0;t<b.sps.length;t++)l=b.sps[t],r=l.byteLength,p.push(r>>>8&255),p.push(r&255),p=p.concat(Array.prototype.slice.call(l));for(t=0;t<b.pps.length;t++)l=b.pps[t],r=l.byteLength,d.push(r>>>8&255),d.push(r&255),d=d.concat(Array.prototype.slice.call(l));var i=m.box(m.types.avcC,new Uint8Array([1,p[3],p[4],p[5],252|3,224|b.sps.length].concat(p).concat([b.pps.length]).concat(d))),o=b.width,s=b.height,c=b.pixelRatio[0],a=b.pixelRatio[1];return m.box(m.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,o>>8&255,o&255,s>>8&255,s&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i,m.box(m.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),m.box(m.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,a>>24,a>>16&255,a>>8&255,a&255])))},m.esds=function(b){var p=b.config.length;return new Uint8Array([0,0,0,0,3,23+p,0,1,0,4,15+p,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([p]).concat(b.config).concat([6,1,2]))},m.mp4a=function(b){var p=b.samplerate;return m.box(m.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,b.channelCount,0,16,0,0,0,0,p>>8&255,p&255,0,0]),m.box(m.types.esds,m.esds(b)))},m.mp3=function(b){var p=b.samplerate;return m.box(m.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,b.channelCount,0,16,0,0,0,0,p>>8&255,p&255,0,0]))},m.stsd=function(b){return b.type==="audio"?!b.isAAC&&b.codec==="mp3"?m.box(m.types.stsd,m.STSD,m.mp3(b)):m.box(m.types.stsd,m.STSD,m.mp4a(b)):m.box(m.types.stsd,m.STSD,m.avc1(b))},m.tkhd=function(b){var p=b.id,d=b.duration*b.timescale,t=b.width,l=b.height,r=Math.floor(d/(k+1)),i=Math.floor(d%(k+1));return m.box(m.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,p>>24&255,p>>16&255,p>>8&255,p&255,0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,t>>8&255,t&255,0,0,l>>8&255,l&255,0,0]))},m.traf=function(b,p){var d=m.sdtp(b),t=b.id,l=Math.floor(p/(k+1)),r=Math.floor(p%(k+1));return m.box(m.types.traf,m.box(m.types.tfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255])),m.box(m.types.tfdt,new Uint8Array([1,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,r>>24,r>>16&255,r>>8&255,r&255])),m.trun(b,d.length+16+20+8+16+8+8),d)},m.trak=function(b){return b.duration=b.duration||4294967295,m.box(m.types.trak,m.tkhd(b),m.mdia(b))},m.trex=function(b){var p=b.id;return m.box(m.types.trex,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},m.trun=function(b,p){var d=b.samples||[],t=d.length,l=12+16*t,r=new Uint8Array(l),i,o,s,c,a,u;for(p+=8+l,r.set([0,0,15,1,t>>>24&255,t>>>16&255,t>>>8&255,t&255,p>>>24&255,p>>>16&255,p>>>8&255,p&255],0),i=0;i<t;i++)o=d[i],s=o.duration,c=o.size,a=o.flags,u=o.cts,r.set([s>>>24&255,s>>>16&255,s>>>8&255,s&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*i);return m.box(m.types.trun,r)},m.initSegment=function(b){m.types||m.init();var p=m.moov(b),d=new Uint8Array(m.FTYP.byteLength+p.byteLength);return d.set(m.FTYP),d.set(p,m.FTYP.byteLength),d},m}();y.types=void 0,y.HDLR_TYPES=void 0,y.STTS=void 0,y.STSC=void 0,y.STCO=void 0,y.STSZ=void 0,y.VMHD=void 0,y.SMHD=void 0,y.STSD=void 0,y.FTYP=void 0,y.DINF=void 0,v.default=y},"./src/remux/mp4-remuxer.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return u}),C.d(v,"normalizePts",function(){return f});var k=C("./src/polyfills/number.ts"),y=C("./src/remux/aac-helper.ts"),m=C("./src/remux/mp4-generator.ts"),S=C("./src/events.ts"),b=C("./src/errors.ts"),p=C("./src/utils/logger.ts"),d=C("./src/types/loader.ts"),t=C("./src/utils/timescale-conversion.ts");function l(){return l=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var g=arguments[O];for(var x in g)Object.prototype.hasOwnProperty.call(g,x)&&(R[x]=g[x])}return R},l.apply(this,arguments)}var r=10*1e3,i=1024,o=1152,s=null,c=null,a=!1,u=function(){function R(g,x,E,T){if(T===void 0&&(T=""),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=g,this.config=x,this.typeSupported=E,this.ISGenerated=!1,s===null){var M=navigator.userAgent||"",L=M.match(/Chrome\/(\d+)/i);s=L?parseInt(L[1]):0}if(c===null){var A=navigator.userAgent.match(/Safari\/(\d+)/i);c=A?parseInt(A[1]):0}a=!!s&&s<75||!!c&&c<600}var O=R.prototype;return O.destroy=function(){},O.resetTimeStamp=function(x){p.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=x},O.resetNextTimestamp=function(){p.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){p.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(x){var E=!1,T=x.reduce(function(M,L){var A=L.pts-M;return A<-4294967296?(E=!0,f(M,L.pts)):A>0?M:L.pts},x[0].pts);return E&&p.logger.debug("PTS rollover detected"),T},O.remux=function(x,E,T,M,L,A,V,z){var W,G,U,P,H,$,re=L,te=L,ge=x.pid>-1,ve=E.pid>-1,de=E.samples.length,De=x.samples.length>0,Te=de>1,he=(!ge||De)&&(!ve||Te)||this.ISGenerated||V;if(he){this.ISGenerated||(U=this.generateIS(x,E,L));var ue=this.isVideoContiguous,ie=-1;if(Te&&(ie=w(E.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,ie>0){p.logger.warn("[mp4-remuxer]: Dropped "+ie+" out of "+de+" video samples due to a missing keyframe");var Se=this.getVideoStartPts(E.samples);E.samples=E.samples.slice(ie),E.dropped+=ie,te+=(E.samples[0].pts-Se)/(E.timescale||9e4)}else ie===-1&&(p.logger.warn("[mp4-remuxer]: No keyframe found out of "+de+" video samples"),$=!1);if(this.ISGenerated){if(De&&Te){var ne=this.getVideoStartPts(E.samples),ce=f(x.samples[0].pts,ne)-ne,Oe=ce/E.inputTimeScale;re+=Math.max(0,Oe),te+=Math.max(0,-Oe)}if(De){if(x.samplerate||(p.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(x,E,L)),G=this.remuxAudio(x,re,this.isAudioContiguous,A,ve||Te||z===d.PlaylistLevelType.AUDIO?te:void 0),Te){var oe=G?G.endPTS-G.startPTS:0;E.inputTimeScale||(p.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(x,E,L)),W=this.remuxVideo(E,te,ue,oe)}}else Te&&(W=this.remuxVideo(E,te,ue,0));W&&(W.firstKeyFrame=ie,W.independent=ie!==-1)}}return this.ISGenerated&&(T.samples.length&&(H=this.remuxID3(T,L)),M.samples.length&&(P=this.remuxText(M,L))),{audio:G,video:W,initSegment:U,independent:$,text:P,id3:H}},O.generateIS=function(x,E,T){var M=x.samples,L=E.samples,A=this.typeSupported,V={},z=!Object(k.isFiniteNumber)(this._initPTS),W="audio/mp4",G,U,P;if(z&&(G=U=Infinity),x.config&&M.length&&(x.timescale=x.samplerate,x.isAAC||(A.mpeg?(W="audio/mpeg",x.codec=""):A.mp3&&(x.codec="mp3")),V.audio={id:"audio",container:W,codec:x.codec,initSegment:!x.isAAC&&A.mpeg?new Uint8Array(0):m.default.initSegment([x]),metadata:{channelCount:x.channelCount}},z&&(P=x.inputTimeScale,G=U=M[0].pts-Math.round(P*T))),E.sps&&E.pps&&L.length&&(E.timescale=E.inputTimeScale,V.video={id:"main",container:"video/mp4",codec:E.codec,initSegment:m.default.initSegment([E]),metadata:{width:E.width,height:E.height}},z)){P=E.inputTimeScale;var H=this.getVideoStartPts(L),$=Math.round(P*T);U=Math.min(U,f(L[0].dts,H)-$),G=Math.min(G,H-$)}if(Object.keys(V).length)return this.ISGenerated=!0,z&&(this._initPTS=G,this._initDTS=U),{tracks:V,initPTS:G,timescale:P}},O.remuxVideo=function(x,E,T,M){var L=x.inputTimeScale,A=x.samples,V=[],z=A.length,W=this._initPTS,G=this.nextAvcDts,U=8,P,H,$,re=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY,ge=0,ve=!1;if(!T||G===null){var de=E*L,De=A[0].pts-f(A[0].dts,A[0].pts);G=de-De}for(var Te=0;Te<z;Te++){var he=A[Te];if(he.pts=f(he.pts-W,G),he.dts=f(he.dts-W,G),he.dts>he.pts){var ue=9e4*.2;ge=Math.max(Math.min(ge,he.pts-he.dts),-1*ue)}he.dts<A[Te>0?Te-1:Te].dts&&(ve=!0)}ve&&A.sort(function(It,At){var _t=It.dts-At.dts,Vt=It.pts-At.pts;return _t||Vt}),H=A[0].dts,$=A[A.length-1].dts;var ie=Math.round(($-H)/(z-1));if(ge<0){if(ge<ie*-2){p.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(t.toMsFromMpegTsClock)(-ie,!0)+" ms");for(var Se=ge,ne=0;ne<z;ne++)A[ne].dts=Se=Math.max(Se,A[ne].pts-ie),A[ne].pts=Math.max(Se,A[ne].pts)}else{p.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(t.toMsFromMpegTsClock)(ge,!0)+" ms to overcome this issue");for(var ce=0;ce<z;ce++)A[ce].dts=A[ce].dts+ge}H=A[0].dts}if(T){var Oe=H-G,oe=Oe>ie,q=Oe<-1;if(oe||q){oe?p.logger.warn("AVC: "+Object(t.toMsFromMpegTsClock)(Oe,!0)+" ms ("+Oe+"dts) hole between fragments detected, filling it"):p.logger.warn("AVC: "+Object(t.toMsFromMpegTsClock)(-Oe,!0)+" ms ("+Oe+"dts) overlapping between fragments detected"),H=G;var Y=A[0].pts-Oe;A[0].dts=H,A[0].pts=Y,p.logger.log("Video: First PTS/DTS adjusted: "+Object(t.toMsFromMpegTsClock)(Y,!0)+"/"+Object(t.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(t.toMsFromMpegTsClock)(Oe,!0)+" ms")}}a&&(H=Math.max(0,H));for(var Z=0,ye=0,be=0;be<z;be++){for(var Re=A[be],Qe=Re.units,rt=Qe.length,at=0,qe=0;qe<rt;qe++)at+=Qe[qe].data.length;ye+=at,Z+=rt,Re.length=at,Re.dts=Math.max(Re.dts,H),Re.pts=Math.max(Re.pts,Re.dts,0),re=Math.min(Re.pts,re),te=Math.max(Re.pts,te)}$=A[z-1].dts;var st=ye+4*Z+8,lt;try{lt=new Uint8Array(st)}catch(It){this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:b.ErrorTypes.MUX_ERROR,details:b.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:st,reason:"fail allocating video mdat "+st});return}var je=new DataView(lt.buffer);je.setUint32(0,st),lt.set(m.default.types.mdat,4);for(var Ie=0;Ie<z;Ie++){for(var tt=A[Ie],ot=tt.units,ze=0,Ze=0,Ne=ot.length;Ze<Ne;Ze++){var Ae=ot[Ze],Me=Ae.data,Ee=Ae.data.byteLength;je.setUint32(U,Ee),U+=4,lt.set(Me,U),U+=Ee,ze+=4+Ee}if(Ie<z-1)P=A[Ie+1].dts-tt.dts;else{var Ce=this.config,ke=tt.dts-A[Ie>0?Ie-1:Ie].dts;if(Ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var Fe=Math.floor(Ce.maxBufferHole*L),Be=(M?re+M*L:this.nextAudioPts)-tt.pts;Be>Fe?(P=Be-ke,P<0&&(P=ke),p.logger.log("[mp4-remuxer]: It is approximately "+Be/90+" ms to the next segment; using duration "+P/90+" ms for the last video frame.")):P=ke}else P=ke}var et=Math.round(tt.pts-tt.dts);V.push(new _(tt.key,P,ze,et))}if(V.length&&s&&s<70){var ct=V[0].flags;ct.dependsOn=2,ct.isNonSync=0}console.assert(P!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=$+P,this.isVideoContiguous=!0;var yt=m.default.moof(x.sequenceNumber++,H,l({},x,{samples:V})),ft="video",mt={data1:yt,data2:lt,startPTS:re/L,endPTS:(te+P)/L,startDTS:H/L,endDTS:G/L,type:ft,hasAudio:!1,hasVideo:!0,nb:V.length,dropped:x.dropped};return x.samples=[],x.dropped=0,console.assert(lt.length,"MDAT length must not be zero"),mt},O.remuxAudio=function(x,E,T,M,L){var A=x.inputTimeScale,V=x.samplerate?x.samplerate:A,z=A/V,W=x.isAAC?i:o,G=W*z,U=this._initPTS,P=!x.isAAC&&this.typeSupported.mpeg,H=[],$=x.samples,re=P?0:8,te=this.nextAudioPts||-1,ge=E*A;if(this.isAudioContiguous=T=T||$.length&&te>0&&(M&&Math.abs(ge-te)<9e3||Math.abs(f($[0].pts-U,ge)-te)<20*G),$.forEach(function(Me){Me.pts=f(Me.pts-U,ge)}),!T||te<0){if($=$.filter(function(Me){return Me.pts>=0}),!$.length)return;L===0?te=0:M?te=Math.max(0,ge):te=$[0].pts}if(x.isAAC)for(var ve=L!==void 0,de=this.config.maxAudioFramesDrift,De=0,Te=te;De<$.length;De++){var he=$[De],ue=he.pts,ie=ue-Te,Se=Math.abs(1e3*ie/A);if(ie<=-de*G&&ve)De===0&&(p.logger.warn("Audio frame @ "+(ue/A).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ie/A)+" ms."),this.nextAudioPts=te=Te=ue);else if(ie>=de*G&&Se<r&&ve){var ne=Math.round(ie/G);Te=ue-ne*G,Te<0&&(ne--,Te+=G),De===0&&(this.nextAudioPts=te=Te),p.logger.warn("[mp4-remuxer]: Injecting "+ne+" audio frame @ "+(Te/A).toFixed(3)+"s due to "+Math.round(1e3*ie/A)+" ms gap.");for(var ce=0;ce<ne;ce++){var Oe=Math.max(Te,0),oe=y.default.getSilentFrame(x.manifestCodec||x.codec,x.channelCount);oe||(p.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),oe=he.unit.subarray()),$.splice(De,0,{unit:oe,pts:Oe}),Te+=G,De++}}he.pts=Te,Te+=G}for(var q=null,Y=null,Z,ye=0,be=$.length;be--;)ye+=$[be].unit.byteLength;for(var Re=0,Qe=$.length;Re<Qe;Re++){var rt=$[Re],at=rt.unit,qe=rt.pts;if(Y!==null){var st=H[Re-1];st.duration=Math.round((qe-Y)/z)}else if(T&&x.isAAC&&(qe=te),q=qe,ye>0){ye+=re;try{Z=new Uint8Array(ye)}catch(Me){this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:b.ErrorTypes.MUX_ERROR,details:b.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ye,reason:"fail allocating audio mdat "+ye});return}if(!P){var lt=new DataView(Z.buffer);lt.setUint32(0,ye),Z.set(m.default.types.mdat,4)}}else return;Z.set(at,re);var je=at.byteLength;re+=je,H.push(new _(!0,W,je,0)),Y=qe}var Ie=H.length;if(!Ie)return;var tt=H[H.length-1];this.nextAudioPts=te=Y+z*tt.duration;var ot=P?new Uint8Array(0):m.default.moof(x.sequenceNumber++,q/z,l({},x,{samples:H}));x.samples=[];var ze=q/A,Ze=te/A,Ne="audio",Ae={data1:ot,data2:Z,startPTS:ze,endPTS:Ze,startDTS:ze,endDTS:Ze,type:Ne,hasAudio:!0,hasVideo:!1,nb:Ie};return this.isAudioContiguous=!0,console.assert(Z.length,"MDAT length must not be zero"),Ae},O.remuxEmptyAudio=function(x,E,T,M){var L=x.inputTimeScale,A=x.samplerate?x.samplerate:L,V=L/A,z=this.nextAudioPts,W=(z!==null?z:M.startDTS*L)+this._initDTS,G=M.endDTS*L+this._initDTS,U=V*i,P=Math.ceil((G-W)/U),H=y.default.getSilentFrame(x.manifestCodec||x.codec,x.channelCount);if(p.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){p.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],re=0;re<P;re++){var te=W+re*U;$.push({unit:H,pts:te,dts:te})}return x.samples=$,this.remuxAudio(x,E,T,!1)},O.remuxID3=function(x,E){var T=x.samples.length;if(!T)return;for(var M=x.inputTimeScale,L=this._initPTS,A=this._initDTS,V=0;V<T;V++){var z=x.samples[V];z.pts=f(z.pts-L,E*M)/M,z.dts=f(z.dts-A,E*M)/M}var W=x.samples;return x.samples=[],{samples:W}},O.remuxText=function(x,E){var T=x.samples.length;if(!T)return;for(var M=x.inputTimeScale,L=this._initPTS,A=0;A<T;A++){var V=x.samples[A];V.pts=f(V.pts-L,E*M)/M}x.samples.sort(function(W,G){return W.pts-G.pts});var z=x.samples;return x.samples=[],{samples:z}},R}();function f(R,O){var g;if(O===null)return R;for(O<R?g=-8589934592:g=8589934592;Math.abs(R-O)>4294967296;)R+=g;return R}function w(R){for(var O=0;O<R.length;O++)if(R[O].key)return O;return-1}var _=function(O,g,x,E){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=g,this.size=x,this.cts=E,this.flags=new h(O)},h=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/polyfills/number.ts"),y=C("./src/utils/mp4-tools.ts"),m=C("./src/loader/fragment.ts"),S=C("./src/utils/logger.ts"),b=function(){function t(){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 l=t.prototype;return l.destroy=function(){},l.resetTimeStamp=function(i){this.initPTS=i,this.lastEndDTS=null},l.resetNextTimestamp=function(){this.lastEndDTS=null},l.resetInitSegment=function(i,o,s){this.audioCodec=o,this.videoCodec=s,this.generateInitSegment(i),this.emitInitSegment=!0},l.generateInitSegment=function(i){var o=this.audioCodec,s=this.videoCodec;if(!i||!i.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(y.parseInitSegment)(i);o||(o=d(c.audio,m.ElementaryStreamTypes.AUDIO)),s||(s=d(c.video,m.ElementaryStreamTypes.VIDEO));var a={};c.audio&&c.video?a.audiovideo={container:"video/mp4",codec:o+","+s,initSegment:i,id:"main"}:c.audio?a.audio={container:"audio/mp4",codec:o,initSegment:i,id:"audio"}:c.video?a.video={container:"video/mp4",codec:s,initSegment:i,id:"main"}:S.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},l.remux=function(i,o,s,c,a){var u=this.initPTS,f=this.lastEndDTS,w={audio:void 0,video:void 0,text:c,id3:s,initSegment:void 0};Object(k.isFiniteNumber)(f)||(f=this.lastEndDTS=a||0);var _=o.samples;if(!_||!_.length)return w;var h={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(_),R=this.initData),!R||!R.length)return S.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),w;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1),Object(k.isFiniteNumber)(u)||(this.initPTS=h.initPTS=u=p(R,_,f));var O=Object(y.getDuration)(_,R),g=f,x=O+g;Object(y.offsetStartDTS)(R,_,u),O>0?this.lastEndDTS=x:(S.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var E=!!R.audio,T=!!R.video,M="";E&&(M+="audio"),T&&(M+="video");var L={data1:_,startPTS:g,startDTS:g,endPTS:x,endDTS:x,type:M,hasAudio:E,hasVideo:T,nb:1,dropped:0};return w.audio=L.type==="audio"?L:void 0,w.video=L.type!=="audio"?L:void 0,w.text=c,w.id3=s,w.initSegment=h,w},t}(),p=function(l,r,i){return Object(y.getStartDTS)(l,r)-i};function d(t,l){var r=t==null?void 0:t.codec;return r&&r.length>4?r:r==="hvc1"?"hvc1.1.c.L120.90":r==="av01"?"av01.0.04M.08":r==="avc1"||l===m.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}v.default=b},"./src/task-loop.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return k});var k=function(){function y(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var m=y.prototype;return m.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},m.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},m.onHandlerDestroyed=function(){},m.hasInterval=function(){return!!this._tickInterval},m.hasNextTick=function(){return!!this._tickTimer},m.setInterval=function(b){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,b),!0)},m.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},m.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},m.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},m.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},m.doTick=function(){},y}()},"./src/types/cmcd.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"CMCDVersion",function(){return k}),C.d(v,"CMCDObjectType",function(){return y}),C.d(v,"CMCDStreamingFormat",function(){return m}),C.d(v,"CMCDStreamType",function(){return S});var k=1,y;(function(b){b.MANIFEST="m",b.AUDIO="a",b.VIDEO="v",b.MUXED="av",b.INIT="i",b.CAPTION="c",b.TIMED_TEXT="tt",b.KEY="k",b.OTHER="o"})(y||(y={}));var m;(function(b){b.DASH="d",b.HLS="h",b.SMOOTH="s",b.OTHER="o"})(m||(m={}));var S;(function(b){b.VOD="v",b.LIVE="l"})(S||(S={}))},"./src/types/level.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"HlsSkip",function(){return m}),C.d(v,"getSkipValue",function(){return S}),C.d(v,"HlsUrlParameters",function(){return b}),C.d(v,"Level",function(){return p});function k(d,t){for(var l=0;l<t.length;l++){var r=t[l];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(d,r.key,r)}}function y(d,t,l){return t&&k(d.prototype,t),l&&k(d,l),d}var m;(function(d){d.No="",d.Yes="YES",d.v2="v2"})(m||(m={}));function S(d,t){var l=d.canSkipUntil,r=d.canSkipDateRanges,i=d.endSN,o=t!==void 0?t-i:0;return l&&o<l?r?m.v2:m.Yes:m.No}var b=function(){function d(l,r,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=l,this.part=r,this.skip=i}var t=d.prototype;return t.addDirectives=function(r){var i=new self.URL(r);return this.msn!==void 0&&i.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&i.searchParams.set("_HLS_part",this.part.toString()),this.skip&&i.searchParams.set("_HLS_skip",this.skip),i.toString()},d}(),p=function(){function d(t){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=[t.url],this.attrs=t.attrs,this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.unknownCodecs=t.unknownCodecs,this.codecSet=[t.videoCodec,t.audioCodec].filter(function(l){return l}).join(",").replace(/\.[^.,]+/g,"")}return y(d,[{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(l){var r=l%this.url.length;this._urlId!==r&&(this.details=void 0,this._urlId=r)}}]),d}()},"./src/types/loader.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"PlaylistContextType",function(){return k}),C.d(v,"PlaylistLevelType",function(){return y});var k;(function(m){m.MANIFEST="manifest",m.LEVEL="level",m.AUDIO_TRACK="audioTrack",m.SUBTITLE_TRACK="subtitleTrack"})(k||(k={}));var y;(function(m){m.MAIN="main",m.AUDIO="audio",m.SUBTITLE="subtitle"})(y||(y={}))},"./src/types/transmuxer.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"ChunkMetadata",function(){return k});var k=function(S,b,p,d,t,l){d===void 0&&(d=0),t===void 0&&(t=-1),l===void 0&&(l=!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=y(),this.buffering={audio:y(),video:y(),audiovideo:y()},this.level=S,this.sn=b,this.id=p,this.size=d,this.part=t,this.partial=l};function y(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"AttrList",function(){return m});var k=/^(\d+)x(\d+)$/,y=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,m=function(){function S(p){typeof p=="string"&&(p=S.parseAttrList(p));for(var d in p)p.hasOwnProperty(d)&&(this[d]=p[d])}var b=S.prototype;return b.decimalInteger=function(d){var t=parseInt(this[d],10);return t>Number.MAX_SAFE_INTEGER?Infinity:t},b.hexadecimalInteger=function(d){if(this[d]){var t=(this[d]||"0x").slice(2);t=(t.length&1?"0":"")+t;for(var l=new Uint8Array(t.length/2),r=0;r<t.length/2;r++)l[r]=parseInt(t.slice(r*2,r*2+2),16);return l}else return null},b.hexadecimalIntegerAsNumber=function(d){var t=parseInt(this[d],16);return t>Number.MAX_SAFE_INTEGER?Infinity:t},b.decimalFloatingPoint=function(d){return parseFloat(this[d])},b.optionalFloat=function(d,t){var l=this[d];return l?parseFloat(l):t},b.enumeratedString=function(d){return this[d]},b.bool=function(d){return this[d]==="YES"},b.decimalResolution=function(d){var t=k.exec(this[d]);return t===null?void 0:{width:parseInt(t[1],10),height:parseInt(t[2],10)}},S.parseAttrList=function(d){var t,l={},r='"';for(y.lastIndex=0;(t=y.exec(d))!==null;){var i=t[2];i.indexOf(r)===0&&i.lastIndexOf(r)===i.length-1&&(i=i.slice(1,-1)),l[t[1]]=i}return l},S}()},"./src/utils/binary-search.ts":function(N,v,C){"use strict";C.r(v);var k={search:function(m,S){for(var b=0,p=m.length-1,d=null,t=null;b<=p;){d=(b+p)/2|0,t=m[d];var l=S(t);if(l>0)b=d+1;else if(l<0)p=d-1;else return t}return null}};v.default=k},"./src/utils/buffer-helper.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"BufferHelper",function(){return m});var k=C("./src/utils/logger.ts"),y={length:0,start:function(){return 0},end:function(){return 0}},m=function(){function S(){}return S.isBuffered=function(p,d){try{if(p){for(var t=S.getBuffered(p),l=0;l<t.length;l++)if(d>=t.start(l)&&d<=t.end(l))return!0}}catch(r){}return!1},S.bufferInfo=function(p,d,t){try{if(p){var l=S.getBuffered(p),r=[],i;for(i=0;i<l.length;i++)r.push({start:l.start(i),end:l.end(i)});return this.bufferedInfo(r,d,t)}}catch(o){}return{len:0,start:d,end:d,nextStart:void 0}},S.bufferedInfo=function(p,d,t){d=Math.max(0,d),p.sort(function(h,R){var O=h.start-R.start;return O||R.end-h.end});var l=[];if(t)for(var r=0;r<p.length;r++){var i=l.length;if(i){var o=l[i-1].end;p[r].start-o<t?p[r].end>o&&(l[i-1].end=p[r].end):l.push(p[r])}else l.push(p[r])}else l=p;for(var s=0,c,a=d,u=d,f=0;f<l.length;f++){var w=l[f].start,_=l[f].end;if(d+t>=w&&d<_)a=w,u=_,s=u-d;else if(d+t<w){c=w;break}}return{len:s,start:a||0,end:u||0,nextStart:c}},S.getBuffered=function(p){try{return p.buffered}catch(d){return k.logger.log("failed to get media.buffered",d),y}},S}()},"./src/utils/cea-608-parser.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"Row",function(){return u}),C.d(v,"CaptionScreen",function(){return f});var k=C("./src/utils/logger.ts"),y={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},m=function(x){var E=x;return y.hasOwnProperty(x)&&(E=y[x]),String.fromCharCode(E)},S=15,b=100,p={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},d={17:2,18:4,21:6,22:8,23:10,19:13,20:15},t={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},l={25:2,26:4,29:6,30:8,31:10,27:13,28:15},r=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],i;(function(g){g[g.ERROR=0]="ERROR",g[g.TEXT=1]="TEXT",g[g.WARNING=2]="WARNING",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g[g.DATA=3]="DATA"})(i||(i={}));var o=function(){function g(){this.time=null,this.verboseLevel=i.ERROR}var x=g.prototype;return x.log=function(T,M){this.verboseLevel>=T&&k.logger.log(this.time+" ["+T+"] "+M)},g}(),s=function(x){for(var E=[],T=0;T<x.length;T++)E.push(x[T].toString(16));return E},c=function(){function g(E,T,M,L,A){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=E||"white",this.underline=T||!1,this.italics=M||!1,this.background=L||"black",this.flash=A||!1}var x=g.prototype;return x.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},x.setStyles=function(T){for(var M=["foreground","underline","italics","background","flash"],L=0;L<M.length;L++){var A=M[L];T.hasOwnProperty(A)&&(this[A]=T[A])}},x.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},x.equals=function(T){return this.foreground===T.foreground&&this.underline===T.underline&&this.italics===T.italics&&this.background===T.background&&this.flash===T.flash},x.copy=function(T){this.foreground=T.foreground,this.underline=T.underline,this.italics=T.italics,this.background=T.background,this.flash=T.flash},x.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},g}(),a=function(){function g(E,T,M,L,A,V){this.uchar=void 0,this.penState=void 0,this.uchar=E||" ",this.penState=new c(T,M,L,A,V)}var x=g.prototype;return x.reset=function(){this.uchar=" ",this.penState.reset()},x.setChar=function(T,M){this.uchar=T,this.penState.copy(M)},x.setPenState=function(T){this.penState.copy(T)},x.equals=function(T){return this.uchar===T.uchar&&this.penState.equals(T.penState)},x.copy=function(T){this.uchar=T.uchar,this.penState.copy(T.penState)},x.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},g}(),u=function(){function g(E){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var T=0;T<b;T++)this.chars.push(new a);this.logger=E,this.pos=0,this.currPenState=new c}var x=g.prototype;return x.equals=function(T){for(var M=!0,L=0;L<b;L++)if(!this.chars[L].equals(T.chars[L])){M=!1;break}return M},x.copy=function(T){for(var M=0;M<b;M++)this.chars[M].copy(T.chars[M])},x.isEmpty=function(){for(var T=!0,M=0;M<b;M++)if(!this.chars[M].isEmpty()){T=!1;break}return T},x.setCursor=function(T){this.pos!==T&&(this.pos=T),this.pos<0?(this.logger.log(i.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>b&&(this.logger.log(i.DEBUG,"Too large cursor position "+this.pos),this.pos=b)},x.moveCursor=function(T){var M=this.pos+T;if(T>1)for(var L=this.pos+1;L<M+1;L++)this.chars[L].setPenState(this.currPenState);this.setCursor(M)},x.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},x.insertChar=function(T){T>=144&&this.backSpace();var M=m(T);if(this.pos>=b){this.logger.log(i.ERROR,"Cannot insert "+T.toString(16)+" ("+M+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(M,this.currPenState),this.moveCursor(1)},x.clearFromPos=function(T){var M;for(M=T;M<b;M++)this.chars[M].reset()},x.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},x.clearToEndOfRow=function(){this.clearFromPos(this.pos)},x.getTextString=function(){for(var T=[],M=!0,L=0;L<b;L++){var A=this.chars[L].uchar;A!==" "&&(M=!1),T.push(A)}return M?"":T.join("")},x.setPenStyles=function(T){this.currPenState.setStyles(T);var M=this.chars[this.pos];M.setPenState(this.currPenState)},g}(),f=function(){function g(E){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var T=0;T<S;T++)this.rows.push(new u(E));this.logger=E,this.currRow=S-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var x=g.prototype;return x.reset=function(){for(var T=0;T<S;T++)this.rows[T].clear();this.currRow=S-1},x.equals=function(T){for(var M=!0,L=0;L<S;L++)if(!this.rows[L].equals(T.rows[L])){M=!1;break}return M},x.copy=function(T){for(var M=0;M<S;M++)this.rows[M].copy(T.rows[M])},x.isEmpty=function(){for(var T=!0,M=0;M<S;M++)if(!this.rows[M].isEmpty()){T=!1;break}return T},x.backSpace=function(){var T=this.rows[this.currRow];T.backSpace()},x.clearToEndOfRow=function(){var T=this.rows[this.currRow];T.clearToEndOfRow()},x.insertChar=function(T){var M=this.rows[this.currRow];M.insertChar(T)},x.setPen=function(T){var M=this.rows[this.currRow];M.setPenStyles(T)},x.moveCursor=function(T){var M=this.rows[this.currRow];M.moveCursor(T)},x.setCursor=function(T){this.logger.log(i.INFO,"setCursor: "+T);var M=this.rows[this.currRow];M.setCursor(T)},x.setPAC=function(T){this.logger.log(i.INFO,"pacData = "+JSON.stringify(T));var M=T.row-1;if(this.nrRollUpRows&&M<this.nrRollUpRows-1&&(M=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==M){for(var L=0;L<S;L++)this.rows[L].clear();var A=this.currRow+1-this.nrRollUpRows,V=this.lastOutputScreen;if(V){var z=V.rows[A].cueStartTime,W=this.logger.time;if(z&&W!==null&&z<W)for(var G=0;G<this.nrRollUpRows;G++)this.rows[M-this.nrRollUpRows+G+1].copy(V.rows[A+G])}}this.currRow=M;var U=this.rows[this.currRow];if(T.indent!==null){var P=T.indent,H=Math.max(P-1,0);U.setCursor(T.indent),T.color=U.chars[H].penState.foreground}var $={foreground:T.color,underline:T.underline,italics:T.italics,background:"black",flash:!1};this.setPen($)},x.setBkgData=function(T){this.logger.log(i.INFO,"bkgData = "+JSON.stringify(T)),this.backSpace(),this.setPen(T),this.insertChar(32)},x.setRollUpRows=function(T){this.nrRollUpRows=T},x.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(i.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(i.TEXT,this.getDisplayText());var T=this.currRow+1-this.nrRollUpRows,M=this.rows.splice(T,1)[0];M.clear(),this.rows.splice(this.currRow,0,M),this.logger.log(i.INFO,"Rolling up")},x.getDisplayText=function(T){T=T||!1;for(var M=[],L="",A=-1,V=0;V<S;V++){var z=this.rows[V].getTextString();z&&(A=V+1,T?M.push("Row "+A+": '"+z+"'"):M.push(z.trim()))}return M.length>0&&(T?L="["+M.join(" | ")+"]":L=M.join(`
|
|
|
`)),L},x.getTextAndFormat=function(){return this.rows},g}(),w=function(){function g(E,T,M){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=E,this.outputFilter=T,this.mode=null,this.verbose=0,this.displayedMemory=new f(M),this.nonDisplayedMemory=new f(M),this.lastOutputScreen=new f(M),this.currRollUpRow=this.displayedMemory.rows[S-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=M}var x=g.prototype;return x.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[S-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},x.getHandler=function(){return this.outputFilter},x.setHandler=function(T){this.outputFilter=T},x.setPAC=function(T){this.writeScreen.setPAC(T)},x.setBkgData=function(T){this.writeScreen.setBkgData(T)},x.setMode=function(T){if(T===this.mode)return;this.mode=T,this.logger.log(i.INFO,"MODE="+T),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=T},x.insertChars=function(T){for(var M=0;M<T.length;M++)this.writeScreen.insertChar(T[M]);var L=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(i.INFO,L+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(i.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},x.ccRCL=function(){this.logger.log(i.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},x.ccBS=function(){if(this.logger.log(i.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},x.ccAOF=function(){},x.ccAON=function(){},x.ccDER=function(){this.logger.log(i.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},x.ccRU=function(T){this.logger.log(i.INFO,"RU("+T+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(T)},x.ccFON=function(){this.logger.log(i.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},x.ccRDC=function(){this.logger.log(i.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},x.ccTR=function(){this.logger.log(i.INFO,"TR"),this.setMode("MODE_TEXT")},x.ccRTD=function(){this.logger.log(i.INFO,"RTD"),this.setMode("MODE_TEXT")},x.ccEDM=function(){this.logger.log(i.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},x.ccCR=function(){this.logger.log(i.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},x.ccENM=function(){this.logger.log(i.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},x.ccEOC=function(){if(this.logger.log(i.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var T=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=T,this.writeScreen=this.nonDisplayedMemory,this.logger.log(i.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},x.ccTO=function(T){this.logger.log(i.INFO,"TO("+T+") - Tab Offset"),this.writeScreen.moveCursor(T)},x.ccMIDROW=function(T){var M={flash:!1};if(M.underline=T%2===1,M.italics=T>=46,M.italics)M.foreground="white";else{var L=Math.floor(T/2)-16,A=["white","green","blue","cyan","red","yellow","magenta"];M.foreground=A[L]}this.logger.log(i.INFO,"MIDROW: "+JSON.stringify(M)),this.writeScreen.setPen(M)},x.outputDataUpdate=function(T){T===void 0&&(T=!1);var M=this.logger.time;if(M===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=M:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,M,this.lastOutputScreen),T&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:M),this.lastOutputScreen.copy(this.displayedMemory))},x.cueSplitAtTime=function(T){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,T,this.displayedMemory),this.cueStartTime=T))},g}(),_=function(){function g(E,T,M){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var L=new o;this.channels=[null,new w(E,T,L),new w(E+1,M,L)],this.cmdHistory=O(),this.logger=L}var x=g.prototype;return x.getHandler=function(T){return this.channels[T].getHandler()},x.setHandler=function(T,M){this.channels[T].setHandler(M)},x.addData=function(T,M){var L,A,V,z=!1;this.logger.time=T;for(var W=0;W<M.length;W+=2){if(A=M[W]&127,V=M[W+1]&127,A===0&&V===0)continue;if(this.logger.log(i.DATA,"["+s([M[W],M[W+1]])+"] -> ("+s([A,V])+")"),L=this.parseCmd(A,V),L||(L=this.parseMidrow(A,V)),L||(L=this.parsePAC(A,V)),L||(L=this.parseBackgroundAttributes(A,V)),!L&&(z=this.parseChars(A,V),z)){var G=this.currentChannel;if(G&&G>0){var U=this.channels[G];U.insertChars(z)}else this.logger.log(i.WARNING,"No channel found yet. TEXT-MODE?")}!L&&!z&&this.logger.log(i.WARNING,"Couldn't parse cleaned data "+s([A,V])+" orig: "+s([M[W],M[W+1]]))}},x.parseCmd=function(T,M){var L=this.cmdHistory,A=(T===20||T===28||T===21||T===29)&&M>=32&&M<=47,V=(T===23||T===31)&&M>=33&&M<=35;if(!(A||V))return!1;if(R(T,M,L))return h(null,null,L),this.logger.log(i.DEBUG,"Repeated command ("+s([T,M])+") is dropped"),!0;var z=T===20||T===21||T===23?1:2,W=this.channels[z];return T===20||T===21||T===28||T===29?M===32?W.ccRCL():M===33?W.ccBS():M===34?W.ccAOF():M===35?W.ccAON():M===36?W.ccDER():M===37?W.ccRU(2):M===38?W.ccRU(3):M===39?W.ccRU(4):M===40?W.ccFON():M===41?W.ccRDC():M===42?W.ccTR():M===43?W.ccRTD():M===44?W.ccEDM():M===45?W.ccCR():M===46?W.ccENM():M===47&&W.ccEOC():W.ccTO(M-32),h(T,M,L),this.currentChannel=z,!0},x.parseMidrow=function(T,M){var L=0;if((T===17||T===25)&&M>=32&&M<=47){if(T===17?L=1:L=2,L!==this.currentChannel)return this.logger.log(i.ERROR,"Mismatch channel in midrow parsing"),!1;var A=this.channels[L];return A?(A.ccMIDROW(M),this.logger.log(i.DEBUG,"MIDROW ("+s([T,M])+")"),!0):!1}return!1},x.parsePAC=function(T,M){var L,A=this.cmdHistory,V=(T>=17&&T<=23||T>=25&&T<=31)&&M>=64&&M<=127,z=(T===16||T===24)&&M>=64&&M<=95;if(!(V||z))return!1;if(R(T,M,A))return h(null,null,A),!0;var W=T<=23?1:2;M>=64&&M<=95?L=W===1?p[T]:t[T]:L=W===1?d[T]:l[T];var G=this.channels[W];return G?(G.setPAC(this.interpretPAC(L,M)),h(T,M,A),this.currentChannel=W,!0):!1},x.interpretPAC=function(T,M){var L,A={color:null,italics:!1,indent:null,underline:!1,row:T};return M>95?L=M-96:L=M-64,A.underline=(L&1)===1,L<=13?A.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(L/2)]:L<=15?(A.italics=!0,A.color="white"):A.indent=Math.floor((L-16)/2)*4,A},x.parseChars=function(T,M){var L,A=null,V=null;if(T>=25?(L=2,V=T-8):(L=1,V=T),V>=17&&V<=19){var z;V===17?z=M+80:V===18?z=M+112:z=M+144,this.logger.log(i.INFO,"Special char '"+m(z)+"' in channel "+L),A=[z]}else T>=32&&T<=127&&(A=M===0?[T]:[T,M]);if(A){var W=s(A);this.logger.log(i.DEBUG,"Char codes = "+W.join(",")),h(T,M,this.cmdHistory)}return A},x.parseBackgroundAttributes=function(T,M){var L=(T===16||T===24)&&M>=32&&M<=47,A=(T===23||T===31)&&M>=45&&M<=47;if(!(L||A))return!1;var V,z={};T===16||T===24?(V=Math.floor((M-32)/2),z.background=r[V],M%2===1&&(z.background=z.background+"_semi")):M===45?z.background="transparent":(z.foreground="black",M===47&&(z.underline=!0));var W=T<=23?1:2,G=this.channels[W];return G.setBkgData(z),h(T,M,this.cmdHistory),!0},x.reset=function(){for(var T=0;T<Object.keys(this.channels).length;T++){var M=this.channels[T];M&&M.reset()}this.cmdHistory=O()},x.cueSplitAtTime=function(T){for(var M=0;M<this.channels.length;M++){var L=this.channels[M];L&&L.cueSplitAtTime(T)}},g}();function h(g,x,E){E.a=g,E.b=x}function R(g,x,E){return E.a===g&&E.b===x}function O(){return{a:null,b:null}}v.default=_},"./src/utils/codecs.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"isCodecType",function(){return y}),C.d(v,"isCodecSupportedInMp4",function(){return m});var k={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 y(S,b){var p=k[b];return!!p&&p[S.slice(0,4)]===!0}function m(S,b){return MediaSource.isTypeSupported((b||"video")+'/mp4;codecs="'+S+'"')}},"./src/utils/cues.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/utils/vttparser.ts"),y=C("./src/utils/webvtt-parser.ts"),m=C("./src/utils/texttrack-utils.ts"),S=/\s/,b={newCue:function(d,t,l,r){for(var i=[],o,s,c,a,u,f=self.VTTCue||self.TextTrackCue,w=0;w<r.rows.length;w++)if(o=r.rows[w],c=!0,a=0,u="",!o.isEmpty()){for(var _=0;_<o.chars.length;_++)S.test(o.chars[_].uchar)&&c?a++:(u+=o.chars[_].uchar,c=!1);o.cueStartTime=t,t===l&&(l+=1e-4),a>=16?a--:a++;var h=Object(k.fixLineBreaks)(u.trim()),R=Object(y.generateCueId)(t,l,h);(!d||!d.cues||!d.cues.getCueById(R))&&(s=new f(t,l,h),s.id=R,s.line=w+1,s.align="left",s.position=10+Math.min(80,Math.floor(a*8/32)*10),i.push(s))}return d&&i.length&&(i.sort(function(O,g){return O.line==="auto"||g.line==="auto"?0:O.line>8&&g.line>8?g.line-O.line:O.line-g.line}),i.forEach(function(O){return Object(m.addCueToTrack)(d,O)})),i}};v.default=b},"./src/utils/discontinuities.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"findFirstFragWithCC",function(){return S}),C.d(v,"shouldAlignOnDiscontinuities",function(){return b}),C.d(v,"findDiscontinuousReferenceFrag",function(){return p}),C.d(v,"adjustSlidingStart",function(){return t}),C.d(v,"alignStream",function(){return l}),C.d(v,"alignPDT",function(){return i}),C.d(v,"alignFragmentByPDTDelta",function(){return o}),C.d(v,"alignMediaPlaylistByPDT",function(){return s});var k=C("./src/polyfills/number.ts"),y=C("./src/utils/logger.ts"),m=C("./src/controller/level-helper.ts");function S(c,a){for(var u=null,f=0,w=c.length;f<w;f++){var _=c[f];if(_&&_.cc===a){u=_;break}}return u}function b(c,a,u){return!!(a.details&&(u.endCC>u.startCC||c&&c.cc<u.startCC))}function p(c,a){var u=c.fragments,f=a.fragments;if(!f.length||!u.length){y.logger.log("No fragments to align");return}var w=S(u,f[0].cc);if(!w||w&&!w.startPTS){y.logger.log("No frag in previous level to align on");return}return w}function d(c,a){if(c){var u=c.start+a;c.start=c.startPTS=u,c.endPTS=u+c.duration}}function t(c,a){for(var u=a.fragments,f=0,w=u.length;f<w;f++)d(u[f],c);a.fragmentHint&&d(a.fragmentHint,c),a.alignedSliding=!0}function l(c,a,u){if(!a)return;r(c,u,a),!u.alignedSliding&&a.details&&i(u,a.details),!u.alignedSliding&&a.details&&!u.skippedSegments&&Object(m.adjustSliding)(a.details,u)}function r(c,a,u){if(b(c,u,a)){var f=p(u.details,a);f&&Object(k.isFiniteNumber)(f.start)&&(y.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),t(f.start,a))}}function i(c,a){if(!a.fragments.length||!c.hasProgramDateTime||!a.hasProgramDateTime)return;var u=a.fragments[0].programDateTime,f=c.fragments[0].programDateTime,w=(f-u)/1e3+a.fragments[0].start;w&&Object(k.isFiniteNumber)(w)&&(y.logger.log("Adjusting PTS using programDateTime delta "+(f-u)+"ms, sliding:"+w.toFixed(3)+" "+c.url+" "),t(w,c))}function o(c,a){var u=c.programDateTime;if(!u)return;var f=(u-a)/1e3;c.start=c.startPTS=f,c.endPTS=f+c.duration}function s(c,a){if(!a.fragments.length||!c.hasProgramDateTime||!a.hasProgramDateTime)return;var u=a.fragments[0].programDateTime,f=a.fragments[0].start,w=u-f*1e3;c.fragments.forEach(function(_){o(_,w)}),c.fragmentHint&&o(c.fragmentHint,w),c.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/utils/ewma.ts"),y=function(){function m(b,p,d){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=d,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new k.default(b),this.fast_=new k.default(p)}var S=m.prototype;return S.update=function(p,d){var t=this.slow_,l=this.fast_;this.slow_.halfLife!==p&&(this.slow_=new k.default(p,t.getEstimate(),t.getTotalWeight())),this.fast_.halfLife!==d&&(this.fast_=new k.default(d,l.getEstimate(),l.getTotalWeight()))},S.sample=function(p,d){p=Math.max(p,this.minDelayMs_);var t=8*d,l=p/1e3,r=t/l;this.fast_.sample(l,r),this.slow_.sample(l,r)},S.canEstimate=function(){var p=this.fast_;return p&&p.getTotalWeight()>=this.minWeight_},S.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},S.destroy=function(){},m}();v.default=y},"./src/utils/ewma.ts":function(N,v,C){"use strict";C.r(v);var k=function(){function y(S,b,p){b===void 0&&(b=0),p===void 0&&(p=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=S,this.alpha_=S?Math.exp(Math.log(.5)/S):0,this.estimate_=b,this.totalWeight_=p}var m=y.prototype;return m.sample=function(b,p){var d=Math.pow(this.alpha_,b);this.estimate_=p*(1-d)+d*this.estimate_,this.totalWeight_+=b},m.getTotalWeight=function(){return this.totalWeight_},m.getEstimate=function(){if(this.alpha_){var b=1-Math.pow(this.alpha_,this.totalWeight_);if(b)return this.estimate_/b}return this.estimate_},y}();v.default=k},"./src/utils/fetch-loader.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"fetchSupported",function(){return o});var k=C("./src/polyfills/number.ts"),y=C("./src/loader/load-stats.ts"),m=C("./src/demux/chunk-cache.ts");function S(f,w){f.prototype=Object.create(w.prototype),f.prototype.constructor=f,l(f,w)}function b(f){var w=typeof Map=="function"?new Map:void 0;return b=function(h){if(h===null||!t(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(h))return w.get(h);w.set(h,R)}function R(){return p(h,arguments,r(this).constructor)}return R.prototype=Object.create(h.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),l(R,h)},b(f)}function p(f,w,_){return d()?p=Reflect.construct:p=function(R,O,g){var x=[null];x.push.apply(x,O);var E=Function.bind.apply(R,x),T=new E;return g&&l(T,g.prototype),T},p.apply(null,arguments)}function d(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(f){return!1}}function t(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function l(f,w){return l=Object.setPrototypeOf||function(h,R){return h.__proto__=R,h},l(f,w)}function r(f){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},r(f)}function i(){return i=Object.assign||function(f){for(var w=1;w<arguments.length;w++){var _=arguments[w];for(var h in _)Object.prototype.hasOwnProperty.call(_,h)&&(f[h]=_[h])}return f},i.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(f){}return!1}var s=function(){function f(_){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=_.fetchSetup||a,this.controller=new self.AbortController,this.stats=new y.LoadStats}var w=f.prototype;return w.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},w.abortInternal=function(){var h=this.response;(!h||!h.ok)&&(this.stats.aborted=!0,this.controller.abort())},w.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},w.load=function(h,R,O){var g=this,x=this.stats;if(x.loading.start)throw new Error("Loader can only be used once.");x.loading.start=self.performance.now();var E=c(h,this.controller.signal),T=O.onProgress,M=h.responseType==="arraybuffer",L=M?"byteLength":"length";this.context=h,this.config=R,this.callbacks=O,this.request=this.fetchSetup(h,E),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){g.abortInternal(),O.onTimeout(x,h,g.response)},R.timeout),self.fetch(this.request).then(function(A){if(g.response=g.loader=A,!A.ok){var V=A.status,z=A.statusText;throw new u(z||"fetch, bad network response",V,A)}return x.loading.first=Math.max(self.performance.now(),x.loading.start),x.total=parseInt(A.headers.get("Content-Length")||"0"),T&&Object(k.isFiniteNumber)(R.highWaterMark)?g.loadProgressively(A,x,h,R.highWaterMark,T):M?A.arrayBuffer():A.text()}).then(function(A){var V=g.response;self.clearTimeout(g.requestTimeout),x.loading.end=Math.max(self.performance.now(),x.loading.first),x.loaded=x.total=A[L];var z={url:V.url,data:A};T&&!Object(k.isFiniteNumber)(R.highWaterMark)&&T(x,h,A,V),O.onSuccess(z,x,h,V)}).catch(function(A){if(self.clearTimeout(g.requestTimeout),x.aborted)return;var V=A.code||0;O.onError({code:V,text:A.message},h,A.details)})},w.getCacheAge=function(){var h=null;if(this.response){var R=this.response.headers.get("age");h=R?parseFloat(R):null}return h},w.loadProgressively=function(h,R,O,g,x){g===void 0&&(g=0);var E=new m.default,T=h.body.getReader(),M=function L(){return T.read().then(function(A){if(A.done)return E.dataLength&&x(R,O,E.flush(),h),Promise.resolve(new ArrayBuffer(0));var V=A.value,z=V.length;return R.loaded+=z,z<g||E.dataLength?(E.push(V),E.dataLength>=g&&x(R,O,E.flush(),h)):x(R,O,V,h),L()}).catch(function(){return Promise.reject()})};return M()},f}();function c(f,w){var _={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(i({},f.headers))};return f.rangeEnd&&_.headers.set("Range","bytes="+f.rangeStart+"-"+String(f.rangeEnd-1)),_}function a(f,w){return new self.Request(f.url,w)}var u=function(f){S(w,f);function w(_,h,R){var O;return O=f.call(this,_)||this,O.code=void 0,O.details=void 0,O.code=h,O.details=R,O}return w}(b(Error));v.default=s},"./src/utils/imsc1-ttml-parser.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"IMSC1_CODEC",function(){return t}),C.d(v,"parseIMSC1",function(){return o});var k=C("./src/utils/mp4-tools.ts"),y=C("./src/utils/vttparser.ts"),m=C("./src/utils/vttcue.ts"),S=C("./src/demux/id3.ts"),b=C("./src/utils/timescale-conversion.ts"),p=C("./src/utils/webvtt-parser.ts");function d(){return d=Object.assign||function(g){for(var x=1;x<arguments.length;x++){var E=arguments[x];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(g[T]=E[T])}return g},d.apply(this,arguments)}var t="stpp.ttml.im1t",l=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,r=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,i={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(g,x,E,T,M){var L=Object(k.findBox)(new Uint8Array(g),["mdat"]);if(L.length===0){M(new Error("Could not parse IMSC1 mdat"));return}var A=L[0],V=Object(S.utf8ArrayToStr)(new Uint8Array(g,A.start,A.end-A.start)),z=Object(b.toTimescaleFromScale)(x,1,E);try{T(s(V,z))}catch(W){M(W)}}function s(g,x){var E=new DOMParser,T=E.parseFromString(g,"text/xml"),M=T.getElementsByTagName("tt")[0];if(!M)throw new Error("Invalid ttml");var L={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},A=Object.keys(L).reduce(function(U,P){return U[P]=M.getAttribute("ttp:"+P)||L[P],U},{}),V=M.getAttribute("xml:space")!=="preserve",z=a(c(M,"styling","style")),W=a(c(M,"layout","region")),G=c(M,"body","[begin]");return[].map.call(G,function(U){var P=u(U,V);if(!P||!U.hasAttribute("begin"))return null;var H=h(U.getAttribute("begin"),A),$=h(U.getAttribute("dur"),A),re=h(U.getAttribute("end"),A);if(H===null)throw _(U);if(re===null){if($===null)throw _(U);re=H+$}var te=new m.default(H-x,re-x,P);te.id=Object(p.generateCueId)(te.startTime,te.endTime,te.text);var ge=W[U.getAttribute("region")],ve=z[U.getAttribute("style")];te.position=10,te.size=80;var de=f(ge,ve),De=de.textAlign;if(De){var Te=i[De];Te&&(te.lineAlign=Te),te.align=De}return d(te,de),te}).filter(function(U){return U!==null})}function c(g,x,E){var T=g.getElementsByTagName(x)[0];return T?[].slice.call(T.querySelectorAll(E)):[]}function a(g){return g.reduce(function(x,E){var T=E.getAttribute("xml:id");return T&&(x[T]=E),x},{})}function u(g,x){return[].slice.call(g.childNodes).reduce(function(E,T,M){var L;return T.nodeName==="br"&&M?E+`
|
|
|
`:(L=T.childNodes)!==null&&L!==void 0&&L.length?u(T,x):x?E+T.textContent.trim().replace(/\s+/g," "):E+T.textContent},"")}function f(g,x){var E="http://www.w3.org/ns/ttml#styling",T=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return T.reduce(function(M,L){var A=w(x,E,L)||w(g,E,L);return A&&(M[L]=A),M},{})}function w(g,x,E){return g.hasAttributeNS(x,E)?g.getAttributeNS(x,E):null}function _(g){return new Error("Could not parse ttml timestamp "+g)}function h(g,x){if(!g)return null;var E=Object(y.parseTimeStamp)(g);return E===null&&(l.test(g)?E=R(g,x):r.test(g)&&(E=O(g,x))),E}function R(g,x){var E=l.exec(g),T=(E[4]|0)+(E[5]|0)/x.subFrameRate;return(E[1]|0)*3600+(E[2]|0)*60+(E[3]|0)+T/x.frameRate}function O(g,x){var E=r.exec(g),T=Number(E[1]),M=E[2];switch(M){case"h":return T*3600;case"m":return T*60;case"ms":return T*1e3;case"f":return T/x.frameRate;case"t":return T/x.tickRate}return T}},"./src/utils/logger.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"enableLogs",function(){return p}),C.d(v,"logger",function(){return d});var k=function(){},y={trace:k,debug:k,log:k,warn:k,info:k,error:k},m=y;function S(t){var l=self.console[t];return l?l.bind(self.console,"["+t+"] >"):k}function b(t){for(var l=arguments.length,r=new Array(l>1?l-1:0),i=1;i<l;i++)r[i-1]=arguments[i];r.forEach(function(o){m[o]=t[o]?t[o].bind(t):S(o)})}function p(t){if(self.console&&t===!0||typeof t=="object"){b(t,"debug","log","info","warn","error");try{m.log()}catch(l){m=y}}else m=y}var d=m},"./src/utils/mediakeys-helper.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"KeySystems",function(){return k}),C.d(v,"requestMediaKeySystemAccess",function(){return y});var k;(function(m){m.WIDEVINE="com.widevine.alpha",m.PLAYREADY="com.microsoft.playready"})(k||(k={}));var y=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"getMediaSource",function(){return k});function k(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"bin2str",function(){return b}),C.d(v,"readUint16",function(){return p}),C.d(v,"readUint32",function(){return d}),C.d(v,"writeUint32",function(){return t}),C.d(v,"findBox",function(){return l}),C.d(v,"parseSegmentIndex",function(){return r}),C.d(v,"parseInitSegment",function(){return i}),C.d(v,"getStartDTS",function(){return o}),C.d(v,"getDuration",function(){return s}),C.d(v,"computeRawDurationFromSamples",function(){return c}),C.d(v,"offsetStartDTS",function(){return a}),C.d(v,"segmentValidRange",function(){return u}),C.d(v,"appendUint8Array",function(){return f});var k=C("./src/utils/typed-array.ts"),y=C("./src/loader/fragment.ts"),m=Math.pow(2,32)-1,S=[].push;function b(w){return String.fromCharCode.apply(null,w)}function p(w,_){"data"in w&&(_+=w.start,w=w.data);var h=w[_]<<8|w[_+1];return h<0?65536+h:h}function d(w,_){"data"in w&&(_+=w.start,w=w.data);var h=w[_]<<24|w[_+1]<<16|w[_+2]<<8|w[_+3];return h<0?4294967296+h:h}function t(w,_,h){"data"in w&&(_+=w.start,w=w.data),w[_]=h>>24,w[_+1]=h>>16&255,w[_+2]=h>>8&255,w[_+3]=h&255}function l(w,_){var h=[];if(!_.length)return h;var R,O,g;"data"in w?(R=w.data,O=w.start,g=w.end):(R=w,O=0,g=R.byteLength);for(var x=O;x<g;){var E=d(R,x),T=b(R.subarray(x+4,x+8)),M=E>1?x+E:g;if(T===_[0])if(_.length===1)h.push({data:R,start:x+8,end:M});else{var L=l({data:R,start:x+8,end:M},_.slice(1));L.length&&S.apply(h,L)}x=M}return h}function r(w){var _=l(w,["moov"]),h=_[0],R=h?h.end:null,O=l(w,["sidx"]);if(!O||!O[0])return null;var g=[],x=O[0],E=x.data[0],T=E===0?8:16,M=d(x,T);T+=4;var L=0,A=0;E===0?T+=8:T+=16,T+=2;var V=x.end+A,z=p(x,T);T+=2;for(var W=0;W<z;W++){var G=T,U=d(x,G);G+=4;var P=U&2147483647,H=(U&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=d(x,G);G+=4,g.push({referenceSize:P,subsegmentDuration:$,info:{duration:$/M,start:V,end:V+P-1}}),V+=P,G+=4,T=G}return{earliestPresentationTime:L,timescale:M,version:E,referencesCount:z,references:g,moovEndOffset:R}}function i(w){for(var _=[],h=l(w,["moov","trak"]),R=0;R<h.length;R++){var O=h[R],g=l(O,["tkhd"])[0];if(g){var x=g.data[g.start],E=x===0?12:20,T=d(g,E),M=l(O,["mdia","mdhd"])[0];if(M){x=M.data[M.start],E=x===0?12:20;var L=d(M,E),A=l(O,["mdia","hdlr"])[0];if(A){var V=b(A.data.subarray(A.start+8,A.start+12)),z={soun:y.ElementaryStreamTypes.AUDIO,vide:y.ElementaryStreamTypes.VIDEO}[V];if(z){var W=l(O,["mdia","minf","stbl","stsd"])[0],G=void 0;W&&(G=b(W.data.subarray(W.start+12,W.start+16))),_[T]={timescale:L,type:z},_[z]={timescale:L,id:T,codec:G}}}}}}var U=l(w,["moov","mvex","trex"]);return U.forEach(function(P){var H=d(P,4),$=_[H];$&&($.default={duration:d(P,12),flags:d(P,20)})}),_}function o(w,_){return l(_,["moof","traf"]).reduce(function(h,R){var O=l(R,["tfdt"])[0],g=O.data[O.start],x=l(R,["tfhd"]).reduce(function(E,T){var M=d(T,4),L=w[M];if(L){var A=d(O,4);g===1&&(A*=Math.pow(2,32),A+=d(O,8));var V=L.timescale||9e4,z=A/V;if(isFinite(z)&&(E===null||z<E))return z}return E},null);return x!==null&&isFinite(x)&&(h===null||x<h)?x:h},null)||0}function s(w,_){for(var h=0,R=0,O=0,g=l(w,["moof","traf"]),x=0;x<g.length;x++){var E=g[x],T=l(E,["tfhd"])[0],M=d(T,4),L=_[M];if(!L)continue;var A=L.default,V=d(T,0)|(A==null?void 0:A.flags),z=A==null?void 0:A.duration;V&8&&(V&2?z=d(T,12):z=d(T,8));for(var W=L.timescale||9e4,G=l(E,["trun"]),U=0;U<G.length;U++){if(z){var P=d(G[U],4);h=z*P}else h=c(G[U]);L.type===y.ElementaryStreamTypes.VIDEO?R+=h/W:L.type===y.ElementaryStreamTypes.AUDIO&&(O+=h/W)}}if(R===0&&O===0){var H=r(w);if(H!=null&&H.references)return H.references.reduce(function($,re){return $+re.info.duration||0},0)}return R||O}function c(w){var _=d(w,0),h=8;_&1&&(h+=4),_&4&&(h+=4);for(var R=0,O=d(w,4),g=0;g<O;g++){if(_&256){var x=d(w,h);R+=x,h+=4}_&512&&(h+=4),_&1024&&(h+=4),_&2048&&(h+=4)}return R}function a(w,_,h){l(_,["moof","traf"]).forEach(function(R){l(R,["tfhd"]).forEach(function(O){var g=d(O,4),x=w[g];if(!x)return;var E=x.timescale||9e4;l(R,["tfdt"]).forEach(function(T){var M=T.data[T.start],L=d(T,4);if(M===0)t(T,4,L-h*E);else{L*=Math.pow(2,32),L+=d(T,8),L-=h*E,L=Math.max(L,0);var A=Math.floor(L/(m+1)),V=Math.floor(L%(m+1));t(T,4,A),t(T,8,V)}})})})}function u(w){var _={valid:null,remainder:null},h=l(w,["moof"]);if(h){if(h.length<2)return _.remainder=w,_}else return _;var R=h[h.length-1];return _.valid=Object(k.sliceUint8)(w,0,R.start-8),_.remainder=Object(k.sliceUint8)(w,R.start-8),_}function f(w,_){var h=new Uint8Array(w.length+_.length);return h.set(w),h.set(_,w.length),h}},"./src/utils/output-filter.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"default",function(){return k});var k=function(){function y(S,b){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=S,this.trackName=b}var m=y.prototype;return m.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},m.newCue=function(b,p,d){(this.startTime===null||this.startTime>b)&&(this.startTime=b),this.endTime=p,this.screen=d,this.timelineController.createCaptionsTrack(this.trackName)},m.reset=function(){this.cueRanges=[]},y}()},"./src/utils/texttrack-utils.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"sendAddTrackEvent",function(){return y}),C.d(v,"addCueToTrack",function(){return m}),C.d(v,"clearCurrentCues",function(){return S}),C.d(v,"removeCuesInRange",function(){return b}),C.d(v,"getCuesInRange",function(){return d});var k=C("./src/utils/logger.ts");function y(t,l){var r;try{r=new Event("addtrack")}catch(i){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=t,l.dispatchEvent(r)}function m(t,l){var r=t.mode;if(r==="disabled"&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(l.id))try{if(t.addCue(l),!t.cues.getCueById(l.id))throw new Error("addCue is failed for: "+l)}catch(o){k.logger.debug("[texttrack-utils]: "+o);var i=new self.TextTrackCue(l.startTime,l.endTime,l.text);i.id=l.id,t.addCue(i)}r==="disabled"&&(t.mode=r)}function S(t){var l=t.mode;if(l==="disabled"&&(t.mode="hidden"),t.cues)for(var r=t.cues.length;r--;)t.removeCue(t.cues[r]);l==="disabled"&&(t.mode=l)}function b(t,l,r){var i=t.mode;if(i==="disabled"&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var o=d(t.cues,l,r),s=0;s<o.length;s++)t.removeCue(o[s]);i==="disabled"&&(t.mode=i)}function p(t,l){if(l<t[0].startTime)return 0;var r=t.length-1;if(l>t[r].endTime)return-1;for(var i=0,o=r;i<=o;){var s=Math.floor((o+i)/2);if(l<t[s].startTime)o=s-1;else if(l>t[s].startTime&&i<r)i=s+1;else return s}return t[i].startTime-l<l-t[o].startTime?i:o}function d(t,l,r){var i=[],o=p(t,l);if(o>-1)for(var s=o,c=t.length;s<c;s++){var a=t[s];if(a.startTime>=l&&a.endTime<=r)i.push(a);else if(a.startTime>r)return i}return i}},"./src/utils/time-ranges.ts":function(N,v,C){"use strict";C.r(v);var k={toString:function(m){for(var S="",b=m.length,p=0;p<b;p++)S+="["+m.start(p).toFixed(3)+","+m.end(p).toFixed(3)+"]";return S}};v.default=k},"./src/utils/timescale-conversion.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"toTimescaleFromBase",function(){return y}),C.d(v,"toTimescaleFromScale",function(){return m}),C.d(v,"toMsFromMpegTsClock",function(){return S}),C.d(v,"toMpegTsClockFromTimescale",function(){return b});var k=9e4;function y(p,d,t,l){t===void 0&&(t=1),l===void 0&&(l=!1);var r=p*d*t;return l?Math.round(r):r}function m(p,d,t,l){return t===void 0&&(t=1),l===void 0&&(l=!1),y(p,d,1/t,l)}function S(p,d){return d===void 0&&(d=!1),y(p,1e3,1/k,d)}function b(p,d){return d===void 0&&(d=1),y(p,k,1/d)}},"./src/utils/typed-array.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"sliceUint8",function(){return k});function k(y,m,S){return Uint8Array.prototype.slice?y.slice(m,S):new Uint8Array(Array.prototype.slice.call(y,m,S))}},"./src/utils/vttcue.ts":function(N,v,C){"use strict";C.r(v),v.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var k=["","lr","rl"],y=["start","middle","end","left","right"];function m(t,l){if(typeof l!="string")return!1;if(!Array.isArray(t))return!1;var r=l.toLowerCase();return~t.indexOf(r)?r:!1}function S(t){return m(k,t)}function b(t){return m(y,t)}function p(t){for(var l=arguments.length,r=new Array(l>1?l-1:0),i=1;i<l;i++)r[i-1]=arguments[i];for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var c in s)t[c]=s[c]}return t}function d(t,l,r){var i=this,o={enumerable:!0};i.hasBeenReset=!1;var s="",c=!1,a=t,u=l,f=r,w=null,_="",h=!0,R="auto",O="start",g=50,x="middle",E=50,T="middle";Object.defineProperty(i,"id",p({},o,{get:function(){return s},set:function(L){s=""+L}})),Object.defineProperty(i,"pauseOnExit",p({},o,{get:function(){return c},set:function(L){c=!!L}})),Object.defineProperty(i,"startTime",p({},o,{get:function(){return a},set:function(L){if(typeof L!="number")throw new TypeError("Start time must be set to a number.");a=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"endTime",p({},o,{get:function(){return u},set:function(L){if(typeof L!="number")throw new TypeError("End time must be set to a number.");u=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"text",p({},o,{get:function(){return f},set:function(L){f=""+L,this.hasBeenReset=!0}})),Object.defineProperty(i,"region",p({},o,{get:function(){return w},set:function(L){w=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"vertical",p({},o,{get:function(){return _},set:function(L){var A=S(L);if(A===!1)throw new SyntaxError("An invalid or illegal string was specified.");_=A,this.hasBeenReset=!0}})),Object.defineProperty(i,"snapToLines",p({},o,{get:function(){return h},set:function(L){h=!!L,this.hasBeenReset=!0}})),Object.defineProperty(i,"line",p({},o,{get:function(){return R},set:function(L){if(typeof L!="number"&&L!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"lineAlign",p({},o,{get:function(){return O},set:function(L){var A=b(L);if(!A)throw new SyntaxError("An invalid or illegal string was specified.");O=A,this.hasBeenReset=!0}})),Object.defineProperty(i,"position",p({},o,{get:function(){return g},set:function(L){if(L<0||L>100)throw new Error("Position must be between 0 and 100.");g=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"positionAlign",p({},o,{get:function(){return x},set:function(L){var A=b(L);if(!A)throw new SyntaxError("An invalid or illegal string was specified.");x=A,this.hasBeenReset=!0}})),Object.defineProperty(i,"size",p({},o,{get:function(){return E},set:function(L){if(L<0||L>100)throw new Error("Size must be between 0 and 100.");E=L,this.hasBeenReset=!0}})),Object.defineProperty(i,"align",p({},o,{get:function(){return T},set:function(L){var A=b(L);if(!A)throw new SyntaxError("An invalid or illegal string was specified.");T=A,this.hasBeenReset=!0}})),i.displayState=void 0}return d.prototype.getCueAsHTML=function(){var t=self.WebVTT;return t.convertCueToDOMTree(self,this.text)},d}()},"./src/utils/vttparser.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"parseTimeStamp",function(){return m}),C.d(v,"fixLineBreaks",function(){return l}),C.d(v,"VTTParser",function(){return r});var k=C("./src/utils/vttcue.ts"),y=function(){function i(){}var o=i.prototype;return o.decode=function(c,a){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},i}();function m(i){function o(c,a,u,f){return(c|0)*3600+(a|0)*60+(u|0)+parseFloat(f||0)}var s=i.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?o(s[2],s[3],0,s[4]):o(s[1],s[2],s[3],s[4]):null}var S=function(){function i(){this.values=Object.create(null)}var o=i.prototype;return o.set=function(c,a){!this.get(c)&&a!==""&&(this.values[c]=a)},o.get=function(c,a,u){return u?this.has(c)?this.values[c]:a[u]:this.has(c)?this.values[c]:a},o.has=function(c){return c in this.values},o.alt=function(c,a,u){for(var f=0;f<u.length;++f)if(a===u[f]){this.set(c,a);break}},o.integer=function(c,a){/^-?\d+$/.test(a)&&this.set(c,parseInt(a,10))},o.percent=function(c,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var u=parseFloat(a);if(u>=0&&u<=100)return this.set(c,u),!0}return!1},i}();function b(i,o,s,c){var a=c?i.split(c):[i];for(var u in a){if(typeof a[u]!="string")continue;var f=a[u].split(s);if(f.length!==2)continue;var w=f[0],_=f[1];o(w,_)}}var p=new k.default(0,0,""),d=p.align==="middle"?"middle":"center";function t(i,o,s){var c=i;function a(){var w=m(i);if(w===null)throw new Error("Malformed timestamp: "+c);return i=i.replace(/^[^\sa-zA-Z-]+/,""),w}function u(w,_){var h=new S;b(w,function(g,x){var E;switch(g){case"region":for(var T=s.length-1;T>=0;T--)if(s[T].id===x){h.set(g,s[T].region);break}break;case"vertical":h.alt(g,x,["rl","lr"]);break;case"line":E=x.split(","),h.integer(g,E[0]),h.percent(g,E[0])&&h.set("snapToLines",!1),h.alt(g,E[0],["auto"]),E.length===2&&h.alt("lineAlign",E[1],["start",d,"end"]);break;case"position":E=x.split(","),h.percent(g,E[0]),E.length===2&&h.alt("positionAlign",E[1],["start",d,"end","line-left","line-right","auto"]);break;case"size":h.percent(g,x);break;case"align":h.alt(g,x,["start",d,"end","left","right"]);break}},/:/,/\s/),_.region=h.get("region",null),_.vertical=h.get("vertical","");var R=h.get("line","auto");R==="auto"&&p.line===-1&&(R=-1),_.line=R,_.lineAlign=h.get("lineAlign","start"),_.snapToLines=h.get("snapToLines",!0),_.size=h.get("size",100),_.align=h.get("align",d);var O=h.get("position","auto");O==="auto"&&p.position===50&&(O=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=O}function f(){i=i.replace(/^\s+/,"")}if(f(),o.startTime=a(),f(),i.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);i=i.substr(3),f(),o.endTime=a(),f(),u(i,o)}function l(i){return i.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var r=function(){function i(){this.state="INITIAL",this.buffer="",this.decoder=new y,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=i.prototype;return o.parse=function(c){var a=this;c&&(a.buffer+=a.decoder.decode(c,{stream:!0}));function u(){var O=a.buffer,g=0;for(O=l(O);g<O.length&&O[g]!=="\r"&&O[g]!==`
|
|
|
`;)++g;var x=O.substr(0,g);return O[g]==="\r"&&++g,O[g]===`
|
|
|
`&&++g,a.buffer=O.substr(g),x}function f(O){b(O,function(g,x){},/:/)}try{var w="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;w=u();var _=w.match(/^()?WEBVTT([ \t].*)?$/);if(!_||!_[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var h=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;h?h=!1:w=u();switch(a.state){case"HEADER":/:/.test(w)?f(w):w||(a.state="ID");continue;case"NOTE":w||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(w)){a.state="NOTE";break}if(!w)continue;if(a.cue=new k.default(0,0,""),a.state="CUE",w.indexOf("-->")===-1){a.cue.id=w;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{t(w,a.cue,a.regionList)}catch(O){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var R=w.indexOf("-->")!==-1;if(!w||R&&(h=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=`
|
|
|
`),a.cue.text+=w}continue;case"BADCUE":w||(a.state="ID")}}}catch(O){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var c=this;try{if((c.cue||c.state==="HEADER")&&(c.buffer+=`
|
|
|
|
|
|
`,c.parse()),c.state==="INITIAL"||c.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){c.onparsingerror&&c.onparsingerror(a)}return c.onflush&&c.onflush(),this},i}()},"./src/utils/webvtt-parser.ts":function(N,v,C){"use strict";C.r(v),C.d(v,"generateCueId",function(){return r}),C.d(v,"parseWebVTT",function(){return o});var k=C("./src/polyfills/number.ts"),y=C("./src/utils/vttparser.ts"),m=C("./src/demux/id3.ts"),S=C("./src/utils/timescale-conversion.ts"),b=C("./src/remux/mp4-remuxer.ts"),p=/\r\n|\n\r|\n|\r/g,d=function(c,a,u){return u===void 0&&(u=0),c.substr(u,a.length)===a},t=function(c){var a=parseInt(c.substr(-3)),u=parseInt(c.substr(-6,2)),f=parseInt(c.substr(-9,2)),w=c.length>9?parseInt(c.substr(0,c.indexOf(":"))):0;if(!Object(k.isFiniteNumber)(a)||!Object(k.isFiniteNumber)(u)||!Object(k.isFiniteNumber)(f)||!Object(k.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+c);return a+=1e3*u,a+=60*1e3*f,a+=60*60*1e3*w,a},l=function(c){for(var a=5381,u=c.length;u;)a=a*33^c.charCodeAt(--u);return(a>>>0).toString()};function r(s,c,a){return l(s.toString())+l(c.toString())+l(a)}var i=function(c,a,u){var f=c[a],w=c[f.prevCC];if(!w||!w.new&&f.new){c.ccOffset=c.presentationOffset=f.start,f.new=!1;return}for(;(_=w)!==null&&_!==void 0&&_.new;){var _;c.ccOffset+=f.start-w.start,f.new=!1,f=w,w=c[f.prevCC]}c.presentationOffset=u};function o(s,c,a,u,f,w,_,h){var R=new y.VTTParser,O=Object(m.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(p,`
|
|
|
`).split(`
|
|
|
`),g=[],x=Object(S.toMpegTsClockFromTimescale)(c,a),E="00:00.000",T=0,M=0,L,A=!0,V=!1;R.oncue=function(z){var W=u[f],G=u.ccOffset,U=(T-x)/9e4;if(W!=null&&W.new&&(M!==void 0?G=u.ccOffset=W.start:i(u,f,U)),U&&(G=U-u.presentationOffset),V){var P=z.endTime-z.startTime,H=Object(b.normalizePts)((z.startTime+G-M)*9e4,w*9e4)/9e4;z.startTime=H,z.endTime=H+P}var $=z.text.trim();z.text=decodeURIComponent(encodeURIComponent($)),z.id||(z.id=r(z.startTime,z.endTime,$)),z.endTime>0&&g.push(z)},R.onparsingerror=function(z){L=z},R.onflush=function(){if(L){h(L);return}_(g)},O.forEach(function(z){if(A)if(d(z,"X-TIMESTAMP-MAP=")){A=!1,V=!0,z.substr(16).split(",").forEach(function(W){d(W,"LOCAL:")?E=W.substr(6):d(W,"MPEGTS:")&&(T=parseInt(W.substr(7)))});try{M=t(E)/1e3}catch(W){V=!1,L=W}return}else z===""&&(A=!1);R.parse(z+`
|
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(N,v,C){"use strict";C.r(v);var k=C("./src/utils/logger.ts"),y=C("./src/loader/load-stats.ts"),m=/^age:\s*[\d.]+\s*$/m,S=function(){function b(d){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=d?d.xhrSetup:null,this.stats=new y.LoadStats,this.retryDelay=0}var p=b.prototype;return p.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},p.abortInternal=function(){var t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,t.readyState!==4&&(this.stats.aborted=!0,t.abort()))},p.abort=function(){var t;this.abortInternal(),(t=this.callbacks)!==null&&t!==void 0&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},p.load=function(t,l,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=l,this.callbacks=r,this.retryDelay=l.retryDelay,this.loadInternal()},p.loadInternal=function(){var t=this.config,l=this.context;if(!t)return;var r=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0;var o=this.xhrSetup;try{if(o)try{o(r,l.url)}catch(a){r.open("GET",l.url,!0),o(r,l.url)}r.readyState||r.open("GET",l.url,!0);var s=this.context.headers;if(s)for(var c in s)r.setRequestHeader(c,s[c])}catch(a){this.callbacks.onError({code:r.status,text:a.message},l,r);return}l.rangeEnd&&r.setRequestHeader("Range","bytes="+l.rangeStart+"-"+(l.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=l.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout),r.send()},p.readystatechange=function(){var t=this.context,l=this.loader,r=this.stats;if(!t||!l)return;var i=l.readyState,o=this.config;if(r.aborted)return;if(i>=2)if(self.clearTimeout(this.requestTimeout),r.loading.first===0&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),i===4){l.onreadystatechange=null,l.onprogress=null;var s=l.status;if(s>=200&&s<300){r.loading.end=Math.max(self.performance.now(),r.loading.first);var c,a;if(t.responseType==="arraybuffer"?(c=l.response,a=c.byteLength):(c=l.responseText,a=c.length),r.loaded=r.total=a,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(r,t,c,l),!this.callbacks)return;var f={url:l.responseURL,data:c};this.callbacks.onSuccess(f,r,t,l)}else r.retry>=o.maxRetry||s>=400&&s<499?(k.logger.error(s+" while loading "+t.url),this.callbacks.onError({code:s,text:l.statusText},t,l)):(k.logger.warn(s+" while loading "+t.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,o.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},p.loadtimeout=function(){k.logger.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},p.loadprogress=function(t){var l=this.stats;l.loaded=t.loaded,t.lengthComputable&&(l.total=t.total)},p.getCacheAge=function(){var t=null;if(this.loader&&m.test(this.loader.getAllResponseHeaders())){var l=this.loader.getResponseHeader("age");t=l?parseFloat(l):null}return t},b}();v.default=S}}).default})},vHTk:function(F,Q,j){F.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},w7YG:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("ETIr"),j("cv67"),j("K3mO"),j("OLod"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.StreamCipher,y=v.algo,m=y.RC4=k.extend({_doReset:function(){for(var p=this._key,d=p.words,t=p.sigBytes,l=this._S=[],r=0;r<256;r++)l[r]=r;for(var r=0,i=0;r<256;r++){var o=r%t,s=d[o>>>2]>>>24-o%4*8&255;i=(i+l[r]+s)%256;var c=l[r];l[r]=l[i],l[i]=c}this._i=this._j=0},_doProcessBlock:function(p,d){p[d]^=S.call(this)},keySize:256/32,ivSize:0});function S(){for(var p=this._S,d=this._i,t=this._j,l=0,r=0;r<4;r++){d=(d+1)%256,t=(t+p[d])%256;var i=p[d];p[d]=p[t],p[t]=i,l|=p[(p[d]+p[t])%256]<<24-r*8}return this._i=d,this._j=t,l}v.RC4=k._createHelper(m);var b=y.RC4Drop=m.extend({cfg:m.cfg.extend({drop:192}),_doReset:function(){m._doReset.call(this);for(var p=this.cfg.drop;p>0;p--)S.call(this)}});v.RC4Drop=k._createHelper(b)}(),N.RC4})},wCXF:function(F,Q,j){"use strict";j.d(Q,"a",function(){return at});var N=j("rePB"),v=j("VTBJ"),C=j("KQm4"),k=j("U8pU"),y=j("ODXe"),m=j("cDcd"),S=j("TSYQ"),b=j.n(S),p=j("Gytx"),d=j.n(p),t=j("Kwbf"),l=j("t23M"),r=j("qx4F"),i=j("6eGT"),o=j("IBYe"),s=j("Ff2n"),c=j("c+Xe"),a=j("fyJ8"),u=j("biw7");function f(je,Ie,tt,ot,ze){var Ze=tt[je]||{},Ne=tt[Ie]||{},Ae,Me;Ze.fixed==="left"?Ae=ot.left[je]:Ne.fixed==="right"&&(Me=ot.right[Ie]);var Ee=!1,Ce=!1,ke=!1,Fe=!1,Be=tt[Ie+1],et=tt[je-1];if(ze==="rtl"){if(Ae!==void 0){var ct=et&&et.fixed==="left";Fe=!ct}else if(Me!==void 0){var yt=Be&&Be.fixed==="right";ke=!yt}}else if(Ae!==void 0){var ft=Be&&Be.fixed==="left";Ee=!ft}else if(Me!==void 0){var mt=et&&et.fixed==="right";Ce=!mt}return{fixLeft:Ae,fixRight:Me,lastFixLeft:Ee,firstFixRight:Ce,lastFixRight:ke,firstFixLeft:Fe,isSticky:ot.isSticky}}var w=j("sR1s");function _(je){var Ie=je.cells,tt=je.stickyOffsets,ot=je.flattenColumns,ze=je.rowComponent,Ze=je.cellComponent,Ne=je.onHeaderRow,Ae=je.index,Me=m.useContext(u.a),Ee=Me.prefixCls,Ce=Me.direction,ke;Ne&&(ke=Ne(Ie.map(function(Be){return Be.column}),Ae));var Fe=Object(w.a)(Ie.map(function(Be){return Be.column}));return m.createElement(ze,Object.assign({},ke),Ie.map(function(Be,et){var ct=Be.column,yt=f(Be.colStart,Be.colEnd,ot,tt,Ce),ft;return ct&&ct.onHeaderCell&&(ft=Be.column.onHeaderCell(ct)),m.createElement(a.a,Object.assign({},Be,{ellipsis:ct.ellipsis,align:ct.align,component:Ze,prefixCls:Ee,key:Fe[et]},yt,{additionalProps:ft,rowType:"header"}))}))}_.displayName="HeaderRow";var h=_;function R(je){var Ie=[];function tt(Ne,Ae){var Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ie[Me]=Ie[Me]||[];var Ee=Ae,Ce=Ne.filter(Boolean).map(function(ke){var Fe={key:ke.key,className:ke.className||"",children:ke.title,column:ke,colStart:Ee},Be=1,et=ke.children;return et&&et.length>0&&(Be=tt(et,Ee,Me+1).reduce(function(ct,yt){return ct+yt},0),Fe.hasSubColumns=!0),"colSpan"in ke&&(Be=ke.colSpan),"rowSpan"in ke&&(Fe.rowSpan=ke.rowSpan),Fe.colSpan=Be,Fe.colEnd=Fe.colStart+Be-1,Ie[Me].push(Fe),Ee+=Be,Be});return Ce}tt(je,0);for(var ot=Ie.length,ze=function(Ae){Ie[Ae].forEach(function(Me){!("rowSpan"in Me)&&!Me.hasSubColumns&&(Me.rowSpan=ot-Ae)})},Ze=0;Ze<ot;Ze+=1)ze(Ze);return Ie}function O(je){var Ie=je.stickyOffsets,tt=je.columns,ot=je.flattenColumns,ze=je.onHeaderRow,Ze=m.useContext(u.a),Ne=Ze.prefixCls,Ae=Ze.getComponent,Me=m.useMemo(function(){return R(tt)},[tt]),Ee=Ae(["header","wrapper"],"thead"),Ce=Ae(["header","row"],"tr"),ke=Ae(["header","cell"],"th");return m.createElement(Ee,{className:"".concat(Ne,"-thead")},Me.map(function(Fe,Be){var et=m.createElement(h,{key:Be,flattenColumns:ot,cells:Fe,stickyOffsets:Ie,rowComponent:Ce,cellComponent:ke,onHeaderRow:ze,index:Be});return et}))}var g=O,x=j("hW8S");function E(je){for(var Ie=je.colWidths,tt=je.columns,ot=je.columCount,ze=[],Ze=ot||tt.length,Ne=!1,Ae=Ze-1;Ae>=0;Ae-=1){var Me=Ie[Ae],Ee=tt&&tt[Ae],Ce=Ee&&Ee[x.a];(Me||Ce||Ne)&&(ze.unshift(m.createElement("col",Object.assign({key:Ae,style:{width:Me,minWidth:Me}},Ce))),Ne=!0)}return m.createElement("colgroup",null,ze)}var T=E;function M(je,Ie){return Object(m.useMemo)(function(){for(var tt=[],ot=0;ot<Ie;ot+=1){var ze=je[ot];if(ze!==void 0)tt[ot]=ze;else return null}return tt},[je.join("_"),Ie])}var L=m.forwardRef(function(je,Ie){var tt=je.noData,ot=je.columns,ze=je.flattenColumns,Ze=je.colWidths,Ne=je.columCount,Ae=je.stickyOffsets,Me=je.direction,Ee=je.fixHeader,Ce=je.offsetHeader,ke=je.stickyClassName,Fe=je.onScroll,Be=Object(s.a)(je,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),et=m.useContext(u.a),ct=et.prefixCls,yt=et.scrollbarSize,ft=et.isSticky,mt=ft&&!Ee?0:yt,It=m.useRef(null),At=m.useCallback(function(Lt){Object(c.b)(Ie,Lt),Object(c.b)(It,Lt)},[]);m.useEffect(function(){var Lt;function nr(dt){var Et=dt.currentTarget,jt=dt.deltaX;jt&&(Fe({currentTarget:Et,scrollLeft:Et.scrollLeft+jt}),dt.preventDefault())}return(Lt=It.current)===null||Lt===void 0||Lt.addEventListener("wheel",nr),function(){var dt;(dt=It.current)===null||dt===void 0||dt.removeEventListener("wheel",nr)}},[]);var _t=ze[ze.length-1],Vt={fixed:_t?_t.fixed:null,onHeaderCell:function(){return{className:"".concat(ct,"-cell-scrollbar")}}},Kt=Object(m.useMemo)(function(){return mt?[].concat(Object(C.a)(ot),[Vt]):ot},[mt,ot]),tr=Object(m.useMemo)(function(){return mt?[].concat(Object(C.a)(ze),[Vt]):ze},[mt,ze]),rr=Object(m.useMemo)(function(){var Lt=Ae.right,nr=Ae.left;return Object(v.a)(Object(v.a)({},Ae),{},{left:Me==="rtl"?[].concat(Object(C.a)(nr.map(function(dt){return dt+mt})),[0]):nr,right:Me==="rtl"?Lt:[].concat(Object(C.a)(Lt.map(function(dt){return dt+mt})),[0]),isSticky:ft})},[mt,Ae,ft]),Wt=M(Ze,Ne);return m.createElement("div",{style:Object(v.a)({overflow:"hidden"},ft?{top:Ce}:{}),ref:At,className:b()("".concat(ct,"-header"),Object(N.a)({},ke,!!ke))},m.createElement("table",{style:{tableLayout:"fixed",visibility:tt||Wt?null:"hidden"}},m.createElement(T,{colWidths:Wt?[].concat(Object(C.a)(Wt),[mt]):[],columCount:Ne+1,columns:tr}),m.createElement(g,Object.assign({},Be,{stickyOffsets:rr,columns:Kt,flattenColumns:tr}))))});L.displayName="FixedHeader";var A=L,V=m.createContext(null),z=V;function W(je){var Ie=je.prefixCls,tt=je.children,ot=je.component,ze=je.cellComponent,Ze=je.fixHeader,Ne=je.fixColumn,Ae=je.horizonScroll,Me=je.className,Ee=je.expanded,Ce=je.componentWidth,ke=je.colSpan,Fe=m.useContext(u.a),Be=Fe.scrollbarSize;return m.useMemo(function(){var et=tt;return Ne&&(et=m.createElement("div",{style:{width:Ce-(Ze?Be:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ie,"-expanded-row-fixed")},et)),m.createElement(ot,{className:Me,style:{display:Ee?null:"none"}},m.createElement(a.a,{component:ze,prefixCls:Ie,colSpan:ke},et))},[tt,ot,Ze,Ae,Me,Ee,Ce,ke,Be])}var G=W;function U(je){var Ie=je.className,tt=je.style,ot=je.record,ze=je.index,Ze=je.rowKey,Ne=je.getRowKey,Ae=je.rowExpandable,Me=je.expandedKeys,Ee=je.onRow,Ce=je.indent,ke=Ce===void 0?0:Ce,Fe=je.rowComponent,Be=je.cellComponent,et=je.childrenColumnName,ct=m.useContext(u.a),yt=ct.prefixCls,ft=ct.fixedInfoList,mt=m.useContext(z),It=mt.fixHeader,At=mt.fixColumn,_t=mt.horizonScroll,Vt=mt.componentWidth,Kt=mt.flattenColumns,tr=mt.expandableType,rr=mt.expandRowByClick,Wt=mt.onTriggerExpand,Lt=mt.rowClassName,nr=mt.expandedRowClassName,dt=mt.indentSize,Et=mt.expandIcon,jt=mt.expandedRowRender,kt=mt.expandIconColumnIndex,hr=m.useState(!1),Nn=Object(y.a)(hr,2),Ct=Nn[0],Dt=Nn[1],wt=Me&&Me.has(je.recordKey);m.useEffect(function(){wt&&Dt(!0)},[wt]);var wr=tr==="row"&&(!Ae||Ae(ot)),Cr=tr==="nest",Jt=et&&ot&&ot[et],Ut=wr||Cr,Or;Ee&&(Or=Ee(ot,ze));var un=function(K){if(rr&&Ut&&Wt(ot,K),Or&&Or.onClick){for(var X,ee=arguments.length,me=new Array(ee>1?ee-1:0),ae=1;ae<ee;ae++)me[ae-1]=arguments[ae];(X=Or).onClick.apply(X,[K].concat(me))}},Nr;typeof Lt=="string"?Nr=Lt:typeof Lt=="function"&&(Nr=Lt(ot,ze,ke));var bt=Object(w.a)(Kt),Bt=m.createElement(Fe,Object.assign({},Or,{"data-row-key":Ze,className:b()(Ie,"".concat(yt,"-row"),"".concat(yt,"-row-level-").concat(ke),Nr,Or&&Or.className),style:Object(v.a)(Object(v.a)({},tt),Or?Or.style:null),onClick:un}),Kt.map(function(le,K){var X=le.render,ee=le.dataIndex,me=le.className,ae=bt[K],Ke=ft[K],pt;K===(kt||0)&&Cr&&(pt=m.createElement(m.Fragment,null,m.createElement("span",{style:{paddingLeft:"".concat(dt*ke,"px")},className:"".concat(yt,"-row-indent indent-level-").concat(ke)}),Et({prefixCls:yt,expanded:wt,expandable:Jt,record:ot,onExpand:Wt})));var Ot;return le.onCell&&(Ot=le.onCell(ot,ze)),m.createElement(a.a,Object.assign({className:me,ellipsis:le.ellipsis,align:le.align,component:Be,prefixCls:yt,key:ae,record:ot,index:ze,dataIndex:ee,render:X,shouldCellUpdate:le.shouldCellUpdate},Ke,{appendNode:pt,additionalProps:Ot}))})),Jr;if(wr&&(Ct||wt)){var on=jt(ot,ze,ke+1,wt),Ln=nr&&nr(ot,ze,ke);Jr=m.createElement(G,{expanded:wt,className:b()("".concat(yt,"-expanded-row"),"".concat(yt,"-expanded-row-level-").concat(ke+1),Ln),prefixCls:yt,fixHeader:It,fixColumn:At,horizonScroll:_t,component:Fe,componentWidth:Vt,cellComponent:Be,colSpan:Kt.length},on)}var Sn;return Jt&&wt&&(Sn=(ot[et]||[]).map(function(le,K){var X=Ne(le,K);return m.createElement(U,Object.assign({},je,{key:X,rowKey:X,record:le,recordKey:X,index:K,indent:ke+1}))})),m.createElement(m.Fragment,null,Bt,Jr,Sn)}U.displayName="BodyRow";var P=U,H=m.createContext(null),$=H;function re(je){var Ie=je.columnKey,tt=je.onColumnResize,ot=m.useRef();return m.useEffect(function(){ot.current&&tt(Ie,ot.current.offsetWidth)},[]),m.createElement(l.a,{onResize:function(Ze){var Ne=Ze.offsetWidth;tt(Ie,Ne)}},m.createElement("td",{ref:ot,style:{padding:0,border:0,height:0}},m.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function te(je){var Ie=je.data,tt=je.getRowKey,ot=je.measureColumnWidth,ze=je.expandedKeys,Ze=je.onRow,Ne=je.rowExpandable,Ae=je.emptyNode,Me=je.childrenColumnName,Ee=m.useContext($),Ce=Ee.onColumnResize,ke=m.useContext(u.a),Fe=ke.prefixCls,Be=ke.getComponent,et=m.useContext(z),ct=et.fixHeader,yt=et.horizonScroll,ft=et.flattenColumns,mt=et.componentWidth;return m.useMemo(function(){var It=Be(["body","wrapper"],"tbody"),At=Be(["body","row"],"tr"),_t=Be(["body","cell"],"td"),Vt;Ie.length?Vt=Ie.map(function(tr,rr){var Wt=tt(tr,rr);return m.createElement(P,{key:Wt,rowKey:Wt,record:tr,recordKey:Wt,index:rr,rowComponent:At,cellComponent:_t,expandedKeys:ze,onRow:Ze,getRowKey:tt,rowExpandable:Ne,childrenColumnName:Me})}):Vt=m.createElement(G,{expanded:!0,className:"".concat(Fe,"-placeholder"),prefixCls:Fe,fixHeader:ct,fixColumn:yt,horizonScroll:yt,component:At,componentWidth:mt,cellComponent:_t,colSpan:ft.length},Ae);var Kt=Object(w.a)(ft);return m.createElement(It,{className:"".concat(Fe,"-tbody")},ot&&m.createElement("tr",{"aria-hidden":"true",className:"".concat(Fe,"-measure-row"),style:{height:0}},Kt.map(function(tr){return m.createElement(re,{key:tr,columnKey:tr,onColumnResize:Ce})})),Vt)},[Ie,Fe,Ze,ot,ze,tt,Be,mt,Ae,ft])}var ge=m.memo(te);ge.displayName="Body";var ve=ge,de=j("wRmb"),De=j("xEkU"),Te=j.n(De);function he(je){var Ie=Object(m.useRef)(je),tt=Object(m.useState)({}),ot=Object(y.a)(tt,2),ze=ot[1],Ze=Object(m.useRef)(null),Ne=Object(m.useRef)([]);function Ae(Me){Ze.current===null&&(Ne.current=[],Ze.current=Te()(function(){Ne.current.forEach(function(Ee){Ie.current=Ee(Ie.current)}),Ze.current=null,ze({})})),Ne.current.push(Me)}return Object(m.useEffect)(function(){return function(){Te.a.cancel(Ze.current)}},[]),[Ie.current,Ae]}function ue(je){var Ie=Object(m.useRef)(je),tt=Object(m.useRef)(null);function ot(){window.clearTimeout(tt.current)}function ze(Ne){Ie.current=Ne,ot(),tt.current=window.setTimeout(function(){Ie.current=null,tt.current=null},100)}function Ze(){return Ie.current}return Object(m.useEffect)(function(){return ot},[]),[ze,Ze]}function ie(je,Ie,tt){var ot=Object(m.useMemo)(function(){for(var ze=[],Ze=[],Ne=0,Ae=0,Me=0;Me<Ie;Me+=1)if(tt==="rtl"){Ze[Me]=Ae,Ae+=je[Me]||0;var Ee=Ie-Me-1;ze[Ee]=Ne,Ne+=je[Ee]||0}else{ze[Me]=Ne,Ne+=je[Me]||0;var Ce=Ie-Me-1;Ze[Ce]=Ae,Ae+=je[Ce]||0}return{left:ze,right:Ze}},[je,Ie,tt]);return ot}var Se=ie;function ne(je){var Ie=je.className,tt=je.children;return m.createElement("div",{className:Ie},tt)}var ce=ne,Oe=j("n6Qo");function oe(je){var Ie,tt=je.prefixCls,ot=je.record,ze=je.onExpand,Ze=je.expanded,Ne=je.expandable,Ae="".concat(tt,"-row-expand-icon");if(!Ne)return m.createElement("span",{className:b()(Ae,"".concat(tt,"-row-spaced"))});var Me=function(Ce){ze(ot,Ce),Ce.stopPropagation()};return m.createElement("span",{className:b()(Ae,(Ie={},Object(N.a)(Ie,"".concat(tt,"-row-expanded"),Ze),Object(N.a)(Ie,"".concat(tt,"-row-collapsed"),!Ze),Ie)),onClick:Me})}function q(je,Ie,tt){var ot=[];function ze(Ze){(Ze||[]).forEach(function(Ne,Ae){ot.push(Ie(Ne,Ae)),ze(Ne[tt])})}return ze(je),ot}var Y=j("zT1h"),Z=j("y0+3"),ye=function(Ie,tt){var ot,ze,Ze=Ie.scrollBodyRef,Ne=Ie.onScroll,Ae=Ie.offsetScroll,Me=m.useContext(u.a),Ee=Me.prefixCls,Ce=((ot=Ze.current)===null||ot===void 0?void 0:ot.scrollWidth)||0,ke=((ze=Ze.current)===null||ze===void 0?void 0:ze.clientWidth)||0,Fe=Ce&&ke*(ke/Ce),Be=m.useRef(),et=he({scrollLeft:0,isHiddenScrollBar:!1}),ct=Object(y.a)(et,2),yt=ct[0],ft=ct[1],mt=m.useRef({delta:0,x:0}),It=m.useState(!1),At=Object(y.a)(It,2),_t=At[0],Vt=At[1],Kt=function(){Vt(!1)},tr=function(dt){dt.persist(),mt.current.delta=dt.pageX-yt.scrollLeft,mt.current.x=0,Vt(!0),dt.preventDefault()},rr=function(dt){var Et,jt=dt||((Et=window)===null||Et===void 0?void 0:Et.event),kt=jt.buttons;if(!_t||kt===0){_t&&Vt(!1);return}var hr=mt.current.x+dt.pageX-mt.current.x-mt.current.delta;hr<=0&&(hr=0),hr+Fe>=ke&&(hr=ke-Fe),Ne({scrollLeft:hr/ke*(Ce+2)}),mt.current.x=dt.pageX},Wt=function(){var dt=Object(Z.b)(Ze.current).top,Et=dt+Ze.current.offsetHeight,jt=document.documentElement.scrollTop+window.innerHeight;Et-Object(r.a)()<=jt||dt>=jt-Ae?ft(function(kt){return Object(v.a)(Object(v.a)({},kt),{},{isHiddenScrollBar:!0})}):ft(function(kt){return Object(v.a)(Object(v.a)({},kt),{},{isHiddenScrollBar:!1})})},Lt=function(dt){ft(function(Et){return Object(v.a)(Object(v.a)({},Et),{},{scrollLeft:dt/Ce*ke||0})})};return m.useImperativeHandle(tt,function(){return{setScrollLeft:Lt}}),m.useEffect(function(){var nr=Object(Y.a)(document.body,"mouseup",Kt,!1),dt=Object(Y.a)(document.body,"mousemove",rr,!1);return Wt(),function(){nr.remove(),dt.remove()}},[Fe,_t]),m.useEffect(function(){var nr=Object(Y.a)(window,"scroll",Wt,!1),dt=Object(Y.a)(window,"resize",Wt,!1);return function(){nr.remove(),dt.remove()}},[]),m.useEffect(function(){yt.isHiddenScrollBar||ft(function(nr){var dt,Et;return Object(v.a)(Object(v.a)({},nr),{},{scrollLeft:Ze.current.scrollLeft/((dt=Ze.current)===null||dt===void 0?void 0:dt.scrollWidth)*((Et=Ze.current)===null||Et===void 0?void 0:Et.clientWidth)})})},[yt.isHiddenScrollBar]),Ce<=ke||!Fe||yt.isHiddenScrollBar?null:m.createElement("div",{style:{height:Object(r.a)(),width:ke,bottom:Ae},className:"".concat(Ee,"-sticky-scroll")},m.createElement("div",{onMouseDown:tr,ref:Be,className:b()("".concat(Ee,"-sticky-scroll-bar"),Object(N.a)({},"".concat(Ee,"-sticky-scroll-bar-active"),_t)),style:{width:"".concat(Fe,"px"),transform:"translate3d(".concat(yt.scrollLeft,"px, 0, 0)")}}))},be=m.forwardRef(ye);function Re(je,Ie){return m.useMemo(function(){var tt=!!je;return{isSticky:tt,stickyClassName:tt?"".concat(Ie,"-sticky-header"):"",offsetHeader:Object(k.a)(je)==="object"&&je.offsetHeader||0,offsetScroll:Object(k.a)(je)==="object"&&je.offsetScroll||0}},[je,Ie])}var Qe=[],rt={},at="rc-table-internal-hook",qe=m.memo(function(je){var Ie=je.children;return Ie},function(je,Ie){return d()(je.props,Ie.props)?je.pingLeft!==Ie.pingLeft||je.pingRight!==Ie.pingRight:!1});function st(je){var Ie,tt=je.prefixCls,ot=je.className,ze=je.rowClassName,Ze=je.style,Ne=je.data,Ae=je.rowKey,Me=je.scroll,Ee=je.tableLayout,Ce=je.direction,ke=je.title,Fe=je.footer,Be=je.summary,et=je.id,ct=je.showHeader,yt=je.components,ft=je.emptyText,mt=je.onRow,It=je.onHeaderRow,At=je.internalHooks,_t=je.transformColumns,Vt=je.internalRefs,Kt=je.sticky,tr=Ne||Qe,rr=!!tr.length,Wt=m.useState(0),Lt=Object(y.a)(Wt,2),nr=Lt[0],dt=Lt[1];m.useEffect(function(){dt(Object(r.a)())});var Et=m.useMemo(function(){return Object(w.c)(yt,{})},[yt]),jt=m.useCallback(function(Xr,Mr){return Object(w.b)(Et,Xr)||Mr},[Et]),kt=m.useMemo(function(){return typeof Ae=="function"?Ae:function(Xr){var Mr=Xr&&Xr[Ae];return Mr}},[Ae]),hr=Object(x.c)(je),Nn=hr.expandIcon,Ct=hr.expandedRowKeys,Dt=hr.defaultExpandedRowKeys,wt=hr.defaultExpandAllRows,wr=hr.expandedRowRender,Cr=hr.onExpand,Jt=hr.onExpandedRowsChange,Ut=hr.expandRowByClick,Or=hr.rowExpandable,un=hr.expandIconColumnIndex,Nr=hr.expandedRowClassName,bt=hr.childrenColumnName,Bt=hr.indentSize,Jr=Nn||oe,on=bt||"children",Ln=m.useMemo(function(){return wr?"row":je.expandable&&At===at&&je.expandable.__PARENT_RENDER_ICON__||tr.some(function(Xr){return Xr&&Object(k.a)(Xr)==="object"&&Xr[on]})?"nest":!1},[!!wr,tr]),Sn=m.useState(function(){return Dt||(wt?q(tr,kt,on):[])}),le=Object(y.a)(Sn,2),K=le[0],X=le[1],ee=m.useMemo(function(){return new Set(Ct||K||[])},[Ct,K]),me=m.useCallback(function(Xr){var Mr=kt(Xr,tr.indexOf(Xr)),Rr,hi=ee.has(Mr);hi?(ee.delete(Mr),Rr=Object(C.a)(ee)):Rr=[].concat(Object(C.a)(ee),[Mr]),X(Rr),Cr&&Cr(!hi,Xr),Jt&&Jt(Rr)},[kt,ee,tr,Cr,Jt]),ae=m.useState(0),Ke=Object(y.a)(ae,2),pt=Ke[0],Ot=Ke[1],Ht=Object(de.b)(Object(v.a)(Object(v.a)(Object(v.a)({},je),hr),{},{expandable:!!wr,expandedKeys:ee,getRowKey:kt,onTriggerExpand:me,expandIcon:Jr,expandIconColumnIndex:un,direction:Ce}),At===at?_t:null),vt=Object(y.a)(Ht,2),Xt=vt[0],qt=vt[1],Hr=m.useMemo(function(){return{columns:Xt,flattenColumns:qt}},[Xt,qt]),nn=m.useRef(),zr=m.useRef(),or=m.useRef(),Qr=m.useState(!1),Cn=Object(y.a)(Qr,2),zt=Cn[0],pr=Cn[1],fr=m.useState(!1),jr=Object(y.a)(fr,2),Er=jr[0],li=jr[1],On=he(new Map),Ui=Object(y.a)(On,2),Bi=Ui[0],qn=Ui[1],sn=Object(w.a)(qt),Si=sn.map(function(Xr){return Bi.get(Xr)}),dn=m.useMemo(function(){return Si},[Si.join("_")]),Yn=Se(dn,qt.length,Ce),Zr=Me&&Object(w.d)(Me.y),cr=Me&&Object(w.d)(Me.x),tn=cr&&qt.some(function(Xr){var Mr=Xr.fixed;return Mr}),br=m.useRef(),hn=Re(Kt,tt),Fr=hn.isSticky,mi=hn.offsetHeader,_n=hn.offsetScroll,Un=hn.stickyClassName,Di,ui,bi;Zr&&(ui={overflowY:"scroll",maxHeight:Me.y}),cr&&(Di={overflowX:"auto"},Zr||(ui={overflowY:"hidden"}),bi={width:Me.x===!0?"auto":Me.x,minWidth:"100%"});var ei=m.useCallback(function(Xr,Mr){qn(function(Rr){var hi=new Map(Rr);return hi.set(Xr,Mr),hi})},[]),ti=ue(null),ji=Object(y.a)(ti,2),ci=ji[0],_i=ji[1];function Hi(Xr,Mr){if(!Mr)return;typeof Mr=="function"?Mr(Xr):Mr.scrollLeft!==Xr&&(Mr.scrollLeft=Xr)}var di=function(Mr){var Rr=Mr.currentTarget,hi=Mr.scrollLeft,Xi=typeof hi=="number"?hi:Rr.scrollLeft,Yi=Rr||rt;if(!_i()||_i()===Yi){var lr;ci(Yi),Hi(Xi,zr.current),Hi(Xi,or.current),Hi(Xi,(lr=br.current)===null||lr===void 0?void 0:lr.setScrollLeft)}if(Rr){var Ft=Rr.scrollWidth,mr=Rr.clientWidth;pr(Xi>0),li(Xi<Ft-mr)}},qr=function(){or.current&&di({currentTarget:or.current})},Yt=function(Mr){var Rr=Mr.width;qr(),Ot(nn.current?nn.current.offsetWidth:Rr)};m.useEffect(function(){return qr},[]),m.useEffect(function(){cr&&qr()},[cr]),m.useEffect(function(){At===at&&Vt&&(Vt.body.current=or.current)});var sr=jt(["table"],"table"),Qt=m.useMemo(function(){return Ee||(tn?Me.x==="max-content"?"auto":"fixed":Zr||qt.some(function(Xr){var Mr=Xr.ellipsis;return Mr})?"fixed":"auto")},[Zr,tn,qt,Ee]),gr,Lr={colWidths:dn,columCount:qt.length,stickyOffsets:Yn,onHeaderRow:It,fixHeader:Zr},Kr=m.useMemo(function(){return rr?null:typeof ft=="function"?ft():ft},[rr,ft]),Ar=m.createElement(ve,{data:tr,measureColumnWidth:Zr||cr||Fr,expandedKeys:ee,rowExpandable:Or,getRowKey:kt,onRow:mt,emptyNode:Kr,childrenColumnName:on}),gn=m.createElement(T,{colWidths:qt.map(function(Xr){var Mr=Xr.width;return Mr}),columns:qt}),$n=Be&&m.createElement(Oe.b,null,Be(tr)),xr=jt(["body"]);if(Zr||Fr){var Ei;typeof xr=="function"?(Ei=xr(tr,{scrollbarSize:nr,ref:or,onScroll:di}),Lr.colWidths=qt.map(function(Xr,Mr){var Rr=Xr.width,hi=Mr===Xt.length-1?Rr-nr:Rr;return typeof hi=="number"&&!Number.isNaN(hi)?hi:(Object(t.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Ei=m.createElement("div",{style:Object(v.a)(Object(v.a)({},Di),ui),onScroll:di,ref:or,className:b()("".concat(tt,"-body"))},m.createElement(sr,{style:Object(v.a)(Object(v.a)({},bi),{},{tableLayout:Qt})},gn,Ar,$n),Fr&&m.createElement(be,{ref:br,offsetScroll:_n,scrollBodyRef:or,onScroll:di})),gr=m.createElement(m.Fragment,null,ct!==!1&&m.createElement(A,Object.assign({noData:!tr.length},Lr,Hr,{direction:Ce,offsetHeader:mi,stickyClassName:Un,ref:zr,onScroll:di})),Ei)}else gr=m.createElement("div",{style:Object(v.a)(Object(v.a)({},Di),ui),className:b()("".concat(tt,"-content")),onScroll:di,ref:or},m.createElement(sr,{style:Object(v.a)(Object(v.a)({},bi),{},{tableLayout:Qt})},gn,ct!==!1&&m.createElement(g,Object.assign({},Lr,Hr)),Ar,$n));var Vr=Object(x.b)(je),jn=m.createElement("div",Object.assign({className:b()(tt,ot,(Ie={},Object(N.a)(Ie,"".concat(tt,"-rtl"),Ce==="rtl"),Object(N.a)(Ie,"".concat(tt,"-ping-left"),zt),Object(N.a)(Ie,"".concat(tt,"-ping-right"),Er),Object(N.a)(Ie,"".concat(tt,"-layout-fixed"),Ee==="fixed"),Object(N.a)(Ie,"".concat(tt,"-fixed-header"),Zr),Object(N.a)(Ie,"".concat(tt,"-fixed-column"),tn),Object(N.a)(Ie,"".concat(tt,"-scroll-horizontal"),cr),Object(N.a)(Ie,"".concat(tt,"-has-fix-left"),qt[0]&&qt[0].fixed),Object(N.a)(Ie,"".concat(tt,"-has-fix-right"),qt[qt.length-1]&&qt[qt.length-1].fixed==="right"),Ie)),style:Ze,id:et,ref:nn},Vr),m.createElement(qe,{pingLeft:zt,pingRight:Er,props:Object(v.a)(Object(v.a)({},je),{},{stickyOffsets:Yn,mergedExpandedKeys:ee})},ke&&m.createElement(ce,{className:"".concat(tt,"-title")},ke(tr)),m.createElement("div",{className:"".concat(tt,"-container")},gr),Fe&&m.createElement(ce,{className:"".concat(tt,"-footer")},Fe(tr))));cr&&(jn=m.createElement(l.a,{onResize:Yt},jn));var Bn=m.useMemo(function(){return{prefixCls:tt,getComponent:jt,scrollbarSize:nr,direction:Ce,fixedInfoList:qt.map(function(Xr,Mr){return f(Mr,Mr,qt,Yn,Ce)}),isSticky:Fr}},[tt,jt,nr,Ce,qt,Yn,Ce,Fr]),gi=m.useMemo(function(){return Object(v.a)(Object(v.a)({},Hr),{},{tableLayout:Qt,rowClassName:ze,expandedRowClassName:Nr,componentWidth:pt,fixHeader:Zr,fixColumn:tn,horizonScroll:cr,expandIcon:Jr,expandableType:Ln,expandRowByClick:Ut,expandedRowRender:wr,onTriggerExpand:me,expandIconColumnIndex:un,indentSize:Bt})},[Hr,Qt,ze,Nr,pt,Zr,tn,cr,Jr,Ln,Ut,wr,me,un,Bt]),ua=m.useMemo(function(){return{onColumnResize:ei}},[ei]);return m.createElement(u.a.Provider,{value:Bn},m.createElement(z.Provider,{value:gi},m.createElement($.Provider,{value:ua},jn)))}st.Column=o.a,st.ColumnGroup=i.a,st.Summary=Oe.a,st.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var lt=Q.b=st},wRmb:function(F,Q,j){"use strict";j.d(Q,"a",function(){return d});var N=j("rePB"),v=j("KQm4"),C=j("VTBJ"),k=j("Ff2n"),y=j("cDcd"),m=j.n(y),S=j("Kwbf"),b=j("Zm9Q"),p=j("hW8S");function d(o){return Object(b.a)(o).filter(function(s){return y.isValidElement(s)}).map(function(s){var c=s.key,a=s.props,u=a.children,f=Object(k.a)(a,["children"]),w=Object(C.a)({key:c},f);return u&&(w.children=d(u)),w})}function t(o){return o.reduce(function(s,c){var a=c.fixed,u=a===!0?"left":a,f=c.children;return f&&f.length>0?[].concat(Object(v.a)(s),Object(v.a)(t(f).map(function(w){return Object(C.a)({fixed:u},w)}))):[].concat(Object(v.a)(s),[Object(C.a)(Object(C.a)({},c),{},{fixed:u})])},[])}function l(o){for(var s=!0,c=0;c<o.length;c+=1){var a=o[c];if(s&&a.fixed!=="left")s=!1;else if(!s&&a.fixed==="left"){Object(S.a)(!1,"Index ".concat(c-1," of `columns` missing `fixed='left'` prop."));break}}for(var u=!0,f=o.length-1;f>=0;f-=1){var w=o[f];if(u&&w.fixed!=="right")u=!1;else if(!u&&w.fixed==="right"){Object(S.a)(!1,"Index ".concat(f+1," of `columns` missing `fixed='right'` prop."));break}}}function r(o){return o.map(function(s){var c=s.fixed,a=Object(k.a)(s,["fixed"]),u=c;return c==="left"?u="right":c==="right"&&(u="left"),Object(C.a)({fixed:u},a)})}function i(o,s){var c=o.prefixCls,a=o.columns,u=o.children,f=o.expandable,w=o.expandedKeys,_=o.getRowKey,h=o.onTriggerExpand,R=o.expandIcon,O=o.rowExpandable,g=o.expandIconColumnIndex,x=o.direction,E=o.expandRowByClick,T=y.useMemo(function(){return a||d(u)},[a,u]),M=y.useMemo(function(){if(f){var V,z=g||0,W=T[z],G=(V={},Object(N.a)(V,p.a,{className:"".concat(c,"-expand-icon-col")}),Object(N.a)(V,"title",""),Object(N.a)(V,"fixed",W?W.fixed:null),Object(N.a)(V,"className","".concat(c,"-row-expand-icon-cell")),Object(N.a)(V,"render",function(H,$,re){var te=_($,re),ge=w.has(te),ve=O?O($):!0,de=R({prefixCls:c,expanded:ge,expandable:ve,record:$,onExpand:h});return E?y.createElement("span",{onClick:function(Te){return Te.stopPropagation()}},de):de}),V),U=T.slice();return z>=0&&U.splice(z,0,G),U}return T},[f,T,_,w,R,x]),L=y.useMemo(function(){var V=M;return s&&(V=s(V)),V.length||(V=[{render:function(){return null}}]),V},[s,M,x]),A=y.useMemo(function(){return x==="rtl"?r(t(L)):t(L)},[L,x]);return[L,A]}Q.b=i},wZgz:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("ETIr"),j("cv67"),j("K3mO"),j("OLod"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.BlockCipher,y=v.algo,m=[],S=[],b=[],p=[],d=[],t=[],l=[],r=[],i=[],o=[];(function(){for(var a=[],u=0;u<256;u++)u<128?a[u]=u<<1:a[u]=u<<1^283;for(var f=0,w=0,u=0;u<256;u++){var _=w^w<<1^w<<2^w<<3^w<<4;_=_>>>8^_&255^99,m[f]=_,S[_]=f;var h=a[f],R=a[h],O=a[R],g=a[_]*257^_*16843008;b[f]=g<<24|g>>>8,p[f]=g<<16|g>>>16,d[f]=g<<8|g>>>24,t[f]=g;var g=O*16843009^R*65537^h*257^f*16843008;l[_]=g<<24|g>>>8,r[_]=g<<16|g>>>16,i[_]=g<<8|g>>>24,o[_]=g,f?(f=h^a[a[a[O^h]]],w^=a[a[w]]):f=w=1}})();var s=[0,1,2,4,8,16,32,64,128,27,54],c=y.AES=k.extend({_doReset:function(){var a;if(this._nRounds&&this._keyPriorReset===this._key)return;for(var u=this._keyPriorReset=this._key,f=u.words,w=u.sigBytes/4,_=this._nRounds=w+6,h=(_+1)*4,R=this._keySchedule=[],O=0;O<h;O++)O<w?R[O]=f[O]:(a=R[O-1],O%w?w>6&&O%w==4&&(a=m[a>>>24]<<24|m[a>>>16&255]<<16|m[a>>>8&255]<<8|m[a&255]):(a=a<<8|a>>>24,a=m[a>>>24]<<24|m[a>>>16&255]<<16|m[a>>>8&255]<<8|m[a&255],a^=s[O/w|0]<<24),R[O]=R[O-w]^a);for(var g=this._invKeySchedule=[],x=0;x<h;x++){var O=h-x;if(x%4)var a=R[O];else var a=R[O-4];x<4||O<=4?g[x]=a:g[x]=l[m[a>>>24]]^r[m[a>>>16&255]]^i[m[a>>>8&255]]^o[m[a&255]]}},encryptBlock:function(a,u){this._doCryptBlock(a,u,this._keySchedule,b,p,d,t,m)},decryptBlock:function(a,u){var f=a[u+1];a[u+1]=a[u+3],a[u+3]=f,this._doCryptBlock(a,u,this._invKeySchedule,l,r,i,o,S);var f=a[u+1];a[u+1]=a[u+3],a[u+3]=f},_doCryptBlock:function(a,u,f,w,_,h,R,O){for(var g=this._nRounds,x=a[u]^f[0],E=a[u+1]^f[1],T=a[u+2]^f[2],M=a[u+3]^f[3],L=4,A=1;A<g;A++){var V=w[x>>>24]^_[E>>>16&255]^h[T>>>8&255]^R[M&255]^f[L++],z=w[E>>>24]^_[T>>>16&255]^h[M>>>8&255]^R[x&255]^f[L++],W=w[T>>>24]^_[M>>>16&255]^h[x>>>8&255]^R[E&255]^f[L++],G=w[M>>>24]^_[x>>>16&255]^h[E>>>8&255]^R[T&255]^f[L++];x=V,E=z,T=W,M=G}var V=(O[x>>>24]<<24|O[E>>>16&255]<<16|O[T>>>8&255]<<8|O[M&255])^f[L++],z=(O[E>>>24]<<24|O[T>>>16&255]<<16|O[M>>>8&255]<<8|O[x&255])^f[L++],W=(O[T>>>24]<<24|O[M>>>16&255]<<16|O[x>>>8&255]<<8|O[E&255])^f[L++],G=(O[M>>>24]<<24|O[x>>>16&255]<<16|O[E>>>8&255]<<8|O[T&255])^f[L++];a[u]=V,a[u+1]=z,a[u+2]=W,a[u+3]=G},keySize:256/32});v.AES=k._createHelper(c)}(),N.AES})},wbyO:function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.WordArray,y=v.enc,m=y.Base64url={stringify:function(b,p=!0){var d=b.words,t=b.sigBytes,l=p?this._safe_map:this._map;b.clamp();for(var r=[],i=0;i<t;i+=3)for(var o=d[i>>>2]>>>24-i%4*8&255,s=d[i+1>>>2]>>>24-(i+1)%4*8&255,c=d[i+2>>>2]>>>24-(i+2)%4*8&255,a=o<<16|s<<8|c,u=0;u<4&&i+u*.75<t;u++)r.push(l.charAt(a>>>6*(3-u)&63));var f=l.charAt(64);if(f)for(;r.length%4;)r.push(f);return r.join("")},parse:function(b,p=!0){var d=b.length,t=p?this._safe_map:this._map,l=this._reverseMap;if(!l){l=this._reverseMap=[];for(var r=0;r<t.length;r++)l[t.charCodeAt(r)]=r}var i=t.charAt(64);if(i){var o=b.indexOf(i);o!==-1&&(d=o)}return S(b,d,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function S(b,p,d){for(var t=[],l=0,r=0;r<p;r++)if(r%4){var i=d[b.charCodeAt(r-1)]<<r%4*2,o=d[b.charCodeAt(r)]>>>6-r%4*2,s=i|o;t[l>>>2]|=s<<24-l%4*8,l++}return k.create(t,l)}}(),N.enc.Base64url})},"y0+3":function(F,Q,j){"use strict";j.d(Q,"a",function(){return t}),j.d(Q,"b",function(){return r});var N=/margin|padding|width|height|max|min|offset/,v={left:!0,top:!0},C={cssFloat:1,styleFloat:1,float:1};function k(i){return i.nodeType===1?i.ownerDocument.defaultView.getComputedStyle(i,null):{}}function y(i,o,s){if(o=o.toLowerCase(),s==="auto"){if(o==="height")return i.offsetHeight;if(o==="width")return i.offsetWidth}return o in v||(v[o]=N.test(o)),v[o]?parseFloat(s)||0:s}function m(i,o){var s=arguments.length,c=k(i);return o=C[o]?"cssFloat"in i.style?"cssFloat":"styleFloat":o,s===1?c:y(i,o,c[o]||i.style[o])}function S(i,o,s){var c=arguments.length;if(o=C[o]?"cssFloat"in i.style?"cssFloat":"styleFloat":o,c===3)return typeof s=="number"&&N.test(o)&&(s="".concat(s,"px")),i.style[o]=s,s;for(var a in o)o.hasOwnProperty(a)&&S(i,a,o[a]);return k(i)}function b(i){return i===document.body?document.documentElement.clientWidth:i.offsetWidth}function p(i){return i===document.body?window.innerHeight||document.documentElement.clientHeight:i.offsetHeight}function d(){var i=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:i,height:o}}function t(){var i=document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return{width:i,height:o}}function l(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function r(i){var o=i.getBoundingClientRect(),s=document.documentElement;return{left:o.left+(window.pageXOffset||s.scrollLeft)-(s.clientLeft||document.body.clientLeft||0),top:o.top+(window.pageYOffset||s.scrollTop)-(s.clientTop||document.body.clientTop||0)}}},ynwM:function(F,Q,j){var N=j("MFOe"),v=N.Global;F.exports={name:"oldFF-globalStorage",read:k,write:y,each:m,remove:S,clearAll:b};var C=v.globalStorage;function k(p){return C[p]}function y(p,d){C[p]=d}function m(p){for(var d=C.length-1;d>=0;d--){var t=C.key(d);p(C[t],t)}}function S(p){return C.removeItem(p)}function b(){m(function(p,d){delete C[p]})}}}]);
|