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

457 lines
1.5 MiB

This file contains invisible Unicode characters!

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

(window.webpackJsonp=window.webpackJsonp||[]).push([[207,6,7,20,21],{"+NIl":function(I,q,M){(function(P){P(M("VrN/"))})(function(P){"use strict";P.defineMode("stex",function(m,S){"use strict";function R(f,E){f.cmdState.push(E)}function T(f){return f.cmdState.length>0?f.cmdState[f.cmdState.length-1]:null}function g(f){var E=f.cmdState.pop();E&&E.closeBracket()}function C(f){for(var E=f.cmdState,y=E.length-1;y>=0;y--){var l=E[y];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function p(f,E,y){return function(){this.name=f,this.bracketNo=0,this.style=E,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var s={};s.importmodule=p("importmodule","tag",["string","builtin"]),s.documentclass=p("documentclass","tag",["","atom"]),s.usepackage=p("usepackage","tag",["atom"]),s.begin=p("begin","tag",["atom"]),s.end=p("end","tag",["atom"]),s.label=p("label","tag",["atom"]),s.ref=p("ref","tag",["atom"]),s.eqref=p("eqref","tag",["atom"]),s.cite=p("cite","tag",["atom"]),s.bibitem=p("bibitem","tag",["atom"]),s.Bibitem=p("Bibitem","tag",["atom"]),s.RBibitem=p("RBibitem","tag",["atom"]),s.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function a(f,E){f.f=E}function r(f,E){var y;if(f.match(/^\\[a-zA-Z@]+/)){var l=f.current().slice(1);return y=s.hasOwnProperty(l)?s[l]:s.DEFAULT,y=new y,R(E,y),a(E,d),y.style}if(f.match(/^\\[$&%#{}_]/))return"tag";if(f.match(/^\\[,;!\/\\]/))return"tag";if(f.match("\\["))return a(E,function(o,u){return h(o,u,"\\]")}),"keyword";if(f.match("\\("))return a(E,function(o,u){return h(o,u,"\\)")}),"keyword";if(f.match("$$"))return a(E,function(o,u){return h(o,u,"$$")}),"keyword";if(f.match("$"))return a(E,function(o,u){return h(o,u,"$")}),"keyword";var n=f.next();if(n=="%")return f.skipToEnd(),"comment";if(n=="}"||n=="]"){if(y=T(E),y)y.closeBracket(n),a(E,d);else return"error";return"bracket"}else return n=="{"||n=="["?(y=s.DEFAULT,y=new y,R(E,y),"bracket"):/\d/.test(n)?(f.eatWhile(/[\w.%]/),"atom"):(f.eatWhile(/[\w\-_]/),y=C(E),y.name=="begin"&&(y.argument=f.current()),y.styleIdentifier())}function h(f,E,y){if(f.eatSpace())return null;if(y&&f.match(y))return a(E,r),"keyword";if(f.match(/^\\[a-zA-Z@]+/))return"tag";if(f.match(/^[a-zA-Z]+/))return"variable-2";if(f.match(/^\\[$&%#{}_]/))return"tag";if(f.match(/^\\[,;!\/]/))return"tag";if(f.match(/^[\^_&]/))return"tag";if(f.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(f.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=f.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(f.skipToEnd(),"comment"):"error"}function d(f,E){var y=f.peek(),l;return y=="{"||y=="["?(l=T(E),l.openBracket(y),f.eat(y),a(E,r),"bracket"):/[ \t\r]/.test(y)?(f.eat(y),null):(a(E,r),g(E),r(f,E))}return{startState:function(){var f=S.inMathMode?function(E,y){return h(E,y)}:r;return{cmdState:[],f}},copyState:function(f){return{cmdState:f.cmdState.slice(),f:f.f}},token:function(f,E){return E.f(f,E)},blankLine:function(f){f.f=r,f.cmdState.length=0},lineComment:"%"}}),P.defineMIME("text/x-stex","stex"),P.defineMIME("text/x-latex","stex")})},"19Vz":function(I,q,M){(function(P){P(M("VrN/"))})(function(P){P.defineOption("placeholder","",function(p,s,a){var r=a&&a!=P.Init;if(s&&!r)p.on("blur",T),p.on("change",g),p.on("swapDoc",g),P.on(p.getInputField(),"compositionupdate",p.state.placeholderCompose=function(){R(p)}),g(p);else if(!s&&r){p.off("blur",T),p.off("change",g),p.off("swapDoc",g),P.off(p.getInputField(),"compositionupdate",p.state.placeholderCompose),m(p);var h=p.getWrapperElement();h.className=h.className.replace(" CodeMirror-empty","")}s&&!p.hasFocus()&&T(p)});function m(p){p.state.placeholder&&(p.state.placeholder.parentNode.removeChild(p.state.placeholder),p.state.placeholder=null)}function S(p){m(p);var s=p.state.placeholder=document.createElement("pre");s.style.cssText="height: 0; overflow: visible",s.style.direction=p.getOption("direction"),s.className="CodeMirror-placeholder CodeMirror-line-like";var a=p.getOption("placeholder");typeof a=="string"&&(a=document.createTextNode(a)),s.appendChild(a),p.display.lineSpace.insertBefore(s,p.display.lineSpace.firstChild)}function R(p){setTimeout(function(){var s=!1,a=p.getInputField();a.nodeName=="TEXTAREA"?s=!a.value:p.lineCount()==1&&(s=!/[^\u200b]/.test(a.querySelector(".CodeMirror-line").textContent)),s?S(p):m(p)},20)}function T(p){C(p)&&S(p)}function g(p){var s=p.getWrapperElement(),a=C(p);s.className=s.className.replace(" CodeMirror-empty","")+(a?" CodeMirror-empty":""),a?S(p):m(p)}function C(p){return p.lineCount()===1&&p.getLine(0)===""}})},"1eCo":function(I,q,M){(function(P){P(M("VrN/"))})(function(P){"use strict";var m={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},S={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};P.defineMode("xml",function(R,T){var g=R.indentUnit,C={},p=T.htmlMode?m:S;for(var s in p)C[s]=p[s];for(var s in T)C[s]=T[s];var a,r;function h(_,j){function F(z){return j.tokenize=z,z(_,j)}var L=_.next();if(L=="<")return _.eat("!")?_.eat("[")?_.match("CDATA[")?F(E("atom","]]>")):null:_.match("--")?F(E("comment","-->")):_.match("DOCTYPE",!0,!0)?(_.eatWhile(/[\w\._\-]/),F(y(1))):null:_.eat("?")?(_.eatWhile(/[\w\._\-]/),j.tokenize=E("meta","?>"),"meta"):(a=_.eat("/")?"closeTag":"openTag",j.tokenize=d,"tag bracket");if(L=="&"){var X;return _.eat("#")?_.eat("x")?X=_.eatWhile(/[a-fA-F\d]/)&&_.eat(";"):X=_.eatWhile(/[\d]/)&&_.eat(";"):X=_.eatWhile(/[\w\.\-:]/)&&_.eat(";"),X?"atom":"error"}else return _.eatWhile(/[^&<]/),null}h.isInText=!0;function d(_,j){var F=_.next();if(F==">"||F=="/"&&_.eat(">"))return j.tokenize=h,a=F==">"?"endTag":"selfcloseTag","tag bracket";if(F=="=")return a="equals",null;if(F=="<"){j.tokenize=h,j.state=u,j.tagName=j.tagStart=null;var L=j.tokenize(_,j);return L?L+" tag error":"tag error"}else return/[\'\"]/.test(F)?(j.tokenize=f(F),j.stringStartCol=_.column(),j.tokenize(_,j)):(_.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(_){var j=function(F,L){for(;!F.eol();)if(F.next()==_){L.tokenize=d;break}return"string"};return j.isInAttribute=!0,j}function E(_,j){return function(F,L){for(;!F.eol();){if(F.match(j)){L.tokenize=h;break}F.next()}return _}}function y(_){return function(j,F){for(var L;(L=j.next())!=null;){if(L=="<")return F.tokenize=y(_+1),F.tokenize(j,F);if(L==">")if(_==1){F.tokenize=h;break}else return F.tokenize=y(_-1),F.tokenize(j,F)}return"meta"}}function l(_,j,F){this.prev=_.context,this.tagName=j,this.indent=_.indented,this.startOfLine=F,(C.doNotIndent.hasOwnProperty(j)||_.context&&_.context.noIndent)&&(this.noIndent=!0)}function n(_){_.context&&(_.context=_.context.prev)}function o(_,j){for(var F;;){if(!_.context)return;if(F=_.context.tagName,!C.contextGrabbers.hasOwnProperty(F)||!C.contextGrabbers[F].hasOwnProperty(j))return;n(_)}}function u(_,j,F){return _=="openTag"?(F.tagStart=j.column(),w):_=="closeTag"?v:u}function w(_,j,F){return _=="word"?(F.tagName=j.current(),r="tag",D):C.allowMissingTagName&&_=="endTag"?(r="tag bracket",D(_,j,F)):(r="error",w)}function v(_,j,F){if(_=="word"){var L=j.current();return F.context&&F.context.tagName!=L&&C.implicitlyClosed.hasOwnProperty(F.context.tagName)&&n(F),F.context&&F.context.tagName==L||C.matchClosing===!1?(r="tag",i):(r="tag error",k)}else return C.allowMissingTagName&&_=="endTag"?(r="tag bracket",i(_,j,F)):(r="error",k)}function i(_,j,F){return _!="endTag"?(r="error",i):(n(F),u)}function k(_,j,F){return r="error",i(_,j,F)}function D(_,j,F){if(_=="word")return r="attribute",c;if(_=="endTag"||_=="selfcloseTag"){var L=F.tagName,X=F.tagStart;return F.tagName=F.tagStart=null,_=="selfcloseTag"||C.autoSelfClosers.hasOwnProperty(L)?o(F,L):(o(F,L),F.context=new l(F,L,X==F.indented)),u}return r="error",D}function c(_,j,F){return _=="equals"?b:(C.allowMissing||(r="error"),D(_,j,F))}function b(_,j,F){return _=="string"?x:_=="word"&&C.allowUnquoted?(r="string",D):(r="error",D(_,j,F))}function x(_,j,F){return _=="string"?x:D(_,j,F)}return{startState:function(_){var j={tokenize:h,state:u,indented:_||0,tagName:null,tagStart:null,context:null};return _!=null&&(j.baseIndent=_),j},token:function(_,j){if(!j.tagName&&_.sol()&&(j.indented=_.indentation()),_.eatSpace())return null;a=null;var F=j.tokenize(_,j);return(F||a)&&F!="comment"&&(r=null,j.state=j.state(a||F,_,j),r&&(F=r=="error"?F+" error":r)),F},indent:function(_,j,F){var L=_.context;if(_.tokenize.isInAttribute)return _.tagStart==_.indented?_.stringStartCol+1:_.indented+g;if(L&&L.noIndent)return P.Pass;if(_.tokenize!=d&&_.tokenize!=h)return F?F.match(/^(\s*)/)[0].length:0;if(_.tagName)return C.multilineTagIndentPastTag!==!1?_.tagStart+_.tagName.length+2:_.tagStart+g*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(j))return 0;var X=j&&/^<(\/)?([\w_:\.-]*)/.exec(j);if(X&&X[1])for(;L;)if(L.tagName==X[2]){L=L.prev;break}else if(C.implicitlyClosed.hasOwnProperty(L.tagName))L=L.prev;else break;else if(X)for(;L;){var z=C.contextGrabbers[L.tagName];if(z&&z.hasOwnProperty(X[2]))L=L.prev;else break}for(;L&&L.prev&&!L.startOfLine;)L=L.prev;return L?L.indent+g:_.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(_){_.state==b&&(_.state=D)},xmlCurrentTag:function(_){return _.tagName?{name:_.tagName,close:_.type=="closeTag"}:null},xmlCurrentContext:function(_){for(var j=[],F=_.context;F;F=F.prev)F.tagName&&j.push(F.tagName);return j.reverse()}}}),P.defineMIME("text/xml","xml"),P.defineMIME("application/xml","xml"),P.mimeModes.hasOwnProperty("text/html")||P.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1uat":function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("MlIO"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.Hasher,T=m.x64,g=T.Word,C=T.WordArray,p=m.algo;function s(){return g.create.apply(g,arguments)}var a=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],r=[];(function(){for(var d=0;d<80;d++)r[d]=s()})();var h=p.SHA512=R.extend({_doReset:function(){this._hash=new C.init([new g.init(1779033703,4089235720),new g.init(3144134277,2227873595),new g.init(1013904242,4271175723),new g.init(2773480762,1595750129),new g.init(1359893119,2917565137),new g.init(2600822924,725511199),new g.init(528734635,4215389547),new g.init(1541459225,327033209)])},_doProcessBlock:function(d,f){for(var E=this._hash.words,y=E[0],l=E[1],n=E[2],o=E[3],u=E[4],w=E[5],v=E[6],i=E[7],k=y.high,D=y.low,c=l.high,b=l.low,x=n.high,_=n.low,j=o.high,F=o.low,L=u.high,X=u.low,z=w.high,H=w.low,G=v.high,U=v.low,B=i.high,W=i.low,te=k,de=D,fe=c,be=b,Ce=x,ue=_,ge=j,pe=F,oe=L,ae=X,re=z,he=H,Q=G,ie=U,we=B,ne=W,J=0;J<80;J++){var V,Z,Ee=r[J];if(J<16)Z=Ee.high=d[f+J*2]|0,V=Ee.low=d[f+J*2+1]|0;else{var xe=r[J-15],_e=xe.high,Ne=xe.low,Be=(_e>>>1|Ne<<31)^(_e>>>8|Ne<<24)^_e>>>7,We=(Ne>>>1|_e<<31)^(Ne>>>8|_e<<24)^(Ne>>>7|_e<<25),Ue=r[J-2],ze=Ue.high,Ke=Ue.low,Ye=(ze>>>19|Ke<<13)^(ze<<3|Ke>>>29)^ze>>>6,Re=(Ke>>>19|ze<<13)^(Ke<<3|ze>>>29)^(Ke>>>6|ze<<26),tt=r[J-7],rt=tt.high,He=tt.low,$e=r[J-16],Ie=$e.high,Oe=$e.low;V=We+He,Z=Be+rt+(V>>>0<We>>>0?1:0),V=V+Re,Z=Z+Ye+(V>>>0<Re>>>0?1:0),V=V+Oe,Z=Z+Ie+(V>>>0<Oe>>>0?1:0),Ee.high=Z,Ee.low=V}var Le=oe&re^~oe&Q,Te=ae&he^~ae&ie,Ae=te&fe^te&Ce^fe&Ce,De=de&be^de&ue^be&ue,Me=(te>>>28|de<<4)^(te<<30|de>>>2)^(te<<25|de>>>7),Fe=(de>>>28|te<<4)^(de<<30|te>>>2)^(de<<25|te>>>7),Xe=(oe>>>14|ae<<18)^(oe>>>18|ae<<14)^(oe<<23|ae>>>9),qe=(ae>>>14|oe<<18)^(ae>>>18|oe<<14)^(ae<<23|oe>>>9),pt=a[J],at=pt.high,ft=pt.low,Et=ne+qe,xt=we+Xe+(Et>>>0<ne>>>0?1:0),Et=Et+Te,xt=xt+Le+(Et>>>0<Te>>>0?1:0),Et=Et+ft,xt=xt+at+(Et>>>0<ft>>>0?1:0),Et=Et+V,xt=xt+Z+(Et>>>0<V>>>0?1:0),lt=Fe+De,Wt=Me+Ae+(lt>>>0<Fe>>>0?1:0);we=Q,ne=ie,Q=re,ie=he,re=oe,he=ae,ae=pe+Et|0,oe=ge+xt+(ae>>>0<pe>>>0?1:0)|0,ge=Ce,pe=ue,Ce=fe,ue=be,fe=te,be=de,de=Et+lt|0,te=xt+Wt+(de>>>0<Et>>>0?1:0)|0}D=y.low=D+de,y.high=k+te+(D>>>0<de>>>0?1:0),b=l.low=b+be,l.high=c+fe+(b>>>0<be>>>0?1:0),_=n.low=_+ue,n.high=x+Ce+(_>>>0<ue>>>0?1:0),F=o.low=F+pe,o.high=j+ge+(F>>>0<pe>>>0?1:0),X=u.low=X+ae,u.high=L+oe+(X>>>0<ae>>>0?1:0),H=w.low=H+he,w.high=z+re+(H>>>0<he>>>0?1:0),U=v.low=U+ie,v.high=G+Q+(U>>>0<ie>>>0?1:0),W=i.low=W+ne,i.high=B+we+(W>>>0<ne>>>0?1:0)},_doFinalize:function(){var d=this._data,f=d.words,E=this._nDataBytes*8,y=d.sigBytes*8;f[y>>>5]|=128<<24-y%32,f[(y+128>>>10<<5)+30]=Math.floor(E/4294967296),f[(y+128>>>10<<5)+31]=E,d.sigBytes=f.length*4,this._process();var l=this._hash.toX32();return l},clone:function(){var d=R.clone.call(this);return d._hash=this._hash.clone(),d},blockSize:1024/32});m.SHA512=R._createHelper(h),m.HmacSHA512=R._createHmacHelper(h)}(),P.SHA512})},"3y9D":function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=S.Hasher,g=m.algo,C=[],p=g.SHA1=T.extend({_doReset:function(){this._hash=new R.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(s,a){for(var r=this._hash.words,h=r[0],d=r[1],f=r[2],E=r[3],y=r[4],l=0;l<80;l++){if(l<16)C[l]=s[a+l]|0;else{var n=C[l-3]^C[l-8]^C[l-14]^C[l-16];C[l]=n<<1|n>>>31}var o=(h<<5|h>>>27)+y+C[l];l<20?o+=(d&f|~d&E)+1518500249:l<40?o+=(d^f^E)+1859775393:l<60?o+=(d&f|d&E|f&E)-1894007588:o+=(d^f^E)-899497514,y=E,E=f,f=d<<30|d>>>2,d=h,h=o}r[0]=r[0]+h|0,r[1]=r[1]+d|0,r[2]=r[2]+f|0,r[3]=r[3]+E|0,r[4]=r[4]+y|0},_doFinalize:function(){var s=this._data,a=s.words,r=this._nDataBytes*8,h=s.sigBytes*8;return a[h>>>5]|=128<<24-h%32,a[(h+64>>>9<<4)+14]=Math.floor(r/4294967296),a[(h+64>>>9<<4)+15]=r,s.sigBytes=a.length*4,this._process(),this._hash},clone:function(){var s=T.clone.call(this);return s._hash=this._hash.clone(),s}});m.SHA1=T._createHelper(p),m.HmacSHA1=T._createHmacHelper(p)}(),P.SHA1})},4:function(I,q){},"5hvy":function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("MlIO"))})(this,function(P){return function(m){var S=P,R=S.lib,T=R.WordArray,g=R.Hasher,C=S.x64,p=C.Word,s=S.algo,a=[],r=[],h=[];(function(){for(var E=1,y=0,l=0;l<24;l++){a[E+5*y]=(l+1)*(l+2)/2%64;var n=y%5,o=(2*E+3*y)%5;E=n,y=o}for(var E=0;E<5;E++)for(var y=0;y<5;y++)r[E+5*y]=y+(2*E+3*y)%5*5;for(var u=1,w=0;w<24;w++){for(var v=0,i=0,k=0;k<7;k++){if(u&1){var D=(1<<k)-1;D<32?i^=1<<D:v^=1<<D-32}u&128?u=u<<1^113:u<<=1}h[w]=p.create(v,i)}})();var d=[];(function(){for(var E=0;E<25;E++)d[E]=p.create()})();var f=s.SHA3=g.extend({cfg:g.cfg.extend({outputLength:512}),_doReset:function(){for(var E=this._state=[],y=0;y<25;y++)E[y]=new p.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(E,y){for(var l=this._state,n=this.blockSize/2,o=0;o<n;o++){var u=E[y+2*o],w=E[y+2*o+1];u=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360;var v=l[o];v.high^=w,v.low^=u}for(var i=0;i<24;i++){for(var k=0;k<5;k++){for(var D=0,c=0,b=0;b<5;b++){var v=l[k+5*b];D^=v.high,c^=v.low}var x=d[k];x.high=D,x.low=c}for(var k=0;k<5;k++)for(var _=d[(k+4)%5],j=d[(k+1)%5],F=j.high,L=j.low,D=_.high^(F<<1|L>>>31),c=_.low^(L<<1|F>>>31),b=0;b<5;b++){var v=l[k+5*b];v.high^=D,v.low^=c}for(var X=1;X<25;X++){var D,c,v=l[X],z=v.high,H=v.low,G=a[X];G<32?(D=z<<G|H>>>32-G,c=H<<G|z>>>32-G):(D=H<<G-32|z>>>64-G,c=z<<G-32|H>>>64-G);var U=d[r[X]];U.high=D,U.low=c}var B=d[0],W=l[0];B.high=W.high,B.low=W.low;for(var k=0;k<5;k++)for(var b=0;b<5;b++){var X=k+5*b,v=l[X],te=d[X],de=d[(k+1)%5+5*b],fe=d[(k+2)%5+5*b];v.high=te.high^~de.high&fe.high,v.low=te.low^~de.low&fe.low}var v=l[0],be=h[i];v.high^=be.high,v.low^=be.low}},_doFinalize:function(){var E=this._data,y=E.words,l=this._nDataBytes*8,n=E.sigBytes*8,o=this.blockSize*32;y[n>>>5]|=1<<24-n%32,y[(m.ceil((n+1)/o)*o>>>5)-1]|=128,E.sigBytes=y.length*4,this._process();for(var u=this._state,w=this.cfg.outputLength/8,v=w/8,i=[],k=0;k<v;k++){var D=u[k],c=D.high,b=D.low;c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,i.push(b),i.push(c)}return new T.init(i,w)},clone:function(){for(var E=g.clone.call(this),y=E._state=this._state.slice(0),l=0;l<25;l++)y[l]=y[l].clone();return E}});S.SHA3=g._createHelper(f),S.HmacSHA3=g._createHmacHelper(f)}(Math),P.SHA3})},"5nXd":function(I,q,M){var P=M("MFOe"),m=P.slice,S=P.pluck,R=P.each,T=P.bind,g=P.create,C=P.isList,p=P.isFunction,s=P.isObject;I.exports={createStore:h};var a={version:"2.0.12",enabled:!1,get:function(d,f){var E=this.storage.read(this._namespacePrefix+d);return this._deserialize(E,f)},set:function(d,f){return f===void 0?this.remove(d):(this.storage.write(this._namespacePrefix+d,this._serialize(f)),f)},remove:function(d){this.storage.remove(this._namespacePrefix+d)},each:function(d){var f=this;this.storage.each(function(E,y){d.call(f,f._deserialize(E),(y||"").replace(f._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(d){return this._namespacePrefix=="__storejs_"+d+"_"},createStore:function(){return h.apply(this,arguments)},addPlugin:function(d){this._addPlugin(d)},namespace:function(d){return h(this.storage,this.plugins,d)}};function r(){var d=typeof console=="undefined"?null:console;if(!d)return;var f=d.warn?d.warn:d.log;f.apply(d,arguments)}function h(d,f,E){E||(E=""),d&&!C(d)&&(d=[d]),f&&!C(f)&&(f=[f]);var y=E?"__storejs_"+E+"_":"",l=E?new RegExp("^"+y):null,n=/^[a-zA-Z0-9_\-]*$/;if(!n.test(E))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:y,_namespaceRegexp:l,_testStorage:function(w){try{var v="__storejs__test__";w.write(v,v);var i=w.read(v)===v;return w.remove(v),i}catch(k){return!1}},_assignPluginFnProp:function(w,v){var i=this[v];this[v]=function(){var D=m(arguments,0),c=this;function b(){return i?(R(arguments,function(_,j){D[j]=_}),i.apply(c,D)):void 0}var x=[b].concat(D);return w.apply(c,x)}},_serialize:function(w){return JSON.stringify(w)},_deserialize:function(w,v){if(!w)return v;var i="";try{i=JSON.parse(w)}catch(k){i=w}return i!==void 0?i:v},_addStorage:function(w){if(this.enabled)return;this._testStorage(w)&&(this.storage=w,this.enabled=!0)},_addPlugin:function(w){var v=this;if(C(w)){R(w,function(D){v._addPlugin(D)});return}var i=S(this.plugins,function(D){return w===D});if(i)return;if(this.plugins.push(w),!p(w))throw new Error("Plugins must be function values that return objects");var k=w.call(this);if(!s(k))throw new Error("Plugins must return an object of function properties");R(k,function(D,c){if(!p(D))throw new Error("Bad plugin property: "+c+" from plugin "+w.name+". Plugins should only return functions.");v._assignPluginFnProp(D,c)})},addStorage:function(w){r("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(w)}},u=g(o,a,{plugins:[]});return u.raw={},R(u,function(w,v){p(w)&&(u.raw[v]=T(u,w))}),R(d,function(w){u._addStorage(w)}),R(f,function(w){u._addPlugin(w)}),u}},"7Cbv":function(I,q,M){"use strict";var P=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),m=new Uint8Array(16);function S(){if(!P)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return P(m)}var R=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function T(d){return typeof d=="string"&&R.test(d)}for(var g=T,C=[],p=0;p<256;++p)C.push((p+256).toString(16).substr(1));function s(d){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,E=(C[d[f+0]]+C[d[f+1]]+C[d[f+2]]+C[d[f+3]]+"-"+C[d[f+4]]+C[d[f+5]]+"-"+C[d[f+6]]+C[d[f+7]]+"-"+C[d[f+8]]+C[d[f+9]]+"-"+C[d[f+10]]+C[d[f+11]]+C[d[f+12]]+C[d[f+13]]+C[d[f+14]]+C[d[f+15]]).toLowerCase();if(!g(E))throw TypeError("Stringified UUID is invalid");return E}var a=s;function r(d,f,E){d=d||{};var y=d.random||(d.rng||S)();if(y[6]=y[6]&15|64,y[8]=y[8]&63|128,f){E=E||0;for(var l=0;l<16;++l)f[E+l]=y[l];return f}return a(y)}var h=q.a=r},"7ahc":function(I,q,M){"use strict";M.d(q,"a",function(){return w});var P=M("k1fw"),m=M("0Owb"),S=M("+L6B"),R=M("2/Rp"),T=M("y8nQ"),g=M("Vl3Y"),C=M("tJVT"),p=M("OaEy"),s=M("2fM7"),a=M("q1tI"),r=M.n(a),h=M("VrN/"),d=M.n(h),f=M("p77/"),E=M.n(f),y=M("c5Ni"),l=M.n(y),n=s.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},u={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(v){var i=v.callback,k=v.onCancel,D=Object(a.useState)("python"),c=Object(C.a)(D,2),b=c[0],x=c[1];function _(F){x(u[F][1])}function j(F){i(F)}return r.a.createElement(g.a,Object(m.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:j}),r.a.createElement(g.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},r.a.createElement(s.a,{onChange:_},Object.keys(u).map(function(F){return r.a.createElement(n,{key:F,value:F},u[F][0])}))),r.a.createElement(g.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},r.a.createElement(w,{mode:b})),r.a.createElement("div",{className:"flex-container flex-end"},r.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),r.a.createElement(R.a,{type:"ghost",onClick:k},"\u53D6\u6D88")))};function w(v){var i=v.value,k=v.onChange,D=v.mode,c=v.options,b=c===void 0?{}:c,x=Object(a.useRef)(),_=Object(a.useState)(),j=Object(C.a)(_,2),F=j[0],L=j[1];return Object(a.useEffect)(function(){if(F){function X(z){var H=z.getValue();k&&k(H)}return F.on("change",X),function(){F.off("change",X)}}},[F,k]),Object(a.useEffect)(function(){F&&F.setOption("mode",D)},[F,D]),Object(a.useEffect)(function(){F&&((i!==F.getValue()||i==="")&&setTimeout(function(){F.setValue(i||" ")},300))},[F,i]),Object(a.useEffect)(function(){if(x.current&&!F){var X=d.a.fromTextArea(x.current,Object(P.a)({mode:D,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));L(X)}},[x.current,F]),r.a.createElement("div",{className:"my-codemirror-container"},r.a.createElement("textarea",{ref:x}))}},"7ixt":function(I,q,M){"use strict";M.d(q,"a",function(){return S});var P={adjustX:1,adjustY:1},m=[0,0],S={left:{points:["cr","cl"],overflow:P,offset:[-4,0],targetOffset:m},right:{points:["cl","cr"],overflow:P,offset:[4,0],targetOffset:m},top:{points:["bc","tc"],overflow:P,offset:[0,-4],targetOffset:m},bottom:{points:["tc","bc"],overflow:P,offset:[0,4],targetOffset:m},topLeft:{points:["bl","tl"],overflow:P,offset:[0,-4],targetOffset:m},leftTop:{points:["tr","tl"],overflow:P,offset:[-4,0],targetOffset:m},topRight:{points:["br","tr"],overflow:P,offset:[0,-4],targetOffset:m},rightTop:{points:["tl","tr"],overflow:P,offset:[4,0],targetOffset:m},bottomRight:{points:["tr","br"],overflow:P,offset:[0,4],targetOffset:m},rightBottom:{points:["bl","br"],overflow:P,offset:[4,0],targetOffset:m},bottomLeft:{points:["tl","bl"],overflow:P,offset:[0,4],targetOffset:m},leftBottom:{points:["br","bl"],overflow:P,offset:[-4,0],targetOffset:m}},R=S},"815F":function(I,q,M){"use strict";M.d(q,"e",function(){return C}),M.d(q,"c",function(){return s}),M.d(q,"d",function(){return a}),M.d(q,"a",function(){return h}),M.d(q,"f",function(){return d}),M.d(q,"b",function(){return f});var P=M("KQm4"),m=M("VTBJ"),S=M("Ff2n"),R=M("Zm9Q"),T=M("Kwbf"),g=M("OZM5");function C(E,y){return E!=null?E:y}function p(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=new Map;function l(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(u){var w=u.key,v=u.children;Object(T.a)(w!=null,"Tree node must have a certain key: [".concat(o).concat(w,"]"));var i=String(w);Object(T.a)(!y.has(i)||w===null||w===void 0,"Same 'key' exist in the Tree: ".concat(i)),y.set(i,!0),l(v,"".concat(o).concat(i," > "))})}l(E)}function s(E){function y(l){var n=Object(R.a)(l);return n.map(function(o){if(!Object(g.i)(o))return Object(T.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var u=o.key,w=o.props,v=w.children,i=Object(S.a)(w,["children"]),k=Object(m.a)({key:u},i),D=y(v);return D.length&&(k.children=D),k}).filter(function(o){return o})}return y(E)}function a(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(y===!0?[]:y),n=[];function o(u){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(v,i){var k=Object(g.h)(w?w.pos:"0",i),D=C(v.key,k),c=Object(m.a)(Object(m.a)({},v),{},{parent:w,pos:k,children:null,data:v,isStart:[].concat(Object(P.a)(w?w.isStart:[]),[i===0]),isEnd:[].concat(Object(P.a)(w?w.isEnd:[]),[i===u.length-1])});return n.push(c),y===!0||l.has(D)?c.children=o(v.children||[],c):c.children=[],c})}return o(E),n}function r(E,y,l){var n;l?typeof l=="string"?n=function(w){return w[l]}:typeof l=="function"&&(n=function(w){return l(w)}):n=function(w,v){return C(w.key,v)};function o(u,w,v){var i=u?u.children:E,k=u?Object(g.h)(v.pos,w):"0";if(u){var D=n(u,k),c={node:u,index:w,pos:k,key:D,parentPos:v.node?v.pos:null,level:v.level+1};y(c)}i&&i.forEach(function(b,x){o(b,x,{node:u,pos:k,level:v?v.level+1:-1})})}o(null)}function h(E){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=y.initWrapper,n=y.processEntity,o=y.onProcessFinished,u=arguments.length>2?arguments[2]:void 0,w={},v={},i={posEntities:w,keyEntities:v};return l&&(i=l(i)||i),r(E,function(k){var D=k.node,c=k.index,b=k.pos,x=k.key,_=k.parentPos,j=k.level,F={node:D,index:c,key:x,pos:b,level:j},L=C(x,b);w[b]=F,v[L]=F,F.parent=w[_],F.parent&&(F.parent.children=F.parent.children||[],F.parent.children.push(F)),n&&n(F,i)},u),o&&o(i),i}function d(E,y){var l=y.expandedKeys,n=y.selectedKeys,o=y.loadedKeys,u=y.loadingKeys,w=y.checkedKeys,v=y.halfCheckedKeys,i=y.dragOverNodeKey,k=y.dropPosition,D=y.keyEntities,c=D[E],b={eventKey:E,expanded:l.indexOf(E)!==-1,selected:n.indexOf(E)!==-1,loaded:o.indexOf(E)!==-1,loading:u.indexOf(E)!==-1,checked:w.indexOf(E)!==-1,halfChecked:v.indexOf(E)!==-1,pos:String(c?c.pos:""),dragOver:i===E&&k===0,dragOverGapTop:i===E&&k===-1,dragOverGapBottom:i===E&&k===1};return b}function f(E){var y=E.data,l=E.expanded,n=E.selected,o=E.checked,u=E.loaded,w=E.loading,v=E.halfChecked,i=E.dragOver,k=E.dragOverGapTop,D=E.dragOverGapBottom,c=E.pos,b=E.active,x=Object(m.a)(Object(m.a)({},y),{},{expanded:l,selected:n,checked:o,loaded:u,loading:w,halfChecked:v,dragOver:i,dragOverGapTop:k,dragOverGapBottom:D,pos:c,active:b});return"props"in x||Object.defineProperty(x,"props",{get:function(){return Object(T.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),E}}),x}},"8EBN":function(I,q,M){(function(P){P(M("VrN/"))})(function(P){"use strict";P.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 m=0;m<P.modeInfo.length;m++){var S=P.modeInfo[m];S.mimes&&(S.mime=S.mimes[0])}P.findModeByMIME=function(R){R=R.toLowerCase();for(var T=0;T<P.modeInfo.length;T++){var g=P.modeInfo[T];if(g.mime==R)return g;if(g.mimes){for(var C=0;C<g.mimes.length;C++)if(g.mimes[C]==R)return g}}if(/\+xml$/.test(R))return P.findModeByMIME("application/xml");if(/\+json$/.test(R))return P.findModeByMIME("application/json")},P.findModeByExtension=function(R){R=R.toLowerCase();for(var T=0;T<P.modeInfo.length;T++){var g=P.modeInfo[T];if(g.ext){for(var C=0;C<g.ext.length;C++)if(g.ext[C]==R)return g}}},P.findModeByFileName=function(R){for(var T=0;T<P.modeInfo.length;T++){var g=P.modeInfo[T];if(g.file&&g.file.test(R))return g}var C=R.lastIndexOf("."),p=C>-1&&R.substring(C+1,R.length);if(p)return P.findModeByExtension(p)},P.findModeByName=function(R){R=R.toLowerCase();for(var T=0;T<P.modeInfo.length;T++){var g=P.modeInfo[T];if(g.name.toLowerCase()==R)return g;if(g.alias){for(var C=0;C<g.alias.length;C++)if(g.alias[C].toLowerCase()==R)return g}}}})},"8hTe":function(I,q,M){I.exports={button:"button___1wy9m"}},"9Bee":function(I,q,M){"use strict";var P=M("DYRE"),m=M("zeV3"),S=M("+L6B"),R=M("2/Rp"),T=M("k1fw"),g=M("9og8"),C=M("tJVT"),p=M("WmNS"),s=M.n(p),a=M("q1tI"),r=M.n(a),h=M("vg9a"),d=M("DlQD"),f=M.n(d),E=M("rUJ1");function y(ce,K){var Y=ce.match(/^(\s+)(?:```)/);if(Y===null)return K;var ee=Y[1];return K.split(`
`).map(function(ye){var se=ye.match(/^\s+/);if(se===null)return ye;var Pe=Object(C.a)(se,1),Ze=Pe[0];return Ze.length>=ee.length?ye.slice(ee.length):ye}).join(`
`)}var l=[],n=["<ul>"],o=new f.a.Renderer,u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){l.length=0,n=["<ul>"]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function i(ce,K,Y,ee){if(K>=ce.length||ce[K].level<=Y)return K;var ye=ce[K];ee.push("<li><a href='#"+ye.anchor+"'>"+ye.text+"</a>"),K++;var se=[];return K=i(ce,K,ye.level,se),se.length>0&&(ee.push("<ul>"),se.forEach(function(Pe){ee.push(Pe)}),ee.push("</ul>")),ee.push("</li>"),K=i(ce,K,Y,ee),K}function k(){return i(l,0,0,n),n.push("</ul>"),n.join("")}var D={heading:function(K){var Y=u.exec(K);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},fences:function(K){var Y=this.rules.block.fences.exec(K);if(Y){var ee=Y[0],ye=y(ee,Y[3]||""),se=Y[2]?Y[2].trim():Y[2];if(["latex","katex","math"].indexOf(se)>=0){var Pe=x(),Ze=ye;ye=Pe,_[Pe]={type:"block",expression:Ze}}return{type:"code",raw:ee,lang:se,text:ye}}}},c=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,x=function(){return"__special_katext_id_".concat(b++,"__")},_={};function j(){return _}function F(){b=0,_={}}function L(ce){return ce=ce.replace(c,function(K,Y){var ee=x();return _[ee]={type:"inline",expression:Y},ee}),ce}var X=o.listitem;o.listitem=function(ce){return X(L(ce))};var z=o.paragraph;o.paragraph=function(ce){return z(L(ce))};var H=o.tablecell;o.tablecell=function(ce,K){return H(L(ce),K)},o.code=function(ce,K,Y){var ee=(K||"").match(/\S*/)[0];return ee?["latex","katex","math"].indexOf(ee)>=0?"<p class='editormd-tex'>".concat(ce,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(K,'">').concat(Y?ce:Object(E.escape)(ce,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(Y?ce:Object(E.escape)(ce,!0))+"</code></pre>"},o.heading=function(ce,K,Y){var ee=this.options.headerPrefix+Y.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:ee,level:K,text:ce}),"<h"+K+' id="'+ee+'">'+ce+"</h"+K+">"},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:D,renderer:o});var G=f.a,U=M("SJMd"),B=M("ulZh"),W=M.n(B),te=M("m3rI"),de=M("Oy/b"),fe=M("p5ED"),be=M("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 Ce=function(ce,K){return(Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,ee){Y.__proto__=ee}||function(Y,ee){for(var ye in ee)Object.prototype.hasOwnProperty.call(ee,ye)&&(Y[ye]=ee[ye])})(ce,K)};function ue(ce,K){function Y(){this.constructor=ce}Ce(ce,K),ce.prototype=K===null?Object.create(K):(Y.prototype=K.prototype,new Y)}function ge(ce,K,Y,ee){return new(Y||(Y=Promise))(function(ye,se){function Pe(Tt){try{mt(ee.next(Tt))}catch(et){se(et)}}function Ze(Tt){try{mt(ee.throw(Tt))}catch(et){se(et)}}function mt(Tt){var et;Tt.done?ye(Tt.value):(et=Tt.value,et instanceof Y?et:new Y(function(Dt){Dt(et)})).then(Pe,Ze)}mt((ee=ee.apply(ce,K||[])).next())})}function pe(ce,K){var Y,ee,ye,se,Pe={label:0,sent:function(){if(1&ye[0])throw ye[1];return ye[1]},trys:[],ops:[]};return se={next:Ze(0),throw:Ze(1),return:Ze(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Ze(mt){return function(Tt){return function(et){if(Y)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(Y=1,ee&&(ye=2&et[0]?ee.return:et[0]?ee.throw||((ye=ee.return)&&ye.call(ee),0):ee.next)&&!(ye=ye.call(ee,et[1])).done)return ye;switch(ee=0,ye&&(et=[2&et[0],ye.value]),et[0]){case 0:case 1:ye=et;break;case 4:return Pe.label++,{value:et[1],done:!1};case 5:Pe.label++,ee=et[1],et=[0];continue;case 7:et=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(ye=Pe.trys,(ye=ye.length>0&&ye[ye.length-1])||et[0]!==6&&et[0]!==2)){Pe=0;continue}if(et[0]===3&&(!ye||et[1]>ye[0]&&et[1]<ye[3])){Pe.label=et[1];break}if(et[0]===6&&Pe.label<ye[1]){Pe.label=ye[1],ye=et;break}if(ye&&Pe.label<ye[2]){Pe.label=ye[2],Pe.ops.push(et);break}ye[2]&&Pe.ops.pop(),Pe.trys.pop();continue}et=K.call(ce,Pe)}catch(Dt){et=[6,Dt],ee=0}finally{Y=ye=0}if(5&et[0])throw et[1];return{value:et[0]?et[1]:void 0,done:!0}}([mt,Tt])}}}function oe(){for(var ce=0,K=0,Y=arguments.length;K<Y;K++)ce+=arguments[K].length;var ee=Array(ce),ye=0;for(K=0;K<Y;K++)for(var se=arguments[K],Pe=0,Ze=se.length;Pe<Ze;Pe++,ye++)ee[ye]=se[Pe];return ee}var ae=function(){function ce(){}return ce.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ce.setAttributes=function(K,Y){for(var ee=0,ye=Y;ee<ye.length;ee++){var se=ye[ee],Pe=se[0],Ze=se[1];K.setAttribute(Pe,Ze)}},ce.createRect=function(K,Y,ee){var ye=document.createElementNS("http://www.w3.org/2000/svg","rect");return ye.setAttribute("width",K.toString()),ye.setAttribute("height",Y.toString()),ee&&ce.setAttributes(ye,ee),ye},ce.createLine=function(K,Y,ee,ye,se){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",K.toString()),Pe.setAttribute("y1",Y.toString()),Pe.setAttribute("x2",ee.toString()),Pe.setAttribute("y2",ye.toString()),se&&ce.setAttributes(Pe,se),Pe},ce.createPolygon=function(K,Y){var ee=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ee.setAttribute("points",K),Y&&ce.setAttributes(ee,Y),ee},ce.createCircle=function(K,Y){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()),Y&&ce.setAttributes(ee,Y),ee},ce.createEllipse=function(K,Y,ee){var ye=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ye.setAttribute("cx",(K/2).toString()),ye.setAttribute("cy",(Y/2).toString()),ye.setAttribute("rx",(K/2).toString()),ye.setAttribute("ry",(Y/2).toString()),ee&&ce.setAttributes(ye,ee),ye},ce.createGroup=function(K){var Y=document.createElementNS("http://www.w3.org/2000/svg","g");return K&&ce.setAttributes(Y,K),Y},ce.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ce.createMarker=function(K,Y,ee,ye,se,Pe,Ze){var mt=document.createElementNS("http://www.w3.org/2000/svg","marker");return ce.setAttributes(mt,[["id",K],["orient",Y],["markerWidth",ee.toString()],["markerHeight",ye.toString()],["refX",se.toString()],["refY",Pe.toString()]]),mt.appendChild(Ze),mt},ce.createText=function(K){var Y=document.createElementNS("http://www.w3.org/2000/svg","text");return Y.setAttribute("x","0"),Y.setAttribute("y","0"),K&&ce.setAttributes(Y,K),Y},ce.createTSpan=function(K,Y){var ee=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ee.textContent=K,Y&&ce.setAttributes(ee,Y),ee},ce.createImage=function(K){var Y=document.createElementNS("http://www.w3.org/2000/svg","image");return K&&ce.setAttributes(Y,K),Y},ce.createPoint=function(K,Y){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ee.x=K,ee.y=Y,ee},ce.createPath=function(K,Y){var ee=document.createElementNS("http://www.w3.org/2000/svg","path");return ee.setAttribute("d",K),Y&&ce.setAttributes(ee,Y),ee},ce}(),re=function(){function ce(){}return ce.addKey=function(K){ce.key=K},Object.defineProperty(ce,"isLicensed",{get:function(){return!!ce.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ce.key)},enumerable:!1,configurable:!0}),ce}(),he=function(){function ce(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ce.prototype.rasterize=function(K,Y,ee){var ye=this;return new Promise(function(se){var Pe=ee!==void 0?ee:document.createElement("canvas");K===null&&(ye.markersOnly=!0,ye.naturalSize=!1);var Ze=document.createElementNS("http://www.w3.org/2000/svg","svg");Ze.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ze.setAttribute("width",Y.width.baseVal.valueAsString),Ze.setAttribute("height",Y.height.baseVal.valueAsString),Ze.setAttribute("viewBox","0 0 "+Y.viewBox.baseVal.width.toString()+" "+Y.viewBox.baseVal.height.toString()),Ze.innerHTML=Y.innerHTML,ye.naturalSize===!0?(Ze.width.baseVal.value=K.naturalWidth,Ze.height.baseVal.value=K.naturalHeight):ye.width!==void 0&&ye.height!==void 0&&(Ze.width.baseVal.value=ye.width,Ze.height.baseVal.value=ye.height),Pe.width=Ze.width.baseVal.value,Pe.height=Ze.height.baseVal.value;var mt=Ze.outerHTML,Tt=Pe.getContext("2d");ye.markersOnly!==!0&&Tt.drawImage(K,0,0,Pe.width,Pe.height);var et=window.URL,Dt=new Image(Pe.width,Pe.height);Dt.setAttribute("crossOrigin","anonymous");var Zt=new Blob([mt],{type:"image/svg+xml"}),Yt=et.createObjectURL(Zt);Dt.onload=function(){Tt.drawImage(Dt,0,0),et.revokeObjectURL(Yt);var Cr=Pe.toDataURL(ye.imageType,ye.imageQuality);se(Cr)},Dt.src=Yt})},ce}(),Q=function(){},ie=function(){function ce(K){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+K+"_"}return Object.defineProperty(ce.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ce.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(ce.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ce.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},ce.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)},ce.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 we("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new we("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new we("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ne("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ne("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ce.prototype.removeStyleSheet=function(){var K;this.styleSheet&&(((K=this.styleSheetRoot)!==null&&K!==void 0?K:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ce}(),we=function(ce,K){this.selector=ce,this.style=K},ne=function(ce,K){this.localName=ce,this.style=K},J=function(){function ce(K,Y,ee,ye,se){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=K,this.displayMode=Y,this.markerItems=ee,this.uiStyleSettings=ye,this.styles=se,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ce.prototype.show=function(K){var Y=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(se){var Pe=document.createElement("div");Pe.className=""+Y.toolbarButtonStyleClass.name,Pe.setAttribute("data-type-name",se.typeName),Pe.innerHTML=se.icon,Pe.addEventListener("click",function(){Y.markerToolbarButtonClicked(Pe,se)}),Y.buttons.push(Pe),Y.markerButtons.push(Pe)}),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 ye=document.createElement("div");ye.className=this.toolbarBlockStyleClass.name,ye.style.whiteSpace="nowrap",ye.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ye),this.addActionButton(ye,'<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(ye,'<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()},ce.prototype.addButtonClickListener=function(K){this.buttonClickListeners.push(K)},ce.prototype.removeButtonClickListener=function(K){this.buttonClickListeners.indexOf(K)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(K),1)},ce.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ce.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 Y=0;Y<this.markerButtons.length;Y++)Y<K||Y===K&&this.markerButtons.length-1===K?this.markerButtonBlock.appendChild(this.markerButtons[Y]):(Y===K&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[Y]))}},ce.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")},ce.prototype.resetButtonStyles=function(){var K=this;this.buttons.forEach(function(Y){Y.className=Y.className.replace(K.uiStyleSettings.toolbarButtonStyleColorsClassName?K.uiStyleSettings.toolbarButtonStyleColorsClassName:K.toolbarButtonStyleColorsClass.name,"").trim(),Y.className=Y.className.replace(K.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?K.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:K.toolbarActiveButtonStyleColorsClass.name,"").trim(),Y.className+=" "+(K.uiStyleSettings.toolbarButtonStyleColorsClassName?K.uiStyleSettings.toolbarButtonStyleColorsClassName:K.toolbarButtonStyleColorsClass.name)})},ce.prototype.addActionButton=function(K,Y,ee){var ye=this,se=document.createElement("div");switch(se.className=""+this.toolbarButtonStyleClass.name,se.innerHTML=Y,se.setAttribute("data-action",ee),se.addEventListener("click",function(){ye.actionToolbarButtonClicked(se,ee)}),ee){case"select":se.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":se.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":se.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":se.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":se.style.fill=this.uiStyleSettings.closeButtonColor}K.appendChild(se),this.buttons.push(se)},ce.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ne("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 ne("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ne("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ne("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 ne("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var K=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ne("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 ne("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ne("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new we("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new we("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ce.prototype.markerToolbarButtonClicked=function(K,Y){this.setActiveButton(K),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("marker",Y)}),this.markerButtonOverflowBlock.style.display="none"},ce.prototype.actionToolbarButtonClicked=function(K,Y){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("action",Y)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ce.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)},ce.prototype.setActiveMarkerButton=function(K){var Y=this.markerButtons.find(function(ee){return ee.getAttribute("data-type-name")===K});Y&&this.setActiveButton(Y)},ce.prototype.setCurrentMarker=function(K){var Y=this;this.currentMarker=K,this.buttons.filter(function(ee){return/delete|notes/.test(ee.getAttribute("data-action"))}).forEach(function(ee){Y.currentMarker===void 0?(ee.style.fillOpacity="0.4",ee.style.pointerEvents="none"):(ee.style.fillOpacity="1",ee.style.pointerEvents="all")})},ce}(),V=function(){function ce(K,Y,ee,ye){this.panels=[],this.panelButtons=[],this.markerjsContainer=K,this.displayMode=Y,this.uiStyleSettings=ee,this.styles=ye,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ce.prototype.addStyles=function(){var K;this.toolboxStyleClass=this.styles.addClass(new ne("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 ne("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var Y=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ne("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ne("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ne("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 ne("toolbox-panel-row_colors",`
background-color: `+((K=this.uiStyleSettings.toolboxBackgroundColor)!==null&&K!==void 0?K:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ne("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Y)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Y)+`px;
padding: `+Y+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new we("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new we("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ce.prototype.show=function(K){var Y;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=K,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Y!==void 0?Y:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ce.prototype.setPanelButtons=function(K){var Y,ee,ye=this;this.panels=K,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Y!==void 0?Y: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(se){var Pe;se.uiStyleSettings=ye.uiStyleSettings;var Ze=document.createElement("div");Ze.className=ye.toolboxButtonStyleClass.name+" "+((Pe=ye.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:ye.toolboxButtonStyleColorsClass.name),Ze.innerHTML=se.icon,Ze.title=se.title,Ze.addEventListener("click",function(){ye.panelButtonClick(se)}),ye.panelButtons.push(Ze),ye.buttonRow.appendChild(Ze)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ce.prototype.panelButtonClick=function(K){var Y=this,ee=-1;if(K!==this.activePanel){ee=this.panels.indexOf(K),this.panelRow.innerHTML="";var ye=K.getUi();ye.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ye),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(){Y.displayMode==="inline"?Y.panelRow.style.display="none":Y.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(se,Pe){var Ze,mt;se.className=Y.toolboxButtonStyleClass.name+" "+(Pe===ee?""+((Ze=Y.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ze!==void 0?Ze:Y.toolboxActiveButtonStyleColorsClass.name):""+((mt=Y.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&mt!==void 0?mt:Y.toolboxButtonStyleColorsClass.name))})},ce}(),Z=function(ce,K){this.title=ce,this.icon=K},Ee=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Pe.colors=[],Pe.addTransparent=!1,Pe.colorBoxes=[],Pe.colors=ee,Pe.currentColor=ye,Pe.setCurrentColor=Pe.setCurrentColor.bind(Pe),Pe.getColorBox=Pe.getColorBox.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.whiteSpace="nowrap",this.colors.forEach(function(ye){var se=Y.getColorBox(ye);ee.appendChild(se),Y.colorBoxes.push(se)}),ee},K.prototype.getColorBox=function(Y){var ee=this,ye=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-ye,Pe=document.createElement("div");Pe.style.display="inline-block",Pe.style.boxSizing="content-box",Pe.style.width=se-2+"px",Pe.style.height=se-2+"px",Pe.style.padding="1px",Pe.style.marginRight="2px",Pe.style.marginBottom="2px",Pe.style.borderWidth="2px",Pe.style.borderStyle="solid",Pe.style.borderRadius=(se+2)/2+"px",Pe.style.borderColor=Y===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Pe.addEventListener("click",function(){ee.setCurrentColor(Y,Pe)});var Ze=document.createElement("div");return Ze.style.display="inline-block",Ze.style.width=se-2+"px",Ze.style.height=se-2+"px",Ze.style.backgroundColor=Y,Ze.style.borderRadius=se/2+"px",Y==="transparent"&&(Ze.style.fill=this.uiStyleSettings.toolboxAccentColor,Ze.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>`),Pe.appendChild(Ze),Pe},K.prototype.setCurrentColor=function(Y,ee){var ye=this;this.currentColor=Y,this.colorBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Y)},K}(Z),xe=function(){function ce(K,Y,ee){this._state="new",this._isSelected=!1,this._container=K,this._overlayContainer=Y,this.globalSettings=ee,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ce.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ce.prototype.ownsTarget=function(K){return!1},Object.defineProperty(ce.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ce.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ce.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ce.prototype.pointerDown=function(K,Y){},ce.prototype.dblClick=function(K,Y){},ce.prototype.manipulate=function(K){},ce.prototype.pointerUp=function(K){this.stateChanged()},ce.prototype.dispose=function(){},ce.prototype.addMarkerVisualToContainer=function(K){this.container.childNodes.length>0?this.container.insertBefore(K,this.container.childNodes[0]):this.container.appendChild(K)},ce.prototype.getState=function(){return{typeName:ce.typeName,state:this.state,notes:this.notes}},ce.prototype.restoreState=function(K){this._state=K.state,this.notes=K.notes},ce.prototype.scale=function(K,Y){},ce.prototype.colorChanged=function(K){this.onColorChanged&&this.onColorChanged(K),this.stateChanged()},ce.prototype.fillColorChanged=function(K){this.onFillColorChanged&&this.onFillColorChanged(K),this.stateChanged()},ce.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)}},ce.typeName="MarkerBase",ce}(),_e=function(){function ce(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ce.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},ce}(),Ne=function(){function ce(){this.GRIP_SIZE=10,this.visual=ae.createGroup(),this.visual.appendChild(ae.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ae.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ce.prototype.ownsTarget=function(K){return K===this.visual||K===this.visual.childNodes[0]||K===this.visual.childNodes[1]},ce}(),Be=function(){function ce(){}return ce.toITransformMatrix=function(K){return{a:K.a,b:K.b,c:K.c,d:K.d,e:K.e,f:K.f}},ce.toSVGMatrix=function(K,Y){return K.a=Y.a,K.b=Y.b,K.c=Y.c,K.d=Y.d,K.e=Y.e,K.f=Y.f,K},ce}(),We=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.left=0,se.top=0,se.width=0,se.height=0,se.defaultSize={x:50,y:20},se.offsetX=0,se.offsetY=0,se.rotationAngle=0,se.CB_DISTANCE=10,se._suppressMarkerCreateEvent=!1,se.container.transform.baseVal.appendItem(ae.createTransform()),se.setupControlBox(),se}return ue(K,ce),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(Y){this._visual=Y;var ee=ae.createTransform();this._visual.transform.baseVal.appendItem(ee)},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(Y){return!!ce.prototype.ownsTarget.call(this,Y)||!!(this.controlGrips.findGripByVisual(Y)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Y))},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.state==="new"&&(this.left=Y.x,this.top=Y.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ye=this.unrotatePoint(Y);if(this.manipulationStartX=ye.x,this.manipulationStartY=ye.y,this.offsetX=ye.x-this.left,this.offsetY=ye.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 se=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=se.x-this.width/2,this.top=se.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Pe=this.container.transform.baseVal.getItem(0);Pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},K.prototype.pointerUp=function(Y){var ee=this.state;ce.prototype.pointerUp.call(this,Y),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Y),this._state="select",ee==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},K.prototype.moveVisual=function(Y){this.visual.style.transform="translate("+Y.x+"px, "+Y.y+"px)"},K.prototype.manipulate=function(Y){var ee=this.unrotatePoint(Y);this.state==="creating"?this.resize(Y):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(Y)},K.prototype.resize=function(Y){var ee=this.manipulationStartLeft,ye=this.manipulationStartWidth,se=this.manipulationStartTop,Pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ee=this.manipulationStartLeft+Y.x-this.manipulationStartX,ye=this.manipulationStartWidth+this.manipulationStartLeft-ee;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ye=this.manipulationStartWidth+Y.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:se=this.manipulationStartTop+Y.y-this.manipulationStartY,Pe=this.manipulationStartHeight+this.manipulationStartTop-se;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Pe=this.manipulationStartHeight+Y.y-this.manipulationStartY}ye>=0?(this.left=ee,this.width=ye):(this.left=ee+ye,this.width=-ye),Pe>=0?(this.top=se,this.height=Pe):(this.top=se+Pe,this.height=-Pe),this.setSize()},K.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},K.prototype.rotate=function(Y){if(Math.abs(Y.x-this.centerX)>.1){var ee=Math.sign(Y.x-this.centerX);this.rotationAngle=180*Math.atan((Y.y-this.centerY)/(Y.x-this.centerX))/Math.PI+90*ee,this.applyRotation()}},K.prototype.applyRotation=function(){var Y=this.container.transform.baseVal.getItem(0);Y.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Y,0)},K.prototype.rotatePoint=function(Y){if(this.rotationAngle===0)return Y;var ee=this.container.getCTM(),ye=ae.createPoint(Y.x,Y.y);return{x:(ye=ye.matrixTransform(ee)).x,y:ye.y}},K.prototype.unrotatePoint=function(Y){if(this.rotationAngle===0)return Y;var ee=this.container.getCTM();ee=ee.inverse();var ye=ae.createPoint(Y.x,Y.y);return{x:(ye=ye.matrixTransform(ee)).x,y:ye.y}},K.prototype.select=function(){ce.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},K.prototype.deselect=function(){ce.prototype.deselect.call(this),this.controlBox.style.display="none"},K.prototype.setupControlBox=function(){this.controlBox=ae.createGroup();var Y=ae.createTransform();Y.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Y),this.container.appendChild(this.controlBox),this.controlRect=ae.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=ae.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 _e,this.addControlGrips(),this.controlBox.style.display="none"},K.prototype.adjustControlBox=function(){var Y=this.controlBox.transform.baseVal.getItem(0);Y.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Y,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 Y=new Ne;return Y.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(Y.visual),Y},K.prototype.positionGrips=function(){var Y=this.controlGrips.topLeft.GRIP_SIZE,ee=-Y/2,ye=ee,se=(this.width+this.CB_DISTANCE)/2-Y/2,Pe=(this.height+this.CB_DISTANCE)/2-Y/2,Ze=this.height+this.CB_DISTANCE-Y/2,mt=this.width+this.CB_DISTANCE-Y/2;this.positionGrip(this.controlGrips.topLeft.visual,ee,ye),this.positionGrip(this.controlGrips.topCenter.visual,se,ye),this.positionGrip(this.controlGrips.topRight.visual,mt,ye),this.positionGrip(this.controlGrips.centerLeft.visual,ee,Pe),this.positionGrip(this.controlGrips.centerRight.visual,mt,Pe),this.positionGrip(this.controlGrips.bottomLeft.visual,ee,Ze),this.positionGrip(this.controlGrips.bottomCenter.visual,se,Ze),this.positionGrip(this.controlGrips.bottomRight.visual,mt,Ze),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,ye-3*this.CB_DISTANCE)},K.prototype.positionGrip=function(Y,ee,ye){var se=Y.transform.baseVal.getItem(0);se.setTranslate(ee,ye),Y.transform.baseVal.replaceItem(se,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:Be.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Be.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ce.prototype.getState.call(this))},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;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(Be.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ee.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Be.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ee.containerTransformMatrix))},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,ee);var ye=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:ye.x*Y,y:ye.y*ee});this.left=se.x,this.top=se.y,this.width=this.width*Y,this.height=this.height*ee,this.adjustControlBox()},K}(xe),Ue=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.createVisual=se.createVisual.bind(se),se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.visual)},K.prototype.createVisual=function(){this.visual=ae.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(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(Y),this._state="creating")},K.prototype.manipulate=function(Y){ce.prototype.manipulate.call(this,Y)},K.prototype.resize=function(Y){ce.prototype.resize.call(this,Y),this.setSize()},K.prototype.setSize=function(){ce.prototype.setSize.call(this),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},K.prototype.pointerUp=function(Y){ce.prototype.pointerUp.call(this,Y),this.setSize()},K.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.visual&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Y),this.stateChanged()},K.prototype.setFillColor=function(Y){this.fillColor=Y,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},K.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},K.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.visual&&ae.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},ce.prototype.getState.call(this))},K.prototype.restoreState=function(Y){var ee=Y;this.fillColor=ee.fillColor,this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.opacity=ee.opacity,this.createVisual(),ce.prototype.restoreState.call(this,Y),this.setSize()},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,ee),this.setSize()},K.title="Rectangle marker",K}(We),ze=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Pe.widths=[],Pe.widthBoxes=[],Pe.widths=ee,Pe.currentWidth=ye,Pe.setCurrentWidth=Pe.setCurrentWidth.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.widths.forEach(function(ye){var se=document.createElement("div");se.style.display="flex",se.style.flexGrow="2",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=ye===Y.currentWidth?Y.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){Y.setCurrentWidth(ye,se)}),ee.appendChild(se);var Pe=document.createElement("div");Pe.innerText=ye.toString(),Pe.style.marginRight="5px",se.appendChild(Pe);var Ze=document.createElement("div");Ze.style.minHeight="20px",Ze.style.flexGrow="2",Ze.style.display="flex",Ze.style.alignItems="center";var mt=document.createElement("hr");mt.style.minWidth="20px",mt.style.border="0px",mt.style.borderTop=ye+"px solid "+Y.uiStyleSettings.toolboxColor,mt.style.flexGrow="2",Ze.appendChild(mt),se.appendChild(Ze),Y.widthBoxes.push(se)}),ee},K.prototype.setCurrentWidth=function(Y,ee){var ye=this;this.currentWidth=Y,this.widthBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},K}(Z),Ke=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Pe.styles=[],Pe.styleBoxes=[],Pe.styles=ee,Pe.currentStyle=ye,Pe.setCurrentStyle=Pe.setCurrentStyle.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.styles.forEach(function(ye){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/Y.styles.length-5+"%",se.style.borderColor=ye===Y.currentStyle?Y.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){Y.setCurrentStyle(ye,se)}),ee.appendChild(se);var Pe=document.createElement("div");Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.overflow="hidden";var Ze=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Y.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ye!==""?'stroke-dasharray="'+ye+'"':"")+` />
</svg>`;Pe.innerHTML=Ze,se.appendChild(Pe),Y.styleBoxes.push(se)}),ee},K.prototype.setCurrentStyle=function(Y,ee){var ye=this;this.currentStyle=Y,this.styleBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},K}(Z),Ye=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.strokeColor=ye.defaultColor,se.strokeWidth=ye.defaultStrokeWidth,se.strokeDasharray=ye.defaultStrokeDasharray,se.strokePanel=new Ee("Line color",ye.defaultColorSet,ye.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ze("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new Ke("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return ue(K,ce),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},K.typeName="FrameMarker",K.title="Frame marker",K.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',K}(Ue),Re=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(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.x1=0,se.y1=0,se.x2=0,se.y2=0,se.defaultLength=50,se.manipulationStartX=0,se.manipulationStartY=0,se.manipulationStartX1=0,se.manipulationStartY1=0,se.manipulationStartX2=0,se.manipulationStartY2=0,se.setupControlBox(),se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!!ce.prototype.ownsTarget.call(this,Y)||!(!this.grip1.ownsTarget(Y)&&!this.grip2.ownsTarget(Y))},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.manipulationStartX=Y.x,this.manipulationStartY=Y.y,this.state==="new"&&(this.x1=Y.x,this.y1=Y.y,this.x2=Y.x,this.y2=Y.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(Y){var ee=this.state;ce.prototype.pointerUp.call(this,Y),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(Y),this._state="select",ee==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},K.prototype.adjustVisual=function(){},K.prototype.manipulate=function(Y){this.state==="creating"?this.resize(Y):this.state==="move"?(this.x1=this.manipulationStartX1+Y.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Y.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Y.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Y.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Y)},K.prototype.resize=function(Y){switch(this.activeGrip){case this.grip1:this.x1=Y.x,this.y1=Y.y;break;case this.grip2:case void 0:this.x2=Y.x,this.y2=Y.y}this.adjustVisual(),this.adjustControlBox()},K.prototype.select=function(){ce.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},K.prototype.deselect=function(){ce.prototype.deselect.call(this),this.controlBox.style.display="none"},K.prototype.setupControlBox=function(){this.controlBox=ae.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 Y=new Ne;return Y.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(Y.visual),Y},K.prototype.positionGrips=function(){var Y=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Y/2,this.y1-Y/2),this.positionGrip(this.grip2.visual,this.x2-Y/2,this.y2-Y/2)},K.prototype.positionGrip=function(Y,ee,ye){var se=Y.transform.baseVal.getItem(0);se.setTranslate(ee,ye),Y.transform.baseVal.replaceItem(se,0)},K.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ce.prototype.getState.call(this))},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;this.x1=ee.x1,this.y1=ee.y1,this.x2=ee.x2,this.y2=ee.y2},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,ee),this.x1=this.x1*Y,this.y1=this.y1*ee,this.x2=this.x2*Y,this.y2=this.y2*ee,this.adjustVisual(),this.adjustControlBox()},K}(xe),rt=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.strokeColor=ye.defaultColor,se.strokeWidth=ye.defaultStrokeWidth,se.strokeDasharray=ye.defaultStrokeDasharray,se.strokePanel=new Ee("Line color",ye.defaultColorSet,ye.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ze("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new Ke("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.visual&&Y!==this.selectorLine&&Y!==this.visibleLine)},K.prototype.createVisual=function(){this.visual=ae.createGroup(),this.selectorLine=ae.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ae.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(Y,ee){ce.prototype.pointerDown.call(this,Y,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()),ae.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},K.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.adjustVisual(),this.colorChanged(Y)},K.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.adjustVisual()},K.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,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 Y=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;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),He=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Pe.fonts=[],Pe.fontBoxes=[],Pe.fonts=ee,Pe.currentFont=ye,Pe.setCurrentFont=Pe.setCurrentFont.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.flexGrow="2",this.fonts.forEach(function(ye){var se=document.createElement("div");se.style.display="inline-block",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/Y.fonts.length-5+"%",se.style.borderColor=ye===Y.currentFont?Y.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){Y.setCurrentFont(ye,se)}),ee.appendChild(se);var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.fontFamily=ye,Pe.style.overflow="hidden";var Ze=document.createElement("div");Ze.style.whiteSpace="nowrap",Ze.style.overflow="hidden",Ze.style.textOverflow="ellipsis",Ze.innerHTML="The quick brown fox jumps over the lazy dog",Pe.appendChild(Ze),se.appendChild(Pe),Y.fontBoxes.push(se)}),ee},K.prototype.setCurrentFont=function(Y,ee){var ye=this;this.currentFont=Y,this.fontBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},K}(Z),$e=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=ye.defaultColor,se.fontFamily=ye.defaultFontFamily,se.defaultSize={x:100,y:30},se.setColor=se.setColor.bind(se),se.setFont=se.setFont.bind(se),se.renderText=se.renderText.bind(se),se.sizeText=se.sizeText.bind(se),se.textEditDivClicked=se.textEditDivClicked.bind(se),se.showTextEditor=se.showTextEditor.bind(se),se.setSize=se.setSize.bind(se),se.positionTextEditor=se.positionTextEditor.bind(se),se.colorPanel=new Ee("Color",ye.defaultColorSet,ye.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new He("Font",ye.defaultFontFamilies,ye.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){if(ce.prototype.ownsTarget.call(this,Y)||Y===this.visual||Y===this.textElement||Y===this.bgRectangle)return!0;var ee=!1;return this.textElement.childNodes.forEach(function(ye){ye===Y&&(ee=!0)}),ee},K.prototype.createVisual=function(){this.visual=ae.createGroup(),this.bgRectangle=ae.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ae.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.isMoved=!1,this.pointerDownPoint=Y,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Y),this._state="creating")},K.prototype.renderText=function(){var Y=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){Y.textElement.appendChild(ae.createTSpan(ee.trim()===""?" ":ee.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},K.prototype.getTextScale=function(){var Y=this.textElement.getBBox(),ee=1;if(Y.width>0&&Y.height>0){var ye=(1*this.width-this.width*this.padding*2/100)/Y.width,se=(1*this.height-this.height*this.padding*2/100)/Y.height;ee=Math.min(ye,se)}return ee},K.prototype.getTextPosition=function(Y){var ee=this.textElement.getBBox(),ye=0,se=0;return ee.width>0&&ee.height>0&&(ye=(this.width-ee.width*Y)/2,se=this.height/2-ee.height*Y/2),{x:ye,y:se}},K.prototype.sizeText=function(){var Y=this.textElement.getBBox(),ee=this.getTextScale(),ye=this.getTextPosition(ee);ye.y-=Y.y*ee,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ye.x+"px, "+ye.y+"px) scale("+ee+", "+ee+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ye.x,ye.y),this.textElement.transform.baseVal.getItem(1).setScale(ee,ee))},K.prototype.manipulate=function(Y){ce.prototype.manipulate.call(this,Y),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Y.x-this.pointerDownPoint.x)>5||Math.abs(Y.y-this.pointerDownPoint.y)>5)},K.prototype.resize=function(Y){ce.prototype.resize.call(this,Y),this.isMoved=!0,this.setSize(),this.sizeText()},K.prototype.setSize=function(){ce.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},K.prototype.pointerUp=function(Y){var ee=this.state;ee==="creating"&&(this._suppressMarkerCreateEvent=!0),ce.prototype.pointerUp.call(this,Y),this.setSize(),(ee==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},K.prototype.showTextEditor=function(){var Y=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(Y.textEditor.style.fontSize);Y.textEditor.clientWidth>=Number.parseInt(Y.textEditor.style.maxWidth)&&ee>.9;)ee-=.1,Y.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 ye=ee.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(ye)),ee.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Y.textEditDivClicked(Y.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 Y=this.getTextScale(),ee=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ye=this.textElement.getBBox(),se={x:ye.width*Y,y:ye.height*Y};ee.x-=se.x/2,ee.y-=se.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*Y,12)+"px",this.textElement.style.display="none"}},K.prototype.textEditDivClicked=function(Y){this.text=Y.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},K.prototype.select=function(){ce.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},K.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ce.prototype.deselect.call(this)},K.prototype.dblClick=function(Y,ee){ce.prototype.dblClick.call(this,Y,ee),this.showTextEditor()},K.prototype.setColor=function(Y){this.textElement&&ae.setAttributes(this.textElement,[["fill",Y]]),this.color=Y,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Y)},K.prototype.setFont=function(Y){this.textElement&&ae.setAttributes(this.textElement,[["font-family",Y]]),this.fontFamily=Y,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 Y=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){var ee=Y;this.color=ee.color,this.fontFamily=ee.fontFamily,this.padding=ee.padding,this.text=ee.text,this.createVisual(),ce.prototype.restoreState.call(this,Y),this.setSize()},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,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}(We),Ie=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=ye.defaultColor,se.lineWidth=ye.defaultStrokeWidth,se.pixelRatio=ye.freehandPixelRatio,se.setColor=se.setColor.bind(se),se.addCanvas=se.addCanvas.bind(se),se.finishCreation=se.finishCreation.bind(se),se.setLineWidth=se.setLineWidth.bind(se),se.colorPanel=new Ee("Color",ye.defaultColorSet,ye.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new ze("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),se.lineWidthPanel.onWidthChanged=se.setLineWidth,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.visual&&Y!==this.drawingImage)},K.prototype.createVisual=function(){this.visual=ae.createGroup(),this.drawingImage=ae.createImage(),this.visual.appendChild(this.drawingImage);var Y=ae.createTransform();this.visual.transform.baseVal.appendItem(Y),this.addMarkerVisualToContainer(this.visual)},K.prototype.pointerDown=function(Y,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(Y.x,Y.y),this.drawing=!0):ce.prototype.pointerDown.call(this,Y,ee)},K.prototype.manipulate=function(Y){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Y.x,Y.y),this.canvasContext.stroke()):ce.prototype.manipulate.call(this,Y)},K.prototype.resize=function(Y){ce.prototype.resize.call(this,Y),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},K.prototype.pointerUp=function(Y){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ce.prototype.pointerUp.call(this,Y)},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(),ce.prototype.select.call(this)},K.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ce.prototype.deselect.call(this)},K.prototype.finishCreation=function(){for(var Y=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ee=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ye=ee[0],se=ee[1],Pe=ee[2],Ze=ee[3],mt=!1,Tt=0;Tt<this.canvasElement.height;Tt++)for(var et=0;et<this.canvasElement.width;et++)Y.data[Tt*this.canvasElement.width*4+4*et+3]>0&&(mt=!0,Tt<se&&(se=Tt),et<ye&&(ye=et),Tt>Ze&&(Ze=Tt),et>Pe&&(Pe=et));if(mt){this.left=ye/this.pixelRatio,this.top=se/this.pixelRatio,this.width=(Pe-ye)/this.pixelRatio,this.height=(Ze-se)/this.pixelRatio;var Dt=document.createElement("canvas");Dt.width=Pe-ye,Dt.height=Ze-se,Dt.getContext("2d").putImageData(this.canvasContext.getImageData(ye,se,Pe-ye,Ze-se),0,0),this.drawingImgUrl=Dt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},K.prototype.setDrawingImage=function(){ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},K.prototype.setColor=function(Y){this.color=Y,this.colorChanged(Y)},K.prototype.setLineWidth=function(Y){this.lineWidth=Y},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 Y=Object.assign({drawingImgUrl:this.drawingImgUrl},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){this.createVisual(),ce.prototype.restoreState.call(this,Y),this.drawingImgUrl=Y.drawingImgUrl,this.setDrawingImage()},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,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}(We),Oe=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ye||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return se.typeBoxes=[],se.currentType=ee,se.setCurrentType=se.setCurrentType.bind(se),se}return ue(K,ce),K.prototype.getUi=function(){var Y=this,ee=document.createElement("div");ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2";for(var ye=function(Ze){var mt="both";switch(Ze){case 0:mt="both";break;case 1:mt="start";break;case 2:mt="end";break;case 3:mt="none"}var Tt=document.createElement("div");if(Tt.style.display="flex",Tt.style.flexGrow="2",Tt.style.alignItems="center",Tt.style.justifyContent="space-between",Tt.style.padding="5px",Tt.style.borderWidth="2px",Tt.style.borderStyle="solid",Tt.style.borderColor=mt===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",Tt.addEventListener("click",function(){Y.setCurrentType(mt,Tt)}),ee.appendChild(Tt),mt==="both"||mt==="start"){var et=document.createElement("div");et.style.display="flex",et.style.alignItems="center",et.style.minHeight="20px",et.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,et.style.marginLeft="5px",Tt.appendChild(et)}var Dt=document.createElement("div");Dt.style.display="flex",Dt.style.alignItems="center",Dt.style.minHeight="20px",Dt.style.flexGrow="2";var Zt=document.createElement("hr");if(Zt.style.minWidth="20px",Zt.style.border="0px",Zt.style.borderTop="3px solid "+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee"),Zt.style.flexGrow="2",Dt.appendChild(Zt),Tt.appendChild(Dt),mt==="both"||mt==="end"){var Yt=document.createElement("div");Yt.style.display="flex",Yt.style.alignItems="center",Yt.style.minHeight="20px",Yt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Yt.style.marginRight="5px",Tt.appendChild(Yt)}se.typeBoxes.push(Tt)},se=this,Pe=0;Pe<4;Pe++)ye(Pe);return ee},K.prototype.setCurrentType=function(Y,ee){var ye=this;this.currentType=Y,this.typeBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings!==void 0?ye.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},K}(Z),Le=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.arrowType="end",se.arrowBaseHeight=10,se.arrowBaseWidth=10,se.getArrowPoints=se.getArrowPoints.bind(se),se.setArrowType=se.setArrowType.bind(se),se.arrowTypePanel=new Oe("Arrow type","end"),se.arrowTypePanel.onArrowTypeChanged=se.setArrowType,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.arrow1&&Y!==this.arrow2)},K.prototype.getArrowPoints=function(Y,ee){var ye=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return Y-ye/2+","+(ee+se/2)+" "+Y+","+(ee-se/2)+" "+(Y+ye/2)+","+(ee+se/2)},K.prototype.createTips=function(){this.arrow1=ae.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ae.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow2)},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.state==="creating"&&this.createTips()},K.prototype.adjustVisual=function(){if(ce.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",ae.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ae.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var Y=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(Y,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ee,0);var ye=this.arrow2.transform.baseVal.getItem(0);ye.setRotate(Y+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ye,0)}},K.prototype.setArrowType=function(Y){this.arrowType=Y,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 Y=Object.assign({arrowType:this.arrowType},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;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}(rt),Te=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.fillColor=ye.defaultFillColor,se.strokeWidth=0,se.fillPanel=new Ee("Color",ye.defaultColorSet,ye.defaultFillColor),se.fillPanel.onColorChanged=se.setFillColor,se}return ue(K,ce),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},K.typeName="CoverMarker",K.title="Cover marker",K.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',K}(Ue),Ae=function(ce){function K(Y,ee,ye,se){var Pe=ce.call(this,Y,se||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Pe.opacities=[],Pe.opacityBoxes=[],Pe.opacities=ee,Pe.currentOpacity=ye,Pe.setCurrentOpacity=Pe.setCurrentOpacity.bind(Pe),Pe}return ue(K,ce),K.prototype.getUi=function(){var Y=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(ye){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=ye===Y.currentOpacity?Y.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){Y.setCurrentOpacity(ye,se)}),ee.appendChild(se);var Pe=document.createElement("div");Pe.innerText=100*ye+"%",se.appendChild(Pe),Y.opacityBoxes.push(se)}),ee},K.prototype.setCurrentOpacity=function(Y,ee){var ye=this;this.currentOpacity=Y,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===ee?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},K}(Z),De=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=ye.defaultHighlightColor,se.strokeWidth=0,se.opacity=ye.defaultHighlightOpacity,se.fillPanel=new Ee("Color",ye.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Ae("Opacity",ye.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return ue(K,ce),K.prototype.setOpacity=function(Y){this.opacity=Y,this.visual&&ae.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 Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},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}(Te),Me='<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>',Fe=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.bgColor="transparent",se.tipPosition={x:0,y:0},se.tipBase1Position={x:0,y:0},se.tipBase2Position={x:0,y:0},se.tipMoving=!1,se.color=ye.defaultStrokeColor,se.bgColor=ye.defaultFillColor,se.fontFamily=ye.defaultFontFamily,se.defaultSize={x:100,y:30},se.setBgColor=se.setBgColor.bind(se),se.getTipPoints=se.getTipPoints.bind(se),se.positionTip=se.positionTip.bind(se),se.setTipPoints=se.setTipPoints.bind(se),se.colorPanel=new Ee("Text color",ye.defaultColorSet,se.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),se.colorPanel.onColorChanged=se.setColor,se.bgColorPanel=new Ee("Fill color",ye.defaultColorSet,se.bgColor,Me),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new He("Font",ye.defaultFontFamilies,ye.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se.tipGrip=new Ne,se.tipGrip.visual.transform.baseVal.appendItem(ae.createTransform()),se.controlBox.appendChild(se.tipGrip.visual),se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return ce.prototype.ownsTarget.call(this,Y)||this.tipGrip.ownsTarget(Y)||this.tip===Y},K.prototype.createTip=function(){ae.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ae.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},K.prototype.pointerDown=function(Y,ee){this.state==="new"&&ce.prototype.pointerDown.call(this,Y,ee),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ee)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ce.prototype.pointerDown.call(this,Y,ee)},K.prototype.pointerUp=function(Y){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ce.prototype.pointerUp.call(this,Y);else{var ee=this.state==="creating";ce.prototype.pointerUp.call(this,Y),this.setTipPoints(ee),this.positionTip()}},K.prototype.manipulate=function(Y){if(this.tipMoving){var ee=this.unrotatePoint(Y);this.tipPosition={x:ee.x-this.manipulationStartLeft,y:ee.y-this.manipulationStartTop},this.positionTip()}else ce.prototype.manipulate.call(this,Y)},K.prototype.setBgColor=function(Y){this.bgRectangle&&this.tip&&(ae.setAttributes(this.bgRectangle,[["fill",Y]]),ae.setAttributes(this.tip,[["fill",Y]])),this.bgColor=Y,this.fillColorChanged(Y)},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(Y){Y===void 0&&(Y=!1);var ee=Math.min(this.height/2,15),ye=this.height/5;Y&&(this.tipPosition={x:ee+ye/2,y:this.height+20});var se=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?se<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ye=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:ee,y:0},this.tipBase2Position={x:ee+ye,y:0}):(this.tipBase1Position={x:0,y:ee},this.tipBase2Position={x:0,y:ee+ye}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?se<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ye=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ee-ye,y:0},this.tipBase2Position={x:this.width-ee,y:0}):(this.tipBase1Position={x:this.width,y:ee},this.tipBase2Position={x:this.width,y:ee+ye}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?se<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ye=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ee-ye,y:this.height},this.tipBase2Position={x:this.width-ee,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ee-ye},this.tipBase2Position={x:this.width,y:this.height-ee}):se<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ye=this.width/5,ee=Math.min(this.width/2,15),this.tipBase1Position={x:ee,y:this.height},this.tipBase2Position={x:ee+ye,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ee},this.tipBase2Position={x:0,y:this.height-ee-ye})},K.prototype.resize=function(Y){ce.prototype.resize.call(this,Y),this.positionTip()},K.prototype.positionTip=function(){ae.setAttributes(this.tip,[["points",this.getTipPoints()]]);var Y=this.tipGrip.visual.transform.baseVal.getItem(0);Y.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(Y,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(),ce.prototype.select.call(this)},K.prototype.getState=function(){var Y=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){var ee=Y;this.bgColor=ee.bgColor,this.tipPosition=ee.tipPosition,ce.prototype.restoreState.call(this,Y),this.createTip(),this.setTipPoints()},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,ee),this.tipPosition={x:this.tipPosition.x*Y,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}($e),Xe=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.strokeColor=ye.defaultColor,se.strokeWidth=ye.defaultStrokeWidth,se.strokeDasharray=ye.defaultStrokeDasharray,se.fillColor=ye.defaultFillColor,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.setOpacity=se.setOpacity.bind(se),se.createVisual=se.createVisual.bind(se),se.strokePanel=new Ee("Line color",oe(ye.defaultColorSet,["transparent"]),ye.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.fillPanel=new Ee("Fill color",oe(ye.defaultColorSet,["transparent"]),se.fillColor,Me),se.fillPanel.onColorChanged=se.setFillColor,se.strokeWidthPanel=new ze("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new Ke("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se.opacityPanel=new Ae("Opacity",ye.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.visual)},K.prototype.createVisual=function(){this.visual=ae.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(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(Y),this._state="creating")},K.prototype.manipulate=function(Y){ce.prototype.manipulate.call(this,Y)},K.prototype.resize=function(Y){ce.prototype.resize.call(this,Y),this.setSize()},K.prototype.setSize=function(){ce.prototype.setSize.call(this),ae.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(Y){ce.prototype.pointerUp.call(this,Y),this.setSize()},K.prototype.setStrokeColor=function(Y){this.strokeColor=Y,this.visual&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Y),this.stateChanged()},K.prototype.setFillColor=function(Y){this.fillColor=Y,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Y),this.stateChanged()},K.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},K.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.visual&&ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},K.prototype.setOpacity=function(Y){this.opacity=Y,this.visual&&ae.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 Y=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){var ee=Y;this.fillColor=ee.fillColor,this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.opacity=ee.opacity,this.createVisual(),ce.prototype.restoreState.call(this,Y),this.setSize()},K.prototype.scale=function(Y,ee){ce.prototype.scale.call(this,Y,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}(We),qe=function(ce){function K(Y,ee,ye){return ce.call(this,Y,ee,ye)||this}return ue(K,ce),Object.defineProperty(K.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.tip1&&Y!==this.tip2)},K.prototype.createTips=function(){this.tip1=ae.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(ae.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ae.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(ae.createTransform()),this.visual.appendChild(this.tip2)},K.prototype.pointerDown=function(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.state==="creating"&&this.createTips()},K.prototype.adjustVisual=function(){if(ce.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ae.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()]]),ae.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 Y=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(Y,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ee,0);var ye=this.tip2.transform.baseVal.getItem(0);ye.setRotate(Y+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ye,0)}},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y),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}(rt),pt=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.strokePanel.colors=ye.defaultColorSet,se.fillColor="transparent",se}return ue(K,ce),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=ce.prototype.getState.call(this);return Y.typeName=K.typeName,Y},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}(Xe),at=function(){function ce(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ce.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ce.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))},ce.prototype.replaceLastUndoStep=function(K){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=K)},ce.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ce.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}},ce.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ce}(),ft=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee,ye)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.curveX=0,se.curveY=0,se.manipulationStartCurveX=0,se.manipulationStartCurveY=0,se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.positionGrips=se.positionGrips.bind(se),se.addControlGrips=se.addControlGrips.bind(se),se.adjustVisual=se.adjustVisual.bind(se),se.setupControlBox=se.setupControlBox.bind(se),se.resize=se.resize.bind(se),se.strokeColor=ye.defaultColor,se.strokeWidth=ye.defaultStrokeWidth,se.strokeDasharray=ye.defaultStrokeDasharray,se.strokePanel=new Ee("Line color",ye.defaultColorSet,ye.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ze("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new Ke("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return ue(K,ce),K.prototype.ownsTarget=function(Y){return!(!ce.prototype.ownsTarget.call(this,Y)&&Y!==this.visual&&Y!==this.selectorCurve&&Y!==this.visibleCurve&&!this.curveGrip.ownsTarget(Y))},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=ae.createGroup(),this.selectorCurve=ae.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ae.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(Y,ee){ce.prototype.pointerDown.call(this,Y,ee),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Y.x,this.curveY=Y.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()),ae.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},K.prototype.setupControlBox=function(){ce.prototype.setupControlBox.call(this),this.curveControlLine1=ae.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ae.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,ce.prototype.addControlGrips.call(this)},K.prototype.positionGrips=function(){ce.prototype.positionGrips.call(this);var Y=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Y/2,this.curveY-Y/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(Y){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Y.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Y.y-this.manipulationStartY),ce.prototype.manipulate.call(this,Y)},K.prototype.resize=function(Y){this.activeGrip===this.curveGrip&&(this.curveX=Y.x,this.curveY=Y.y),ce.prototype.resize.call(this,Y),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(Y){this.strokeColor=Y,this.adjustVisual(),this.colorChanged(Y)},K.prototype.setStrokeWidth=function(Y){this.strokeWidth=Y,this.adjustVisual()},K.prototype.setStrokeDasharray=function(Y){this.strokeDasharray=Y,this.adjustVisual()},K.prototype.scale=function(Y,ee){this.curveX=this.curveX*Y,this.curveY=this.curveY*ee,ce.prototype.scale.call(this,Y,ee)},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var Y=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ce.prototype.getState.call(this));return Y.typeName=K.typeName,Y},K.prototype.restoreState=function(Y){ce.prototype.restoreState.call(this,Y);var ee=Y;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),Et=function(){function ce(K,Y){Y===void 0&&(Y=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=K,this.cancelable=Y}return Object.defineProperty(ce.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ce.prototype.preventDefault=function(){this._defaultPrevented=!0},ce}(),xt=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,!1)||this;return se.dataUrl=ee,se.state=ye,se}return ue(K,ce),K}(Et),lt=function(ce){function K(Y,ee,ye){ye===void 0&&(ye=!1);var se=ce.call(this,Y,ye)||this;return se.marker=ee,se}return ue(K,ce),K}(Et),Wt=function(){function ce(){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 ce.prototype.addEventListener=function(K,Y){this[K].push(Y)},ce.prototype.removeEventListener=function(K,Y){var ee=this[K].indexOf(Y);ee>-1&&this[K].splice(ee,1)},ce}(),It=function(){function ce(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 Re,this._isOpen=!1,this.undoRedoManager=new at,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 Wt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ce.instanceCounter++,this.styles=new ie(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(ce.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ye,Ie,Le,$e,pt,Xe,De,Fe,qe,Te,rt,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ye,Ie,Le,$e,Xe,De,Fe]},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ye,Ie,Le,$e,De]},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(K){var Y=this;this._availableMarkerTypes.splice(0),K.forEach(function(ee){if(typeof ee=="string"){var ye=Y.ALL_MARKER_TYPES.find(function(se){return se.typeName===ee});ye!==void 0&&Y._availableMarkerTypes.push(ye)}else Y._availableMarkerTypes.push(ee)})},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.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(ce.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ce.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ce.prototype.show=function(){var K=this;this.styles.styleSheetRoot===void 0&&Q.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Q.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Y){return Y(new Et(K))})},ce.prototype.render=function(){return ge(this,void 0,void 0,function(){var K;return pe(this,function(Y){switch(Y.label){case 0:return this.setCurrentMarker(),(K=new he).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 Y.sent(),[4,K.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Y.sent()]}})})},ce.prototype.close=function(K){var Y=this;if(K===void 0&&(K=!1),this.isOpen){var ee=!1;K||this.eventListeners.beforeclose.forEach(function(ye){var se=new Et(Y,!0);ye(se),se.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(ye){return ye(new Et(Y))}),this.detachEvents(),this._isOpen=!1)}},ce.prototype.addMarkersToToolbar=function(){for(var K,Y=[],ee=0;ee<arguments.length;ee++)Y[ee]=arguments[ee];(K=this._availableMarkerTypes).push.apply(K,Y)},ce.prototype.addRenderEventListener=function(K){this.addEventListener("render",function(Y){K(Y.dataUrl,Y.state)})},ce.prototype.removeRenderEventListener=function(K){},ce.prototype.addCloseEventListener=function(K){this.addEventListener("close",function(){K()})},ce.prototype.removeCloseEventListener=function(K){},ce.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))},ce.prototype.onPopupTargetResize=function(){var K=1*this.target.clientWidth/this.target.clientHeight,Y=this.editorCanvas.clientWidth/K>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*K:this.editorCanvas.clientWidth,ee=Y<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/K;this.resize(Y,ee)},ce.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ce.prototype.resize=function(K,Y){this._isResizing=!0;var ee=K/this.imageWidth,ye=Y/this.imageHeight;this.imageWidth=Math.round(K),this.imageHeight=Math.round(Y),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,ye),this._isResizing=!1},ce.prototype.scaleMarkers=function(K,Y){var ee,ye=this;this._currentMarker&&this._currentMarker instanceof $e?this._currentMarker.scale(K,Y):(ee=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(se){se!==ye._currentMarker&&se.scale(K,Y)}),ee!==void 0&&this.setCurrentMarker(ee)},ce.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"},ce.prototype.setTopLeft=function(){var K=this.editingTarget.getBoundingClientRect(),Y=this.editorCanvas.getBoundingClientRect();this.left=K.left-Y.left,this.top=K.top-Y.top},ce.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)},ce.prototype.addDefs=function(){for(var K,Y=[],ee=0;ee<arguments.length;ee++)Y[ee]=arguments[ee];this.defs=ae.createDefs(),this.addDefsToImage(),(K=this.defs).append.apply(K,Y)},ce.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ce.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)},ce.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ce.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ce.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)},ce.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ce.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)},ce.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()},ce.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")},ce.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"},ce.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ce.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 J(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 V(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ce.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ce.prototype.removeMarker=function(K){this.markerImage.removeChild(K.container),this.markers.indexOf(K)>-1&&this.markers.splice(this.markers.indexOf(K),1),K.dispose()},ce.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())},ce.prototype.toolbarButtonClicked=function(K,Y){if(K==="marker"&&Y!==void 0)this.createNewMarker(Y);else if(K==="action")switch(Y){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()}},ce.prototype.deleteSelectedMarker=function(){var K=this;if(this._currentMarker!==void 0){var Y=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ye){var se=new lt(K,K._currentMarker,!0);ye(se),se.defaultPrevented&&(Y=!0)}),!Y){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(ye){return ye(new lt(K,ee))})}}},ce.prototype.clear=function(){var K=this,Y=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Pe){var Ze=new lt(K,void 0,!0);Pe(Ze),Ze.defaultPrevented&&(Y=!0)}),!Y)){this.setCurrentMarker();for(var ee=function(Pe){var Ze=ye.markers[Pe];ye.setCurrentMarker(ye.markers[Pe]),ye._currentMarker.dispose(),ye.markerImage.removeChild(ye._currentMarker.container),ye.markers.splice(ye.markers.indexOf(ye._currentMarker),1),ye.eventListeners.markerdelete.forEach(function(mt){return mt(new lt(K,Ze))})},ye=this,se=this.markers.length-1;se>=0;se--)ee(se);this.addUndoStep()}},Object.defineProperty(ce.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ce.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))},ce.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)},ce.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ce.prototype.addUndoStep=function(){var K=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Y=this.getState(),ee=this.undoRedoManager.getLastUndoStep();if(!ee||ee.width===Y.width&&ee.height===Y.height){var ye=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Y),ye<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(se){return se(new Et(K))})}else this.undoRedoManager.replaceLastUndoStep(Y),this.eventListeners.statechange.forEach(function(se){return se(new Et(K))})}},ce.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ce.prototype.undoStep=function(){var K=this,Y=this.undoRedoManager.undo();Y!==void 0&&(this.restoreState(Y),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ee){return ee(new Et(K))}))},ce.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ce.prototype.redoStep=function(){var K=this,Y=this.undoRedoManager.redo();Y!==void 0&&(this.restoreState(Y),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ee){return ee(new Et(K))}))},ce.prototype.stepZoom=function(){var K=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=K<this.zoomSteps.length-1?this.zoomSteps[K+1]:this.zoomSteps[0]},ce.prototype.panTo=function(K){this.contentDiv.scrollBy({left:this.prevPanPoint.x-K.x,top:this.prevPanPoint.y-K.y}),this.prevPanPoint=K},ce.prototype.startRenderAndClose=function(){return ge(this,void 0,void 0,function(){var K,Y,ee=this;return pe(this,function(ye){switch(ye.label){case 0:return[4,this.render()];case 1:return K=ye.sent(),Y=this.getState(),this.eventListeners.render.forEach(function(se){return se(new xt(ee,K,Y))}),this.close(!0),[2]}})})},ce.prototype.getState=function(K){K===!0&&this.setCurrentMarker();var Y={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ee){return Y.markers.push(ee.getState())}),Y},ce.prototype.restoreState=function(K){var Y=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);K.markers.forEach(function(ee){var ye=Y._availableMarkerTypes.find(function(Pe){return Pe.typeName===ee.typeName});if(ye!==void 0){var se=Y.addNewMarker(ye);se.restoreState(ee),Y.markers.push(se)}}),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 Et(Y))})},ce.prototype.addNewMarker=function(K){var Y=ae.createGroup();return this.markerImage.appendChild(Y),new K(Y,this.overlayContainer,this.settings)},ce.prototype.createNewMarker=function(K){var Y,ee=this;(Y=typeof K=="string"?this._availableMarkerTypes.find(function(ye){return ye.typeName===K}):K)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(Y),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(Y.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ye){return ye(new lt(ee,ee._currentMarker))}))},ce.prototype.markerCreated=function(K){var Y=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(K),this.setCurrentMarker(K),K instanceof Ie&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ie):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ee){return ee(new lt(Y,Y._currentMarker))})},ce.prototype.colorChanged=function(K){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=K,this.settings.defaultStrokeColor=K)},ce.prototype.fillColorChanged=function(K){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=K)},ce.prototype.markerStateChanged=function(K){var Y=this;this.eventListeners.markerchange.forEach(function(ee){return ee(new lt(Y,K))})},ce.prototype.setCurrentMarker=function(K){var Y=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 lt(Y,Y._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 lt(Y,Y._currentMarker))}))},ce.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 Y=this.markers.find(function(ee){return ee.ownsTarget(K.target)});Y!==void 0?(this.setCurrentMarker(Y),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))},ce.prototype.onDblClick=function(K){if(this._isFocused||this.focus(),this.mode==="select"){var Y=this.markers.find(function(ee){return ee.ownsTarget(K.target)});Y!==void 0&&Y!==this._currentMarker&&this.setCurrentMarker(Y),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(K.clientX,K.clientY),K.target):this.setCurrentMarker()}},ce.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}))},ce.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()},ce.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ce.prototype.onKeyUp=function(K){this._currentMarker===void 0||this.notesArea!==void 0||K.key!=="Delete"&&K.key!=="Backspace"||this.deleteSelectedMarker()},ce.prototype.clientToLocalCoordinates=function(K,Y){var ee=this.markerImage.getBoundingClientRect();return{x:(K-ee.left)/this.zoomLevel,y:(Y-ee.top)/this.zoomLevel}},ce.prototype.onWindowResize=function(){this.positionUI()},ce.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()},ce.prototype.addLicenseKey=function(K){re.addKey(K)},ce.prototype.addEventListener=function(K,Y){this.eventListeners.addEventListener(K,Y)},ce.prototype.removeEventListener=function(K,Y){this.eventListeners.removeEventListener(K,Y)},ce.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(ce.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ce.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(Y){return Y(new Et(K))}))},ce.prototype.blur=function(){var K=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Y){return Y(new Et(K))}))},ce.instanceCounter=0,ce}();/* **********************************
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 ir=function(ce,K){return(ir=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,ee){Y.__proto__=ee}||function(Y,ee){for(var ye in ee)Object.prototype.hasOwnProperty.call(ee,ye)&&(Y[ye]=ee[ye])})(ce,K)};function $t(ce,K){if(typeof K!="function"&&K!==null)throw new TypeError("Class extends value "+String(K)+" is not a constructor or null");function Y(){this.constructor=ce}ir(ce,K),ce.prototype=K===null?Object.create(K):(Y.prototype=K.prototype,new Y)}function At(ce,K,Y,ee){return new(Y||(Y=Promise))(function(ye,se){function Pe(Tt){try{mt(ee.next(Tt))}catch(et){se(et)}}function Ze(Tt){try{mt(ee.throw(Tt))}catch(et){se(et)}}function mt(Tt){var et;Tt.done?ye(Tt.value):(et=Tt.value,et instanceof Y?et:new Y(function(Dt){Dt(et)})).then(Pe,Ze)}mt((ee=ee.apply(ce,K||[])).next())})}function Rt(ce,K){var Y,ee,ye,se,Pe={label:0,sent:function(){if(1&ye[0])throw ye[1];return ye[1]},trys:[],ops:[]};return se={next:Ze(0),throw:Ze(1),return:Ze(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Ze(mt){return function(Tt){return function(et){if(Y)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(Y=1,ee&&(ye=2&et[0]?ee.return:et[0]?ee.throw||((ye=ee.return)&&ye.call(ee),0):ee.next)&&!(ye=ye.call(ee,et[1])).done)return ye;switch(ee=0,ye&&(et=[2&et[0],ye.value]),et[0]){case 0:case 1:ye=et;break;case 4:return Pe.label++,{value:et[1],done:!1};case 5:Pe.label++,ee=et[1],et=[0];continue;case 7:et=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(ye=Pe.trys,(ye=ye.length>0&&ye[ye.length-1])||et[0]!==6&&et[0]!==2)){Pe=0;continue}if(et[0]===3&&(!ye||et[1]>ye[0]&&et[1]<ye[3])){Pe.label=et[1];break}if(et[0]===6&&Pe.label<ye[1]){Pe.label=ye[1],ye=et;break}if(ye&&Pe.label<ye[2]){Pe.label=ye[2],Pe.ops.push(et);break}ye[2]&&Pe.ops.pop(),Pe.trys.pop();continue}et=K.call(ce,Pe)}catch(Dt){et=[6,Dt],ee=0}finally{Y=ye=0}if(5&et[0])throw et[1];return{value:et[0]?et[1]:void 0,done:!0}}([mt,Tt])}}}var hr=function(){function ce(){}return ce.addKey=function(K){ce.key=K},Object.defineProperty(ce,"isLicensed",{get:function(){return!!ce.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ce.key)},enumerable:!1,configurable:!0}),ce}(),St=function(){function ce(){}return ce.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ce.setAttributes=function(K,Y){for(var ee=0,ye=Y;ee<ye.length;ee++){var se=ye[ee],Pe=se[0],Ze=se[1];K.setAttribute(Pe,Ze)}},ce.createRect=function(K,Y,ee){var ye=document.createElementNS("http://www.w3.org/2000/svg","rect");return ye.setAttribute("width",K.toString()),ye.setAttribute("height",Y.toString()),ee&&ce.setAttributes(ye,ee),ye},ce.createLine=function(K,Y,ee,ye,se){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",K.toString()),Pe.setAttribute("y1",Y.toString()),Pe.setAttribute("x2",ee.toString()),Pe.setAttribute("y2",ye.toString()),se&&ce.setAttributes(Pe,se),Pe},ce.createPolygon=function(K,Y){var ee=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ee.setAttribute("points",K),Y&&ce.setAttributes(ee,Y),ee},ce.createCircle=function(K,Y){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()),Y&&ce.setAttributes(ee,Y),ee},ce.createEllipse=function(K,Y,ee){var ye=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ye.setAttribute("cx",(K/2).toString()),ye.setAttribute("cy",(Y/2).toString()),ye.setAttribute("rx",(K/2).toString()),ye.setAttribute("ry",(Y/2).toString()),ee&&ce.setAttributes(ye,ee),ye},ce.createGroup=function(K){var Y=document.createElementNS("http://www.w3.org/2000/svg","g");return K&&ce.setAttributes(Y,K),Y},ce.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ce.createMarker=function(K,Y,ee,ye,se,Pe,Ze){var mt=document.createElementNS("http://www.w3.org/2000/svg","marker");return ce.setAttributes(mt,[["id",K],["orient",Y],["markerWidth",ee.toString()],["markerHeight",ye.toString()],["refX",se.toString()],["refY",Pe.toString()]]),mt.appendChild(Ze),mt},ce.createText=function(K){var Y=document.createElementNS("http://www.w3.org/2000/svg","text");return Y.setAttribute("x","0"),Y.setAttribute("y","0"),K&&ce.setAttributes(Y,K),Y},ce.createTSpan=function(K,Y){var ee=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ee.textContent=K,Y&&ce.setAttributes(ee,Y),ee},ce.createImage=function(K){var Y=document.createElementNS("http://www.w3.org/2000/svg","image");return K&&ce.setAttributes(Y,K),Y},ce.createPoint=function(K,Y){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ee.x=K,ee.y=Y,ee},ce.createPath=function(K,Y){var ee=document.createElementNS("http://www.w3.org/2000/svg","path");return ee.setAttribute("d",K),Y&&ce.setAttributes(ee,Y),ee},ce.createElement=function(K,Y){var ee=document.createElementNS("http://www.w3.org/2000/svg",K);return Y&&ce.setAttributes(ee,Y),ee},ce.getHollowRectanglePath=function(K,Y,ee,ye,se,Pe,Ze,mt){return"M"+K+","+Y+"V"+(Y+ye)+"H"+(K+ee)+"V"+Y+"H"+se+"V"+Pe+"H"+(se+Ze)+"V"+(Pe+mt)+"H"+se+"V"+Y+"Z"},ce}(),Je=function(){function ce(K){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+K+"_"}return Object.defineProperty(ce.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ce.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(ce.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ce.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},ce.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)},ce.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 dt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new dt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new dt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ct("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ct("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ce.prototype.removeStyleSheet=function(){var K;this.styleSheet&&(((K=this.styleSheetRoot)!==null&&K!==void 0?K:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ce}(),dt=function(ce,K){this.selector=ce,this.style=K},Ct=function(ce,K){this.localName=ce,this.style=K},Xt=function(){function ce(){this.blocks=[],this.display=""}return ce.prototype.addButtonBlock=function(K){K.className=this.blockClassName,K.buttonClassName=this.buttonClassName,K.buttonColorsClassName=this.buttonColorsClassName,K.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(K)},ce.prototype.addElementBlock=function(K){K.className===void 0&&(K.className=this.blockClassName),this.blocks.push(K)},ce.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(Y){return K.appendChild(Y.getUI())}),K},ce}(),Jt=function(){function ce(){}return ce.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},ce}(),Mt=function(ce){function K(){var Y=ce!==null&&ce.apply(this,arguments)||this;return Y.buttons=[],Y}return $t(K,ce),K.prototype.addButton=function(Y){Y.className=this.buttonClassName,Y.colorsClassName=this.buttonColorsClassName,Y.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(Y)},K.prototype.getUI=function(){var Y=ce.prototype.getUI.call(this);return this.buttons.forEach(function(ee){return Y.appendChild(ee.getUI())}),Y},K}(Jt),Pt=function(){function ce(K,Y){this._isActive=!1,this._isHidden=!1,this._icon=K,this.title=Y,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ce.prototype,"icon",{get:function(){return this._icon},set:function(K){this._icon=K,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isActive",{get:function(){return this._isActive},set:function(K){this._isActive=K,this.adjustClassName()},enumerable:!1,configurable:!0}),ce.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},ce.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,"")))},ce.prototype.hide=function(){this._isHidden=!0},ce}(),gt=function(ce){function K(){var Y=ce!==null&&ce.apply(this,arguments)||this;return Y.elements=[],Y}return $t(K,ce),K.prototype.addElement=function(Y){this.elements.push(Y)},K.prototype.getUI=function(){var Y=ce.prototype.getUI.call(this);return this.elements.forEach(function(ee){return Y.appendChild(ee)}),Y},K}(Jt),Bt=function(){function ce(K,Y){this.horizontal=K,this.vertical=Y}return Object.defineProperty(ce.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ce.prototype.getVerticalLength=function(K){return K/this.ratio},ce.prototype.getHorizontalLength=function(K){return K*this.ratio},ce}(),fr=function(){function ce(){}return ce.getIcon=function(K,Y){if(K>0&&Y>0){var ee=new Bt(K,Y),ye=ee.ratio>=1?20:ee.getHorizontalLength(20),se=ee.ratio<1?20:ee.getVerticalLength(20),Pe=document.createElementNS("http://www.w3.org/2000/svg","svg");Pe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Pe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Pe);var Ze=St.createDefs();Pe.appendChild(Ze);var mt=St.createElement("clipPath",[["id","text-bg-clip"]]);Ze.appendChild(mt);var Tt=St.createPath(St.getHollowRectanglePath((24-ye)/2,(24-se)/2,ye,se,(24-ye)/2+2,(24-se)/2+2,ye-4,se-4));Pe.appendChild(Tt);var et=St.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);et.appendChild(St.createTSpan(K+":"+Y)),Pe.appendChild(et);var Dt=et.getBBox();St.setAttributes(et,[["x",((24-Dt.width)/2).toString()],["y",((24-Dt.height)/2-Dt.y).toString()]]);var Zt=St.createPath(St.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Dt.width))/2,(24-Math.ceil(Dt.height))/2,Math.ceil(Dt.width),Math.ceil(Dt.height)));return mt.appendChild(Zt),St.setAttributes(Tt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Pe),Pe.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>'},ce}(),ar=function(ce){function K(Y,ee,ye){var se=ce.call(this,Y,ee)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=ye,se}return $t(K,ce),K.prototype.setupDropdown=function(){var Y=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=Y.className,ee.colorsClassName=Y.colorsClassName,Y.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}(Pt),Gt=function(){function ce(K,Y){this.GRIP_SIZE=10,this.color=K,this.fillColor=Y,this.visual=St.createGroup(),this.visual.appendChild(St.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(St.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ce.prototype.ownsTarget=function(K){return K===this.visual||K===this.visual.childNodes[0]||K===this.visual.childNodes[1]},ce.prototype.setCenter=function(K,Y){this.visual.childNodes.forEach(function(ee){return St.setAttributes(ee,[["cx",K.toString()],["cy",Y.toString()]])})},ce}(),mr=function(){function ce(K,Y,ee,ye){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=K,this.canvasHeight=Y,this.margin=ee,this.container=ye,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(ce.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(ce.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(K){this._isGridVisible=K,this.gridContainer&&St.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(K){this._zoomFactor=K,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ce.prototype.open=function(){var K=this;this.cropShadeElement=St.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=St.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var Y=0;Y<this.numberOfGridLines;Y++)this.horizontalGridLines.push(St.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(St.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=St.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Gt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Gt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Gt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Gt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ce.prototype.setCropRectangle=function(K){this.cropRect=K;var Y=Object.assign({},this.cropRect);this.zoomFactor!==1&&(Y.width=this.cropRect.width*this.zoomFactor,Y.height=this.cropRect.height*this.zoomFactor,Y.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-Y.width/2,Y.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-Y.height/2),St.setAttributes(this.cropRectElement,[["x",Y.x.toString()],["y",Y.y.toString()],["width",Y.width.toString()],["height",Y.height.toString()]]);var ee=Y.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,Pe){var Ze=Y.y+ee*(Pe+1);St.setAttributes(se,[["x1",""+Y.x],["y1",""+Ze],["x2",""+(Y.x+Y.width)],["y2",""+Ze]])});var ye=Y.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,Pe){var Ze=Y.x+ye*(Pe+1);St.setAttributes(se,[["x1",""+Ze],["y1",""+Y.y],["x2",""+Ze],["y2",""+(Y.y+Y.height)]])}),St.setAttributes(this.cropShadeElement,[["d",St.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,Y.x,Y.y,Y.width,Y.height)]]),this.topLeftGrip.setCenter(Y.x,Y.y),this.topRightGrip.setCenter(Y.x+Y.width,Y.y),this.bottomLeftGrip.setCenter(Y.x,Y.y+Y.height),this.bottomRightGrip.setCenter(Y.x+Y.width,Y.y+Y.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ce.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)},ce.prototype.clientToLocalCoordinates=function(K,Y){var ee=this.container.getBoundingClientRect();return{x:K-ee.left+this.margin,y:Y-ee.top+this.margin}},ce.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)},ce.prototype.onPointerMove=function(K){if(this.isMoving)this.move(this.clientToLocalCoordinates(K.clientX,K.clientY));else if(this.activeGrip){var Y=this.clientToLocalCoordinates(K.clientX,K.clientY);this.resize(Y)}K.preventDefault()},ce.prototype.onPointerUp=function(K){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(K.pointerId)},ce.prototype.move=function(K){var Y=K.x-this.previousPoint.x,ee=K.y-this.previousPoint.y;this.zoomFactor!==1&&(Y=-Y/this.zoomFactor,ee=-ee/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+Y),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},ce.prototype.resize=function(K){var Y=Object.assign({},this.cropRect),ee=K.x-this.previousPoint.x,ye=K.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:Y.x+ee<this.margin&&(ee=this.margin-Y.x),Y.x+=ee,Y.width=this.cropRect.x+this.cropRect.width-Y.x;break;case this.bottomRightGrip:case this.topRightGrip:Y.width+ee>this.canvasWidth*this.zoomFactor&&(ee=this.canvasWidth*this.zoomFactor-Y.width),Y.width+=ee}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(Y.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ee),Y.height=this.aspectRatio.getVerticalLength(Y.width)):(Y.y+=ye,Y.height=this.cropRect.y+this.cropRect.height-Y.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?Y.height=this.aspectRatio.getVerticalLength(Y.width):Y.height+=ye}Y.width<10&&(Y.x=this.cropRect.x,Y.width=10),Y.height<10&&(Y.y=this.cropRect.y,Y.height=10),this.previousPoint=K,Y.x>=this.margin&&Y.y>=this.margin&&Y.x-this.margin+Y.width<=this.canvasWidth&&Y.y-this.margin+Y.height<=this.canvasHeight&&(this.cropRect=Y,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ce.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,Y=this.cropRect.y+this.cropRect.height/2,ee=this.aspectRatio.getHorizontalLength(this.cropRect.height),ye=this.aspectRatio.getVerticalLength(this.cropRect.width);ee/this.canvasWidth<ye/this.canvasHeight?this.cropRect.width=ee:this.cropRect.height=ye,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=Y-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)}},ce.prototype.getRescaledRect=function(K,Y,ee,ye,se,Pe){var Ze=ee/K,mt=ye/Y;return{x:(se.x-Pe)*Ze+Pe,y:(se.y-Pe)*mt+Pe,width:se.width*Ze,height:se.height*mt}},ce.prototype.scaleCanvas=function(K,Y){var ee=this.getRescaledRect(this.canvasWidth,this.canvasHeight,K,Y,this.cropRect,this.margin);this.canvasWidth=K,this.canvasHeight=Y,this.onCropChange&&this.onCropChange(ee),this.setCropRectangle(ee)},ce}(),zt=function(){function ce(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(ce.prototype,"angle",{get:function(){return this._angle},set:function(K){this._angle=K,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ce.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},ce.prototype.onPointerDown=function(K){this.controlContainer.setPointerCapture(K.pointerId),this.isDragging=!0,this.previousPoint={x:K.clientX,y:K.clientY}},ce.prototype.onPointerMove=function(K){this.isDragging&&(this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.previousPoint.x=K.clientX)},ce.prototype.onPointerUp=function(K){this.isDragging&&this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(K.pointerId)},ce.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var K=this.angleLabelText.getBBox();St.setAttributes(this.angleLabelElement,[["x",((this.width-K.width)/2).toString()],["y",(this.height/2).toString()]])}},ce.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)}},ce.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 Y="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ee=1;ee<=this.width/5+10;ee++){var ye=ee%5==0?this.height/3:this.height/6;Y+="h4v"+-ye+"h1v"+ye}Y+="v1H0Z",this.scaleShape=St.createPath(Y);var se=St.createTransform();this.scaleShape.transform.baseVal.appendItem(se),K.appendChild(this.scaleShape),this.angleLabelElement=St.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=St.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Pe=St.createTSpan("");return Pe.innerHTML="&deg;",this.angleLabelElement.appendChild(Pe),K.appendChild(this.angleLabelElement),document.body.removeChild(K),K},ce}(),Ur=function(){function ce(){this.naturalSize=!1,this.imageType="image/png"}return ce.prototype.rasterize=function(K,Y,ee,ye,se,Pe,Ze){var mt=this;return new Promise(function(Tt){var et=document.createElement("canvas");et.width=K.width.baseVal.value-2*ye,et.height=K.height.baseVal.value-2*ye;var Dt=1,Zt=1;mt.naturalSize===!0?(Dt=Y.naturalWidth/(K.width.baseVal.value-2*ye)/Pe,Zt=Y.naturalHeight/(K.height.baseVal.value-2*ye)/Ze,et.width=Y.naturalWidth/Pe,et.height=Y.naturalHeight/Ze):mt.width!==void 0&&mt.height!==void 0&&(Dt=mt.width/ee.width,Zt=mt.height/ee.height,et.width*=Dt,et.height*=Zt);var Yt=et.getContext("2d");Yt.translate(et.width/2,et.height/2),Yt.rotate(se*Math.PI/180),Yt.scale(Pe,Ze),Yt.translate(-et.width/2,-et.height/2),Yt.drawImage(Y,0,0,et.width,et.height);var Cr=document.createElement("canvas");Cr.width=ee.width*Dt,Cr.height=ee.height*Zt,Cr.getContext("2d").putImageData(Yt.getImageData((ee.x-ye)*Dt,(ee.y-ye)*Zt,ee.width*Dt,ee.height*Zt),0,0),Tt(Cr.toDataURL(mt.imageType,mt.imageQuality))})},ce}(),nt=function(){function ce(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=ce.instanceCounter++,this.styles=new Je(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(ce.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(K){this._zoomToCropEnabled=K,K?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ce.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(ce.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(ce.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(ce.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ce.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}),ce.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},ce.prototype.show=function(){this.showUI(),this.open()},ce.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(Y){return Y()}),this._isOpen=!1)},ce.prototype.addRenderEventListener=function(K){this.renderEventListeners.push(K)},ce.prototype.removeRenderEventListener=function(K){this.renderEventListeners.indexOf(K)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(K),1)},ce.prototype.addCloseEventListener=function(K){this.closeEventListeners.push(K)},ce.prototype.removeCloseEventListener=function(K){this.closeEventListeners.indexOf(K)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(K),1)},ce.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))},ce.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var K=1*this.target.clientWidth/this.target.clientHeight,Y=this.contentDiv.clientWidth/K>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*K:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ee=Y+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/K;this.resize(Y,ee)}},ce.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ce.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",St.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ce.prototype.resize=function(K,Y){this.imageWidth=Math.round(K),this.imageHeight=Math.round(Y),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()},ce.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 Y=K.toDataURL();St.setAttributes(this.editingTarget,[["href",Y]]),this.setEditingTargetSize()},ce.prototype.setTopLeft=function(){var K=this.target.getBoundingClientRect(),Y=this.editorCanvas.getBoundingClientRect();this.left=K.left-Y.left-this.CANVAS_MARGIN,this.top=K.top-Y.top-this.CANVAS_MARGIN},ce.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=St.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=St.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=St.createGroup(),this.editingTargetRotationScaleContainer=St.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var K=St.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(K);var Y=St.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(Y),this.editingTargetContainer=St.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)},ce.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ce.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=St.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new mr(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()},ce.prototype.zoomToCrop=function(){if(this.cropRect){var K=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,Y=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 "+Y+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-K+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-Y+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ce.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)},ce.prototype.cropRectChanged=function(K){this.cropRect=K,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ce.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ce.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"},ce.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ce.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,Y=this.target.offsetTop>K+this.CANVAS_MARGIN?this.target.offsetTop-(K+this.CANVAS_MARGIN):0;this.coverDiv.style.top=Y+"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},ce.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ce.prototype.addTopToolbar=function(){var K=this;this.topToolbar=new Xt,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 Y=new Mt;Y.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(Y);var ee=[];this.aspectRatios.forEach(function(Zt){var Yt=new Pt(fr.getIcon(Zt.horizontal,Zt.vertical),Zt.horizontal===0&&Zt.vertical===0?"FREE":Zt.horizontal+":"+Zt.vertical);Yt.onClick=function(){return K.ratioButtonClicked(Zt)},ee.push(Yt)}),this.aspectRatioButton=new ar(fr.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,Y.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ye=new Pt('<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");ye.isActive=this.isGridVisible,ye.onClick=function(){K.isGridVisible=!K.isGridVisible,ye.isActive=K.isGridVisible},Y.addButton(ye);var se=new Pt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(se.isActive=this.zoomToCropEnabled,se.onClick=function(){K.zoomToCropEnabled=!K.zoomToCropEnabled,se.isActive=K.zoomToCropEnabled},Y.addButton(se),!hr.isLicensed){var Pe=new gt;this.topToolbar.addElementBlock(Pe);var Ze=document.createElement("div");Ze.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var mt=document.createElement("a");mt.style.color="currentColor",mt.href="https://markerjs.com/products/cropro",mt.target="_blank",mt.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>',Ze.appendChild(mt),Pe.addElement(Ze)}var Tt=new Mt;Tt.minWidth=3*this.toolbarHeight+"px",Tt.contentAlign="end",this.topToolbar.addButtonBlock(Tt);var et=new Pt('<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");et.onClick=this.startRenderAndClose,Tt.addButton(et),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(et.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Dt=new Pt('<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");Dt.onClick=this.close,Tt.addButton(Dt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Dt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ce.prototype.addBottomToolbar=function(){var K=this;this.bottomToolbar=new Xt,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 Y=new Mt;Y.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(Y);var ee=new Pt('<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,Y.addButton(ee);var ye=new Pt('<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");ye.onClick=this.rotateRightButtonClicked,Y.addButton(ye);var se=new gt;se.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(se),this.straightener=new zt("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(Tt){K.rotateBy(Tt),K.straightener.angle=K.rotationAngle},se.addElement(this.straightener.getUI());var Pe=new Mt;Pe.minWidth=2*this.toolbarHeight+"px",Pe.contentAlign="end",this.bottomToolbar.addButtonBlock(Pe);var Ze=new Pt('<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");Ze.onClick=this.flipHorizontallyButtonClicked,Pe.addButton(Ze);var mt=new Pt('<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");mt.onClick=this.flipVerticallyButtonClicked,Pe.addButton(mt)},ce.prototype.ratioButtonClicked=function(K){this.aspectRatio=K,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ce.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=fr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ce.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Bt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ce.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ce.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ce.prototype.restoreState=function(K){if(K){var Y=this.cropLayer.getRescaledRect(K.width,K.height,this.imageWidth,this.imageHeight,K.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(Y),this.cropRectChanged(Y),this.flippedHorizontally=K.flippedHorizontally,this.flippedVertically=K.flippedVertically,this.applyFlip(),this.rotationAngle=K.rotationAngle,this.applyRotation()}},ce.prototype.clientToLocalCoordinates=function(K,Y){var ee=this.cropImage.getBoundingClientRect();return{x:K-ee.left,y:Y-ee.top}},ce.prototype.onWindowResize=function(){this.positionUI()},ce.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()},ce.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)},ce.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)},ce.prototype.rotateTo=function(K){K=(K=K>180?K-360:K)<=-180?K+360:K,this.rotationAngle=K,this.applyRotation()},ce.prototype.rotateBy=function(K){this.rotateTo((this.rotationAngle+K)%360)},ce.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 Y=this.editingTargetRotationContainer.transform.baseVal.getItem(0);Y.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(Y,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},ce.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ce.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ce.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ce.prototype.startRenderAndClose=function(){return At(this,void 0,void 0,function(){var K,Y;return Rt(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return K=ee.sent(),Y=this.getState(),this.renderEventListeners.forEach(function(ye){return ye(K,Y)}),this.close(!0),[2]}})})},ce.prototype.render=function(){return At(this,void 0,void 0,function(){var K;return Rt(this,function(Y){switch(Y.label){case 0:return(K=new Ur).naturalSize=this.renderAtNaturalSize,K.imageType=this.renderImageType,K.imageQuality=this.renderImageQuality,K.width=this.renderWidth,K.height=this.renderHeight,this.unzoomFromCrop(),St.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 Y.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,Y.sent()]}})})},ce.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ct("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var K=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ct("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new dt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new dt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ct("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 Ct("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 Ct("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},ce.instanceCounter=0,ce}(),kt=M("8hTe"),zr=M.n(kt),Pr=/<pre[^>]*>/g;function Xr(ce){var K=document.createElement("div");return K.innerHTML=ce,K.childNodes.length===0?"":K.childNodes[0].nodeValue}var Yr=q.a=function(ce){var K=ce.value,Y=K===void 0?"":K,ee=ce.edit,ye=ee===void 0?!1:ee,se=ce.className,Pe=ce.showTextOnly,Ze=ce.showLines,mt=ce.replaces,Tt=ce.zoomImg,et=ce.hasMask,Dt=ce.style,Zt=Dt===void 0?{}:Dt,Yt=ce.stylesPrev,Cr=Yt===void 0?{}:Yt,Tr=String(Y),_r=Object(a.useRef)(),en=Object(a.useRef)(),Rn=Object(a.useState)(""),gr=Object(C.a)(Rn,2),$r=gr[0],mn=gr[1],gn=Object(a.useState)("office"),jr=Object(C.a)(gn,2),Ar=jr[0],rr=jr[1],br=function(){var tr=new nt(en.current);tr.displayMode="popup",tr.addRenderEventListener(function(){var Dr=Object(g.a)(s.a.mark(function er(wr){var nr;return s.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return _r.current.style.display="none",Ir.next=3,Object(be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:wr}});case 3:nr=Ir.sent,nr!=null&&nr.id&&mt(en.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(nr==null?void 0:nr.id,"?type=").concat(nr.content_type));case 5:case"end":return Ir.stop()}},er)}));return function(er){return Dr.apply(this,arguments)}}()),tr.show()},Or=function(){var tr=new It(en.current);tr.settings.displayMode="popup",tr.addEventListener("render",function(){var Dr=Object(g.a)(s.a.mark(function er(wr){var nr;return s.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:if(_r.current.style.display="none",!en.current){Ir.next=6;break}return Ir.next=4,Object(be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:wr.dataUrl}});case 4:nr=Ir.sent,nr!=null&&nr.id&&mt(en.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(nr==null?void 0:nr.id,"?type=").concat(nr.content_type));case 6:case"end":return Ir.stop()}},er)}));return function(er){return Dr.apply(this,arguments)}}()),tr.show(),window.markerArea=tr},Jr=Object(a.useMemo)(function(){_r.current&&(_r.current.style.zIndex=-1);try{var vr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,tr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Dr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Tr=Tr.replace(vr,"("+te.a.API_SERVER+"/api/attachments/").replace(tr,'"'+te.a.API_SERVER+"/api/attachments/").replace(Dr,'"'+te.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(Cn){}var er=G(Tr),wr=j();if(Tr.match(/\[TOC\]/)&&(er=er.replace("<p>[TOC]</p>",k()),w()),er=er.replace(/(__special_katext_id_\d+__)/g,function(Cn,Ir){var Fr=wr[Ir],Bn=Fr.type,Tn=Fr.expression;return Object(de.renderToString)(Xr(Tn)||"",{displayMode:Bn==="block",throwOnError:!1,output:"html"})}),er=er.replace(/▁/g,"\u2581\u2581\u2581"),F(),Pe){var nr=document.createElement("div");return nr.innerHTML=er,nr.innerText}return setTimeout(function(){return li()},500),er},[Tr]),tn=Object(a.useRef)();v.WebkitLineClamp=Ze,Ze&&(Zt=Object(T.a)(Object(T.a)({},Zt),v));function rn(vr){var tr=vr.target;if(tr.tagName.toUpperCase()==="IMG"){if(Tt){var Dr=tr.getAttribute("src");mn(Dr),rr("image")}}else if(tr.tagName.toUpperCase()==="A"){var er=tr.getAttribute("href");if(er.indexOf("office")>-1)vr.preventDefault(),mn(er),rr("office");else if(er.indexOf("application/pdf")>-1)vr.preventDefault(),mn(er),rr("pdf");else if(er.indexOf("text/html")>-1)vr.preventDefault(),mn(er),rr("html");else if(er.startsWith("#")){vr.preventDefault();var wr=document.getElementById(er.replace("#",""));wr&&wr.scrollIntoView(!0)}}}var li=function(){var tr,Dr=(tr=tn.current)===null||tr===void 0?void 0:tr.querySelectorAll("video");Dr==null||Dr.forEach(function(er){if(er.oncontextmenu=function(){return!1},er.src.indexOf(".m3u8")>-1&&!er.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var wr=new W.a;wr.loadSource(er.src),wr.attachMedia(er)}}})};Object(a.useEffect)(function(){if(tn.current&&Jr&&(Jr.match(Pr)&&window.PR.prettyPrint()),tn.current)return tn.current.addEventListener("click",rn),function(){tn.current.removeEventListener("click",rn),F(),w()}},[Jr,tn.current,rn]);var Ln=function(tr){if(!ye)return;tr.target.nodeName==="IMG"?(_r.current.style.zIndex=1,_r.current.style.display="flex",_r.current.style.width=tr.target.clientWidth+"px",_r.current.style.height=tr.target.clientHeight+"px",_r.current.style.top=tr.target.offsetTop+"px",_r.current.style.left=tr.target.offsetLeft+"px",en.current.src=tr.target.getAttribute("src")):_r.current.style.display="none"};return r.a.createElement("div",{style:{position:"relative"}},r.a.createElement("div",{ref:tn,style:Object(T.a)({},Zt),className:"".concat(se||""," markdown-body ").concat(zr.a.mdBody),onMouseOver:Ln,dangerouslySetInnerHTML:{__html:Jr}}),r.a.createElement("div",{ref:_r,className:zr.a.button},r.a.createElement(m.a,null,r.a.createElement(R.a,{onClick:function(){return br()}},"\u88C1\u526A"),r.a.createElement(R.a,{onClick:function(){return Or()}},"\u7F16\u8F91"))),r.a.createElement("img",{ref:en,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),r.a.createElement(fe.a,{close:!0,data:$r,type:$r!=null&&$r.length?Ar:"",style:Object(T.a)({},Cr),onClose:function(){return mn("")}}))}},"9OqN":function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return P.mode.CTR=function(){var m=P.lib.BlockCipherMode.extend(),S=m.Encryptor=m.extend({processBlock:function(R,T){var g=this._cipher,C=g.blockSize,p=this._iv,s=this._counter;p&&(s=this._counter=p.slice(0),this._iv=void 0);var a=s.slice(0);g.encryptBlock(a,0),s[C-1]=s[C-1]+1|0;for(var r=0;r<C;r++)R[T+r]^=a[r]}});return m.Decryptor=S,m}(),P.mode.CTR})},"9VGf":function(I,q,M){"use strict";M.d(q,"a",function(){return S});var P=M("q1tI"),m=M.n(P);function S(R,T){var g=Object(P.useRef)();Object(P.useEffect)(function(){g.current=R}),Object(P.useEffect)(function(){function C(){g.current()}if(T!==null){var p=setInterval(C,T);return function(){return clearInterval(p)}}},[T])}},ALsQ:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return P.mode.CFB=function(){var m=P.lib.BlockCipherMode.extend();m.Encryptor=m.extend({processBlock:function(R,T){var g=this._cipher,C=g.blockSize;S.call(this,R,T,C,g),this._prevBlock=R.slice(T,T+C)}}),m.Decryptor=m.extend({processBlock:function(R,T){var g=this._cipher,C=g.blockSize,p=R.slice(T,T+C);S.call(this,R,T,C,g),this._prevBlock=p}});function S(R,T,g,C){var p,s=this._iv;s?(p=s.slice(0),this._iv=void 0):p=this._prevBlock,C.encryptBlock(p,0);for(var a=0;a<g;a++)R[T+a]^=p[a]}return m}(),P.mode.CFB})},B7Ph:function(I,q,M){"use strict";M.d(q,"a",function(){return de});var P=M("5NDa"),m=M("5rEg"),S=M("sRBo"),R=M("kaz8"),T=M("5Dmo"),g=M("3S7+"),C=M("14J3"),p=M("BMrR"),s=M("7Kak"),a=M("9yH6"),r=M("+L6B"),h=M("2/Rp"),d=M("2qtc"),f=M("kLXV"),E=M("miYZ"),y=M("tsqr"),l=M("k1fw"),n=M("9og8"),o=M("tJVT"),u=M("oBTY"),w=M("DZo9"),v=M("8z0m"),i=M("WmNS"),k=M.n(i),D=M("q1tI"),c=M.n(D),b=M("Bvq2"),x=M.n(b),_=M("nj2k"),j=M.n(_),F=M("mxV5"),L=M.n(F),X=M("KhGG"),z=M("ErOA"),H=M("7Cbv"),G=M("1vsH"),U=M("p5ED"),B=v.a.Dragger,W=function(be){for(var Ce=function(we){return we&&we.substring(0,we.lastIndexOf("."))},ue=Object(u.a)(be),ge=0,pe=[],oe=0;oe<ue.length;oe++){for(var ae="",re=0;re<pe.length;re++)if(Ce(pe[re][0].name)==Ce(ue[oe].name)){ge=1,ae=re;break}if(ge==1)pe[ae].push(ue[oe]),ge=0;else if(ge==0){var he=new Array;he.push(ue[oe]),pe.push(he)}}var Q=pe.map(function(ie){if(ie[0].name.includes(".in"))return ie.length===2?ie:[ie[0],{}];if(ie[0].name.includes(".out"))return ie.length===2?ie.reverse():[{},ie[0]]});return Q},te=function(be){var Ce=be.onClose,ue=be.onOK,ge=be.visible,pe=be.wrapClassName,oe=be.rootIdentifier,ae=be.multiple,re=ae===void 0?!1:ae,he=be.defaultMultipleValue,Q=he===void 0?!0:he,ie=Object(D.useState)([]),we=Object(o.a)(ie,2),ne=we[0],J=we[1],V=Object(D.useState)({}),Z=Object(o.a)(V,2),Ee=Z[0],xe=Z[1],_e=Object(D.useState)(!1),Ne=Object(o.a)(_e,2),Be=Ne[0],We=Ne[1],Ue=Object(D.useState)(!0),ze=Object(o.a)(Ue,2),Ke=ze[0],Ye=ze[1],Re=Object(D.useState)(null),tt=Object(o.a)(Re,2),rt=tt[0],He=tt[1],$e=Object(D.useRef)([]),Ie=Object(D.useRef)(0),Oe=function(){Ce()};Object(D.useEffect)(function(){Le()},[]),Object(D.useEffect)(function(){ge&&($e.current=[],Ie.current=0,J([]),Ye(Q))},[ge]);var Le=function(){var pt=Object(n.a)(k.a.mark(function at(){var ft,Et;return k.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return lt.prev=0,lt.next=3,Object(z.a)("/api/buckets/get_upload_token_for_big_files",{method:"get"});case 3:ft=lt.sent,(ft==null?void 0:ft.status)===0&&(ft!=null&&ft.is_oss?(Et=JSON.parse(Object(X.a)(ft.data)),xe(Et),He(!1)):He(!0)),lt.next=9;break;case 7:lt.prev=7,lt.t0=lt.catch(0);case 9:case"end":return lt.stop()}},at,null,[[0,7]])}));return function(){return pt.apply(this,arguments)}}(),Te=function(at){return at&&at.substring(0,at.lastIndexOf("."))},Ae=function(at){var ft,Et,xt=Te((ft=at[0])===null||ft===void 0?void 0:ft.name)||Te((Et=at[1])===null||Et===void 0?void 0:Et.name),lt=ne.filter(function(Wt){return Te(Wt.name)!==xt});$e.current=Object(u.a)(lt),J(Object(u.a)(lt))},De=function(at){if(!Ke){var ft=new FormData;ft.append("file",at.file);var Et=Object(z.a)("/api/attachments/get_file_content.json",{method:"post",body:ft},!0);Et.then(function(Rt){if(Rt.status===0){Ie.current=Ie.current+1;var hr=$e.current.map(function(Je){if(Je.name===at.name){var dt,Ct=Object(l.a)({},Je);return at!=null&&(dt=at.name)!==null&&dt!==void 0&&dt.includes(".in")?Ct.input=Rt==null?void 0:Rt.content:Ct.output=Rt==null?void 0:Rt.content,Ct}return Je});if($e.current=Object(u.a)(hr),J(Object(u.a)(hr)),Ie.current>0&&Ie.current===ne.length){We(!1);var St=W(hr);St=St.filter(function(Je){var dt,Ct;return!!((dt=Je[0])!==null&&dt!==void 0&&dt.name&&(Ct=Je[1])!==null&&Ct!==void 0&&Ct.name)}),St=St.map(function(Je){return Object(l.a)(Object(l.a)(Object(l.a)({},Je[0]),Je[1]),{},{is_file:!1})}),ue(St),Ce()}}else We(!1),Ce()});return}if(rt){var xt=new FormData;xt.append("file",at.file),xt.append("identifier",oe);var lt=Object(z.a)("/api/attachments.json",{method:"post",body:xt},!0);lt.then(function(Rt){if(Rt.filename){Ie.current=Ie.current+1;var hr=$e.current.map(function(Je){if(Je.name===(Rt==null?void 0:Rt.filename)){var dt,Ct=Object(l.a)(Object(l.a)({},Je),{},{is_oss:!rt});return Rt!=null&&(dt=Rt.filename)!==null&&dt!==void 0&&dt.includes(".in")?(Ct.in_object_key=Rt==null?void 0:Rt.object,Ct.in_object_size=Rt==null?void 0:Rt.size,Ct.input=Rt==null?void 0:Rt.filename,Ct.in_file=at):(Ct.out_object_key=Rt==null?void 0:Rt.object,Ct.out_object_size=Rt==null?void 0:Rt.size,Ct.output=Rt==null?void 0:Rt.filename,Ct.out_file=at),Ct}return Je});if($e.current=Object(u.a)(hr),J(Object(u.a)(hr)),Ie.current>0&&Ie.current===ne.length){We(!1);var St=W(hr);St=St.filter(function(Je){var dt,Ct;return!!((dt=Je[0])!==null&&dt!==void 0&&dt.name&&(Ct=Je[1])!==null&&Ct!==void 0&&Ct.name)}),St=St.map(function(Je){return Object(l.a)(Object(l.a)(Object(l.a)({},Je[0]),Je[1]),{},{is_file:!0})}),ue(St),Ce()}}else We(!1),Ce()});return}var Wt=new L.a({endpoint:Ee.end_point,region:Ee.region,accessKeyId:Ee.access_key_id,accessKeySecret:Ee.access_key_secret,bucket:Ee.bucket,stsToken:Ee.security_token}),It=at.name,ir={container_type:"TestSet",file_name:It},$t=Object(H.a)(),At="testsets/".concat(oe,"/").concat($t).concat(It.indexOf(".")>-1?"."+It.split(".").pop():"");oe===null&&(At="testsets/".concat($t).concat(It.indexOf(".")>-1?"."+It.split(".").pop():"")),Wt.multipartUpload(At,new Blob([at.file],{type:at.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:It+""},url:Ee==null?void 0:Ee.callback_url,host:Ee==null?void 0:Ee.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(z.e)(ir)}}).then(function(Rt){if(Rt.data.status===0){Ie.current=Ie.current+1;var hr=$e.current.map(function(Je){var dt,Ct;if(Je.name===((dt=Rt.data)===null||dt===void 0||((Ct=dt.data)===null||Ct===void 0)?void 0:Ct.file_name)){var Xt,Jt,Mt,Pt=Object(l.a)(Object(l.a)({},Je),{},{is_oss:!rt});if((Xt=Rt.data)!==null&&Xt!==void 0&&(Jt=Xt.data)!==null&&Jt!==void 0&&(Mt=Jt.file_name)!==null&&Mt!==void 0&&Mt.includes(".in")){var gt,Bt,fr,ar,Gt,mr;Pt.in_object_key=(gt=Rt.data)===null||gt===void 0||((Bt=gt.data)===null||Bt===void 0)?void 0:Bt.object,Pt.in_object_size=(fr=Rt.data)===null||fr===void 0||((ar=fr.data)===null||ar===void 0)?void 0:ar.size,Pt.input=(Gt=Rt.data)===null||Gt===void 0||((mr=Gt.data)===null||mr===void 0)?void 0:mr.file_name,Pt.in_file=at}else{var zt,Ur,nt,kt,zr,Pr;Pt.out_object_key=(zt=Rt.data)===null||zt===void 0||((Ur=zt.data)===null||Ur===void 0)?void 0:Ur.object,Pt.out_object_size=(nt=Rt.data)===null||nt===void 0||((kt=nt.data)===null||kt===void 0)?void 0:kt.size,Pt.output=(zr=Rt.data)===null||zr===void 0||((Pr=zr.data)===null||Pr===void 0)?void 0:Pr.file_name,Pt.out_file=at}return Pt}return Je});if($e.current=Object(u.a)(hr),J(Object(u.a)(hr)),Ie.current>0&&Ie.current===ne.length){We(!1);var St=W(hr);St=St.filter(function(Je){var dt,Ct;return!!((dt=Je[0])!==null&&dt!==void 0&&dt.name&&(Ct=Je[1])!==null&&Ct!==void 0&&Ct.name)}),St=St.map(function(Je){return Object(l.a)(Object(l.a)(Object(l.a)({},Je[0]),Je[1]),{},{is_file:!0})}),ue(St),Ce()}}})},Me=function(at){return new Promise(function(ft,Et){for(var xt=0,lt=[],Wt=function($t){at[$t].file.slice(0,1).arrayBuffer().then(function(){xt++,xt===at.length&&(lt.length?(y.b.warn("".concat(lt.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),Et()):ft(at))}).catch(function(At){console.log("\u9519\u8BEF\u4FE1\u606F\uFF1A",At),xt++,lt.push(at[$t].name),xt===at.length&&(lt.length?(y.b.warn("".concat(lt.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),Et()):ft(at))})},It=0;It<at.length;It++)Wt(It)})},Fe=function(){var pt=Object(n.a)(k.a.mark(function at(){var ft;return k.a.wrap(function(xt){for(;;)switch(xt.prev=xt.next){case 0:if(!(ne.length===0)){xt.next=3;break}return y.b.warn("\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6"),xt.abrupt("return");case 3:return xt.next=5,Me(ne);case 5:if(We(!0),ft=W(ne),!ft.some(function(lt){var Wt,It;return!((Wt=lt[0])!==null&&Wt!==void 0&&Wt.name&&(It=lt[1])!==null&&It!==void 0&&It.name)})){xt.next=10;break}return f.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 lt=Object(n.a)(k.a.mark(function It(){return k.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:ne.map(function(){var At=Object(n.a)(k.a.mark(function Rt(hr){return k.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:De(hr);case 1:case"end":return Je.stop()}},Rt)}));return function(Rt){return At.apply(this,arguments)}}());case 1:case"end":return $t.stop()}},It)}));function Wt(){return lt.apply(this,arguments)}return Wt}(),onCancel:function(){We(!1)}}),xt.abrupt("return");case 10:ne.map(function(){var lt=Object(n.a)(k.a.mark(function Wt(It){return k.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:De(It);case 1:case"end":return $t.stop()}},Wt)}));return function(Wt){return lt.apply(this,arguments)}}());case 11:case"end":return xt.stop()}},at)}));return function(){return pt.apply(this,arguments)}}(),Xe={name:"file",fileList:ne,multiple:!0,accept:".in, .out",showUploadList:!1,beforeUpload:function(at){if(ne!=null&&ne.some(function(Et){return Et.name===at.name}))return y.b.info("".concat(at.name,"\u6587\u4EF6\u5DF2\u5B58\u5728")),!1;if(at.size/1024/1024>100)return y.b.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(at.name))return y.b.warn("\u8F93\u5165\u6587\u4EF6\u53EA\u80FD\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6"),!1;var ft={name:at.name,uid:at.uid,file:at,percent:0};return ne.push(ft),$e.current=Object(u.a)(ne),J(Object(u.a)(ne)),!1}},qe=W(ne);return console.log(ne,qe,"fileList"),c.a.createElement(f.a,{visible:ge,wrapClassName:pe,onOk:Fe,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:Be},onCancel:Oe,width:"1000px",title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},c.a.createElement("div",{className:x.a.wrap},ne.length?c.a.createElement("div",null,c.a.createElement(p.a,{justify:"space-between",align:"middle",className:"mb20"},c.a.createElement("div",{style:{visibility:re?"visible":"hidden"}},"\u6D4B\u8BD5\u7528\u4F8B\u7C7B\u578B\uFF1A",c.a.createElement(a.a.Group,{className:"ml10",value:Ke,onChange:function(at){return Ye(at.target.value)}},c.a.createElement(a.a,{value:!1},"\u6587\u672C"),c.a.createElement(a.a,{value:!0},"\u6587\u4EF6"))),c.a.createElement(v.a,Xe,c.a.createElement(h.a,{className:x.a.btnS},"\u4E0A\u4F20\u6587\u4EF6"))),c.a.createElement(de,{data:qe,onRemove:Ae})):c.a.createElement("div",{className:x.a.noData},c.a.createElement("img",{src:j.a,alt:""}),c.a.createElement(v.a,Xe,c.a.createElement(h.a,{className:x.a.btn},"\u4E0A\u4F20\u6587\u4EF6"))),c.a.createElement("div",{className:x.a.text},"\u4E0A\u4F20\u9650\u5236\uFF1A",c.a.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",c.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",c.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",c.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",c.a.createElement("br",null))))},de=function(be){var Ce=be.data,ue=Ce===void 0?[]:Ce,ge=be.onRemove,pe=be.width,oe=pe===void 0?"auto":pe,ae=be.showScore,re=ae===void 0?!1:ae,he=be.disabled,Q=he===void 0?!1:he,ie=be.inputChange,we=be.onEvaluatingChange,ne=be.showEvaluatingSetting,J=ne===void 0?!1:ne,V={value:"",filename:"",dataUrl:""},Z=Object(D.useState)(Object(l.a)({},V)),Ee=Object(o.a)(Z,2),xe=Ee[0],_e=Ee[1],Ne=function(ze){var Ke=document.createElement("a");document.body.appendChild(Ke);var Ye=URL.createObjectURL(ze.file);Ke.href=Ye,Ke.download=ze.name,Ke.click(),URL.revokeObjectURL(Ye),document.body.removeChild(Ke)},Be=function(ze,Ke){Object(G.y)(ze,Ke)},We=function(ze,Ke){f.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:c.a.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:function(){ge(ze,Ke)},onCancel:function(){}})};return ue.length?c.a.createElement("div",{style:{width:oe}},c.a.createElement("div",{className:x.a.head},J&&c.a.createElement("div",{style:{width:"10%"}},"\u9690\u85CF",c.a.createElement(g.a,{title:'\u9690\u85CF\u6D4B\u8BD5\u96C6\u53EF\u4EE5\u9632\u6B62\u5B66\u751F\u901A\u8FC7"print"\u7B49\u624B\u6BB5\u76F4\u63A5\u901A\u5173'},c.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),c.a.createElement("div",{style:{width:"20%"}},"\u7528\u4F8B"),c.a.createElement("div",{style:{width:re?"25%":"35%",padding:"0 12px"}},"\u8F93\u5165"),c.a.createElement("div",{style:{width:re?"25%":"35%",padding:"0 12px"}},"\u8F93\u51FA"),re&&c.a.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),J&&c.a.createElement("div",{style:{width:"20%"}},"\u9884\u671F\u8F93\u51FA",c.a.createElement(g.a,{title:"\u52FE\u9009\u540E\uFF0C\u9884\u671F\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"},c.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),J&&c.a.createElement("div",{style:{width:"20%"}},"\u7279\u6B8A\u5224\u5B9A",c.a.createElement(g.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"},c.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),c.a.createElement("div",{style:{width:"10%"}},"\u64CD\u4F5C")),ue.map(function(Ue,ze){var Ke,Ye,Re,tt;return c.a.createElement("div",{key:ze,className:x.a.list},J&&c.a.createElement("div",{style:{width:"10%"}},c.a.createElement(R.a,{checked:!!Ue.hidden,onChange:function(He){we(He.target.checked?1:0,ze,"hidden")}})),c.a.createElement("div",{style:{width:"20%"}},"\u6D4B\u8BD5\u7528\u4F8B",ze+1),c.a.createElement("div",{className:x.a.info,style:{width:re?"25%":"35%"}},c.a.createElement("span",{title:Ue.input||((Ke=Ue[0])===null||Ke===void 0?void 0:Ke.name),onClick:Object(n.a)(k.a.mark(function rt(){var He,$e;return k.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:if(Ue.input?Ue.input_file_url?He=Ue.input_file_url:He=Ue.in_file:He=Ue[0],!(typeof He=="string")){Oe.next=14;break}return Oe.next=4,fetch(He,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return $e=Oe.sent,Oe.t0=_e,Oe.next=8,$e.text();case 8:Oe.t1=Oe.sent,Oe.t2=He,Oe.t3={value:Oe.t1,filename:"",dataUrl:Oe.t2},(0,Oe.t0)(Oe.t3),Oe.next=18;break;case 14:return Oe.next=16,Object(G.G)(He.file);case 16:$e=Oe.sent,_e({value:$e.text,filename:He.name,dataUrl:$e.link});case 18:case"end":return Oe.stop()}},rt)}))},Ue.input||((Ye=Ue[0])===null||Ye===void 0?void 0:Ye.name))),c.a.createElement("div",{className:x.a.info,style:{width:re?"25%":"35%"}},c.a.createElement("span",{title:Ue.output||((Re=Ue[1])===null||Re===void 0?void 0:Re.name),onClick:Object(n.a)(k.a.mark(function rt(){var He,$e;return k.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:if(Ue.input?Ue.output_file_url?He=Ue.output_file_url:He=Ue.out_file:He=Ue[1],!(typeof He=="string")){Oe.next=14;break}return Oe.next=4,fetch(He,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return $e=Oe.sent,Oe.t0=_e,Oe.next=8,$e.text();case 8:Oe.t1=Oe.sent,Oe.t2=He,Oe.t3={value:Oe.t1,filename:"",dataUrl:Oe.t2},(0,Oe.t0)(Oe.t3),Oe.next=18;break;case 14:return Oe.next=16,Object(G.G)(He.file);case 16:$e=Oe.sent,_e({value:$e.text,filename:He.name,dataUrl:$e.link});case 18:case"end":return Oe.stop()}},rt)}))},Ue.output||((tt=Ue[1])===null||tt===void 0?void 0:tt.name))),re&&c.a.createElement("div",{style:{width:"20%"}},c.a.createElement(m.a,{disabled:Q,style:{width:"70%"},onChange:function(He){return ie(He,ze)},value:Ue.score}),c.a.createElement("span",null,"\xA0%")),J&&c.a.createElement("div",{style:{width:"20%"}},c.a.createElement(R.a,{checked:Ue.is_invisible||!1,onChange:function(He){we(He.target.checked,ze,"is_invisible")},className:"font14"},"\u5BF9\u5B66\u5458\u4E0D\u53EF\u89C1")),J&&c.a.createElement("div",{style:{width:"20%"}},c.a.createElement(R.a,{checked:Ue.last_match_rule||!1,onChange:function(He){we(He.target.checked,ze,"last_match_rule")},className:"font14"},"\u672B\u5C3E\u5339\u914D")),c.a.createElement("div",{onClick:function(){return We(Ue,ze)},style:{width:"10%"}},c.a.createElement("span",{className:x.a.del},"\u5220\u9664")))}),c.a.createElement(U.a,{close:!0,data:xe.dataUrl,filename:xe.filename,type:xe.dataUrl.length?"txt":"",onClose:function(){return _e(Object(l.a)({},V))},monacoEditor:{value:xe.value,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}})):c.a.createElement(c.a.Fragment,null)};q.b=te},Bd2K:function(I,q,M){(function(P){P(M("VrN/"),M("osHv"))})(function(P){P.defineOption("autoCloseTags",!1,function(s,a,r){if(r!=P.Init&&r&&s.removeKeyMap("autoCloseTags"),!a)return;var h={name:"autoCloseTags"};(typeof a!="object"||a.whenClosing!==!1)&&(h["'/'"]=function(d){return g(d)}),(typeof a!="object"||a.whenOpening!==!1)&&(h["'>'"]=function(d){return R(d)}),s.addKeyMap(h)});var m=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],S=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function R(s){if(s.getOption("disableInput"))return P.Pass;for(var a=s.listSelections(),r=[],h=s.getOption("autoCloseTags"),d=0;d<a.length;d++){if(!a[d].empty())return P.Pass;var f=a[d].head,E=s.getTokenAt(f),y=P.innerMode(s.getMode(),E.state),l=y.state,n=y.mode.xmlCurrentTag&&y.mode.xmlCurrentTag(l),o=n&&n.name;if(!o)return P.Pass;var u=y.mode.configuration=="html",w=typeof h=="object"&&h.dontCloseTags||u&&m,v=typeof h=="object"&&h.indentTags||u&&S;E.end>f.ch&&(o=o.slice(0,o.length-E.end+f.ch));var i=o.toLowerCase();if(!o||E.type=="string"&&(E.end!=f.ch||!/[\"\']/.test(E.string.charAt(E.string.length-1))||E.string.length==1)||E.type=="tag"&&n.close||E.string.indexOf("/")==f.ch-E.start-1||w&&C(w,i)>-1||p(s,y.mode.xmlCurrentContext&&y.mode.xmlCurrentContext(l)||[],o,f,!0))return P.Pass;var k=typeof h=="object"&&h.emptyTags;if(k&&C(k,o)>-1){r[d]={text:"/>",newPos:P.Pos(f.line,f.ch+2)};continue}var D=v&&C(v,i)>-1;r[d]={indent:D,text:">"+(D?`
`:"")+"</"+o+">",newPos:D?P.Pos(f.line+1,0):P.Pos(f.line,f.ch+1)}}for(var c=typeof h=="object"&&h.dontIndentOnAutoClose,d=a.length-1;d>=0;d--){var b=r[d];s.replaceRange(b.text,a[d].head,a[d].anchor,"+insert");var x=s.listSelections().slice(0);x[d]={head:b.newPos,anchor:b.newPos},s.setSelections(x),!c&&b.indent&&(s.indentLine(b.newPos.line,null,!0),s.indentLine(b.newPos.line+1,null,!0))}}function T(s,a){for(var r=s.listSelections(),h=[],d=a?"/":"</",f=s.getOption("autoCloseTags"),E=typeof f=="object"&&f.dontIndentOnSlash,y=0;y<r.length;y++){if(!r[y].empty())return P.Pass;var l=r[y].head,n=s.getTokenAt(l),o=P.innerMode(s.getMode(),n.state),u=o.state;if(a&&(n.type=="string"||n.string.charAt(0)!="<"||n.start!=l.ch-1))return P.Pass;var w,v=o.mode.name!="xml"&&s.getMode().name=="htmlmixed";if(v&&o.mode.name=="javascript")w=d+"script";else if(v&&o.mode.name=="css")w=d+"style";else{var i=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(u);if(!i||i.length&&p(s,i,i[i.length-1],l))return P.Pass;w=d+i[i.length-1]}s.getLine(l.line).charAt(n.end)!=">"&&(w+=">"),h[y]=w}if(s.replaceSelections(h),r=s.listSelections(),!E)for(var y=0;y<r.length;y++)(y==r.length-1||r[y].head.line<r[y+1].head.line)&&s.indentLine(r[y].head.line)}function g(s){return s.getOption("disableInput")?P.Pass:T(s,!0)}P.commands.closeTag=function(s){return T(s)};function C(s,a){if(s.indexOf)return s.indexOf(a);for(var r=0,h=s.length;r<h;++r)if(s[r]==a)return r;return-1}function p(s,a,r,h,d){if(!P.scanForClosingTag)return!1;var f=Math.min(s.lastLine()+1,h.line+500),E=P.scanForClosingTag(s,h,null,f);if(!E||E.tag!=r)return!1;for(var y=d?1:0,l=a.length-1;l>=0&&a[l]==r;l--)++y;h=E.to;for(var l=1;l<y;l++){var n=P.scanForClosingTag(s,h,null,f);if(!n||n.tag!=r)return!1;h=n.to}return!0}})},BjJ7:function(I,q,M){"use strict";M.d(q,"d",function(){return m}),M.d(q,"c",function(){return S}),M.d(q,"e",function(){return R}),M.d(q,"b",function(){return T}),M.d(q,"a",function(){return C});var P=M("m3rI");function m(p){var s=!0;if(p.length>0){for(var a=0;a<p.length;a++)if(p[a].compile_success==0||!p[a].compile_success){s=!1;break}}else s=!1;return s}function S(p){for(var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=[],r=0;r<p.length;r++){var h=p[r],d=s?"".concat(s,"/").concat(h.name):"".concat(h.name);a.push({title:h.name,isLeaf:!(h.type==="tree"),key:d})}return a}function R(p,s,a){for(var r=0;r<p.length;r++){var h=p[r];if(h.key===s){h.children=a;break}h.children&&R(h.children,s,a)}return p}function T(p,s,a){var r;return function(){var h=this,d=arguments,f=function(){r=null,a||p.apply(h,d)},E=a&&!r;clearTimeout(r),r=setTimeout(f,s),E&&p.apply(h,d)}}var g=!0,C=P.a.API_SERVER},Bvq2:function(I,q,M){I.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(I,q,M){},CrYA:function(I,q,M){var P=M("MFOe"),m=P.Global;I.exports={name:"sessionStorage",read:R,write:T,each:g,remove:C,clearAll:p};function S(){return m.sessionStorage}function R(s){return S().getItem(s)}function T(s,a){return S().setItem(s,a)}function g(s){for(var a=S().length-1;a>=0;a--){var r=S().key(a);s(R(r),r)}}function C(s){return S().removeItem(s)}function p(){return S().clear()}},DlQD:function(I,q,M){(function(P,m){I.exports=m()})(this,function(){"use strict";function P(Ie,Oe){for(var Le=0;Le<Oe.length;Le++){var Te=Oe[Le];Te.enumerable=Te.enumerable||!1,Te.configurable=!0,"value"in Te&&(Te.writable=!0),Object.defineProperty(Ie,Te.key,Te)}}function m(Ie,Oe,Le){return Oe&&P(Ie.prototype,Oe),Le&&P(Ie,Le),Ie}function S(Ie,Oe){if(!Ie)return;if(typeof Ie=="string")return R(Ie,Oe);var Le=Object.prototype.toString.call(Ie).slice(8,-1);if(Le==="Object"&&Ie.constructor&&(Le=Ie.constructor.name),Le==="Map"||Le==="Set")return Array.from(Ie);if(Le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Le))return R(Ie,Oe)}function R(Ie,Oe){(Oe==null||Oe>Ie.length)&&(Oe=Ie.length);for(var Le=0,Te=new Array(Oe);Le<Oe;Le++)Te[Le]=Ie[Le];return Te}function T(Ie,Oe){var Le;if(typeof Symbol=="undefined"||Ie[Symbol.iterator]==null){if(Array.isArray(Ie)||(Le=S(Ie))||Oe&&Ie&&typeof Ie.length=="number"){Le&&(Ie=Le);var Te=0;return function(){return Te>=Ie.length?{done:!0}:{done:!1,value:Ie[Te++]}}}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 Le=Ie[Symbol.iterator](),Le.next.bind(Le)}function g(Ie,Oe){return Oe={exports:{}},Ie(Oe,Oe.exports),Oe.exports}var C=g(function(Ie){function Oe(){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 Le(Te){Ie.exports.defaults=Te}Ie.exports={defaults:Oe(),getDefaults:Oe,changeDefaults:Le}}),p=C.defaults,s=C.getDefaults,a=C.changeDefaults,r=/[&<>"']/,h=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,f=/[<>"']|&(?!#?\w+;)/g,E={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},y=function(Oe){return E[Oe]};function l(Ie,Oe){if(Oe){if(r.test(Ie))return Ie.replace(h,y)}else if(d.test(Ie))return Ie.replace(f,y);return Ie}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(Ie){return Ie.replace(n,function(Oe,Le){return Le=Le.toLowerCase(),Le==="colon"?":":Le.charAt(0)==="#"?Le.charAt(1)==="x"?String.fromCharCode(parseInt(Le.substring(2),16)):String.fromCharCode(+Le.substring(1)):""})}var u=/(^|[^\[])\^/g;function w(Ie,Oe){Ie=Ie.source||Ie,Oe=Oe||"";var Le={replace:function(Ae,De){return De=De.source||De,De=De.replace(u,"$1"),Ie=Ie.replace(Ae,De),Le},getRegex:function(){return new RegExp(Ie,Oe)}};return Le}var v=/[^\w:]/g,i=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(Ie,Oe,Le){if(Ie){var Te;try{Te=decodeURIComponent(o(Le)).replace(v,"").toLowerCase()}catch(Ae){return null}if(Te.indexOf("javascript:")===0||Te.indexOf("vbscript:")===0||Te.indexOf("data:")===0)return null}Oe&&!i.test(Le)&&(Le=_(Oe,Le));try{Le=encodeURI(Le).replace(/%25/g,"%")}catch(Ae){return null}return Le}var D={},c=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(Ie,Oe){D[" "+Ie]||(c.test(Ie)?D[" "+Ie]=Ie+"/":D[" "+Ie]=X(Ie,"/",!0)),Ie=D[" "+Ie];var Le=Ie.indexOf(":")===-1;return Oe.substring(0,2)==="//"?Le?Oe:Ie.replace(b,"$1")+Oe:Oe.charAt(0)==="/"?Le?Oe:Ie.replace(x,"$1")+Oe:Ie+Oe}var j={exec:function(){}};function F(Ie){for(var Oe=1,Le,Te;Oe<arguments.length;Oe++){Le=arguments[Oe];for(Te in Le)Object.prototype.hasOwnProperty.call(Le,Te)&&(Ie[Te]=Le[Te])}return Ie}function L(Ie,Oe){var Le=Ie.replace(/\|/g,function(De,Me,Fe){for(var Xe=!1,qe=Me;--qe>=0&&Fe[qe]==="\\";)Xe=!Xe;return Xe?"|":" |"}),Te=Le.split(/ \|/),Ae=0;if(Te.length>Oe)Te.splice(Oe);else for(;Te.length<Oe;)Te.push("");for(;Ae<Te.length;Ae++)Te[Ae]=Te[Ae].trim().replace(/\\\|/g,"|");return Te}function X(Ie,Oe,Le){var Te=Ie.length;if(Te===0)return"";for(var Ae=0;Ae<Te;){var De=Ie.charAt(Te-Ae-1);if(De===Oe&&!Le)Ae++;else if(De!==Oe&&Le)Ae++;else break}return Ie.substr(0,Te-Ae)}function z(Ie,Oe){if(Ie.indexOf(Oe[1])===-1)return-1;for(var Le=Ie.length,Te=0,Ae=0;Ae<Le;Ae++)if(Ie[Ae]==="\\")Ae++;else if(Ie[Ae]===Oe[0])Te++;else if(Ie[Ae]===Oe[1]&&(Te--,Te<0))return Ae;return-1}function H(Ie){Ie&&Ie.sanitize&&!Ie.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:l,unescape:o,edit:w,cleanUrl:k,resolveUrl:_,noopTest:j,merge:F,splitCells:L,rtrim:X,findClosingBracket:z,checkSanitizeDeprecation:H},U=C.defaults,B=G.rtrim,W=G.splitCells,te=G.escape,de=G.findClosingBracket;function fe(Ie,Oe,Le){var Te=Oe.href,Ae=Oe.title?te(Oe.title):null,De=Ie[1].replace(/\\([\[\]])/g,"$1");return Ie[0].charAt(0)!=="!"?{type:"link",raw:Le,href:Te,title:Ae,text:De}:{type:"image",raw:Le,href:Te,title:Ae,text:te(De)}}function be(Ie,Oe){var Le=Ie.match(/^(\s+)(?:```)/);if(Le===null)return Oe;var Te=Le[1];return Oe.split(`
`).map(function(Ae){var De=Ae.match(/^\s+/);if(De===null)return Ae;var Me=De[0];return Me.length>=Te.length?Ae.slice(Te.length):Ae}).join(`
`)}var Ce=function(){function Ie(Le){this.options=Le||U}var Oe=Ie.prototype;return Oe.space=function(Te){var Ae=this.rules.block.newline.exec(Te);if(Ae)return Ae[0].length>1?{type:"space",raw:Ae[0]}:{raw:`
`}},Oe.code=function(Te,Ae){var De=this.rules.block.code.exec(Te);if(De){var Me=Ae[Ae.length-1];if(Me&&Me.type==="paragraph")return{raw:De[0],text:De[0].trimRight()};var Fe=De[0].replace(/^ {4}/gm,"");return{type:"code",raw:De[0],codeBlockStyle:"indented",text:this.options.pedantic?Fe:B(Fe,`
`)}}},Oe.fences=function(Te){var Ae=this.rules.block.fences.exec(Te);if(Ae){var De=Ae[0],Me=be(De,Ae[3]||"");return{type:"code",raw:De,lang:Ae[2]?Ae[2].trim():Ae[2],text:Me}}},Oe.heading=function(Te){var Ae=this.rules.block.heading.exec(Te);if(Ae)return{type:"heading",raw:Ae[0],depth:Ae[1].length,text:Ae[2]}},Oe.nptable=function(Te){var Ae=this.rules.block.nptable.exec(Te);if(Ae){var De={type:"table",header:W(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(`
`):[],raw:Ae[0]};if(De.header.length===De.align.length){var Me=De.align.length,Fe;for(Fe=0;Fe<Me;Fe++)/^ *-+: *$/.test(De.align[Fe])?De.align[Fe]="right":/^ *:-+: *$/.test(De.align[Fe])?De.align[Fe]="center":/^ *:-+ *$/.test(De.align[Fe])?De.align[Fe]="left":De.align[Fe]=null;for(Me=De.cells.length,Fe=0;Fe<Me;Fe++)De.cells[Fe]=W(De.cells[Fe],De.header.length);return De}}},Oe.hr=function(Te){var Ae=this.rules.block.hr.exec(Te);if(Ae)return{type:"hr",raw:Ae[0]}},Oe.blockquote=function(Te){var Ae=this.rules.block.blockquote.exec(Te);if(Ae){var De=Ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Ae[0],text:De}}},Oe.list=function(Te){var Ae=this.rules.block.list.exec(Te);if(Ae){for(var De=Ae[0],Me=Ae[2],Fe=Me.length>1,Xe=Me[Me.length-1]===")",qe={type:"list",raw:De,ordered:Fe,start:Fe?+Me.slice(0,-1):"",loose:!1,items:[]},pt=Ae[0].match(this.rules.block.item),at=!1,ft,Et,xt,lt,Wt,It,ir,$t=pt.length,At=0;At<$t;At++)ft=pt[At],De=ft,Et=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) */,""),~ft.indexOf(`
`)&&(Et-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+Et+"}","gm"),"")),At!==$t-1&&(xt=this.rules.block.bullet.exec(pt[At+1])[0],(Fe?xt.length===1||!Xe&&xt[xt.length-1]===")":xt.length>1||this.options.smartLists&&xt!==Me)&&(lt=pt.slice(At+1).join(`
`),qe.raw=qe.raw.substring(0,qe.raw.length-lt.length),At=$t-1)),Wt=at||/\n\n(?!\s*$)/.test(ft),At!==$t-1&&(at=ft.charAt(ft.length-1)===`
`,Wt||(Wt=at)),Wt&&(qe.loose=!0),It=/^\[[ xX]\] /.test(ft),ir=void 0,It&&(ir=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),qe.items.push({type:"list_item",raw:De,task:It,checked:ir,loose:Wt,text:ft});return qe}},Oe.html=function(Te){var Ae=this.rules.block.html.exec(Te);if(Ae)return{type:this.options.sanitize?"paragraph":"html",raw:Ae[0],pre:!this.options.sanitizer&&(Ae[1]==="pre"||Ae[1]==="script"||Ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):te(Ae[0]):Ae[0]}},Oe.def=function(Te){var Ae=this.rules.block.def.exec(Te);if(Ae){Ae[3]&&(Ae[3]=Ae[3].substring(1,Ae[3].length-1));var De=Ae[1].toLowerCase().replace(/\s+/g," ");return{tag:De,raw:Ae[0],href:Ae[2],title:Ae[3]}}},Oe.table=function(Te){var Ae=this.rules.block.table.exec(Te);if(Ae){var De={type:"table",header:W(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(`
`):[]};if(De.header.length===De.align.length){De.raw=Ae[0];var Me=De.align.length,Fe;for(Fe=0;Fe<Me;Fe++)/^ *-+: *$/.test(De.align[Fe])?De.align[Fe]="right":/^ *:-+: *$/.test(De.align[Fe])?De.align[Fe]="center":/^ *:-+ *$/.test(De.align[Fe])?De.align[Fe]="left":De.align[Fe]=null;for(Me=De.cells.length,Fe=0;Fe<Me;Fe++)De.cells[Fe]=W(De.cells[Fe].replace(/^ *\| *| *\| *$/g,""),De.header.length);return De}}},Oe.lheading=function(Te){var Ae=this.rules.block.lheading.exec(Te);if(Ae)return{type:"heading",raw:Ae[0],depth:Ae[2].charAt(0)==="="?1:2,text:Ae[1]}},Oe.paragraph=function(Te){var Ae=this.rules.block.paragraph.exec(Te);if(Ae)return{type:"paragraph",raw:Ae[0],text:Ae[1].charAt(Ae[1].length-1)===`
`?Ae[1].slice(0,-1):Ae[1]}},Oe.text=function(Te,Ae){var De=this.rules.block.text.exec(Te);if(De){var Me=Ae[Ae.length-1];return Me&&Me.type==="text"?{raw:De[0],text:De[0]}:{type:"text",raw:De[0],text:De[0]}}},Oe.escape=function(Te){var Ae=this.rules.inline.escape.exec(Te);if(Ae)return{type:"escape",raw:Ae[0],text:te(Ae[1])}},Oe.tag=function(Te,Ae,De){var Me=this.rules.inline.tag.exec(Te);if(Me)return!Ae&&/^<a /i.test(Me[0])?Ae=!0:Ae&&/^<\/a>/i.test(Me[0])&&(Ae=!1),!De&&/^<(pre|code|kbd|script)(\s|>)/i.test(Me[0])?De=!0:De&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Me[0])&&(De=!1),{type:this.options.sanitize?"text":"html",raw:Me[0],inLink:Ae,inRawBlock:De,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Me[0]):te(Me[0]):Me[0]}},Oe.link=function(Te){var Ae=this.rules.inline.link.exec(Te);if(Ae){var De=de(Ae[2],"()");if(De>-1){var Me=Ae[0].indexOf("!")===0?5:4,Fe=Me+Ae[1].length+De;Ae[2]=Ae[2].substring(0,De),Ae[0]=Ae[0].substring(0,Fe).trim(),Ae[3]=""}var Xe=Ae[2],qe="";if(this.options.pedantic){var pt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Xe);pt?(Xe=pt[1],qe=pt[3]):qe=""}else qe=Ae[3]?Ae[3].slice(1,-1):"";Xe=Xe.trim().replace(/^<([\s\S]*)>$/,"$1");var at=fe(Ae,{href:Xe&&Xe.replace(this.rules.inline._escapes,"$1"),title:qe&&qe.replace(this.rules.inline._escapes,"$1")},Ae[0]);return at}},Oe.reflink=function(Te,Ae){var De;if((De=this.rules.inline.reflink.exec(Te))||(De=this.rules.inline.nolink.exec(Te))){var Me=(De[2]||De[1]).replace(/\s+/g," ");if(Me=Ae[Me.toLowerCase()],!Me||!Me.href){var Fe=De[0].charAt(0);return{type:"text",raw:Fe,text:Fe}}var Xe=fe(De,Me,De[0]);return Xe}},Oe.strong=function(Te,Ae,De){De===void 0&&(De="");var Me=this.rules.inline.strong.start.exec(Te);if(Me&&(!Me[1]||Me[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){Ae=Ae.slice(-1*Te.length);var Fe=Me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Fe.lastIndex=0;for(var Xe;(Me=Fe.exec(Ae))!=null;)if(Xe=this.rules.inline.strong.middle.exec(Ae.slice(0,Me.index+3)),Xe)return{type:"strong",raw:Te.slice(0,Xe[0].length),text:Te.slice(2,Xe[0].length-2)}}},Oe.em=function(Te,Ae,De){De===void 0&&(De="");var Me=this.rules.inline.em.start.exec(Te);if(Me&&(!Me[1]||Me[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){Ae=Ae.slice(-1*Te.length);var Fe=Me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Fe.lastIndex=0;for(var Xe;(Me=Fe.exec(Ae))!=null;)if(Xe=this.rules.inline.em.middle.exec(Ae.slice(0,Me.index+2)),Xe)return{type:"em",raw:Te.slice(0,Xe[0].length),text:Te.slice(1,Xe[0].length-1)}}},Oe.codespan=function(Te){var Ae=this.rules.inline.code.exec(Te);if(Ae){var De=Ae[2].replace(/\n/g," "),Me=/[^ ]/.test(De),Fe=De.startsWith(" ")&&De.endsWith(" ");return Me&&Fe&&(De=De.substring(1,De.length-1)),De=te(De,!0),{type:"codespan",raw:Ae[0],text:De}}},Oe.br=function(Te){var Ae=this.rules.inline.br.exec(Te);if(Ae)return{type:"br",raw:Ae[0]}},Oe.del=function(Te){var Ae=this.rules.inline.del.exec(Te);if(Ae)return{type:"del",raw:Ae[0],text:Ae[1]}},Oe.autolink=function(Te,Ae){var De=this.rules.inline.autolink.exec(Te);if(De){var Me,Fe;return De[2]==="@"?(Me=te(this.options.mangle?Ae(De[1]):De[1]),Fe="mailto:"+Me):(Me=te(De[1]),Fe=Me),{type:"link",raw:De[0],text:Me,href:Fe,tokens:[{type:"text",raw:Me,text:Me}]}}},Oe.url=function(Te,Ae){var De;if(De=this.rules.inline.url.exec(Te)){var Me,Fe;if(De[2]==="@")Me=te(this.options.mangle?Ae(De[0]):De[0]),Fe="mailto:"+Me;else{var Xe;do Xe=De[0],De[0]=this.rules.inline._backpedal.exec(De[0])[0];while(Xe!==De[0]);Me=te(De[0]),De[1]==="www."?Fe="http://"+Me:Fe=Me}return{type:"link",raw:De[0],text:Me,href:Fe,tokens:[{type:"text",raw:Me,text:Me}]}}},Oe.inlineText=function(Te,Ae,De){var Me=this.rules.inline.text.exec(Te);if(Me){var Fe;return Ae?Fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Me[0]):te(Me[0]):Me[0]:Fe=te(this.options.smartypants?De(Me[0]):Me[0]),{type:"text",raw:Me[0],text:Fe}}},Ie}(),ue=G.noopTest,ge=G.edit,pe=G.merge,oe={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:ue,table:ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};oe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,oe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,oe.def=ge(oe.def).replace("label",oe._label).replace("title",oe._title).getRegex(),oe.bullet=/(?:[*+-]|\d{1,9}[.)])/,oe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,oe.item=ge(oe.item,"gm").replace(/bull/g,oe.bullet).getRegex(),oe.list=ge(oe.list).replace(/bull/g,oe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+oe.def.source+")").getRegex(),oe._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",oe._comment=/<!--(?!-?>)[\s\S]*?-->/,oe.html=ge(oe.html,"i").replace("comment",oe._comment).replace("tag",oe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe.paragraph=ge(oe._paragraph).replace("hr",oe.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",oe._tag).getRegex(),oe.blockquote=ge(oe.blockquote).replace("paragraph",oe.paragraph).getRegex(),oe.normal=pe({},oe),oe.gfm=pe({},oe.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*|$)"}),oe.gfm.nptable=ge(oe.gfm.nptable).replace("hr",oe.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",oe._tag).getRegex(),oe.gfm.table=ge(oe.gfm.table).replace("hr",oe.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",oe._tag).getRegex(),oe.pedantic=pe({},oe.normal,{html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",oe._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:ue,paragraph:ge(oe.normal._paragraph).replace("hr",oe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",oe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ue,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:ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ae._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ae.punctuation=ge(ae.punctuation).replace(/punctuation/g,ae._punctuation).getRegex(),ae._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ae._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ae.em.start=ge(ae.em.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.middle=ge(ae.em.middle).replace(/punctuation/g,ae._punctuation).replace(/overlapSkip/g,ae._overlapSkip).getRegex(),ae.em.endAst=ge(ae.em.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.endUnd=ge(ae.em.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.start=ge(ae.strong.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.middle=ge(ae.strong.middle).replace(/punctuation/g,ae._punctuation).replace(/blockSkip/g,ae._blockSkip).getRegex(),ae.strong.endAst=ge(ae.strong.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.endUnd=ge(ae.strong.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=ge(ae._blockSkip,"g").getRegex(),ae.overlapSkip=ge(ae._overlapSkip,"g").getRegex(),ae._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._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])?)+(?![-_])/,ae.autolink=ge(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=ge(ae.tag).replace("comment",oe._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=ge(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=ge(ae.reflink).replace("label",ae._label).getRegex(),ae.reflinkSearch=ge(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal=pe({},ae),ae.pedantic=pe({},ae.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:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()}),ae.gfm=pe({},ae.normal,{escape:ge(ae.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ae.gfm.url=ge(ae.gfm.url,"i").replace("email",ae.gfm._extended_email).getRegex(),ae.breaks=pe({},ae.gfm,{br:ge(ae.br).replace("{2,}","*").getRegex(),text:ge(ae.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var re={block:oe,inline:ae},he=C.defaults,Q=re.block,ie=re.inline;function we(Ie){return Ie.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 ne(Ie){var Oe="",Le,Te,Ae=Ie.length;for(Le=0;Le<Ae;Le++)Te=Ie.charCodeAt(Le),Math.random()>.5&&(Te="x"+Te.toString(16)),Oe+="&#"+Te+";";return Oe}var J=function(){function Ie(Le){this.tokens=[],this.tokens.links=Object.create(null),this.options=Le||he,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Te={block:Q.normal,inline:ie.normal};this.options.pedantic?(Te.block=Q.pedantic,Te.inline=ie.pedantic):this.options.gfm&&(Te.block=Q.gfm,this.options.breaks?Te.inline=ie.breaks:Te.inline=ie.gfm),this.tokenizer.rules=Te}Ie.lex=function(Te,Ae){var De=new Ie(Ae);return De.lex(Te)};var Oe=Ie.prototype;return Oe.lex=function(Te){return Te=Te.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(Te,this.tokens,!0),this.inline(this.tokens),this.tokens},Oe.blockTokens=function(Te,Ae,De){Ae===void 0&&(Ae=[]),De===void 0&&(De=!0),Te=Te.replace(/^ +$/gm,"");for(var Me,Fe,Xe,qe;Te;){if(Me=this.tokenizer.space(Te)){Te=Te.substring(Me.raw.length),Me.type&&Ae.push(Me);continue}if(Me=this.tokenizer.code(Te,Ae)){Te=Te.substring(Me.raw.length),Me.type?Ae.push(Me):(qe=Ae[Ae.length-1],qe.raw+=`
`+Me.raw,qe.text+=`
`+Me.text);continue}if(Me=this.tokenizer.fences(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.heading(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.nptable(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.hr(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.blockquote(Te)){Te=Te.substring(Me.raw.length),Me.tokens=this.blockTokens(Me.text,[],De),Ae.push(Me);continue}if(Me=this.tokenizer.list(Te)){for(Te=Te.substring(Me.raw.length),Xe=Me.items.length,Fe=0;Fe<Xe;Fe++)Me.items[Fe].tokens=this.blockTokens(Me.items[Fe].text,[],!1);Ae.push(Me);continue}if(Me=this.tokenizer.html(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(De&&(Me=this.tokenizer.def(Te))){Te=Te.substring(Me.raw.length),this.tokens.links[Me.tag]||(this.tokens.links[Me.tag]={href:Me.href,title:Me.title});continue}if(Me=this.tokenizer.table(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.lheading(Te)){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(De&&(Me=this.tokenizer.paragraph(Te))){Te=Te.substring(Me.raw.length),Ae.push(Me);continue}if(Me=this.tokenizer.text(Te,Ae)){Te=Te.substring(Me.raw.length),Me.type?Ae.push(Me):(qe=Ae[Ae.length-1],qe.raw+=`
`+Me.raw,qe.text+=`
`+Me.text);continue}if(Te){var pt="Infinite loop on byte: "+Te.charCodeAt(0);if(this.options.silent){console.error(pt);break}else throw new Error(pt)}}return Ae},Oe.inline=function(Te){var Ae,De,Me,Fe,Xe,qe,pt=Te.length;for(Ae=0;Ae<pt;Ae++){qe=Te[Ae];switch(qe.type){case"paragraph":case"text":case"heading":{qe.tokens=[],this.inlineTokens(qe.text,qe.tokens);break}case"table":{for(qe.tokens={header:[],cells:[]},Fe=qe.header.length,De=0;De<Fe;De++)qe.tokens.header[De]=[],this.inlineTokens(qe.header[De],qe.tokens.header[De]);for(Fe=qe.cells.length,De=0;De<Fe;De++)for(Xe=qe.cells[De],qe.tokens.cells[De]=[],Me=0;Me<Xe.length;Me++)qe.tokens.cells[De][Me]=[],this.inlineTokens(Xe[Me],qe.tokens.cells[De][Me]);break}case"blockquote":{this.inline(qe.tokens);break}case"list":{for(Fe=qe.items.length,De=0;De<Fe;De++)this.inline(qe.items[De].tokens);break}}}return Te},Oe.inlineTokens=function(Te,Ae,De,Me,Fe){Ae===void 0&&(Ae=[]),De===void 0&&(De=!1),Me===void 0&&(Me=!1),Fe===void 0&&(Fe="");var Xe,qe=Te,pt;if(this.tokens.links){var at=Object.keys(this.tokens.links);if(at.length>0)for(;(pt=this.tokenizer.rules.inline.reflinkSearch.exec(qe))!=null;)at.includes(pt[0].slice(pt[0].lastIndexOf("[")+1,-1))&&(qe=qe.slice(0,pt.index)+"["+"a".repeat(pt[0].length-2)+"]"+qe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(pt=this.tokenizer.rules.inline.blockSkip.exec(qe))!=null;)qe=qe.slice(0,pt.index)+"["+"a".repeat(pt[0].length-2)+"]"+qe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Te;){if(Xe=this.tokenizer.escape(Te)){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(Xe=this.tokenizer.tag(Te,De,Me)){Te=Te.substring(Xe.raw.length),De=Xe.inLink,Me=Xe.inRawBlock,Ae.push(Xe);continue}if(Xe=this.tokenizer.link(Te)){Te=Te.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,Me)),Ae.push(Xe);continue}if(Xe=this.tokenizer.reflink(Te,this.tokens.links)){Te=Te.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,Me)),Ae.push(Xe);continue}if(Xe=this.tokenizer.strong(Te,qe,Fe)){Te=Te.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],De,Me),Ae.push(Xe);continue}if(Xe=this.tokenizer.em(Te,qe,Fe)){Te=Te.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],De,Me),Ae.push(Xe);continue}if(Xe=this.tokenizer.codespan(Te)){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(Xe=this.tokenizer.br(Te)){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(Xe=this.tokenizer.del(Te)){Te=Te.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],De,Me),Ae.push(Xe);continue}if(Xe=this.tokenizer.autolink(Te,ne)){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(!De&&(Xe=this.tokenizer.url(Te,ne))){Te=Te.substring(Xe.raw.length),Ae.push(Xe);continue}if(Xe=this.tokenizer.inlineText(Te,Me,we)){Te=Te.substring(Xe.raw.length),Fe=Xe.raw.slice(-1),Ae.push(Xe);continue}if(Te){var ft="Infinite loop on byte: "+Te.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return Ae},m(Ie,null,[{key:"rules",get:function(){return{block:Q,inline:ie}}}]),Ie}(),V=C.defaults,Z=G.cleanUrl,Ee=G.escape,xe=function(){function Ie(Le){this.options=Le||V}var Oe=Ie.prototype;return Oe.code=function(Te,Ae,De){var Me=(Ae||"").match(/\S*/)[0];if(this.options.highlight){var Fe=this.options.highlight(Te,Me);Fe!=null&&Fe!==Te&&(De=!0,Te=Fe)}return Me?'<pre><code class="'+this.options.langPrefix+Ee(Me,!0)+'">'+(De?Te:Ee(Te,!0))+`</code></pre>
`:"<pre><code>"+(De?Te:Ee(Te,!0))+`</code></pre>
`},Oe.blockquote=function(Te){return`<blockquote>
`+Te+`</blockquote>
`},Oe.html=function(Te){return Te},Oe.heading=function(Te,Ae,De,Me){return this.options.headerIds?"<h"+Ae+' id="'+this.options.headerPrefix+Me.slug(De)+'">'+Te+"</h"+Ae+`>
`:"<h"+Ae+">"+Te+"</h"+Ae+`>
`},Oe.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Oe.list=function(Te,Ae,De){var Me=Ae?"ol":"ul",Fe=Ae&&De!==1?' start="'+De+'"':"";return"<"+Me+Fe+`>
`+Te+"</"+Me+`>
`},Oe.listitem=function(Te){return"<li>"+Te+`</li>
`},Oe.checkbox=function(Te){return"<input "+(Te?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Oe.paragraph=function(Te){return"<p>"+Te+`</p>
`},Oe.table=function(Te,Ae){return Ae&&(Ae="<tbody>"+Ae+"</tbody>"),`<table>
<thead>
`+Te+`</thead>
`+Ae+`</table>
`},Oe.tablerow=function(Te){return`<tr>
`+Te+`</tr>
`},Oe.tablecell=function(Te,Ae){var De=Ae.header?"th":"td",Me=Ae.align?"<"+De+' align="'+Ae.align+'">':"<"+De+">";return Me+Te+"</"+De+`>
`},Oe.strong=function(Te){return"<strong>"+Te+"</strong>"},Oe.em=function(Te){return"<em>"+Te+"</em>"},Oe.codespan=function(Te){return"<code>"+Te+"</code>"},Oe.br=function(){return this.options.xhtml?"<br/>":"<br>"},Oe.del=function(Te){return"<del>"+Te+"</del>"},Oe.link=function(Te,Ae,De){if(Te=Z(this.options.sanitize,this.options.baseUrl,Te),Te===null)return De;var Me='<a href="'+Ee(Te)+'"';return Ae&&(Me+=' title="'+Ae+'"'),Me+=">"+De+"</a>",Me},Oe.image=function(Te,Ae,De){if(Te=Z(this.options.sanitize,this.options.baseUrl,Te),Te===null)return De;var Me='<img src="'+Te+'" alt="'+De+'"';return Ae&&(Me+=' title="'+Ae+'"'),Me+=this.options.xhtml?"/>":">",Me},Oe.text=function(Te){return Te},Ie}(),_e=function(){function Ie(){}var Oe=Ie.prototype;return Oe.strong=function(Te){return Te},Oe.em=function(Te){return Te},Oe.codespan=function(Te){return Te},Oe.del=function(Te){return Te},Oe.html=function(Te){return Te},Oe.text=function(Te){return Te},Oe.link=function(Te,Ae,De){return""+De},Oe.image=function(Te,Ae,De){return""+De},Oe.br=function(){return""},Ie}(),Ne=function(){function Ie(){this.seen={}}var Oe=Ie.prototype;return Oe.slug=function(Te){var Ae=Te.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ae)){var De=Ae;do this.seen[De]++,Ae=De+"-"+this.seen[De];while(this.seen.hasOwnProperty(Ae))}return this.seen[Ae]=0,Ae},Ie}(),Be=C.defaults,We=G.unescape,Ue=function(){function Ie(Le){this.options=Le||Be,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new _e,this.slugger=new Ne}Ie.parse=function(Te,Ae){var De=new Ie(Ae);return De.parse(Te)};var Oe=Ie.prototype;return Oe.parse=function(Te,Ae){Ae===void 0&&(Ae=!0);var De="",Me,Fe,Xe,qe,pt,at,ft,Et,xt,lt,Wt,It,ir,$t,At,Rt,hr,St,Je=Te.length;for(Me=0;Me<Je;Me++){lt=Te[Me];switch(lt.type){case"space":continue;case"hr":{De+=this.renderer.hr();continue}case"heading":{De+=this.renderer.heading(this.parseInline(lt.tokens),lt.depth,We(this.parseInline(lt.tokens,this.textRenderer)),this.slugger);continue}case"code":{De+=this.renderer.code(lt.text,lt.lang,lt.escaped);continue}case"table":{for(Et="",ft="",qe=lt.header.length,Fe=0;Fe<qe;Fe++)ft+=this.renderer.tablecell(this.parseInline(lt.tokens.header[Fe]),{header:!0,align:lt.align[Fe]});for(Et+=this.renderer.tablerow(ft),xt="",qe=lt.cells.length,Fe=0;Fe<qe;Fe++){for(at=lt.tokens.cells[Fe],ft="",pt=at.length,Xe=0;Xe<pt;Xe++)ft+=this.renderer.tablecell(this.parseInline(at[Xe]),{header:!1,align:lt.align[Xe]});xt+=this.renderer.tablerow(ft)}De+=this.renderer.table(Et,xt);continue}case"blockquote":{xt=this.parse(lt.tokens),De+=this.renderer.blockquote(xt);continue}case"list":{for(Wt=lt.ordered,It=lt.start,ir=lt.loose,qe=lt.items.length,xt="",Fe=0;Fe<qe;Fe++)At=lt.items[Fe],Rt=At.checked,hr=At.task,$t="",At.task&&(St=this.renderer.checkbox(Rt),ir?At.tokens.length>0&&At.tokens[0].type==="text"?(At.tokens[0].text=St+" "+At.tokens[0].text,At.tokens[0].tokens&&At.tokens[0].tokens.length>0&&At.tokens[0].tokens[0].type==="text"&&(At.tokens[0].tokens[0].text=St+" "+At.tokens[0].tokens[0].text)):At.tokens.unshift({type:"text",text:St}):$t+=St),$t+=this.parse(At.tokens,ir),xt+=this.renderer.listitem($t,hr,Rt);De+=this.renderer.list(xt,Wt,It);continue}case"html":{De+=this.renderer.html(lt.text);continue}case"paragraph":{De+=this.renderer.paragraph(this.parseInline(lt.tokens));continue}case"text":{for(xt=lt.tokens?this.parseInline(lt.tokens):lt.text;Me+1<Je&&Te[Me+1].type==="text";)lt=Te[++Me],xt+=`
`+(lt.tokens?this.parseInline(lt.tokens):lt.text);De+=Ae?this.renderer.paragraph(xt):xt;continue}default:{var dt='Token with "'+lt.type+'" type was not found.';if(this.options.silent){console.error(dt);return}else throw new Error(dt)}}}return De},Oe.parseInline=function(Te,Ae){Ae=Ae||this.renderer;var De="",Me,Fe,Xe=Te.length;for(Me=0;Me<Xe;Me++){Fe=Te[Me];switch(Fe.type){case"escape":{De+=Ae.text(Fe.text);break}case"html":{De+=Ae.html(Fe.text);break}case"link":{De+=Ae.link(Fe.href,Fe.title,this.parseInline(Fe.tokens,Ae));break}case"image":{De+=Ae.image(Fe.href,Fe.title,Fe.text);break}case"strong":{De+=Ae.strong(this.parseInline(Fe.tokens,Ae));break}case"em":{De+=Ae.em(this.parseInline(Fe.tokens,Ae));break}case"codespan":{De+=Ae.codespan(Fe.text);break}case"br":{De+=Ae.br();break}case"del":{De+=Ae.del(this.parseInline(Fe.tokens,Ae));break}case"text":{De+=Ae.text(Fe.text);break}default:{var qe='Token with "'+Fe.type+'" type was not found.';if(this.options.silent){console.error(qe);return}else throw new Error(qe)}}}return De},Ie}(),ze=G.merge,Ke=G.checkSanitizeDeprecation,Ye=G.escape,Re=C.getDefaults,tt=C.changeDefaults,rt=C.defaults;function He(Ie,Oe,Le){if(typeof Ie=="undefined"||Ie===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ie!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ie)+", string expected");if(typeof Oe=="function"&&(Le=Oe,Oe=null),Oe=ze({},He.defaults,Oe||{}),Ke(Oe),Le){var Te=Oe.highlight,Ae;try{Ae=J.lex(Ie,Oe)}catch(Xe){return Le(Xe)}var De=function(qe){var pt;if(!qe)try{pt=Ue.parse(Ae,Oe)}catch(at){qe=at}return Oe.highlight=Te,qe?Le(qe):Le(null,pt)};if(!Te||Te.length<3)return De();if(delete Oe.highlight,!Ae.length)return De();var Me=0;He.walkTokens(Ae,function(Xe){Xe.type==="code"&&(Me++,setTimeout(function(){Te(Xe.text,Xe.lang,function(qe,pt){if(qe)return De(qe);pt!=null&&pt!==Xe.text&&(Xe.text=pt,Xe.escaped=!0),Me--,Me===0&&De()})},0))}),Me===0&&De();return}try{var Fe=J.lex(Ie,Oe);return Oe.walkTokens&&He.walkTokens(Fe,Oe.walkTokens),Ue.parse(Fe,Oe)}catch(Xe){if(Xe.message+=`
Please report this to https://github.com/markedjs/marked.`,Oe.silent)return"<p>An error occurred:</p><pre>"+Ye(Xe.message+"",!0)+"</pre>";throw Xe}}He.options=He.setOptions=function(Ie){return ze(He.defaults,Ie),tt(He.defaults),He},He.getDefaults=Re,He.defaults=rt,He.use=function(Ie){var Oe=ze({},Ie);if(Ie.renderer&&function(){var Te=He.defaults.renderer||new xe,Ae=function(Fe){var Xe=Te[Fe];Te[Fe]=function(){for(var qe=arguments.length,pt=new Array(qe),at=0;at<qe;at++)pt[at]=arguments[at];var ft=Ie.renderer[Fe].apply(Te,pt);return ft===!1&&(ft=Xe.apply(Te,pt)),ft}};for(var De in Ie.renderer)Ae(De);Oe.renderer=Te}(),Ie.tokenizer&&function(){var Te=He.defaults.tokenizer||new Ce,Ae=function(Fe){var Xe=Te[Fe];Te[Fe]=function(){for(var qe=arguments.length,pt=new Array(qe),at=0;at<qe;at++)pt[at]=arguments[at];var ft=Ie.tokenizer[Fe].apply(Te,pt);return ft===!1&&(ft=Xe.apply(Te,pt)),ft}};for(var De in Ie.tokenizer)Ae(De);Oe.tokenizer=Te}(),Ie.walkTokens){var Le=He.defaults.walkTokens;Oe.walkTokens=function(Te){Ie.walkTokens(Te),Le&&Le(Te)}}He.setOptions(Oe)},He.walkTokens=function(Ie,Oe){for(var Le=T(Ie),Te;!(Te=Le()).done;){var Ae=Te.value;Oe(Ae);switch(Ae.type){case"table":{for(var De=T(Ae.tokens.header),Me;!(Me=De()).done;){var Fe=Me.value;He.walkTokens(Fe,Oe)}for(var Xe=T(Ae.tokens.cells),qe;!(qe=Xe()).done;)for(var pt=qe.value,at=T(pt),ft;!(ft=at()).done;){var Et=ft.value;He.walkTokens(Et,Oe)}break}case"list":{He.walkTokens(Ae.items,Oe);break}default:Ae.tokens&&He.walkTokens(Ae.tokens,Oe)}}},He.Parser=Ue,He.parser=Ue.parse,He.Renderer=xe,He.TextRenderer=_e,He.Lexer=J,He.lexer=J.lex,He.Tokenizer=Ce,He.Slugger=Ne,He.parse=He;var $e=He;return $e})},"DlR+":function(I,q,M){var P=M("MFOe"),m=P.Global,S=P.trim;I.exports={name:"cookieStorage",read:T,write:C,each:g,remove:p,clearAll:s};var R=m.document;function T(r){if(!r||!a(r))return null;var h="(?:^|.*;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(R.cookie.replace(new RegExp(h),"$1"))}function g(r){for(var h=R.cookie.split(/; ?/g),d=h.length-1;d>=0;d--){if(!S(h[d]))continue;var f=h[d].split("="),E=unescape(f[0]),y=unescape(f[1]);r(y,E)}}function C(r,h){if(!r)return;R.cookie=escape(r)+"="+escape(h)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function p(r){if(!r||!a(r))return;R.cookie=escape(r)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function s(){g(function(r,h){p(h)})}function a(r){return new RegExp("(?:^|;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(R.cookie)}},E4JC:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("ETIr"),M("cv67"),M("K3mO"),M("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.StreamCipher,T=m.algo,g=[],C=[],p=[],s=T.Rabbit=R.extend({_doReset:function(){for(var r=this._key.words,h=this.cfg.iv,d=0;d<4;d++)r[d]=(r[d]<<8|r[d]>>>24)&16711935|(r[d]<<24|r[d]>>>8)&4278255360;var f=this._X=[r[0],r[3]<<16|r[2]>>>16,r[1],r[0]<<16|r[3]>>>16,r[2],r[1]<<16|r[0]>>>16,r[3],r[2]<<16|r[1]>>>16],E=this._C=[r[2]<<16|r[2]>>>16,r[0]&4294901760|r[1]&65535,r[3]<<16|r[3]>>>16,r[1]&4294901760|r[2]&65535,r[0]<<16|r[0]>>>16,r[2]&4294901760|r[3]&65535,r[1]<<16|r[1]>>>16,r[3]&4294901760|r[0]&65535];this._b=0;for(var d=0;d<4;d++)a.call(this);for(var d=0;d<8;d++)E[d]^=f[d+4&7];if(h){var y=h.words,l=y[0],n=y[1],o=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,u=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,w=o>>>16|u&4294901760,v=u<<16|o&65535;E[0]^=o,E[1]^=w,E[2]^=u,E[3]^=v,E[4]^=o,E[5]^=w,E[6]^=u,E[7]^=v;for(var d=0;d<4;d++)a.call(this)}},_doProcessBlock:function(r,h){var d=this._X;a.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var f=0;f<4;f++)g[f]=(g[f]<<8|g[f]>>>24)&16711935|(g[f]<<24|g[f]>>>8)&4278255360,r[h+f]^=g[f]},blockSize:128/32,ivSize:64/32});function a(){for(var r=this._X,h=this._C,d=0;d<8;d++)C[d]=h[d];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0<C[0]>>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0<C[1]>>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0<C[2]>>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0<C[3]>>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0<C[4]>>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0<C[5]>>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0<C[6]>>>0?1:0)|0,this._b=h[7]>>>0<C[7]>>>0?1:0;for(var d=0;d<8;d++){var f=r[d]+h[d],E=f&65535,y=f>>>16,l=((E*E>>>17)+E*y>>>15)+y*y,n=((f&4294901760)*f|0)+((f&65535)*f|0);p[d]=l^n}r[0]=p[0]+(p[7]<<16|p[7]>>>16)+(p[6]<<16|p[6]>>>16)|0,r[1]=p[1]+(p[0]<<8|p[0]>>>24)+p[7]|0,r[2]=p[2]+(p[1]<<16|p[1]>>>16)+(p[0]<<16|p[0]>>>16)|0,r[3]=p[3]+(p[2]<<8|p[2]>>>24)+p[1]|0,r[4]=p[4]+(p[3]<<16|p[3]>>>16)+(p[2]<<16|p[2]>>>16)|0,r[5]=p[5]+(p[4]<<8|p[4]>>>24)+p[3]|0,r[6]=p[6]+(p[5]<<16|p[5]>>>16)+(p[4]<<16|p[4]>>>16)|0,r[7]=p[7]+(p[6]<<8|p[6]>>>24)+p[5]|0}m.Rabbit=R._createHelper(s)}(),P.Rabbit})},EHPI:function(I,q,M){"use strict";var P=M("bbsP"),m=M("/wGt"),S=M("tJVT"),R=M("k1fw"),T=M("q1tI"),g=M.n(T),C=M("ZW9T"),p=M("ZD9Y"),s=M("M8RZ"),a=M("bCnd"),r=M("fcyK"),h=M.n(r),d={theme:Object(a.a)("cmCodeMode","vs-dark"),fontSize:Object(a.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(a.a)("cmTabToSpace",!0)},f;(function(l){l[l.set_font_size=0]="set_font_size",l[l.set_theme=1]="set_theme",l[l.on_tab_to_space=2]="on_tab_to_space",l[l.set_show_editor_setting=3]="set_show_editor_setting"})(f||(f={}));function E(l,n){switch(n.type){case f.set_show_editor_setting:return Object(R.a)(Object(R.a)({},l),{},{showEditorSetting:n.payload});case f.set_theme:return Object(R.a)(Object(R.a)({},l),{},{theme:n.payload});case f.set_font_size:return Object(R.a)(Object(R.a)({},l),{},{fontSize:n.payload});case f.on_tab_to_space:return Object(R.a)(Object(R.a)({},l),{},{tabToSpace:n.payload});default:throw new Error}}q.a=function(l){var n=l.isLoading,o=l.value,u=l.onChange,w=l.language,v=l.ActionBarRender,i=v===void 0?function(G){return g.a.createElement(y,{onShowCodeSetting:G})}:v,k=Object(T.useReducer)(E,d),D=Object(S.a)(k,2),c=D[0],b=D[1],x=c.theme,_=c.fontSize,j=c.showEditorSetting,F=c.tabToSpace,L={onFontSizeChange:function(U){b({type:f.set_font_size,payload:U}),Object(a.b)("cmFontSize",U)},tabToSpace:F,cmFontSize:_,className:"oj",cmCodeMode:x,onTabToSpace:function(U){b({type:f.on_tab_to_space,payload:U}),Object(a.b)("cmTabToSpace",U)},onCodeModeChange:function(U){b({type:f.set_theme,payload:U}),Object(a.b)("cmCodeMode",U)}};function X(){b({type:f.set_show_editor_setting,payload:!1})}function z(){b({type:f.set_show_editor_setting,payload:!0})}var H={value:o,language:w,onChange:u,theme:x,height:"calc(100% - 56px)",options:{fontSize:_,insertSpaces:F}};return g.a.createElement(T.Fragment,null,g.a.createElement("div",{className:"code-panel-container"},i(z),!n&&g.a.createElement(C.b,H)),g.a.createElement(s.a,null,g.a.createElement(m.a,{className:"oj",title:null,placement:"right",closable:!1,visible:j,onClose:X},g.a.createElement(p.a,L))))};function y(l){var n=l.onShowCodeSetting;return g.a.createElement("div",{className:"action-bar"},g.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),g.a.createElement("a",{onClick:n},g.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(I,q,M){(function(P){P(M("VrN/"))})(function(P){var m={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},S=P.Pos;P.defineOption("autoCloseBrackets",!1,function(E,y,l){l&&l!=P.Init&&(E.removeKeyMap(T),E.state.closeBrackets=null),y&&(g(R(y,"pairs")),E.state.closeBrackets=y,E.addKeyMap(T))});function R(E,y){return y=="pairs"&&typeof E=="string"?E:typeof E=="object"&&E[y]!=null?E[y]:m[y]}var T={Backspace:s,Enter:a};function g(E){for(var y=0;y<E.length;y++){var l=E.charAt(y),n="'"+l+"'";T[n]||(T[n]=C(l))}}g(m.pairs+"`");function C(E){return function(y){return h(y,E)}}function p(E){var y=E.state.closeBrackets;if(!y||y.override)return y;var l=E.getModeAt(E.getCursor());return l.closeBrackets||y}function s(E){var y=p(E);if(!y||E.getOption("disableInput"))return P.Pass;for(var l=R(y,"pairs"),n=E.listSelections(),o=0;o<n.length;o++){if(!n[o].empty())return P.Pass;var u=d(E,n[o].head);if(!u||l.indexOf(u)%2!=0)return P.Pass}for(var o=n.length-1;o>=0;o--){var w=n[o].head;E.replaceRange("",S(w.line,w.ch-1),S(w.line,w.ch+1),"+delete")}}function a(E){var y=p(E),l=y&&R(y,"explode");if(!l||E.getOption("disableInput"))return P.Pass;for(var n=E.listSelections(),o=0;o<n.length;o++){if(!n[o].empty())return P.Pass;var u=d(E,n[o].head);if(!u||l.indexOf(u)%2!=0)return P.Pass}E.operation(function(){var w=E.lineSeparator()||`
`;E.replaceSelection(w+w,null),E.execCommand("goCharLeft"),n=E.listSelections();for(var v=0;v<n.length;v++){var i=n[v].head.line;E.indentLine(i,null,!0),E.indentLine(i+1,null,!0)}})}function r(E){var y=P.cmpPos(E.anchor,E.head)>0;return{anchor:new S(E.anchor.line,E.anchor.ch+(y?-1:1)),head:new S(E.head.line,E.head.ch+(y?1:-1))}}function h(E,y){var l=p(E);if(!l||E.getOption("disableInput"))return P.Pass;var n=R(l,"pairs"),o=n.indexOf(y);if(o==-1)return P.Pass;for(var u=R(l,"closeBefore"),w=R(l,"triples"),v=n.charAt(o+1)==y,i=E.listSelections(),k=o%2==0,D,c=0;c<i.length;c++){var b=i[c],x=b.head,_,j=E.getRange(x,S(x.line,x.ch+1));if(k&&!b.empty())_="surround";else if((v||!k)&&j==y)v&&f(E,x)?_="both":w.indexOf(y)>=0&&E.getRange(x,S(x.line,x.ch+3))==y+y+y?_="skipThree":_="skip";else if(v&&x.ch>1&&w.indexOf(y)>=0&&E.getRange(S(x.line,x.ch-2),x)==y+y){if(x.ch>2&&/\bstring/.test(E.getTokenTypeAt(S(x.line,x.ch-2))))return P.Pass;_="addFour"}else if(v){var F=x.ch==0?" ":E.getRange(S(x.line,x.ch-1),x);if(!P.isWordChar(j)&&F!=y&&!P.isWordChar(F))_="both";else return P.Pass}else if(k&&(j.length===0||/\s/.test(j)||u.indexOf(j)>-1))_="both";else return P.Pass;if(!D)D=_;else if(D!=_)return P.Pass}var L=o%2?n.charAt(o-1):y,X=o%2?y:n.charAt(o+1);E.operation(function(){if(D=="skip")E.execCommand("goCharRight");else if(D=="skipThree")for(var z=0;z<3;z++)E.execCommand("goCharRight");else if(D=="surround"){for(var H=E.getSelections(),z=0;z<H.length;z++)H[z]=L+H[z]+X;E.replaceSelections(H,"around"),H=E.listSelections().slice();for(var z=0;z<H.length;z++)H[z]=r(H[z]);E.setSelections(H)}else D=="both"?(E.replaceSelection(L+X,null),E.triggerElectric(L+X),E.execCommand("goCharLeft")):D=="addFour"&&(E.replaceSelection(L+L+L+L,"before"),E.execCommand("goCharRight"))})}function d(E,y){var l=E.getRange(S(y.line,y.ch-1),S(y.line,y.ch+1));return l.length==2?l:null}function f(E,y){var l=E.getTokenAt(S(y.line,y.ch+1));return/\bstring/.test(l.type)&&l.start==y.ch&&(y.ch==0||!/\bstring/.test(E.getTokenTypeAt(y)))}})},ELcG:function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){/** @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(m){var S=P,R=S.lib,T=R.WordArray,g=R.Hasher,C=S.algo,p=T.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=T.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=T.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),r=T.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=T.create([0,1518500249,1859775393,2400959708,2840853838]),d=T.create([1352829926,1548603684,1836072691,2053994217,0]),f=C.RIPEMD160=g.extend({_doReset:function(){this._hash=T.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(w,v){for(var i=0;i<16;i++){var k=v+i,D=w[k];w[k]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}var c=this._hash.words,b=h.words,x=d.words,_=p.words,j=s.words,F=a.words,L=r.words,X,z,H,G,U,B,W,te,de,fe;B=X=c[0],W=z=c[1],te=H=c[2],de=G=c[3],fe=U=c[4];for(var be,i=0;i<80;i+=1)be=X+w[v+_[i]]|0,i<16?be+=E(z,H,G)+b[0]:i<32?be+=y(z,H,G)+b[1]:i<48?be+=l(z,H,G)+b[2]:i<64?be+=n(z,H,G)+b[3]:be+=o(z,H,G)+b[4],be=be|0,be=u(be,F[i]),be=be+U|0,X=U,U=G,G=u(H,10),H=z,z=be,be=B+w[v+j[i]]|0,i<16?be+=o(W,te,de)+x[0]:i<32?be+=n(W,te,de)+x[1]:i<48?be+=l(W,te,de)+x[2]:i<64?be+=y(W,te,de)+x[3]:be+=E(W,te,de)+x[4],be=be|0,be=u(be,L[i]),be=be+fe|0,B=fe,fe=de,de=u(te,10),te=W,W=be;be=c[1]+H+de|0,c[1]=c[2]+G+fe|0,c[2]=c[3]+U+B|0,c[3]=c[4]+X+W|0,c[4]=c[0]+z+te|0,c[0]=be},_doFinalize:function(){var w=this._data,v=w.words,i=this._nDataBytes*8,k=w.sigBytes*8;v[k>>>5]|=128<<24-k%32,v[(k+64>>>9<<4)+14]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,w.sigBytes=(v.length+1)*4,this._process();for(var D=this._hash,c=D.words,b=0;b<5;b++){var x=c[b];c[b]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}return D},clone:function(){var w=g.clone.call(this);return w._hash=this._hash.clone(),w}});function E(w,v,i){return w^v^i}function y(w,v,i){return w&v|~w&i}function l(w,v,i){return(w|~v)^i}function n(w,v,i){return w&i|v&~i}function o(w,v,i){return w^(v|~i)}function u(w,v){return w<<v|w>>>32-v}S.RIPEMD160=g._createHelper(f),S.HmacRIPEMD160=g._createHmacHelper(f)}(Math),P.RIPEMD160})},ETIr:function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=m.enc,g=T.Base64={stringify:function(p){var s=p.words,a=p.sigBytes,r=this._map;p.clamp();for(var h=[],d=0;d<a;d+=3)for(var f=s[d>>>2]>>>24-d%4*8&255,E=s[d+1>>>2]>>>24-(d+1)%4*8&255,y=s[d+2>>>2]>>>24-(d+2)%4*8&255,l=f<<16|E<<8|y,n=0;n<4&&d+n*.75<a;n++)h.push(r.charAt(l>>>6*(3-n)&63));var o=r.charAt(64);if(o)for(;h.length%4;)h.push(o);return h.join("")},parse:function(p){var s=p.length,a=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var h=0;h<a.length;h++)r[a.charCodeAt(h)]=h}var d=a.charAt(64);if(d){var f=p.indexOf(d);f!==-1&&(s=f)}return C(p,s,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function C(p,s,a){for(var r=[],h=0,d=0;d<s;d++)if(d%4){var f=a[p.charCodeAt(d-1)]<<d%4*2,E=a[p.charCodeAt(d)]>>>6-d%4*2,y=f|E;r[h>>>2]|=y<<24-h%4*8,h++}return R.create(r,h)}}(),P.enc.Base64})},"F+F2":function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){return function(){if(typeof ArrayBuffer!="function")return;var m=P,S=m.lib,R=S.WordArray,T=R.init,g=R.init=function(C){if(C instanceof ArrayBuffer&&(C=new Uint8Array(C)),(C instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&C instanceof Uint8ClampedArray||C instanceof Int16Array||C instanceof Uint16Array||C instanceof Int32Array||C instanceof Uint32Array||C instanceof Float32Array||C instanceof Float64Array)&&(C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength)),C instanceof Uint8Array){for(var p=C.byteLength,s=[],a=0;a<p;a++)s[a>>>2]|=C[a]<<24-a%4*8;T.call(this,s,p)}else T.apply(this,arguments)};g.prototype=R}(),P.lib.WordArray})},GRuw:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("lPiR"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=m.algo,g=T.SHA256,C=T.SHA224=g.extend({_doReset:function(){this._hash=new R.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var p=g._doFinalize.call(this);return p.sigBytes-=4,p}});m.SHA224=g._createHelper(C),m.HmacSHA224=g._createHmacHelper(C)}(),P.SHA224})},GfqC:function(I,q,M){"use strict";var P=M("q1tI"),m=M.n(P),S=M("TSYQ"),R=M.n(S);function T(G,U){var B="cannot "+G.method+" "+G.action+" "+U.status+"'",W=new Error(B);return W.status=U.status,W.method=G.method,W.url=G.action,W}function g(G){var U=G.responseText||G.response;if(!U)return U;try{return JSON.parse(U)}catch(B){return U}}function C(G){var U=new XMLHttpRequest;G.onProgress&&U.upload&&(U.upload.onprogress=function(de){de.total>0&&(de.percent=de.loaded/de.total*100),G.onProgress(de)});var B=new FormData;G.data&&Object.keys(G.data).forEach(function(te){var de=G.data[te];if(Array.isArray(de)){de.forEach(function(fe){B.append(te+"[]",fe)});return}B.append(te,G.data[te])}),G.file instanceof Blob?B.append(G.filename,G.file,G.file.name):B.append(G.filename,G.file),U.onerror=function(de){G.onError(de)},U.onload=function(){return U.status<200||U.status>=300?G.onError(T(G,U),g(U)):G.onSuccess(g(U),U)},U.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in U&&(U.withCredentials=!0);var W=G.headers||{};return W["X-Requested-With"]!==null&&U.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function(te){W[te]!==null&&U.setRequestHeader(te,W[te])}),U.send(B),{abort:function(){U.abort()}}}var p=+new Date,s=0;function a(){return"rc-upload-"+p+"-"+ ++s}function r(G,U){return G.indexOf(U,G.length-U.length)!==-1}var h=function(G,U){if(G&&U){var B=Array.isArray(U)?U:U.split(","),W=G.name||"",te=G.type||"",de=te.replace(/\/.*$/,"");return B.some(function(fe){var be=fe.trim();return be.charAt(0)==="."?r(W.toLowerCase(),be.toLowerCase()):/\/\*$/.test(be)?de===be.replace(/\/.*$/,""):te===be})}return!0};function d(G,U){var B=G.createReader(),W=[];function te(){B.readEntries(function(de){var fe=Array.prototype.slice.apply(de);W=W.concat(fe);var be=!fe.length;be?U(W):te()})}te()}var f=function(U,B,W){var te=function de(fe,be){be=be||"",fe.isFile?fe.file(function(Ce){W(Ce)&&(fe.fullPath&&!Ce.webkitRelativePath&&(Object.defineProperties(Ce,{webkitRelativePath:{writable:!0}}),Ce.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(Ce,{webkitRelativePath:{writable:!1}})),B([Ce]))}):fe.isDirectory&&d(fe,function(Ce){Ce.forEach(function(ue){de(ue,""+be+fe.name+"/")})})};U.forEach(function(de){te(de.webkitGetAsEntry())})},E=f,y=Object.assign||function(G){for(var U=1;U<arguments.length;U++){var B=arguments[U];for(var W in B)Object.prototype.hasOwnProperty.call(B,W)&&(G[W]=B[W])}return G},l=function(){function G(U,B){var W=[],te=!0,de=!1,fe=void 0;try{for(var be=U[Symbol.iterator](),Ce;!(te=(Ce=be.next()).done)&&!(W.push(Ce.value),B&&W.length===B);te=!0);}catch(ue){de=!0,fe=ue}finally{try{!te&&be.return&&be.return()}finally{if(de)throw fe}}return W}return function(U,B){if(Array.isArray(U))return U;if(Symbol.iterator in Object(U))return G(U,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=function(){function G(U,B){for(var W=0;W<B.length;W++){var te=B[W];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(U,te.key,te)}}return function(U,B,W){return B&&G(U.prototype,B),W&&G(U,W),U}}();function o(G,U,B){return U in G?Object.defineProperty(G,U,{value:B,enumerable:!0,configurable:!0,writable:!0}):G[U]=B,G}function u(G,U){var B={};for(var W in G){if(U.indexOf(W)>=0)continue;if(!Object.prototype.hasOwnProperty.call(G,W))continue;B[W]=G[W]}return B}function w(G,U){if(!(G instanceof U))throw new TypeError("Cannot call a class as a function")}function v(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 i(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 k=function(U){return Object.keys(U).reduce(function(B,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(B[W]=U[W]),B},{})},D=function(G){i(U,G);function U(){var B,W,te,de;w(this,U);for(var fe=arguments.length,be=Array(fe),Ce=0;Ce<fe;Ce++)be[Ce]=arguments[Ce];return de=(W=(te=v(this,(B=U.__proto__||Object.getPrototypeOf(U)).call.apply(B,[this].concat(be))),te),te.state={uid:a()},te.reqs={},te.onChange=function(ue){var ge=ue.target.files;te.uploadFiles(ge),te.reset()},te.onClick=function(ue){var ge=te.fileInput;if(!ge)return;var pe=te.props,oe=pe.children,ae=pe.onClick;oe&&oe.type==="button"&&(ge.parentNode.focus(),ge.parentNode.querySelector("button").blur()),ge.click(),ae&&ae(ue)},te.onKeyDown=function(ue){ue.key==="Enter"&&te.onClick()},te.onFileDrop=function(ue){var ge=te.props.multiple;if(ue.preventDefault(),ue.type==="dragover")return;if(te.props.directory)E(Array.prototype.slice.call(ue.dataTransfer.items),te.uploadFiles,function(oe){return h(oe,te.props.accept)});else{var pe=Array.prototype.slice.call(ue.dataTransfer.files).filter(function(oe){return h(oe,te.props.accept)});ge===!1&&(pe=pe.slice(0,1)),te.uploadFiles(pe)}},te.uploadFiles=function(ue){var ge=Array.prototype.slice.call(ue);ge.map(function(pe){return pe.uid=a(),pe}).forEach(function(pe){te.upload(pe,ge)})},te.saveFileInput=function(ue){te.fileInput=ue},W),v(te,de)}return n(U,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(W,te){var de=this,fe=this.props;if(!fe.beforeUpload)return setTimeout(function(){return de.post(W)},0);var be=fe.beforeUpload(W,te);be&&be.then?be.then(function(Ce){var ue=Object.prototype.toString.call(Ce);return ue==="[object File]"||ue==="[object Blob]"?de.post(Ce):de.post(W)}).catch(function(Ce){console.log(Ce)}):be!==!1&&setTimeout(function(){return de.post(W)},0);return}},{key:"post",value:function(W){var te=this;if(!this._isMounted)return;var de=this.props,fe=de.onStart,be=de.onProgress,Ce=de.transformFile,ue=Ce===void 0?function(ge){return ge}:Ce;new Promise(function(ge){var pe=de.action;return typeof pe=="function"&&(pe=pe(W)),ge(pe)}).then(function(ge){var pe=W.uid,oe=de.customRequest||C,ae=Promise.resolve(ue(W)).then(function(re){var he=de.data;return typeof he=="function"&&(he=he(re)),Promise.all([re,he])}).catch(function(re){console.error(re)});ae.then(function(re){var he=l(re,2),Q=he[0],ie=he[1],we={action:ge,filename:de.name,data:ie,file:Q,headers:de.headers,withCredentials:de.withCredentials,method:de.method||"post",onProgress:be?function(ne){be(ne,W)}:null,onSuccess:function(J,V){delete te.reqs[pe],de.onSuccess(J,W,V)},onError:function(J,V){delete te.reqs[pe],de.onError(J,V,W)}};fe(W),te.reqs[pe]=oe(we)})})}},{key:"reset",value:function(){this.setState({uid:a()})}},{key:"abort",value:function(W){var te=this.reqs;if(W){var de=W;W&&W.uid&&(de=W.uid),te[de]&&te[de].abort&&te[de].abort(),delete te[de]}else Object.keys(te).forEach(function(fe){te[fe]&&te[fe].abort&&te[fe].abort(),delete te[fe]})}},{key:"render",value:function(){var W,te=this.props,de=te.component,fe=te.prefixCls,be=te.className,Ce=te.disabled,ue=te.id,ge=te.style,pe=te.multiple,oe=te.accept,ae=te.children,re=te.directory,he=te.openFileDialogOnClick,Q=te.onMouseEnter,ie=te.onMouseLeave,we=u(te,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),ne=R()((W={},o(W,fe,!0),o(W,fe+"-disabled",Ce),o(W,be,be),W)),J=Ce?{}:{onClick:he?this.onClick:function(){},onKeyDown:he?this.onKeyDown:function(){},onMouseEnter:Q,onMouseLeave:ie,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return m.a.createElement(de,y({},J,{className:ne,role:"button",style:ge}),m.a.createElement("input",y({},k(we),{id:ue,type:"file",ref:this.saveFileInput,onClick:function(Z){return Z.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:oe,directory:re?"directory":null,webkitdirectory:re?"webkitdirectory":null,multiple:pe,onChange:this.onChange})),ae)}}]),U}(P.Component),c=D,b=Object.assign||function(G){for(var U=1;U<arguments.length;U++){var B=arguments[U];for(var W in B)Object.prototype.hasOwnProperty.call(B,W)&&(G[W]=B[W])}return G},x=function(){function G(U,B){for(var W=0;W<B.length;W++){var te=B[W];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(U,te.key,te)}}return function(U,B,W){return B&&G(U.prototype,B),W&&G(U,W),U}}();function _(G,U){if(!(G instanceof U))throw new TypeError("Cannot call a class as a function")}function j(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 F(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 L(){}var X=function(G){F(U,G);function U(){var B,W,te,de;_(this,U);for(var fe=arguments.length,be=Array(fe),Ce=0;Ce<fe;Ce++)be[Ce]=arguments[Ce];return de=(W=(te=j(this,(B=U.__proto__||Object.getPrototypeOf(U)).call.apply(B,[this].concat(be))),te),te.saveUploader=function(ue){te.uploader=ue},W),j(te,de)}return x(U,[{key:"abort",value:function(W){this.uploader.abort(W)}},{key:"render",value:function(){return m.a.createElement(c,b({},this.props,{ref:this.saveUploader}))}}]),U}(P.Component);X.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:L,onError:L,onSuccess:L,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var z=X,H=q.a=z},Gytx:function(I,q){I.exports=function(P,m,S,R){var T=S?S.call(R,P,m):void 0;if(T!==void 0)return!!T;if(P===m)return!0;if(typeof P!="object"||!P||typeof m!="object"||!m)return!1;var g=Object.keys(P),C=Object.keys(m);if(g.length!==C.length)return!1;for(var p=Object.prototype.hasOwnProperty.bind(m),s=0;s<g.length;s++){var a=g[s];if(!p(a))return!1;var r=P[a],h=m[a];if(T=S?S.call(R,r,h,a):void 0,T===!1||T===void 0&&r!==h)return!1}return!0}},HmJG:function(I,q,M){},Ib8C:function(I,q,M){(function(P){(function(m,S){I.exports=q=S()})(this,function(){var m=m||function(S,R){var T;if(typeof window!="undefined"&&window.crypto&&(T=window.crypto),typeof self!="undefined"&&self.crypto&&(T=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(T=globalThis.crypto),!T&&typeof window!="undefined"&&window.msCrypto&&(T=window.msCrypto),!T&&typeof P!="undefined"&&P.crypto&&(T=P.crypto),!T&&!0)try{T=M(4)}catch(o){}var g=function(){if(T){if(typeof T.getRandomValues=="function")try{return T.getRandomValues(new Uint32Array(1))[0]}catch(o){}if(typeof T.randomBytes=="function")try{return T.randomBytes(4).readInt32LE()}catch(o){}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||function(){function o(){}return function(u){var w;return o.prototype=u,w=new o,o.prototype=null,w}}(),p={},s=p.lib={},a=s.Base=function(){return{extend:function(o){var u=C(this);return o&&u.mixIn(o),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},create:function(){var o=this.extend();return o.init.apply(o,arguments),o},init:function(){},mixIn:function(o){for(var u in o)o.hasOwnProperty(u)&&(this[u]=o[u]);o.hasOwnProperty("toString")&&(this.toString=o.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=s.WordArray=a.extend({init:function(o,u){o=this.words=o||[],u!=R?this.sigBytes=u:this.sigBytes=o.length*4},toString:function(o){return(o||d).stringify(this)},concat:function(o){var u=this.words,w=o.words,v=this.sigBytes,i=o.sigBytes;if(this.clamp(),v%4)for(var k=0;k<i;k++){var D=w[k>>>2]>>>24-k%4*8&255;u[v+k>>>2]|=D<<24-(v+k)%4*8}else for(var c=0;c<i;c+=4)u[v+c>>>2]=w[c>>>2];return this.sigBytes+=i,this},clamp:function(){var o=this.words,u=this.sigBytes;o[u>>>2]&=4294967295<<32-u%4*8,o.length=S.ceil(u/4)},clone:function(){var o=a.clone.call(this);return o.words=this.words.slice(0),o},random:function(o){for(var u=[],w=0;w<o;w+=4)u.push(g());return new r.init(u,o)}}),h=p.enc={},d=h.Hex={stringify:function(o){for(var u=o.words,w=o.sigBytes,v=[],i=0;i<w;i++){var k=u[i>>>2]>>>24-i%4*8&255;v.push((k>>>4).toString(16)),v.push((k&15).toString(16))}return v.join("")},parse:function(o){for(var u=o.length,w=[],v=0;v<u;v+=2)w[v>>>3]|=parseInt(o.substr(v,2),16)<<24-v%8*4;return new r.init(w,u/2)}},f=h.Latin1={stringify:function(o){for(var u=o.words,w=o.sigBytes,v=[],i=0;i<w;i++){var k=u[i>>>2]>>>24-i%4*8&255;v.push(String.fromCharCode(k))}return v.join("")},parse:function(o){for(var u=o.length,w=[],v=0;v<u;v++)w[v>>>2]|=(o.charCodeAt(v)&255)<<24-v%4*8;return new r.init(w,u)}},E=h.Utf8={stringify:function(o){try{return decodeURIComponent(escape(f.stringify(o)))}catch(u){throw new Error("Malformed UTF-8 data")}},parse:function(o){return f.parse(unescape(encodeURIComponent(o)))}},y=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(o){typeof o=="string"&&(o=E.parse(o)),this._data.concat(o),this._nDataBytes+=o.sigBytes},_process:function(o){var u,w=this._data,v=w.words,i=w.sigBytes,k=this.blockSize,D=k*4,c=i/D;o?c=S.ceil(c):c=S.max((c|0)-this._minBufferSize,0);var b=c*k,x=S.min(b*4,i);if(b){for(var _=0;_<b;_+=k)this._doProcessBlock(v,_);u=v.splice(0,b),w.sigBytes-=x}return new r.init(u,x)},clone:function(){var o=a.clone.call(this);return o._data=this._data.clone(),o},_minBufferSize:0}),l=s.Hasher=y.extend({cfg:a.extend(),init:function(o){this.cfg=this.cfg.extend(o),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(o){return this._append(o),this._process(),this},finalize:function(o){o&&this._append(o);var u=this._doFinalize();return u},blockSize:512/32,_createHelper:function(o){return function(u,w){return new o.init(w).finalize(u)}},_createHmacHelper:function(o){return function(u,w){return new n.HMAC.init(o,w).finalize(u)}}}),n=p.algo={};return p}(Math);return m})}).call(this,M("IyRk"))},J66h:function(I,q,M){(function(P){var m,S;(function(R,T){I.exports=T(R)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof P!="undefined"?P:this,function(R){"use strict";R=R||{};var T=R.Base64,g="2.6.4",C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=function(L){for(var X={},z=0,H=L.length;z<H;z++)X[L.charAt(z)]=z;return X}(C),s=String.fromCharCode,a=function(L){if(L.length<2){var X=L.charCodeAt(0);return X<128?L:X<2048?s(192|X>>>6)+s(128|X&63):s(224|X>>>12&15)+s(128|X>>>6&63)+s(128|X&63)}else{var X=65536+(L.charCodeAt(0)-55296)*1024+(L.charCodeAt(1)-56320);return s(240|X>>>18&7)+s(128|X>>>12&63)+s(128|X>>>6&63)+s(128|X&63)}},r=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(L){return L.replace(r,a)},d=function(L){var X=[0,2,1][L.length%3],z=L.charCodeAt(0)<<16|(L.length>1?L.charCodeAt(1):0)<<8|(L.length>2?L.charCodeAt(2):0),H=[C.charAt(z>>>18),C.charAt(z>>>12&63),X>=2?"=":C.charAt(z>>>6&63),X>=1?"=":C.charAt(z&63)];return H.join("")},f=R.btoa&&typeof R.btoa=="function"?function(L){return R.btoa(L)}:function(L){if(L.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return L.replace(/[\s\S]{1,3}/g,d)},E=function(L){return f(h(String(L)))},y=function(L){return L.replace(/[+\/]/g,function(X){return X=="+"?"-":"_"}).replace(/=/g,"")},l=function(L,X){return X?y(E(L)):E(L)},n=function(L){return l(L,!0)},o;R.Uint8Array&&(o=function(L,X){for(var z="",H=0,G=L.length;H<G;H+=3){var U=L[H],B=L[H+1],W=L[H+2],te=U<<16|B<<8|W;z+=C.charAt(te>>>18)+C.charAt(te>>>12&63)+(typeof B!="undefined"?C.charAt(te>>>6&63):"=")+(typeof W!="undefined"?C.charAt(te&63):"=")}return X?y(z):z});var u=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(L){switch(L.length){case 4:var X=(7&L.charCodeAt(0))<<18|(63&L.charCodeAt(1))<<12|(63&L.charCodeAt(2))<<6|63&L.charCodeAt(3),z=X-65536;return s((z>>>10)+55296)+s((z&1023)+56320);case 3:return s((15&L.charCodeAt(0))<<12|(63&L.charCodeAt(1))<<6|63&L.charCodeAt(2));default:return s((31&L.charCodeAt(0))<<6|63&L.charCodeAt(1))}},v=function(L){return L.replace(u,w)},i=function(L){var X=L.length,z=X%4,H=(X>0?p[L.charAt(0)]<<18:0)|(X>1?p[L.charAt(1)]<<12:0)|(X>2?p[L.charAt(2)]<<6:0)|(X>3?p[L.charAt(3)]:0),G=[s(H>>>16),s(H>>>8&255),s(H&255)];return G.length-=[0,0,2,1][z],G.join("")},k=R.atob&&typeof R.atob=="function"?function(L){return R.atob(L)}:function(L){return L.replace(/\S{1,4}/g,i)},D=function(L){return k(String(L).replace(/[^A-Za-z0-9\+\/]/g,""))},c=function(L){return v(k(L))},b=function(L){return String(L).replace(/[-_]/g,function(X){return X=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},x=function(L){return c(b(L))},_;R.Uint8Array&&(_=function(L){return Uint8Array.from(D(b(L)),function(X){return X.charCodeAt(0)})});var j=function(){var L=R.Base64;return R.Base64=T,L};if(R.Base64={VERSION:g,atob:D,btoa:f,fromBase64:x,toBase64:l,utob:h,encode:l,encodeURI:n,btou:v,decode:x,noConflict:j,fromUint8Array:o,toUint8Array:_},typeof Object.defineProperty=="function"){var F=function(L){return{value:L,enumerable:!1,writable:!0,configurable:!0}};R.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",F(function(){return x(this)})),Object.defineProperty(String.prototype,"toBase64",F(function(L){return l(this,L)})),Object.defineProperty(String.prototype,"toBase64URI",F(function(){return l(this,!0)}))}}return R.Meteor&&(Base64=R.Base64),I.exports?I.exports.Base64=R.Base64:!(m=[],S=function(){return R.Base64}.apply(q,m),S!==void 0&&(I.exports=S)),{Base64:R.Base64}})}).call(this,M("IyRk"))},K3mO:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("3y9D"),M("WYAk"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.Base,T=S.WordArray,g=m.algo,C=g.MD5,p=g.EvpKDF=R.extend({cfg:R.extend({keySize:128/32,hasher:C,iterations:1}),init:function(s){this.cfg=this.cfg.extend(s)},compute:function(s,a){for(var r,h=this.cfg,d=h.hasher.create(),f=T.create(),E=f.words,y=h.keySize,l=h.iterations;E.length<y;){r&&d.update(r),r=d.update(s).finalize(a),d.reset();for(var n=1;n<l;n++)r=d.finalize(r),d.reset();f.concat(r)}return f.sigBytes=y*4,f}});m.EvpKDF=function(s,a,r){return p.create(r).compute(s,a)}}(),P.EvpKDF})},KhGG:function(I,q,M){"use strict";M.d(q,"a",function(){return i}),M.d(q,"c",function(){return c});var P=M("0Owb"),m=M("miYZ"),S=M("tsqr"),R=M("oBTY"),T=M("tJVT"),g=M("PpiC"),C=M("k1fw"),p=M("9og8"),s=M("DZo9"),a=M("8z0m"),r=M("WmNS"),h=M.n(r),d=M("q1tI"),f=M.n(d),E=M("ErOA"),y=M("NFKh"),l=M.n(y),n=M("7Cbv"),o=M("9kvl"),u=M("mxV5"),w=M.n(u),v=a.a.Dragger,i=function(_){var j="bf3c199c2470cb477d907b1e0917c17b",F="5183666c72eec9e4",L=l.a.enc.Utf8.parse(j),X=l.a.enc.Utf8.parse(F),z=l.a.AES.decrypt(_,L,{iv:X,mode:l.a.mode.CBC});return z.toString(l.a.enc.Utf8)},k,D=function(){var x=Object(p.a)(h.a.mark(function _(j){var F,L,X,z,H,G,U,B,W,te,de;return h.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return U=j.identifier,B=j.oldFilename,W=j.newFilename,be.next=3,Object(E.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 3:return te=be.sent,te.data=JSON.parse(i(te.data)),de=new w.a({endpoint:te==null||((F=te.data)===null||F===void 0)?void 0:F.end_point,region:te==null||((L=te.data)===null||L===void 0)?void 0:L.region,accessKeyId:te==null||((X=te.data)===null||X===void 0)?void 0:X.access_key_id,accessKeySecret:te==null||((z=te.data)===null||z===void 0)?void 0:z.access_key_secret,bucket:te==null||((H=te.data)===null||H===void 0)?void 0:H.bucket,stsToken:te==null||((G=te.data)===null||G===void 0)?void 0:G.security_token}),be.abrupt("return",new Promise(function(Ce,ue){console.log(11111,"".concat(U,"/").concat(B),"".concat(U,"/").concat(W),te.data),de.copy("/".concat(U,"/").concat(B),"/".concat(U,"/").concat(W)).then(function(ge){console.log("\u62F7\u8D1D\u6210\u529F",ge)}).catch(function(ge){console.log(ge)})}));case 7:case"end":return be.stop()}},_)}));return function(j){return x.apply(this,arguments)}}(),c=function(){var x=Object(p.a)(h.a.mark(function _(j,F,L){var X,z,H,G,U,B,W,te,de,fe;return h.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return F.file_name=j.name,Ce.next=3,Object(E.a)("/api/buckets/get_upload_token.json",{method:"get"});case 3:return W=Ce.sent,console.log("decrypt(res.data):",i(W.data)),W.data=JSON.parse(i(W.data)),te=j.name.split("."),te.pop(),de=F.realFileName?te:Object(n.a)(),fe=new w.a({endpoint:W==null||((X=W.data)===null||X===void 0)?void 0:X.end_point,region:W==null||((z=W.data)===null||z===void 0)?void 0:z.region,accessKeyId:W==null||((H=W.data)===null||H===void 0)?void 0:H.access_key_id,accessKeySecret:W==null||((G=W.data)===null||G===void 0)?void 0:G.access_key_secret,bucket:W==null||((U=W.data)===null||U===void 0)?void 0:U.bucket,stsToken:W==null||((B=W.data)===null||B===void 0)?void 0:B.security_token}),Ce.abrupt("return",new Promise(function(ue,ge){var pe;fe.multipartUpload("".concat(de),new Blob([j],{type:j.type}),Object(C.a)(Object(C.a)({timeout:200*1e3,partSize:102400},L),{},{callback:{url:W==null||((pe=W.data)===null||pe===void 0)?void 0:pe.callback_url,host:W==null?void 0:W.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(E.e)(F)}})).then(function(oe){var ae;j.response=(ae=oe.data)===null||ae===void 0?void 0:ae.data,ue(oe==null?void 0:oe.data)}).catch(function(oe){ge(oe),console.log("err:",oe)})}));case 11:case"end":return Ce.stop()}},_)}));return function(j,F,L){return x.apply(this,arguments)}}(),b=function(_){var j=_.user,F=_.cancelUpload,L=Object(g.a)(_,["user","cancelUpload"]),X=Object(d.useState)([]),z=Object(T.a)(X,2),H=z[0],G=z[1],U=Object(d.useState)(),B=Object(T.a)(U,2),W=B[0],te=B[1],de={onRemove:function(Ce){G(Object(R.a)(H.filter(function(ue){return ue.name!==Ce.name}))),L.onChange(H.filter(function(ue){return ue.name!==Ce.name}))},disabled:L.disabled,multiple:!0,fileList:H==null?void 0:H.map(function(be){return be.file}),customRequest:function(){},beforeUpload:function(){var be=Object(p.a)(h.a.mark(function ue(ge){var pe;return h.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:if(pe=L.maxSize||1024*1024*1024*1,!H.filter(function(re){return re.name===ge.name}).length){ae.next=4;break}return S.b.info("".concat(ge.name,"\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9")),ae.abrupt("return");case 4:if(!((ge==null?void 0:ge.size)>pe)){ae.next=7;break}return S.b.info("\u6587\u4EF6\u8D85\u8FC7".concat(pe/1024/1024/1024,"GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42")),ae.abrupt("return",!1);case 7:return H.push({name:ge.name,file:ge}),G(Object(R.a)(H)),L.onChange(H),ae.abrupt("return",!1);case 11:case"end":return ae.stop()}},ue)}));function Ce(ue){return be.apply(this,arguments)}return Ce}()},fe=function(){var be=Object(p.a)(h.a.mark(function Ce(ue,ge){var pe,oe,ae,re,he,Q,ie,we,ne,J;return h.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return ge.file_name=ue.name,ie=ue.name,Z.next=4,Object(E.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 4:if(we=Z.sent,we.data=JSON.parse(i(we.data)),!((we==null?void 0:we.status)!==0)){Z.next=12;break}return H[H.findIndex(function(Ee){return Ee.name===ie})].status="error",H[H.findIndex(function(Ee){return Ee.name===ie})].file.status="error",L.onChange(H),S.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),Z.abrupt("return");case 12:return W=new w.a({endpoint:we==null||((pe=we.data)===null||pe===void 0)?void 0:pe.end_point,region:we==null||((oe=we.data)===null||oe===void 0)?void 0:oe.region,accessKeyId:we==null||((ae=we.data)===null||ae===void 0)?void 0:ae.access_key_id,accessKeySecret:we==null||((re=we.data)===null||re===void 0)?void 0:re.access_key_secret,bucket:we==null||((he=we.data)===null||he===void 0)?void 0:he.bucket,stsToken:we==null||((Q=we.data)===null||Q===void 0)?void 0:Q.security_token}),console.log(ue,"file"),te(W),ne=ue.name.split("."),ne.pop(),J=ge.realFileName?ne:Object(n.a)(),Z.abrupt("return",new Promise(function(Ee,xe){try{var _e;W.multipartUpload("".concat(L.identifier,"/").concat(J).concat(ie.indexOf(".")>-1?"."+ie.split(".").pop():""),new Blob([ue.file],{type:ue.file.type}),{timeout:3600*1e3,partSize:1002400,progress:function(Be,We,Ue){try{console.log("\u8FDB\u5EA6",Be,We,Ue);var ze=H.findIndex(function(Ke){return Ke.name===ie});H[ze].file.percent=Be*100,H[ze].tempCheckpoint=We,G(Object(R.a)(H))}catch(Ke){}},checkpoint:H[H.findIndex(function(Ne){return Ne.name===ie})].tempCheckpoint,callback:{customValue:{id:ie+""},url:we==null||((_e=we.data)===null||_e===void 0)?void 0:_e.callback_url,host:we==null?void 0:we.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(E.e)(ge)}}).then(function(Ne){var Be,We=H.findIndex(function(Re){return Re.name===ie}),Ue="done";if(((Be=Ne.data)===null||Be===void 0?void 0:Be.status)===0){var ze;ue.response=(ze=Ne.data)===null||ze===void 0?void 0:ze.data;var Ke=H.findIndex(function(Re){return Re.name===ie});H[Ke].status="done",H[Ke].file.status="done"}else{var Ye;S.b.warn((Ye=Ne.data)===null||Ye===void 0?void 0:Ye.message),Ue="error"}H[We].status=Ue,H[We].file.status=Ue,L.onChange(H),Ee(Ne==null?void 0:Ne.data)}).catch(function(Ne){H[H.findIndex(function(Be){return Be.name===ie})].status="error",H[H.findIndex(function(Be){return Be.name===ie})].file.status="error",S.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),G(Object(R.a)(H)),L.onChange(H),xe(Ne),console.log("err:",Ne)})}catch(Ne){}}));case 19:case"end":return Z.stop()}},Ce)}));return function(ue,ge){return be.apply(this,arguments)}}();return Object(d.useEffect)(function(){H.every(function(be){return be==="done"||be==="error"})&&L.onComplete(H)},[H]),Object(d.useEffect)(function(){if(F){var be;(be=W)===null||be===void 0||be.cancel()}},[F]),Object(d.useEffect)(function(){L.uploading&&H.map(function(){var be=Object(p.a)(h.a.mark(function Ce(ue){var ge,pe;return h.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:if(!((!ue.status||ue.status==="error")&&!F)){ae.next=6;break}return ue.status="uploading",ue.file.status="uploading",ae.next=5,fe(ue,{login:j==null||((ge=j.userInfo)===null||ge===void 0)?void 0:ge.login,container_type:L.container_type,container_id:L.container_id,description:L.description,realFileName:L.realFileName});case 5:pe=ae.sent;case 6:case"end":return ae.stop()}},Ce)}));return function(Ce){return be.apply(this,arguments)}}())},[L.uploading]),f.a.createElement(v,Object(P.a)({},de,{height:L.height,className:L.className}),f.a.createElement("p",{className:"ant-upload-hint"},L.text||"\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))};q.b=Object(o.a)(function(x){var _=x.loading,j=x.globalSetting,F=x.user;return{globalSetting:j,loading:_.models.competitions,user:F}})(b)},KmYQ:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return P.pad.ZeroPadding={pad:function(m,S){var R=S*4;m.clamp(),m.sigBytes+=R-(m.sigBytes%R||R)},unpad:function(m){for(var S=m.words,R=m.sigBytes-1,R=m.sigBytes-1;R>=0;R--)if(S[R>>>2]>>>24-R%4*8&255){m.sigBytes=R+1;break}}},P.pad.ZeroPadding})},LdHM:function(I,q,M){"use strict";M.d(q,"b",function(){return u}),M.d(q,"a",function(){return v});var P=M("1OyB"),m=M("vuIU"),S=M("Ji7U"),R=M("LK+K"),T=M("q1tI"),g=M("rePB"),C=M("Ff2n"),p=M("ODXe"),s=M("4IlW"),a=M("bX4T"),r=M("YrtM"),h=M("TSYQ"),d=M.n(h),f=M("+nKL"),E=M("8OUc"),y=function(W,te){var de=W.prefixCls,fe=W.id,be=W.flattenOptions,Ce=W.childrenAsData,ue=W.values,ge=W.searchValue,pe=W.multiple,oe=W.defaultActiveFirstOption,ae=W.height,re=W.itemHeight,he=W.notFoundContent,Q=W.open,ie=W.menuItemSelectedIcon,we=W.virtual,ne=W.onSelect,J=W.onToggleOpen,V=W.onActiveValue,Z=W.onScroll,Ee=W.onMouseEnter,xe="".concat(de,"-item"),_e=Object(r.a)(function(){return be},[Q,be],function($e,Ie){return Ie[0]&&$e[1]!==Ie[1]}),Ne=T.useRef(null),Be=function(Ie){Ie.preventDefault()},We=function(Ie){Ne.current&&Ne.current.scrollTo({index:Ie})},Ue=function(Ie){for(var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Le=_e.length,Te=0;Te<Le;Te+=1){var Ae=(Ie+Te*Oe+Le)%Le,De=_e[Ae],Me=De.group,Fe=De.data;if(!Me&&!Fe.disabled)return Ae}return-1},ze=T.useState(function(){return Ue(0)}),Ke=Object(p.a)(ze,2),Ye=Ke[0],Re=Ke[1],tt=function(Ie){Re(Ie);var Oe=_e[Ie];if(!Oe){V(null,-1);return}V(Oe.data.value,Ie)};T.useEffect(function(){tt(oe!==!1?Ue(0):-1)},[_e.length,ge]),T.useEffect(function(){var $e=setTimeout(function(){if(!pe&&Q&&ue.size===1){var Ie=Array.from(ue)[0],Oe=_e.findIndex(function(Le){var Te=Le.data;return Te.value===Ie});tt(Oe),We(Oe)}});return function(){return clearTimeout($e)}},[Q]);var rt=function(Ie){Ie!==void 0&&ne(Ie,{selected:!ue.has(Ie)}),pe||J(!1)};if(T.useImperativeHandle(te,function(){return{onKeyDown:function(Ie){var Oe=Ie.which;switch(Oe){case s.a.UP:case s.a.DOWN:{var Le=0;if(Oe===s.a.UP?Le=-1:Oe===s.a.DOWN&&(Le=1),Le!==0){var Te=Ue(Ye+Le,Le);We(Te),tt(Te)}break}case s.a.ENTER:{var Ae=_e[Ye];Ae&&!Ae.data.disabled?rt(Ae.data.value):rt(void 0),Q&&Ie.preventDefault();break}case s.a.ESC:J(!1)}},onKeyUp:function(){},scrollTo:function(Ie){We(Ie)}}}),_e.length===0)return T.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(xe,"-empty"),onMouseDown:Be},he);function He($e){var Ie=_e[$e];if(!Ie)return null;var Oe=Ie.data||{},Le=Oe.value,Te=Oe.label,Ae=Oe.children,De=Object(a.a)(Oe,!0),Me=Ce?Ae:Te;return Ie?T.createElement("div",Object.assign({"aria-label":typeof Me=="string"?Me:null},De,{key:$e,role:"option",id:"".concat(fe,"_list_").concat($e),"aria-selected":ue.has(Le)}),Le):null}return T.createElement(T.Fragment,null,T.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},He(Ye-1),He(Ye),He(Ye+1)),T.createElement(f.a,{itemKey:"key",ref:Ne,data:_e,height:ae,itemHeight:re,fullHeight:!1,onMouseDown:Be,onScroll:Z,virtual:we,onMouseEnter:Ee},function($e,Ie){var Oe,Le=$e.group,Te=$e.groupOption,Ae=$e.data,De=Ae.label,Me=Ae.key;if(Le)return T.createElement("div",{className:d()(xe,"".concat(xe,"-group"))},De!==void 0?De:Me);var Fe=Ae.disabled,Xe=Ae.value,qe=Ae.title,pt=Ae.children,at=Ae.style,ft=Ae.className,Et=Object(C.a)(Ae,["disabled","value","title","children","style","className"]),xt=ue.has(Xe),lt="".concat(xe,"-option"),Wt=d()(xe,lt,ft,(Oe={},Object(g.a)(Oe,"".concat(lt,"-grouped"),Te),Object(g.a)(Oe,"".concat(lt,"-active"),Ye===Ie&&!Fe),Object(g.a)(Oe,"".concat(lt,"-disabled"),Fe),Object(g.a)(Oe,"".concat(lt,"-selected"),xt),Oe)),It=Ce?pt:De,ir=!ie||typeof ie=="function"||xt;return T.createElement("div",Object.assign({},Et,{"aria-selected":xt,className:Wt,title:qe,onMouseMove:function(){if(Ye===Ie||Fe)return;tt(Ie)},onClick:function(){Fe||rt(Xe)},style:at}),T.createElement("div",{className:"".concat(lt,"-content")},It||Xe),T.isValidElement(ie)||xt,ir&&T.createElement(E.a,{className:"".concat(xe,"-option-state"),customizeIcon:ie,customizeIconProps:{isSelected:xt}},xt?"\u2713":null))}))},l=T.forwardRef(y);l.displayName="OptionList";var n=l,o=function(){return null};o.isSelectOption=!0;var u=o,w=function(){return null};w.isSelectOptGroup=!0;var v=w,i=M("VTBJ"),k=M("Zm9Q");function D(B){var W=B.key,te=B.props,de=te.children,fe=te.value,be=Object(C.a)(te,["children","value"]);return Object(i.a)({key:W,value:fe!==void 0?fe:W,children:de},be)}function c(B){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(k.a)(B).map(function(te,de){if(!T.isValidElement(te)||!te.type)return null;var fe=te.type.isSelectOptGroup,be=te.key,Ce=te.props,ue=Ce.children,ge=Object(C.a)(Ce,["children"]);return W||!fe?D(te):Object(i.a)(Object(i.a)({key:"__RC_SELECT_GRP__".concat(be===null?de:be,"__"),label:be},ge),{},{options:c(ue)})}).filter(function(te){return te})}var b=M("2Qr1"),x=M("qNPg"),_=M("U8pU"),j=M("Kwbf"),F=M("WKfj");function L(B){var W=B.mode,te=B.options,de=B.children,fe=B.backfill,be=B.allowClear,Ce=B.placeholder,ue=B.getInputElement,ge=B.showSearch,pe=B.onSearch,oe=B.defaultOpen,ae=B.autoFocus,re=B.labelInValue,he=B.value,Q=B.inputValue,ie=B.optionLabelProp,we=W==="multiple"||W==="tags",ne=ge!==void 0?ge:we||W==="combobox",J=te||c(de);if(Object(j.a)(W!=="tags"||J.every(function(xe){return!xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var V=J.some(function(xe){return xe.options?xe.options.some(function(_e){return typeof("value"in _e?_e.value:_e.key)=="number"}):typeof("value"in xe?xe.value:xe.key)=="number"});Object(j.a)(!V,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(j.a)(W!=="combobox"||!ie,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(j.a)(W==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(j.a)(W==="combobox"||!ue,"`getInputElement` only work with `combobox` mode."),Object(j.b)(W!=="combobox"||!ue||!be||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),pe&&!ne&&W!=="combobox"&&W!=="tags"&&Object(j.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(j.b)(!oe||ae,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),he!=null){var Z=Object(F.d)(he);Object(j.a)(!re||Z.every(function(xe){return Object(_.a)(xe)==="object"&&("key"in xe||"value"in xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(j.a)(!we||Array.isArray(he),"`value` should be array when `mode` is `multiple` or `tags`")}if(de){var Ee=null;Object(k.a)(de).some(function(xe){if(!T.isValidElement(xe)||!xe.type)return!1;var _e=xe.type;if(_e.isSelectOption)return!1;if(_e.isSelectOptGroup){var Ne=Object(k.a)(xe.props.children).every(function(Be){return!T.isValidElement(Be)||!xe.type||Be.type.isSelectOption?!0:(Ee=Be.type,!1)});return!Ne}return Ee=_e,!0}),Ee&&Object(j.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ee.displayName||Ee.name||Ee,"`.")),Object(j.a)(Q===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var X=L,z=Object(x.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:c,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:X,fillOptionsWithMissingValue:b.a}),H=function(B){Object(S.a)(te,B);var W=Object(R.a)(te);function te(){var de;return Object(P.a)(this,te),de=W.apply(this,arguments),de.selectRef=T.createRef(),de.focus=function(){de.selectRef.current.focus()},de.blur=function(){de.selectRef.current.blur()},de}return Object(m.a)(te,[{key:"render",value:function(){return T.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),te}(T.Component);H.Option=u,H.OptGroup=v;var G=H,U=q.c=G},M8RZ:function(I,q,M){"use strict";M.d(q,"a",function(){return s});var P=M("fWQN"),m=M("mtLc"),S=M("yKVA"),R=M("879j"),T=M("q1tI"),g=M.n(T),C=M("i8i4"),p=M.n(C),s=function(a){Object(S.a)(h,a);var r=Object(R.a)(h);function h(d){var f;Object(P.a)(this,h),f=r.call(this,d);var E=window.document;return f.node=E.createElement("div"),E.body.appendChild(f.node),f}return Object(m.a)(h,[{key:"render",value:function(){var f=this.props.children;return Object(C.createPortal)(f,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),h}(g.a.Component)},MFOe:function(I,q,M){(function(P){var m=g(),S=C(),R=p(),T=typeof window!="undefined"?window:P;I.exports={assign:m,create:S,trim:R,bind:s,slice:a,each:r,map:h,pluck:d,isList:f,isFunction:E,isObject:y,Global:T};function g(){return Object.assign?Object.assign:function(n,o,u,w){for(var v=1;v<arguments.length;v++)r(Object(arguments[v]),function(i,k){n[k]=i});return n}}function C(){if(Object.create)return function(o,u,w,v){var i=a(arguments,1);return m.apply(this,[Object.create(o)].concat(i))};{function l(){}return function(o,u,w,v){var i=a(arguments,1);return l.prototype=o,m.apply(this,[new l].concat(i))}}}function p(){return String.prototype.trim?function(n){return String.prototype.trim.call(n)}:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function s(l,n){return function(){return n.apply(l,Array.prototype.slice.call(arguments,0))}}function a(l,n){return Array.prototype.slice.call(l,n||0)}function r(l,n){d(l,function(o,u){return n(o,u),!1})}function h(l,n){var o=f(l)?[]:{};return d(l,function(u,w){return o[w]=n(u,w),!1}),o}function d(l,n){if(f(l)){for(var o=0;o<l.length;o++)if(n(l[o],o))return l[o]}else for(var u in l)if(l.hasOwnProperty(u)&&n(l[u],u))return l[u]}function f(l){return l!=null&&typeof l!="function"&&typeof l.length=="number"}function E(l){return l&&{}.toString.call(l)==="[object Function]"}function y(l){return l&&{}.toString.call(l)==="[object Object]"}}).call(this,M("IyRk"))},MlIO:function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){return function(m){var S=P,R=S.lib,T=R.Base,g=R.WordArray,C=S.x64={},p=C.Word=T.extend({init:function(a,r){this.high=a,this.low=r}}),s=C.WordArray=T.extend({init:function(a,r){a=this.words=a||[],r!=m?this.sigBytes=r:this.sigBytes=a.length*8},toX32:function(){for(var a=this.words,r=a.length,h=[],d=0;d<r;d++){var f=a[d];h.push(f.high),h.push(f.low)}return g.create(h,this.sigBytes)},clone:function(){for(var a=T.clone.call(this),r=a.words=this.words.slice(0),h=r.length,d=0;d<h;d++)r[d]=r[d].clone();return a}})}(),P})},NFKh:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("MlIO"),M("F+F2"),M("qM6L"),M("ETIr"),M("wbyO"),M("cv67"),M("3y9D"),M("lPiR"),M("GRuw"),M("1uat"),M("uGsb"),M("5hvy"),M("ELcG"),M("WYAk"),M("e7zE"),M("K3mO"),M("OLod"),M("ALsQ"),M("9OqN"),M("qu8F"),M("S6kV"),M("gb/T"),M("qBft"),M("oRuE"),M("jO9C"),M("KmYQ"),M("uGxW"),M("bQjk"),M("wZgz"),M("pA7S"),M("w7YG"),M("E4JC"),M("PVpz"))})(this,function(P){return P})},NvD2:function(I,q,M){"use strict";M.d(q,"a",function(){return g});var P=M("Kwbf");function m(C,p){var s=new Set;return C.forEach(function(a){p.has(a)||s.add(a)}),s}function S(C){var p=C||{},s=p.disabled,a=p.disableCheckbox,r=p.checkable;return!!(s||a)||r===!1}function R(C,p,s,a){for(var r=new Set(C),h=new Set,d=0;d<=s;d+=1){var f=p.get(d)||new Set;f.forEach(function(n){var o=n.key,u=n.node,w=n.children,v=w===void 0?[]:w;r.has(o)&&!a(u)&&v.filter(function(i){return!a(i.node)}).forEach(function(i){r.add(i.key)})})}for(var E=new Set,y=s;y>=0;y-=1){var l=p.get(y)||new Set;l.forEach(function(n){var o=n.parent,u=n.node;if(a(u)||!n.parent||E.has(n.parent.key))return;if(a(n.parent.node)){E.add(o.key);return}var w=!0,v=!1;(o.children||[]).filter(function(i){return!a(i.node)}).forEach(function(i){var k=i.key,D=r.has(k);w&&!D&&(w=!1),!v&&(D||h.has(k))&&(v=!0)}),w&&r.add(o.key),v&&h.add(o.key),E.add(o.key)})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(m(h,r))}}function T(C,p,s,a,r){for(var h=new Set(C),d=new Set(p),f=0;f<=a;f+=1){var E=s.get(f)||new Set;E.forEach(function(o){var u=o.key,w=o.node,v=o.children,i=v===void 0?[]:v;!h.has(u)&&!d.has(u)&&!r(w)&&i.filter(function(k){return!r(k.node)}).forEach(function(k){h.delete(k.key)})})}d=new Set;for(var y=new Set,l=a;l>=0;l-=1){var n=s.get(l)||new Set;n.forEach(function(o){var u=o.parent,w=o.node;if(r(w)||!o.parent||y.has(o.parent.key))return;if(r(o.parent.node)){y.add(u.key);return}var v=!0,i=!1;(u.children||[]).filter(function(k){return!r(k.node)}).forEach(function(k){var D=k.key,c=h.has(D);v&&!c&&(v=!1),!i&&(c||d.has(D))&&(i=!0)}),v||h.delete(u.key),i&&d.add(u.key),y.add(u.key)})}return{checkedKeys:Array.from(h),halfCheckedKeys:Array.from(m(d,h))}}function g(C,p,s,a){var r=[],h;a?h=a:h=S;var d=new Set(C.filter(function(l){var n=!!s[l];return n||r.push(l),n})),f=new Map,E=0;Object.keys(s).forEach(function(l){var n=s[l],o=n.level,u=f.get(o);u||(u=new Set,f.set(o,u)),u.add(n),E=Math.max(E,o)}),Object(P.a)(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var y;return p===!0?y=R(d,f,E,h):y=T(d,p.halfCheckedKeys,f,E,h),y}},OLES:function(I,q,M){"use strict";var P=M("U8pU"),m=M("VTBJ"),S=M("Ff2n"),R=M("q1tI"),T=M("uciX"),g=M("7ixt"),C=function(d){var f=d.overlay,E=d.prefixCls,y=d.id,l=d.overlayInnerStyle;return R.createElement("div",{className:"".concat(E,"-inner"),id:y,role:"tooltip",style:l},typeof f=="function"?f():f)},p=C,s=function(d,f){var E=d.overlayClassName,y=d.trigger,l=y===void 0?["hover"]:y,n=d.mouseEnterDelay,o=n===void 0?0:n,u=d.mouseLeaveDelay,w=u===void 0?.1:u,v=d.overlayStyle,i=d.prefixCls,k=i===void 0?"rc-tooltip":i,D=d.children,c=d.onVisibleChange,b=d.afterVisibleChange,x=d.transitionName,_=d.animation,j=d.placement,F=j===void 0?"right":j,L=d.align,X=L===void 0?{}:L,z=d.destroyTooltipOnHide,H=z===void 0?!1:z,G=d.defaultVisible,U=d.getTooltipContainer,B=d.overlayInnerStyle,W=Object(S.a)(d,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),te=Object(R.useRef)(null);Object(R.useImperativeHandle)(f,function(){return te.current});var de=Object(m.a)({},W);"visible"in d&&(de.popupVisible=d.visible);var fe=function(){var pe=d.arrowContent,oe=pe===void 0?null:pe,ae=d.overlay,re=d.id;return[R.createElement("div",{className:"".concat(k,"-arrow"),key:"arrow"},oe),R.createElement(p,{key:"content",prefixCls:k,id:re,overlay:ae,overlayInnerStyle:B})]},be=!1,Ce=!1;if(typeof H=="boolean")be=H;else if(H&&Object(P.a)(H)==="object"){var ue=H.keepParent;be=ue===!0,Ce=ue===!1}return R.createElement(T.a,Object.assign({popupClassName:E,prefixCls:k,popup:fe,action:l,builtinPlacements:g.a,popupPlacement:F,ref:te,popupAlign:X,getPopupContainer:U,onPopupVisibleChange:c,afterPopupVisibleChange:b,popupTransitionName:x,popupAnimation:_,defaultPopupVisible:G,destroyPopupOnHide:be,autoDestroy:Ce,mouseLeaveDelay:w,popupStyle:v,mouseEnterDelay:o},de),D)},a=Object(R.forwardRef)(s),r=q.a=a},OLod:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("K3mO"))})(this,function(P){P.lib.Cipher||function(m){var S=P,R=S.lib,T=R.Base,g=R.WordArray,C=R.BufferedBlockAlgorithm,p=S.enc,s=p.Utf8,a=p.Base64,r=S.algo,h=r.EvpKDF,d=R.Cipher=C.extend({cfg:T.extend(),createEncryptor:function(x,_){return this.create(this._ENC_XFORM_MODE,x,_)},createDecryptor:function(x,_){return this.create(this._DEC_XFORM_MODE,x,_)},init:function(x,_,j){this.cfg=this.cfg.extend(j),this._xformMode=x,this._key=_,this.reset()},reset:function(){C.reset.call(this),this._doReset()},process:function(x){return this._append(x),this._process()},finalize:function(x){x&&this._append(x);var _=this._doFinalize();return _},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function x(_){return typeof _=="string"?b:k}return function(_){return{encrypt:function(j,F,L){return x(F).encrypt(_,j,F,L)},decrypt:function(j,F,L){return x(F).decrypt(_,j,F,L)}}}}()}),f=R.StreamCipher=d.extend({_doFinalize:function(){var x=this._process(!0);return x},blockSize:1}),E=S.mode={},y=R.BlockCipherMode=T.extend({createEncryptor:function(x,_){return this.Encryptor.create(x,_)},createDecryptor:function(x,_){return this.Decryptor.create(x,_)},init:function(x,_){this._cipher=x,this._iv=_}}),l=E.CBC=function(){var x=y.extend();x.Encryptor=x.extend({processBlock:function(j,F){var L=this._cipher,X=L.blockSize;_.call(this,j,F,X),L.encryptBlock(j,F),this._prevBlock=j.slice(F,F+X)}}),x.Decryptor=x.extend({processBlock:function(j,F){var L=this._cipher,X=L.blockSize,z=j.slice(F,F+X);L.decryptBlock(j,F),_.call(this,j,F,X),this._prevBlock=z}});function _(j,F,L){var X,z=this._iv;z?(X=z,this._iv=m):X=this._prevBlock;for(var H=0;H<L;H++)j[F+H]^=X[H]}return x}(),n=S.pad={},o=n.Pkcs7={pad:function(x,_){for(var j=_*4,F=j-x.sigBytes%j,L=F<<24|F<<16|F<<8|F,X=[],z=0;z<F;z+=4)X.push(L);var H=g.create(X,F);x.concat(H)},unpad:function(x){var _=x.words[x.sigBytes-1>>>2]&255;x.sigBytes-=_}},u=R.BlockCipher=d.extend({cfg:d.cfg.extend({mode:l,padding:o}),reset:function(){var x;d.reset.call(this);var _=this.cfg,j=_.iv,F=_.mode;this._xformMode==this._ENC_XFORM_MODE?x=F.createEncryptor:(x=F.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==x?this._mode.init(this,j&&j.words):(this._mode=x.call(F,this,j&&j.words),this._mode.__creator=x)},_doProcessBlock:function(x,_){this._mode.processBlock(x,_)},_doFinalize:function(){var x,_=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(_.pad(this._data,this.blockSize),x=this._process(!0)):(x=this._process(!0),_.unpad(x)),x},blockSize:128/32}),w=R.CipherParams=T.extend({init:function(x){this.mixIn(x)},toString:function(x){return(x||this.formatter).stringify(this)}}),v=S.format={},i=v.OpenSSL={stringify:function(x){var _,j=x.ciphertext,F=x.salt;return F?_=g.create([1398893684,1701076831]).concat(F).concat(j):_=j,_.toString(a)},parse:function(x){var _,j=a.parse(x),F=j.words;return F[0]==1398893684&&F[1]==1701076831&&(_=g.create(F.slice(2,4)),F.splice(0,4),j.sigBytes-=16),w.create({ciphertext:j,salt:_})}},k=R.SerializableCipher=T.extend({cfg:T.extend({format:i}),encrypt:function(x,_,j,F){F=this.cfg.extend(F);var L=x.createEncryptor(j,F),X=L.finalize(_),z=L.cfg;return w.create({ciphertext:X,key:j,iv:z.iv,algorithm:x,mode:z.mode,padding:z.padding,blockSize:x.blockSize,formatter:F.format})},decrypt:function(x,_,j,F){F=this.cfg.extend(F),_=this._parse(_,F.format);var L=x.createDecryptor(j,F).finalize(_.ciphertext);return L},_parse:function(x,_){return typeof x=="string"?_.parse(x,this):x}}),D=S.kdf={},c=D.OpenSSL={execute:function(x,_,j,F){F||(F=g.random(64/8));var L=h.create({keySize:_+j}).compute(x,F),X=g.create(L.words.slice(_),j*4);return L.sigBytes=_*4,w.create({key:L,iv:X,salt:F})}},b=R.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:c}),encrypt:function(x,_,j,F){F=this.cfg.extend(F);var L=F.kdf.execute(j,x.keySize,x.ivSize);F.iv=L.iv;var X=k.encrypt.call(this,x,_,L.key,F);return X.mixIn(L),X},decrypt:function(x,_,j,F){F=this.cfg.extend(F),_=this._parse(_,F.format);var L=F.kdf.execute(j,x.keySize,x.ivSize,_.salt);F.iv=L.iv;var X=k.decrypt.call(this,x,_,L.key,F);return X}})}()})},OZM5:function(I,q,M){"use strict";M.d(q,"b",function(){return a}),M.d(q,"a",function(){return r}),M.d(q,"k",function(){return h}),M.d(q,"h",function(){return d}),M.d(q,"i",function(){return f}),M.d(q,"g",function(){return E}),M.d(q,"c",function(){return y}),M.d(q,"d",function(){return l}),M.d(q,"j",function(){return u}),M.d(q,"e",function(){return w}),M.d(q,"f",function(){return v});var P=M("KQm4"),m=M("U8pU"),S=M("Ff2n"),R=M("q1tI"),T=M.n(R),g=M("Kwbf"),C=M("WaYH"),p=.25,s=2;function a(i,k){var D=i.slice(),c=D.indexOf(k);return c>=0&&D.splice(c,1),D}function r(i,k){var D=i.slice();return D.indexOf(k)===-1&&D.push(k),D}function h(i){return i.split("-")}function d(i,k){return"".concat(i,"-").concat(k)}function f(i){return i&&i.type&&i.type.isTreeNode}function E(i,k){var D=[i],c=k[i];function b(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];x.forEach(function(_){var j=_.key,F=_.children;D.push(j),b(F)})}return b(c.children),D}function y(i,k){var D=i.clientY,c=k.selectHandle.getBoundingClientRect(),b=c.top,x=c.bottom,_=c.height,j=Math.max(_*p,s);return D<=b+j?-1:D>=x-j?1:0}function l(i,k){if(!i)return;var D=k.multiple;return D?i.slice():i.length?[i[0]]:i}var n=function(k){return k};function o(i,k){if(!i)return[];var D=k||{},c=D.processProps,b=c===void 0?n:c,x=Array.isArray(i)?i:[i];return x.map(function(_){var j=_.children,F=Object(S.a)(_,["children"]),L=o(j,k);return T.a.createElement(C.a,Object.assign({},b(F)),L)})}function u(i){if(!i)return null;var k;if(Array.isArray(i))k={checkedKeys:i,halfCheckedKeys:void 0};else if(Object(m.a)(i)==="object")k={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return Object(g.a)(!1,"`checkedKeys` is not an array or an object"),null;return k}function w(i,k){var D=new Set;function c(b){if(D.has(b))return;var x=k[b];if(!x)return;D.add(b);var _=x.parent,j=x.node;if(j.disabled)return;_&&c(_.key)}return(i||[]).forEach(function(b){c(b)}),Object(P.a)(D)}function v(i){var k={};return Object.keys(i).forEach(function(D){(D.startsWith("data-")||D.startsWith("aria-"))&&(k[D]=i[D])}),k}},Ot1p:function(I,q,M){"use strict";var P=M("2qtc"),m=M("kLXV"),S=M("rAM+"),R=M("miYZ"),T=M("tsqr"),g=M("9og8"),C=M("tJVT"),p=M("jrin"),s=M("WmNS"),a=M.n(s),r=M("q1tI"),h=M.n(r),d=M("VrN/"),f=M.n(d),E=M("bdgK"),y=M("p77/"),l=M("Bd2K"),n=M("ELLl"),o=M("19Vz"),u=M("lZu9"),w=M("+NIl"),v=M("kSUc"),i=M("9Bee"),k=function(Fe){var Xe=Fe.value,qe=Xe===void 0?"":Xe,pt=Fe.className,at=Fe.showTextOnly,ft=Fe.showLines,Et=Fe.style,xt=Et===void 0?{}:Et,lt=Object(r.useMemo)(function(){return""},[qe]);return h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{dangerouslySetInnerHTML:{__html:lt}}))},D=M("0Owb"),c=M("dejd"),b=M("C+DQ"),x=M("1vsH"),_=M("m3rI"),j=[{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 F(Fe){var Xe=Fe.onActionCallback,qe=Fe.title,pt=Fe.icon,at=Fe.actionName,ft=Fe.className,Et=ft===void 0?"":ft,xt=Fe.children;function lt(){Xe(at)}return h.a.createElement("a",{title:qe,className:Et,onClick:lt},h.a.createElement("i",{className:"md-iconfont ".concat(pt)}),xt)}var L=function(Fe){var Xe=Fe.watch,qe=Fe.showNullButton,pt=Fe.onActionCallback,at=Fe.fullScreen,ft=Fe.insertTemp,Et=Fe.hidetoolBar,xt=Fe.uuid,lt=Fe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(xt,"&api=").concat(encodeURIComponent(_.a.PROXY_SERVER)));var Wt=[].concat(j,[{title:"".concat(Xe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Xe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return h.a.createElement("ul",{className:"markdown-toolbar-container"},!Et&&Wt.map(function(It,ir){return h.a.createElement("li",{key:ir},It.actionName?h.a.createElement(F,Object(D.a)({},It,{onActionCallback:pt})):h.a.createElement("span",{className:"v-line"}))}),qe?h.a.createElement("li",null,h.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:pt},h.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&h.a.createElement("li",null,h.a.createElement(F,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:pt},h.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),h.a.createElement("li",{className:"btn-full-screen"},h.a.createElement(F,{icon:"".concat(at?"icon-shrink":"icon-enlarge"),title:at?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:pt})))},X=M("M8RZ"),z=M("+L6B"),H=M("2/Rp"),G=M("y8nQ"),U=M("Vl3Y"),B=M("5NDa"),W=M("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},de=function(Fe){var Xe=Fe.callback,qe=Fe.onCancel;function pt(at){Xe(at)}return h.a.createElement(U.a,Object(D.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:pt}),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},h.a.createElement(W.a,null)),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},h.a.createElement(W.a,null)),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(H.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))},fe=M("7ahc"),be=M("HmJG"),Ce=M("BjJ7"),ue=U.a.useForm,ge={width:280,marginRight:10},pe={labelCol:{span:5},wrapperCol:{span:19}},oe=function(Fe){var Xe=Fe.callback,qe=Fe.onCancel,pt=ue(),at=Object(C.a)(pt,1),ft=at[0];function Et(Wt){Xe(Wt)}function xt(Wt,It){if(Wt.status===-1){T.b.error(Wt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Wt.id),type:It.type})}function lt(Wt){var It=Wt.target.files[0];re(It,xt)}return h.a.createElement(U.a,Object(D.a)({form:ft},pe,{className:"upload-image-panel",onFinish:Et}),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},h.a.createElement("div",{className:"flex-container"},h.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},h.a.createElement(W.a,{style:ge})),h.a.createElement(ae,{onFileChange:lt}))),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},h.a.createElement(W.a,{style:{width:264}})),h.a.createElement(U.a.Item,{style:{textAlign:"right"}},h.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(H.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))};function ae(Fe){var Xe=Fe.onFileChange;return h.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",h.a.createElement("input",{type:"file",onChange:Xe}))}function re(Fe,Xe){if(!Fe)throw new String("\u6CA1\u6709\u6587\u4EF6");var qe=new FormData;qe.append("editormd-image-file",Fe),qe.append("file_param_name","editormd-image-file"),qe.append("byxhr","true");var pt=new window.XMLHttpRequest;pt.withCredentials=!0,pt.addEventListener("load",function(at){Xe(JSON.parse(at.target.responseText),Fe)},!1),pt.addEventListener("error",function(at){console.error(at)},!1),pt.open("POST","".concat(Ce.a,"/api/attachments.json")),pt.send(qe)}var he=M("giR+"),Q=M("fyUT"),ie=M("7Kak"),we=M("9yH6"),ne=we.a.Group,J={margin:"0 8px"},V=function(Fe){var Xe=Fe.callback,qe=Fe.onCancel;function pt(at){Xe(at)}return h.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:pt},h.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},h.a.createElement("span",{style:J},"\u5355\u5143\u683C\u6570\uFF1A"),h.a.createElement("span",{style:J},"\u884C\u6570"),h.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},h.a.createElement(Q.a,null)),h.a.createElement("span",{style:J},"\u5217\u6570"),h.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},h.a.createElement(Q.a,null))),h.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},h.a.createElement("span",{style:J},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),h.a.createElement(U.a.Item,{name:"align"},h.a.createElement(ne,null,h.a.createElement(we.a,{value:"default"},h.a.createElement("i",{className:"fa fa-align-justify"})),h.a.createElement(we.a,{value:"left"},h.a.createElement("i",{className:"fa fa-align-left"})),h.a.createElement(we.a,{value:"center"},h.a.createElement("i",{className:"fa fa-align-center"})),h.a.createElement(we.a,{value:"right"},h.a.createElement("i",{className:"fa fa-align-right"}))))),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(H.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))},Z=M("ErOA"),Ee=M("7Cbv"),xe="link",_e="upload-image",Ne="code-block",Be="add-table",We="------------",Ue={default:We,left:":".concat(We),center:":".concat(We,":"),right:"".concat(We,":")},ze=M("9VGf"),Ke,Ye;function Re(){}var tt=0,rt=1e4,He="\u2581",$e=`
**\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 Ie(Fe){return/^\d+$/.test(Fe)?"".concat(Fe,"px"):Fe}var Oe=navigator.platform.toUpperCase().indexOf("MAC")>=0,Le=Oe?"Cmd":"Ctrl",Te=["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"],Ae=(Ke={},Object(p.a)(Ke,Le+"-B","bold"),Object(p.a)(Ke,Le+"-I","italic"),Ke),De=(Ye={},Object(p.a)(Ye,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(p.a)(Ye,Ne,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(p.a)(Ye,_e,"\u6DFB\u52A0\u6587\u4EF6"),Object(p.a)(Ye,Be,"\u6DFB\u52A0\u8868\u683C"),Ye),Me=q.a=function(Fe){var Xe=Fe.defaultValue,qe=Xe===void 0?"":Xe,pt=Fe.onChange,at=Fe.width,ft=at===void 0?"100%":at,Et=Fe.height,xt=Et===void 0?400:Et,lt=Fe.miniToolbar,Wt=lt===void 0?!1:lt,It=Fe.isFocus,ir=It===void 0?!1:It,$t=Fe.watch,At=Fe.insertTemp,Rt=Fe.mode,hr=Rt===void 0?"markdown":Rt,St=Fe.id,Je=St===void 0?"markdown-editor-id":St,dt=Fe.showResizeBar,Ct=dt===void 0?!1:dt,Xt=Fe.noStorage,Jt=Xt===void 0?!1:Xt,Mt=Fe.showNullButton,Pt=Mt===void 0?!1:Mt,gt=Fe.hidetoolBar,Bt=gt===void 0?!1:gt,fr=Fe.fullScreen,ar=fr===void 0?!1:fr,Gt=Fe.onBlur,mr=Fe.onCMBeforeChange,zt=Fe.onFullScreen,Ur=Fe.className,nt=Ur===void 0?"":Ur,kt=Fe.disablePaste,zr=kt===void 0?!1:kt,Pr=Fe.placeholder,Xr=Pr===void 0?"":Pr,Yr=Fe.values,ce=Yr===void 0?"":Yr,K=Object(r.useState)(null),Y=Object(C.a)(K,2),ee=Y[0],ye=Y[1],se=Object(r.useState)(qe),Pe=Object(C.a)(se,2),Ze=Pe[0],mt=Pe[1],Tt=Object(r.useState)($t),et=Object(C.a)(Tt,2),Dt=et[0],Zt=et[1],Yt=Object(r.useState)(ar),Cr=Object(C.a)(Yt,2),Tr=Cr[0],_r=Cr[1],en=Object(r.useState)(""),Rn=Object(C.a)(en,2),gr=Rn[0],$r=Rn[1],mn=Object(r.useState)(0),gn=Object(C.a)(mn,2),jr=gn[0],Ar=gn[1],rr=Object(r.useState)(xt),br=Object(C.a)(rr,2),Or=br[0],Jr=br[1],tn=Object(r.useState)(!1),rn=Object(C.a)(tn,2),li=rn[0],Ln=rn[1],vr=Object(r.useRef)(Object(Ee.a)()),tr=Object(r.useRef)(!1),Dr=Object(r.useRef)(),er=Object(r.useRef)(),wr=Object(r.useRef)(),nr=Object(r.useRef)(),Cn=Object(r.useRef)(),Ir=function(){var Lt=Object(g.a)(a.a.mark(function Ht(){var Ft,Qt;return a.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.next=2,Object(Z.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:vr.current}});case 2:Qt=ot.sent,Qt!=null&&(Ft=Qt.attachments)!==null&&Ft!==void 0&&Ft.length&&(console.log("cm:",ee,er),Qt.attachments.map(function(ut){ut.content_type.indexOf("image")>-1?ee.replaceSelection("![,](/api/attachments/".concat(ut.id,"?type=").concat(ut.content_type,")")):ut.content_type.indexOf("video")>-1?ee.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):ut.content_type.indexOf("pdf")>-1?ee.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,"?type=").concat(ut.content_type,'&disposition=inline" target="_blank">').concat(ut.name,"</a>")):ee.replaceSelection("[".concat(ut.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,"?type=").concat(ut.content_type,")"))}));case 4:case"end":return ot.stop()}},Ht)}));return function(){return Lt.apply(this,arguments)}}();Object(r.useEffect)(function(){mt(ce),ee==null||ee.setValue(ce)},[ce]),Object(r.useEffect)(function(){zt==null||zt(Tr)},[Tr]),Object(r.useEffect)(function(){if(er.current){var Lt=f.a.fromTextArea(er.current,{mode:hr,lineNumbers:!Wt,lineWrapping:!0,value:qe,autoCloseTags:!0,autoCloseBrackets:!0});ir&&Lt.focus();function Ht(Ft,Qt){if(zr){Qt.preventDefault();return}var ct=Qt.clipboardData;if(ct){var ot=ct.types.toString(),ut=ct.items;if(ot==="Files"||ct.types.indexOf("Files")>-1){if(Qt.preventDefault(),hr=="stex")return;try{var wt,Nt=ut[1];((wt=ut[0])===null||wt===void 0?void 0:wt.kind)==="file"&&(Nt=ut[0]);var st=Nt.getAsFile(),Kt=st.name.split(".").pop();re(st,function(vt){if(vt.id){var or,ur,xr;(st==null||((or=st.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?Lt.replaceSelection("![,](/api/attachments/".concat(vt.id,"?type=").concat(vt.content_type,")")):(st==null||((ur=st.type)===null||ur===void 0)?void 0:ur.indexOf("video"))>-1?Lt.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,'"></video>')):(st==null||((xr=st.type)===null||xr===void 0)?void 0:xr.indexOf("pdf"))>-1?Lt.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(st.type,'&disposition=inline" target="_blank">').concat(st.name,"</a>")):Te.includes(Kt)?Lt.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,'?type=office&disposition=inline" target="_blank">').concat(st.name,"</a>")):Lt.replaceSelection("[".concat(st.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})}catch(vt){T.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Lt.on("paste",Ht),Lt.on("dragleave",function(Ft,Qt){wr.current.classList.remove("mouse-hover-md")}),Lt.on("dragover",function(Ft,Qt){wr.current.classList.add("mouse-hover-md")}),Lt.on("drop",function(Ft,Qt){wr.current.classList.add("mouse-hover-md");var ct;if(ct=Qt.dataTransfer.files,ct.length>0){Qt.preventDefault(),Qt.stopPropagation();for(var ot=function(Nt){var st=ct[Nt],Kt=st.name.split(".").pop();re(st,function(vt){if(vt.id){var or,ur,xr;(st==null||((or=st.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?Lt.replaceSelection("![,](/api/attachments/".concat(vt.id,"?type=").concat(vt.content_type,")")):(st==null||((ur=st.type)===null||ur===void 0)?void 0:ur.indexOf("video"))>-1?Lt.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,'"></video>')):(st==null||((xr=st.type)===null||xr===void 0)?void 0:xr.indexOf("pdf"))>-1?Lt.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(st.type,'&disposition=inline" target="_blank">').concat(st.name,"</a>")):Te.includes(Kt)?Lt.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,'?type=office&disposition=inline" target="_blank">').concat(st.name,"</a>")):Lt.replaceSelection("[".concat(st.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})},ut=0;ut<ct.length;ut++)ot(ut)}}),ye(Lt),function(){Lt.off("paste",Ht)}}},[]);var Fr=Object(r.useCallback)(function(){if(wr.current)try{}catch(Lt){console.log(Lt,"---- to set md editor body height")}},[Or,wr,Tr]);Object(r.useEffect)(function(){function Lt(){var Ft=new E.default(function(Qt){var ct=Object(S.a)(Qt),ot;try{for(ct.s();!(ot=ct.n()).done;){var ut=ot.value;(ut.target.offsetHeight>0||ut.target.offsetWidth>0)&&(Fr(),ee.setSize("100%","100%"),ee.refresh())}}catch(wt){ct.e(wt)}finally{ct.f()}});return Ft.observe(er.current.parentElement),Ft}if(ee){var Ht=Lt();return function(){Ht.unobserve(er.current.parentElement)}}},[ee,Fr]),Object(r.useEffect)(function(){if(ee){for(var Lt=[],Ht=function(){var ut=Qt[Ft];ct=Object(C.a)(ut,2);var wt=ct[0],Nt=ct[1],st=Object(p.a)({},wt,function(){Bn(Nt)});Lt.push(st),ee.addKeyMap(st)},Ft=0,Qt=Object.entries(Ae);Ft<Qt.length;Ft++){var ct;Ht()}return Dr.current=setInterval(function(){tr.current&&Ir()},4e3),function(){clearInterval(Dr.current);var ot=Object(S.a)(Lt),ut;try{for(ot.s();!(ut=ot.n()).done;){var wt=ut.value;ee.removeKeyMap(wt)}}catch(Nt){ot.e(Nt)}finally{ot.f()}}}},[ee]),Object(r.useEffect)(function(){ar!==Tr&&_r(ar)},[ar]),Object(ze.a)(function(){if(!Jt&&jr>0){var Lt=new Date().getTime(),Ht=window.sessionStorage.getItem(Je);Lt>=jr+rt&&(!Ht||Ht!==Ze)&&(window.sessionStorage.setItem(Je,Ze),Ln(!0))}},rt),Object(r.useEffect)(function(){Zt($t)},[ee,$t]),Object(r.useEffect)(function(){ee&&(ir&&ee.focus())},[ee,ir]),Object(r.useEffect)(function(){if(Dt&&ee){var Lt=ee.getScrollerElement();function Ht(Ft){var Qt=Ft.target;if(Cn.current){var ct=Qt.scrollTop/Qt.scrollHeight;Cn.current.scrollTop=Cn.current.scrollHeight*ct}}return Lt.addEventListener("scroll",Ht),function(){Lt.removeEventListener("scroll",Ht)}}},[ee,Dt]),Object(r.useEffect)(function(){if(ee&&mr){function Lt(Ht,Ft){mr(Ht,Ft)}return ee.on("beforeChange",Lt),function(){ee.off("beforeChange",Lt)}}},[ee,mr]),Object(r.useEffect)(function(){if(ee&&Gt){function Lt(){Gt(ee.getValue())}return ee.on("blur",Lt),function(){ee.off("blur",Lt)}}},[ee,Gt]),Object(r.useEffect)(function(){if(ee){function Lt(Ht){var Ft=Ht.getValue();mt(Ft),Ar(new Date().getTime()),Ht.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),pt&&pt(Ft)}return ee.on("change",Lt),function(){ee.off("change",Lt)}}},[ee,pt]),Object(r.useEffect)(function(){ee&&(qe==null?(ee.setValue(""),mt("")):qe!==ee.getValue()&&(ee.setValue(qe),mt(qe),ee.setCursor(ee.lineCount(),0)))},[ee,qe]);var Bn=Object(r.useCallback)(function(Lt){var Ht=ee.getCursor(),Ft=ee.getSelection(),Qt=Ft.split(`
`);switch(Lt){case"bold":return ee.replaceSelection("**"+Ft+"**"),Ft===""&&ee.setCursor(Ht.line,Ht.ch+2),ee.focus();case"italic":return ee.replaceSelection("*"+Ft+"*"),Ft===""&&ee.setCursor(Ht.line,Ht.ch+1),ee.focus();case"code":return ee.replaceSelection("`"+Ft+"`"),Ft===""&&ee.setCursor(Ht.line,Ht.ch+1),ee.focus();case"inline-latex":return ee.replaceSelection("`$$"+Ft+"$$`"),Ft===""&&ee.setCursor(Ht.line,Ht.ch+3),ee.focus();case"latex":return ee.replaceSelection("```latex\n"+Ft+"\n```"),ee.setCursor(Ht.line+1,Ft.length+1),ee.focus();case"line-break":return ee.replaceSelection(`<br/>
`),ee.focus();case"list-ul":return Ft===""?ee.replaceSelection("- "+Ft):ee.replaceSelection(Qt.map(function(ct){return ct===""?"":"- ".concat(ct)}).join(`
`)),ee.focus();case"list-ol":return Ft===""?ee.replaceSelection("1. "+Ft):ee.replaceSelection(Qt.map(function(ct,ot){return ct===""?"":"".concat(ot+1,". ").concat(ct)}).join(`
`)),ee.focus();case"add-null-ch":return Ft===""&&ee.setCursor(Ht.line,Ht.ch+1),ee.replaceSelection(He),ee.focus();case"inster-template-1":return Ft===""&&ee.setCursor(Ht.line,Ht.ch),ee.replaceSelection($e),ee.focus();case"eraser":return ee.setValue(""),ee.focus();case"trigger-watch":return Zt(!Dt),ee.focus();case"trigger-full-screen":return _r(!Tr),ee.focus();case xe:$r(xe);return;case Ne:$r(Ne);return;case _e:$r(_e);return;case Be:$r(Be);return;default:throw new Error}},[ee,Dt,Tr]),Tn=Object(r.useCallback)(function(Lt){$r("");switch(gr){case xe:var Ht=Lt.title,Ft=Lt.link;return ee.replaceSelection("[".concat(Ht,"](").concat(Ft,")")),ee.focus();case Ne:var Qt=Lt.language,ct=Lt.content;return ee.replaceSelection(["```"+Qt,ct,"```"].join(`
`)),ee.focus();case _e:var ot=Lt.src,ut=Lt.alt;return ut?ee.replaceSelection("![ ".concat(ut," ]( ").concat(ot,' "').concat(ut,'" )')):ee.replaceSelection("![,](".concat(ot,")")),ee.focus();case Be:for(var wt=Lt.row,Nt=Lt.col,st=Lt.align,Kt=`
`,vt=0;vt<wt;vt++){for(var or=[],ur=[],xr=0;xr<Nt;xr++)vt===1&&ur.push(Ue[st]),or.push(" ");vt===1&&(Kt+="| ".concat(ur.join(" | "),` |
`)),Kt+="| ".concat(or.join(Nt===1?"":" | "),` |
`)}return ee.replaceSelection(Kt+`
`),ee.focus();default:throw new Error}},[ee,gr]),ui=Object(r.useMemo)(function(){switch(gr){case xe:return h.a.createElement(de,{callback:Tn,onCancel:Un});case Ne:return h.a.createElement(fe.b,{callback:Tn,onCancel:Un});case _e:return h.a.createElement(oe,{callback:Tn,onCancel:Un});case Be:return h.a.createElement(V,{callback:Tn,onCancel:Un});default:return null}},[gr]);function Un(){$r("")}Object(r.useEffect)(function(){if(nr.current){var Lt=nr.current,Ht=!1,Ft=0;function Qt(ut){Ht=!0,Ft=ut.pageY}function ct(){Ht=!1}function ot(ut){if(Ht){var wt=ut.pageY-Ft;wt<0&&(wt=0),wt>300&&(wt=300);var Nt=xt+wt+"px";Jr(Nt)}}return Lt.addEventListener("mousedown",Qt),document.addEventListener("mousemove",ot),document.addEventListener("mouseup",ct),function(){Lt.removeEventListener("mousedown",Qt),document.removeEventListener("mousemove",ot),document.removeEventListener("mouseup",ct)}}},[ee,nr]),Object(r.useEffect)(function(){Jr(xt)},[xt]);var _n=Ie(ft),ci=Ie(Or),vn={width:_n,height:ci},di=Object(r.useMemo)(function(){if(jr){var Lt=new Date(jr),Ht=Lt.getHours(),Ft=Lt.getMinutes(),Qt=Lt.getSeconds();return Ht=Ht<10?"0"+Ht:Ht,Ft=Ft<10?"0"+Ft:Ft,Qt=Qt<10?"0"+Qt:Qt,"".concat(Ht,":").concat(Ft,":").concat(Qt)}return 0},[jr]);function Ti(){window.sessionStorage.removeItem(Je),Ln(!1),Ar(0)}function Kn(){Ln(!1),Ar(0),ee.setValue(window.sessionStorage.getItem(Je))}function Xi(Lt,Ht){var Ft=ee.getValue();Ft=Ft.replace(Lt,Ht),mt(Ft),ee==null||ee.setValue(Ft)}return h.a.createElement(r.Fragment,null,h.a.createElement("div",{className:"markdown-editor-wrapper",ref:wr},h.a.createElement("div",{className:"markdown-editor-container ".concat(nt," ").concat(Dt?"on-preview":""," ").concat(Wt?"mini":""," ").concat(Tr?"full-screen":""),style:vn},h.a.createElement(L,{insertTemp:At,watch:Dt,fullScreen:Tr,showNullButton:Pt,onActionCallback:Bn,hidetoolBar:Bt,uuid:vr.current,setOpenPhones:function(){tr.current=!0}}),h.a.createElement("div",{className:"markdown-editor-body"},h.a.createElement("div",{className:"codemirror-container"},h.a.createElement("textarea",{ref:er,placeholder:Xr})),Dt?h.a.createElement("div",{ref:Cn,className:"preview-container"},hr==="stex"&&h.a.createElement(k,{value:Ze}),hr!=="stex"&&h.a.createElement(i.a,{edit:!0,value:Ze,replaces:Xi})):null))),Ct?h.a.createElement("a",{ref:nr,className:"editor-resize"}):null,h.a.createElement(X.a,null,De[gr]?h.a.createElement(m.a,{centered:!0,title:De[gr],visible:!0,onCancel:Un,footer:null,className:"markdown-popup-form"},ui):null))}},"P/tu":function(I,q,M){"use strict";var P=M("ozfa"),m=M("MJZm"),S=M("0Owb"),R=M("9og8"),T=M("tJVT"),g=M("PpiC"),C=M("WmNS"),p=M.n(C),s=M("q1tI"),a=M.n(s),r=M("WCUW"),h=M("spXi"),d=M.n(h),f=function(y){var l=y.value,n=y.onChange,o=y.defaultValue,u=y.disabled,w=Object(g.a)(y,["value","onChange","defaultValue","disabled"]),v=Object(s.useState)([]),i=Object(T.a)(v,2),k=i[0],D=i[1],c=Object(s.useState)("1"),b=Object(T.a)(c,2),x=b[0],_=b[1];Object(s.useEffect)(function(){j()},[]);var j=function(){var X=Object(R.a)(p.a.mark(function z(){var H,G;return p.a.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,Object(r.A)({});case 2:H=B.sent,H!=null&&H.data&&(G=[{title:a.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:d.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:a.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:F(H.data||[])}],D(G),_("2"));case 4:case"end":return B.stop()}},z)}));return function(){return X.apply(this,arguments)}}(),F=function(z){function H(G){var U=G.children,B=Array.isArray(U)&&U.length>0,W=G==null?void 0:G.group_id;return{title:a.a.createElement("div",{title:G==null?void 0:G.name,className:d.a.name},G==null?void 0:G.name),value:W,key:W,icon:a.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:B?U==null?void 0:U.map(function(te){return H(te)}):[]}}return z==null?void 0:z.map(function(G){return H(G)})},L=o?{defaultExpandedKeys:[0]}:{selectedKeys:l,defaultExpandedKeys:l};return a.a.createElement("div",{className:d.a.customTree},a.a.createElement(m.a,Object(S.a)({key:x},L,{showIcon:!0,treeData:k,onSelect:n,disabled:u},w)))};q.a=f},PD8m:function(I,q){I.exports={name:"memoryStorage",read:P,write:m,each:S,remove:R,clearAll:T};var M={};function P(g){return M[g]}function m(g,C){M[g]=C}function S(g){for(var C in M)M.hasOwnProperty(C)&&g(M[C],C)}function R(g){delete M[g]}function T(g){M={}}},PHyj:function(I,q,M){"use strict";M.r(q),M.d(q,"Types",function(){return At});var P=M("P2fV"),m=M("NJEC"),S=M("CiB2"),R=M("DYRE"),T=M("zeV3"),g=M("7Kak"),C=M("9yH6"),p=M("sRBo"),s=M("kaz8"),a=M("giR+"),r=M("fyUT"),h=M("6UJt"),d=M("DFOY"),f=M("OaEy"),E=M("2fM7"),y=M("rAM+"),l=M("T2oS"),n=M("W9HT"),o=M("+L6B"),u=M("2/Rp"),w=M("oBTY"),v=M("miYZ"),i=M("tsqr"),k=M("9og8"),D=M("y8nQ"),c=M("Vl3Y"),b=M("tJVT"),x=M("k1fw"),_=M("fu2T"),j=M("gK9i"),F=M("2qtc"),L=M("kLXV"),X=M("5NDa"),z=M("5rEg"),H=M("WmNS"),G=M.n(H),U=M("q1tI"),B=M.n(U),W=M("uMZB"),te=M.n(W),de=M("jrin"),fe,be=E.a.Option,Ce;(function(Je){Je[Je.language=0]="language",Je[Je.difficult=1]="difficult",Je[Je.category=2]="category",Je[Je.openOrNot=3]="openOrNot"})(Ce||(Ce={}));var ue=(fe={},Object(de.a)(fe,Ce.language,[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}]),Object(de.a)(fe,Ce.difficult,[{title:"\u7B80\u5355",key:1},{title:"\u4E2D\u7B49",key:2},{title:"\u56F0\u96BE",key:3}]),Object(de.a)(fe,Ce.category,[{title:"\u7A0B\u5E8F\u8BBE\u8BA1",key:1},{title:"\u7B97\u6CD5",key:2}]),Object(de.a)(fe,Ce.openOrNot,[{title:"\u516C\u5F00",key:1},{title:"\u79C1\u6709",key:0}]),fe);function ge(Je){return ue[Je].map(function(dt){return B.a.createElement(be,{key:dt.title,value:dt.key}," ",dt.title," ")})}function pe(Je,dt){Je.map(function(Ct){var Xt=Ct.id,Jt=Ct.name,Mt=Ct.sub_disciplines,Pt={value:Xt,label:Jt};dt.push(Pt),Mt&&Mt.length>0&&(Pt.children=[],pe(Mt,Pt.children))})}function oe(Je,dt){for(var Ct=[],Xt=0;Xt<Je.length;Xt++){var Jt,Mt=Je[Xt];if(((Jt=Mt.sub_disciplines)===null||Jt===void 0?void 0:Jt.length)>0){Ct[0]=Mt.id;for(var Pt=0;Pt<Mt.sub_disciplines.length;Pt++){var gt=Mt.sub_disciplines[Pt];if(gt.id===dt)return Ct[1]=gt.id,[Ct,gt.tag_disciplines||gt.sub_disciplines||[]]}}}return[Ct,[]]}var ae=M("Ty5D"),re=M("J66h"),he=M("GIiI"),Q=M("2BaD"),ie=M("Ot1p"),we=M("ErOA");function ne(){return Object(we.c)("problems/new.json")}function J(){var Je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"question";return Object(we.c)("disciplines.json",{source:Je})}function V(Je){return Object(we.c)("problems/".concat(Je,"/edit.json"))}function Z(Je,dt){return Object(we.g)("problems/".concat(Je,".json"),dt)}function Ee(Je){return Object(we.f)("problems.json",Je)}function xe(Je,dt){return Object(we.f)("exercises/".concat(Je,"/exercise_questions.json"),dt)}function _e(Je,dt){return Object(we.g)("exercise_questions/".concat(Je,".json"),dt)}function Ne(Je){return Object(we.f)("problems/".concat(Je,"/publish.json"))}function Be(Je){return Object(we.f)("problems/".concat(Je,"/cancel_publish.json"))}function We(Je){return Object(we.c)("problems/".concat(Je,"/start.json"))}function Ue(Je,dt){return Object(we.f)("tag_disciplines.json",{name:dt,sub_discipline_id:Je})}var ze=M("V0Rq"),Ke=M("cDPC"),Ye=M("EHPI"),Re=M("bbsP"),tt=M("/wGt"),rt=M("ZW9T"),He=M("ZD9Y"),$e=M("M8RZ"),Ie=M("bCnd"),Oe=M("b8wu"),Le=M.n(Oe),Te=M("LvDl"),Ae={theme:Object(Ie.a)("cmCodeMode","vs-dark"),fontSize:Object(Ie.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(Ie.a)("cmTabToSpace",!0)},De;(function(Je){Je[Je.set_font_size=0]="set_font_size",Je[Je.set_theme=1]="set_theme",Je[Je.on_tab_to_space=2]="on_tab_to_space",Je[Je.set_show_editor_setting=3]="set_show_editor_setting"})(De||(De={}));function Me(Je,dt){switch(dt.type){case De.set_show_editor_setting:return Object(x.a)(Object(x.a)({},Je),{},{showEditorSetting:dt.payload});case De.set_theme:return Object(x.a)(Object(x.a)({},Je),{},{theme:dt.payload});case De.set_font_size:return Object(x.a)(Object(x.a)({},Je),{},{fontSize:dt.payload});case De.on_tab_to_space:return Object(x.a)(Object(x.a)({},Je),{},{tabToSpace:dt.payload});default:throw new Error}}var Fe=function(Je){var dt,Ct=Je.isLoading,Xt=Je.value,Jt=Xt===void 0?[]:Xt,Mt=Je.onChange,Pt=Object(U.useReducer)(Me,Ae),gt=Object(b.a)(Pt,2),Bt=gt[0],fr=gt[1],ar=Bt.theme,Gt=Bt.fontSize,mr=Bt.showEditorSetting,zt=Bt.tabToSpace,Ur=Object(U.useState)("c"),nt=Object(b.a)(Ur,2),kt=nt[0],zr=nt[1],Pr=Object(U.useRef)([]);Object(U.useEffect)(function(){Jt!=null&&Jt.length&&(Pr.current=Object(Te.cloneDeep)(Jt))},[Jt]);var Xr={onFontSizeChange:function(ye){fr({type:De.set_font_size,payload:ye}),Object(Ie.b)("cmFontSize",ye)},tabToSpace:zt,cmFontSize:Gt,className:"oj",cmCodeMode:ar,onTabToSpace:function(ye){fr({type:De.on_tab_to_space,payload:ye}),Object(Ie.b)("cmTabToSpace",ye)},onCodeModeChange:function(ye){fr({type:De.set_theme,payload:ye}),Object(Ie.b)("cmCodeMode",ye)}};function Yr(){fr({type:De.set_show_editor_setting,payload:!1})}function ce(){fr({type:De.set_show_editor_setting,payload:!0})}function K(ee){var ye,se=(ye=Pr.current)===null||ye===void 0?void 0:ye.map(function(Pe){return Pe.language===kt&&(Pe.code=ee),Pe});Pr.current=Object(Te.cloneDeep)(se),Mt(se)}var Y={key:kt,value:Jt==null||((dt=Jt.find(function(ee){return ee.language===kt}))===null||dt===void 0)?void 0:dt.code,language:kt,onChange:K,theme:ar,height:"calc(100% - 56px)",options:{fontSize:Gt,insertSpaces:zt}};return B.a.createElement(U.Fragment,null,B.a.createElement("div",{className:Le.a["code-panel-container"]},B.a.createElement(Xe,{languageItems:Jt,onLanguage:function(ye){return zr(ye)},language:kt,onShowCodeSetting:ce}),!Ct&&B.a.createElement(rt.b,Y)),B.a.createElement($e.a,null,B.a.createElement(tt.a,{className:"oj",title:null,placement:"right",closable:!1,visible:mr,onClose:Yr},B.a.createElement(He.a,Xr))))};function Xe(Je){var dt=Je.languageItems,Ct=Je.language,Xt=Je.onShowCodeSetting,Jt=Je.onLanguage;return B.a.createElement("div",{className:Le.a["action-oj-bar"]},B.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),dt==null?void 0:dt.map(function(Mt){return B.a.createElement("div",{className:Ct===(Mt==null?void 0:Mt.language)?Le.a.active:"",onClick:function(){return Jt(Mt==null?void 0:Mt.language)},key:Mt==null?void 0:Mt.language},Mt==null?void 0:Mt.language)}),B.a.createElement("a",{onClick:Xt},B.a.createElement("i",{className:"iconfont icon-shezhi"})))}var qe=M("m3rI"),pt=M("u2Z1"),at=M("P/tu"),ft=M("B7Ph"),Et=M("vCeJ"),xt=M("hQp1"),lt=z.a.TextArea,Wt=L.a.confirm,It=j.a.Panel;function ir(){return new Date().getTime()}var $t={loading:!0,user:null,disciplines:[],dicts:null,status:0,data:void 0,lastedUpdateTime:0},At;(function(Je){Je[Je.SET_INITAL_DATA=0]="SET_INITAL_DATA",Je[Je.SET_LOADING=1]="SET_LOADING",Je[Je.SET_STATUS=2]="SET_STATUS"})(At||(At={}));function Rt(Je,dt){switch(dt.type){case At.SET_INITAL_DATA:return Object(x.a)(Object(x.a)({},Je),dt.payload);case At.SET_LOADING:return Object(x.a)(Object(x.a)({},Je),{},{loading:dt.payload});case At.SET_STATUS:return Object(x.a)(Object(x.a)({},Je),{},{status:dt.payload});default:throw new Error}}var hr=q.default=function(){var Je,dt,Ct=Object(ae.h)(),Xt=Object(ae.g)(),Jt=Object(ae.i)(),Mt=Jt.id,Pt=c.a.useForm(),gt=Object(b.a)(Pt,1),Bt=gt[0],fr=Object(U.useState)(),ar=Object(b.a)(fr,2),Gt=ar[0],mr=ar[1],zt=Object(U.useState)([]),Ur=Object(b.a)(zt,2),nt=Ur[0],kt=Ur[1],zr=Object(U.useState)([]),Pr=Object(b.a)(zr,2),Xr=Pr[0],Yr=Pr[1],ce=Object(U.useReducer)(Rt,$t),K=Object(b.a)(ce,2),Y=K[0],ee=K[1],ye=Y.loading,se=Y.data,Pe=Y.user,Ze=Y.disciplines,mt=Y.dicts,Tt=Y.status,et=se==null?void 0:se.hack_sets,Dt=se==null||((Je=se.hack)===null||Je===void 0)?void 0:Je.test_set_average,Zt=Ct.query,Yt=Zt.callback_url,Cr=Zt.express_id,Tr=Zt.score,_r=Zt.question_id,en=Zt.type,Rn=Object(U.useState)([]),gr=Object(b.a)(Rn,2),$r=gr[0],mn=gr[1],gn=Object(U.useState)(!1),jr=Object(b.a)(gn,2),Ar=jr[0],rr=jr[1],br=Object(U.useState)(!1),Or=Object(b.a)(br,2),Jr=Or[0],tn=Or[1],rn=en==="1",li=Object(U.useMemo)(function(){var ct=[];return Ze&&pe(Ze,ct),ct},[Ze]),Ln=Object(U.useCallback)(Object(k.a)(G.a.mark(function ct(){var ot,ut,wt,Nt,st,Kt,vt,or,ur,xr,kr,dn,Rr,sr,hi,Pn,yn,$n,Gn,fi,An,On,Jn,Wn,Zn,zn,Yi,Vt,cr,Vn,pi,Dn,bn,In,mi,$i,_i,Ji,Zi,Ai,xn,hn,Qi,Qn,Mn,xa,Ea,Oi,kn,qn,Di,ki=arguments;return G.a.wrap(function(Zr){for(;;)switch(Zr.prev=Zr.next){case 0:if(ot=ki.length>0&&ki[0]!==void 0?ki[0]:0,ut=Ze,!(ut.length===0)){Zr.next=7;break}return Zr.next=5,J("new_question");case 5:wt=Zr.sent,ut=wt.disciplines;case 7:if(!Mt){Zr.next=15;break}return Nt={disciplines:ut},Zr.next=11,V(Mt);case 11:st=Zr.sent,st.message?st.status==="401"&&(document.location.href="/user/login"):(Kt=st.category,vt=st.user,or=st.code,ur=st.language,xr=st.hack_sets,kr=st.description,dn=st.difficult,Rr=st.name,sr=st.open_or_not,hi=st.sub_discipline_id,Pn=st.tag_discipline_id,yn=st.time_limit,$n=st.test_set_average,Gn=st.test_set_score,fi=st.status,An=st.tag_discipline_ids,On=st.item_banks_group_id,Jn=st.is_file,Wn=Jn===void 0?!1:Jn,Zn=st.hide_actual_output,zn=st.code_compile_score,Yi=st.languages,Vt=st.is_my,cr=st.codes,Vn=oe(ut,hi),pi=Object(b.a)(Vn,2),Dn=pi[0],bn=pi[1],rr(Zn),In=Wn?[{input:"",output:"",score:100,position:1}]:xr,Wn?(Yr(xr),Bt.setFieldsValue({hack_sets:In})):Yr([]),mi=Ct.query.lastedUpdateTime,$i=cr==null?void 0:cr.map(function(En){return Object(x.a)(Object(x.a)({},En),{},{code:re.Base64.decode(En==null?void 0:En.code)})}),Nt=Object(x.a)(Object(x.a)({},Nt),{},{loading:!1,user:vt,dicts:bn,status:fi,lastedUpdateTime:ot||(mi||0),data:{hack_codes:{language:ur,code:re.Base64.decode(or)},hack:{category:Kt,difficult:dn,name:Rr,description:kr,open_or_not:sr,time_limit:yn,test_set_average:$n,test_set_score:Gn,sub_discipline_id:Dn,tag_discipline_ids:An,languages:Yi,score:Tr||1,item_banks_group_ids:On,is_file:Wn,is_my:Vt,code_compile_score:zn},hack_sets:In,tags:An,codes:$i}}),parseInt(zn)>0&&tn(!0),ee({type:At.SET_INITAL_DATA,payload:Nt}),mr({hack:{category:Kt,difficult:dn,name:Rr,description:kr,open_or_not:sr,time_limit:yn,test_set_average:$n,test_set_score:Gn,sub_discipline_id:Dn,tag_discipline_ids:An,score:Tr||1,item_banks_group_ids:On,is_file:Wn},codes:$i}),vr(Dn==null?void 0:Dn[0],Dn==null?void 0:Dn[1],ut)),Zr.next=25;break;case 15:return Zr.next=17,ne();case 17:Zi=Zr.sent,Ai=Zi.user,xn=Ct.query,hn=xn.difficult,Qi=xn.sub_discipline_id,Qn=xn.tag_discipline_id,Mn=xn.tagIds,xa=xn.banksIds,Ea=oe(ut,parseInt(Qi,10)),Oi=Object(b.a)(Ea,2),kn=Oi[0],qn=Oi[1],Di=[Number(xa)],ee({type:At.SET_INITAL_DATA,payload:{loading:!1,user:Ai,disciplines:ut,status:0,dicts:qn,data:{hack_codes:{language:"C",code:""},hack:{category:null,difficult:parseInt(hn,10),time_limit:3,description:"",test_set_score:!0,test_set_average:!0,open_or_not:!0,sub_discipline_id:kn,tag_discipline_id:Mn&&(Mn==null||((_i=Mn.split(","))===null||_i===void 0)?void 0:_i.map(function(En){return Number(En)})),name:"",item_banks_group_ids:Di,is_file:!1},tags:Qn?Qn==null?void 0:Qn.split(",").map(function(En){return parseInt(En,10)}):[],hack_sets:[{input:"",output:"",score:100,position:1}]}}}),mr({hack:{category:null,difficult:parseInt(hn,10),time_limit:3,description:"",test_set_average:!0,open_or_not:!0,sub_discipline_id:kn,tag_discipline_id:Mn&&(Mn==null||((Ji=Mn.split(","))===null||Ji===void 0)?void 0:Ji.map(function(En){return Number(En)})),name:"",item_banks_group_id:Di,is_file:!1}}),vr(kn==null?void 0:kn[0],kn==null?void 0:kn[1],ut);case 25:case"end":return Zr.stop()}},ct)})),[Mt,Ze]);Object(U.useEffect)(function(){try{Ln()}catch(ct){console.log(ct,"----")}},[]),Object(U.useEffect)(function(){function ct(){return ot.apply(this,arguments)}function ot(){return ot=Object(k.a)(G.a.mark(function ut(){var wt;return G.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return st.next=2,Object(we.c)("item_banks_groups/mine.json");case 2:wt=st.sent,mn(wt);case 4:case"end":return st.stop()}},ut)})),ot.apply(this,arguments)}ct()},[]);var vr=function(ot,ut,wt){var Nt,st,Kt,vt=wt==null||((Nt=wt.find(function(or){return or.id===ot}))===null||Nt===void 0||((st=Nt.sub_disciplines)===null||st===void 0||((Kt=st.find(function(or){return or.id===ut}))===null||Kt===void 0)))?void 0:Kt.tag_disciplines};function tr(ct,ot,ut){return Dr.apply(this,arguments)}function Dr(){return Dr=Object(k.a)(G.a.mark(function ct(ot,ut,wt){var Nt,st,Kt,vt,or,ur,xr,kr,dn,Rr,sr,hi,Pn,yn,$n,Gn,fi,An,On,Jn,Wn,Zn,zn;return G.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:Nt=Object(x.a)({},ot),st=Nt.hack_sets,Kt=Nt.hack_codes,vt=Nt.hack,or=Nt.tags,ur=Nt.codes,vt.hide_actual_output=Ar,xr=[],kr=[],dn=0,Rr=vt!=null&&vt.is_file?Xr.map(function(cr,Vn){return Object(x.a)(Object(x.a)({},cr),{},{position:Vn+1})}):st.map(function(cr){return Object(x.a)(Object(x.a)({},cr),{},{is_file:!1})}),sr=Object(y.a)(Rr);try{for(sr.s();!(hi=sr.n()).done;)Pn=hi.value,dn+=Pn.score,Pn.id&&Pn.id>=0?xr.push(Pn):kr.push(Pn)}catch(cr){sr.e(cr)}finally{sr.f()}if(Rr!=null&&Rr.length){Vt.next=11;break}return i.b.error("\u6D4B\u8BD5\u96C6\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 11:if(dn+=parseInt(vt.code_compile_score||0),!(dn!==100&&!vt.test_set_score)){Vt.next=15;break}return i.b.error("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),Vt.abrupt("return");case 15:if(!(Rr!=null&&Rr.some(function(cr){return!cr.output}))){Vt.next=18;break}return i.b.error("\u6D4B\u8BD5\u96C6\u8F93\u51FA\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 18:if(yn={},rn?ur==null||ur.forEach(function(cr){yn[cr.language]=cr!=null&&cr.code?re.Base64.encode(cr==null?void 0:cr.code):""}):Kt.code=re.Base64.encode(Kt==null?void 0:Kt.code),vt.sub_discipline_id=vt.sub_discipline_id[1],ee({type:At.SET_LOADING,payload:!0}),Yt||(vt.score=vt.difficult*100),!Mt){Vt.next=49;break}return Vt.next=26,Z(Mt,{hack:vt,hack_codes:Kt,hack_sets:kr,update_hack_sets:xr,tags:or,is_cover:wt,languages:vt.languages,codes:yn});case 26:if(!Yt){Vt.next=45;break}return Vt.next=29,Ne(Mt);case 29:if(!Yt.includes("paperlibrary")){Vt.next=35;break}return Vt.next=32,Object(Et.f)({id:Cr,question_id:_r,item_type:xt.a.Program,name:vt.name,question_score:vt.score,difficulty:vt.difficult,sub_discipline_id:vt.sub_discipline_id,tag_discipline_ids:vt.tag_discipline_ids,item_banks_group_ids:vt.item_banks_group_ids});case 32:return $n=Vt.sent,$n.status===0&&Xt.replace(Yt),Vt.abrupt("return");case 35:return Vt.next=37,_e(_r,{question_type:6,question_score:vt.score,question_title:vt.name,description:vt.description,sub_discipline_id:vt.sub_discipline_id,tag_discipline_ids:vt.tag_discipline_ids,item_banks_group_ids:vt.item_banks_group_ids,identifier:Mt});case 37:if(Gn=Vt.sent,fi=Gn.status,!(fi===0)){Vt.next=43;break}if(!(ut==="start")){Vt.next=42;break}return Vt.abrupt("return");case 42:Xt.replace(Yt);case 43:Vt.next=46;break;case 45:Ln(ir());case 46:ee({type:At.SET_LOADING,payload:!1}),Vt.next=79;break;case 49:return Vt.next=51,Ee({hack:vt,hack_codes:Kt,hack_sets:Rr,tags:or,examination_bank_id:Cr||null});case 51:if(An=Vt.sent,On=An.identifier,Jn=An.exam_identifier,ee({type:At.SET_LOADING,payload:!1}),!(ut==="start")){Vt.next=57;break}return Vt.abrupt("return");case 57:if(!On){Vt.next=79;break}if(Yt){Vt.next=62;break}Xt.replace("/problems/".concat(On,"/edit?lastedUpdateTime=").concat(ir())),Vt.next=79;break;case 62:return Vt.next=64,Ne(On);case 64:if(Mt){Vt.next=78;break}if(!Yt.includes("paperlibrary")){Vt.next=71;break}return Vt.next=68,Object(Et.f)({id:Cr,item_type:xt.a.Program,name:vt.name,question_score:vt.score,difficulty:vt.difficult,sub_discipline_id:vt.sub_discipline_id,tag_discipline_ids:vt.tag_discipline_ids,identifier:Jn});case 68:return Wn=Vt.sent,Wn.status===0&&Xt.replace(Yt),Vt.abrupt("return");case 71:return Vt.next=73,xe(parseInt(Cr,10),{question_type:6,question_score:vt.score,question_title:vt.name,identifier:On,tag_discipline_ids:vt.tag_discipline_ids});case 73:Zn=Vt.sent,zn=Zn.status,zn===0&&Xt.replace(Yt),Vt.next=79;break;case 78:Xt.replace(Yt);case 79:case"end":return Vt.stop()}},ct)})),Dr.apply(this,arguments)}function er(){Bt.submit(),setTimeout(Object(k.a)(G.a.mark(function ct(){var ot;return G.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Ne(Mt);case 2:ot=wt.sent,ot.status===0?(i.b.success("\u53D1\u5E03\u6210\u529F"),ee({type:At.SET_STATUS,payload:1})):i.b.info(ot.message);case 4:case"end":return wt.stop()}},ct)})),400)}function wr(){return nr.apply(this,arguments)}function nr(){return nr=Object(k.a)(G.a.mark(function ct(){var ot;return G.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Be(Mt);case 2:ot=wt.sent,ot.status===0?(i.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),ee({type:At.SET_STATUS,payload:0})):i.b.info(ot.message);case 4:case"end":return wt.stop()}},ct)})),nr.apply(this,arguments)}function Cn(){Tt===0?Wt({title:"\u63D0\u793A",content:B.a.createElement(U.Fragment,null," ",B.a.createElement("div",null,"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802")," ",B.a.createElement("div",null," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")," "),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){er()}}):Wt({title:"\u63D0\u793A",content:B.a.createElement("p",null,"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){wr()}})}function Ir(){return Fr.apply(this,arguments)}function Fr(){return Fr=Object(k.a)(G.a.mark(function ct(){return G.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.t0=tr,ut.next=3,Bt.getFieldValue();case 3:ut.t1=ut.sent,(0,ut.t0)(ut.t1,"start"),setTimeout(Object(k.a)(G.a.mark(function wt(){var Nt,st;return G.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return vt.next=2,We(Mt);case 2:Nt=vt.sent,st=Nt.identifier,rn?window.location.href="/myproblems/".concat(st,"?type=1"):window.location.href="/myproblems/".concat(st);case 5:case"end":return vt.stop()}},wt)})),400);case 6:case"end":return ut.stop()}},ct)})),Fr.apply(this,arguments)}function Bn(){if(Yt)Xt.replace(Yt);else if(rn){var ct,ot=(ct=localStorage.getItem("program_homework"))===null||ct===void 0?void 0:ct.split(",");Xt.push("/classrooms/".concat(ot==null?void 0:ot[0],"/program_homework/").concat(ot==null?void 0:ot[1],"/detail"))}else Xt.replace("/problemset")}var Tn=function(ot){var ut=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,wt=Math.floor((100-ut)/ot.length),Nt=wt+(100-ut)%ot.length;ot=ot.map(function(st,Kt){return Kt===ot.length-1?Object(x.a)(Object(x.a)({},st),{},{score:Nt}):Object(x.a)(Object(x.a)({},st),{},{score:wt})}),Yr(ot)};function ui(ct){ct.target.value||Tn(Xr),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{test_set_score:ct.target.value})})}})}function Un(ct){ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{is_file:ct.target.value})})}})}function _n(ct){rr(ct.target.checked)}function ci(ct){var ot=ct.target.value;ot&&Tn(Xr),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{test_set_average:ot})})}})}function vn(){var ct=Bt.getFieldValue("hack_sets"),ot=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,ut=ct.length+1,wt=Math.floor((100-ot)/ut),Nt=(100-ot)%ut;ct.map(function(st,Kt){return Dt&&(st.score=wt),st.position=Kt+1,st}),ct.push({input:"",output:"",position:ut,score:Dt?wt+Nt:0}),Bt.setFieldsValue({hack_sets:ct}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:ct})}})}function di(){var ct=Bt.getFieldValue("hack_sets"),ot=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,ut=ct.length,wt=Math.floor((100-ot)/ut),Nt=(100-ot)%ut;ct.map(function(st,Kt){return Dt&&(st.score=wt,Kt===ct.length-1&&(st.score=wt+Nt)),st.position=Kt+1,st}),Bt.setFieldsValue({hack_sets:ct}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:ct})}})}Object(U.useEffect)(function(){if(Dt){var ct=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,ot=et==null?void 0:et.length,ut=Math.floor((100-ct)/ot),wt=(100-ct)%ot;et==null||et.map(function(Nt,st){return Nt.score=ut,Nt.position=st+1,st===ot-1&&(Nt.score=ut+wt),Nt}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:et})}}),Bt.setFieldsValue({hack_sets:et})}},[Dt]);function Ti(ct){var ot=Bt.getFieldValue("hack_sets"),ut=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,wt=(ot==null?void 0:ot.length)-1,Nt=Math.floor((100-ut)/wt),st=(100-ut)%wt;ot.splice(ct,1),ot==null||ot.map(function(Kt,vt){return Dt&&(Kt.score=Nt,vt===wt-1&&(Kt.score=Nt+st)),Kt.position=vt+1,Kt}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:ot})}}),Bt.setFieldsValue({hack_sets:ot})}function Kn(ct){ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_codes:Object(x.a)(Object(x.a)({},se.hack_codes),{},{language:ct})})}})}var Xi=function(ot){var ut;if(ot!=null&&(ut=ot.hack)!==null&&ut!==void 0&&ut.sub_discipline_id){var wt,Nt,st,Kt,vt,or=ot==null||((wt=ot.hack)===null||wt===void 0)?void 0:wt.sub_discipline_id,ur=Object(b.a)(or,2),xr=ur[0],kr=ur[1],dn=Ze==null||((Nt=Ze.find(function(sr){return sr.id===xr}))===null||Nt===void 0||((st=Nt.sub_disciplines)===null||st===void 0||((Kt=st.find(function(sr){return sr.id===kr}))===null||Kt===void 0)))?void 0:Kt.tag_disciplines,Rr=Object(x.a)(Object(x.a)({},Bt.getFieldsValue()),{},{hack:Object(x.a)(Object(x.a)({},(vt=Bt.getFieldsValue())===null||vt===void 0?void 0:vt.hack),{},{tag_discipline_ids:[]})});Bt.setFieldsValue(Rr),mr(Rr)}else mr(Object(x.a)({},Bt.getFieldsValue()))},Lt=function(ot){kt([].concat(Object(w.a)(nt),[Object(x.a)({},ot)]))};Object(U.useEffect)(function(){var ct,ot;if(se!=null&&(ct=se.hack)!==null&&ct!==void 0&&(ot=ct.sub_discipline_id)!==null&&ot!==void 0&&ot[1]){var ut,wt;Ht(se==null||((ut=se.hack)===null||ut===void 0||((wt=ut.sub_discipline_id)===null||wt===void 0))?void 0:wt[1])}},[se==null||((dt=se.hack)===null||dt===void 0)?void 0:dt.sub_discipline_id]);var Ht=function(){var ct=Object(k.a)(G.a.mark(function ot(ut){var wt;return G.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return st.next=2,Object(ze.I)({sub_discipline_id:ut});case 2:wt=st.sent,kt(wt.tag_disciplines);case 4:case"end":return st.stop()}},ot)}));return function(ut){return ct.apply(this,arguments)}}();function Ft(ct){var ot=ct[1],ut=oe(Ze,ot),wt=Object(b.a)(ut,2),Nt=wt[1];Bt.setFieldsValue({tags:[]}),ee({type:At.SET_INITAL_DATA,payload:{dicts:Nt,data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{sub_discipline_id:ct}),tags:[]})}})}var Qt=function(ot){var ut,wt,Nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Nt)return function(){ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack:Object(x.a)(Object(x.a)({},se.hack),{},{is_file:!0})})}}),Bt.setFieldsValue({hack:{is_file:!0}})};var st=ot==null?void 0:ot.map(function(kr){return{input:kr.input,output:kr.output,score:0,position:1}}),Kt=(ut=Bt.getFieldValue("hack_sets"))===null||ut===void 0||((wt=ut.filter(function(kr){return kr.input||kr.output}))===null||wt===void 0)?void 0:wt.concat(st),vt=parseInt(Bt.getFieldValue("hack").code_compile_score)||0,or=Kt==null?void 0:Kt.length,ur=Math.floor((100-vt)/or),xr=(100-vt)%or;Kt==null||Kt.map(function(kr,dn){return Dt&&(kr.score=ur,dn===or-1&&(kr.score=ur+xr)),kr.position=dn+1,kr}),ee({type:At.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},se),{},{hack_sets:Kt,hack:Object(x.a)(Object(x.a)({},se.hack),{},{is_file:!1})})}}),Bt.setFieldsValue({hack_sets:Kt,hack:{is_file:!1}})};return B.a.createElement(n.a,{spinning:ye,delay:500},se?B.a.createElement(U.Fragment,null,B.a.createElement("header",{className:te.a.header},B.a.createElement("div",null,B.a.createElement("img",{src:"".concat(qe.a.IMG_SERVER,"/images/").concat(Pe==null?void 0:Pe.image_url),alt:"user",width:30}),B.a.createElement("span",null,Pe==null?void 0:Pe.name)),B.a.createElement("h2",null," ",se==null?void 0:se.hack.name," "),Mt?B.a.createElement("a",{className:te.a.btn_back,onClick:Bn}," ",B.a.createElement(he.a,null),"\u9000\u51FA"):null),B.a.createElement(c.a,{form:Bt,initialValues:se,layout:"vertical",className:te.a["oj-form-container"],onValuesChange:Xi,onFinish:function(ot,ut){var wt;if(Ct!=null&&(wt=Ct.query)!==null&&wt!==void 0&&wt.exercise&&!Yt.includes("paperlibrary")){L.a.confirm({title:"\u4FDD\u5B58\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u8BD5\u9898\u5E93\u4E2D\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u8BD5\u9898\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",onOk:function(){return tr(ot,ut,1)},onCancel:function(){return tr(ot,ut,0)}});return}tr(ot,ut)}},B.a.createElement(Ke.a,{leftChild:B.a.createElement(St,{onAddTestCases:di,form:Bt,handleAddKnowledgeFinish:Lt,MyGroup:$r,formValue:Gt,knowledgeOptions:nt,onChangeLanguage:Kn,onChangeSubDiscipline:Ft,onRemoveTestCase:Ti,onAddTestCase:vn,dicts:mt,categorys:li,callback_url:Yt,hack:se.hack,onChangeScore:ui,onChangehide:_n,onChangeAverage:ci,onChangeFile:Un,uploadData:Xr,setUploadData:Yr,handleUploadRatio:Tn,ischecked:Ar,isshows:Jr,isProgram:rn,addUploadFnc:Qt,id:Mt}),rightChild:rn?B.a.createElement(c.a.Item,{name:"codes",style:{marginBottom:0}},B.a.createElement(Fe,null)):B.a.createElement(c.a.Item,{name:["hack_codes","code"],style:{marginBottom:0}},B.a.createElement(Ye.a,{language:se.hack_codes.language}))}),B.a.createElement("div",{className:te.a.footer},Mt?B.a.createElement(U.Fragment,null,rn&&B.a.createElement(u.a,{onClick:Bn,type:"primary",ghost:!0},"\u9000\u51FA\u7F16\u8F91"),Yt||rn?null:B.a.createElement(u.a,{type:Tt?"default":"primary",onClick:Cn},Tt?"\u64A4\u9500\u53D1\u5E03":"\u7ACB\u5373\u53D1\u5E03"),B.a.createElement(u.a,{loading:ye,type:"primary",htmlType:"submit"},"\u4FDD\u5B58"),B.a.createElement(u.a,{type:"primary",onClick:Ir},Tt?"\u5F00\u59CB\u6311\u6218":"\u6A21\u62DF\u6311\u6218")):B.a.createElement(U.Fragment,null,B.a.createElement(u.a,{onClick:Bn},"\u53D6\u6D88"),B.a.createElement(u.a,{loading:ye,type:"primary",htmlType:"submit"},"\u4FDD\u5B58"))))):null)};function St(Je){var dt,Ct,Xt,Jt,Mt=Je.form,Pt=Je.onAddTestCases,gt=Je.handleAddKnowledgeFinish,Bt=Je.ischecked,fr=Je.MyGroup,ar=Je.formValue,Gt=Je.knowledgeOptions,mr=Je.categorys,zt=Je.hack,Ur=Je.callback_url,nt=Je.onChangeAverage,kt=Je.onChangeScore,zr=Je.onChangehide,Pr=Je.onChangeFile,Xr=Je.onAddTestCase,Yr=Je.onRemoveTestCase,ce=Je.onChangeSubDiscipline,K=Je.onChangeLanguage,Y=Je.uploadData,ee=Je.setUploadData,ye=Je.handleUploadRatio,se=Je.isshows,Pe=Je.isProgram,Ze=Je.addUploadFnc,mt=Je.id,Tt=((dt=location)===null||dt===void 0||((Ct=dt.search)===null||Ct===void 0)?void 0:Ct.includes("select"))||!1,et=Object(U.useState)(se),Dt=Object(b.a)(et,2),Zt=Dt[0],Yt=Dt[1],Cr=zt.test_set_average,Tr=zt.test_set_score,_r=Object(U.useState)(!1),en=Object(b.a)(_r,2),Rn=en[0],gr=en[1],$r=function(rr,br){var Or=Object(w.a)(Y);Or.splice(br,1),Cr?ye(Or):ee(Or)},mn=function(rr,br){console.log(rr,br);var Or=Y.map(function(Jr,tn){return tn===br?Object(x.a)(Object(x.a)({},Jr),{},{score:rr.target.value?Number(rr.target.value):0}):Jr});ee(Or)},gn=function(rr){if(!(rr!=null&&rr.length))return;if(rr!=null&&rr[0].is_file){Ze(rr,!0)();var br=Y.concat(rr);zt.test_set_average?ye(br):ee(br)}rr!=null&&rr[0].is_file||Ze(rr)};function jr(Ar){Ar.stopPropagation()}return B.a.createElement("div",{className:te.a["oj-left-panel"]},B.a.createElement("div",{className:te.a["oj-form-info"]},B.a.createElement("div",{className:te.a.field},B.a.createElement(c.a.Item,{label:"\u96BE\u6613\u5EA6",name:["hack","difficult"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},B.a.createElement(E.a,{disabled:Tt},ge(Ce.difficult))),B.a.createElement(c.a.Item,{label:"\u8BFE\u7A0B(\u5408\u7406\u7684\u8BFE\u7A0B\u5206\u7C7B\u6709\u5229\u4E8E\u5FEB\u901F\u68C0\u7D22)",name:["hack","sub_discipline_id"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},B.a.createElement(d.a,{disabled:Tt,allowClear:!1,options:mr,placeholder:"\u8BF7\u9009\u62E9",onChange:ce}))),B.a.createElement("div",{className:te.a.field},Ur&&B.a.createElement(c.a.Item,{label:"\u5206\u6570",name:["hack","score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u6570"}],extra:B.a.createElement("span",{style:{position:"absolute",left:100,top:5}},"\u5206")},B.a.createElement(r.a,{disabled:Tt,min:1,max:100})),B.a.createElement(c.a.Item,{label:B.a.createElement("div",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"," ",B.a.createElement("span",{className:"c-grey-999"},"(\u4EE3\u7801\u6267\u884C\u6240\u5141\u8BB8\u7684\u6700\u5927\u65F6\u957F)")),name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:3,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F3\u79D2"}],extra:B.a.createElement("span",{style:{position:"absolute",left:100,top:5}},"\u79D2")},B.a.createElement(r.a,{min:3})),Pe?B.a.createElement(c.a.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",name:["hack","languages"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},B.a.createElement(s.a.Group,null,B.a.createElement(s.a,{value:"c"},"C"),B.a.createElement(s.a,{value:"c++"},"C++"),B.a.createElement(s.a,{value:"java"},"Java"),B.a.createElement(s.a,{value:"python"},"Python"))):B.a.createElement(c.a.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",name:["hack_codes","language"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},B.a.createElement(E.a,{onChange:K},ge(Ce.language)))),B.a.createElement(c.a.Item,{label:B.a.createElement("span",null,"\u77E5\u8BC6\u70B9\uFF1A",B.a.createElement("span",{className:"c-grey-999"},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),name:["hack","tag_discipline_ids"]},B.a.createElement(pt.a,{selectvalues:(zt==null?void 0:zt.tag_discipline_id)||(zt==null?void 0:zt.tag_discipline_ids),disabled:Tt,subId:ar==null||((Xt=ar.hack)===null||Xt===void 0||((Jt=Xt.sub_discipline_id)===null||Jt===void 0))?void 0:Jt[1],knowledgeOptions:Gt,onAddKnowledgeFinish:gt})),B.a.createElement(c.a.Item,{label:"\u52A0\u5165\u6587\u4EF6\u5939\u76EE\u5F55",name:["hack","item_banks_group_ids"],labelCol:{span:24},wrapperCol:{span:24}},B.a.createElement(at.a,{disabled:Tt})),B.a.createElement(c.a.Item,{label:"\u4EFB\u52A1\u540D\u79F0",name:["hack","name"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},B.a.createElement(z.a,{maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0",suffix:B.a.createElement("span",null,60-zt.name.length)})),B.a.createElement(c.a.Item,{name:["hack","description"],valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},B.a.createElement(ie.a,{miniToolbar:!0,id:"moop_cases_content",noStorage:!0,height:200})),B.a.createElement("div",{className:"tst-case-info"},B.a.createElement("h3",{className:"flex-container",style:{justifyContent:"space-between"}}," ","\u6D4B\u8BD5\u7528\u4F8B\u4E0E\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219",!zt.is_file&&B.a.createElement(u.a,{type:"primary",ghost:!0,onClick:Xr},"\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B")),B.a.createElement(c.a.Item,{name:["hack","test_set_score"]},B.a.createElement(C.a.Group,{onChange:kt},B.a.createElement(C.a,{value:!0},"\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6",B.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")),B.a.createElement(C.a,{value:!1},"\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6",B.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")))),B.a.createElement(s.a,{style:{marginBottom:"5px"},checked:Bt,onChange:zr},"\u9690\u85CF\u5B9E\u9645\u8F93\u51FA \uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u5B66\u751F\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u65E0\u6CD5\u770B\u5230\u5B9E\u9645\u8F93\u51FA\u7ED3\u679C\uFF0C\u4EC5\u5C55\u793A\u662F\u5426\u8BC4\u6D4B\u662F\u5426\u901A\u8FC7\uFF09"),B.a.createElement(c.a.Item,{className:te.a.testJi,name:["hack","is_file"],label:"\u7528\u4F8B\u7C7B\u578B:"},B.a.createElement(C.a.Group,{onChange:Pr},B.a.createElement(T.a,{direction:"horizontal"},B.a.createElement(C.a,{value:!1},"\u6587\u672C"),B.a.createElement(C.a,{value:!0},"\u6587\u4EF6")))),!zt.test_set_score&&B.a.createElement(c.a.Item,{name:["hack","test_set_average"],label:"\u7CFB\u7EDF\u8BC4\u5206\u5360\u6BD4"},B.a.createElement(C.a.Group,{onChange:nt},B.a.createElement(C.a,{value:!0},"\u5747\u5206\u6BD4\u4F8B"),B.a.createElement(C.a,{value:!1},"\u81EA\u5B9A\u4E49\u6BD4\u4F8B"))),!zt.test_set_score&&B.a.createElement("div",{style:{marginBottom:"20px",marginTop:"-10px"}},B.a.createElement("div",{style:{display:"flex",height:"30px",marginBottom:"10px"}},B.a.createElement(s.a,{checked:Zt,style:{display:"flex",alignItems:"center"},className:te.a.checkboxs,onChange:function(rr){Yt(rr.target.checked),Mt.setFieldsValue({hack:{code_compile_score:0}}),zt.test_set_average&&(zt.is_file?ye(Y):Pt())}},"\u542F\u7528\u7F16\u8BD1\u901A\u8FC7\u5373\u53EF\u5F97\u5206"),Zt&&B.a.createElement("span",{style:{display:"flex"}},B.a.createElement(c.a.Item,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7F16\u8BD1\u5F97\u5206"}],name:["hack","code_compile_score"]},B.a.createElement(r.a,{onChange:function(){zt.test_set_average&&(zt.is_file?ye(Y):Pt())},parser:function(rr){return isNaN(parseInt(rr))?"":parseInt(rr)},min:0,max:100,style:{width:"90px",margin:"5px 0px"}}))," ",B.a.createElement("span",{style:{display:"flex",alignItems:"center",marginLeft:"5px"}},"%"))),B.a.createElement("span",{style:{color:"#999",fontSize:"12px",marginLeft:"-8px"}},"\uFF08\u8BF7\u6CE8\u610F\u8BE5\u5B9E\u8BAD\u9898\u662F\u5426\u6709\u7F16\u8BD1\u8FC7\u7A0B\uFF0C\u82E5\u6CA1\u6709\u5219\u65E0\u6CD5\u83B7\u5F97\u7F16\u8BD1\u5F97\u5206\uFF09")),B.a.createElement("div",{className:te.a.upBtn},B.a.createElement(u.a,{ghost:!0,type:"primary",className:"mb20",onClick:function(){return gr(!0)}},"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"),(zt==null?void 0:zt.is_file)&&B.a.createElement(ft.a,{disabled:zt==null?void 0:zt.test_set_average,inputChange:mn,showScore:!zt.test_set_score,data:Y,onRemove:$r})),!zt.is_file&&B.a.createElement(c.a.List,{name:"hack_sets"},function(Ar,rr){return Object(S.a)(rr),B.a.createElement(j.a,{accordion:!0},Ar.map(function(br,Or){return B.a.createElement(It,{key:"".concat(br.key,"--").concat(Or),header:B.a.createElement("a",{className:te.a["test-case-name"]},B.a.createElement("span",null,"\u6D4B\u8BD5\u7528\u4F8B",Or+1,"\b"),Tr?null:B.a.createElement(B.a.Fragment,null,B.a.createElement(c.a.Item,{name:[br.name,"score"],fieldKey:[br.fieldKey,"score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D4B\u8BD5\u96C6".concat(Or+1,"\u8BC4\u5206")}]},B.a.createElement(r.a,{onClick:jr,min:0,max:100,disabled:Cr})),B.a.createElement("span",null,"%"))),extra:Or>0?B.a.createElement("div",{onClick:jr},B.a.createElement(m.a,{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u5B9A\u5220\u9664\u6D4B\u8BD5\u96C6\b"+(Or+1),onConfirm:function(){Yr(Or)}},B.a.createElement(Q.a,{className:te.a["btn-remove-case"]}))):null},B.a.createElement(c.a.Item,{label:"\u8F93\u5165",name:[br.name,"input"],fieldKey:[br.fieldKey,"input"]},B.a.createElement(lt,null)),B.a.createElement(c.a.Item,{label:"\u8F93\u51FA",name:[br.name,"output"],fieldKey:[br.fieldKey,"output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},B.a.createElement(lt,null)))}))}))),B.a.createElement(ft.b,{rootIdentifier:mt,visible:Rn,onClose:function(){return gr(!1)},onOK:gn,multiple:!0,defaultMultipleValue:zt==null?void 0:zt.is_file}))}},PVpz:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("ETIr"),M("cv67"),M("K3mO"),M("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.StreamCipher,T=m.algo,g=[],C=[],p=[],s=T.RabbitLegacy=R.extend({_doReset:function(){var r=this._key.words,h=this.cfg.iv,d=this._X=[r[0],r[3]<<16|r[2]>>>16,r[1],r[0]<<16|r[3]>>>16,r[2],r[1]<<16|r[0]>>>16,r[3],r[2]<<16|r[1]>>>16],f=this._C=[r[2]<<16|r[2]>>>16,r[0]&4294901760|r[1]&65535,r[3]<<16|r[3]>>>16,r[1]&4294901760|r[2]&65535,r[0]<<16|r[0]>>>16,r[2]&4294901760|r[3]&65535,r[1]<<16|r[1]>>>16,r[3]&4294901760|r[0]&65535];this._b=0;for(var E=0;E<4;E++)a.call(this);for(var E=0;E<8;E++)f[E]^=d[E+4&7];if(h){var y=h.words,l=y[0],n=y[1],o=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,u=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,w=o>>>16|u&4294901760,v=u<<16|o&65535;f[0]^=o,f[1]^=w,f[2]^=u,f[3]^=v,f[4]^=o,f[5]^=w,f[6]^=u,f[7]^=v;for(var E=0;E<4;E++)a.call(this)}},_doProcessBlock:function(r,h){var d=this._X;a.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var f=0;f<4;f++)g[f]=(g[f]<<8|g[f]>>>24)&16711935|(g[f]<<24|g[f]>>>8)&4278255360,r[h+f]^=g[f]},blockSize:128/32,ivSize:64/32});function a(){for(var r=this._X,h=this._C,d=0;d<8;d++)C[d]=h[d];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0<C[0]>>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0<C[1]>>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0<C[2]>>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0<C[3]>>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0<C[4]>>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0<C[5]>>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0<C[6]>>>0?1:0)|0,this._b=h[7]>>>0<C[7]>>>0?1:0;for(var d=0;d<8;d++){var f=r[d]+h[d],E=f&65535,y=f>>>16,l=((E*E>>>17)+E*y>>>15)+y*y,n=((f&4294901760)*f|0)+((f&65535)*f|0);p[d]=l^n}r[0]=p[0]+(p[7]<<16|p[7]>>>16)+(p[6]<<16|p[6]>>>16)|0,r[1]=p[1]+(p[0]<<8|p[0]>>>24)+p[7]|0,r[2]=p[2]+(p[1]<<16|p[1]>>>16)+(p[0]<<16|p[0]>>>16)|0,r[3]=p[3]+(p[2]<<8|p[2]>>>24)+p[1]|0,r[4]=p[4]+(p[3]<<16|p[3]>>>16)+(p[2]<<16|p[2]>>>16)|0,r[5]=p[5]+(p[4]<<8|p[4]>>>24)+p[3]|0,r[6]=p[6]+(p[5]<<16|p[5]>>>16)+(p[4]<<16|p[4]>>>16)|0,r[7]=p[7]+(p[6]<<8|p[6]>>>24)+p[5]|0}m.RabbitLegacy=R._createHelper(s)}(),P.RabbitLegacy})},RELg:function(I,q,M){var P=M("MFOe"),m=P.Global;I.exports={name:"oldIE-userDataStorage",write:C,read:p,each:s,remove:a,clearAll:r};var S="storejs",R=m.document,T=f(),g=(m.navigator?m.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function C(E,y){if(g)return;var l=d(E);T(function(n){n.setAttribute(l,y),n.save(S)})}function p(E){if(g)return;var y=d(E),l=null;return T(function(n){l=n.getAttribute(y)}),l}function s(E){T(function(y){for(var l=y.XMLDocument.documentElement.attributes,n=l.length-1;n>=0;n--){var o=l[n];E(y.getAttribute(o.name),o.name)}})}function a(E){var y=d(E);T(function(l){l.removeAttribute(y),l.save(S)})}function r(){T(function(E){var y=E.XMLDocument.documentElement.attributes;E.load(S);for(var l=y.length-1;l>=0;l--)E.removeAttribute(y[l].name);E.save(S)})}var h=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function d(E){return E.replace(/^\d/,"___$&").replace(h,"___")}function f(){if(!R||!R.documentElement||!R.documentElement.addBehavior)return null;var E="script",y,l,n;try{l=new ActiveXObject("htmlfile"),l.open(),l.write("<"+E+">document.w=window</"+E+'><iframe src="/favicon.ico"></iframe>'),l.close(),y=l.w.frames[0].document,n=y.createElement("div")}catch(o){n=R.createElement("div"),y=R.body}return function(o){var u=[].slice.call(arguments,0);u.unshift(n),y.appendChild(n),n.addBehavior("#default#userData"),n.load(S),o.apply(this,u),y.removeChild(n);return}}},RxwV:function(I,q,M){"use strict";var P=M("q1tI"),m=M("uciX"),S=M("2W6z"),R=M.n(S),T=M("4IlW"),g=M("uK0f"),C=M.n(g);function p(ge,pe){if(ge===pe)return!0;if(!ge||!pe)return!1;var oe=ge.length;if(pe.length!==oe)return!1;for(var ae=0;ae<oe;ae++)if(ge[ae]!==pe[ae])return!1;return!0}function s(ge){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s=function(oe){return typeof oe}:s=function(oe){return oe&&typeof Symbol=="function"&&oe.constructor===Symbol&&oe!==Symbol.prototype?"symbol":typeof oe},s(ge)}function a(ge,pe){if(!(ge instanceof pe))throw new TypeError("Cannot call a class as a function")}function r(ge,pe){for(var oe=0;oe<pe.length;oe++){var ae=pe[oe];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(ge,ae.key,ae)}}function h(ge,pe,oe){return pe&&r(ge.prototype,pe),oe&&r(ge,oe),ge}function d(ge,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");ge.prototype=Object.create(pe&&pe.prototype,{constructor:{value:ge,writable:!0,configurable:!0}}),pe&&f(ge,pe)}function f(ge,pe){return f=Object.setPrototypeOf||function(ae,re){return ae.__proto__=re,ae},f(ge,pe)}function E(ge){var pe=n();return function(){var oe=o(ge),ae;if(pe){var re=o(this).constructor;ae=Reflect.construct(oe,arguments,re)}else ae=oe.apply(this,arguments);return y(this,ae)}}function y(ge,pe){return pe&&(s(pe)==="object"||typeof pe=="function")?pe:l(ge)}function l(ge){if(ge===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ge}function n(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(ge){return!1}}function o(ge){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(oe){return oe.__proto__||Object.getPrototypeOf(oe)},o(ge)}var u=function(){var ge=function(pe){d(ae,pe);var oe=E(ae);function ae(){var re;return a(this,ae),re=oe.apply(this,arguments),re.menuItems={},re.saveMenuItem=function(he){return function(Q){re.menuItems[he]=Q}},re}return h(ae,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(he){!he.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(he){var Q=this.props,ie=Q.fieldNames,we=Q.defaultFieldNames;return ie[he]||we[he]}},{key:"getOption",value:function(he,Q){var ie=this.props,we=ie.prefixCls,ne=ie.expandTrigger,J=ie.expandIcon,V=ie.loadingIcon,Z=this.props.onSelect.bind(this,he,Q),Ee=this.props.onItemDoubleClick.bind(this,he,Q),xe={onClick:Z,onDoubleClick:Ee},_e="".concat(we,"-menu-item"),Ne=null,Be=he[this.getFieldName("children")]&&he[this.getFieldName("children")].length>0;(Be||he.isLeaf===!1)&&(_e+=" ".concat(we,"-menu-item-expand"),he.loading||(Ne=P.createElement("span",{className:"".concat(we,"-menu-item-expand-icon")},J))),ne==="hover"&&(Be||he.isLeaf===!1)&&(xe={onMouseEnter:this.delayOnSelect.bind(this,Z),onMouseLeave:this.delayOnSelect.bind(this),onClick:Z}),this.isActiveOption(he,Q)&&(_e+=" ".concat(we,"-menu-item-active"),xe.ref=this.saveMenuItem(Q)),he.disabled&&(_e+=" ".concat(we,"-menu-item-disabled"));var We=null;he.loading&&(_e+=" ".concat(we,"-menu-item-loading"),We=V||null);var Ue="";return"title"in he?Ue=he.title:typeof he[this.getFieldName("label")]=="string"&&(Ue=he[this.getFieldName("label")]),P.createElement("li",Object.assign({key:he[this.getFieldName("value")],className:_e,title:Ue},xe,{role:"menuitem",onMouseDown:function(Ke){return Ke.preventDefault()}}),he[this.getFieldName("label")],Ne,We)}},{key:"getActiveOptions",value:function(he){var Q=this,ie=this.props.options,we=he||this.props.activeValue;return C()(ie,function(ne,J){return ne[Q.getFieldName("value")]===we[J]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var he=this,Q=this.props.options,ie=this.getActiveOptions().map(function(we){return we[he.getFieldName("children")]}).filter(function(we){return!!we});return ie.unshift(Q),ie}},{key:"delayOnSelect",value:function(he){for(var Q=this,ie=arguments.length,we=new Array(ie>1?ie-1:0),ne=1;ne<ie;ne++)we[ne-1]=arguments[ne];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof he=="function"&&(this.delayTimer=window.setTimeout(function(){he(we),Q.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var he=this.getShowOptions().length,Q=0;Q<he;Q++){var ie=this.menuItems[Q];ie&&ie.parentElement&&(ie.parentElement.scrollTop=ie.offsetTop)}}},{key:"isActiveOption",value:function(he,Q){var ie=this.props.activeValue,we=ie===void 0?[]:ie;return we[Q]===he[this.getFieldName("value")]}},{key:"render",value:function(){var he=this,Q=this.props,ie=Q.prefixCls,we=Q.dropdownMenuColumnStyle;return P.createElement("div",null,this.getShowOptions().map(function(ne,J){return P.createElement("ul",{className:"".concat(ie,"-menu"),key:J,style:we},ne.map(function(V){return he.getOption(V,J)}))}))}}]),ae}(P.Component);return ge.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},ge}(),w=u,v={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},i=v;function k(ge){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(oe){return typeof oe}:k=function(oe){return oe&&typeof Symbol=="function"&&oe.constructor===Symbol&&oe!==Symbol.prototype?"symbol":typeof oe},k(ge)}function D(ge,pe){if(ge==null)return{};var oe=c(ge,pe),ae,re;if(Object.getOwnPropertySymbols){var he=Object.getOwnPropertySymbols(ge);for(re=0;re<he.length;re++){if(ae=he[re],pe.indexOf(ae)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(ge,ae))continue;oe[ae]=ge[ae]}}return oe}function c(ge,pe){if(ge==null)return{};var oe={},ae=Object.keys(ge),re,he;for(he=0;he<ae.length;he++){if(re=ae[he],pe.indexOf(re)>=0)continue;oe[re]=ge[re]}return oe}function b(ge){return F(ge)||j(ge)||_(ge)||x()}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(ge,pe){if(!ge)return;if(typeof ge=="string")return L(ge,pe);var oe=Object.prototype.toString.call(ge).slice(8,-1);if(oe==="Object"&&ge.constructor&&(oe=ge.constructor.name),oe==="Map"||oe==="Set")return Array.from(ge);if(oe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(oe))return L(ge,pe)}function j(ge){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(ge))return Array.from(ge)}function F(ge){if(Array.isArray(ge))return L(ge)}function L(ge,pe){(pe==null||pe>ge.length)&&(pe=ge.length);for(var oe=0,ae=new Array(pe);oe<pe;oe++)ae[oe]=ge[oe];return ae}function X(ge,pe){if(!(ge instanceof pe))throw new TypeError("Cannot call a class as a function")}function z(ge,pe){for(var oe=0;oe<pe.length;oe++){var ae=pe[oe];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(ge,ae.key,ae)}}function H(ge,pe,oe){return pe&&z(ge.prototype,pe),oe&&z(ge,oe),ge}function G(ge,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function");ge.prototype=Object.create(pe&&pe.prototype,{constructor:{value:ge,writable:!0,configurable:!0}}),pe&&U(ge,pe)}function U(ge,pe){return U=Object.setPrototypeOf||function(ae,re){return ae.__proto__=re,ae},U(ge,pe)}function B(ge){var pe=de();return function(){var oe=fe(ge),ae;if(pe){var re=fe(this).constructor;ae=Reflect.construct(oe,arguments,re)}else ae=oe.apply(this,arguments);return W(this,ae)}}function W(ge,pe){return pe&&(k(pe)==="object"||typeof pe=="function")?pe:te(ge)}function te(ge){if(ge===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ge}function de(){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(ge){return!1}}function fe(ge){return fe=Object.setPrototypeOf?Object.getPrototypeOf:function(oe){return oe.__proto__||Object.getPrototypeOf(oe)},fe(ge)}var be=function(){var ge=function(pe){G(ae,pe);var oe=B(ae);function ae(re){var he;X(this,ae),he=oe.call(this,re),he.setPopupVisible=function(ie){var we=he.state.value;"popupVisible"in he.props||he.setState({popupVisible:ie}),ie&&!he.state.popupVisible&&he.setState({activeValue:we}),he.props.onPopupVisibleChange(ie)},he.handleChange=function(ie,we,ne){var J=we.visible;(ne.type!=="keydown"||ne.keyCode===T.a.ENTER)&&(he.props.onChange(ie.map(function(V){return V[he.getFieldName("value")]}),ie),he.setPopupVisible(J))},he.handlePopupVisibleChange=function(ie){he.setPopupVisible(ie)},he.handleMenuSelect=function(ie,we,ne){var J=he.trigger.getRootDomNode();J&&J.focus&&J.focus();var V=he.props,Z=V.changeOnSelect,Ee=V.loadData,xe=V.expandTrigger;if(!ie||ie.disabled)return;var _e=he.state.activeValue;_e=_e.slice(0,we+1),_e[we]=ie[he.getFieldName("value")];var Ne=he.getActiveOptions(_e);if(ie.isLeaf===!1&&!ie[he.getFieldName("children")]&&Ee){Z&&he.handleChange(Ne,{visible:!0},ne),he.setState({activeValue:_e}),Ee(Ne);return}var Be={};!ie[he.getFieldName("children")]||!ie[he.getFieldName("children")].length?(he.handleChange(Ne,{visible:!1},ne),Be.value=_e):Z&&(ne.type==="click"||ne.type==="keydown")&&(xe==="hover"?he.handleChange(Ne,{visible:!1},ne):he.handleChange(Ne,{visible:!0},ne),Be.value=_e),Be.activeValue=_e,("value"in he.props||ne.type==="keydown"&&ne.keyCode!==T.a.ENTER)&&delete Be.value,he.setState(Be)},he.handleItemDoubleClick=function(){var ie=he.props.changeOnSelect;ie&&he.setPopupVisible(!1)},he.handleKeyDown=function(ie){var we=he.props.children;if(we&&we.props.onKeyDown){we.props.onKeyDown(ie);return}var ne=b(he.state.activeValue),J=ne.length-1<0?0:ne.length-1,V=he.getCurrentLevelOptions(),Z=V.map(function(Ne){return Ne[he.getFieldName("value")]}).indexOf(ne[J]);if(ie.keyCode!==T.a.DOWN&&ie.keyCode!==T.a.UP&&ie.keyCode!==T.a.LEFT&&ie.keyCode!==T.a.RIGHT&&ie.keyCode!==T.a.ENTER&&ie.keyCode!==T.a.SPACE&&ie.keyCode!==T.a.BACKSPACE&&ie.keyCode!==T.a.ESC&&ie.keyCode!==T.a.TAB)return;if(!he.state.popupVisible&&ie.keyCode!==T.a.BACKSPACE&&ie.keyCode!==T.a.LEFT&&ie.keyCode!==T.a.RIGHT&&ie.keyCode!==T.a.ESC&&ie.keyCode!==T.a.TAB){he.setPopupVisible(!0);return}if(ie.keyCode===T.a.DOWN||ie.keyCode===T.a.UP){ie.preventDefault();var Ee=Z;Ee!==-1?ie.keyCode===T.a.DOWN?(Ee+=1,Ee=Ee>=V.length?0:Ee):(Ee-=1,Ee=Ee<0?V.length-1:Ee):Ee=0,ne[J]=V[Ee][he.getFieldName("value")]}else if(ie.keyCode===T.a.LEFT||ie.keyCode===T.a.BACKSPACE)ie.preventDefault(),ne.splice(ne.length-1,1);else if(ie.keyCode===T.a.RIGHT)ie.preventDefault(),V[Z]&&V[Z][he.getFieldName("children")]&&ne.push(V[Z][he.getFieldName("children")][0][he.getFieldName("value")]);else if(ie.keyCode===T.a.ESC||ie.keyCode===T.a.TAB){he.setPopupVisible(!1);return}(!ne||ne.length===0)&&he.setPopupVisible(!1);var xe=he.getActiveOptions(ne),_e=xe[xe.length-1];he.handleMenuSelect(_e,xe.length-1,ie),he.props.onKeyDown&&he.props.onKeyDown(ie)},he.saveTrigger=function(ie){he.trigger=ie};var Q=[];return"value"in re?Q=re.value||[]:"defaultValue"in re&&(Q=re.defaultValue||[]),R()(!("filedNames"in re),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),he.state={popupVisible:re.popupVisible,activeValue:Q,value:Q,prevProps:re},he.defaultFieldNames={label:"label",value:"value",children:"children"},he}return H(ae,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(he){var Q=this.defaultFieldNames,ie=this.props,we=ie.fieldNames,ne=ie.filedNames;return"filedNames"in this.props?ne[he]||Q[he]:we[he]||Q[he]}},{key:"getFieldNames",value:function(){var he=this.props,Q=he.fieldNames,ie=he.filedNames;return"filedNames"in this.props?ie:Q}},{key:"getCurrentLevelOptions",value:function(){var he=this,Q=this.props.options,ie=Q===void 0?[]:Q,we=this.state.activeValue,ne=we===void 0?[]:we,J=C()(ie,function(V,Z){return V[he.getFieldName("value")]===ne[Z]},{childrenKeyName:this.getFieldName("children")});return J[J.length-2]?J[J.length-2][this.getFieldName("children")]:b(ie).filter(function(V){return!V.disabled})}},{key:"getActiveOptions",value:function(he){var Q=this;return C()(this.props.options||[],function(ie,we){return ie[Q.getFieldName("value")]===he[we]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var he=this.props,Q=he.prefixCls,ie=he.transitionName,we=he.popupClassName,ne=he.options,J=ne===void 0?[]:ne,V=he.disabled,Z=he.builtinPlacements,Ee=he.popupPlacement,xe=he.children,_e=he.dropdownRender,Ne=D(he,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Be=P.createElement("div",null),We="";J&&J.length>0?Be=P.createElement(w,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):We=" ".concat(Q,"-menus-empty");var Ue=Be;return _e&&(Ue=_e(Be)),P.createElement(m.a,Object.assign({ref:this.saveTrigger},Ne,{popupPlacement:Ee,builtinPlacements:Z,popupTransitionName:ie,action:V?[]:["click"],popupVisible:V?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(Q,"-menus"),popupClassName:we+We,popup:Ue}),P.cloneElement(xe,{onKeyDown:this.handleKeyDown,tabIndex:V?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(he,Q){var ie=Q.prevProps,we=ie===void 0?{}:ie,ne={prevProps:he};return"value"in he&&!p(we.value,he.value)&&(ne.value=he.value||[],"loadData"in he||(ne.activeValue=he.value||[])),"popupVisible"in he&&(ne.popupVisible=he.popupVisible),ne}}]),ae}(P.Component);return ge.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:i,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},ge}(),Ce=be,ue=q.a=Ce},S6kV:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return P.mode.OFB=function(){var m=P.lib.BlockCipherMode.extend(),S=m.Encryptor=m.extend({processBlock:function(R,T){var g=this._cipher,C=g.blockSize,p=this._iv,s=this._keystream;p&&(s=this._keystream=p.slice(0),this._iv=void 0),g.encryptBlock(s,0);for(var a=0;a<C;a++)R[T+a]^=s[a]}});return m.Decryptor=S,m}(),P.mode.OFB})},SJMd:function(I,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 M,P,m,S=!1,R,T;window.PR_SHOULD_USE_CONTINUATION=!0;var g,C;(function(){var p=window,s=["break,continue,do,else,for,if,return,while"],a=[s,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],r=[a,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[r,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],d=[r,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],f=[r,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],E="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[r,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",n=[s,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],o=[s,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],u=[s,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[h,f,d,y,l,n,o,u],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,i="str",k="kwd",D="com",c="typ",b="lit",x="pun",_="pln",j="tag",F="dec",L="src",X="atn",z="atv",H="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(ne){for(var J=0,V=!1,Z=!1,Ee=0,xe=ne.length;Ee<xe;++Ee){var _e=ne[Ee];if(_e.ignoreCase)Z=!0;else if(/[a-z]/i.test(_e.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){V=!0,Z=!1;break}}var Ne={b:8,t:9,n:10,v:11,f:12,r:13};function Be(Ye){var Re=Ye.charCodeAt(0);if(Re!==92)return Re;var tt=Ye.charAt(1);return Re=Ne[tt],Re||("0"<=tt&&tt<="7"?parseInt(Ye.substring(1),8):tt==="u"||tt==="x"?parseInt(Ye.substring(2),16):Ye.charCodeAt(1))}function We(Ye){if(Ye<32)return(Ye<16?"\\x0":"\\x")+Ye.toString(16);var Re=String.fromCharCode(Ye);return Re==="\\"||Re==="-"||Re==="]"||Re==="^"?"\\"+Re:Re}function Ue(Ye){var Re=Ye.substring(1,Ye.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=[],rt=Re[0]==="^",He=["["];rt&&He.push("^");for(var $e=rt?1:0,Ie=Re.length;$e<Ie;++$e){var Oe=Re[$e];if(/\\[bdsw]/i.test(Oe))He.push(Oe);else{var Le=Be(Oe),Te;$e+2<Ie&&Re[$e+1]==="-"?(Te=Be(Re[$e+2]),$e+=2):Te=Le,tt.push([Le,Te]),Te<65||Le>122||(Te<65||Le>90||tt.push([Math.max(65,Le)|32,Math.min(Te,90)|32]),Te<97||Le>122||tt.push([Math.max(97,Le)&~32,Math.min(Te,122)&~32]))}}tt.sort(function(Fe,Xe){return Fe[0]-Xe[0]||Xe[1]-Fe[1]});for(var Ae=[],De=[],$e=0;$e<tt.length;++$e){var Me=tt[$e];Me[0]<=De[1]+1?De[1]=Math.max(De[1],Me[1]):Ae.push(De=Me)}for(var $e=0;$e<Ae.length;++$e){var Me=Ae[$e];He.push(We(Me[0])),Me[1]>Me[0]&&(Me[1]+1>Me[0]&&He.push("-"),He.push(We(Me[1])))}return He.push("]"),He.join("")}function ze(Ye){for(var Re=Ye.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=Re.length,rt=[],He=0,$e=0;He<tt;++He){var Ie=Re[He];if(Ie==="(")++$e;else if(Ie.charAt(0)==="\\"){var Oe=+Ie.substring(1);Oe&&(Oe<=$e?rt[Oe]=-1:Re[He]=We(Oe))}}for(var He=1;He<rt.length;++He)rt[He]===-1&&(rt[He]=++J);for(var He=0,$e=0;He<tt;++He){var Ie=Re[He];if(Ie==="(")++$e,rt[$e]||(Re[He]="(?:");else if(Ie.charAt(0)==="\\"){var Oe=+Ie.substring(1);Oe&&Oe<=$e&&(Re[He]="\\"+rt[Oe])}}for(var He=0;He<tt;++He)Re[He]==="^"&&Re[He+1]!=="^"&&(Re[He]="");if(Ye.ignoreCase&&V)for(var He=0;He<tt;++He){var Ie=Re[He],Le=Ie.charAt(0);Ie.length>=2&&Le==="["?Re[He]=Ue(Ie):Le!=="\\"&&(Re[He]=Ie.replace(/[a-zA-Z]/g,function(De){var Me=De.charCodeAt(0);return"["+String.fromCharCode(Me&~32,Me|32)+"]"}))}return Re.join("")}for(var Ke=[],Ee=0,xe=ne.length;Ee<xe;++Ee){var _e=ne[Ee];if(_e.global||_e.multiline)throw new Error(""+_e);Ke.push("(?:"+ze(_e)+")")}return new RegExp(Ke.join("|"),Z?"gi":"g")}function B(ne,J){var V=/(?:^|\s)nocode(?:\s|$)/,Z=[],Ee=0,xe=[],_e=0;function Ne(Be){var We=Be.nodeType;if(We==1){if(V.test(Be.className))return;for(var Ue=Be.firstChild;Ue;Ue=Ue.nextSibling)Ne(Ue);var ze=Be.nodeName.toLowerCase();(ze==="br"||ze==="li")&&(Z[_e]=`
`,xe[_e<<1]=Ee++,xe[_e++<<1|1]=Be)}else if(We==3||We==4){var Ke=Be.nodeValue;Ke.length&&(J?Ke=Ke.replace(/\r\n?/g,`
`):Ke=Ke.replace(/[ \t\r\n]+/g," "),Z[_e]=Ke,xe[_e<<1]=Ee,Ee+=Ke.length,xe[_e++<<1|1]=Be)}}return Ne(ne),{sourceCode:Z.join("").replace(/\n$/,""),spans:xe}}function W(ne,J,V,Z,Ee){if(!V)return;var xe={sourceNode:ne,pre:1,langExtension:null,numberLines:null,sourceCode:V,spans:null,basePos:J,decorations:null};Z(xe),Ee.push.apply(Ee,xe.decorations)}var te=/\S/;function de(ne){for(var J=void 0,V=ne.firstChild;V;V=V.nextSibling){var Z=V.nodeType;J=Z===1?J?ne:V:Z===3&&te.test(V.nodeValue)?ne:J}return J===ne?void 0:J}function fe(ne,J){var V={},Z;(function(){for(var _e=ne.concat(J),Ne=[],Be={},We=0,Ue=_e.length;We<Ue;++We){var ze=_e[We],Ke=ze[3];if(Ke)for(var Ye=Ke.length;--Ye>=0;)V[Ke.charAt(Ye)]=ze;var Re=ze[1],tt=""+Re;Be.hasOwnProperty(tt)||(Ne.push(Re),Be[tt]=null)}Ne.push(/[\0-\uffff]/),Z=U(Ne)})();var Ee=J.length,xe=function(_e){for(var Ne=_e.sourceCode,Be=_e.basePos,We=_e.sourceNode,Ue=[Be,_],ze=0,Ke=Ne.match(Z)||[],Ye={},Re=0,tt=Ke.length;Re<tt;++Re){var rt=Ke[Re],He=Ye[rt],$e=void 0,Ie;if(typeof He=="string")Ie=!1;else{var Oe=V[rt.charAt(0)];if(Oe)$e=rt.match(Oe[1]),He=Oe[0];else{for(var Le=0;Le<Ee;++Le)if(Oe=J[Le],$e=rt.match(Oe[1]),$e){He=Oe[0];break}$e||(He=_)}Ie=He.length>=5&&He.substring(0,5)==="lang-",Ie&&!($e&&typeof $e[1]=="string")&&(Ie=!1,He=L),Ie||(Ye[rt]=He)}var Te=ze;if(ze+=rt.length,!Ie)Ue.push(Be+Te,He);else{var Ae=$e[1],De=rt.indexOf(Ae),Me=De+Ae.length;$e[2]&&(Me=rt.length-$e[2].length,De=Me-Ae.length);var Fe=He.substring(5);W(We,Be+Te,rt.substring(0,De),xe,Ue),W(We,Be+Te+De,Ae,ae(Fe,Ae),Ue),W(We,Be+Te+Me,rt.substring(Me),xe,Ue)}}_e.decorations=Ue};return xe}function be(ne){var J=[],V=[];ne.tripleQuotedStrings?J.push([i,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ne.multiLineStrings?J.push([i,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):J.push([i,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ne.verbatimStrings&&V.push([i,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Z=ne.hashComments;Z&&(ne.cStyleComments?(Z>1?J.push([D,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):J.push([D,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),V.push([i,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):J.push([D,/^#[^\r\n]*/,null,"#"])),ne.cStyleComments&&(V.push([D,/^\/\/[^\r\n]*/,null]),V.push([D,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ee=ne.regexLiterals;if(Ee){var xe=Ee>1?"":`
\r`,_e=xe?".":"[\\S\\s]",Ne="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+_e+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+_e+")*(?:\\x5D|$))+/";V.push(["lang-regex",RegExp("^"+G+"("+Ne+")")])}var Be=ne.types;Be&&V.push([c,Be]);var We=(""+ne.keywords).replace(/^ | $/g,"");We.length&&V.push([k,new RegExp("^(?:"+We.replace(/[\s,]+/g,"|")+")\\b"),null]),J.push([_,/^\s+/,null,` \r
\xA0`]);var Ue="^.[^\\s\\w.$@'\"`/\\\\]*";return ne.regexLiterals&&(Ue+="(?!s*/)"),V.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[c,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[_,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[_,/^\\[\s\S]?/,null],[x,new RegExp(Ue),null]),fe(J,V)}var Ce=be({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ue(ne,J,V){for(var Z=/(?:^|\s)nocode(?:\s|$)/,Ee=/\r\n?|\n/,xe=ne.ownerDocument,_e=xe.createElement("li");ne.firstChild;)_e.appendChild(ne.firstChild);var Ne=[_e];function Be(Re){var tt=Re.nodeType;if(tt==1&&!Z.test(Re.className))if(Re.nodeName==="br")We(Re),Re.parentNode&&Re.parentNode.removeChild(Re);else for(var rt=Re.firstChild;rt;rt=rt.nextSibling)Be(rt);else if((tt==3||tt==4)&&V){var He=Re.nodeValue,$e=He.match(Ee);if($e){var Ie=He.substring(0,$e.index);Re.nodeValue=Ie;var Oe=He.substring($e.index+$e[0].length);if(Oe){var Le=Re.parentNode;Le.insertBefore(xe.createTextNode(Oe),Re.nextSibling)}We(Re),Ie||Re.parentNode.removeChild(Re)}}}function We(Re){for(;!Re.nextSibling;)if(Re=Re.parentNode,!Re)return;function tt($e,Ie){var Oe=Ie?$e.cloneNode(!1):$e,Le=$e.parentNode;if(Le){var Te=tt(Le,1),Ae=$e.nextSibling;Te.appendChild(Oe);for(var De=Ae;De;De=Ae)Ae=De.nextSibling,Te.appendChild(De)}return Oe}for(var rt=tt(Re.nextSibling,0),He;(He=rt.parentNode)&&He.nodeType===1;)rt=He;Ne.push(rt)}for(var Ue=0;Ue<Ne.length;++Ue)Be(Ne[Ue]);J===(J|0)&&Ne[0].setAttribute("value",J);var ze=xe.createElement("ol");ze.className="linenums";for(var Ke=Math.max(0,J-1|0)||0,Ue=0,Ye=Ne.length;Ue<Ye;++Ue)_e=Ne[Ue],_e.className="L"+(Ue+Ke)%10,_e.firstChild||_e.appendChild(xe.createTextNode("\xA0")),ze.appendChild(_e);ne.appendChild(ze)}function ge(ne){var J=/\bMSIE\s(\d+)/.exec(navigator.userAgent);J=J&&+J[1]<=8;var V=/\n/g,Z=ne.sourceCode,Ee=Z.length,xe=0,_e=ne.spans,Ne=_e.length,Be=0,We=ne.decorations,Ue=We.length,ze=0;We[Ue]=Ee;var Ke,Ye;for(Ye=Ke=0;Ye<Ue;)We[Ye]!==We[Ye+2]?(We[Ke++]=We[Ye++],We[Ke++]=We[Ye++]):Ye+=2;for(Ue=Ke,Ye=Ke=0;Ye<Ue;){for(var Re=We[Ye],tt=We[Ye+1],rt=Ye+2;rt+2<=Ue&&We[rt+1]===tt;)rt+=2;We[Ke++]=Re,We[Ke++]=tt,Ye=rt}Ue=We.length=Ke;var He=ne.sourceNode,$e="";He&&($e=He.style.display,He.style.display="none");try{for(var Ie=null;Be<Ne;){var Oe=_e[Be],Le=_e[Be+2]||Ee,Te=We[ze+2]||Ee,rt=Math.min(Le,Te),Ae=_e[Be+1],De;if(Ae.nodeType!==1&&(De=Z.substring(xe,rt))){J&&(De=De.replace(V,"\r")),Ae.nodeValue=De;var Me=Ae.ownerDocument,Fe=Me.createElement("span");Fe.className=We[ze+1];var Xe=Ae.parentNode;Xe.replaceChild(Fe,Ae),Fe.appendChild(Ae),xe<Le&&(_e[Be+1]=Ae=Me.createTextNode(Z.substring(rt,Le)),Xe.insertBefore(Ae,Fe.nextSibling))}xe=rt,xe>=Le&&(Be+=2),xe>=Te&&(ze+=2)}}finally{He&&(He.style.display=$e)}}var pe={};function oe(ne,J){for(var V=J.length;--V>=0;){var Z=J[V];pe.hasOwnProperty(Z)?p.console&&console.warn("cannot override language handler %s",Z):pe[Z]=ne}}function ae(ne,J){return ne&&pe.hasOwnProperty(ne)||(ne=/^\s*</.test(J)?"default-markup":"default-code"),pe[ne]}oe(Ce,["default-code"]),oe(fe([],[[_,/^[^<?]+/],[F,/^<!\w[^>]*(?:>|$)/],[D,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),oe(fe([[_,/^[\s]+/,null,` \r
`],[z,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[j,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[X,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),oe(fe([],[[z,/^[\s\S]+/]]),["uq.val"]),oe(be({keywords:h,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),oe(be({keywords:"null,true,false"}),["json"]),oe(be({keywords:f,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),oe(be({keywords:d,cStyleComments:!0}),["java"]),oe(be({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),oe(be({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),oe(be({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),oe(be({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),oe(be({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),oe(be({keywords:E,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),oe(fe([],[[i,/^[\s\S]+/]]),["regex"]);function re(ne){var J=ne.langExtension;try{var V=B(ne.sourceNode,ne.pre),Z=V.sourceCode;ne.sourceCode=Z,ne.spans=V.spans,ne.basePos=0,ae(J,Z)(ne),ge(ne)}catch(Ee){p.console&&console.log(Ee&&Ee.stack||Ee)}}function he(ne,J,V){var Z=V||!1,Ee=J||null,xe=document.createElement("div");xe.innerHTML="<pre>"+ne+"</pre>",xe=xe.firstChild,Z&&ue(xe,Z,!0);var _e={langExtension:Ee,numberLines:Z,sourceNode:xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return re(_e),xe.innerHTML}function Q(ne,J){var V=J||document.body,Z=V.ownerDocument||document;function Ee(Oe){return V.getElementsByTagName(Oe)}for(var xe=[Ee("pre"),Ee("code"),Ee("xmp")],_e=[],Ne=0;Ne<xe.length;++Ne)for(var Be=0,We=xe[Ne].length;Be<We;++Be)_e.push(xe[Ne][Be]);xe=null;var Ue=Date;Ue.now||(Ue={now:function(){return+new Date}});var ze=0,Ke=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ye=/\bprettyprint\b/,Re=/\bprettyprinted\b/,tt=/pre|xmp/i,rt=/^code$/i,He=/^(?:pre|code|xmp)$/i,$e={};function Ie(){for(var Oe=p.PR_SHOULD_USE_CONTINUATION?Ue.now()+250:Infinity;ze<_e.length&&Ue.now()<Oe;ze++){for(var Le=_e[ze],Te=$e,Ae=Le;Ae=Ae.previousSibling;){var De=Ae.nodeType,Me=(De===7||De===8)&&Ae.nodeValue;if(Me?!/^\??prettify\b/.test(Me):De!==3||/\S/.test(Ae.nodeValue))break;if(Me){Te={},Me.replace(/\b(\w+)=([\w:.%+-]+)/g,function($t,At,Rt){Te[At]=Rt});break}}var Fe=Le.className;if((Te!==$e||Ye.test(Fe))&&!Re.test(Fe)){for(var Xe=!1,qe=Le.parentNode;qe;qe=qe.parentNode){var pt=qe.tagName;if(He.test(pt)&&qe.className&&Ye.test(qe.className)){Xe=!0;break}}if(!Xe){Le.className+=" prettyprinted";var at=Te.lang;if(!at){at=Fe.match(Ke);var ft;!at&&(ft=de(Le))&&rt.test(ft.tagName)&&(at=ft.className.match(Ke)),at&&(at=at[1])}var Et;if(tt.test(Le.tagName))Et=1;else{var xt=Le.currentStyle,lt=Z.defaultView,Wt=xt?xt.whiteSpace:lt&&lt.getComputedStyle?lt.getComputedStyle(Le,null).getPropertyValue("white-space"):0;Et=Wt&&Wt.substring(0,3)==="pre"}var It=Te.linenums;(It=It==="true"||+It)||(It=Fe.match(/\blinenums\b(?::(\d+))?/),It=It?It[1]&&It[1].length?+It[1]:!0:!1),It&&ue(Le,It,Et);var ir={langExtension:at,sourceNode:Le,numberLines:It,pre:Et,sourceCode:null,basePos:null,spans:null,decorations:null};re(ir)}}}ze<_e.length?p.setTimeout(Ie,250):typeof ne=="function"&&ne()}Ie()}var ie=p.PR={createSimpleLexer:fe,registerLangHandler:oe,sourceDecorator:be,PR_ATTRIB_NAME:X,PR_ATTRIB_VALUE:z,PR_COMMENT:D,PR_DECLARATION:F,PR_KEYWORD:k,PR_LITERAL:b,PR_NOCODE:H,PR_PLAIN:_,PR_PUNCTUATION:x,PR_SOURCE:L,PR_STRING:i,PR_TAG:j,PR_TYPE:c,prettyPrintOne:S?p.prettyPrintOne=he:g=he,prettyPrint:C=S?p.prettyPrint=Q:C=Q},we=p.define;typeof we=="function"&&we.amd&&we("google-code-prettify",[],function(){return ie})})()},T1X5:function(I,q){I.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAALdklEQVR4Xu2dC2wc1RVAzx1nDXFiO4SEhqxtxS0JHzX94TS0FEKLALX8WkKbqrRVKQrh15Zfq0IqIaSGSOXb8ktANFJbKqUFWigEAUohfFRQDC1KxS8UR/7wDbZ3TRxix3urN951No7Xnt15M7Mbz0hRImXevffds/PmzXv33StU0KWqTlcfh6mwkCHmq8M8B5oUZosyS6EeOCD7x/Rsl/kjkFJhu8AHGWiXDNuoYqsoW5K1vCkimUpxg5SzoW+r1gylOUGErygci9IC1Fi2uR+hVeA5VZ6tquOpuSL9lnVYE1d2wNo+0jnVylLNcKYKx6EcaK23XgQJH4vyjDg8OCDc3zxd3vXSLKx7ygJYW5seOGUmZ6GcJ8IShaqwHDCeHoEhVTYh3LO7mweam+XjqO2KFNjWPp09VblUlQuAmVE7YwL93SKs2SncMr9WPojK1kiAdWzXpCa40oHlCtOi6nwpegV2ZOBuGeSGxlnSVYoMP21CBfZmnx5SneFagXPzZnJ+7I+y7S6FdQMO1xxWK++HZUgowNzpeIoVKqwCDgqrcyHp6RFlZbKetWF8HgQOrD2liwTuAHdKvj9frVVTuHDuNGkNspOBAWtt1cShC1ilcLlqecz6gnSkkS3CkMBN77zBypYWGQxCXyDAuvq1KTPIeuCYIIyuAJnPOwmWJWuk3bat1oF1pfWMjLKuAqbptn05Wl63I5ybrJOHbCqyCqw9ratEucqMDjaNrGBZqsLqpjpZaasPVhyrqlVdKe5Wcafr8TXKA6KsS9azXESG/DrHN7CODp0qdaxXON2vMftze4F/aJpljY2y008/fQFr69EZCYeH3ZX0+JrQA2ZHYDDDac0HSe+ENxe4oWRg2SfriRhWca53t3HSnFTqk1YSMPedleZv8TBYHKzc3WZ4TNbxrVLeaSUB6+zV38cTjNJgjUBT1jXMkB8XK6VoYNmp+9XFKorv39cDKlxX7JS/KGDZj+K/x99Z1n5+6gjfLObj2jOw7HLTv+MVDGuwcoK6nQSf97qM5QmYWcj9xHyensRrg9YpjRL4/HtbOd7LgrEnYF1p/U1G+XnQVk9m+Y5wfbJOfjGRDyYEZvazHOFfk2WLZCKHBfX/Zmsmo3ypqV42j6djXGBmp7gzzQuTYPMxKA7Fym1tqGPxeDvX4wLr7NULVdzd4vgKyQOiXNQwQ+4spK4gMBMwc0CG1/bDGIyQXF+ymp5dDkcUCuwpCKwzpXcqbrxgfIXsAYU1TfVy4VhqxwRm4gZJ8L/9IBQtZFdbU7eLQT41VtzjmMDaU3qzwKXW1MeCivaAwi1N9XLZ6Ib7AHPDpzO0hRmR+/L78Ict8J93IT1QdN+sN6irhs/NgR8uhM8eYl28J4EmwninQ/PosPB9gHWmdZUqoS3u/uUVuPEFKMcDWg5wxWL4zlGefGz9JhGuaxgVD7IXsOwpEhMvHsrBBPNknf9IecLKed9Au+vUyJ607t3dJPNPzewFrCOl3wPutf5TKSDwio3wdF7k3imfhMNnugGZkV2q8Ho3PPbWHhOOb4IbT4zMpHMa6+XPOe17A+vVjQhfC8u0E+/d884ysH69JCzNE+v51aY90Mw7beM5E7cJ5A7ln40zZOTnMgLMnHxMDNEZ5mG6RSbcNHv9tAV+sDCQLpck9I9b4Hd5UfKbIwrgM4cKB6toyJ0EHQHWkdJLgFtL6l2JjfKB/WwRfP/TJQoKoNmf/gu/zVuGjQqY6ZrjcEmyVm43/x4B1pnSxxVOCqDvBUXGwLx5W+CJhno5eQSYe1q/jw/DPgAeA/MGDOHjqloONtkN3CesI6XfAB7x2NzabV6B3fca3LoZ+ndbU+0KmpaAn7TA0iP2lVtOQ2LWulMb62WDC6wzrdfp8CGGUC+vwL56L3wU0ArI9Gp4cowZYLkBE2F1Q51cPfyEpXUTyvGh0gK8ArvgUXgxoGwZX5gDa79eAU+Y8HRjnSyR7K5yXwAZZibk7xXYjkHY2Abmb5uXGRJPnAfTqisAGPQ31FErnWldoMrrNh3hVZZXYF7l2byv3IZEd4YoHC4dfbqUDPfZ7KxXWTEwr57K3udwtnT06i8RVhfZ1MrtMbAi3ahcJe1pXSPKiiKbWrk9BlacG1VYa95hG1QZY55UnLBS7vYK7JXtwxuc/ZYnHTWJ4U3Ko2ZVxKTDvMMelY60bs7mISzF577aeAV25l/h7Y98qSrYeO50ePDblQHMzevYmVITDjAvGHeMLzUGVpzXBbZJR0p7gBnFNbVzt1dgr+aGRMtLUzVThofEI8cYEh9/C1ZuGu7n7BrYsMxOn31K6TXAdkTx0WwM9wrMZydLaj6UgTtegje64UefgaPnlCTGdqN+A8z8biPJAFrOwGx72pK8oRiYJU+GJMYFFg+JIXnbghp3SOyO6sCD1yFxxwBs3BbA4m91dvE3YcGV4YjoqYhp/YpH4aWAtlfMZGJNJMsGxRMentZXwIdzFBuYxbszhBbuh3MFLE25IQKtwSxNmRCBs8cIEQjB/UWrcJem4sXfvf32Qhdc8jjcdjIsThbt00AbuIu/8fZK5QDDbK/EG5gVBMxsYMYhApUDzA0RqIQgnEBfDKOEl/E7bDgIx9hb7mFuMTA3qH44zM04o9wDSWNgbsRUXiBpmYdq2wZmhr1C16sfwu0vwsVHw5EHF74vgin/nlDtcjgMEeb5sPw1zFJ/DKEePxp9GMIdFiM4bhTVCUyvT9gR4zxhx4T4Ub3PcSMDrKtPL85kuK3UX1wp7fyccTaHGE5uBhP5ZPMqx1nimAf6ojgy+/J7cP6G0rMILJ4Lt51iExeUG7CCR2bd6X3Ih9KNTj95OmZOhce+u38Do9ChdBdYyGkfcq4uJRPO9ARc9kU4Y8F+DgwKp30IO7GKXVfbkVZmQ+L4iVWyH9Ghpi6y42Z7UsoJ2ISpi0y3o0gOZs/d/iWVCzDPycFMl+P0e/7B+5XgOf2eO/mIE1z69bff9sUluMw+ZXdKnELWr+NLal90ClmjJU7SXJKvbTQqLUmzO2OM06DbAFCUjJLToBstcaGBonxt42Z/hQay77K4lIcNFBPIsFLKI6cjLpYTBjGub7RRLMeYGpejChyY3XJUxty44Ftg0OwXfMsbGs/IKHFJRXvsgiupmLMxLlpqkVbQRUtzpsZlgf1Dk7DKAme/z+LC2z6YhV54210g7tCpUkdc2r5IcJGUts/Z2NajMxIODyscW6Tdk/J2A2sww2nNB0lvqQ7wXTQj+6StVzi9VCMmQzszDGqaZY2NstNPf30DM8qfVJ0yP8VdKkRUP8GPC4JvayYYyXqWi8iQX21WgI2a8pvs3Fbl+u1khO1VhdVNo0pK+bHHumO70mo+rk1VlVBKWvnpfMBtux3h3GSdPGRTj3VgectY64FjbBpbQbKedxIsS9ZIXrEtO9YHAsyYZhaMD13AKoXLJ0uVdbNFInDTO2+wsqVFLOdPHQYeGLCR91pKFwlu8e4WO7+xspXSqnDRRKXp/VofODBjoNm57kqxQoVVUeW18uuocdr3iLIyWc/a8UrS29IfCrCcsSawpzrDtYI7/T/AVicikrNLYd2AwzWFqpoHYVeowHIdMHGPmuBKB5aHWX7YhgNNRG4G7pZBbhirMLYNHePJiARYziA3LFy5VJULKuAzoFuENTuFW0bXVg4aUr78SIHlDMmemjkL5TwRloRZh3OCX/OQKpsQ7tndzQP55XnDhFR2wPINMidBq5WlmuFMFY4Lu2qgqYYnyjPi8OCAcH+uWGhUgEbrLYsnrJAz3OwGaU5AOQ6HL2cLItRYdl6/m8AfnlPl2ao6njKlCy3rsCaurIGN7qX7edDHYSosZIj56jDPgSaF2aLM0uH8+6YaWG4GugsYEOhVYbvABxlolwzbqGKrKFuStbwZxnTcFrH/A8wNv8JI/KKJAAAAAElFTkSuQmCC"},"VrN/":function(I,q,M){(function(P,m){I.exports=m()})(this,function(){"use strict";var P=navigator.userAgent,m=navigator.platform,S=/gecko\/\d/i.test(P),R=/MSIE \d/.test(P),T=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(P),g=/Edge\/(\d+)/.exec(P),C=R||T||g,p=C&&(R?document.documentMode||6:+(g||T)[1]),s=!g&&/WebKit\//.test(P),a=s&&/Qt\/\d+\.\d+/.test(P),r=!g&&/Chrome\//.test(P),h=/Opera\//.test(P),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(P),E=/PhantomJS/.test(P),y=!g&&/AppleWebKit/.test(P)&&/Mobile\/\w+/.test(P),l=/Android/.test(P),n=y||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(P),o=y||/Mac/.test(m),u=/\bCrOS\b/.test(P),w=/win/i.test(m),v=h&&P.match(/Version\/(\d*\.\d*)/);v&&(v=Number(v[1])),v&&v>=15&&(h=!1,s=!0);var i=o&&(a||h&&(v==null||v<12.11)),k=S||C&&p>=9;function D(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var c=function(e,t){var O=e.className,A=D(t).exec(O);if(A){var N=O.slice(A.index+A[0].length);e.className=O.slice(0,A.index)+(N?A[1]+N:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return b(e).appendChild(t)}function _(e,t,O,A){var N=document.createElement(e);if(O&&(N.className=O),A&&(N.style.cssText=A),typeof t=="string")N.appendChild(document.createTextNode(t));else if(t)for(var $=0;$<t.length;++$)N.appendChild(t[$]);return N}function j(e,t,O,A){var N=_(e,t,O,A);return N.setAttribute("role","presentation"),N}var F;document.createRange?F=function(e,t,O,A){var N=document.createRange();return N.setEnd(A||e,O),N.setStart(e,t),N}:F=function(e,t,O){var A=document.body.createTextRange();try{A.moveToElementText(e.parentNode)}catch(N){return A}return A.collapse(!0),A.moveEnd("character",O),A.moveStart("character",t),A};function L(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function X(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function z(e,t){var O=e.className;D(t).test(O)||(e.className+=(O?" ":"")+t)}function H(e,t){for(var O=e.split(" "),A=0;A<O.length;A++)O[A]&&!D(O[A]).test(t)&&(t+=" "+O[A]);return t}var G=function(e){e.select()};y?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:C&&(G=function(e){try{e.select()}catch(t){}});function U(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function B(e,t,O){t||(t={});for(var A in e)e.hasOwnProperty(A)&&(O!==!1||!t.hasOwnProperty(A))&&(t[A]=e[A]);return t}function W(e,t,O,A,N){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var $=A||0,le=N||0;;){var me=e.indexOf(" ",$);if(me<0||me>=t)return le+(t-$);le+=me-$,le+=O-le%O,$=me+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,t){this.f=t;var O=+new Date+e;(!this.id||O<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=O)};function de(e,t){for(var O=0;O<e.length;++O)if(e[O]==t)return O;return-1}var fe=50,be={toString:function(){return"CodeMirror.Pass"}},Ce={scroll:!1},ue={origin:"*mouse"},ge={origin:"+move"};function pe(e,t,O){for(var A=0,N=0;;){var $=e.indexOf(" ",A);$==-1&&($=e.length);var le=$-A;if($==e.length||N+le>=t)return A+Math.min(le,t-N);if(N+=$-A,N+=O-N%O,A=$+1,N>=t)return A}}var oe=[""];function ae(e){for(;oe.length<=e;)oe.push(re(oe)+" ");return oe[e]}function re(e){return e[e.length-1]}function he(e,t){for(var O=[],A=0;A<e.length;A++)O[A]=t(e[A],A);return O}function Q(e,t,O){for(var A=0,N=O(t);A<e.length&&O(e[A])<=N;)A++;e.splice(A,0,t)}function ie(){}function we(e,t){var O;return Object.create?O=Object.create(e):(ie.prototype=e,O=new ie),t&&B(t,O),O}var ne=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function J(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ne.test(e))}function V(e,t){return t?t.source.indexOf("\\w")>-1&&J(e)?!0:t.test(e):J(e)}function Z(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ee=/[\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 xe(e){return e.charCodeAt(0)>=768&&Ee.test(e)}function _e(e,t,O){for(;(O<0?t>0:t<e.length)&&xe(e.charAt(t));)t+=O;return t}function Ne(e,t,O){for(var A=t>O?-1:1;;){if(t==O)return t;var N=(t+O)/2,$=A<0?Math.ceil(N):Math.floor(N);if($==t)return e($)?t:O;e($)?O=$:t=$+A}}function Be(e,t,O,A){if(!e)return A(t,O,"ltr",0);for(var N=!1,$=0;$<e.length;++$){var le=e[$];(le.from<O&&le.to>t||t==O&&le.to==t)&&(A(Math.max(le.from,t),Math.min(le.to,O),le.level==1?"rtl":"ltr",$),N=!0)}N||A(t,O,"ltr")}var We=null;function Ue(e,t,O){var A;We=null;for(var N=0;N<e.length;++N){var $=e[N];if($.from<t&&$.to>t)return N;$.to==t&&($.from!=$.to&&O=="before"?A=N:We=N),$.from==t&&($.from!=$.to&&O!="before"?A=N:We=N)}return A!=null?A:We}var ze=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function O(Se){return Se<=247?e.charAt(Se):1424<=Se&&Se<=1524?"R":1536<=Se&&Se<=1785?t.charAt(Se-1536):1774<=Se&&Se<=2220?"r":8192<=Se&&Se<=8203?"w":Se==8204?"b":"L"}var A=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,N=/[stwN]/,$=/[LRr]/,le=/[Lb1n]/,me=/[1n]/;function ve(Se,ke,je){this.level=Se,this.from=ke,this.to=je}return function(Se,ke){var je=ke=="ltr"?"L":"R";if(Se.length==0||ke=="ltr"&&!A.test(Se))return!1;for(var Ve=Se.length,Ge=[],Qe=0;Qe<Ve;++Qe)Ge.push(O(Se.charCodeAt(Qe)));for(var it=0,ht=je;it<Ve;++it){var yt=Ge[it];yt=="m"?Ge[it]=ht:ht=yt}for(var _t=0,bt=je;_t<Ve;++_t){var Ot=Ge[_t];Ot=="1"&&bt=="r"?Ge[_t]="n":$.test(Ot)&&(bt=Ot,Ot=="r"&&(Ge[_t]="R"))}for(var Ut=1,jt=Ge[0];Ut<Ve-1;++Ut){var qt=Ge[Ut];qt=="+"&&jt=="1"&&Ge[Ut+1]=="1"?Ge[Ut]="1":qt==","&&jt==Ge[Ut+1]&&(jt=="1"||jt=="n")&&(Ge[Ut]=jt),jt=qt}for(var pr=0;pr<Ve;++pr){var Kr=Ge[pr];if(Kr==",")Ge[pr]="N";else if(Kr=="%"){var Er=void 0;for(Er=pr+1;Er<Ve&&Ge[Er]=="%";++Er);for(var pn=pr&&Ge[pr-1]=="!"||Er<Ve&&Ge[Er]=="1"?"1":"N",ln=pr;ln<Er;++ln)Ge[ln]=pn;pr=Er-1}}for(var Mr=0,un=je;Mr<Ve;++Mr){var Vr=Ge[Mr];un=="L"&&Vr=="1"?Ge[Mr]="L":$.test(Vr)&&(un=Vr)}for(var Br=0;Br<Ve;++Br)if(N.test(Ge[Br])){var Nr=void 0;for(Nr=Br+1;Nr<Ve&&N.test(Ge[Nr]);++Nr);for(var Sr=(Br?Ge[Br-1]:je)=="L",cn=(Nr<Ve?Ge[Nr]:je)=="L",zi=Sr==cn?Sr?"L":"R":je,si=Br;si<Nr;++si)Ge[si]=zi;Br=Nr-1}for(var qr=[],Hn,Gr=0;Gr<Ve;)if(le.test(Ge[Gr])){var Eo=Gr;for(++Gr;Gr<Ve&&le.test(Ge[Gr]);++Gr);qr.push(new ve(0,Eo,Gr))}else{var Yn=Gr,Si=qr.length,Ci=ke=="rtl"?1:0;for(++Gr;Gr<Ve&&Ge[Gr]!="L";++Gr);for(var an=Yn;an<Gr;)if(me.test(Ge[an])){Yn<an&&(qr.splice(Si,0,new ve(1,Yn,an)),Si+=Ci);var Vi=an;for(++an;an<Gr&&me.test(Ge[an]);++an);qr.splice(Si,0,new ve(2,Vi,an)),Si+=Ci,Yn=an}else++an;Yn<Gr&&qr.splice(Si,0,new ve(1,Yn,Gr))}return ke=="ltr"&&(qr[0].level==1&&(Hn=Se.match(/^\s+/))&&(qr[0].from=Hn[0].length,qr.unshift(new ve(0,0,Hn[0].length))),re(qr).level==1&&(Hn=Se.match(/\s+$/))&&(re(qr).to-=Hn[0].length,qr.push(new ve(0,Ve-Hn[0].length,Ve)))),ke=="rtl"?qr.reverse():qr}}();function Ke(e,t){var O=e.order;return O==null&&(O=e.order=ze(e.text,t)),O}var Ye=[],Re=function(e,t,O){if(e.addEventListener)e.addEventListener(t,O,!1);else if(e.attachEvent)e.attachEvent("on"+t,O);else{var A=e._handlers||(e._handlers={});A[t]=(A[t]||Ye).concat(O)}};function tt(e,t){return e._handlers&&e._handlers[t]||Ye}function rt(e,t,O){if(e.removeEventListener)e.removeEventListener(t,O,!1);else if(e.detachEvent)e.detachEvent("on"+t,O);else{var A=e._handlers,N=A&&A[t];if(N){var $=de(N,O);$>-1&&(A[t]=N.slice(0,$).concat(N.slice($+1)))}}}function He(e,t){var O=tt(e,t);if(!O.length)return;for(var A=Array.prototype.slice.call(arguments,2),N=0;N<O.length;++N)O[N].apply(null,A)}function $e(e,t,O){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),He(e,O||t.type,e,t),De(t)||t.codemirrorIgnore}function Ie(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var O=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),A=0;A<t.length;++A)de(O,t[A])==-1&&O.push(t[A])}function Oe(e,t){return tt(e,t).length>0}function Le(e){e.prototype.on=function(t,O){Re(this,t,O)},e.prototype.off=function(t,O){rt(this,t,O)}}function Te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Me(e){Te(e),Ae(e)}function Fe(e){return e.target||e.srcElement}function Xe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),o&&e.ctrlKey&&t==1&&(t=3),t}var qe=function(){if(C&&p<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}(),pt;function at(e){if(pt==null){var t=_("span","\u200B");x(e,_("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(C&&p<8))}var O=pt?_("span","\u200B"):_("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return O.setAttribute("cm-text",""),O}var ft;function Et(e){if(ft!=null)return ft;var t=x(e,document.createTextNode("A\u062EA")),O=F(t,0,1).getBoundingClientRect(),A=F(t,1,2).getBoundingClientRect();return b(e),!O||O.left==O.right?!1:ft=A.right-O.right<3}var xt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,O=[],A=e.length;t<=A;){var N=e.indexOf(`
`,t);N==-1&&(N=e.length);var $=e.slice(t,e.charAt(N-1)=="\r"?N-1:N),le=$.indexOf("\r");le!=-1?(O.push($.slice(0,le)),t+=le+1):(O.push($),t=N+1)}return O}:function(e){return e.split(/\r\n?|\n/)},lt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(O){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Wt=function(){var e=_("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),It=null;function ir(e){if(It!=null)return It;var t=x(e,_("span","x")),O=t.getBoundingClientRect(),A=F(t,0,1).getBoundingClientRect();return It=Math.abs(O.left-A.left)>1}var $t={},At={};function Rt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),$t[e]=t}function hr(e,t){At[e]=t}function St(e){if(typeof e=="string"&&At.hasOwnProperty(e))e=At[e];else if(e&&typeof e.name=="string"&&At.hasOwnProperty(e.name)){var t=At[e.name];typeof t=="string"&&(t={name:t}),e=we(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return St("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return St("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Je(e,t){t=St(t);var O=$t[t.name];if(!O)return Je(e,"text/plain");var A=O(e,t);if(dt.hasOwnProperty(t.name)){var N=dt[t.name];for(var $ in N){if(!N.hasOwnProperty($))continue;A.hasOwnProperty($)&&(A["_"+$]=A[$]),A[$]=N[$]}}if(A.name=t.name,t.helperType&&(A.helperType=t.helperType),t.modeProps)for(var le in t.modeProps)A[le]=t.modeProps[le];return A}var dt={};function Ct(e,t){var O=dt.hasOwnProperty(e)?dt[e]:dt[e]={};B(t,O)}function Xt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var O={};for(var A in t){var N=t[A];N instanceof Array&&(N=N.concat([])),O[A]=N}return O}function Jt(e,t){for(var O;e.innerMode&&!(O=e.innerMode(t),!O||O.mode==e);)t=O.state,e=O.mode;return O||{mode:e,state:t}}function Mt(e,t,O){return e.startState?e.startState(t,O):!0}var Pt=function(e,t,O){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=O};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.prototype.eat=function(e){var t=this.string.charAt(this.pos),O;if(typeof e=="string"?O=t==e:O=t&&(e.test?e.test(t):e(t)),O)return++this.pos,t},Pt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,t,O){if(typeof e=="string"){var A=function(le){return O?le.toLowerCase():le},N=this.string.substr(this.pos,e.length);if(A(N)==A(e))return t!==!1&&(this.pos+=e.length),!0}else{var $=this.string.slice(this.pos).match(e);return $&&$.index>0?null:($&&t!==!1&&(this.pos+=$[0].length),$)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function gt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var O=e;!O.lines;)for(var A=0;;++A){var N=O.children[A],$=N.chunkSize();if(t<$){O=N;break}t-=$}return O.lines[t]}function Bt(e,t,O){var A=[],N=t.line;return e.iter(t.line,O.line+1,function($){var le=$.text;N==O.line&&(le=le.slice(0,O.ch)),N==t.line&&(le=le.slice(t.ch)),A.push(le),++N}),A}function fr(e,t,O){var A=[];return e.iter(t,O,function(N){A.push(N.text)}),A}function ar(e,t){var O=t-e.height;if(O)for(var A=e;A;A=A.parent)A.height+=O}function Gt(e){if(e.parent==null)return null;for(var t=e.parent,O=de(t.lines,e),A=t.parent;A;t=A,A=A.parent)for(var N=0;!(A.children[N]==t);++N)O+=A.children[N].chunkSize();return O+t.first}function mr(e,t){var O=e.first;e:do{for(var A=0;A<e.children.length;++A){var N=e.children[A],$=N.height;if(t<$){e=N;continue e}t-=$,O+=N.chunkSize()}return O}while(!e.lines);for(var le=0;le<e.lines.length;++le){var me=e.lines[le],ve=me.height;if(t<ve)break;t-=ve}return O+le}function zt(e,t){return t>=e.first&&t<e.first+e.size}function Ur(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function nt(e,t,O){if(O===void 0&&(O=null),!(this instanceof nt))return new nt(e,t,O);this.line=e,this.ch=t,this.sticky=O}function kt(e,t){return e.line-t.line||e.ch-t.ch}function zr(e,t){return e.sticky==t.sticky&&kt(e,t)==0}function Pr(e){return nt(e.line,e.ch)}function Xr(e,t){return kt(e,t)<0?t:e}function Yr(e,t){return kt(e,t)<0?e:t}function ce(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function K(e,t){if(t.line<e.first)return nt(e.first,0);var O=e.first+e.size-1;return t.line>O?nt(O,gt(e,O).text.length):Y(t,gt(e,t.line).text.length)}function Y(e,t){var O=e.ch;return O==null||O>t?nt(e.line,t):O<0?nt(e.line,0):e}function ee(e,t){for(var O=[],A=0;A<t.length;A++)O[A]=K(e,t[A]);return O}var ye=function(e,t){this.state=e,this.lookAhead=t},se=function(e,t,O,A){this.state=t,this.doc=e,this.line=O,this.maxLookAhead=A||0,this.baseTokens=null,this.baseTokenPos=1};se.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},se.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},se.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},se.fromSaved=function(e,t,O){return t instanceof ye?new se(e,Xt(e.mode,t.state),O,t.lookAhead):new se(e,Xt(e.mode,t),O)},se.prototype.save=function(e){var t=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ye(t,this.maxLookAhead):t};function Pe(e,t,O,A){var N=[e.state.modeGen],$={};Tr(e,t.text,e.doc.mode,O,function(Se,ke){return N.push(Se,ke)},$,A);for(var le=O.state,me=function(Se){O.baseTokens=N;var ke=e.state.overlays[Se],je=1,Ve=0;O.state=!0,Tr(e,t.text,ke.mode,O,function(Ge,Qe){for(var it=je;Ve<Ge;){var ht=N[je];ht>Ge&&N.splice(je,1,Ge,N[je+1],ht),je+=2,Ve=Math.min(Ge,ht)}if(!Qe)return;if(ke.opaque)N.splice(it,je-it,Ge,"overlay "+Qe),je=it+2;else for(;it<je;it+=2){var yt=N[it+1];N[it+1]=(yt?yt+" ":"")+"overlay "+Qe}},$),O.state=le,O.baseTokens=null,O.baseTokenPos=1},ve=0;ve<e.state.overlays.length;++ve)me(ve);return{styles:N,classes:$.bgClass||$.textClass?$:null}}function Ze(e,t,O){if(!t.styles||t.styles[0]!=e.state.modeGen){var A=mt(e,Gt(t)),N=t.text.length>e.options.maxHighlightLength&&Xt(e.doc.mode,A.state),$=Pe(e,t,A);N&&(A.state=N),t.stateAfter=A.save(!N),t.styles=$.styles,$.classes?t.styleClasses=$.classes:t.styleClasses&&(t.styleClasses=null),O===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function mt(e,t,O){var A=e.doc,N=e.display;if(!A.mode.startState)return new se(A,!0,t);var $=_r(e,t,O),le=$>A.first&&gt(A,$-1).stateAfter,me=le?se.fromSaved(A,le,$):new se(A,Mt(A.mode),$);return A.iter($,t,function(ve){Tt(e,ve.text,me);var Se=me.line;ve.stateAfter=Se==t-1||Se%5==0||Se>=N.viewFrom&&Se<N.viewTo?me.save():null,me.nextLine()}),O&&(A.modeFrontier=me.line),me}function Tt(e,t,O,A){var N=e.doc.mode,$=new Pt(t,e.options.tabSize,O);for($.start=$.pos=A||0,t==""&&et(N,O.state);!$.eol();)Dt(N,$,O.state),$.start=$.pos}function et(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var O=Jt(e,t);if(O.mode.blankLine)return O.mode.blankLine(O.state)}function Dt(e,t,O,A){for(var N=0;N<10;N++){A&&(A[0]=Jt(e,O).mode);var $=e.token(t,O);if(t.pos>t.start)return $}throw new Error("Mode "+e.name+" failed to advance stream.")}var Zt=function(e,t,O){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=O};function Yt(e,t,O,A){var N=e.doc,$=N.mode,le;t=K(N,t);var me=gt(N,t.line),ve=mt(e,t.line,O),Se=new Pt(me.text,e.options.tabSize,ve),ke;for(A&&(ke=[]);(A||Se.pos<t.ch)&&!Se.eol();)Se.start=Se.pos,le=Dt($,Se,ve.state),A&&ke.push(new Zt(Se,le,Xt(N.mode,ve.state)));return A?ke:new Zt(Se,le,ve.state)}function Cr(e,t){if(e)for(;;){var O=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!O)break;e=e.slice(0,O.index)+e.slice(O.index+O[0].length);var A=O[1]?"bgClass":"textClass";t[A]==null?t[A]=O[2]:new RegExp("(?:^|\\s)"+O[2]+"(?:$|\\s)").test(t[A])||(t[A]+=" "+O[2])}return e}function Tr(e,t,O,A,N,$,le){var me=O.flattenSpans;me==null&&(me=e.options.flattenSpans);var ve=0,Se=null,ke=new Pt(t,e.options.tabSize,A),je,Ve=e.options.addModeClass&&[null];for(t==""&&Cr(et(O,A.state),$);!ke.eol();){if(ke.pos>e.options.maxHighlightLength?(me=!1,le&&Tt(e,t,A,ke.pos),ke.pos=t.length,je=null):je=Cr(Dt(O,ke,A.state,Ve),$),Ve){var Ge=Ve[0].name;Ge&&(je="m-"+(je?Ge+" "+je:Ge))}if(!me||Se!=je){for(;ve<ke.start;)ve=Math.min(ke.start,ve+5e3),N(ve,Se);Se=je}ke.start=ke.pos}for(;ve<ke.pos;){var Qe=Math.min(ke.pos,ve+5e3);N(Qe,Se),ve=Qe}}function _r(e,t,O){for(var A,N,$=e.doc,le=O?-1:t-(e.doc.mode.innerMode?1e3:100),me=t;me>le;--me){if(me<=$.first)return $.first;var ve=gt($,me-1),Se=ve.stateAfter;if(Se&&(!O||me+(Se instanceof ye?Se.lookAhead:0)<=$.modeFrontier))return me;var ke=W(ve.text,null,e.options.tabSize);(N==null||A>ke)&&(N=me-1,A=ke)}return N}function en(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var O=e.first,A=t-1;A>O;A--){var N=gt(e,A).stateAfter;if(N&&(!(N instanceof ye)||A+N.lookAhead<t)){O=A+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,O)}var Rn=!1,gr=!1;function $r(){Rn=!0}function mn(){gr=!0}function gn(e,t,O){this.marker=e,this.from=t,this.to=O}function jr(e,t){if(e)for(var O=0;O<e.length;++O){var A=e[O];if(A.marker==t)return A}}function Ar(e,t){for(var O,A=0;A<e.length;++A)e[A]!=t&&(O||(O=[])).push(e[A]);return O}function rr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function br(e,t,O){var A;if(e)for(var N=0;N<e.length;++N){var $=e[N],le=$.marker,me=$.from==null||(le.inclusiveLeft?$.from<=t:$.from<t);if(me||$.from==t&&le.type=="bookmark"&&(!O||!$.marker.insertLeft)){var ve=$.to==null||(le.inclusiveRight?$.to>=t:$.to>t);(A||(A=[])).push(new gn(le,$.from,ve?null:$.to))}}return A}function Or(e,t,O){var A;if(e)for(var N=0;N<e.length;++N){var $=e[N],le=$.marker,me=$.to==null||(le.inclusiveRight?$.to>=t:$.to>t);if(me||$.from==t&&le.type=="bookmark"&&(!O||$.marker.insertLeft)){var ve=$.from==null||(le.inclusiveLeft?$.from<=t:$.from<t);(A||(A=[])).push(new gn(le,ve?null:$.from-t,$.to==null?null:$.to-t))}}return A}function Jr(e,t){if(t.full)return null;var O=zt(e,t.from.line)&&gt(e,t.from.line).markedSpans,A=zt(e,t.to.line)&&gt(e,t.to.line).markedSpans;if(!O&&!A)return null;var N=t.from.ch,$=t.to.ch,le=kt(t.from,t.to)==0,me=br(O,N,le),ve=Or(A,$,le),Se=t.text.length==1,ke=re(t.text).length+(Se?N:0);if(me)for(var je=0;je<me.length;++je){var Ve=me[je];if(Ve.to==null){var Ge=jr(ve,Ve.marker);Ge?Se&&(Ve.to=Ge.to==null?null:Ge.to+ke):Ve.to=N}}if(ve)for(var Qe=0;Qe<ve.length;++Qe){var it=ve[Qe];if(it.to!=null&&(it.to+=ke),it.from==null){var ht=jr(me,it.marker);ht||(it.from=ke,Se&&(me||(me=[])).push(it))}else it.from+=ke,Se&&(me||(me=[])).push(it)}me&&(me=tn(me)),ve&&ve!=me&&(ve=tn(ve));var yt=[me];if(!Se){var _t=t.text.length-2,bt;if(_t>0&&me)for(var Ot=0;Ot<me.length;++Ot)me[Ot].to==null&&(bt||(bt=[])).push(new gn(me[Ot].marker,null,null));for(var Ut=0;Ut<_t;++Ut)yt.push(bt);yt.push(ve)}return yt}function tn(e){for(var t=0;t<e.length;++t){var O=e[t];O.from!=null&&O.from==O.to&&O.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function rn(e,t,O){var A=null;if(e.iter(t.line,O.line+1,function(Ge){if(Ge.markedSpans)for(var Qe=0;Qe<Ge.markedSpans.length;++Qe){var it=Ge.markedSpans[Qe].marker;it.readOnly&&(!A||de(A,it)==-1)&&(A||(A=[])).push(it)}}),!A)return null;for(var N=[{from:t,to:O}],$=0;$<A.length;++$)for(var le=A[$],me=le.find(0),ve=0;ve<N.length;++ve){var Se=N[ve];if(kt(Se.to,me.from)<0||kt(Se.from,me.to)>0)continue;var ke=[ve,1],je=kt(Se.from,me.from),Ve=kt(Se.to,me.to);(je<0||!le.inclusiveLeft&&!je)&&ke.push({from:Se.from,to:me.from}),(Ve>0||!le.inclusiveRight&&!Ve)&&ke.push({from:me.to,to:Se.to}),N.splice.apply(N,ke),ve+=ke.length-3}return N}function li(e){var t=e.markedSpans;if(!t)return;for(var O=0;O<t.length;++O)t[O].marker.detachLine(e);e.markedSpans=null}function Ln(e,t){if(!t)return;for(var O=0;O<t.length;++O)t[O].marker.attachLine(e);e.markedSpans=t}function vr(e){return e.inclusiveLeft?-1:0}function tr(e){return e.inclusiveRight?1:0}function Dr(e,t){var O=e.lines.length-t.lines.length;if(O!=0)return O;var A=e.find(),N=t.find(),$=kt(A.from,N.from)||vr(e)-vr(t);if($)return-$;var le=kt(A.to,N.to)||tr(e)-tr(t);return le||t.id-e.id}function er(e,t){var O=gr&&e.markedSpans,A;if(O)for(var N=void 0,$=0;$<O.length;++$)N=O[$],N.marker.collapsed&&(t?N.from:N.to)==null&&(!A||Dr(A,N.marker)<0)&&(A=N.marker);return A}function wr(e){return er(e,!0)}function nr(e){return er(e,!1)}function Cn(e,t){var O=gr&&e.markedSpans,A;if(O)for(var N=0;N<O.length;++N){var $=O[N];$.marker.collapsed&&($.from==null||$.from<t)&&($.to==null||$.to>t)&&(!A||Dr(A,$.marker)<0)&&(A=$.marker)}return A}function Ir(e,t,O,A,N){var $=gt(e,t),le=gr&&$.markedSpans;if(le)for(var me=0;me<le.length;++me){var ve=le[me];if(!ve.marker.collapsed)continue;var Se=ve.marker.find(0),ke=kt(Se.from,O)||vr(ve.marker)-vr(N),je=kt(Se.to,A)||tr(ve.marker)-tr(N);if(ke>=0&&je<=0||ke<=0&&je>=0)continue;if(ke<=0&&(ve.marker.inclusiveRight&&N.inclusiveLeft?kt(Se.to,O)>=0:kt(Se.to,O)>0)||ke>=0&&(ve.marker.inclusiveRight&&N.inclusiveLeft?kt(Se.from,A)<=0:kt(Se.from,A)<0))return!0}}function Fr(e){for(var t;t=wr(e);)e=t.find(-1,!0).line;return e}function Bn(e){for(var t;t=nr(e);)e=t.find(1,!0).line;return e}function Tn(e){for(var t,O;t=nr(e);)e=t.find(1,!0).line,(O||(O=[])).push(e);return O}function ui(e,t){var O=gt(e,t),A=Fr(O);return O==A?t:Gt(A)}function Un(e,t){if(t>e.lastLine())return t;var O=gt(e,t),A;if(!_n(e,O))return t;for(;A=nr(O);)O=A.find(1,!0).line;return Gt(O)+1}function _n(e,t){var O=gr&&t.markedSpans;if(O)for(var A=void 0,N=0;N<O.length;++N){if(A=O[N],!A.marker.collapsed)continue;if(A.from==null)return!0;if(A.marker.widgetNode)continue;if(A.from==0&&A.marker.inclusiveLeft&&ci(e,t,A))return!0}}function ci(e,t,O){if(O.to==null){var A=O.marker.find(1,!0);return ci(e,A.line,jr(A.line.markedSpans,O.marker))}if(O.marker.inclusiveRight&&O.to==t.text.length)return!0;for(var N=void 0,$=0;$<t.markedSpans.length;++$)if(N=t.markedSpans[$],N.marker.collapsed&&!N.marker.widgetNode&&N.from==O.to&&(N.to==null||N.to!=O.from)&&(N.marker.inclusiveLeft||O.marker.inclusiveRight)&&ci(e,t,N))return!0}function vn(e){e=Fr(e);for(var t=0,O=e.parent,A=0;A<O.lines.length;++A){var N=O.lines[A];if(N==e)break;t+=N.height}for(var $=O.parent;$;O=$,$=O.parent)for(var le=0;le<$.children.length;++le){var me=$.children[le];if(me==O)break;t+=me.height}return t}function di(e){if(e.height==0)return 0;for(var t=e.text.length,O,A=e;O=wr(A);){var N=O.find(0,!0);A=N.from.line,t+=N.from.ch-N.to.ch}for(A=e;O=nr(A);){var $=O.find(0,!0);t-=A.text.length-$.from.ch,A=$.to.line,t+=A.text.length-$.to.ch}return t}function Ti(e){var t=e.display,O=e.doc;t.maxLine=gt(O,O.first),t.maxLineLength=di(t.maxLine),t.maxLineChanged=!0,O.iter(function(A){var N=di(A);N>t.maxLineLength&&(t.maxLineLength=N,t.maxLine=A)})}var Kn=function(e,t,O){this.text=e,Ln(this,t),this.height=O?O(this):1};Kn.prototype.lineNo=function(){return Gt(this)},Le(Kn);function Xi(e,t,O,A){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),li(e),Ln(e,O);var N=A?A(e):1;N!=e.height&&ar(e,N)}function Lt(e){e.parent=null,li(e)}var Ht={},Ft={};function Qt(e,t){if(!e||/^\s*$/.test(e))return null;var O=t.addModeClass?Ft:Ht;return O[e]||(O[e]=e.replace(/\S+/g,"cm-$&"))}function ct(e,t){var O=j("span",null,null,s?"padding-right: .1px":null),A={pre:j("pre",[O],"CodeMirror-line"),content:O,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var N=0;N<=(t.rest?t.rest.length:0);N++){var $=N?t.rest[N-1]:t.line,le=void 0;A.pos=0,A.addToken=ut,Et(e.display.measure)&&(le=Ke($,e.doc.direction))&&(A.addToken=Nt(A.addToken,le)),A.map=[];var me=t!=e.display.externalMeasured&&Gt($);Kt($,A,Ze(e,$,me)),$.styleClasses&&($.styleClasses.bgClass&&(A.bgClass=H($.styleClasses.bgClass,A.bgClass||"")),$.styleClasses.textClass&&(A.textClass=H($.styleClasses.textClass,A.textClass||""))),A.map.length==0&&A.map.push(0,0,A.content.appendChild(at(e.display.measure))),N==0?(t.measure.map=A.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(A.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var ve=A.content.lastChild;(/\bcm-tab\b/.test(ve.className)||ve.querySelector&&ve.querySelector(".cm-tab"))&&(A.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,t.line,A.pre),A.pre.className&&(A.textClass=H(A.pre.className,A.textClass||"")),A}function ot(e){var t=_("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ut(e,t,O,A,N,$,le){if(!t)return;var me=e.splitSpaces?wt(t,e.trailingSpace):t,ve=e.cm.state.specialChars,Se=!1,ke;if(!ve.test(t))e.col+=t.length,ke=document.createTextNode(me),e.map.push(e.pos,e.pos+t.length,ke),C&&p<9&&(Se=!0),e.pos+=t.length;else{ke=document.createDocumentFragment();for(var je=0;;){ve.lastIndex=je;var Ve=ve.exec(t),Ge=Ve?Ve.index-je:t.length-je;if(Ge){var Qe=document.createTextNode(me.slice(je,je+Ge));C&&p<9?ke.appendChild(_("span",[Qe])):ke.appendChild(Qe),e.map.push(e.pos,e.pos+Ge,Qe),e.col+=Ge,e.pos+=Ge}if(!Ve)break;je+=Ge+1;var it=void 0;if(Ve[0]==" "){var ht=e.cm.options.tabSize,yt=ht-e.col%ht;it=ke.appendChild(_("span",ae(yt),"cm-tab")),it.setAttribute("role","presentation"),it.setAttribute("cm-text"," "),e.col+=yt}else Ve[0]=="\r"||Ve[0]==`
`?(it=ke.appendChild(_("span",Ve[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),it.setAttribute("cm-text",Ve[0]),e.col+=1):(it=e.cm.options.specialCharPlaceholder(Ve[0]),it.setAttribute("cm-text",Ve[0]),C&&p<9?ke.appendChild(_("span",[it])):ke.appendChild(it),e.col+=1);e.map.push(e.pos,e.pos+1,it),e.pos++}}if(e.trailingSpace=me.charCodeAt(t.length-1)==32,O||A||N||Se||$||le){var _t=O||"";A&&(_t+=A),N&&(_t+=N);var bt=_("span",[ke],_t,$);if(le)for(var Ot in le)le.hasOwnProperty(Ot)&&Ot!="style"&&Ot!="class"&&bt.setAttribute(Ot,le[Ot]);return e.content.appendChild(bt)}e.content.appendChild(ke)}function wt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var O=t,A="",N=0;N<e.length;N++){var $=e.charAt(N);$==" "&&O&&(N==e.length-1||e.charCodeAt(N+1)==32)&&($="\xA0"),A+=$,O=$==" "}return A}function Nt(e,t){return function(O,A,N,$,le,me,ve){N=N?N+" cm-force-border":"cm-force-border";for(var Se=O.pos,ke=Se+A.length;;){for(var je=void 0,Ve=0;Ve<t.length&&!(je=t[Ve],je.to>Se&&je.from<=Se);Ve++);if(je.to>=ke)return e(O,A,N,$,le,me,ve);e(O,A.slice(0,je.to-Se),N,$,null,me,ve),$=null,A=A.slice(je.to-Se),Se=je.to}}}function st(e,t,O,A){var N=!A&&O.widgetNode;N&&e.map.push(e.pos,e.pos+t,N),!A&&e.cm.display.input.needsContentAttribute&&(N||(N=e.content.appendChild(document.createElement("span"))),N.setAttribute("cm-marker",O.id)),N&&(e.cm.display.input.setUneditable(N),e.content.appendChild(N)),e.pos+=t,e.trailingSpace=!1}function Kt(e,t,O){var A=e.markedSpans,N=e.text,$=0;if(!A){for(var le=1;le<O.length;le+=2)t.addToken(t,N.slice($,$=O[le]),Qt(O[le+1],t.cm.options));return}for(var me=N.length,ve=0,Se=1,ke="",je,Ve,Ge=0,Qe,it,ht,yt,_t;;){if(Ge==ve){Qe=it=ht=Ve="",_t=null,yt=null,Ge=Infinity;for(var bt=[],Ot=void 0,Ut=0;Ut<A.length;++Ut){var jt=A[Ut],qt=jt.marker;if(qt.type=="bookmark"&&jt.from==ve&&qt.widgetNode)bt.push(qt);else if(jt.from<=ve&&(jt.to==null||jt.to>ve||qt.collapsed&&jt.to==ve&&jt.from==ve)){if(jt.to!=null&&jt.to!=ve&&Ge>jt.to&&(Ge=jt.to,it=""),qt.className&&(Qe+=" "+qt.className),qt.css&&(Ve=(Ve?Ve+";":"")+qt.css),qt.startStyle&&jt.from==ve&&(ht+=" "+qt.startStyle),qt.endStyle&&jt.to==Ge&&(Ot||(Ot=[])).push(qt.endStyle,jt.to),qt.title&&((_t||(_t={})).title=qt.title),qt.attributes)for(var pr in qt.attributes)(_t||(_t={}))[pr]=qt.attributes[pr];qt.collapsed&&(!yt||Dr(yt.marker,qt)<0)&&(yt=jt)}else jt.from>ve&&Ge>jt.from&&(Ge=jt.from)}if(Ot)for(var Kr=0;Kr<Ot.length;Kr+=2)Ot[Kr+1]==Ge&&(it+=" "+Ot[Kr]);if(!yt||yt.from==ve)for(var Er=0;Er<bt.length;++Er)st(t,0,bt[Er]);if(yt&&(yt.from||0)==ve){if(st(t,(yt.to==null?me+1:yt.to)-ve,yt.marker,yt.from==null),yt.to==null)return;yt.to==ve&&(yt=!1)}}if(ve>=me)break;for(var pn=Math.min(me,Ge);;){if(ke){var ln=ve+ke.length;if(!yt){var Mr=ln>pn?ke.slice(0,pn-ve):ke;t.addToken(t,Mr,je?je+Qe:Qe,ht,ve+Mr.length==Ge?it:"",Ve,_t)}if(ln>=pn){ke=ke.slice(pn-ve),ve=pn;break}ve=ln,ht=""}ke=N.slice($,$=O[Se++]),je=Qt(O[Se++],t.cm.options)}}}function vt(e,t,O){this.line=t,this.rest=Tn(t),this.size=this.rest?Gt(re(this.rest))-O+1:1,this.node=this.text=null,this.hidden=_n(e,t)}function or(e,t,O){for(var A=[],N,$=t;$<O;$=N){var le=new vt(e.doc,gt(e.doc,$),$);N=$+le.size,A.push(le)}return A}var ur=null;function xr(e){ur?ur.ops.push(e):e.ownsGroup=ur={ops:[e],delayedCallbacks:[]}}function kr(e){var t=e.delayedCallbacks,O=0;do{for(;O<t.length;O++)t[O].call(null);for(var A=0;A<e.ops.length;A++){var N=e.ops[A];if(N.cursorActivityHandlers)for(;N.cursorActivityCalled<N.cursorActivityHandlers.length;)N.cursorActivityHandlers[N.cursorActivityCalled++].call(null,N.cm)}}while(O<t.length)}function dn(e,t){var O=e.ownsGroup;if(!O)return;try{kr(O)}finally{ur=null,t(O)}}var Rr=null;function sr(e,t){var O=tt(e,t);if(!O.length)return;var A=Array.prototype.slice.call(arguments,2),N;ur?N=ur.delayedCallbacks:Rr?N=Rr:(N=Rr=[],setTimeout(hi,0));for(var $=function(me){N.push(function(){return O[me].apply(null,A)})},le=0;le<O.length;++le)$(le)}function hi(){var e=Rr;Rr=null;for(var t=0;t<e.length;++t)e[t]()}function Pn(e,t,O,A){for(var N=0;N<t.changes.length;N++){var $=t.changes[N];$=="text"?fi(e,t):$=="gutter"?On(e,t,O,A):$=="class"?An(e,t):$=="widget"&&Jn(e,t,A)}t.changes=null}function yn(e){return e.node==e.text&&(e.node=_("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),C&&p<8&&(e.node.style.zIndex=2)),e.node}function $n(e,t){var O=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(O&&(O+=" CodeMirror-linebackground"),t.background)O?t.background.className=O:(t.background.parentNode.removeChild(t.background),t.background=null);else if(O){var A=yn(t);t.background=A.insertBefore(_("div",null,O),A.firstChild),e.display.input.setUneditable(t.background)}}function Gn(e,t){var O=e.display.externalMeasured;return O&&O.line==t.line?(e.display.externalMeasured=null,t.measure=O.measure,O.built):ct(e,t)}function fi(e,t){var O=t.text.className,A=Gn(e,t);t.text==t.node&&(t.node=A.pre),t.text.parentNode.replaceChild(A.pre,t.text),t.text=A.pre,A.bgClass!=t.bgClass||A.textClass!=t.textClass?(t.bgClass=A.bgClass,t.textClass=A.textClass,An(e,t)):O&&(t.text.className=O)}function An(e,t){$n(e,t),t.line.wrapClass?yn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var O=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=O||""}function On(e,t,O,A){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var N=yn(t);t.gutterBackground=_("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?A.fixedPos:-A.gutterTotalWidth)+"px; width: "+A.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),N.insertBefore(t.gutterBackground,t.text)}var $=t.line.gutterMarkers;if(e.options.lineNumbers||$){var le=yn(t),me=t.gutter=_("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?A.fixedPos:-A.gutterTotalWidth)+"px");if(e.display.input.setUneditable(me),le.insertBefore(me,t.text),t.line.gutterClass&&(me.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!$||!$["CodeMirror-linenumbers"])&&(t.lineNumber=me.appendChild(_("div",Ur(e.options,O),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+A.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),$)for(var ve=0;ve<e.display.gutterSpecs.length;++ve){var Se=e.display.gutterSpecs[ve].className,ke=$.hasOwnProperty(Se)&&$[Se];ke&&me.appendChild(_("div",[ke],"CodeMirror-gutter-elt","left: "+A.gutterLeft[Se]+"px; width: "+A.gutterWidth[Se]+"px"))}}}function Jn(e,t,O){t.alignable&&(t.alignable=null);for(var A=D("CodeMirror-linewidget"),N=t.node.firstChild,$=void 0;N;N=$)$=N.nextSibling,A.test(N.className)&&t.node.removeChild(N);Zn(e,t,O)}function Wn(e,t,O,A){var N=Gn(e,t);return t.text=t.node=N.pre,N.bgClass&&(t.bgClass=N.bgClass),N.textClass&&(t.textClass=N.textClass),An(e,t),On(e,t,O,A),Zn(e,t,A),t.node}function Zn(e,t,O){if(zn(e,t.line,t,O,!0),t.rest)for(var A=0;A<t.rest.length;A++)zn(e,t.rest[A],t,O,!1)}function zn(e,t,O,A,N){if(!t.widgets)return;for(var $=yn(O),le=0,me=t.widgets;le<me.length;++le){var ve=me[le],Se=_("div",[ve.node],"CodeMirror-linewidget"+(ve.className?" "+ve.className:""));ve.handleMouseEvents||Se.setAttribute("cm-ignore-events","true"),Yi(ve,Se,O,A),e.display.input.setUneditable(Se),N&&ve.above?$.insertBefore(Se,O.gutter||O.text):$.appendChild(Se),sr(ve,"redraw")}}function Yi(e,t,O,A){if(e.noHScroll){(O.alignable||(O.alignable=[])).push(t);var N=A.wrapperWidth;t.style.left=A.fixedPos+"px",e.coverGutter||(N-=A.gutterTotalWidth,t.style.paddingLeft=A.gutterTotalWidth+"px"),t.style.width=N+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-A.gutterTotalWidth+"px"))}function Vt(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!L(document.body,e.node)){var O="position: relative;";e.coverGutter&&(O+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(O+="width: "+t.display.wrapper.clientWidth+"px;"),x(t.display.measure,_("div",[e.node],null,O))}return e.height=e.node.parentNode.offsetHeight}function cr(e,t){for(var O=Fe(t);O!=e.wrapper;O=O.parentNode)if(!O||O.nodeType==1&&O.getAttribute("cm-ignore-events")=="true"||O.parentNode==e.sizer&&O!=e.mover)return!0}function Vn(e){return e.lineSpace.offsetTop}function pi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Dn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=x(e.measure,_("pre","x","CodeMirror-line-like")),O=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,A={left:parseInt(O.paddingLeft),right:parseInt(O.paddingRight)};return!isNaN(A.left)&&!isNaN(A.right)&&(e.cachedPaddingH=A),A}function bn(e){return fe-e.display.nativeBarWidth}function In(e){return e.display.scroller.clientWidth-bn(e)-e.display.barWidth}function mi(e){return e.display.scroller.clientHeight-bn(e)-e.display.barHeight}function $i(e,t,O){var A=e.options.lineWrapping,N=A&&In(e);if(!t.measure.heights||A&&t.measure.width!=N){var $=t.measure.heights=[];if(A){t.measure.width=N;for(var le=t.text.firstChild.getClientRects(),me=0;me<le.length-1;me++){var ve=le[me],Se=le[me+1];Math.abs(ve.bottom-Se.bottom)>2&&$.push((ve.bottom+Se.top)/2-O.top)}}$.push(O.bottom-O.top)}}function _i(e,t,O){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var A=0;A<e.rest.length;A++)if(e.rest[A]==t)return{map:e.measure.maps[A],cache:e.measure.caches[A]};for(var N=0;N<e.rest.length;N++)if(Gt(e.rest[N])>O)return{map:e.measure.maps[N],cache:e.measure.caches[N],before:!0}}function Ji(e,t){t=Fr(t);var O=Gt(t),A=e.display.externalMeasured=new vt(e.doc,t,O);A.lineN=O;var N=A.built=ct(e,A);return A.text=N.pre,x(e.display.lineMeasure,N.pre),A}function Zi(e,t,O,A){return hn(e,xn(e,t),O,A)}function Ai(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[yi(e,t)];var O=e.display.externalMeasured;if(O&&t>=O.lineN&&t<O.lineN+O.size)return O}function xn(e,t){var O=Gt(t),A=Ai(e,O);A&&!A.text?A=null:A&&A.changes&&(Pn(e,A,O,Xa(e)),e.curOp.forceUpdate=!0),A||(A=Ji(e,t));var N=_i(A,t,O);return{line:t,view:A,rect:null,map:N.map,cache:N.cache,before:N.before,hasHeights:!1}}function hn(e,t,O,A,N){t.before&&(O=-1);var $=O+(A||""),le;return t.cache.hasOwnProperty($)?le=t.cache[$]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||($i(e,t.view,t.rect),t.hasHeights=!0),le=xa(e,t,O,A),le.bogus||(t.cache[$]=le)),{left:le.left,right:le.right,top:N?le.rtop:le.top,bottom:N?le.rbottom:le.bottom}}var Qi={left:0,right:0,top:0,bottom:0};function Qn(e,t,O){for(var A,N,$,le,me,ve,Se=0;Se<e.length;Se+=3)if(me=e[Se],ve=e[Se+1],t<me?(N=0,$=1,le="left"):t<ve?(N=t-me,$=N+1):(Se==e.length-3||t==ve&&e[Se+3]>t)&&($=ve-me,N=$-1,t>=ve&&(le="right")),N!=null){if(A=e[Se+2],me==ve&&O==(A.insertLeft?"left":"right")&&(le=O),O=="left"&&N==0)for(;Se&&e[Se-2]==e[Se-3]&&e[Se-1].insertLeft;)A=e[(Se-=3)+2],le="left";if(O=="right"&&N==ve-me)for(;Se<e.length-3&&e[Se+3]==e[Se+4]&&!e[Se+5].insertLeft;)A=e[(Se+=3)+2],le="right";break}return{node:A,start:N,end:$,collapse:le,coverStart:me,coverEnd:ve}}function Mn(e,t){var O=Qi;if(t=="left")for(var A=0;A<e.length&&!((O=e[A]).left!=O.right);A++);else for(var N=e.length-1;N>=0&&!((O=e[N]).left!=O.right);N--);return O}function xa(e,t,O,A){var N=Qn(t.map,O,A),$=N.node,le=N.start,me=N.end,ve=N.collapse,Se;if($.nodeType==3){for(var ke=0;ke<4;ke++){for(;le&&xe(t.line.text.charAt(N.coverStart+le));)--le;for(;N.coverStart+me<N.coverEnd&&xe(t.line.text.charAt(N.coverStart+me));)++me;if(C&&p<9&&le==0&&me==N.coverEnd-N.coverStart?Se=$.parentNode.getBoundingClientRect():Se=Mn(F($,le,me).getClientRects(),A),Se.left||Se.right||le==0)break;me=le,le=le-1,ve="right"}C&&p<11&&(Se=Ea(e.display.measure,Se))}else{le>0&&(ve=A="right");var je;e.options.lineWrapping&&(je=$.getClientRects()).length>1?Se=je[A=="right"?je.length-1:0]:Se=$.getBoundingClientRect()}if(C&&p<9&&!le&&(!Se||!Se.left&&!Se.right)){var Ve=$.parentNode.getClientRects()[0];Ve?Se={left:Ve.left,right:Ve.left+Li(e.display),top:Ve.top,bottom:Ve.bottom}:Se=Qi}for(var Ge=Se.top-t.rect.top,Qe=Se.bottom-t.rect.top,it=(Ge+Qe)/2,ht=t.view.measure.heights,yt=0;yt<ht.length-1&&!(it<ht[yt]);yt++);var _t=yt?ht[yt-1]:0,bt=ht[yt],Ot={left:(ve=="right"?Se.right:Se.left)-t.rect.left,right:(ve=="left"?Se.left:Se.right)-t.rect.left,top:_t,bottom:bt};return!Se.left&&!Se.right&&(Ot.bogus=!0),e.options.singleCursorHeightPerLine||(Ot.rtop=Ge,Ot.rbottom=Qe),Ot}function Ea(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ir(e))return t;var O=screen.logicalXDPI/screen.deviceXDPI,A=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*O,right:t.right*O,top:t.top*A,bottom:t.bottom*A}}function Oi(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function kn(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Oi(e.display.view[t])}function qn(e){kn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Di(){return r&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ki(){return r&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function wa(e){var t=0;if(e.widgets)for(var O=0;O<e.widgets.length;++O)e.widgets[O].above&&(t+=Vt(e.widgets[O]));return t}function Zr(e,t,O,A,N){if(!N){var $=wa(t);O.top+=$,O.bottom+=$}if(A=="line")return O;A||(A="local");var le=vn(t);if(A=="local"?le+=Vn(e.display):le-=e.display.viewOffset,A=="page"||A=="window"){var me=e.display.lineSpace.getBoundingClientRect();le+=me.top+(A=="window"?0:ki());var ve=me.left+(A=="window"?0:Di());O.left+=ve,O.right+=ve}return O.top+=le,O.bottom+=le,O}function En(e,t,O){if(O=="div")return t;var A=t.left,N=t.top;if(O=="page")A-=Di(),N-=ki();else if(O=="local"||!O){var $=e.display.sizer.getBoundingClientRect();A+=$.left,N+=$.top}var le=e.display.lineSpace.getBoundingClientRect();return{left:A-le.left,top:N-le.top}}function Ka(e,t,O,A,N){return A||(A=gt(e.doc,t.line)),Zr(e,A,Zi(e,A,t.ch,N),O)}function Nn(e,t,O,A,N,$){A=A||gt(e.doc,t.line),N||(N=xn(e,A));function le(Qe,it){var ht=hn(e,N,Qe,it?"right":"left",$);return it?ht.left=ht.right:ht.right=ht.left,Zr(e,A,ht,O)}var me=Ke(A,e.doc.direction),ve=t.ch,Se=t.sticky;if(ve>=A.text.length?(ve=A.text.length,Se="before"):ve<=0&&(ve=0,Se="after"),!me)return le(Se=="before"?ve-1:ve,Se=="before");function ke(Qe,it,ht){var yt=me[it],_t=yt.level==1;return le(ht?Qe-1:Qe,_t!=ht)}var je=Ue(me,ve,Se),Ve=We,Ge=ke(ve,je,Se=="before");return Ve!=null&&(Ge.other=ke(ve,Ve,Se!="before")),Ge}function So(e,t){var O=0;t=K(e.doc,t),e.options.lineWrapping||(O=Li(e.display)*t.ch);var A=gt(e.doc,t.line),N=vn(A)+Vn(e.display);return{left:O,right:O,top:N,bottom:N+A.height}}function Ga(e,t,O,A,N){var $=nt(e,t,O);return $.xRel=N,A&&($.outside=A),$}function za(e,t,O){var A=e.doc;if(O+=e.display.viewOffset,O<0)return Ga(A.first,0,null,-1,-1);var N=mr(A,O),$=A.first+A.size-1;if(N>$)return Ga(A.first+A.size-1,gt(A,$).text.length,null,1,1);t<0&&(t=0);for(var le=gt(A,N);;){var me=Ks(e,le,N,t,O),ve=Cn(le,me.ch+(me.xRel>0||me.outside>0?1:0));if(!ve)return me;var Se=ve.find(1);if(Se.line==N)return Se;le=gt(A,N=Se.line)}}function Co(e,t,O,A){A-=wa(t);var N=t.text.length,$=Ne(function(le){return hn(e,O,le-1).bottom<=A},N,0);return N=Ne(function(le){return hn(e,O,le).top>A},$,N),{begin:$,end:N}}function To(e,t,O,A){O||(O=xn(e,t));var N=Zr(e,t,hn(e,O,A),"line").top;return Co(e,t,O,N)}function Va(e,t,O,A){return e.bottom<=O?!1:e.top>O?!0:(A?e.left:e.right)>t}function Ks(e,t,O,A,N){N-=vn(t);var $=xn(e,t),le=wa(t),me=0,ve=t.text.length,Se=!0,ke=Ke(t,e.doc.direction);if(ke){var je=(e.options.lineWrapping?zs:Gs)(e,t,O,$,ke,A,N);Se=je.level!=1,me=Se?je.from:je.to-1,ve=Se?je.to:je.from-1}var Ve=null,Ge=null,Qe=Ne(function(Ut){var jt=hn(e,$,Ut);return jt.top+=le,jt.bottom+=le,Va(jt,A,N,!1)?(jt.top<=N&&jt.left<=A&&(Ve=Ut,Ge=jt),!0):!1},me,ve),it,ht,yt=!1;if(Ge){var _t=A-Ge.left<Ge.right-A,bt=_t==Se;Qe=Ve+(bt?0:1),ht=bt?"after":"before",it=_t?Ge.left:Ge.right}else{!Se&&(Qe==ve||Qe==me)&&Qe++,ht=Qe==0?"after":Qe==t.text.length?"before":hn(e,$,Qe-(Se?1:0)).bottom+le<=N==Se?"after":"before";var Ot=Nn(e,nt(O,Qe,ht),"line",t,$);it=Ot.left,yt=N<Ot.top?-1:N>=Ot.bottom?1:0}return Qe=_e(t.text,Qe,1),Ga(O,Qe,ht,yt,A-it)}function Gs(e,t,O,A,N,$,le){var me=Ne(function(je){var Ve=N[je],Ge=Ve.level!=1;return Va(Nn(e,nt(O,Ge?Ve.to:Ve.from,Ge?"before":"after"),"line",t,A),$,le,!0)},0,N.length-1),ve=N[me];if(me>0){var Se=ve.level!=1,ke=Nn(e,nt(O,Se?ve.from:ve.to,Se?"after":"before"),"line",t,A);Va(ke,$,le,!0)&&ke.top>le&&(ve=N[me-1])}return ve}function zs(e,t,O,A,N,$,le){var me=Co(e,t,A,le),ve=me.begin,Se=me.end;/\s/.test(t.text.charAt(Se-1))&&Se--;for(var ke=null,je=null,Ve=0;Ve<N.length;Ve++){var Ge=N[Ve];if(Ge.from>=Se||Ge.to<=ve)continue;var Qe=Ge.level!=1,it=hn(e,A,Qe?Math.min(Se,Ge.to)-1:Math.max(ve,Ge.from)).right,ht=it<$?$-it+1e9:it-$;(!ke||je>ht)&&(ke=Ge,je=ht)}return ke||(ke=N[N.length-1]),ke.from<ve&&(ke={from:ve,to:ke.to,level:ke.level}),ke.to>Se&&(ke={from:ke.from,to:Se,level:ke.level}),ke}var gi;function Ri(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(gi==null){gi=_("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)gi.appendChild(document.createTextNode("x")),gi.appendChild(_("br"));gi.appendChild(document.createTextNode("x"))}x(e.measure,gi);var O=gi.offsetHeight/50;return O>3&&(e.cachedTextHeight=O),b(e.measure),O||1}function Li(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=_("span","xxxxxxxxxx"),O=_("pre",[t],"CodeMirror-line-like");x(e.measure,O);var A=t.getBoundingClientRect(),N=(A.right-A.left)/10;return N>2&&(e.cachedCharWidth=N),N||10}function Xa(e){for(var t=e.display,O={},A={},N=t.gutters.clientLeft,$=t.gutters.firstChild,le=0;$;$=$.nextSibling,++le){var me=e.display.gutterSpecs[le].className;O[me]=$.offsetLeft+$.clientLeft+N,A[me]=$.clientWidth}return{fixedPos:Ya(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:O,gutterWidth:A,wrapperWidth:t.wrapper.clientWidth}}function Ya(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function _o(e){var t=Ri(e.display),O=e.options.lineWrapping,A=O&&Math.max(5,e.display.scroller.clientWidth/Li(e.display)-3);return function(N){if(_n(e.doc,N))return 0;var $=0;if(N.widgets)for(var le=0;le<N.widgets.length;le++)N.widgets[le].height&&($+=N.widgets[le].height);return O?$+(Math.ceil(N.text.length/A)||1)*t:$+t}}function $a(e){var t=e.doc,O=_o(e);t.iter(function(A){var N=O(A);N!=A.height&&ar(A,N)})}function vi(e,t,O,A){var N=e.display;if(!O&&Fe(t).getAttribute("cm-not-content")=="true")return null;var $,le,me=N.lineSpace.getBoundingClientRect();try{$=t.clientX-me.left,le=t.clientY-me.top}catch(je){return null}var ve=za(e,$,le),Se;if(A&&ve.xRel>0&&(Se=gt(e.doc,ve.line).text).length==ve.ch){var ke=W(Se,Se.length,e.options.tabSize)-Se.length;ve=nt(ve.line,Math.max(0,Math.round(($-Dn(e.display).left)/Li(e.display))-ke))}return ve}function yi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var O=e.display.view,A=0;A<O.length;A++)if(t-=O[A].size,t<0)return A}function on(e,t,O,A){t==null&&(t=e.doc.first),O==null&&(O=e.doc.first+e.doc.size),A||(A=0);var N=e.display;if(A&&O<N.viewTo&&(N.updateLineNumbers==null||N.updateLineNumbers>t)&&(N.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=N.viewTo)gr&&ui(e.doc,t)<N.viewTo&&ti(e);else if(O<=N.viewFrom)gr&&Un(e.doc,O+A)>N.viewFrom?ti(e):(N.viewFrom+=A,N.viewTo+=A);else if(t<=N.viewFrom&&O>=N.viewTo)ti(e);else if(t<=N.viewFrom){var $=Sa(e,O,O+A,1);$?(N.view=N.view.slice($.index),N.viewFrom=$.lineN,N.viewTo+=A):ti(e)}else if(O>=N.viewTo){var le=Sa(e,t,t,-1);le?(N.view=N.view.slice(0,le.index),N.viewTo=le.lineN):ti(e)}else{var me=Sa(e,t,t,-1),ve=Sa(e,O,O+A,1);me&&ve?(N.view=N.view.slice(0,me.index).concat(or(e,me.lineN,ve.lineN)).concat(N.view.slice(ve.index)),N.viewTo+=A):ti(e)}var Se=N.externalMeasured;Se&&(O<Se.lineN?Se.lineN+=A:t<Se.lineN+Se.size&&(N.externalMeasured=null))}function ei(e,t,O){e.curOp.viewChanged=!0;var A=e.display,N=e.display.externalMeasured;if(N&&t>=N.lineN&&t<N.lineN+N.size&&(A.externalMeasured=null),t<A.viewFrom||t>=A.viewTo)return;var $=A.view[yi(e,t)];if($.node==null)return;var le=$.changes||($.changes=[]);de(le,O)==-1&&le.push(O)}function ti(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Sa(e,t,O,A){var N=yi(e,t),$,le=e.display.view;if(!gr||O==e.doc.first+e.doc.size)return{index:N,lineN:O};for(var me=e.display.viewFrom,ve=0;ve<N;ve++)me+=le[ve].size;if(me!=t){if(A>0){if(N==le.length-1)return null;$=me+le[N].size-t,N++}else $=me-t;t+=$,O+=$}for(;ui(e.doc,O)!=O;){if(N==(A<0?0:le.length-1))return null;O+=A*le[N-(A<0?1:0)].size,N+=A}return{index:N,lineN:O}}function Vs(e,t,O){var A=e.display,N=A.view;N.length==0||t>=A.viewTo||O<=A.viewFrom?(A.view=or(e,t,O),A.viewFrom=t):(A.viewFrom>t?A.view=or(e,t,A.viewFrom).concat(A.view):A.viewFrom<t&&(A.view=A.view.slice(yi(e,t))),A.viewFrom=t,A.viewTo<O?A.view=A.view.concat(or(e,A.viewTo,O)):A.viewTo>O&&(A.view=A.view.slice(0,yi(e,O)))),A.viewTo=O}function Ao(e){for(var t=e.display.view,O=0,A=0;A<t.length;A++){var N=t[A];!N.hidden&&(!N.node||N.changes)&&++O}return O}function qi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Oo(e,t){t===void 0&&(t=!0);for(var O=e.doc,A={},N=A.cursors=document.createDocumentFragment(),$=A.selection=document.createDocumentFragment(),le=0;le<O.sel.ranges.length;le++){if(!t&&le==O.sel.primIndex)continue;var me=O.sel.ranges[le];if(me.from().line>=e.display.viewTo||me.to().line<e.display.viewFrom)continue;var ve=me.empty();(ve||e.options.showCursorWhenSelecting)&&Do(e,me.head,N),ve||Xs(e,me,$)}return A}function Do(e,t,O){var A=Nn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),N=O.appendChild(_("div","\xA0","CodeMirror-cursor"));if(N.style.left=A.left+"px",N.style.top=A.top+"px",N.style.height=Math.max(0,A.bottom-A.top)*e.options.cursorHeight+"px",A.other){var $=O.appendChild(_("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));$.style.display="",$.style.left=A.other.left+"px",$.style.top=A.other.top+"px",$.style.height=(A.other.bottom-A.other.top)*.85+"px"}}function Ca(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,O){var A=e.display,N=e.doc,$=document.createDocumentFragment(),le=Dn(e.display),me=le.left,ve=Math.max(A.sizerWidth,In(e)-A.sizer.offsetLeft)-le.right,Se=N.direction=="ltr";function ke(bt,Ot,Ut,jt){Ot<0&&(Ot=0),Ot=Math.round(Ot),jt=Math.round(jt),$.appendChild(_("div",null,"CodeMirror-selected","position: absolute; left: "+bt+`px;
top: `+Ot+"px; width: "+(Ut==null?ve-bt:Ut)+`px;
height: `+(jt-Ot)+"px"))}function je(bt,Ot,Ut){var jt=gt(N,bt),qt=jt.text.length,pr,Kr;function Er(Mr,un){return Ka(e,nt(bt,Mr),"div",jt,un)}function pn(Mr,un,Vr){var Br=To(e,jt,null,Mr),Nr=un=="ltr"==(Vr=="after")?"left":"right",Sr=Vr=="after"?Br.begin:Br.end-(/\s/.test(jt.text.charAt(Br.end-1))?2:1);return Er(Sr,Nr)[Nr]}var ln=Ke(jt,N.direction);return Be(ln,Ot||0,Ut==null?qt:Ut,function(Mr,un,Vr,Br){var Nr=Vr=="ltr",Sr=Er(Mr,Nr?"left":"right"),cn=Er(un-1,Nr?"right":"left"),zi=Ot==null&&Mr==0,si=Ut==null&&un==qt,qr=Br==0,Hn=!ln||Br==ln.length-1;if(cn.top-Sr.top<=3){var Gr=(Se?zi:si)&&qr,Eo=(Se?si:zi)&&Hn,Yn=Gr?me:(Nr?Sr:cn).left,Si=Eo?ve:(Nr?cn:Sr).right;ke(Yn,Sr.top,Si-Yn,Sr.bottom)}else{var Ci,an,Vi,wo;Nr?(Ci=Se&&zi&&qr?me:Sr.left,an=Se?ve:pn(Mr,Vr,"before"),Vi=Se?me:pn(un,Vr,"after"),wo=Se&&si&&Hn?ve:cn.right):(Ci=Se?pn(Mr,Vr,"before"):me,an=!Se&&zi&&qr?ve:Sr.right,Vi=!Se&&si&&Hn?me:cn.left,wo=Se?pn(un,Vr,"after"):ve),ke(Ci,Sr.top,an-Ci,Sr.bottom),Sr.bottom<cn.top&&ke(me,Sr.bottom,null,cn.top),ke(Vi,cn.top,wo-Vi,cn.bottom)}(!pr||Ca(Sr,pr)<0)&&(pr=Sr),Ca(cn,pr)<0&&(pr=cn),(!Kr||Ca(Sr,Kr)<0)&&(Kr=Sr),Ca(cn,Kr)<0&&(Kr=cn)}),{start:pr,end:Kr}}var Ve=t.from(),Ge=t.to();if(Ve.line==Ge.line)je(Ve.line,Ve.ch,Ge.ch);else{var Qe=gt(N,Ve.line),it=gt(N,Ge.line),ht=Fr(Qe)==Fr(it),yt=je(Ve.line,Ve.ch,ht?Qe.text.length+1:null).end,_t=je(Ge.line,ht?0:null,Ge.ch).start;ht&&(yt.top<_t.top-2?(ke(yt.right,yt.top,null,yt.bottom),ke(me,_t.top,_t.left,_t.bottom)):ke(yt.right,yt.top,_t.left-yt.right,yt.bottom)),yt.bottom<_t.top&&ke(me,yt.bottom,null,_t.top)}O.appendChild($)}function Ja(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var O=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Pi(e),t.cursorDiv.style.visibility=(O=!O)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ko(e){e.state.focused||(e.display.input.focus(),Za(e))}function Ro(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Pi(e))},100)}function Za(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(He(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),s&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ja(e)}function Pi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(He(e,"blur",e,t),e.state.focused=!1,c(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ta(e){for(var t=e.display,O=t.lineDiv.offsetTop,A=0;A<t.view.length;A++){var N=t.view[A],$=e.options.lineWrapping,le=void 0,me=0;if(N.hidden)continue;if(C&&p<8){var ve=N.node.offsetTop+N.node.offsetHeight;le=ve-O,O=ve}else{var Se=N.node.getBoundingClientRect();le=Se.bottom-Se.top,!$&&N.text.firstChild&&(me=N.text.firstChild.getBoundingClientRect().right-Se.left-1)}var ke=N.line.height-le;if((ke>.005||ke<-.005)&&(ar(N.line,le),Lo(N.line),N.rest))for(var je=0;je<N.rest.length;je++)Lo(N.rest[je]);if(me>e.display.sizerWidth){var Ve=Math.ceil(me/Li(e.display));Ve>e.display.maxLineLength&&(e.display.maxLineLength=Ve,e.display.maxLine=N.line,e.display.maxLineChanged=!0)}}}function Lo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var O=e.widgets[t],A=O.node.parentNode;A&&(O.height=A.offsetHeight)}}function _a(e,t,O){var A=O&&O.top!=null?Math.max(0,O.top):e.scroller.scrollTop;A=Math.floor(A-Vn(e));var N=O&&O.bottom!=null?O.bottom:A+e.wrapper.clientHeight,$=mr(t,A),le=mr(t,N);if(O&&O.ensure){var me=O.ensure.from.line,ve=O.ensure.to.line;me<$?($=me,le=mr(t,vn(gt(t,me))+e.wrapper.clientHeight)):Math.min(ve,t.lastLine())>=le&&($=mr(t,vn(gt(t,ve))-e.wrapper.clientHeight),le=ve)}return{from:$,to:Math.max(le,$+1)}}function Ys(e,t){if($e(e,"scrollCursorIntoView"))return;var O=e.display,A=O.sizer.getBoundingClientRect(),N=null;if(t.top+A.top<0?N=!0:t.bottom+A.top>(window.innerHeight||document.documentElement.clientHeight)&&(N=!1),N!=null&&!E){var $=_("div","\u200B",null,`position: absolute;
top: `+(t.top-O.viewOffset-Vn(e.display))+`px;
height: `+(t.bottom-t.top+bn(e)+O.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild($),$.scrollIntoView(N),e.display.lineSpace.removeChild($)}}function $s(e,t,O,A){A==null&&(A=0);var N;!e.options.lineWrapping&&t==O&&(t=t.ch?nt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,O=t.sticky=="before"?nt(t.line,t.ch+1,"before"):t);for(var $=0;$<5;$++){var le=!1,me=Nn(e,t),ve=!O||O==t?me:Nn(e,O);N={left:Math.min(me.left,ve.left),top:Math.min(me.top,ve.top)-A,right:Math.max(me.left,ve.left),bottom:Math.max(me.bottom,ve.bottom)+A};var Se=Qa(e,N),ke=e.doc.scrollTop,je=e.doc.scrollLeft;if(Se.scrollTop!=null&&(ta(e,Se.scrollTop),Math.abs(e.doc.scrollTop-ke)>1&&(le=!0)),Se.scrollLeft!=null&&(bi(e,Se.scrollLeft),Math.abs(e.doc.scrollLeft-je)>1&&(le=!0)),!le)break}return N}function Js(e,t){var O=Qa(e,t);O.scrollTop!=null&&ta(e,O.scrollTop),O.scrollLeft!=null&&bi(e,O.scrollLeft)}function Qa(e,t){var O=e.display,A=Ri(e.display);t.top<0&&(t.top=0);var N=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:O.scroller.scrollTop,$=mi(e),le={};t.bottom-t.top>$&&(t.bottom=t.top+$);var me=e.doc.height+pi(O),ve=t.top<A,Se=t.bottom>me-A;if(t.top<N)le.scrollTop=ve?0:t.top;else if(t.bottom>N+$){var ke=Math.min(t.top,(Se?me:t.bottom)-$);ke!=N&&(le.scrollTop=ke)}var je=e.options.fixedGutter?0:O.gutters.offsetWidth,Ve=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:O.scroller.scrollLeft-je,Ge=In(e)-O.gutters.offsetWidth,Qe=t.right-t.left>Ge;return Qe&&(t.right=t.left+Ge),t.left<10?le.scrollLeft=0:t.left<Ve?le.scrollLeft=Math.max(0,t.left+je-(Qe?0:10)):t.right>Ge+Ve-3&&(le.scrollLeft=t.right+(Qe?0:10)-Ge),le}function qa(e,t){if(t==null)return;Aa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ii(e){Aa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ea(e,t,O){(t!=null||O!=null)&&Aa(e),t!=null&&(e.curOp.scrollLeft=t),O!=null&&(e.curOp.scrollTop=O)}function Zs(e,t){Aa(e),e.curOp.scrollToPos=t}function Aa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var O=So(e,t.from),A=So(e,t.to);Po(e,O,A,t.margin)}}function Po(e,t,O,A){var N=Qa(e,{left:Math.min(t.left,O.left),top:Math.min(t.top,O.top)-A,right:Math.max(t.right,O.right),bottom:Math.max(t.bottom,O.bottom)+A});ea(e,N.scrollLeft,N.scrollTop)}function ta(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;S||to(e,{top:t}),Io(e,t,!0),S&&to(e),ia(e,100)}function Io(e,t,O){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!O)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function bi(e,t,O,A){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(O?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!A)return;e.doc.scrollLeft=t,Bo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ra(e){var t=e.display,O=t.gutters.offsetWidth,A=Math.round(e.doc.height+pi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?O:0,docHeight:A,scrollHeight:A+bn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:O}}var xi=function(e,t,O){this.cm=O;var A=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),N=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");A.tabIndex=N.tabIndex=-1,e(A),e(N),Re(A,"scroll",function(){A.clientHeight&&t(A.scrollTop,"vertical")}),Re(N,"scroll",function(){N.clientWidth&&t(N.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,C&&p<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,O=e.scrollHeight>e.clientHeight+1,A=e.nativeBarWidth;if(O){this.vert.style.display="block",this.vert.style.bottom=t?A+"px":"0";var N=e.viewHeight-(t?A:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+N)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=O?A+"px":"0",this.horiz.style.left=e.barLeft+"px";var $=e.viewWidth-e.barLeft-(O?A:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+$)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(A==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:O?A:0,bottom:t?A:0}},xi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xi.prototype.zeroWidthHack=function(){var e=o&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},xi.prototype.enableZeroWidthBar=function(e,t,O){e.style.pointerEvents="auto";function A(){var N=e.getBoundingClientRect(),$=O=="vert"?document.elementFromPoint(N.right-1,(N.top+N.bottom)/2):document.elementFromPoint((N.right+N.left)/2,N.bottom-1);$!=e?e.style.pointerEvents="none":t.set(1e3,A)}t.set(1e3,A)},xi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var na=function(){};na.prototype.update=function(){return{bottom:0,right:0}},na.prototype.setScrollLeft=function(){},na.prototype.setScrollTop=function(){},na.prototype.clear=function(){};function Mi(e,t){t||(t=ra(e));var O=e.display.barWidth,A=e.display.barHeight;Mo(e,t);for(var N=0;N<4&&O!=e.display.barWidth||A!=e.display.barHeight;N++)O!=e.display.barWidth&&e.options.lineWrapping&&Ta(e),Mo(e,ra(e)),O=e.display.barWidth,A=e.display.barHeight}function Mo(e,t){var O=e.display,A=O.scrollbars.update(t);O.sizer.style.paddingRight=(O.barWidth=A.right)+"px",O.sizer.style.paddingBottom=(O.barHeight=A.bottom)+"px",O.heightForcer.style.borderBottom=A.bottom+"px solid transparent",A.right&&A.bottom?(O.scrollbarFiller.style.display="block",O.scrollbarFiller.style.height=A.bottom+"px",O.scrollbarFiller.style.width=A.right+"px"):O.scrollbarFiller.style.display="",A.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(O.gutterFiller.style.display="block",O.gutterFiller.style.height=A.bottom+"px",O.gutterFiller.style.width=t.gutterWidth+"px"):O.gutterFiller.style.display=""}var No={native:xi,null:na};function jo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&c(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new No[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Re(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,O){O=="horizontal"?bi(e,t):ta(e,t)},e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Ei(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},xr(e.curOp)}function wi(e){var t=e.curOp;t&&dn(t,function(O){for(var A=0;A<O.ops.length;A++)O.ops[A].cm.curOp=null;el(O)})}function el(e){for(var t=e.ops,O=0;O<t.length;O++)tl(t[O]);for(var A=0;A<t.length;A++)rl(t[A]);for(var N=0;N<t.length;N++)nl(t[N]);for(var $=0;$<t.length;$++)il(t[$]);for(var le=0;le<t.length;le++)al(t[le])}function tl(e){var t=e.cm,O=t.display;sl(t),e.updateMaxLine&&Ti(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<O.viewFrom||e.scrollToPos.to.line>=O.viewTo)||O.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Oa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function rl(e){e.updatedDisplay=e.mustUpdate&&eo(e.cm,e.update)}function nl(e){var t=e.cm,O=t.display;e.updatedDisplay&&Ta(t),e.barMeasure=ra(t),O.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Zi(t,O.maxLine,O.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(O.scroller.clientWidth,O.sizer.offsetLeft+e.adjustWidthTo+bn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,O.sizer.offsetLeft+e.adjustWidthTo-In(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=O.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&bi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var O=e.focus&&e.focus==X();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,O),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Mi(t,e.barMeasure),e.updatedDisplay&&no(t,e.barMeasure),e.selectionChanged&&Ja(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),O&&ko(e.cm)}function al(e){var t=e.cm,O=t.display,A=t.doc;if(e.updatedDisplay&&Fo(t,e.update),O.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(O.wheelStartX=O.wheelStartY=null),e.scrollTop!=null&&Io(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&bi(t,e.scrollLeft,!0,!0),e.scrollToPos){var N=$s(t,K(A,e.scrollToPos.from),K(A,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,N)}var $=e.maybeHiddenMarkers,le=e.maybeUnhiddenMarkers;if($)for(var me=0;me<$.length;++me)$[me].lines.length||He($[me],"hide");if(le)for(var ve=0;ve<le.length;++ve)le[ve].lines.length&&He(le[ve],"unhide");O.wrapper.offsetHeight&&(A.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&He(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function fn(e,t){if(e.curOp)return t();Ei(e);try{return t()}finally{wi(e)}}function Wr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ei(e);try{return t.apply(e,arguments)}finally{wi(e)}}}function nn(e){return function(){if(this.curOp)return e.apply(this,arguments);Ei(this);try{return e.apply(this,arguments)}finally{wi(this)}}}function Hr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ei(t);try{return e.apply(this,arguments)}finally{wi(t)}}}function ia(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,U(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var O=+new Date+e.options.workTime,A=mt(e,t.highlightFrontier),N=[];t.iter(A.line,Math.min(t.first+t.size,e.display.viewTo+500),function($){if(A.line>=e.display.viewFrom){var le=$.styles,me=$.text.length>e.options.maxHighlightLength?Xt(t.mode,A.state):null,ve=Pe(e,$,A,!0);me&&(A.state=me),$.styles=ve.styles;var Se=$.styleClasses,ke=ve.classes;ke?$.styleClasses=ke:Se&&($.styleClasses=null);for(var je=!le||le.length!=$.styles.length||Se!=ke&&(!Se||!ke||Se.bgClass!=ke.bgClass||Se.textClass!=ke.textClass),Ve=0;!je&&Ve<le.length;++Ve)je=le[Ve]!=$.styles[Ve];je&&N.push(A.line),$.stateAfter=A.save(),A.nextLine()}else $.text.length<=e.options.maxHighlightLength&&Tt(e,$.text,A),$.stateAfter=A.line%5==0?A.save():null,A.nextLine();if(+new Date>O)return ia(e,e.options.workDelay),!0}),t.highlightFrontier=A.line,t.modeFrontier=Math.max(t.modeFrontier,A.line),N.length&&fn(e,function(){for(var $=0;$<N.length;$++)ei(e,N[$],"text")})}var Oa=function(e,t,O){var A=e.display;this.viewport=t,this.visible=_a(A,e.doc,t),this.editorIsHidden=!A.wrapper.offsetWidth,this.wrapperHeight=A.wrapper.clientHeight,this.wrapperWidth=A.wrapper.clientWidth,this.oldDisplayWidth=In(e),this.force=O,this.dims=Xa(e),this.events=[]};Oa.prototype.signal=function(e,t){Oe(e,t)&&this.events.push(arguments)},Oa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)He.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=bn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=bn(e)+"px",t.scrollbarsClipped=!0)}function ll(e){if(e.hasFocus())return null;var t=X();if(!t||!L(e.display.lineDiv,t))return null;var O={activeElt:t};if(window.getSelection){var A=window.getSelection();A.anchorNode&&A.extend&&L(e.display.lineDiv,A.anchorNode)&&(O.anchorNode=A.anchorNode,O.anchorOffset=A.anchorOffset,O.focusNode=A.focusNode,O.focusOffset=A.focusOffset)}return O}function ul(e){if(!e||!e.activeElt||e.activeElt==X())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&L(document.body,e.anchorNode)&&L(document.body,e.focusNode)){var t=window.getSelection(),O=document.createRange();O.setEnd(e.anchorNode,e.anchorOffset),O.collapse(!1),t.removeAllRanges(),t.addRange(O),t.extend(e.focusNode,e.focusOffset)}}function eo(e,t){var O=e.display,A=e.doc;if(t.editorIsHidden)return ti(e),!1;if(!t.force&&t.visible.from>=O.viewFrom&&t.visible.to<=O.viewTo&&(O.updateLineNumbers==null||O.updateLineNumbers>=O.viewTo)&&O.renderedView==O.view&&Ao(e)==0)return!1;Uo(e)&&(ti(e),t.dims=Xa(e));var N=A.first+A.size,$=Math.max(t.visible.from-e.options.viewportMargin,A.first),le=Math.min(N,t.visible.to+e.options.viewportMargin);O.viewFrom<$&&$-O.viewFrom<20&&($=Math.max(A.first,O.viewFrom)),O.viewTo>le&&O.viewTo-le<20&&(le=Math.min(N,O.viewTo)),gr&&($=ui(e.doc,$),le=Un(e.doc,le));var me=$!=O.viewFrom||le!=O.viewTo||O.lastWrapHeight!=t.wrapperHeight||O.lastWrapWidth!=t.wrapperWidth;Vs(e,$,le),O.viewOffset=vn(gt(e.doc,O.viewFrom)),e.display.mover.style.top=O.viewOffset+"px";var ve=Ao(e);if(!me&&ve==0&&!t.force&&O.renderedView==O.view&&(O.updateLineNumbers==null||O.updateLineNumbers>=O.viewTo))return!1;var Se=ll(e);return ve>4&&(O.lineDiv.style.display="none"),cl(e,O.updateLineNumbers,t.dims),ve>4&&(O.lineDiv.style.display=""),O.renderedView=O.view,ul(Se),b(O.cursorDiv),b(O.selectionDiv),O.gutters.style.height=O.sizer.style.minHeight=0,me&&(O.lastWrapHeight=t.wrapperHeight,O.lastWrapWidth=t.wrapperWidth,ia(e,400)),O.updateLineNumbers=null,!0}function Fo(e,t){for(var O=t.viewport,A=!0;;A=!1){if(!A||!e.options.lineWrapping||t.oldDisplayWidth==In(e)){if(O&&O.top!=null&&(O={top:Math.min(e.doc.height+pi(e.display)-mi(e),O.top)}),t.visible=_a(e.display,e.doc,O),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else A&&(t.visible=_a(e.display,e.doc,O));if(!eo(e,t))break;Ta(e);var N=ra(e);qi(e),Mi(e,N),no(e,N),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function to(e,t){var O=new Oa(e,t);if(eo(e,O)){Ta(e),Fo(e,O);var A=ra(e);qi(e),Mi(e,A),no(e,A),O.finish()}}function cl(e,t,O){var A=e.display,N=e.options.lineNumbers,$=A.lineDiv,le=$.firstChild;function me(Qe){var it=Qe.nextSibling;return s&&o&&e.display.currentWheelTarget==Qe?Qe.style.display="none":Qe.parentNode.removeChild(Qe),it}for(var ve=A.view,Se=A.viewFrom,ke=0;ke<ve.length;ke++){var je=ve[ke];if(!je.hidden)if(!je.node||je.node.parentNode!=$){var Ve=Wn(e,je,Se,O);$.insertBefore(Ve,le)}else{for(;le!=je.node;)le=me(le);var Ge=N&&t!=null&&t<=Se&&je.lineNumber;je.changes&&(de(je.changes,"gutter")>-1&&(Ge=!1),Pn(e,je,Se,O)),Ge&&(b(je.lineNumber),je.lineNumber.appendChild(document.createTextNode(Ur(e.options,Se)))),le=je.node.nextSibling}Se+=je.size}for(;le;)le=me(le)}function ro(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function no(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+bn(e)+"px"}function Bo(e){var t=e.display,O=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var A=Ya(t)-t.scroller.scrollLeft+e.doc.scrollLeft,N=t.gutters.offsetWidth,$=A+"px",le=0;le<O.length;le++)if(!O[le].hidden){e.options.fixedGutter&&(O[le].gutter&&(O[le].gutter.style.left=$),O[le].gutterBackground&&(O[le].gutterBackground.style.left=$));var me=O[le].alignable;if(me)for(var ve=0;ve<me.length;ve++)me[ve].style.left=$}e.options.fixedGutter&&(t.gutters.style.left=A+N+"px")}function Uo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,O=Ur(e.options,t.first+t.size-1),A=e.display;if(O.length!=A.lineNumChars){var N=A.measure.appendChild(_("div",[_("div",O)],"CodeMirror-linenumber CodeMirror-gutter-elt")),$=N.firstChild.offsetWidth,le=N.offsetWidth-$;return A.lineGutter.style.width="",A.lineNumInnerWidth=Math.max($,A.lineGutter.offsetWidth-le)+1,A.lineNumWidth=A.lineNumInnerWidth+le,A.lineNumChars=A.lineNumInnerWidth?O.length:-1,A.lineGutter.style.width=A.lineNumWidth+"px",ro(e.display),!0}return!1}function io(e,t){for(var O=[],A=!1,N=0;N<e.length;N++){var $=e[N],le=null;if(typeof $!="string"&&(le=$.style,$=$.className),$=="CodeMirror-linenumbers")if(t)A=!0;else continue;O.push({className:$,style:le})}return t&&!A&&O.push({className:"CodeMirror-linenumbers",style:null}),O}function Wo(e){var t=e.gutters,O=e.gutterSpecs;b(t),e.lineGutter=null;for(var A=0;A<O.length;++A){var N=O[A],$=N.className,le=N.style,me=t.appendChild(_("div",null,"CodeMirror-gutter "+$));le&&(me.style.cssText=le),$=="CodeMirror-linenumbers"&&(e.lineGutter=me,me.style.width=(e.lineNumWidth||1)+"px")}t.style.display=O.length?"":"none",ro(e)}function aa(e){Wo(e.display),on(e),Bo(e)}function dl(e,t,O,A){var N=this;this.input=O,N.scrollbarFiller=_("div",null,"CodeMirror-scrollbar-filler"),N.scrollbarFiller.setAttribute("cm-not-content","true"),N.gutterFiller=_("div",null,"CodeMirror-gutter-filler"),N.gutterFiller.setAttribute("cm-not-content","true"),N.lineDiv=j("div",null,"CodeMirror-code"),N.selectionDiv=_("div",null,null,"position: relative; z-index: 1"),N.cursorDiv=_("div",null,"CodeMirror-cursors"),N.measure=_("div",null,"CodeMirror-measure"),N.lineMeasure=_("div",null,"CodeMirror-measure"),N.lineSpace=j("div",[N.measure,N.lineMeasure,N.selectionDiv,N.cursorDiv,N.lineDiv],null,"position: relative; outline: none");var $=j("div",[N.lineSpace],"CodeMirror-lines");N.mover=_("div",[$],null,"position: relative"),N.sizer=_("div",[N.mover],"CodeMirror-sizer"),N.sizerWidth=null,N.heightForcer=_("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),N.gutters=_("div",null,"CodeMirror-gutters"),N.lineGutter=null,N.scroller=_("div",[N.sizer,N.heightForcer,N.gutters],"CodeMirror-scroll"),N.scroller.setAttribute("tabIndex","-1"),N.wrapper=_("div",[N.scrollbarFiller,N.gutterFiller,N.scroller],"CodeMirror"),C&&p<8&&(N.gutters.style.zIndex=-1,N.scroller.style.paddingRight=0),!s&&!(S&&n)&&(N.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(N.wrapper):e(N.wrapper)),N.viewFrom=N.viewTo=t.first,N.reportedViewFrom=N.reportedViewTo=t.first,N.view=[],N.renderedView=null,N.externalMeasured=null,N.viewOffset=0,N.lastWrapHeight=N.lastWrapWidth=0,N.updateLineNumbers=null,N.nativeBarWidth=N.barHeight=N.barWidth=0,N.scrollbarsClipped=!1,N.lineNumWidth=N.lineNumInnerWidth=N.lineNumChars=null,N.alignWidgets=!1,N.cachedCharWidth=N.cachedTextHeight=N.cachedPaddingH=null,N.maxLine=null,N.maxLineLength=0,N.maxLineChanged=!1,N.wheelDX=N.wheelDY=N.wheelStartX=N.wheelStartY=null,N.shift=!1,N.selForContextMenu=null,N.activeTouch=null,N.gutterSpecs=io(A.gutters,A.lineNumbers),Wo(N),O.init(N)}var Da=0,wn=null;C?wn=-.53:S?wn=15:r?wn=-.7:d&&(wn=-1/3);function Ho(e){var t=e.wheelDeltaX,O=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),O==null&&e.detail&&e.axis==e.VERTICAL_AXIS?O=e.detail:O==null&&(O=e.wheelDelta),{x:t,y:O}}function hl(e){var t=Ho(e);return t.x*=wn,t.y*=wn,t}function Ko(e,t){var O=Ho(t),A=O.x,N=O.y,$=e.display,le=$.scroller,me=le.scrollWidth>le.clientWidth,ve=le.scrollHeight>le.clientHeight;if(!(A&&me||N&&ve))return;if(N&&o&&s){e:for(var Se=t.target,ke=$.view;Se!=le;Se=Se.parentNode)for(var je=0;je<ke.length;je++)if(ke[je].node==Se){e.display.currentWheelTarget=Se;break e}}if(A&&!S&&!h&&wn!=null){N&&ve&&ta(e,Math.max(0,le.scrollTop+N*wn)),bi(e,Math.max(0,le.scrollLeft+A*wn)),(!N||N&&ve)&&Te(t),$.wheelStartX=null;return}if(N&&wn!=null){var Ve=N*wn,Ge=e.doc.scrollTop,Qe=Ge+$.wrapper.clientHeight;Ve<0?Ge=Math.max(0,Ge+Ve-50):Qe=Math.min(e.doc.height,Qe+Ve+50),to(e,{top:Ge,bottom:Qe})}Da<20&&($.wheelStartX==null?($.wheelStartX=le.scrollLeft,$.wheelStartY=le.scrollTop,$.wheelDX=A,$.wheelDY=N,setTimeout(function(){if($.wheelStartX==null)return;var it=le.scrollLeft-$.wheelStartX,ht=le.scrollTop-$.wheelStartY,yt=ht&&$.wheelDY&&ht/$.wheelDY||it&&$.wheelDX&&it/$.wheelDX;if($.wheelStartX=$.wheelStartY=null,!yt)return;wn=(wn*Da+yt)/(Da+1),++Da},200)):($.wheelDX+=A,$.wheelDY+=N))}var Sn=function(e,t){this.ranges=e,this.primIndex=t};Sn.prototype.primary=function(){return this.ranges[this.primIndex]},Sn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var O=this.ranges[t],A=e.ranges[t];if(!zr(O.anchor,A.anchor)||!zr(O.head,A.head))return!1}return!0},Sn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new lr(Pr(this.ranges[t].anchor),Pr(this.ranges[t].head));return new Sn(e,this.primIndex)},Sn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Sn.prototype.contains=function(e,t){t||(t=e);for(var O=0;O<this.ranges.length;O++){var A=this.ranges[O];if(kt(t,A.from())>=0&&kt(e,A.to())<=0)return O}return-1};var lr=function(e,t){this.anchor=e,this.head=t};lr.prototype.from=function(){return Yr(this.anchor,this.head)},lr.prototype.to=function(){return Xr(this.anchor,this.head)},lr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function jn(e,t,O){var A=e&&e.options.selectionsMayTouch,N=t[O];t.sort(function(Ve,Ge){return kt(Ve.from(),Ge.from())}),O=de(t,N);for(var $=1;$<t.length;$++){var le=t[$],me=t[$-1],ve=kt(me.to(),le.from());if(A&&!le.empty()?ve>0:ve>=0){var Se=Yr(me.from(),le.from()),ke=Xr(me.to(),le.to()),je=me.empty()?le.from()==le.head:me.from()==me.head;$<=O&&--O,t.splice(--$,2,new lr(je?ke:Se,je?Se:ke))}}return new Sn(t,O)}function ri(e,t){return new Sn([new lr(e,t||e)],0)}function ni(e){return e.text?nt(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Go(e,t){if(kt(e,t.from)<0)return e;if(kt(e,t.to)<=0)return ni(t);var O=e.line+t.text.length-(t.to.line-t.from.line)-1,A=e.ch;return e.line==t.to.line&&(A+=ni(t).ch-t.to.ch),nt(O,A)}function ao(e,t){for(var O=[],A=0;A<e.sel.ranges.length;A++){var N=e.sel.ranges[A];O.push(new lr(Go(N.anchor,t),Go(N.head,t)))}return jn(e.cm,O,e.sel.primIndex)}function zo(e,t,O){return e.line==t.line?nt(O.line,e.ch-t.ch+O.ch):nt(O.line+(e.line-t.line),e.ch)}function fl(e,t,O){for(var A=[],N=nt(e.first,0),$=N,le=0;le<t.length;le++){var me=t[le],ve=zo(me.from,N,$),Se=zo(ni(me),N,$);if(N=me.to,$=Se,O=="around"){var ke=e.sel.ranges[le],je=kt(ke.head,ke.anchor)<0;A[le]=new lr(je?Se:ve,je?ve:Se)}else A[le]=new lr(ve,ve)}return new Sn(A,e.sel.primIndex)}function oo(e){e.doc.mode=Je(e.options,e.doc.modeOption),oa(e)}function oa(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ia(e,100),e.state.modeGen++,e.curOp&&on(e)}function Vo(e,t){return t.from.ch==0&&t.to.ch==0&&re(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function so(e,t,O,A){function N(_t){return O?O[_t]:null}function $(_t,bt,Ot){Xi(_t,bt,Ot,A),sr(_t,"change",_t,t)}function le(_t,bt){for(var Ot=[],Ut=_t;Ut<bt;++Ut)Ot.push(new Kn(Se[Ut],N(Ut),A));return Ot}var me=t.from,ve=t.to,Se=t.text,ke=gt(e,me.line),je=gt(e,ve.line),Ve=re(Se),Ge=N(Se.length-1),Qe=ve.line-me.line;if(t.full)e.insert(0,le(0,Se.length)),e.remove(Se.length,e.size-Se.length);else if(Vo(e,t)){var it=le(0,Se.length-1);$(je,je.text,Ge),Qe&&e.remove(me.line,Qe),it.length&&e.insert(me.line,it)}else if(ke==je)if(Se.length==1)$(ke,ke.text.slice(0,me.ch)+Ve+ke.text.slice(ve.ch),Ge);else{var ht=le(1,Se.length-1);ht.push(new Kn(Ve+ke.text.slice(ve.ch),Ge,A)),$(ke,ke.text.slice(0,me.ch)+Se[0],N(0)),e.insert(me.line+1,ht)}else if(Se.length==1)$(ke,ke.text.slice(0,me.ch)+Se[0]+je.text.slice(ve.ch),N(0)),e.remove(me.line+1,Qe);else{$(ke,ke.text.slice(0,me.ch)+Se[0],N(0)),$(je,Ve+je.text.slice(ve.ch),Ge);var yt=le(1,Se.length-1);Qe>1&&e.remove(me.line+1,Qe-1),e.insert(me.line+1,yt)}sr(e,"change",e,t)}function ii(e,t,O){function A(N,$,le){if(N.linked)for(var me=0;me<N.linked.length;++me){var ve=N.linked[me];if(ve.doc==$)continue;var Se=le&&ve.sharedHist;if(O&&!Se)continue;t(ve.doc,Se),A(ve.doc,N,Se)}}A(e,null,!0)}function Xo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,$a(e),oo(e),Yo(e),e.options.lineWrapping||Ti(e),e.options.mode=t.modeOption,on(e)}function Yo(e){(e.doc.direction=="rtl"?z:c)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){fn(e,function(){Yo(e),on(e)})}function ka(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function lo(e,t){var O={from:Pr(t.from),to:ni(t),text:Bt(e,t.from,t.to)};return Zo(e,O,t.from.line,t.to.line+1),ii(e,function(A){return Zo(A,O,t.from.line,t.to.line+1)},!0),O}function $o(e){for(;e.length;){var t=re(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return $o(e.done),re(e.done);if(e.done.length&&!re(e.done).ranges)return re(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function Jo(e,t,O,A){var N=e.history;N.undone.length=0;var $=+new Date,le,me;if((N.lastOp==A||N.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&N.lastModTime>$-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(le=ml(N,N.lastOp==A)))me=re(le.changes),kt(t.from,t.to)==0&&kt(t.from,me.to)==0?me.to=ni(t):le.changes.push(lo(e,t));else{var ve=re(N.done);for((!ve||!ve.ranges)&&Ra(e.sel,N.done),le={changes:[lo(e,t)],generation:N.generation},N.done.push(le);N.done.length>N.undoDepth;)N.done.shift(),N.done[0].ranges||N.done.shift()}N.done.push(O),N.generation=++N.maxGeneration,N.lastModTime=N.lastSelTime=$,N.lastOp=N.lastSelOp=A,N.lastOrigin=N.lastSelOrigin=t.origin,me||He(e,"historyAdded")}function gl(e,t,O,A){var N=t.charAt(0);return N=="*"||N=="+"&&O.ranges.length==A.ranges.length&&O.somethingSelected()==A.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,O,A){var N=e.history,$=A&&A.origin;O==N.lastSelOp||$&&N.lastSelOrigin==$&&(N.lastModTime==N.lastSelTime&&N.lastOrigin==$||gl(e,$,re(N.done),t))?N.done[N.done.length-1]=t:Ra(t,N.done),N.lastSelTime=+new Date,N.lastSelOrigin=$,N.lastSelOp=O,A&&A.clearRedo!==!1&&$o(N.undone)}function Ra(e,t){var O=re(t);O&&O.ranges&&O.equals(e)||t.push(e)}function Zo(e,t,O,A){var N=t["spans_"+e.id],$=0;e.iter(Math.max(e.first,O),Math.min(e.first+e.size,A),function(le){le.markedSpans&&((N||(N=t["spans_"+e.id]={}))[$]=le.markedSpans),++$})}function yl(e){if(!e)return null;for(var t,O=0;O<e.length;++O)e[O].marker.explicitlyCleared?t||(t=e.slice(0,O)):t&&t.push(e[O]);return t?t.length?t:null:e}function bl(e,t){var O=t["spans_"+e.id];if(!O)return null;for(var A=[],N=0;N<t.text.length;++N)A.push(yl(O[N]));return A}function Qo(e,t){var O=bl(e,t),A=Jr(e,t);if(!O)return A;if(!A)return O;for(var N=0;N<O.length;++N){var $=O[N],le=A[N];if($&&le){e:for(var me=0;me<le.length;++me){for(var ve=le[me],Se=0;Se<$.length;++Se)if($[Se].marker==ve.marker)continue e;$.push(ve)}}else le&&(O[N]=le)}return O}function Ni(e,t,O){for(var A=[],N=0;N<e.length;++N){var $=e[N];if($.ranges){A.push(O?Sn.prototype.deepCopy.call($):$);continue}var le=$.changes,me=[];A.push({changes:me});for(var ve=0;ve<le.length;++ve){var Se=le[ve],ke=void 0;if(me.push({from:Se.from,to:Se.to,text:Se.text}),t)for(var je in Se)(ke=je.match(/^spans_(\d+)$/))&&(de(t,Number(ke[1]))>-1&&(re(me)[je]=Se[je],delete Se[je]))}}return A}function uo(e,t,O,A){if(A){var N=e.anchor;if(O){var $=kt(t,N)<0;$!=kt(O,N)<0?(N=t,t=O):$!=kt(t,O)<0&&(t=O)}return new lr(N,t)}else return new lr(O||t,t)}function La(e,t,O,A,N){N==null&&(N=e.cm&&(e.cm.display.shift||e.extend)),Qr(e,new Sn([uo(e.sel.primary(),t,O,N)],0),A)}function qo(e,t,O){for(var A=[],N=e.cm&&(e.cm.display.shift||e.extend),$=0;$<e.sel.ranges.length;$++)A[$]=uo(e.sel.ranges[$],t[$],null,N);var le=jn(e.cm,A,e.sel.primIndex);Qr(e,le,O)}function co(e,t,O,A){var N=e.sel.ranges.slice(0);N[t]=O,Qr(e,jn(e.cm,N,e.sel.primIndex),A)}function es(e,t,O,A){Qr(e,ri(t,O),A)}function xl(e,t,O){var A={ranges:t.ranges,update:function(N){this.ranges=[];for(var $=0;$<N.length;$++)this.ranges[$]=new lr(K(e,N[$].anchor),K(e,N[$].head))},origin:O&&O.origin};return He(e,"beforeSelectionChange",e,A),e.cm&&He(e.cm,"beforeSelectionChange",e.cm,A),A.ranges!=t.ranges?jn(e.cm,A.ranges,A.ranges.length-1):t}function ts(e,t,O){var A=e.history.done,N=re(A);N&&N.ranges?(A[A.length-1]=t,Pa(e,t,O)):Qr(e,t,O)}function Qr(e,t,O){Pa(e,t,O),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,O)}function Pa(e,t,O){(Oe(e,"beforeSelectionChange")||e.cm&&Oe(e.cm,"beforeSelectionChange"))&&(t=xl(e,t,O));var A=O&&O.bias||(kt(t.primary().head,e.sel.primary().head)<0?-1:1);rs(e,is(e,t,A,!0)),!(O&&O.scroll===!1)&&e.cm&&Ii(e.cm)}function rs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ie(e.cm)),sr(e,"cursorActivity",e)}function ns(e){rs(e,is(e,e.sel,null,!1))}function is(e,t,O,A){for(var N,$=0;$<t.ranges.length;$++){var le=t.ranges[$],me=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[$],ve=Ia(e,le.anchor,me&&me.anchor,O,A),Se=Ia(e,le.head,me&&me.head,O,A);(N||ve!=le.anchor||Se!=le.head)&&(N||(N=t.ranges.slice(0,$)),N[$]=new lr(ve,Se))}return N?jn(e.cm,N,t.primIndex):t}function ji(e,t,O,A,N){var $=gt(e,t.line);if($.markedSpans)for(var le=0;le<$.markedSpans.length;++le){var me=$.markedSpans[le],ve=me.marker,Se="selectLeft"in ve?!ve.selectLeft:ve.inclusiveLeft,ke="selectRight"in ve?!ve.selectRight:ve.inclusiveRight;if((me.from==null||(Se?me.from<=t.ch:me.from<t.ch))&&(me.to==null||(ke?me.to>=t.ch:me.to>t.ch))){if(N&&(He(ve,"beforeCursorEnter"),ve.explicitlyCleared))if($.markedSpans){--le;continue}else break;if(!ve.atomic)continue;if(O){var je=ve.find(A<0?1:-1),Ve=void 0;if((A<0?ke:Se)&&(je=as(e,je,-A,je&&je.line==t.line?$:null)),je&&je.line==t.line&&(Ve=kt(je,O))&&(A<0?Ve<0:Ve>0))return ji(e,je,t,A,N)}var Ge=ve.find(A<0?-1:1);return(A<0?Se:ke)&&(Ge=as(e,Ge,A,Ge.line==t.line?$:null)),Ge?ji(e,Ge,t,A,N):null}}return t}function Ia(e,t,O,A,N){var $=A||1,le=ji(e,t,O,$,N)||!N&&ji(e,t,O,$,!0)||ji(e,t,O,-$,N)||!N&&ji(e,t,O,-$,!0);return le||(e.cantEdit=!0,nt(e.first,0))}function as(e,t,O,A){return O<0&&t.ch==0?t.line>e.first?K(e,nt(t.line-1)):null:O>0&&t.ch==(A||gt(e,t.line)).text.length?t.line<e.first+e.size-1?nt(t.line+1,0):null:new nt(t.line,t.ch+O)}function os(e){e.setSelection(nt(e.firstLine(),0),nt(e.lastLine()),Ce)}function ss(e,t,O){var A={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return A.canceled=!0}};return O&&(A.update=function(N,$,le,me){N&&(A.from=K(e,N)),$&&(A.to=K(e,$)),le&&(A.text=le),me!==void 0&&(A.origin=me)}),He(e,"beforeChange",e,A),e.cm&&He(e.cm,"beforeChange",e.cm,A),A.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:A.from,to:A.to,text:A.text,origin:A.origin}}function Fi(e,t,O){if(e.cm){if(!e.cm.curOp)return Wr(e.cm,Fi)(e,t,O);if(e.cm.state.suppressEdits)return}if((Oe(e,"beforeChange")||e.cm&&Oe(e.cm,"beforeChange"))&&(t=ss(e,t,!0),!t))return;var A=Rn&&!O&&rn(e,t.from,t.to);if(A)for(var N=A.length-1;N>=0;--N)ls(e,{from:A[N].from,to:A[N].to,text:N?[""]:t.text,origin:t.origin});else ls(e,t)}function ls(e,t){if(t.text.length==1&&t.text[0]==""&&kt(t.from,t.to)==0)return;var O=ao(e,t);Jo(e,t,O,e.cm?e.cm.curOp.id:NaN),sa(e,t,O,Jr(e,t));var A=[];ii(e,function(N,$){!$&&de(A,N.history)==-1&&(hs(N.history,t),A.push(N.history)),sa(N,t,null,Jr(N,t))})}function Ma(e,t,O){var A=e.cm&&e.cm.state.suppressEdits;if(A&&!O)return;for(var N=e.history,$,le=e.sel,me=t=="undo"?N.done:N.undone,ve=t=="undo"?N.undone:N.done,Se=0;Se<me.length&&!($=me[Se],O?$.ranges&&!$.equals(e.sel):!$.ranges);Se++);if(Se==me.length)return;for(N.lastOrigin=N.lastSelOrigin=null;;)if($=me.pop(),$.ranges){if(Ra($,ve),O&&!$.equals(e.sel)){Qr(e,$,{clearRedo:!1});return}le=$}else if(A){me.push($);return}else break;var ke=[];Ra(le,ve),ve.push({changes:ke,generation:N.generation}),N.generation=$.generation||++N.maxGeneration;for(var je=Oe(e,"beforeChange")||e.cm&&Oe(e.cm,"beforeChange"),Ve=function(it){var ht=$.changes[it];if(ht.origin=t,je&&!ss(e,ht,!1))return me.length=0,{};ke.push(lo(e,ht));var yt=it?ao(e,ht):re(me);sa(e,ht,yt,Qo(e,ht)),!it&&e.cm&&e.cm.scrollIntoView({from:ht.from,to:ni(ht)});var _t=[];ii(e,function(bt,Ot){!Ot&&de(_t,bt.history)==-1&&(hs(bt.history,ht),_t.push(bt.history)),sa(bt,ht,null,Qo(bt,ht))})},Ge=$.changes.length-1;Ge>=0;--Ge){var Qe=Ve(Ge);if(Qe)return Qe.v}}function us(e,t){if(t==0)return;if(e.first+=t,e.sel=new Sn(he(e.sel.ranges,function(N){return new lr(nt(N.anchor.line+t,N.anchor.ch),nt(N.head.line+t,N.head.ch))}),e.sel.primIndex),e.cm){on(e.cm,e.first,e.first-t,t);for(var O=e.cm.display,A=O.viewFrom;A<O.viewTo;A++)ei(e.cm,A,"gutter")}}function sa(e,t,O,A){if(e.cm&&!e.cm.curOp)return Wr(e.cm,sa)(e,t,O,A);if(t.to.line<e.first){us(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var N=t.text.length-1-(e.first-t.from.line);us(e,N),t={from:nt(e.first,0),to:nt(t.to.line+N,t.to.ch),text:[re(t.text)],origin:t.origin}}var $=e.lastLine();t.to.line>$&&(t={from:t.from,to:nt($,gt(e,$).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Bt(e,t.from,t.to),O||(O=ao(e,t)),e.cm?El(e.cm,t,A):so(e,t,A),Pa(e,O,Ce),e.cantEdit&&Ia(e,nt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,O){var A=e.doc,N=e.display,$=t.from,le=t.to,me=!1,ve=$.line;e.options.lineWrapping||(ve=Gt(Fr(gt(A,$.line))),A.iter(ve,le.line+1,function(Ge){if(Ge==N.maxLine)return me=!0,!0})),A.sel.contains(t.from,t.to)>-1&&Ie(e),so(A,t,O,_o(e)),e.options.lineWrapping||(A.iter(ve,$.line+t.text.length,function(Ge){var Qe=di(Ge);Qe>N.maxLineLength&&(N.maxLine=Ge,N.maxLineLength=Qe,N.maxLineChanged=!0,me=!1)}),me&&(e.curOp.updateMaxLine=!0)),en(A,$.line),ia(e,400);var Se=t.text.length-(le.line-$.line)-1;t.full?on(e):$.line==le.line&&t.text.length==1&&!Vo(e.doc,t)?ei(e,$.line,"text"):on(e,$.line,le.line+1,Se);var ke=Oe(e,"changes"),je=Oe(e,"change");if(je||ke){var Ve={from:$,to:le,text:t.text,removed:t.removed,origin:t.origin};je&&sr(e,"change",e,Ve),ke&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ve)}e.display.selForContextMenu=null}function Bi(e,t,O,A,N){var $;A||(A=O),kt(A,O)<0&&($=[A,O],O=$[0],A=$[1]),typeof t=="string"&&(t=e.splitLines(t)),Fi(e,{from:O,to:A,text:t,origin:N})}function cs(e,t,O,A){O<e.line?e.line+=A:t<e.line&&(e.line=t,e.ch=0)}function ds(e,t,O,A){for(var N=0;N<e.length;++N){var $=e[N],le=!0;if($.ranges){$.copied||($=e[N]=$.deepCopy(),$.copied=!0);for(var me=0;me<$.ranges.length;me++)cs($.ranges[me].anchor,t,O,A),cs($.ranges[me].head,t,O,A);continue}for(var ve=0;ve<$.changes.length;++ve){var Se=$.changes[ve];if(O<Se.from.line)Se.from=nt(Se.from.line+A,Se.from.ch),Se.to=nt(Se.to.line+A,Se.to.ch);else if(t<=Se.to.line){le=!1;break}}le||(e.splice(0,N+1),N=0)}}function hs(e,t){var O=t.from.line,A=t.to.line,N=t.text.length-(A-O)-1;ds(e.done,O,A,N),ds(e.undone,O,A,N)}function la(e,t,O,A){var N=t,$=t;return typeof t=="number"?$=gt(e,ce(e,t)):N=Gt(t),N==null?null:(A($,N)&&e.cm&&ei(e.cm,N,O),$)}function ua(e){this.lines=e,this.parent=null;for(var t=0,O=0;O<e.length;++O)e[O].parent=this,t+=e[O].height;this.height=t}ua.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var O=e,A=e+t;O<A;++O){var N=this.lines[O];this.height-=N.height,Lt(N),sr(N,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,O){this.height+=O,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var A=0;A<t.length;++A)t[A].parent=this},iterN:function(e,t,O){for(var A=e+t;e<A;++e)if(O(this.lines[e]))return!0}};function ca(e){this.children=e;for(var t=0,O=0,A=0;A<e.length;++A){var N=e[A];t+=N.chunkSize(),O+=N.height,N.parent=this}this.size=t,this.height=O,this.parent=null}ca.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var O=0;O<this.children.length;++O){var A=this.children[O],N=A.chunkSize();if(e<N){var $=Math.min(t,N-e),le=A.height;if(A.removeInner(e,$),this.height-=le-A.height,N==$&&(this.children.splice(O--,1),A.parent=null),(t-=$)==0)break;e=0}else e-=N}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ua))){var me=[];this.collapse(me),this.children=[new ua(me)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,O){this.size+=t.length,this.height+=O;for(var A=0;A<this.children.length;++A){var N=this.children[A],$=N.chunkSize();if(e<=$){if(N.insertInner(e,t,O),N.lines&&N.lines.length>50){for(var le=N.lines.length%25+25,me=le;me<N.lines.length;){var ve=new ua(N.lines.slice(me,me+=25));N.height-=ve.height,this.children.splice(++A,0,ve),ve.parent=this}N.lines=N.lines.slice(0,le),this.maybeSpill()}break}e-=$}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),O=new ca(t);if(e.parent){e.size-=O.size,e.height-=O.height;var N=de(e.parent.children,e);e.parent.children.splice(N+1,0,O)}else{var A=new ca(e.children);A.parent=e,e.children=[A,O],e=A}O.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,O){for(var A=0;A<this.children.length;++A){var N=this.children[A],$=N.chunkSize();if(e<$){var le=Math.min(t,$-e);if(N.iterN(e,le,O))return!0;if((t-=le)==0)break;e=0}else e-=$}}};var da=function(e,t,O){if(O)for(var A in O)O.hasOwnProperty(A)&&(this[A]=O[A]);this.doc=e,this.node=t};da.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,O=this.line,A=Gt(O);if(A==null||!t)return;for(var N=0;N<t.length;++N)t[N]==this&&t.splice(N--,1);t.length||(O.widgets=null);var $=Vt(this);ar(O,Math.max(0,O.height-$)),e&&(fn(e,function(){fs(e,O,-$),ei(e,A,"widget")}),sr(e,"lineWidgetCleared",e,this,A))},da.prototype.changed=function(){var e=this,t=this.height,O=this.doc.cm,A=this.line;this.height=null;var N=Vt(this)-t;if(!N)return;_n(this.doc,A)||ar(A,A.height+N),O&&fn(O,function(){O.curOp.forceUpdate=!0,fs(O,A,N),sr(O,"lineWidgetChanged",O,e,Gt(A))})},Le(da);function fs(e,t,O){vn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qa(e,O)}function wl(e,t,O,A){var N=new da(e,O,A),$=e.cm;return $&&N.noHScroll&&($.display.alignWidgets=!0),la(e,t,"widget",function(le){var me=le.widgets||(le.widgets=[]);if(N.insertAt==null?me.push(N):me.splice(Math.min(me.length-1,Math.max(0,N.insertAt)),0,N),N.line=le,$&&!_n(e,le)){var ve=vn(le)<e.scrollTop;ar(le,le.height+Vt(N)),ve&&qa($,N.height),$.curOp.forceUpdate=!0}return!0}),$&&sr($,"lineWidgetAdded",$,N,typeof t=="number"?t:Gt(t)),N}var ps=0,ai=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ps};ai.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ei(e),Oe(this,"clear")){var O=this.find();O&&sr(this,"clear",O.from,O.to)}for(var A=null,N=null,$=0;$<this.lines.length;++$){var le=this.lines[$],me=jr(le.markedSpans,this);e&&!this.collapsed?ei(e,Gt(le),"text"):e&&(me.to!=null&&(N=Gt(le)),me.from!=null&&(A=Gt(le))),le.markedSpans=Ar(le.markedSpans,me),me.from==null&&this.collapsed&&!_n(this.doc,le)&&e&&ar(le,Ri(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ve=0;ve<this.lines.length;++ve){var Se=Fr(this.lines[ve]),ke=di(Se);ke>e.display.maxLineLength&&(e.display.maxLine=Se,e.display.maxLineLength=ke,e.display.maxLineChanged=!0)}A!=null&&e&&this.collapsed&&on(e,A,N+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ns(e.doc)),e&&sr(e,"markerCleared",e,this,A,N),t&&wi(e),this.parent&&this.parent.clear()},ai.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var O,A,N=0;N<this.lines.length;++N){var $=this.lines[N],le=jr($.markedSpans,this);if(le.from!=null&&(O=nt(t?$:Gt($),le.from),e==-1))return O;if(le.to!=null&&(A=nt(t?$:Gt($),le.to),e==1))return A}return O&&{from:O,to:A}},ai.prototype.changed=function(){var e=this,t=this.find(-1,!0),O=this,A=this.doc.cm;if(!t||!A)return;fn(A,function(){var N=t.line,$=Gt(t.line),le=Ai(A,$);if(le&&(Oi(le),A.curOp.selectionChanged=A.curOp.forceUpdate=!0),A.curOp.updateMaxLine=!0,!_n(O.doc,N)&&O.height!=null){var me=O.height;O.height=null;var ve=Vt(O)-me;ve&&ar(N,N.height+ve)}sr(A,"markerChanged",A,e)})},ai.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||de(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ai.prototype.detachLine=function(e){if(this.lines.splice(de(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Le(ai);function Ui(e,t,O,A,N){if(A&&A.shared)return Sl(e,t,O,A,N);if(e.cm&&!e.cm.curOp)return Wr(e.cm,Ui)(e,t,O,A,N);var $=new ai(e,N),le=kt(t,O);if(A&&B(A,$,!1),le>0||le==0&&$.clearWhenEmpty!==!1)return $;if($.replacedWith&&($.collapsed=!0,$.widgetNode=j("span",[$.replacedWith],"CodeMirror-widget"),A.handleMouseEvents||$.widgetNode.setAttribute("cm-ignore-events","true"),A.insertLeft&&($.widgetNode.insertLeft=!0)),$.collapsed){if(Ir(e,t.line,t,O,$)||t.line!=O.line&&Ir(e,O.line,t,O,$))throw new Error("Inserting collapsed marker partially overlapping an existing one");mn()}$.addToHistory&&Jo(e,{from:t,to:O,origin:"markText"},e.sel,NaN);var me=t.line,ve=e.cm,Se;if(e.iter(me,O.line+1,function(je){ve&&$.collapsed&&!ve.options.lineWrapping&&Fr(je)==ve.display.maxLine&&(Se=!0),$.collapsed&&me!=t.line&&ar(je,0),rr(je,new gn($,me==t.line?t.ch:null,me==O.line?O.ch:null)),++me}),$.collapsed&&e.iter(t.line,O.line+1,function(je){_n(e,je)&&ar(je,0)}),$.clearOnEnter&&Re($,"beforeCursorEnter",function(){return $.clear()}),$.readOnly&&($r(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),$.collapsed&&($.id=++ps,$.atomic=!0),ve){if(Se&&(ve.curOp.updateMaxLine=!0),$.collapsed)on(ve,t.line,O.line+1);else if($.className||$.startStyle||$.endStyle||$.css||$.attributes||$.title)for(var ke=t.line;ke<=O.line;ke++)ei(ve,ke,"text");$.atomic&&ns(ve.doc),sr(ve,"markerAdded",ve,$)}return $}var ha=function(e,t){this.markers=e,this.primary=t;for(var O=0;O<e.length;++O)e[O].parent=this};ha.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sr(this,"clear")},ha.prototype.find=function(e,t){return this.primary.find(e,t)},Le(ha);function Sl(e,t,O,A,N){A=B(A),A.shared=!1;var $=[Ui(e,t,O,A,N)],le=$[0],me=A.widgetNode;return ii(e,function(ve){me&&(A.widgetNode=me.cloneNode(!0)),$.push(Ui(ve,K(ve,t),K(ve,O),A,N));for(var Se=0;Se<ve.linked.length;++Se)if(ve.linked[Se].isParent)return;le=re($)}),new ha($,le)}function ms(e){return e.findMarks(nt(e.first,0),e.clipPos(nt(e.lastLine())),function(t){return t.parent})}function Cl(e,t){for(var O=0;O<t.length;O++){var A=t[O],N=A.find(),$=e.clipPos(N.from),le=e.clipPos(N.to);if(kt($,le)){var me=Ui(e,$,le,A.primary,A.primary.type);A.markers.push(me),me.parent=A}}}function Tl(e){for(var t=function(A){var N=e[A],$=[N.primary.doc];ii(N.primary.doc,function(ve){return $.push(ve)});for(var le=0;le<N.markers.length;le++){var me=N.markers[le];de($,me.doc)==-1&&(me.parent=null,N.markers.splice(le--,1))}},O=0;O<e.length;O++)t(O)}var _l=0,sn=function(e,t,O,A,N){if(!(this instanceof sn))return new sn(e,t,O,A,N);O==null&&(O=0),ca.call(this,[new ua([new Kn("",null)])]),this.first=O,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=O;var $=nt(O,0);this.sel=ri($),this.history=new ka(null),this.id=++_l,this.modeOption=t,this.lineSep=A,this.direction=N=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),so(this,{from:$,to:$,text:e}),Qr(this,ri($),Ce)};sn.prototype=we(ca.prototype,{constructor:sn,iter:function(e,t,O){O?this.iterN(e-this.first,t-e,O):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var O=0,A=0;A<t.length;++A)O+=t[A].height;this.insertInner(e-this.first,t,O)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=fr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Hr(function(e){var t=nt(this.first,0),O=this.first+this.size-1;Fi(this,{from:t,to:nt(O,gt(this,O).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ea(this.cm,0,0),Qr(this,ri(t),Ce)}),replaceRange:function(e,t,O,A){t=K(this,t),O=O?K(this,O):t,Bi(this,e,t,O,A)},getRange:function(e,t,O){var A=Bt(this,K(this,e),K(this,t));return O===!1?A:A.join(O||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(zt(this,e))return gt(this,e)},getLineNumber:function(e){return Gt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=gt(this,e)),Fr(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 t=this.sel.primary(),O;return e==null||e=="head"?O=t.head:e=="anchor"?O=t.anchor:e=="end"||e=="to"||e===!1?O=t.to():O=t.from(),O},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Hr(function(e,t,O){es(this,K(this,typeof e=="number"?nt(e,t||0):e),null,O)}),setSelection:Hr(function(e,t,O){es(this,K(this,e),K(this,t||e),O)}),extendSelection:Hr(function(e,t,O){La(this,K(this,e),t&&K(this,t),O)}),extendSelections:Hr(function(e,t){qo(this,ee(this,e),t)}),extendSelectionsBy:Hr(function(e,t){var O=he(this.sel.ranges,e);qo(this,ee(this,O),t)}),setSelections:Hr(function(e,t,O){if(!e.length)return;for(var A=[],N=0;N<e.length;N++)A[N]=new lr(K(this,e[N].anchor),K(this,e[N].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Qr(this,jn(this.cm,A,t),O)}),addSelection:Hr(function(e,t,O){var A=this.sel.ranges.slice(0);A.push(new lr(K(this,e),K(this,t||e))),Qr(this,jn(this.cm,A,A.length-1),O)}),getSelection:function(e){for(var t=this.sel.ranges,O,A=0;A<t.length;A++){var N=Bt(this,t[A].from(),t[A].to());O=O?O.concat(N):N}return e===!1?O:O.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],O=this.sel.ranges,A=0;A<O.length;A++){var N=Bt(this,O[A].from(),O[A].to());e!==!1&&(N=N.join(e||this.lineSeparator())),t[A]=N}return t},replaceSelection:function(e,t,O){for(var A=[],N=0;N<this.sel.ranges.length;N++)A[N]=e;this.replaceSelections(A,t,O||"+input")},replaceSelections:Hr(function(e,t,O){for(var A=[],N=this.sel,$=0;$<N.ranges.length;$++){var le=N.ranges[$];A[$]={from:le.from(),to:le.to(),text:this.splitLines(e[$]),origin:O}}for(var me=t&&t!="end"&&fl(this,A,t),ve=A.length-1;ve>=0;ve--)Fi(this,A[ve]);me?ts(this,me):this.cm&&Ii(this.cm)}),undo:Hr(function(){Ma(this,"undo")}),redo:Hr(function(){Ma(this,"redo")}),undoSelection:Hr(function(){Ma(this,"undo",!0)}),redoSelection:Hr(function(){Ma(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,O=0,A=0;A<e.done.length;A++)e.done[A].ranges||++t;for(var N=0;N<e.undone.length;N++)e.undone[N].ranges||++O;return{undo:t,redo:O}},clearHistory:function(){var e=this;this.history=new ka(this.history.maxGeneration),ii(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ni(this.history.done),undone:Ni(this.history.undone)}},setHistory:function(e){var t=this.history=new ka(this.history.maxGeneration);t.done=Ni(e.done.slice(0),null,!0),t.undone=Ni(e.undone.slice(0),null,!0)},setGutterMarker:Hr(function(e,t,O){return la(this,e,"gutter",function(A){var N=A.gutterMarkers||(A.gutterMarkers={});return N[t]=O,!O&&Z(N)&&(A.gutterMarkers=null),!0})}),clearGutter:Hr(function(e){var t=this;this.iter(function(O){O.gutterMarkers&&O.gutterMarkers[e]&&la(t,O,"gutter",function(){return O.gutterMarkers[e]=null,Z(O.gutterMarkers)&&(O.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!zt(this,e))return null;if(t=e,e=gt(this,e),!e)return null}else if(t=Gt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Hr(function(e,t,O){return la(this,e,t=="gutter"?"gutter":"class",function(A){var N=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!A[N])A[N]=O;else{if(D(O).test(A[N]))return!1;A[N]+=" "+O}return!0})}),removeLineClass:Hr(function(e,t,O){return la(this,e,t=="gutter"?"gutter":"class",function(A){var N=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",$=A[N];if($)if(O==null)A[N]=null;else{var le=$.match(D(O));if(!le)return!1;var me=le.index+le[0].length;A[N]=$.slice(0,le.index)+(!le.index||me==$.length?"":" ")+$.slice(me)||null}else return!1;return!0})}),addLineWidget:Hr(function(e,t,O){return wl(this,e,t,O)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,O){return Ui(this,K(this,e),K(this,t),O,O&&O.type||"range")},setBookmark:function(e,t){var O={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=K(this,e),Ui(this,e,e,O,"bookmark")},findMarksAt:function(e){e=K(this,e);var t=[],O=gt(this,e.line).markedSpans;if(O)for(var A=0;A<O.length;++A){var N=O[A];(N.from==null||N.from<=e.ch)&&(N.to==null||N.to>=e.ch)&&t.push(N.marker.parent||N.marker)}return t},findMarks:function(e,t,O){e=K(this,e),t=K(this,t);var A=[],N=e.line;return this.iter(e.line,t.line+1,function($){var le=$.markedSpans;if(le)for(var me=0;me<le.length;me++){var ve=le[me];!(ve.to!=null&&N==e.line&&e.ch>=ve.to||ve.from==null&&N!=e.line||ve.from!=null&&N==t.line&&ve.from>=t.ch)&&(!O||O(ve.marker))&&A.push(ve.marker.parent||ve.marker)}++N}),A},getAllMarks:function(){var e=[];return this.iter(function(t){var O=t.markedSpans;if(O)for(var A=0;A<O.length;++A)O[A].from!=null&&e.push(O[A].marker)}),e},posFromIndex:function(e){var t,O=this.first,A=this.lineSeparator().length;return this.iter(function(N){var $=N.text.length+A;if($>e)return t=e,!0;e-=$,++O}),K(this,nt(O,t))},indexFromPos:function(e){e=K(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var O=this.lineSeparator().length;return this.iter(this.first,e.line,function(A){t+=A.text.length+O}),t},copy:function(e){var t=new sn(fr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,O=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<O&&(O=e.to);var A=new sn(fr(this,t,O),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(A.history=this.history),(this.linked||(this.linked=[])).push({doc:A,sharedHist:e.sharedHist}),A.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(A,ms(this)),A},unlinkDoc:function(e){if(e instanceof yr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var O=this.linked[t];if(O.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(ms(this));break}if(e.history==this.history){var A=[e.id];ii(e,function(N){return A.push(N.id)},!0),e.history=new ka(null),e.history.done=Ni(this.history.done,A),e.history.undone=Ni(this.history.undone,A)}},iterLinkedDocs:function(e){ii(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):xt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Hr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&pl(this.cm)})}),sn.prototype.eachLine=sn.prototype.iter;var gs=0;function Al(e){var t=this;if(vs(t),$e(t,e)||cr(t.display,e))return;Te(e),C&&(gs=+new Date);var O=vi(t,e,!0),A=e.dataTransfer.files;if(!O||t.isReadOnly())return;if(A&&A.length&&window.FileReader&&window.File)for(var N=A.length,$=Array(N),le=0,me=function(){++le==N&&Wr(t,function(){O=K(t.doc,O);var Ge={from:O,to:O,text:t.doc.splitLines($.filter(function(Qe){return Qe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Fi(t.doc,Ge),ts(t.doc,ri(K(t.doc,O),K(t.doc,ni(Ge))))})()},ve=function(Ge,Qe){if(t.options.allowDropFileTypes&&de(t.options.allowDropFileTypes,Ge.type)==-1){me();return}var it=new FileReader;it.onerror=function(){return me()},it.onload=function(){var ht=it.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ht)){me();return}$[Qe]=ht,me()},it.readAsText(Ge)},Se=0;Se<A.length;Se++)ve(A[Se],Se);else{if(t.state.draggingText&&t.doc.sel.contains(O)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ke=e.dataTransfer.getData("Text");if(ke){var je;if(t.state.draggingText&&!t.state.draggingText.copy&&(je=t.listSelections()),Pa(t.doc,ri(O,O)),je)for(var Ve=0;Ve<je.length;++Ve)Bi(t.doc,"",je[Ve].anchor,je[Ve].head,"drag");t.replaceSelection(ke,"around","paste"),t.display.input.focus()}}catch(Ge){}}}function Ol(e,t){if(C&&(!e.state.draggingText||+new Date-gs<100)){Me(t);return}if($e(e,t)||cr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d){var O=_("img",null,null,"position: fixed; left: 0; top: 0;");O.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(O.width=O.height=1,e.display.wrapper.appendChild(O),O._top=O.offsetTop),t.dataTransfer.setDragImage(O,0,0),h&&O.parentNode.removeChild(O)}}function Dl(e,t){var O=vi(e,t);if(!O)return;var A=document.createDocumentFragment();Do(e,O,A),e.display.dragCursor||(e.display.dragCursor=_("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,A)}function vs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ys(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),O=[],A=0;A<t.length;A++){var N=t[A].CodeMirror;N&&O.push(N)}O.length&&O[0].operation(function(){for(var $=0;$<O.length;$++)e(O[$])})}var bs=!1;function kl(){if(bs)return;Rl(),bs=!0}function Rl(){var e;Re(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ys(Ll)},100))}),Re(window,"blur",function(){return ys(Pi)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var oi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},fa=0;fa<10;fa++)oi[fa+48]=oi[fa+96]=String(fa);for(var Na=65;Na<=90;Na++)oi[Na]=String.fromCharCode(Na);for(var pa=1;pa<=12;pa++)oi[pa+111]=oi[pa+63235]="F"+pa;var Xn={};Xn.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"},Xn.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"},Xn.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"},Xn.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"]},Xn.default=o?Xn.macDefault:Xn.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var O,A,N,$,le=0;le<t.length-1;le++){var me=t[le];if(/^(cmd|meta|m)$/i.test(me))$=!0;else if(/^a(lt)?$/i.test(me))O=!0;else if(/^(c|ctrl|control)$/i.test(me))A=!0;else if(/^s(hift)?$/i.test(me))N=!0;else throw new Error("Unrecognized modifier name: "+me)}return O&&(e="Alt-"+e),A&&(e="Ctrl-"+e),$&&(e="Cmd-"+e),N&&(e="Shift-"+e),e}function Il(e){var t={};for(var O in e)if(e.hasOwnProperty(O)){var A=e[O];if(/^(name|fallthrough|(de|at)tach)$/.test(O))continue;if(A=="..."){delete e[O];continue}for(var N=he(O.split(" "),Pl),$=0;$<N.length;$++){var le=void 0,me=void 0;$==N.length-1?(me=N.join(" "),le=A):(me=N.slice(0,$+1).join(" "),le="...");var ve=t[me];if(!ve)t[me]=le;else if(ve!=le)throw new Error("Inconsistent bindings for "+me)}delete e[O]}for(var Se in t)e[Se]=t[Se];return e}function Wi(e,t,O,A){t=ja(t);var N=t.call?t.call(e,A):t[e];if(N===!1)return"nothing";if(N==="...")return"multi";if(N!=null&&O(N))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Wi(e,t.fallthrough,O,A);for(var $=0;$<t.fallthrough.length;$++){var le=Wi(e,t.fallthrough[$],O,A);if(le)return le}}}function xs(e){var t=typeof e=="string"?e:oi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Es(e,t,O){var A=e;return t.altKey&&A!="Alt"&&(e="Alt-"+e),(i?t.metaKey:t.ctrlKey)&&A!="Ctrl"&&(e="Ctrl-"+e),(i?t.ctrlKey:t.metaKey)&&A!="Mod"&&(e="Cmd-"+e),!O&&t.shiftKey&&A!="Shift"&&(e="Shift-"+e),e}function ws(e,t){if(h&&e.keyCode==34&&e.char)return!1;var O=oi[e.keyCode];return O==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(O=e.code),Es(O,e,t))}function ja(e){return typeof e=="string"?Xn[e]:e}function Hi(e,t){for(var O=e.doc.sel.ranges,A=[],N=0;N<O.length;N++){for(var $=t(O[N]);A.length&&kt($.from,re(A).to)<=0;){var le=A.pop();if(kt(le.from,$.from)<0){$.from=le.from;break}}A.push($)}fn(e,function(){for(var me=A.length-1;me>=0;me--)Bi(e.doc,"",A[me].from,A[me].to,"+delete");Ii(e)})}function ho(e,t,O){var A=_e(e.text,t+O,O);return A<0||A>e.text.length?null:A}function fo(e,t,O){var A=ho(e,t.ch,O);return A==null?null:new nt(t.line,A,O<0?"after":"before")}function po(e,t,O,A,N){if(e){t.doc.direction=="rtl"&&(N=-N);var $=Ke(O,t.doc.direction);if($){var le=N<0?re($):$[0],me=N<0==(le.level==1),ve=me?"after":"before",Se;if(le.level>0||t.doc.direction=="rtl"){var ke=xn(t,O);Se=N<0?O.text.length-1:0;var je=hn(t,ke,Se).top;Se=Ne(function(Ve){return hn(t,ke,Ve).top==je},N<0==(le.level==1)?le.from:le.to-1,Se),ve=="before"&&(Se=ho(O,Se,1))}else Se=N<0?le.to:le.from;return new nt(A,Se,ve)}}return new nt(A,N<0?O.text.length:0,N<0?"before":"after")}function Ml(e,t,O,A){var N=Ke(t,e.doc.direction);if(!N)return fo(t,O,A);O.ch>=t.text.length?(O.ch=t.text.length,O.sticky="before"):O.ch<=0&&(O.ch=0,O.sticky="after");var $=Ue(N,O.ch,O.sticky),le=N[$];if(e.doc.direction=="ltr"&&le.level%2==0&&(A>0?le.to>O.ch:le.from<O.ch))return fo(t,O,A);var me=function(yt,_t){return ho(t,yt instanceof nt?yt.ch:yt,_t)},ve,Se=function(yt){return e.options.lineWrapping?(ve=ve||xn(e,t),To(e,t,ve,yt)):{begin:0,end:t.text.length}},ke=Se(O.sticky=="before"?me(O,-1):O.ch);if(e.doc.direction=="rtl"||le.level==1){var je=le.level==1==A<0,Ve=me(O,je?1:-1);if(Ve!=null&&(je?Ve<=le.to&&Ve<=ke.end:Ve>=le.from&&Ve>=ke.begin)){var Ge=je?"before":"after";return new nt(O.line,Ve,Ge)}}var Qe=function(yt,_t,bt){for(var Ot=function(pr,Kr){return Kr?new nt(O.line,me(pr,1),"before"):new nt(O.line,pr,"after")};yt>=0&&yt<N.length;yt+=_t){var Ut=N[yt],jt=_t>0==(Ut.level!=1),qt=jt?bt.begin:me(bt.end,-1);if(Ut.from<=qt&&qt<Ut.to)return Ot(qt,jt);if(qt=jt?Ut.from:me(Ut.to,-1),bt.begin<=qt&&qt<bt.end)return Ot(qt,jt)}},it=Qe($+A,A,ke);if(it)return it;var ht=A>0?ke.end:me(ke.begin,-1);return ht!=null&&!(A>0&&ht==t.text.length)&&(it=Qe(A>0?0:N.length-1,A,Se(ht)),it)?it:null}var ma={selectAll:os,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ce)},killLine:function(e){return Hi(e,function(t){if(t.empty()){var O=gt(e.doc,t.head.line).text.length;return t.head.ch==O&&t.head.line<e.lastLine()?{from:t.head,to:nt(t.head.line+1,0)}:{from:t.head,to:nt(t.head.line,O)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Hi(e,function(t){return{from:nt(t.from().line,0),to:K(e.doc,nt(t.to().line+1,0))}})},delLineLeft:function(e){return Hi(e,function(t){return{from:nt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Hi(e,function(t){var O=e.charCoords(t.head,"div").top+5,A=e.coordsChar({left:0,top:O},"div");return{from:A,to:t.from()}})},delWrappedLineRight:function(e){return Hi(e,function(t){var O=e.charCoords(t.head,"div").top+5,A=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:O},"div");return{from:t.from(),to:A}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(nt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(nt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ss(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Cs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var O=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:O},"div")},ge)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var O=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:O},"div")},ge)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var O=e.cursorCoords(t.head,"div").top+5,A=e.coordsChar({left:0,top:O},"div");return A.ch<e.getLine(A.line).search(/\S/)?Cs(e,t.head):A},ge)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],O=e.listSelections(),A=e.options.tabSize,N=0;N<O.length;N++){var $=O[N].from(),le=W(e.getLine($.line),$.ch,A);t.push(ae(A-le%A))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return fn(e,function(){for(var t=e.listSelections(),O=[],A=0;A<t.length;A++){if(!t[A].empty())continue;var N=t[A].head,$=gt(e.doc,N.line).text;if($){if(N.ch==$.length&&(N=new nt(N.line,N.ch-1)),N.ch>0)N=new nt(N.line,N.ch+1),e.replaceRange($.charAt(N.ch-1)+$.charAt(N.ch-2),nt(N.line,N.ch-2),N,"+transpose");else if(N.line>e.doc.first){var le=gt(e.doc,N.line-1).text;le&&(N=new nt(N.line,1),e.replaceRange($.charAt(0)+e.doc.lineSeparator()+le.charAt(le.length-1),nt(N.line-1,le.length-1),N,"+transpose"))}}O.push(new lr(N,N))}e.setSelections(O)})},newlineAndIndent:function(e){return fn(e,function(){for(var t=e.listSelections(),O=t.length-1;O>=0;O--)e.replaceRange(e.doc.lineSeparator(),t[O].anchor,t[O].head,"+input");t=e.listSelections();for(var A=0;A<t.length;A++)e.indentLine(t[A].from().line,null,!0);Ii(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ss(e,t){var O=gt(e.doc,t),A=Fr(O);return A!=O&&(t=Gt(A)),po(!0,e,A,t,1)}function Nl(e,t){var O=gt(e.doc,t),A=Bn(O);return A!=O&&(t=Gt(A)),po(!0,e,O,t,-1)}function Cs(e,t){var O=Ss(e,t.line),A=gt(e.doc,O.line),N=Ke(A,e.doc.direction);if(!N||N[0].level==0){var $=Math.max(O.ch,A.text.search(/\S/)),le=t.line==O.line&&t.ch<=$&&t.ch;return nt(O.line,le?0:$,O.sticky)}return O}function Fa(e,t,O){if(typeof t=="string"&&(t=ma[t],!t))return!1;e.display.input.ensurePolled();var A=e.display.shift,N=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),O&&(e.display.shift=!1),N=t(e)!=be}finally{e.display.shift=A,e.state.suppressEdits=!1}return N}function jl(e,t,O){for(var A=0;A<e.state.keyMaps.length;A++){var N=Wi(t,e.state.keyMaps[A],O,e);if(N)return N}return e.options.extraKeys&&Wi(t,e.options.extraKeys,O,e)||Wi(t,e.options.keyMap,O,e)}var Fl=new te;function ga(e,t,O,A){var N=e.state.keySeq;if(N){if(xs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==N&&(e.state.keySeq=null,e.display.input.reset())}),Ts(e,N+" "+t,O,A))return!0}return Ts(e,t,O,A)}function Ts(e,t,O,A){var N=jl(e,t,A);return N=="multi"&&(e.state.keySeq=t),N=="handled"&&sr(e,"keyHandled",e,t,O),(N=="handled"||N=="multi")&&(Te(O),Ja(e)),!!N}function _s(e,t){var O=ws(t,!0);return O?t.shiftKey&&!e.state.keySeq?ga(e,"Shift-"+O,t,function(A){return Fa(e,A,!0)})||ga(e,O,t,function(A){if(typeof A=="string"?/^go[A-Z]/.test(A):A.motion)return Fa(e,A)}):ga(e,O,t,function(A){return Fa(e,A)}):!1}function Bl(e,t,O){return ga(e,"'"+O+"'",t,function(A){return Fa(e,A,!0)})}var mo=null;function As(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=X(),$e(t,e))return;C&&p<11&&e.keyCode==27&&(e.returnValue=!1);var O=e.keyCode;t.display.shift=O==16||e.shiftKey;var A=_s(t,e);h&&(mo=A?O:null,!A&&O==88&&!Wt&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),S&&!o&&!A&&O==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),O==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;z(t,"CodeMirror-crosshair");function O(A){(A.keyCode==18||!A.altKey)&&(c(t,"CodeMirror-crosshair"),rt(document,"keyup",O),rt(document,"mouseover",O))}Re(document,"keyup",O),Re(document,"mouseover",O)}function Os(e){e.keyCode==16&&(this.doc.sel.shift=!1),$e(this,e)}function Ds(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(cr(t.display,e)||$e(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var O=e.keyCode,A=e.charCode;if(h&&O==mo){mo=null,Te(e);return}if(h&&(!e.which||e.which<10)&&_s(t,e))return;var N=String.fromCharCode(A==null?O:A);if(N=="\b")return;if(Bl(t,e,N))return;t.display.input.onKeyPress(e)}var Wl=400,go=function(e,t,O){this.time=e,this.pos=t,this.button=O};go.prototype.compare=function(e,t,O){return this.time+Wl>e&&kt(t,this.pos)==0&&O==this.button};var va,ya;function Hl(e,t){var O=+new Date;return ya&&ya.compare(O,e,t)?(va=ya=null,"triple"):va&&va.compare(O,e,t)?(ya=new go(O,e,t),va=null,"double"):(va=new go(O,e,t),ya=null,"single")}function ks(e){var t=this,O=t.display;if($e(t,e)||O.activeTouch&&O.input.supportsTouch())return;if(O.input.ensurePolled(),O.shift=e.shiftKey,cr(O,e)){s||(O.scroller.draggable=!1,setTimeout(function(){return O.scroller.draggable=!0},100));return}if(vo(t,e))return;var A=vi(t,e),N=Xe(e),$=A?Hl(A,N):"single";if(window.focus(),N==1&&t.state.selectingText&&t.state.selectingText(e),A&&Kl(t,N,A,$,e))return;N==1?A?zl(t,A,$,e):Fe(e)==O.scroller&&Te(e):N==2?(A&&La(t.doc,A),setTimeout(function(){return O.input.focus()},20)):N==3&&(k?t.display.input.onContextMenu(e):Ro(t))}function Kl(e,t,O,A,N){var $="Click";return A=="double"?$="Double"+$:A=="triple"&&($="Triple"+$),$=(t==1?"Left":t==2?"Middle":"Right")+$,ga(e,Es($,N),N,function(le){if(typeof le=="string"&&(le=ma[le]),!le)return!1;var me=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),me=le(e,O)!=be}finally{e.state.suppressEdits=!1}return me})}function Gl(e,t,O){var A=e.getOption("configureMouse"),N=A?A(e,t,O):{};if(N.unit==null){var $=u?O.shiftKey&&O.metaKey:O.altKey;N.unit=$?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(N.extend==null||e.doc.extend)&&(N.extend=e.doc.extend||O.shiftKey),N.addNew==null&&(N.addNew=o?O.metaKey:O.ctrlKey),N.moveOnDrag==null&&(N.moveOnDrag=!(o?O.altKey:O.ctrlKey)),N}function zl(e,t,O,A){C?setTimeout(U(ko,e),0):e.curOp.focus=X();var N=Gl(e,O,A),$=e.doc.sel,le;e.options.dragDrop&&qe&&!e.isReadOnly()&&O=="single"&&(le=$.contains(t))>-1&&(kt((le=$.ranges[le]).from(),t)<0||t.xRel>0)&&(kt(le.to(),t)>0||t.xRel<0)?Vl(e,A,t,N):Xl(e,A,t,N)}function Vl(e,t,O,A){var N=e.display,$=!1,le=Wr(e,function(Se){s&&(N.scroller.draggable=!1),e.state.draggingText=!1,rt(N.wrapper.ownerDocument,"mouseup",le),rt(N.wrapper.ownerDocument,"mousemove",me),rt(N.scroller,"dragstart",ve),rt(N.scroller,"drop",le),$||(Te(Se),A.addNew||La(e.doc,O,null,null,A.extend),s&&!d||C&&p==9?setTimeout(function(){N.wrapper.ownerDocument.body.focus({preventScroll:!0}),N.input.focus()},20):N.input.focus())}),me=function(Se){$=$||Math.abs(t.clientX-Se.clientX)+Math.abs(t.clientY-Se.clientY)>=10},ve=function(){return $=!0};s&&(N.scroller.draggable=!0),e.state.draggingText=le,le.copy=!A.moveOnDrag,N.scroller.dragDrop&&N.scroller.dragDrop(),Re(N.wrapper.ownerDocument,"mouseup",le),Re(N.wrapper.ownerDocument,"mousemove",me),Re(N.scroller,"dragstart",ve),Re(N.scroller,"drop",le),Ro(e),setTimeout(function(){return N.input.focus()},20)}function Rs(e,t,O){if(O=="char")return new lr(t,t);if(O=="word")return e.findWordAt(t);if(O=="line")return new lr(nt(t.line,0),K(e.doc,nt(t.line+1,0)));var A=O(e,t);return new lr(A.from,A.to)}function Xl(e,t,O,A){var N=e.display,$=e.doc;Te(t);var le,me,ve=$.sel,Se=ve.ranges;if(A.addNew&&!A.extend?(me=$.sel.contains(O),me>-1?le=Se[me]:le=new lr(O,O)):(le=$.sel.primary(),me=$.sel.primIndex),A.unit=="rectangle")A.addNew||(le=new lr(O,O)),O=vi(e,t,!0,!0),me=-1;else{var ke=Rs(e,O,A.unit);A.extend?le=uo(le,ke.anchor,ke.head,A.extend):le=ke}A.addNew?me==-1?(me=Se.length,Qr($,jn(e,Se.concat([le]),me),{scroll:!1,origin:"*mouse"})):Se.length>1&&Se[me].empty()&&A.unit=="char"&&!A.extend?(Qr($,jn(e,Se.slice(0,me).concat(Se.slice(me+1)),0),{scroll:!1,origin:"*mouse"}),ve=$.sel):co($,me,le,ue):(me=0,Qr($,new Sn([le],0),ue),ve=$.sel);var je=O;function Ve(bt){if(kt(je,bt)==0)return;if(je=bt,A.unit=="rectangle"){for(var Ot=[],Ut=e.options.tabSize,jt=W(gt($,O.line).text,O.ch,Ut),qt=W(gt($,bt.line).text,bt.ch,Ut),pr=Math.min(jt,qt),Kr=Math.max(jt,qt),Er=Math.min(O.line,bt.line),pn=Math.min(e.lastLine(),Math.max(O.line,bt.line));Er<=pn;Er++){var ln=gt($,Er).text,Mr=pe(ln,pr,Ut);pr==Kr?Ot.push(new lr(nt(Er,Mr),nt(Er,Mr))):ln.length>Mr&&Ot.push(new lr(nt(Er,Mr),nt(Er,pe(ln,Kr,Ut))))}Ot.length||Ot.push(new lr(O,O)),Qr($,jn(e,ve.ranges.slice(0,me).concat(Ot),me),{origin:"*mouse",scroll:!1}),e.scrollIntoView(bt)}else{var un=le,Vr=Rs(e,bt,A.unit),Br=un.anchor,Nr;kt(Vr.anchor,Br)>0?(Nr=Vr.head,Br=Yr(un.from(),Vr.anchor)):(Nr=Vr.anchor,Br=Xr(un.to(),Vr.head));var Sr=ve.ranges.slice(0);Sr[me]=Yl(e,new lr(K($,Br),Nr)),Qr($,jn(e,Sr,me),ue)}}var Ge=N.wrapper.getBoundingClientRect(),Qe=0;function it(bt){var Ot=++Qe,Ut=vi(e,bt,!0,A.unit=="rectangle");if(!Ut)return;if(kt(Ut,je)!=0){e.curOp.focus=X(),Ve(Ut);var jt=_a(N,$);(Ut.line>=jt.to||Ut.line<jt.from)&&setTimeout(Wr(e,function(){Qe==Ot&&it(bt)}),150)}else{var qt=bt.clientY<Ge.top?-20:bt.clientY>Ge.bottom?20:0;qt&&setTimeout(Wr(e,function(){if(Qe!=Ot)return;N.scroller.scrollTop+=qt,it(bt)}),50)}}function ht(bt){e.state.selectingText=!1,Qe=Infinity,bt&&(Te(bt),N.input.focus()),rt(N.wrapper.ownerDocument,"mousemove",yt),rt(N.wrapper.ownerDocument,"mouseup",_t),$.history.lastSelOrigin=null}var yt=Wr(e,function(bt){bt.buttons===0||!Xe(bt)?ht(bt):it(bt)}),_t=Wr(e,ht);e.state.selectingText=_t,Re(N.wrapper.ownerDocument,"mousemove",yt),Re(N.wrapper.ownerDocument,"mouseup",_t)}function Yl(e,t){var O=t.anchor,A=t.head,N=gt(e.doc,O.line);if(kt(O,A)==0&&O.sticky==A.sticky)return t;var $=Ke(N);if(!$)return t;var le=Ue($,O.ch,O.sticky),me=$[le];if(me.from!=O.ch&&me.to!=O.ch)return t;var ve=le+(me.from==O.ch==(me.level!=1)?0:1);if(ve==0||ve==$.length)return t;var Se;if(A.line!=O.line)Se=(A.line-O.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ke=Ue($,A.ch,A.sticky),je=ke-le||(A.ch-O.ch)*(me.level==1?-1:1);ke==ve-1||ke==ve?Se=je<0:Se=je>0}var Ve=$[ve+(Se?-1:0)],Ge=Se==(Ve.level==1),Qe=Ge?Ve.from:Ve.to,it=Ge?"after":"before";return O.ch==Qe&&O.sticky==it?t:new lr(new nt(O.line,Qe,it),A)}function Ls(e,t,O,A){var N,$;if(t.touches)N=t.touches[0].clientX,$=t.touches[0].clientY;else try{N=t.clientX,$=t.clientY}catch(Ve){return!1}if(N>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;A&&Te(t);var le=e.display,me=le.lineDiv.getBoundingClientRect();if($>me.bottom||!Oe(e,O))return De(t);$-=me.top-le.viewOffset;for(var ve=0;ve<e.display.gutterSpecs.length;++ve){var Se=le.gutters.childNodes[ve];if(Se&&Se.getBoundingClientRect().right>=N){var ke=mr(e.doc,$),je=e.display.gutterSpecs[ve];return He(e,O,e,ke,je.className,t),De(t)}}}function vo(e,t){return Ls(e,t,"gutterClick",!0)}function Ps(e,t){if(cr(e.display,t)||$l(e,t))return;if($e(e,t,"contextmenu"))return;k||e.display.input.onContextMenu(t)}function $l(e,t){return Oe(e,"gutterContextMenu")?Ls(e,t,"gutterContextMenu",!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qn(e)}var Ki={toString:function(){return"CodeMirror.Init"}},Ms={},Ba={};function Jl(e){var t=e.optionHandlers;function O(A,N,$,le){e.defaults[A]=N,$&&(t[A]=le?function(me,ve,Se){Se!=Ki&&$(me,ve,Se)}:$)}e.defineOption=O,e.Init=Ki,O("value","",function(A,N){return A.setValue(N)},!0),O("mode",null,function(A,N){A.doc.modeOption=N,oo(A)},!0),O("indentUnit",2,oo,!0),O("indentWithTabs",!1),O("smartIndent",!0),O("tabSize",4,function(A){oa(A),qn(A),on(A)},!0),O("lineSeparator",null,function(A,N){if(A.doc.lineSep=N,!N)return;var $=[],le=A.doc.first;A.doc.iter(function(ve){for(var Se=0;;){var ke=ve.text.indexOf(N,Se);if(ke==-1)break;Se=ke+N.length,$.push(nt(le,ke))}le++});for(var me=$.length-1;me>=0;me--)Bi(A.doc,N,$[me],nt($[me].line,$[me].ch+N.length))}),O("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(A,N,$){A.state.specialChars=new RegExp(N.source+(N.test(" ")?"":"| "),"g"),$!=Ki&&A.refresh()}),O("specialCharPlaceholder",ot,function(A){return A.refresh()},!0),O("electricChars",!0),O("inputStyle",n?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),O("spellcheck",!1,function(A,N){return A.getInputField().spellcheck=N},!0),O("autocorrect",!1,function(A,N){return A.getInputField().autocorrect=N},!0),O("autocapitalize",!1,function(A,N){return A.getInputField().autocapitalize=N},!0),O("rtlMoveVisually",!w),O("wholeLineUpdateBefore",!0),O("theme","default",function(A){Is(A),aa(A)},!0),O("keyMap","default",function(A,N,$){var le=ja(N),me=$!=Ki&&ja($);me&&me.detach&&me.detach(A,le),le.attach&&le.attach(A,me||null)}),O("extraKeys",null),O("configureMouse",null),O("lineWrapping",!1,Ql,!0),O("gutters",[],function(A,N){A.display.gutterSpecs=io(N,A.options.lineNumbers),aa(A)},!0),O("fixedGutter",!0,function(A,N){A.display.gutters.style.left=N?Ya(A.display)+"px":"0",A.refresh()},!0),O("coverGutterNextToScrollbar",!1,function(A){return Mi(A)},!0),O("scrollbarStyle","native",function(A){jo(A),Mi(A),A.display.scrollbars.setScrollTop(A.doc.scrollTop),A.display.scrollbars.setScrollLeft(A.doc.scrollLeft)},!0),O("lineNumbers",!1,function(A,N){A.display.gutterSpecs=io(A.options.gutters,N),aa(A)},!0),O("firstLineNumber",1,aa,!0),O("lineNumberFormatter",function(A){return A},aa,!0),O("showCursorWhenSelecting",!1,qi,!0),O("resetSelectionOnContextMenu",!0),O("lineWiseCopyCut",!0),O("pasteLinesPerSelection",!0),O("selectionsMayTouch",!1),O("readOnly",!1,function(A,N){N=="nocursor"&&(Pi(A),A.display.input.blur()),A.display.input.readOnlyChanged(N)}),O("screenReaderLabel",null,function(A,N){N=N===""?null:N,A.display.input.screenReaderLabelChanged(N)}),O("disableInput",!1,function(A,N){N||A.display.input.reset()},!0),O("dragDrop",!0,Zl),O("allowDropFileTypes",null),O("cursorBlinkRate",530),O("cursorScrollMargin",0),O("cursorHeight",1,qi,!0),O("singleCursorHeightPerLine",!0,qi,!0),O("workTime",100),O("workDelay",100),O("flattenSpans",!0,oa,!0),O("addModeClass",!1,oa,!0),O("pollInterval",100),O("undoDepth",200,function(A,N){return A.doc.history.undoDepth=N}),O("historyEventDelay",1250),O("viewportMargin",10,function(A){return A.refresh()},!0),O("maxHighlightLength",1e4,oa,!0),O("moveInputWithCursor",!0,function(A,N){N||A.display.input.resetPosition()}),O("tabindex",null,function(A,N){return A.display.input.getField().tabIndex=N||""}),O("autofocus",null),O("direction","ltr",function(A,N){return A.doc.setDirection(N)},!0),O("phrases",null)}function Zl(e,t,O){var A=O&&O!=Ki;if(!t!=!A){var N=e.display.dragFunctions,$=t?Re:rt;$(e.display.scroller,"dragstart",N.start),$(e.display.scroller,"dragenter",N.enter),$(e.display.scroller,"dragover",N.over),$(e.display.scroller,"dragleave",N.leave),$(e.display.scroller,"drop",N.drop)}}function Ql(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(c(e.display.wrapper,"CodeMirror-wrap"),Ti(e)),$a(e),on(e),qn(e),setTimeout(function(){return Mi(e)},100)}function yr(e,t){var O=this;if(!(this instanceof yr))return new yr(e,t);this.options=t=t?B(t):{},B(Ms,t,!1);var A=t.value;typeof A=="string"?A=new sn(A,t.mode,null,t.lineSeparator,t.direction):t.mode&&(A.modeOption=t.mode),this.doc=A;var N=new yr.inputStyles[t.inputStyle](this),$=this.display=new dl(e,A,N,t);$.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),jo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new te,keySeq:null,specialChars:null},t.autofocus&&!n&&$.input.focus(),C&&p<11&&setTimeout(function(){return O.display.input.reset(!0)},20),ql(this),kl(),Ei(this),this.curOp.forceUpdate=!0,Xo(this,A),t.autofocus&&!n||this.hasFocus()?setTimeout(function(){O.hasFocus()&&!O.state.focused&&Za(O)},20):Pi(this);for(var le in Ba)Ba.hasOwnProperty(le)&&Ba[le](this,t[le],Ki);Uo(this),t.finishInit&&t.finishInit(this);for(var me=0;me<yo.length;++me)yo[me](this);wi(this),s&&t.lineWrapping&&getComputedStyle($.lineDiv).textRendering=="optimizelegibility"&&($.lineDiv.style.textRendering="auto")}yr.defaults=Ms,yr.optionHandlers=Ba;function ql(e){var t=e.display;Re(t.scroller,"mousedown",Wr(e,ks)),C&&p<11?Re(t.scroller,"dblclick",Wr(e,function(ve){if($e(e,ve))return;var Se=vi(e,ve);if(!Se||vo(e,ve)||cr(e.display,ve))return;Te(ve);var ke=e.findWordAt(Se);La(e.doc,ke.anchor,ke.head)})):Re(t.scroller,"dblclick",function(ve){return $e(e,ve)||Te(ve)}),Re(t.scroller,"contextmenu",function(ve){return Ps(e,ve)}),Re(t.input.getField(),"contextmenu",function(ve){t.scroller.contains(ve.target)||Ps(e,ve)});var O,A={end:0};function N(){t.activeTouch&&(O=setTimeout(function(){return t.activeTouch=null},1e3),A=t.activeTouch,A.end=+new Date)}function $(ve){if(ve.touches.length!=1)return!1;var Se=ve.touches[0];return Se.radiusX<=1&&Se.radiusY<=1}function le(ve,Se){if(Se.left==null)return!0;var ke=Se.left-ve.left,je=Se.top-ve.top;return ke*ke+je*je>20*20}Re(t.scroller,"touchstart",function(ve){if(!$e(e,ve)&&!$(ve)&&!vo(e,ve)){t.input.ensurePolled(),clearTimeout(O);var Se=+new Date;t.activeTouch={start:Se,moved:!1,prev:Se-A.end<=300?A:null},ve.touches.length==1&&(t.activeTouch.left=ve.touches[0].pageX,t.activeTouch.top=ve.touches[0].pageY)}}),Re(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Re(t.scroller,"touchend",function(ve){var Se=t.activeTouch;if(Se&&!cr(t,ve)&&Se.left!=null&&!Se.moved&&new Date-Se.start<300){var ke=e.coordsChar(t.activeTouch,"page"),je;!Se.prev||le(Se,Se.prev)?je=new lr(ke,ke):!Se.prev.prev||le(Se,Se.prev.prev)?je=e.findWordAt(ke):je=new lr(nt(ke.line,0),K(e.doc,nt(ke.line+1,0))),e.setSelection(je.anchor,je.head),e.focus(),Te(ve)}N()}),Re(t.scroller,"touchcancel",N),Re(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ta(e,t.scroller.scrollTop),bi(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),Re(t.scroller,"mousewheel",function(ve){return Ko(e,ve)}),Re(t.scroller,"DOMMouseScroll",function(ve){return Ko(e,ve)}),Re(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ve){$e(e,ve)||Me(ve)},over:function(ve){$e(e,ve)||(Dl(e,ve),Me(ve))},start:function(ve){return Ol(e,ve)},drop:Wr(e,Al),leave:function(ve){$e(e,ve)||vs(e)}};var me=t.input.getField();Re(me,"keyup",function(ve){return Os.call(e,ve)}),Re(me,"keydown",Wr(e,As)),Re(me,"keypress",Wr(e,Ds)),Re(me,"focus",function(ve){return Za(e,ve)}),Re(me,"blur",function(ve){return Pi(e,ve)})}var yo=[];yr.defineInitHook=function(e){return yo.push(e)};function ba(e,t,O,A){var N=e.doc,$;O==null&&(O="add"),O=="smart"&&(N.mode.indent?$=mt(e,t).state:O="prev");var le=e.options.tabSize,me=gt(N,t),ve=W(me.text,null,le);me.stateAfter&&(me.stateAfter=null);var Se=me.text.match(/^\s*/)[0],ke;if(!A&&!/\S/.test(me.text))ke=0,O="not";else if(O=="smart"&&(ke=N.mode.indent($,me.text.slice(Se.length),me.text),ke==be||ke>150)){if(!A)return;O="prev"}O=="prev"?t>N.first?ke=W(gt(N,t-1).text,null,le):ke=0:O=="add"?ke=ve+e.options.indentUnit:O=="subtract"?ke=ve-e.options.indentUnit:typeof O=="number"&&(ke=ve+O),ke=Math.max(0,ke);var je="",Ve=0;if(e.options.indentWithTabs)for(var Ge=Math.floor(ke/le);Ge;--Ge)Ve+=le,je+=" ";if(Ve<ke&&(je+=ae(ke-Ve)),je!=Se)return Bi(N,je,nt(t,0),nt(t,Se.length),"+input"),me.stateAfter=null,!0;for(var Qe=0;Qe<N.sel.ranges.length;Qe++){var it=N.sel.ranges[Qe];if(it.head.line==t&&it.head.ch<Se.length){var ht=nt(t,Se.length);co(N,Qe,new lr(ht,ht));break}}}var Fn=null;function Ua(e){Fn=e}function bo(e,t,O,A,N){var $=e.doc;e.display.shift=!1,A||(A=$.sel);var le=+new Date-200,me=N=="paste"||e.state.pasteIncoming>le,ve=xt(t),Se=null;if(me&&A.ranges.length>1)if(Fn&&Fn.text.join(`
`)==t){if(A.ranges.length%Fn.text.length==0){Se=[];for(var ke=0;ke<Fn.text.length;ke++)Se.push($.splitLines(Fn.text[ke]))}}else ve.length==A.ranges.length&&e.options.pasteLinesPerSelection&&(Se=he(ve,function(yt){return[yt]}));for(var je=e.curOp.updateInput,Ve=A.ranges.length-1;Ve>=0;Ve--){var Ge=A.ranges[Ve],Qe=Ge.from(),it=Ge.to();Ge.empty()&&(O&&O>0?Qe=nt(Qe.line,Qe.ch-O):e.state.overwrite&&!me?it=nt(it.line,Math.min(gt($,it.line).text.length,it.ch+re(ve).length)):me&&Fn&&Fn.lineWise&&Fn.text.join(`
`)==ve.join(`
`)&&(Qe=it=nt(Qe.line,0)));var ht={from:Qe,to:it,text:Se?Se[Ve%Se.length]:ve,origin:N||(me?"paste":e.state.cutIncoming>le?"cut":"+input")};Fi(e.doc,ht),sr(e,"inputRead",e,ht)}t&&!me&&js(e,t),Ii(e),e.curOp.updateInput<2&&(e.curOp.updateInput=je),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ns(e,t){var O=e.clipboardData&&e.clipboardData.getData("Text");if(O)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&fn(t,function(){return bo(t,O,0,null,"paste")}),!0}function js(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var O=e.doc.sel,A=O.ranges.length-1;A>=0;A--){var N=O.ranges[A];if(N.head.ch>100||A&&O.ranges[A-1].head.line==N.head.line)continue;var $=e.getModeAt(N.head),le=!1;if($.electricChars){for(var me=0;me<$.electricChars.length;me++)if(t.indexOf($.electricChars.charAt(me))>-1){le=ba(e,N.head.line,"smart");break}}else $.electricInput&&($.electricInput.test(gt(e.doc,N.head.line).text.slice(0,N.head.ch))&&(le=ba(e,N.head.line,"smart")));le&&sr(e,"electricInput",e,N.head.line)}}function Fs(e){for(var t=[],O=[],A=0;A<e.doc.sel.ranges.length;A++){var N=e.doc.sel.ranges[A].head.line,$={anchor:nt(N,0),head:nt(N+1,0)};O.push($),t.push(e.getRange($.anchor,$.head))}return{text:t,ranges:O}}function Bs(e,t,O,A){e.setAttribute("autocorrect",O?"":"off"),e.setAttribute("autocapitalize",A?"":"off"),e.setAttribute("spellcheck",!!t)}function Us(){var e=_("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=_("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),y&&(e.style.border="1px solid black"),Bs(e),t}function eu(e){var t=e.optionHandlers,O=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(A,N){var $=this.options,le=$[A];if($[A]==N&&A!="mode")return;$[A]=N,t.hasOwnProperty(A)&&Wr(this,t[A])(this,N,le),He(this,"optionChange",this,A)},getOption:function(A){return this.options[A]},getDoc:function(){return this.doc},addKeyMap:function(A,N){this.state.keyMaps[N?"push":"unshift"](ja(A))},removeKeyMap:function(A){for(var N=this.state.keyMaps,$=0;$<N.length;++$)if(N[$]==A||N[$].name==A)return N.splice($,1),!0},addOverlay:nn(function(A,N){var $=A.token?A:e.getMode(this.options,A);if($.startState)throw new Error("Overlays may not be stateful.");Q(this.state.overlays,{mode:$,modeSpec:A,opaque:N&&N.opaque,priority:N&&N.priority||0},function(le){return le.priority}),this.state.modeGen++,on(this)}),removeOverlay:nn(function(A){for(var N=this.state.overlays,$=0;$<N.length;++$){var le=N[$].modeSpec;if(le==A||typeof A=="string"&&le.name==A){N.splice($,1),this.state.modeGen++,on(this);return}}}),indentLine:nn(function(A,N,$){typeof N!="string"&&typeof N!="number"&&(N==null?N=this.options.smartIndent?"smart":"prev":N=N?"add":"subtract"),zt(this.doc,A)&&ba(this,A,N,$)}),indentSelection:nn(function(A){for(var N=this.doc.sel.ranges,$=-1,le=0;le<N.length;le++){var me=N[le];if(me.empty())me.head.line>$&&(ba(this,me.head.line,A,!0),$=me.head.line,le==this.doc.sel.primIndex&&Ii(this));else{var ve=me.from(),Se=me.to(),ke=Math.max($,ve.line);$=Math.min(this.lastLine(),Se.line-(Se.ch?0:1))+1;for(var je=ke;je<$;++je)ba(this,je,A);var Ve=this.doc.sel.ranges;ve.ch==0&&N.length==Ve.length&&Ve[le].from().ch>0&&co(this.doc,le,new lr(ve,Ve[le].to()),Ce)}}}),getTokenAt:function(A,N){return Yt(this,A,N)},getLineTokens:function(A,N){return Yt(this,nt(A),N,!0)},getTokenTypeAt:function(A){A=K(this.doc,A);var N=Ze(this,gt(this.doc,A.line)),$=0,le=(N.length-1)/2,me=A.ch,ve;if(me==0)ve=N[2];else for(;;){var Se=$+le>>1;if((Se?N[Se*2-1]:0)>=me)le=Se;else if(N[Se*2+1]<me)$=Se+1;else{ve=N[Se*2+2];break}}var ke=ve?ve.indexOf("overlay "):-1;return ke<0?ve:ke==0?null:ve.slice(0,ke-1)},getModeAt:function(A){var N=this.doc.mode;return N.innerMode?e.innerMode(N,this.getTokenAt(A).state).mode:N},getHelper:function(A,N){return this.getHelpers(A,N)[0]},getHelpers:function(A,N){var $=[];if(!O.hasOwnProperty(N))return $;var le=O[N],me=this.getModeAt(A);if(typeof me[N]=="string")le[me[N]]&&$.push(le[me[N]]);else if(me[N])for(var ve=0;ve<me[N].length;ve++){var Se=le[me[N][ve]];Se&&$.push(Se)}else me.helperType&&le[me.helperType]?$.push(le[me.helperType]):le[me.name]&&$.push(le[me.name]);for(var ke=0;ke<le._global.length;ke++){var je=le._global[ke];je.pred(me,this)&&de($,je.val)==-1&&$.push(je.val)}return $},getStateAfter:function(A,N){var $=this.doc;return A=ce($,A==null?$.first+$.size-1:A),mt(this,A+1,N).state},cursorCoords:function(A,N){var $,le=this.doc.sel.primary();return A==null?$=le.head:typeof A=="object"?$=K(this.doc,A):$=A?le.from():le.to(),Nn(this,$,N||"page")},charCoords:function(A,N){return Ka(this,K(this.doc,A),N||"page")},coordsChar:function(A,N){return A=En(this,A,N||"page"),za(this,A.left,A.top)},lineAtHeight:function(A,N){return A=En(this,{top:A,left:0},N||"page").top,mr(this.doc,A+this.display.viewOffset)},heightAtLine:function(A,N,$){var le=!1,me;if(typeof A=="number"){var ve=this.doc.first+this.doc.size-1;A<this.doc.first?A=this.doc.first:A>ve&&(A=ve,le=!0),me=gt(this.doc,A)}else me=A;return Zr(this,me,{top:0,left:0},N||"page",$||le).top+(le?this.doc.height-vn(me):0)},defaultTextHeight:function(){return Ri(this.display)},defaultCharWidth:function(){return Li(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(A,N,$,le,me){var ve=this.display;A=Nn(this,K(this.doc,A));var Se=A.bottom,ke=A.left;if(N.style.position="absolute",N.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(N),ve.sizer.appendChild(N),le=="over")Se=A.top;else if(le=="above"||le=="near"){var je=Math.max(ve.wrapper.clientHeight,this.doc.height),Ve=Math.max(ve.sizer.clientWidth,ve.lineSpace.clientWidth);(le=="above"||A.bottom+N.offsetHeight>je)&&A.top>N.offsetHeight?Se=A.top-N.offsetHeight:A.bottom+N.offsetHeight<=je&&(Se=A.bottom),ke+N.offsetWidth>Ve&&(ke=Ve-N.offsetWidth)}N.style.top=Se+"px",N.style.left=N.style.right="",me=="right"?(ke=ve.sizer.clientWidth-N.offsetWidth,N.style.right="0px"):(me=="left"?ke=0:me=="middle"&&(ke=(ve.sizer.clientWidth-N.offsetWidth)/2),N.style.left=ke+"px"),$&&Js(this,{left:ke,top:Se,right:ke+N.offsetWidth,bottom:Se+N.offsetHeight})},triggerOnKeyDown:nn(As),triggerOnKeyPress:nn(Ds),triggerOnKeyUp:Os,triggerOnMouseDown:nn(ks),execCommand:function(A){if(ma.hasOwnProperty(A))return ma[A].call(null,this)},triggerElectric:nn(function(A){js(this,A)}),findPosH:function(A,N,$,le){var me=1;N<0&&(me=-1,N=-N);for(var ve=K(this.doc,A),Se=0;Se<N&&!(ve=xo(this.doc,ve,me,$,le),ve.hitSide);++Se);return ve},moveH:nn(function(A,N){var $=this;this.extendSelectionsBy(function(le){return $.display.shift||$.doc.extend||le.empty()?xo($.doc,le.head,A,N,$.options.rtlMoveVisually):A<0?le.from():le.to()},ge)}),deleteH:nn(function(A,N){var $=this.doc.sel,le=this.doc;$.somethingSelected()?le.replaceSelection("",null,"+delete"):Hi(this,function(me){var ve=xo(le,me.head,A,N,!1);return A<0?{from:ve,to:me.head}:{from:me.head,to:ve}})}),findPosV:function(A,N,$,le){var me=1,ve=le;N<0&&(me=-1,N=-N);for(var Se=K(this.doc,A),ke=0;ke<N;++ke){var je=Nn(this,Se,"div");if(ve==null?ve=je.left:je.left=ve,Se=Ws(this,je,me,$),Se.hitSide)break}return Se},moveV:nn(function(A,N){var $=this,le=this.doc,me=[],ve=!this.display.shift&&!le.extend&&le.sel.somethingSelected();if(le.extendSelectionsBy(function(ke){if(ve)return A<0?ke.from():ke.to();var je=Nn($,ke.head,"div");ke.goalColumn!=null&&(je.left=ke.goalColumn),me.push(je.left);var Ve=Ws($,je,A,N);return N=="page"&&ke==le.sel.primary()&&qa($,Ka($,Ve,"div").top-je.top),Ve},ge),me.length)for(var Se=0;Se<le.sel.ranges.length;Se++)le.sel.ranges[Se].goalColumn=me[Se]}),findWordAt:function(A){var N=this.doc,$=gt(N,A.line).text,le=A.ch,me=A.ch;if($){var ve=this.getHelper(A,"wordChars");(A.sticky=="before"||me==$.length)&&le?--le:++me;for(var Se=$.charAt(le),ke=V(Se,ve)?function(je){return V(je,ve)}:/\s/.test(Se)?function(je){return/\s/.test(je)}:function(je){return!/\s/.test(je)&&!V(je)};le>0&&ke($.charAt(le-1));)--le;for(;me<$.length&&ke($.charAt(me));)++me}return new lr(nt(A.line,le),nt(A.line,me))},toggleOverwrite:function(A){if(A!=null&&A==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):c(this.display.cursorDiv,"CodeMirror-overwrite"),He(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==X()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:nn(function(A,N){ea(this,A,N)}),getScrollInfo:function(){var A=this.display.scroller;return{left:A.scrollLeft,top:A.scrollTop,height:A.scrollHeight-bn(this)-this.display.barHeight,width:A.scrollWidth-bn(this)-this.display.barWidth,clientHeight:mi(this),clientWidth:In(this)}},scrollIntoView:nn(function(A,N){A==null?(A={from:this.doc.sel.primary().head,to:null},N==null&&(N=this.options.cursorScrollMargin)):typeof A=="number"?A={from:nt(A,0),to:null}:A.from==null&&(A={from:A,to:null}),A.to||(A.to=A.from),A.margin=N||0,A.from.line!=null?Zs(this,A):Po(this,A.from,A.to,A.margin)}),setSize:nn(function(A,N){var $=this,le=function(ve){return typeof ve=="number"||/^\d+$/.test(String(ve))?ve+"px":ve};A!=null&&(this.display.wrapper.style.width=le(A)),N!=null&&(this.display.wrapper.style.height=le(N)),this.options.lineWrapping&&kn(this);var me=this.display.viewFrom;this.doc.iter(me,this.display.viewTo,function(ve){if(ve.widgets){for(var Se=0;Se<ve.widgets.length;Se++)if(ve.widgets[Se].noHScroll){ei($,me,"widget");break}}++me}),this.curOp.forceUpdate=!0,He(this,"refresh",this)}),operation:function(A){return fn(this,A)},startOperation:function(){return Ei(this)},endOperation:function(){return wi(this)},refresh:nn(function(){var A=this.display.cachedTextHeight;on(this),this.curOp.forceUpdate=!0,qn(this),ea(this,this.doc.scrollLeft,this.doc.scrollTop),ro(this.display),(A==null||Math.abs(A-Ri(this.display))>.5||this.options.lineWrapping)&&$a(this),He(this,"refresh",this)}),swapDoc:nn(function(A){var N=this.doc;return N.cm=null,this.state.selectingText&&this.state.selectingText(),Xo(this,A),qn(this),this.display.input.reset(),ea(this,A.scrollLeft,A.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,N),N}),phrase:function(A){var N=this.options.phrases;return N&&Object.prototype.hasOwnProperty.call(N,A)?N[A]:A},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Le(e),e.registerHelper=function(A,N,$){O.hasOwnProperty(A)||(O[A]=e[A]={_global:[]}),O[A][N]=$},e.registerGlobalHelper=function(A,N,$,le){e.registerHelper(A,N,le),O[A]._global.push({pred:$,val:le})}}function xo(e,t,O,A,N){var $=t,le=O,me=gt(e,t.line),ve=N&&e.direction=="rtl"?-O:O;function Se(){var _t=t.line+ve;return _t<e.first||_t>=e.first+e.size?!1:(t=new nt(_t,t.ch,t.sticky),me=gt(e,_t))}function ke(_t){var bt;if(A=="codepoint"){var Ot=me.text.charCodeAt(t.ch+(A>0?0:-1));isNaN(Ot)?bt=null:bt=new nt(t.line,Math.max(0,Math.min(me.text.length,t.ch+O*(Ot>=55296&&Ot<56320?2:1))),-O)}else N?bt=Ml(e.cm,me,t,O):bt=fo(me,t,O);if(bt==null)if(!_t&&Se())t=po(N,e.cm,me,t.line,ve);else return!1;else t=bt;return!0}if(A=="char"||A=="codepoint")ke();else if(A=="column")ke(!0);else if(A=="word"||A=="group")for(var je=null,Ve=A=="group",Ge=e.cm&&e.cm.getHelper(t,"wordChars"),Qe=!0;!(O<0&&!ke(!Qe));Qe=!1){var it=me.text.charAt(t.ch)||`
`,ht=V(it,Ge)?"w":Ve&&it==`
`?"n":!Ve||/\s/.test(it)?null:"p";if(Ve&&!Qe&&!ht&&(ht="s"),je&&je!=ht){O<0&&(O=1,ke(),t.sticky="after");break}if(ht&&(je=ht),O>0&&!ke(!Qe))break}var yt=Ia(e,t,$,le,!0);return zr($,yt)&&(yt.hitSide=!0),yt}function Ws(e,t,O,A){var N=e.doc,$=t.left,le;if(A=="page"){var me=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ve=Math.max(me-.5*Ri(e.display),3);le=(O>0?t.bottom:t.top)+O*ve}else A=="line"&&(le=O>0?t.bottom+3:t.top-3);for(var Se;!(Se=za(e,$,le),!Se.outside);){if(O<0?le<=0:le>=N.height){Se.hitSide=!0;break}le+=O*5}return Se}var dr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};dr.prototype.init=function(e){var t=this,O=this,A=O.cm,N=O.div=e.lineDiv;Bs(N,A.options.spellcheck,A.options.autocorrect,A.options.autocapitalize);function $(me){for(var ve=me.target;ve;ve=ve.parentNode){if(ve==N)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ve.className))break}return!1}Re(N,"paste",function(me){if(!$(me)||$e(A,me)||Ns(me,A))return;p<=11&&setTimeout(Wr(A,function(){return t.updateFromDOM()}),20)}),Re(N,"compositionstart",function(me){t.composing={data:me.data,done:!1}}),Re(N,"compositionupdate",function(me){t.composing||(t.composing={data:me.data,done:!1})}),Re(N,"compositionend",function(me){t.composing&&(me.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Re(N,"touchstart",function(){return O.forceCompositionEnd()}),Re(N,"input",function(){t.composing||t.readFromDOMSoon()});function le(me){if(!$(me)||$e(A,me))return;if(A.somethingSelected())Ua({lineWise:!1,text:A.getSelections()}),me.type=="cut"&&A.replaceSelection("",null,"cut");else if(A.options.lineWiseCopyCut){var ve=Fs(A);Ua({lineWise:!0,text:ve.text}),me.type=="cut"&&A.operation(function(){A.setSelections(ve.ranges,0,Ce),A.replaceSelection("",null,"cut")})}else return;if(me.clipboardData){me.clipboardData.clearData();var Se=Fn.text.join(`
`);if(me.clipboardData.setData("Text",Se),me.clipboardData.getData("Text")==Se){me.preventDefault();return}}var ke=Us(),je=ke.firstChild;A.display.lineSpace.insertBefore(ke,A.display.lineSpace.firstChild),je.value=Fn.text.join(`
`);var Ve=document.activeElement;G(je),setTimeout(function(){A.display.lineSpace.removeChild(ke),Ve.focus(),Ve==N&&O.showPrimarySelection()},50)}Re(N,"copy",le),Re(N,"cut",le)},dr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},dr.prototype.prepareSelection=function(){var e=Oo(this.cm,!1);return e.focus=document.activeElement==this.div,e},dr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},dr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},dr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,O=t.doc.sel.primary(),A=O.from(),N=O.to();if(t.display.viewTo==t.display.viewFrom||A.line>=t.display.viewTo||N.line<t.display.viewFrom){e.removeAllRanges();return}var $=Wa(t,e.anchorNode,e.anchorOffset),le=Wa(t,e.focusNode,e.focusOffset);if($&&!$.bad&&le&&!le.bad&&kt(Yr($,le),A)==0&&kt(Xr($,le),N)==0)return;var me=t.display.view,ve=A.line>=t.display.viewFrom&&Hs(t,A)||{node:me[0].measure.map[2],offset:0},Se=N.line<t.display.viewTo&&Hs(t,N);if(!Se){var ke=me[me.length-1].measure,je=ke.maps?ke.maps[ke.maps.length-1]:ke.map;Se={node:je[je.length-1],offset:je[je.length-2]-je[je.length-3]}}if(!ve||!Se){e.removeAllRanges();return}var Ve=e.rangeCount&&e.getRangeAt(0),Ge;try{Ge=F(ve.node,ve.offset,Se.offset,Se.node)}catch(Qe){}Ge&&(!S&&t.state.focused?(e.collapse(ve.node,ve.offset),Ge.collapsed||(e.removeAllRanges(),e.addRange(Ge))):(e.removeAllRanges(),e.addRange(Ge)),Ve&&e.anchorNode==null?e.addRange(Ve):S&&this.startGracePeriod()),this.rememberSelection()},dr.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)},dr.prototype.showMultipleSelections=function(e){x(this.cm.display.cursorDiv,e.cursors),x(this.cm.display.selectionDiv,e.selection)},dr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},dr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return L(this.div,t)},dr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},dr.prototype.blur=function(){this.div.blur()},dr.prototype.getField=function(){return this.div},dr.prototype.supportsTouch=function(){return!0},dr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():fn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},dr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},dr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&r&&this.cm.display.gutterSpecs.length&&tu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var O=Wa(t,e.anchorNode,e.anchorOffset),A=Wa(t,e.focusNode,e.focusOffset);O&&A&&fn(t,function(){Qr(t.doc,ri(O,A),Ce),(O.bad||A.bad)&&(t.curOp.selectionChanged=!0)})},dr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,O=e.doc.sel.primary(),A=O.from(),N=O.to();if(A.ch==0&&A.line>e.firstLine()&&(A=nt(A.line-1,gt(e.doc,A.line-1).length)),N.ch==gt(e.doc,N.line).text.length&&N.line<e.lastLine()&&(N=nt(N.line+1,0)),A.line<t.viewFrom||N.line>t.viewTo-1)return!1;var $,le,me;A.line==t.viewFrom||($=yi(e,A.line))==0?(le=Gt(t.view[0].line),me=t.view[0].node):(le=Gt(t.view[$].line),me=t.view[$-1].node.nextSibling);var ve=yi(e,N.line),Se,ke;if(ve==t.view.length-1?(Se=t.viewTo-1,ke=t.lineDiv.lastChild):(Se=Gt(t.view[ve+1].line)-1,ke=t.view[ve+1].node.previousSibling),!me)return!1;for(var je=e.doc.splitLines(ru(e,me,ke,le,Se)),Ve=Bt(e.doc,nt(le,0),nt(Se,gt(e.doc,Se).text.length));je.length>1&&Ve.length>1;)if(re(je)==re(Ve))je.pop(),Ve.pop(),Se--;else if(je[0]==Ve[0])je.shift(),Ve.shift(),le++;else break;for(var Ge=0,Qe=0,it=je[0],ht=Ve[0],yt=Math.min(it.length,ht.length);Ge<yt&&it.charCodeAt(Ge)==ht.charCodeAt(Ge);)++Ge;for(var _t=re(je),bt=re(Ve),Ot=Math.min(_t.length-(je.length==1?Ge:0),bt.length-(Ve.length==1?Ge:0));Qe<Ot&&_t.charCodeAt(_t.length-Qe-1)==bt.charCodeAt(bt.length-Qe-1);)++Qe;if(je.length==1&&Ve.length==1&&le==A.line)for(;Ge&&Ge>A.ch&&_t.charCodeAt(_t.length-Qe-1)==bt.charCodeAt(bt.length-Qe-1);)Ge--,Qe++;je[je.length-1]=_t.slice(0,_t.length-Qe).replace(/^\u200b+/,""),je[0]=je[0].slice(Ge).replace(/\u200b+$/,"");var Ut=nt(le,Ge),jt=nt(Se,Ve.length?re(Ve).length-Qe:0);if(je.length>1||je[0]||kt(Ut,jt))return Bi(e.doc,je,Ut,jt,"+input"),!0},dr.prototype.ensurePolled=function(){this.forceCompositionEnd()},dr.prototype.reset=function(){this.forceCompositionEnd()},dr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},dr.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)},dr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&fn(this.cm,function(){return on(e.cm)})},dr.prototype.setUneditable=function(e){e.contentEditable="false"},dr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Wr(this.cm,bo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},dr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},dr.prototype.onContextMenu=function(){},dr.prototype.resetPosition=function(){},dr.prototype.needsContentAttribute=!0;function Hs(e,t){var O=Ai(e,t.line);if(!O||O.hidden)return null;var A=gt(e.doc,t.line),N=_i(O,A,t.line),$=Ke(A,e.doc.direction),le="left";if($){var me=Ue($,t.ch);le=me%2?"right":"left"}var ve=Qn(N.map,t.ch,le);return ve.offset=ve.collapse=="right"?ve.end:ve.start,ve}function tu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Gi(e,t){return t&&(e.bad=!0),e}function ru(e,t,O,A,N){var $="",le=!1,me=e.doc.lineSeparator(),ve=!1;function Se(Ge){return function(Qe){return Qe.id==Ge}}function ke(){le&&($+=me,ve&&($+=me),le=ve=!1)}function je(Ge){Ge&&(ke(),$+=Ge)}function Ve(Ge){if(Ge.nodeType==1){var Qe=Ge.getAttribute("cm-text");if(Qe){je(Qe);return}var it=Ge.getAttribute("cm-marker"),ht;if(it){var yt=e.findMarks(nt(A,0),nt(N+1,0),Se(+it));yt.length&&(ht=yt[0].find(0))&&je(Bt(e.doc,ht.from,ht.to).join(me));return}if(Ge.getAttribute("contenteditable")=="false")return;var _t=/^(pre|div|p|li|table|br)$/i.test(Ge.nodeName);if(!/^br$/i.test(Ge.nodeName)&&Ge.textContent.length==0)return;_t&&ke();for(var bt=0;bt<Ge.childNodes.length;bt++)Ve(Ge.childNodes[bt]);/^(pre|p)$/i.test(Ge.nodeName)&&(ve=!0),_t&&(le=!0)}else Ge.nodeType==3&&je(Ge.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ve(t),t==O);)t=t.nextSibling,ve=!1;return $}function Wa(e,t,O){var A;if(t==e.display.lineDiv){if(A=e.display.lineDiv.childNodes[O],!A)return Gi(e.clipPos(nt(e.display.viewTo-1)),!0);t=null,O=0}else for(A=t;;A=A.parentNode){if(!A||A==e.display.lineDiv)return null;if(A.parentNode&&A.parentNode==e.display.lineDiv)break}for(var N=0;N<e.display.view.length;N++){var $=e.display.view[N];if($.node==A)return nu($,t,O)}}function nu(e,t,O){var A=e.text.firstChild,N=!1;if(!t||!L(A,t))return Gi(nt(Gt(e.line),0),!0);if(t==A&&(N=!0,t=A.childNodes[O],O=0,!t)){var $=e.rest?re(e.rest):e.line;return Gi(nt(Gt($),$.text.length),N)}var le=t.nodeType==3?t:null,me=t;for(!le&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(le=t.firstChild,O&&(O=le.nodeValue.length));me.parentNode!=A;)me=me.parentNode;var ve=e.measure,Se=ve.maps;function ke(ht,yt,_t){for(var bt=-1;bt<(Se?Se.length:0);bt++)for(var Ot=bt<0?ve.map:Se[bt],Ut=0;Ut<Ot.length;Ut+=3){var jt=Ot[Ut+2];if(jt==ht||jt==yt){var qt=Gt(bt<0?e.line:e.rest[bt]),pr=Ot[Ut]+_t;return(_t<0||jt!=ht)&&(pr=Ot[Ut+(_t?1:0)]),nt(qt,pr)}}}var je=ke(le,me,O);if(je)return Gi(je,N);for(var Ve=me.nextSibling,Ge=le?le.nodeValue.length-O:0;Ve;Ve=Ve.nextSibling){if(je=ke(Ve,Ve.firstChild,0),je)return Gi(nt(je.line,je.ch-Ge),N);Ge+=Ve.textContent.length}for(var Qe=me.previousSibling,it=O;Qe;Qe=Qe.previousSibling){if(je=ke(Qe,Qe.firstChild,-1),je)return Gi(nt(je.line,je.ch+it),N);it+=Qe.textContent.length}}var Lr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new te,this.hasSelection=!1,this.composing=null};Lr.prototype.init=function(e){var t=this,O=this,A=this.cm;this.createField(e);var N=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),y&&(N.style.width="0px"),Re(N,"input",function(){C&&p>=9&&t.hasSelection&&(t.hasSelection=null),O.poll()}),Re(N,"paste",function(le){if($e(A,le)||Ns(le,A))return;A.state.pasteIncoming=+new Date,O.fastPoll()});function $(le){if($e(A,le))return;if(A.somethingSelected())Ua({lineWise:!1,text:A.getSelections()});else if(A.options.lineWiseCopyCut){var me=Fs(A);Ua({lineWise:!0,text:me.text}),le.type=="cut"?A.setSelections(me.ranges,null,Ce):(O.prevInput="",N.value=me.text.join(`
`),G(N))}else return;le.type=="cut"&&(A.state.cutIncoming=+new Date)}Re(N,"cut",$),Re(N,"copy",$),Re(e.scroller,"paste",function(le){if(cr(e,le)||$e(A,le))return;if(!N.dispatchEvent){A.state.pasteIncoming=+new Date,O.focus();return}var me=new Event("paste");me.clipboardData=le.clipboardData,N.dispatchEvent(me)}),Re(e.lineSpace,"selectstart",function(le){cr(e,le)||Te(le)}),Re(N,"compositionstart",function(){var le=A.getCursor("from");O.composing&&O.composing.range.clear(),O.composing={start:le,range:A.markText(le,A.getCursor("to"),{className:"CodeMirror-composing"})}}),Re(N,"compositionend",function(){O.composing&&(O.poll(),O.composing.range.clear(),O.composing=null)})},Lr.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},Lr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Lr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,O=e.doc,A=Oo(e);if(e.options.moveInputWithCursor){var N=Nn(e,O.sel.primary().head,"div"),$=t.wrapper.getBoundingClientRect(),le=t.lineDiv.getBoundingClientRect();A.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,N.top+le.top-$.top)),A.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,N.left+le.left-$.left))}return A},Lr.prototype.showSelection=function(e){var t=this.cm,O=t.display;x(O.cursorDiv,e.cursors),x(O.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Lr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var O=t.getSelection();this.textarea.value=O,t.state.focused&&G(this.textarea),C&&p>=9&&(this.hasSelection=O)}else e||(this.prevInput=this.textarea.value="",C&&p>=9&&(this.hasSelection=null))},Lr.prototype.getField=function(){return this.textarea},Lr.prototype.supportsTouch=function(){return!1},Lr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||X()!=this.textarea))try{this.textarea.focus()}catch(e){}},Lr.prototype.blur=function(){this.textarea.blur()},Lr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Lr.prototype.receivedFocus=function(){this.slowPoll()},Lr.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()})},Lr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function O(){var A=t.poll();!A&&!e?(e=!0,t.polling.set(60,O)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,O)},Lr.prototype.poll=function(){var e=this,t=this.cm,O=this.textarea,A=this.prevInput;if(this.contextMenuPending||!t.state.focused||lt(O)&&!A&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var N=O.value;if(N==A&&!t.somethingSelected())return!1;if(C&&p>=9&&this.hasSelection===N||o&&/[\uf700-\uf7ff]/.test(N))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var $=N.charCodeAt(0);if($==8203&&!A&&(A="\u200B"),$==8666)return this.reset(),this.cm.execCommand("undo")}for(var le=0,me=Math.min(A.length,N.length);le<me&&A.charCodeAt(le)==N.charCodeAt(le);)++le;return fn(t,function(){bo(t,N.slice(le),A.length-le,null,e.composing?"*compose":null),N.length>1e3||N.indexOf(`
`)>-1?O.value=e.prevInput="":e.prevInput=N,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Lr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Lr.prototype.onKeyPress=function(){C&&p>=9&&(this.hasSelection=null),this.fastPoll()},Lr.prototype.onContextMenu=function(e){var t=this,O=t.cm,A=O.display,N=t.textarea;t.contextMenuPending&&t.contextMenuPending();var $=vi(O,e),le=A.scroller.scrollTop;if(!$||h)return;var me=O.options.resetSelectionOnContextMenu;me&&O.doc.sel.contains($)==-1&&Wr(O,Qr)(O.doc,ri($),Ce);var ve=N.style.cssText,Se=t.wrapper.style.cssText,ke=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",N.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-ke.top-5)+"px; left: "+(e.clientX-ke.left-5)+`px;
z-index: 1000; background: `+(C?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var je;s&&(je=window.scrollY),A.input.focus(),s&&window.scrollTo(null,je),A.input.reset(),O.somethingSelected()||(N.value=t.prevInput=" "),t.contextMenuPending=Ge,A.selForContextMenu=O.doc.sel,clearTimeout(A.detectingSelectAll);function Ve(){if(N.selectionStart!=null){var it=O.somethingSelected(),ht="\u200B"+(it?N.value:"");N.value="\u21DA",N.value=ht,t.prevInput=it?"":"\u200B",N.selectionStart=1,N.selectionEnd=ht.length,A.selForContextMenu=O.doc.sel}}function Ge(){if(t.contextMenuPending!=Ge)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=Se,N.style.cssText=ve,C&&p<9&&A.scrollbars.setScrollTop(A.scroller.scrollTop=le),N.selectionStart!=null){(!C||C&&p<9)&&Ve();var it=0,ht=function(){A.selForContextMenu==O.doc.sel&&N.selectionStart==0&&N.selectionEnd>0&&t.prevInput=="\u200B"?Wr(O,os)(O):it++<10?A.detectingSelectAll=setTimeout(ht,500):(A.selForContextMenu=null,A.input.reset())};A.detectingSelectAll=setTimeout(ht,200)}}if(C&&p>=9&&Ve(),k){Me(e);var Qe=function(){rt(window,"mouseup",Qe),setTimeout(Ge,20)};Re(window,"mouseup",Qe)}else setTimeout(Ge,50)},Lr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Lr.prototype.setUneditable=function(){},Lr.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?B(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var O=X();t.autofocus=O==e||e.getAttribute("autofocus")!=null&&O==document.body}function A(){e.value=me.getValue()}var N;if(e.form&&(Re(e.form,"submit",A),!t.leaveSubmitMethodAlone)){var $=e.form;N=$.submit;try{var le=$.submit=function(){A(),$.submit=N,$.submit(),$.submit=le}}catch(ve){}}t.finishInit=function(ve){ve.save=A,ve.getTextArea=function(){return e},ve.toTextArea=function(){ve.toTextArea=isNaN,A(),e.parentNode.removeChild(ve.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",A),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=N))}},e.style.display="none";var me=yr(function(ve){return e.parentNode.insertBefore(ve,e.nextSibling)},t);return me}function au(e){e.off=rt,e.on=Re,e.wheelEventPixels=hl,e.Doc=sn,e.splitLines=xt,e.countColumn=W,e.findColumn=pe,e.isWordChar=J,e.Pass=be,e.signal=He,e.Line=Kn,e.changeEnd=ni,e.scrollbarModel=No,e.Pos=nt,e.cmpPos=kt,e.modes=$t,e.mimeModes=At,e.resolveMode=St,e.getMode=Je,e.modeExtensions=dt,e.extendMode=Ct,e.copyState=Xt,e.startState=Mt,e.innerMode=Jt,e.commands=ma,e.keyMap=Xn,e.keyName=ws,e.isModifierKey=xs,e.lookupKey=Wi,e.normalizeKeyMap=Il,e.StringStream=Pt,e.SharedTextMarker=ha,e.TextMarker=ai,e.LineWidget=da,e.e_preventDefault=Te,e.e_stopPropagation=Ae,e.e_stop=Me,e.addClass=z,e.contains=L,e.rmClass=c,e.keyNames=oi}Jl(yr),eu(yr);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Ha in sn.prototype)sn.prototype.hasOwnProperty(Ha)&&de(ou,Ha)<0&&(yr.prototype[Ha]=function(e){return function(){return e.apply(this.doc,arguments)}}(sn.prototype[Ha]));return Le(sn),yr.inputStyles={textarea:Lr,contenteditable:dr},yr.defineMode=function(e){!yr.defaults.mode&&e!="null"&&(yr.defaults.mode=e),Rt.apply(this,arguments)},yr.defineMIME=hr,yr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),yr.defineMIME("text/plain","null"),yr.defineExtension=function(e,t){yr.prototype[e]=t},yr.defineDocExtension=function(e,t){sn.prototype[e]=t},yr.fromTextArea=iu,au(yr),yr.version="5.58.2",yr})},WYAk:function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){(function(){var m=P,S=m.lib,R=S.Base,T=m.enc,g=T.Utf8,C=m.algo,p=C.HMAC=R.extend({init:function(s,a){s=this._hasher=new s.init,typeof a=="string"&&(a=g.parse(a));var r=s.blockSize,h=r*4;a.sigBytes>h&&(a=s.finalize(a)),a.clamp();for(var d=this._oKey=a.clone(),f=this._iKey=a.clone(),E=d.words,y=f.words,l=0;l<r;l++)E[l]^=1549556828,y[l]^=909522486;d.sigBytes=f.sigBytes=h,this.reset()},reset:function(){var s=this._hasher;s.reset(),s.update(this._iKey)},update:function(s){return this._hasher.update(s),this},finalize:function(s){var a=this._hasher,r=a.finalize(s);a.reset();var h=a.finalize(this._oKey.clone().concat(r));return h}})})()})},WaYH:function(I,q,M){"use strict";var P=M("rePB"),m=M("Ff2n"),S=M("VTBJ"),R=M("1OyB"),T=M("vuIU"),g=M("JX7q"),C=M("Ji7U"),p=M("LK+K"),s=M("q1tI"),a=M("TSYQ"),r=M.n(a),h=M("sboe"),d=M("OZM5"),f=function(k){var D=k.prefixCls,c=k.level,b=k.isStart,x=k.isEnd;if(!c)return null;for(var _="".concat(D,"-indent-unit"),j=[],F=0;F<c;F+=1){var L;j.push(s.createElement("span",{key:F,className:r()(_,(L={},Object(P.a)(L,"".concat(_,"-start"),b[F+1]),Object(P.a)(L,"".concat(_,"-end"),x[F+1]),Object(P.a)(L,"".concat(_,"-end-first-level"),!F&&x[0]),L))}))}return s.createElement("span",{"aria-hidden":"true",className:"".concat(D,"-indent")},j)},E=f,y=M("815F"),l="open",n="close",o="---",u=function(i){Object(C.a)(D,i);var k=Object(p.a)(D);function D(){var c;return Object(R.a)(this,D),c=k.apply(this,arguments),c.state={dragNodeHighlight:!1},c.onSelectorClick=function(b){var x=c.props.context.onNodeClick;x(b,Object(y.b)(c.props)),c.isSelectable()?c.onSelect(b):c.onCheck(b)},c.onSelectorDoubleClick=function(b){var x=c.props.context.onNodeDoubleClick;x(b,Object(y.b)(c.props))},c.onSelect=function(b){if(c.isDisabled())return;var x=c.props.context.onNodeSelect;b.preventDefault(),x(b,Object(y.b)(c.props))},c.onCheck=function(b){if(c.isDisabled())return;var x=c.props,_=x.disableCheckbox,j=x.checked,F=c.props.context.onNodeCheck;if(!c.isCheckable()||_)return;b.preventDefault();var L=!j;F(b,Object(y.b)(c.props),L)},c.onMouseEnter=function(b){var x=c.props.context.onNodeMouseEnter;x(b,Object(y.b)(c.props))},c.onMouseLeave=function(b){var x=c.props.context.onNodeMouseLeave;x(b,Object(y.b)(c.props))},c.onContextMenu=function(b){var x=c.props.context.onNodeContextMenu;x(b,Object(y.b)(c.props))},c.onDragStart=function(b){var x=c.props.context.onNodeDragStart;b.stopPropagation(),c.setState({dragNodeHighlight:!0}),x(b,Object(g.a)(c));try{b.dataTransfer.setData("text/plain","")}catch(_){}},c.onDragEnter=function(b){var x=c.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),x(b,Object(g.a)(c))},c.onDragOver=function(b){var x=c.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),x(b,Object(g.a)(c))},c.onDragLeave=function(b){var x=c.props.context.onNodeDragLeave;b.stopPropagation(),x(b,Object(g.a)(c))},c.onDragEnd=function(b){var x=c.props.context.onNodeDragEnd;b.stopPropagation(),c.setState({dragNodeHighlight:!1}),x(b,Object(g.a)(c))},c.onDrop=function(b){var x=c.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),c.setState({dragNodeHighlight:!1}),x(b,Object(g.a)(c))},c.onExpand=function(b){var x=c.props.context.onNodeExpand;x(b,Object(y.b)(c.props))},c.setSelectHandle=function(b){c.selectHandle=b},c.getNodeState=function(){var b=c.props.expanded;return c.isLeaf()?null:b?l:n},c.hasChildren=function(){var b=c.props.eventKey,x=c.props.context.keyEntities,_=x[b]||{},j=_.children;return!!(j||[]).length},c.isLeaf=function(){var b=c.props,x=b.isLeaf,_=b.loaded,j=c.props.context.loadData,F=c.hasChildren();return x===!1?!1:x||!j&&!F||j&&_&&!F},c.isDisabled=function(){var b=c.props.disabled,x=c.props.context.disabled;return!!(x||b)},c.isCheckable=function(){var b=c.props.checkable,x=c.props.context.checkable;return!x||b===!1?!1:x},c.syncLoadData=function(b){var x=b.expanded,_=b.loading,j=b.loaded,F=c.props.context,L=F.loadData,X=F.onNodeLoad;if(_)return;L&&x&&!c.isLeaf()&&(!c.hasChildren()&&!j&&X(Object(y.b)(c.props)))},c.renderSwitcher=function(){var b=c.props,x=b.expanded,_=b.switcherIcon,j=c.props.context,F=j.prefixCls,L=j.switcherIcon,X=_||L;if(c.isLeaf())return s.createElement("span",{className:r()("".concat(F,"-switcher"),"".concat(F,"-switcher-noop"))},typeof X=="function"?X(Object(S.a)(Object(S.a)({},c.props),{},{isLeaf:!0})):X);var z=r()("".concat(F,"-switcher"),"".concat(F,"-switcher_").concat(x?l:n));return s.createElement("span",{onClick:c.onExpand,className:z},typeof X=="function"?X(Object(S.a)(Object(S.a)({},c.props),{},{isLeaf:!1})):X)},c.renderCheckbox=function(){var b=c.props,x=b.checked,_=b.halfChecked,j=b.disableCheckbox,F=c.props.context.prefixCls,L=c.isDisabled(),X=c.isCheckable();if(!X)return null;var z=typeof X!="boolean"?X:null;return s.createElement("span",{className:r()("".concat(F,"-checkbox"),x&&"".concat(F,"-checkbox-checked"),!x&&_&&"".concat(F,"-checkbox-indeterminate"),(L||j)&&"".concat(F,"-checkbox-disabled")),onClick:c.onCheck},z)},c.renderIcon=function(){var b=c.props.loading,x=c.props.context.prefixCls;return s.createElement("span",{className:r()("".concat(x,"-iconEle"),"".concat(x,"-icon__").concat(c.getNodeState()||"docu"),b&&"".concat(x,"-icon_loading"))})},c.renderSelector=function(){var b=c.state.dragNodeHighlight,x=c.props,_=x.title,j=x.selected,F=x.icon,L=x.loading,X=x.data,z=c.props.context,H=z.prefixCls,G=z.showIcon,U=z.icon,B=z.draggable,W=z.loadData,te=z.titleRender,de=c.isDisabled(),fe="".concat(H,"-node-content-wrapper"),be;if(G){var Ce=F||U;be=Ce?s.createElement("span",{className:r()("".concat(H,"-iconEle"),"".concat(H,"-icon__customize"))},typeof Ce=="function"?Ce(c.props):Ce):c.renderIcon()}else W&&L&&(be=c.renderIcon());var ue;typeof _=="function"?ue=_(X):te?ue=te(X):ue=_;var ge=s.createElement("span",{className:"".concat(H,"-title")},ue);return s.createElement("span",{ref:c.setSelectHandle,title:typeof _=="string"?_:"",className:r()("".concat(fe),"".concat(fe,"-").concat(c.getNodeState()||"normal"),!de&&(j||b)&&"".concat(H,"-node-selected"),!de&&B&&"draggable"),draggable:!de&&B||void 0,"aria-grabbed":!de&&B||void 0,onMouseEnter:c.onMouseEnter,onMouseLeave:c.onMouseLeave,onContextMenu:c.onContextMenu,onClick:c.onSelectorClick,onDoubleClick:c.onSelectorDoubleClick,onDragStart:B?c.onDragStart:void 0},be,ge)},c}return Object(T.a)(D,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,x=this.props.context.selectable;return typeof b=="boolean"?b:x}},{key:"render",value:function(){var b,x=this.props,_=x.eventKey,j=x.className,F=x.style,L=x.dragOver,X=x.dragOverGapTop,z=x.dragOverGapBottom,H=x.isLeaf,G=x.isStart,U=x.isEnd,B=x.expanded,W=x.selected,te=x.checked,de=x.halfChecked,fe=x.loading,be=x.domRef,Ce=x.active,ue=x.onMouseMove,ge=Object(m.a)(x,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),pe=this.props.context,oe=pe.prefixCls,ae=pe.filterTreeNode,re=pe.draggable,he=pe.keyEntities,Q=this.isDisabled(),ie=Object(d.f)(ge),we=he[_]||{},ne=we.level,J=U[U.length-1];return s.createElement("div",Object.assign({ref:be,className:r()(j,"".concat(oe,"-treenode"),(b={},Object(P.a)(b,"".concat(oe,"-treenode-disabled"),Q),Object(P.a)(b,"".concat(oe,"-treenode-switcher-").concat(B?"open":"close"),!H),Object(P.a)(b,"".concat(oe,"-treenode-checkbox-checked"),te),Object(P.a)(b,"".concat(oe,"-treenode-checkbox-indeterminate"),de),Object(P.a)(b,"".concat(oe,"-treenode-selected"),W),Object(P.a)(b,"".concat(oe,"-treenode-loading"),fe),Object(P.a)(b,"".concat(oe,"-treenode-active"),Ce),Object(P.a)(b,"".concat(oe,"-treenode-leaf-last"),J),Object(P.a)(b,"drag-over",!Q&&L),Object(P.a)(b,"drag-over-gap-top",!Q&&X),Object(P.a)(b,"drag-over-gap-bottom",!Q&&z),Object(P.a)(b,"filter-node",ae&&ae(Object(y.b)(this.props))),b)),style:F,onDragEnter:re?this.onDragEnter:void 0,onDragOver:re?this.onDragOver:void 0,onDragLeave:re?this.onDragLeave:void 0,onDrop:re?this.onDrop:void 0,onDragEnd:re?this.onDragEnd:void 0,onMouseMove:ue},ie),s.createElement(E,{prefixCls:oe,level:ne,isStart:G,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),D}(s.Component),w=function(k){return s.createElement(h.a.Consumer,null,function(D){return s.createElement(u,Object.assign({},k,{context:D}))})};w.displayName="TreeNode",w.defaultProps={title:o},w.isTreeNode=1;var v=q.a=w},XIdC:function(I,q,M){"use strict";var P=M("rePB"),m=M("ODXe"),S=M("Ff2n"),R=M("q1tI"),T=M.n(R),g=M("TSYQ"),C=M.n(g),p=M("6cGi"),s=M("4IlW"),a=R.forwardRef(function(r,h){var d,f=r.prefixCls,E=f===void 0?"rc-switch":f,y=r.className,l=r.checked,n=r.defaultChecked,o=r.disabled,u=r.loadingIcon,w=r.checkedChildren,v=r.unCheckedChildren,i=r.onClick,k=r.onChange,D=r.onKeyDown,c=Object(S.a)(r,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),b=Object(p.a)(!1,{value:l,defaultValue:n}),x=Object(m.a)(b,2),_=x[0],j=x[1];function F(H,G){var U=_;return o||(U=H,j(U),k==null||k(U,G)),U}function L(H){H.which===s.a.LEFT?F(!1,H):H.which===s.a.RIGHT&&F(!0,H),D==null||D(H)}function X(H){var G=F(!_,H);i==null||i(G,H)}var z=C()(E,y,(d={},Object(P.a)(d,"".concat(E,"-checked"),_),Object(P.a)(d,"".concat(E,"-disabled"),o),d));return R.createElement("button",Object.assign({},c,{type:"button",role:"switch","aria-checked":_,disabled:o,className:z,ref:h,onKeyDown:L,onClick:X}),u,R.createElement("span",{className:"".concat(E,"-inner")},_?w:v))});a.displayName="Switch",q.a=a},Y1PL:function(I,q,M){"use strict";M.r(q),M.d(q,"ResizableTextArea",function(){return de});var P=M("wx14"),m=M("1OyB"),S=M("vuIU"),R=M("Ji7U"),T=M("LK+K"),g=M("q1tI"),C=M("VTBJ"),p=M("rePB"),s=M("Zm9Q"),a=M("Kwbf"),r=M("c+Xe"),h=M("m+aA"),d=M("bdgK"),f=new Map;function E(Ce){Ce.forEach(function(ue){var ge,pe=ue.target;(ge=f.get(pe))===null||ge===void 0||ge.forEach(function(oe){return oe(pe)})})}var y=new d.default(E),l=null,n=null;function o(Ce,ue){f.has(Ce)||(f.set(Ce,new Set),y.observe(Ce)),f.get(Ce).add(ue)}function u(Ce,ue){f.has(Ce)&&(f.get(Ce).delete(ue),f.get(Ce).size||(y.unobserve(Ce),f.delete(Ce)))}var w=function(Ce){Object(R.a)(ge,Ce);var ue=Object(T.a)(ge);function ge(){return Object(m.a)(this,ge),ue.apply(this,arguments)}return Object(S.a)(ge,[{key:"render",value:function(){return this.props.children}}]),ge}(g.Component),v=g.createContext(null);function i(Ce){var ue=Ce.children,ge=Ce.onBatchResize,pe=g.useRef(0),oe=g.useRef([]),ae=g.useContext(v),re=g.useCallback(function(he,Q,ie){pe.current+=1;var we=pe.current;oe.current.push({size:he,element:Q,data:ie}),Promise.resolve().then(function(){we===pe.current&&(ge==null||ge(oe.current),oe.current=[])}),ae==null||ae(he,Q,ie)},[ge,ae]);return g.createElement(v.Provider,{value:re},ue)}function k(Ce){var ue=Ce.children,ge=Ce.disabled,pe=g.useRef(null),oe=g.useRef(null),ae=g.useContext(v),re=g.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),he=g.isValidElement(ue)&&Object(r.c)(ue),Q=he?ue.ref:null,ie=g.useMemo(function(){return Object(r.a)(Q,pe)},[Q,pe]),we=g.useRef(Ce);we.current=Ce;var ne=g.useCallback(function(J){var V=we.current,Z=V.onResize,Ee=V.data,xe=J.getBoundingClientRect(),_e=xe.width,Ne=xe.height,Be=J.offsetWidth,We=J.offsetHeight,Ue=Math.floor(_e),ze=Math.floor(Ne);if(re.current.width!==Ue||re.current.height!==ze||re.current.offsetWidth!==Be||re.current.offsetHeight!==We){var Ke={width:Ue,height:ze,offsetWidth:Be,offsetHeight:We};re.current=Ke;var Ye=Be===Math.round(_e)?_e:Be,Re=We===Math.round(Ne)?Ne:We,tt=Object(C.a)(Object(C.a)({},Ke),{},{offsetWidth:Ye,offsetHeight:Re});ae==null||ae(tt,J,Ee),Z&&Promise.resolve().then(function(){Z(tt,J)})}},[]);return g.useEffect(function(){var J=Object(h.a)(pe.current)||Object(h.a)(oe.current);return J&&!ge&&o(J,ne),function(){return u(J,ne)}},[pe.current,ge]),g.createElement(w,{ref:oe},he?g.cloneElement(ue,{ref:ie}):ue)}var D="rc-observer-key";function c(Ce){var ue=Ce.children,ge=Object(s.a)(ue);return ge.map(function(pe,oe){var ae=(pe==null?void 0:pe.key)||"".concat(D,"-").concat(oe);return g.createElement(k,Object(P.a)({},Ce,{key:ae}),pe)})}c.Collection=i;var b=c,x=M("bT9E"),_=M("TSYQ"),j=M.n(_),F=`
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
`,L=["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"],X={},z;function H(Ce){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=Ce.getAttribute("id")||Ce.getAttribute("data-reactid")||Ce.getAttribute("name");if(ue&&X[ge])return X[ge];var pe=window.getComputedStyle(Ce),oe=pe.getPropertyValue("box-sizing")||pe.getPropertyValue("-moz-box-sizing")||pe.getPropertyValue("-webkit-box-sizing"),ae=parseFloat(pe.getPropertyValue("padding-bottom"))+parseFloat(pe.getPropertyValue("padding-top")),re=parseFloat(pe.getPropertyValue("border-bottom-width"))+parseFloat(pe.getPropertyValue("border-top-width")),he=L.map(function(ie){return"".concat(ie,":").concat(pe.getPropertyValue(ie))}).join(";"),Q={sizingStyle:he,paddingSize:ae,borderSize:re,boxSizing:oe};return ue&&ge&&(X[ge]=Q),Q}function G(Ce){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,pe=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)),Ce.getAttribute("wrap")?z.setAttribute("wrap",Ce.getAttribute("wrap")):z.removeAttribute("wrap");var oe=H(Ce,ue),ae=oe.paddingSize,re=oe.borderSize,he=oe.boxSizing,Q=oe.sizingStyle;z.setAttribute("style","".concat(Q,";").concat(F)),z.value=Ce.value||Ce.placeholder||"";var ie=Number.MIN_SAFE_INTEGER,we=Number.MAX_SAFE_INTEGER,ne=z.scrollHeight,J;if(he==="border-box"?ne+=re:he==="content-box"&&(ne-=ae),ge!==null||pe!==null){z.value=" ";var V=z.scrollHeight-ae;ge!==null&&(ie=V*ge,he==="border-box"&&(ie=ie+ae+re),ne=Math.max(ie,ne)),pe!==null&&(we=V*pe,he==="border-box"&&(we=we+ae+re),J=ne>we?"":"hidden",ne=Math.min(we,ne))}return{height:ne,minHeight:ie,maxHeight:we,overflowY:J,resize:"none"}}var U=M("Gytx"),B=M.n(U),W;(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.RESIZING=1]="RESIZING",Ce[Ce.RESIZED=2]="RESIZED"})(W||(W={}));var te=function(Ce){Object(R.a)(ge,Ce);var ue=Object(T.a)(ge);function ge(pe){var oe;return Object(m.a)(this,ge),oe=ue.call(this,pe),oe.nextFrameActionId=void 0,oe.resizeFrameId=void 0,oe.textArea=void 0,oe.saveTextArea=function(ae){oe.textArea=ae},oe.handleResize=function(ae){var re=oe.state.resizeStatus,he=oe.props,Q=he.autoSize,ie=he.onResize;if(re!==W.NONE)return;typeof ie=="function"&&ie(ae),Q&&oe.resizeOnNextFrame()},oe.resizeOnNextFrame=function(){cancelAnimationFrame(oe.nextFrameActionId),oe.nextFrameActionId=requestAnimationFrame(oe.resizeTextarea)},oe.resizeTextarea=function(){var ae=oe.props.autoSize;if(!ae||!oe.textArea)return;var re=ae.minRows,he=ae.maxRows,Q=G(oe.textArea,!1,re,he);oe.setState({textareaStyles:Q,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(oe.resizeFrameId),oe.resizeFrameId=requestAnimationFrame(function(){oe.setState({resizeStatus:W.RESIZED},function(){oe.resizeFrameId=requestAnimationFrame(function(){oe.setState({resizeStatus:W.NONE}),oe.fixFirefoxAutoScroll()})})})})},oe.renderTextArea=function(){var ae=oe.props,re=ae.prefixCls,he=re===void 0?"rc-textarea":re,Q=ae.autoSize,ie=ae.onResize,we=ae.className,ne=ae.disabled,J=oe.state,V=J.textareaStyles,Z=J.resizeStatus,Ee=Object(x.a)(oe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),xe=j()(he,we,Object(p.a)({},"".concat(he,"-disabled"),ne));"value"in Ee&&(Ee.value=Ee.value||"");var _e=Object(C.a)(Object(C.a)(Object(C.a)({},oe.props.style),V),Z===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return g.createElement(b,{onResize:oe.handleResize,disabled:!(Q||ie)},g.createElement("textarea",Object(P.a)({},Ee,{className:xe,style:_e,ref:oe.saveTextArea})))},oe.state={textareaStyles:{},resizeStatus:W.NONE},oe}return Object(S.a)(ge,[{key:"componentDidUpdate",value:function(oe){(oe.value!==this.props.value||!B()(oe.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 oe=this.textArea.selectionStart,ae=this.textArea.selectionEnd;this.textArea.setSelectionRange(oe,ae)}}catch(re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ge}(g.Component),de=te,fe=function(Ce){Object(R.a)(ge,Ce);var ue=Object(T.a)(ge);function ge(pe){var oe;Object(m.a)(this,ge),oe=ue.call(this,pe),oe.resizableTextArea=void 0,oe.focus=function(){oe.resizableTextArea.textArea.focus()},oe.saveTextArea=function(re){oe.resizableTextArea=re},oe.handleChange=function(re){var he=oe.props.onChange;oe.setValue(re.target.value,function(){oe.resizableTextArea.resizeTextarea()}),he&&he(re)},oe.handleKeyDown=function(re){var he=oe.props,Q=he.onPressEnter,ie=he.onKeyDown;re.keyCode===13&&Q&&Q(re),ie&&ie(re)};var ae=typeof pe.value=="undefined"||pe.value===null?pe.defaultValue:pe.value;return oe.state={value:ae},oe}return Object(S.a)(ge,[{key:"setValue",value:function(oe,ae){"value"in this.props||this.setState({value:oe},ae)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return g.createElement(de,Object(P.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(oe){return"value"in oe?{value:oe.value}:null}}]),ge}(g.Component),be=q.default=fe},ZD9Y:function(I,q,M){"use strict";var P=M("BoS7"),m=M("Sdc0"),S=M("OaEy"),R=M("2fM7"),T=M("q1tI"),g=M.n(T),C=M("lOMy"),p=M.n(C),s=R.a.Option;q.a=function(a){var r=a.onFontSizeChange,h=a.cmFontSize,d=a.cmCodeMode,f=a.onCodeModeChange,E=a.onTabToSpace,y=a.className,l=y===void 0?"":y,n=a.tabToSpace,o=a.children;return g.a.createElement("div",{className:"tpi-code-setting ".concat(l)},g.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),g.a.createElement("section",null,g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),g.a.createElement(R.a,{bordered:!1,size:"small",value:d,onChange:f},g.a.createElement(s,{value:"vs"},"\u767D\u8272\u80CC\u666F"),g.a.createElement(s,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),g.a.createElement(R.a,{bordered:!1,size:"small",value:h,onChange:r},g.a.createElement(s,{value:12},"12px"),g.a.createElement(s,{value:14},"14px"),g.a.createElement(s,{value:16},"16px"),g.a.createElement(s,{value:18},"18px"),g.a.createElement(s,{value:20},"20px"),g.a.createElement(s,{value:22},"22px"))),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"Tab\u8F6C\u6362"),g.a.createElement(m.a,{checked:n,onChange:E}))),g.a.createElement("h3",null,"\u5FEB\u6377\u952E"),g.a.createElement("section",null,g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),g.a.createElement("span",null,"Ctrl + S")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),g.a.createElement("span",null,"F1 / Alt + F1")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),g.a.createElement("span",null,"Ctrl + ]/[")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),g.a.createElement("span",null,"Ctrl + Shift + \\")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),g.a.createElement("span",null,"Home")),g.a.createElement("div",{className:"file-item"},g.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),g.a.createElement("span",null,"End"))),o)}},ZpRC:function(I,q,M){"use strict";function P(r){return typeof r=="object"&&r!=null&&r.nodeType===1}function m(r,h){return(!h||r!=="hidden")&&r!=="visible"&&r!=="clip"}function S(r,h){if(r.clientHeight<r.scrollHeight||r.clientWidth<r.scrollWidth){var d=getComputedStyle(r,null);return m(d.overflowY,h)||m(d.overflowX,h)||function(f){var E=function(y){if(!y.ownerDocument||!y.ownerDocument.defaultView)return null;try{return y.ownerDocument.defaultView.frameElement}catch(l){return null}}(f);return!!E&&(E.clientHeight<f.scrollHeight||E.clientWidth<f.scrollWidth)}(r)}return!1}function R(r,h,d,f,E,y,l,n){return y<r&&l>h||y>r&&l<h?0:y<=r&&n<=d||l>=h&&n>=d?y-r-f:l>h&&n<d||y<r&&n>d?l-h+E:0}var T=function(r,h){var d=window,f=h.scrollMode,E=h.block,y=h.inline,l=h.boundary,n=h.skipOverflowHiddenElements,o=typeof l=="function"?l:function(V){return V!==l};if(!P(r))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,w=[],v=r;P(v)&&o(v);){if((v=v.parentElement)===u){w.push(v);break}v!=null&&v===document.body&&S(v)&&!S(document.documentElement)||v!=null&&S(v,n)&&w.push(v)}for(var i=d.visualViewport?d.visualViewport.width:innerWidth,k=d.visualViewport?d.visualViewport.height:innerHeight,D=window.scrollX||pageXOffset,c=window.scrollY||pageYOffset,b=r.getBoundingClientRect(),x=b.height,_=b.width,j=b.top,F=b.right,L=b.bottom,X=b.left,z=E==="start"||E==="nearest"?j:E==="end"?L:j+x/2,H=y==="center"?X+_/2:y==="end"?F:X,G=[],U=0;U<w.length;U++){var B=w[U],W=B.getBoundingClientRect(),te=W.height,de=W.width,fe=W.top,be=W.right,Ce=W.bottom,ue=W.left;if(f==="if-needed"&&j>=0&&X>=0&&L<=k&&F<=i&&j>=fe&&L<=Ce&&X>=ue&&F<=be)return G;var ge=getComputedStyle(B),pe=parseInt(ge.borderLeftWidth,10),oe=parseInt(ge.borderTopWidth,10),ae=parseInt(ge.borderRightWidth,10),re=parseInt(ge.borderBottomWidth,10),he=0,Q=0,ie="offsetWidth"in B?B.offsetWidth-B.clientWidth-pe-ae:0,we="offsetHeight"in B?B.offsetHeight-B.clientHeight-oe-re:0;if(u===B)he=E==="start"?z:E==="end"?z-k:E==="nearest"?R(c,c+k,k,oe,re,c+z,c+z+x,x):z-k/2,Q=y==="start"?H:y==="center"?H-i/2:y==="end"?H-i:R(D,D+i,i,pe,ae,D+H,D+H+_,_),he=Math.max(0,he+c),Q=Math.max(0,Q+D);else{he=E==="start"?z-fe-oe:E==="end"?z-Ce+re+we:E==="nearest"?R(fe,Ce,te,oe,re+we,z,z+x,x):z-(fe+te/2)+we/2,Q=y==="start"?H-ue-pe:y==="center"?H-(ue+de/2)+ie/2:y==="end"?H-be+ae+ie:R(ue,be,de,pe,ae+ie,H,H+_,_);var ne=B.scrollLeft,J=B.scrollTop;z+=J-(he=Math.max(0,Math.min(J+he,B.scrollHeight-te+we))),H+=ne-(Q=Math.max(0,Math.min(ne+Q,B.scrollWidth-de+ie)))}G.push({el:B,top:he,left:Q})}return G};function g(r){return r===Object(r)&&Object.keys(r).length!==0}function C(r,h){h===void 0&&(h="auto");var d="scrollBehavior"in document.body.style;r.forEach(function(f){var E=f.el,y=f.top,l=f.left;E.scroll&&d?E.scroll({top:y,left:l,behavior:h}):(E.scrollTop=y,E.scrollLeft=l)})}function p(r){return r===!1?{block:"end",inline:"nearest"}:g(r)?r:{block:"start",inline:"nearest"}}function s(r,h){var d=!r.ownerDocument.documentElement.contains(r);if(g(h)&&typeof h.behavior=="function")return h.behavior(d?[]:T(r,h));if(d)return;var f=p(h);return C(T(r,f),f.behavior)}var a=q.a=s},Zss7:function(I,q,M){var P;(function(m){var S=/^\s+/,R=/\s+$/,T=0,g=m.round,C=m.min,p=m.max,s=m.random;function a(re,he){if(re=re||"",he=he||{},re instanceof a)return re;if(!(this instanceof a))return new a(re,he);var Q=r(re);this._originalInput=re,this._r=Q.r,this._g=Q.g,this._b=Q.b,this._a=Q.a,this._roundA=g(100*this._a)/100,this._format=he.format||Q.format,this._gradientType=he.gradientType,this._r<1&&(this._r=g(this._r)),this._g<1&&(this._g=g(this._g)),this._b<1&&(this._b=g(this._b)),this._ok=Q.ok,this._tc_id=T++}a.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var re=this.toRgb();return(re.r*299+re.g*587+re.b*114)/1e3},getLuminance:function(){var re=this.toRgb(),he,Q,ie,we,ne,J;return he=re.r/255,Q=re.g/255,ie=re.b/255,he<=.03928?we=he/12.92:we=m.pow((he+.055)/1.055,2.4),Q<=.03928?ne=Q/12.92:ne=m.pow((Q+.055)/1.055,2.4),ie<=.03928?J=ie/12.92:J=m.pow((ie+.055)/1.055,2.4),.2126*we+.7152*ne+.0722*J},setAlpha:function(re){return this._a=G(re),this._roundA=g(100*this._a)/100,this},toHsv:function(){var re=E(this._r,this._g,this._b);return{h:re.h*360,s:re.s,v:re.v,a:this._a}},toHsvString:function(){var re=E(this._r,this._g,this._b),he=g(re.h*360),Q=g(re.s*100),ie=g(re.v*100);return this._a==1?"hsv("+he+", "+Q+"%, "+ie+"%)":"hsva("+he+", "+Q+"%, "+ie+"%, "+this._roundA+")"},toHsl:function(){var re=d(this._r,this._g,this._b);return{h:re.h*360,s:re.s,l:re.l,a:this._a}},toHslString:function(){var re=d(this._r,this._g,this._b),he=g(re.h*360),Q=g(re.s*100),ie=g(re.l*100);return this._a==1?"hsl("+he+", "+Q+"%, "+ie+"%)":"hsla("+he+", "+Q+"%, "+ie+"%, "+this._roundA+")"},toHex:function(re){return l(this._r,this._g,this._b,re)},toHexString:function(re){return"#"+this.toHex(re)},toHex8:function(re){return n(this._r,this._g,this._b,this._a,re)},toHex8String:function(re){return"#"+this.toHex8(re)},toRgb:function(){return{r:g(this._r),g:g(this._g),b:g(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+g(this._r)+", "+g(this._g)+", "+g(this._b)+")":"rgba("+g(this._r)+", "+g(this._g)+", "+g(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:g(U(this._r,255)*100)+"%",g:g(U(this._g,255)*100)+"%",b:g(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+g(U(this._r,255)*100)+"%, "+g(U(this._g,255)*100)+"%, "+g(U(this._b,255)*100)+"%)":"rgba("+g(U(this._r,255)*100)+"%, "+g(U(this._g,255)*100)+"%, "+g(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:z[l(this._r,this._g,this._b,!0)]||!1},toFilter:function(re){var he="#"+o(this._r,this._g,this._b,this._a),Q=he,ie=this._gradientType?"GradientType = 1, ":"";if(re){var we=a(re);Q="#"+o(we._r,we._g,we._b,we._a)}return"progid:DXImageTransform.Microsoft.gradient("+ie+"startColorstr="+he+",endColorstr="+Q+")"},toString:function(re){var he=!!re;re=re||this._format;var Q=!1,ie=this._a<1&&this._a>=0,we=!he&&ie&&(re==="hex"||re==="hex6"||re==="hex3"||re==="hex4"||re==="hex8"||re==="name");return we?re==="name"&&this._a===0?this.toName():this.toRgbString():(re==="rgb"&&(Q=this.toRgbString()),re==="prgb"&&(Q=this.toPercentageRgbString()),(re==="hex"||re==="hex6")&&(Q=this.toHexString()),re==="hex3"&&(Q=this.toHexString(!0)),re==="hex4"&&(Q=this.toHex8String(!0)),re==="hex8"&&(Q=this.toHex8String()),re==="name"&&(Q=this.toName()),re==="hsl"&&(Q=this.toHslString()),re==="hsv"&&(Q=this.toHsvString()),Q||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(re,he){var Q=re.apply(null,[this].concat([].slice.call(he)));return this._r=Q._r,this._g=Q._g,this._b=Q._b,this.setAlpha(Q._a),this},lighten:function(){return this._applyModification(i,arguments)},brighten:function(){return this._applyModification(k,arguments)},darken:function(){return this._applyModification(D,arguments)},desaturate:function(){return this._applyModification(u,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(c,arguments)},_applyCombination:function(re,he){return re.apply(null,[this].concat([].slice.call(he)))},analogous:function(){return this._applyCombination(F,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(L,arguments)},splitcomplement:function(){return this._applyCombination(j,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},a.fromRatio=function(re,he){if(typeof re=="object"){var Q={};for(var ie in re)re.hasOwnProperty(ie)&&(ie==="a"?Q[ie]=re[ie]:Q[ie]=be(re[ie]));re=Q}return a(re,he)};function r(re){var he={r:0,g:0,b:0},Q=1,ie=null,we=null,ne=null,J=!1,V=!1;return typeof re=="string"&&(re=oe(re)),typeof re=="object"&&(pe(re.r)&&pe(re.g)&&pe(re.b)?(he=h(re.r,re.g,re.b),J=!0,V=String(re.r).substr(-1)==="%"?"prgb":"rgb"):pe(re.h)&&pe(re.s)&&pe(re.v)?(ie=be(re.s),we=be(re.v),he=y(re.h,ie,we),J=!0,V="hsv"):pe(re.h)&&pe(re.s)&&pe(re.l)&&(ie=be(re.s),ne=be(re.l),he=f(re.h,ie,ne),J=!0,V="hsl"),re.hasOwnProperty("a")&&(Q=re.a)),Q=G(Q),{ok:J,format:re.format||V,r:C(255,p(he.r,0)),g:C(255,p(he.g,0)),b:C(255,p(he.b,0)),a:Q}}function h(re,he,Q){return{r:U(re,255)*255,g:U(he,255)*255,b:U(Q,255)*255}}function d(re,he,Q){re=U(re,255),he=U(he,255),Q=U(Q,255);var ie=p(re,he,Q),we=C(re,he,Q),ne,J,V=(ie+we)/2;if(ie==we)ne=J=0;else{var Z=ie-we;J=V>.5?Z/(2-ie-we):Z/(ie+we);switch(ie){case re:ne=(he-Q)/Z+(he<Q?6:0);break;case he:ne=(Q-re)/Z+2;break;case Q:ne=(re-he)/Z+4;break}ne/=6}return{h:ne,s:J,l:V}}function f(re,he,Q){var ie,we,ne;re=U(re,360),he=U(he,100),Q=U(Q,100);function J(Ee,xe,_e){return _e<0&&(_e+=1),_e>1&&(_e-=1),_e<1/6?Ee+(xe-Ee)*6*_e:_e<1/2?xe:_e<2/3?Ee+(xe-Ee)*(2/3-_e)*6:Ee}if(he===0)ie=we=ne=Q;else{var V=Q<.5?Q*(1+he):Q+he-Q*he,Z=2*Q-V;ie=J(Z,V,re+1/3),we=J(Z,V,re),ne=J(Z,V,re-1/3)}return{r:ie*255,g:we*255,b:ne*255}}function E(re,he,Q){re=U(re,255),he=U(he,255),Q=U(Q,255);var ie=p(re,he,Q),we=C(re,he,Q),ne,J,V=ie,Z=ie-we;if(J=ie===0?0:Z/ie,ie==we)ne=0;else{switch(ie){case re:ne=(he-Q)/Z+(he<Q?6:0);break;case he:ne=(Q-re)/Z+2;break;case Q:ne=(re-he)/Z+4;break}ne/=6}return{h:ne,s:J,v:V}}function y(re,he,Q){re=U(re,360)*6,he=U(he,100),Q=U(Q,100);var ie=m.floor(re),we=re-ie,ne=Q*(1-he),J=Q*(1-we*he),V=Q*(1-(1-we)*he),Z=ie%6,Ee=[Q,J,ne,ne,V,Q][Z],xe=[V,Q,Q,J,ne,ne][Z],_e=[ne,ne,V,Q,Q,J][Z];return{r:Ee*255,g:xe*255,b:_e*255}}function l(re,he,Q,ie){var we=[fe(g(re).toString(16)),fe(g(he).toString(16)),fe(g(Q).toString(16))];return ie&&we[0].charAt(0)==we[0].charAt(1)&&we[1].charAt(0)==we[1].charAt(1)&&we[2].charAt(0)==we[2].charAt(1)?we[0].charAt(0)+we[1].charAt(0)+we[2].charAt(0):we.join("")}function n(re,he,Q,ie,we){var ne=[fe(g(re).toString(16)),fe(g(he).toString(16)),fe(g(Q).toString(16)),fe(Ce(ie))];return we&&ne[0].charAt(0)==ne[0].charAt(1)&&ne[1].charAt(0)==ne[1].charAt(1)&&ne[2].charAt(0)==ne[2].charAt(1)&&ne[3].charAt(0)==ne[3].charAt(1)?ne[0].charAt(0)+ne[1].charAt(0)+ne[2].charAt(0)+ne[3].charAt(0):ne.join("")}function o(re,he,Q,ie){var we=[fe(Ce(ie)),fe(g(re).toString(16)),fe(g(he).toString(16)),fe(g(Q).toString(16))];return we.join("")}a.equals=function(re,he){return!re||!he?!1:a(re).toRgbString()==a(he).toRgbString()},a.random=function(){return a.fromRatio({r:s(),g:s(),b:s()})};function u(re,he){he=he===0?0:he||10;var Q=a(re).toHsl();return Q.s-=he/100,Q.s=B(Q.s),a(Q)}function w(re,he){he=he===0?0:he||10;var Q=a(re).toHsl();return Q.s+=he/100,Q.s=B(Q.s),a(Q)}function v(re){return a(re).desaturate(100)}function i(re,he){he=he===0?0:he||10;var Q=a(re).toHsl();return Q.l+=he/100,Q.l=B(Q.l),a(Q)}function k(re,he){he=he===0?0:he||10;var Q=a(re).toRgb();return Q.r=p(0,C(255,Q.r-g(255*-(he/100)))),Q.g=p(0,C(255,Q.g-g(255*-(he/100)))),Q.b=p(0,C(255,Q.b-g(255*-(he/100)))),a(Q)}function D(re,he){he=he===0?0:he||10;var Q=a(re).toHsl();return Q.l-=he/100,Q.l=B(Q.l),a(Q)}function c(re,he){var Q=a(re).toHsl(),ie=(Q.h+he)%360;return Q.h=ie<0?360+ie:ie,a(Q)}function b(re){var he=a(re).toHsl();return he.h=(he.h+180)%360,a(he)}function x(re){var he=a(re).toHsl(),Q=he.h;return[a(re),a({h:(Q+120)%360,s:he.s,l:he.l}),a({h:(Q+240)%360,s:he.s,l:he.l})]}function _(re){var he=a(re).toHsl(),Q=he.h;return[a(re),a({h:(Q+90)%360,s:he.s,l:he.l}),a({h:(Q+180)%360,s:he.s,l:he.l}),a({h:(Q+270)%360,s:he.s,l:he.l})]}function j(re){var he=a(re).toHsl(),Q=he.h;return[a(re),a({h:(Q+72)%360,s:he.s,l:he.l}),a({h:(Q+216)%360,s:he.s,l:he.l})]}function F(re,he,Q){he=he||6,Q=Q||30;var ie=a(re).toHsl(),we=360/Q,ne=[a(re)];for(ie.h=(ie.h-(we*he>>1)+720)%360;--he;)ie.h=(ie.h+we)%360,ne.push(a(ie));return ne}function L(re,he){he=he||6;for(var Q=a(re).toHsv(),ie=Q.h,we=Q.s,ne=Q.v,J=[],V=1/he;he--;)J.push(a({h:ie,s:we,v:ne})),ne=(ne+V)%1;return J}a.mix=function(re,he,Q){Q=Q===0?0:Q||50;var ie=a(re).toRgb(),we=a(he).toRgb(),ne=Q/100,J={r:(we.r-ie.r)*ne+ie.r,g:(we.g-ie.g)*ne+ie.g,b:(we.b-ie.b)*ne+ie.b,a:(we.a-ie.a)*ne+ie.a};return a(J)},a.readability=function(re,he){var Q=a(re),ie=a(he);return(m.max(Q.getLuminance(),ie.getLuminance())+.05)/(m.min(Q.getLuminance(),ie.getLuminance())+.05)},a.isReadable=function(re,he,Q){var ie=a.readability(re,he),we,ne;ne=!1,we=ae(Q);switch(we.level+we.size){case"AAsmall":case"AAAlarge":ne=ie>=4.5;break;case"AAlarge":ne=ie>=3;break;case"AAAsmall":ne=ie>=7;break}return ne},a.mostReadable=function(re,he,Q){var ie=null,we=0,ne,J,V,Z;Q=Q||{},J=Q.includeFallbackColors,V=Q.level,Z=Q.size;for(var Ee=0;Ee<he.length;Ee++)ne=a.readability(re,he[Ee]),ne>we&&(we=ne,ie=a(he[Ee]));return a.isReadable(re,ie,{level:V,size:Z})||!J?ie:(Q.includeFallbackColors=!1,a.mostReadable(re,["#fff","#000"],Q))};var X=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},z=a.hexNames=H(X);function H(re){var he={};for(var Q in re)re.hasOwnProperty(Q)&&(he[re[Q]]=Q);return he}function G(re){return re=parseFloat(re),(isNaN(re)||re<0||re>1)&&(re=1),re}function U(re,he){te(re)&&(re="100%");var Q=de(re);return re=C(he,p(0,parseFloat(re))),Q&&(re=parseInt(re*he,10)/100),m.abs(re-he)<1e-6?1:re%he/parseFloat(he)}function B(re){return C(1,p(0,re))}function W(re){return parseInt(re,16)}function te(re){return typeof re=="string"&&re.indexOf(".")!=-1&&parseFloat(re)===1}function de(re){return typeof re=="string"&&re.indexOf("%")!=-1}function fe(re){return re.length==1?"0"+re:""+re}function be(re){return re<=1&&(re=re*100+"%"),re}function Ce(re){return m.round(parseFloat(re)*255).toString(16)}function ue(re){return W(re)/255}var ge=function(){var re="[-\\+]?\\d+%?",he="[-\\+]?\\d*\\.\\d+%?",Q="(?:"+he+")|(?:"+re+")",ie="[\\s|\\(]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?",we="[\\s|\\(]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?";return{CSS_UNIT:new RegExp(Q),rgb:new RegExp("rgb"+ie),rgba:new RegExp("rgba"+we),hsl:new RegExp("hsl"+ie),hsla:new RegExp("hsla"+we),hsv:new RegExp("hsv"+ie),hsva:new RegExp("hsva"+we),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 pe(re){return!!ge.CSS_UNIT.exec(re)}function oe(re){re=re.replace(S,"").replace(R,"").toLowerCase();var he=!1;if(X[re])re=X[re],he=!0;else if(re=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var Q;return(Q=ge.rgb.exec(re))?{r:Q[1],g:Q[2],b:Q[3]}:(Q=ge.rgba.exec(re))?{r:Q[1],g:Q[2],b:Q[3],a:Q[4]}:(Q=ge.hsl.exec(re))?{h:Q[1],s:Q[2],l:Q[3]}:(Q=ge.hsla.exec(re))?{h:Q[1],s:Q[2],l:Q[3],a:Q[4]}:(Q=ge.hsv.exec(re))?{h:Q[1],s:Q[2],v:Q[3]}:(Q=ge.hsva.exec(re))?{h:Q[1],s:Q[2],v:Q[3],a:Q[4]}:(Q=ge.hex8.exec(re))?{r:W(Q[1]),g:W(Q[2]),b:W(Q[3]),a:ue(Q[4]),format:he?"name":"hex8"}:(Q=ge.hex6.exec(re))?{r:W(Q[1]),g:W(Q[2]),b:W(Q[3]),format:he?"name":"hex"}:(Q=ge.hex4.exec(re))?{r:W(Q[1]+""+Q[1]),g:W(Q[2]+""+Q[2]),b:W(Q[3]+""+Q[3]),a:ue(Q[4]+""+Q[4]),format:he?"name":"hex8"}:(Q=ge.hex3.exec(re))?{r:W(Q[1]+""+Q[1]),g:W(Q[2]+""+Q[2]),b:W(Q[3]+""+Q[3]),format:he?"name":"hex"}:!1}function ae(re){var he,Q;return re=re||{level:"AA",size:"small"},he=(re.level||"AA").toUpperCase(),Q=(re.size||"small").toLowerCase(),he!=="AA"&&he!=="AAA"&&(he="AA"),Q!=="small"&&Q!=="large"&&(Q="small"),{level:he,size:Q}}I.exports?I.exports=a:!(P=function(){return a}.call(q,M,q,I),P!==void 0&&(I.exports=P))})(Math)},b8wu:function(I,q,M){I.exports={"code-panel-container":"code-panel-container___pVbpU","action-oj-bar":"action-oj-bar___1NMjh",active:"active___2NiTj"}},bCnd:function(I,q,M){"use strict";M.d(q,"b",function(){return R}),M.d(q,"a",function(){return T});var P=M("je13"),m=M.n(P),S=!1;function R(g,C){var p=m.a.get("__ec");p||(p={}),p[g]=C,m.a.set("__ec",p)}function T(g,C){var p=m.a.get("__ec");return p?p[g]===void 0?C:p[g]:C}},bQjk:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return function(m){var S=P,R=S.lib,T=R.CipherParams,g=S.enc,C=g.Hex,p=S.format,s=p.Hex={stringify:function(a){return a.ciphertext.toString(C)},parse:function(a){var r=C.parse(a);return T.create({ciphertext:r})}}}(),P.format.Hex})},bT9E:function(I,q,M){"use strict";M.d(q,"a",function(){return m});var P=M("VTBJ");function m(S,R){var T=Object(P.a)({},S);return Array.isArray(R)&&R.forEach(function(g){delete T[g]}),T}},c5Ni:function(I,q,M){},cDPC:function(I,q,M){"use strict";var P=M("tJVT"),m=M("q1tI"),S=M.n(m),R=M("i3hx"),T=M.n(R);q.a=function(g){var C=g.defaultX,p=C===void 0?"40%":C,s=g.leftChild,a=g.rightChild,r=g.className,h=g.hideResize,d=h===void 0?!1:h,f=Object(m.useState)(p),E=Object(P.a)(f,2),y=E[0],l=E[1],n=Object(m.useRef)();function o(){n.current=!0}Object(m.useEffect)(function(){function v(k){n.current&&l(k.pageX)}function i(){n.current=!1}return window.addEventListener("mousemove",v),window.addEventListener("mouseup",i),function(){window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",i)}},[]);var u=typeof y=="number"&&y!==.01?"".concat(y,"px"):p,w="calc(100% - ".concat(d?"0px":"4px"," - ").concat(u,")");return S.a.createElement("div",{className:"split-panel-container ".concat(r)},S.a.createElement("section",{style:{width:u,display:y===.01?"none":""}},s),S.a.createElement("section",{className:"resize-x-bar",onMouseDown:o},S.a.createElement("a",{className:"btn-resize"},S.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},S.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),S.a.createElement("section",{style:{width:w}},a))}},cv67:function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){return function(m){var S=P,R=S.lib,T=R.WordArray,g=R.Hasher,C=S.algo,p=[];(function(){for(var f=0;f<64;f++)p[f]=m.abs(m.sin(f+1))*4294967296|0})();var s=C.MD5=g.extend({_doReset:function(){this._hash=new T.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(f,E){for(var y=0;y<16;y++){var l=E+y,n=f[l];f[l]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360}var o=this._hash.words,u=f[E+0],w=f[E+1],v=f[E+2],i=f[E+3],k=f[E+4],D=f[E+5],c=f[E+6],b=f[E+7],x=f[E+8],_=f[E+9],j=f[E+10],F=f[E+11],L=f[E+12],X=f[E+13],z=f[E+14],H=f[E+15],G=o[0],U=o[1],B=o[2],W=o[3];G=a(G,U,B,W,u,7,p[0]),W=a(W,G,U,B,w,12,p[1]),B=a(B,W,G,U,v,17,p[2]),U=a(U,B,W,G,i,22,p[3]),G=a(G,U,B,W,k,7,p[4]),W=a(W,G,U,B,D,12,p[5]),B=a(B,W,G,U,c,17,p[6]),U=a(U,B,W,G,b,22,p[7]),G=a(G,U,B,W,x,7,p[8]),W=a(W,G,U,B,_,12,p[9]),B=a(B,W,G,U,j,17,p[10]),U=a(U,B,W,G,F,22,p[11]),G=a(G,U,B,W,L,7,p[12]),W=a(W,G,U,B,X,12,p[13]),B=a(B,W,G,U,z,17,p[14]),U=a(U,B,W,G,H,22,p[15]),G=r(G,U,B,W,w,5,p[16]),W=r(W,G,U,B,c,9,p[17]),B=r(B,W,G,U,F,14,p[18]),U=r(U,B,W,G,u,20,p[19]),G=r(G,U,B,W,D,5,p[20]),W=r(W,G,U,B,j,9,p[21]),B=r(B,W,G,U,H,14,p[22]),U=r(U,B,W,G,k,20,p[23]),G=r(G,U,B,W,_,5,p[24]),W=r(W,G,U,B,z,9,p[25]),B=r(B,W,G,U,i,14,p[26]),U=r(U,B,W,G,x,20,p[27]),G=r(G,U,B,W,X,5,p[28]),W=r(W,G,U,B,v,9,p[29]),B=r(B,W,G,U,b,14,p[30]),U=r(U,B,W,G,L,20,p[31]),G=h(G,U,B,W,D,4,p[32]),W=h(W,G,U,B,x,11,p[33]),B=h(B,W,G,U,F,16,p[34]),U=h(U,B,W,G,z,23,p[35]),G=h(G,U,B,W,w,4,p[36]),W=h(W,G,U,B,k,11,p[37]),B=h(B,W,G,U,b,16,p[38]),U=h(U,B,W,G,j,23,p[39]),G=h(G,U,B,W,X,4,p[40]),W=h(W,G,U,B,u,11,p[41]),B=h(B,W,G,U,i,16,p[42]),U=h(U,B,W,G,c,23,p[43]),G=h(G,U,B,W,_,4,p[44]),W=h(W,G,U,B,L,11,p[45]),B=h(B,W,G,U,H,16,p[46]),U=h(U,B,W,G,v,23,p[47]),G=d(G,U,B,W,u,6,p[48]),W=d(W,G,U,B,b,10,p[49]),B=d(B,W,G,U,z,15,p[50]),U=d(U,B,W,G,D,21,p[51]),G=d(G,U,B,W,L,6,p[52]),W=d(W,G,U,B,i,10,p[53]),B=d(B,W,G,U,j,15,p[54]),U=d(U,B,W,G,w,21,p[55]),G=d(G,U,B,W,x,6,p[56]),W=d(W,G,U,B,H,10,p[57]),B=d(B,W,G,U,c,15,p[58]),U=d(U,B,W,G,X,21,p[59]),G=d(G,U,B,W,k,6,p[60]),W=d(W,G,U,B,F,10,p[61]),B=d(B,W,G,U,v,15,p[62]),U=d(U,B,W,G,_,21,p[63]),o[0]=o[0]+G|0,o[1]=o[1]+U|0,o[2]=o[2]+B|0,o[3]=o[3]+W|0},_doFinalize:function(){var f=this._data,E=f.words,y=this._nDataBytes*8,l=f.sigBytes*8;E[l>>>5]|=128<<24-l%32;var n=m.floor(y/4294967296),o=y;E[(l+64>>>9<<4)+15]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,E[(l+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,f.sigBytes=(E.length+1)*4,this._process();for(var u=this._hash,w=u.words,v=0;v<4;v++){var i=w[v];w[v]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}return u},clone:function(){var f=g.clone.call(this);return f._hash=this._hash.clone(),f}});function a(f,E,y,l,n,o,u){var w=f+(E&y|~E&l)+n+u;return(w<<o|w>>>32-o)+E}function r(f,E,y,l,n,o,u){var w=f+(E&l|y&~l)+n+u;return(w<<o|w>>>32-o)+E}function h(f,E,y,l,n,o,u){var w=f+(E^y^l)+n+u;return(w<<o|w>>>32-o)+E}function d(f,E,y,l,n,o,u){var w=f+(y^(E|~l))+n+u;return(w<<o|w>>>32-o)+E}S.MD5=g._createHelper(s),S.HmacMD5=g._createHmacHelper(s)}(Math),P.MD5})},dejd:function(I,q,M){},dmUQ:function(I,q,M){"use strict";var P=M("Ff2n"),m=M("rePB"),S=M("1OyB"),R=M("vuIU"),T=M("Ji7U"),g=M("md7G"),C=M("foSv"),p=M("q1tI"),s=M.n(p),a=M("TSYQ"),r=M.n(a),h=M("4IlW");function d(x,_){var j=Object.keys(x);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(x);_&&(F=F.filter(function(L){return Object.getOwnPropertyDescriptor(x,L).enumerable})),j.push.apply(j,F)}return j}function f(x){for(var _=1;_<arguments.length;_++){var j=arguments[_]!=null?arguments[_]:{};_%2?d(Object(j),!0).forEach(function(F){Object(m.a)(x,F,j[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(j)):d(Object(j)).forEach(function(F){Object.defineProperty(x,F,Object.getOwnPropertyDescriptor(j,F))})}return x}function E(x){var _=y();return function(){var F=Object(C.a)(x),L;if(_){var X=Object(C.a)(this).constructor;L=Reflect.construct(F,arguments,X)}else L=F.apply(this,arguments);return Object(g.a)(this,L)}}function y(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(x){return!1}}function l(){}function n(x){x.preventDefault()}var o=function(_){return _.replace(/[^\w.-]+/g,"")},u=200,w=600,v=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,i=function(_){return _!=null},k=function(_,j){return j===_||typeof j=="number"&&typeof _=="number"&&isNaN(j)&&isNaN(_)},D=function(x){Object(T.a)(j,x);var _=E(j);function j(F){var L;Object(S.a)(this,j),L=_.call(this,F),L.onKeyDown=function(H){var G=L.props,U=G.onKeyDown,B=G.onPressEnter;if(H.keyCode===h.a.UP){var W=L.getRatio(H);L.up(H,W,null),L.stop()}else if(H.keyCode===h.a.DOWN){var te=L.getRatio(H);L.down(H,te,null),L.stop()}else H.keyCode===h.a.ENTER&&B&&B(H);if(L.recordCursorPosition(),L.lastKeyCode=H.keyCode,U){for(var de=arguments.length,fe=new Array(de>1?de-1:0),be=1;be<de;be++)fe[be-1]=arguments[be];U.apply(void 0,[H].concat(fe))}},L.onKeyUp=function(H){var G=L.props.onKeyUp;if(L.stop(),L.recordCursorPosition(),G){for(var U=arguments.length,B=new Array(U>1?U-1:0),W=1;W<U;W++)B[W-1]=arguments[W];G.apply(void 0,[H].concat(B))}},L.onChange=function(H){var G=L.props.onChange;L.state.focused&&(L.inputting=!0),L.rawInput=L.props.parser(L.getValueFromEvent(H)),L.setState({inputValue:L.rawInput}),G(L.toNumber(L.rawInput))},L.onMouseUp=function(){var H=L.props.onMouseUp;L.recordCursorPosition(),H&&H.apply(void 0,arguments)},L.onFocus=function(){var H;L.setState({focused:!0}),(H=L.props).onFocus.apply(H,arguments)},L.onBlur=function(){var H=L.props.onBlur;L.inputting=!1,L.setState({focused:!1});var G=L.getCurrentValidValue(L.state.inputValue),U=L.setValue(G,l);if(H){var B=L.input.value,W=L.getInputDisplayValue({focus:!1,value:U});L.input.value=W&&Number(W),H.apply(void 0,arguments),L.input.value=B}},L.getRatio=function(H){var G=1;return H.metaKey||H.ctrlKey?G=.1:H.shiftKey&&(G=10),G},L.getFullNum=function(H){return isNaN(H)?H:/e/i.test(String(H))?Number(H).toFixed(18).replace(/\.?0+$/,""):H},L.getPrecision=function(H){if(i(L.props.precision))return L.props.precision;var G=String(H);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},L.getInputDisplayValue=function(H){var G=H||L.state,U=G.focused,B=G.inputValue,W=G.value,te;U?te=B:te=L.toPrecisionAsStep(W),te==null&&(te="");var de=L.formatWrapper(te);return i(L.props.decimalSeparator)&&(de=de.toString().replace(".",L.props.decimalSeparator)),de},L.recordCursorPosition=function(){try{L.cursorStart=L.input.selectionStart,L.cursorEnd=L.input.selectionEnd,L.currentValue=L.input.value,L.cursorBefore=L.input.value.substring(0,L.cursorStart),L.cursorAfter=L.input.value.substring(L.cursorEnd)}catch(H){}},L.restoreByAfter=function(H){if(H===void 0)return!1;var G=L.input.value,U=G.lastIndexOf(H);if(U===-1)return!1;var B=L.cursorBefore.length;return L.lastKeyCode===h.a.DELETE&&L.cursorBefore.charAt(B-1)===H[0]?(L.fixCaret(B,B),!0):U+H.length===G.length?(L.fixCaret(U,U),!0):!1},L.partRestoreByAfter=function(H){return H===void 0?!1:Array.prototype.some.call(H,function(G,U){var B=H.substring(U);return L.restoreByAfter(B)})},L.isNotCompleteNumber=function(H){return isNaN(H)||H===""||H===null||H&&H.toString().indexOf(".")===H.toString().length-1},L.stop=function(){L.autoStepTimer&&clearTimeout(L.autoStepTimer)},L.down=function(H,G,U){L.pressingUpOrDown=!0,L.step("down",H,G,U)},L.up=function(H,G,U){L.pressingUpOrDown=!0,L.step("up",H,G,U)},L.saveInput=function(H){L.input=H};var X=F.value;X===void 0&&(X=F.defaultValue),L.state={focused:F.autoFocus};var z=L.getValidValue(L.toNumber(X));return L.state=f(f({},L.state),{},{inputValue:L.toPrecisionAsStep(z),value:z}),L}return Object(R.a)(j,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(L){var X=this.props,z=X.value,H=X.onChange,G=X.max,U=X.min,B=this.state.focused;if(L){if(!k(L.value,z)||!k(L.max,G)||!k(L.min,U)){var W=B?z:this.getValidValue(z),te;this.pressingUpOrDown?te=W:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:te})}var de="value"in this.props?z:this.state.value;"max"in this.props&&L.max!==G&&typeof de=="number"&&de>G&&H&&H(G),"min"in this.props&&L.min!==U&&typeof de=="number"&&de<U&&H&&H(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===h.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===h.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case h.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case h.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(be){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(L){var X=L;return X===""?X="":this.isNotCompleteNumber(parseFloat(X))?X=this.state.value:X=this.getValidValue(X),this.toNumber(X)}},{key:"getValueFromEvent",value:function(L){var X=L.target.value.trim().replace(/。/g,".");return i(this.props.decimalSeparator)&&(X=X.replace(this.props.decimalSeparator,".")),X}},{key:"getValidValue",value:function(L){var X=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,H=parseFloat(L);return isNaN(H)?L:(H<X&&(H=X),H>z&&(H=z),H)}},{key:"setValue",value:function(L,X){var z=this.props.precision,H=this.isNotCompleteNumber(parseFloat(L))?null:parseFloat(L),G=this.state.value,U=G===void 0?null:G,B=this.state.inputValue,W=B===void 0?null:B,te=typeof H=="number"?H.toFixed(z):"".concat(H),de=H!==U||te!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},X)):this.setState({value:H,inputValue:this.toPrecisionAsStep(L)},X),de&&this.props.onChange(H),H}},{key:"getMaxPrecision",value:function(L){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.props,H=z.precision,G=z.step;if(i(H))return H;var U=this.getPrecision(X),B=this.getPrecision(G),W=this.getPrecision(L);return L?Math.max(W,U+B):U+B}},{key:"getPrecisionFactor",value:function(L){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.getMaxPrecision(L,X);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(L){return this.props.formatter?this.props.formatter(L):L}},{key:"toPrecisionAsStep",value:function(L){if(this.isNotCompleteNumber(L)||L==="")return L;var X=Math.abs(this.getMaxPrecision(L));return isNaN(X)?L.toString():Number(L).toFixed(X)}},{key:"toNumber",value:function(L){var X=this.props.precision,z=this.state.focused,H=L&&L.length>16&&z;return this.isNotCompleteNumber(L)||H?L:i(X)?Math.round(L*Math.pow(10,X))/Math.pow(10,X):Number(L)}},{key:"upStep",value:function(L,X){var z=this.props.step,H=this.getPrecisionFactor(L,X),G=Math.abs(this.getMaxPrecision(L,X)),U=((H*L+H*z*X)/H).toFixed(G);return this.toNumber(U)}},{key:"downStep",value:function(L,X){var z=this.props.step,H=this.getPrecisionFactor(L,X),G=Math.abs(this.getMaxPrecision(L,X)),U=((H*L-H*z*X)/H).toFixed(G);return this.toNumber(U)}},{key:"step",value:function(L,X){var z=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),X&&(X.persist(),X.preventDefault());var U=this.props;if(U.disabled)return;var B=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(B))return;var W=this["".concat(L,"Step")](B,H),te=W>U.max||W<U.min;if(W>U.max?W=U.max:W<U.min&&(W=U.min),this.setValue(W,null),this.setState({focused:!0},function(){z.pressingUpOrDown=!1}),te)return;this.autoStepTimer=setTimeout(function(){z[L](X,H,!0)},G?u:w)}},{key:"fixCaret",value:function(L,X){if(L===void 0||X===void 0||!this.input||!this.input.value)return;try{var z=this.input.selectionStart,H=this.input.selectionEnd;(L!==z||X!==H)&&this.input.setSelectionRange(L,X)}catch(G){}}},{key:"render",value:function(){var L,X=this.props,z=X.prefixCls,H=X.disabled,G=X.readOnly,U=X.useTouch,B=X.autoComplete,W=X.upHandler,te=X.downHandler,de=X.className,fe=X.max,be=X.min,Ce=X.style,ue=X.title,ge=X.onMouseEnter,pe=X.onMouseLeave,oe=X.onMouseOver,ae=X.onMouseOut,re=X.required,he=X.onClick,Q=X.tabIndex,ie=X.type,we=X.placeholder,ne=X.id,J=X.inputMode,V=X.pattern,Z=X.step,Ee=X.maxLength,xe=X.autoFocus,_e=X.name,Ne=X.onPaste,Be=X.onInput,We=Object(P.a)(X,["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"]),Ue=this.state,ze=Ue.value,Ke=Ue.focused,Ye=r()(z,(L={},Object(m.a)(L,de,!!de),Object(m.a)(L,"".concat(z,"-disabled"),H),Object(m.a)(L,"".concat(z,"-focused"),Ke),L)),Re={};Object.keys(We).forEach(function(Me){(Me.substr(0,5)==="data-"||Me.substr(0,5)==="aria-"||Me==="role")&&(Re[Me]=We[Me])});var tt=!G&&!H,rt=this.getInputDisplayValue(null),He=(ze||ze===0)&&(isNaN(ze)||Number(ze)>=fe),$e=(ze||ze===0)&&(isNaN(ze)||Number(ze)<=be),Ie=He||H||G,Oe=$e||H||G,Le=r()("".concat(z,"-handler"),"".concat(z,"-handler-up"),Object(m.a)({},"".concat(z,"-handler-up-disabled"),Ie)),Te=r()("".concat(z,"-handler"),"".concat(z,"-handler-down"),Object(m.a)({},"".concat(z,"-handler-down-disabled"),Oe)),Ae=U?{onTouchStart:Ie?l:this.up,onTouchEnd:this.stop}:{onMouseDown:Ie?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},De=U?{onTouchStart:Oe?l:this.down,onTouchEnd:this.stop}:{onMouseDown:Oe?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return s.a.createElement("div",{className:Ye,style:Ce,title:ue,onMouseEnter:ge,onMouseLeave:pe,onMouseOver:oe,onMouseOut:ae,onFocus:function(){return null},onBlur:function(){return null}},s.a.createElement("div",{className:"".concat(z,"-handler-wrap")},s.a.createElement("span",Object.assign({unselectable:"on"},Ae,{role:"button","aria-label":"Increase Value","aria-disabled":Ie,className:Le}),W||s.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-up-inner"),onClick:n})),s.a.createElement("span",Object.assign({unselectable:"on"},De,{role:"button","aria-label":"Decrease Value","aria-disabled":Oe,className:Te}),te||s.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-down-inner"),onClick:n}))),s.a.createElement("div",{className:"".concat(z,"-input-wrap")},s.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":be,"aria-valuemax":fe,"aria-valuenow":ze,required:re,type:ie,placeholder:we,onPaste:Ne,onClick:he,onMouseUp:this.onMouseUp,className:"".concat(z,"-input"),tabIndex:Q,autoComplete:B,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:l,onKeyUp:tt?this.onKeyUp:l,autoFocus:xe,maxLength:Ee,readOnly:G,disabled:H,max:fe,min:be,step:Z,name:_e,title:ue,id:ne,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(rt),pattern:V,inputMode:J,onInput:Be},Re))))}}]),j}(s.a.Component);D.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:o,required:!1,autoComplete:"off"};var c=D,b=q.a=c},e7zE:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("3y9D"),M("WYAk"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.Base,T=S.WordArray,g=m.algo,C=g.SHA1,p=g.HMAC,s=g.PBKDF2=R.extend({cfg:R.extend({keySize:128/32,hasher:C,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,r){for(var h=this.cfg,d=p.create(h.hasher,a),f=T.create(),E=T.create([1]),y=f.words,l=E.words,n=h.keySize,o=h.iterations;y.length<n;){var u=d.update(r).finalize(E);d.reset();for(var w=u.words,v=w.length,i=u,k=1;k<o;k++){i=d.finalize(i),d.reset();for(var D=i.words,c=0;c<v;c++)w[c]^=D[c]}f.concat(u),l[0]++}return f.sigBytes=n*4,f}});m.PBKDF2=function(a,r,h){return s.create(h).compute(a,r)}}(),P.PBKDF2})},fAei:function(I,q,M){"use strict";M.d(q,"a",function(){return u.a});var P=M("rePB"),m=M("VTBJ"),S=M("KQm4"),R=M("1OyB"),T=M("vuIU"),g=M("Ji7U"),C=M("LK+K"),p=M("q1tI"),s=M("4IlW"),a=M("Kwbf"),r=M("TSYQ"),h=M.n(r),d=M("sboe"),f=M("OZM5"),E=M("815F"),y=M("ODXe"),l=M("Ff2n"),n=M("+nKL"),o=M("8XRh"),u=M("WaYH"),w=function(be,Ce){var ue=be.className,ge=be.style,pe=be.motion,oe=be.motionNodes,ae=be.motionType,re=be.onMotionStart,he=be.onMotionEnd,Q=be.active,ie=be.treeNodeRequiredProps,we=Object(l.a)(be,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),ne=p.useState(!0),J=Object(y.a)(ne,2),V=J[0],Z=J[1],Ee=p.useContext(d.a),xe=Ee.prefixCls,_e=p.useRef(!1),Ne=function(){_e.current||he(),_e.current=!0};return Object(p.useEffect)(function(){oe&&ae==="hide"&&V&&Z(!1)},[oe]),Object(p.useEffect)(function(){return oe&&re(),function(){oe&&Ne()}},[]),oe?p.createElement(o.default,Object.assign({ref:Ce,visible:V},pe,{motionAppear:ae==="show",onAppearEnd:Ne,onLeaveEnd:Ne}),function(Be,We){var Ue=Be.className,ze=Be.style;return p.createElement("div",{ref:We,className:h()("".concat(xe,"-treenode-motion"),Ue),style:ze},oe.map(function(Ke){var Ye=Ke.data,Re=Ye.key,tt=Object(l.a)(Ye,["key"]),rt=Ke.isStart,He=Ke.isEnd;delete tt.children;var $e=Object(E.f)(Re,ie);return p.createElement(u.a,Object.assign({},tt,$e,{active:Q,data:Ke.data,key:Re,isStart:rt,isEnd:He}))}))}):p.createElement(u.a,Object.assign({domRef:Ce,className:ue,style:ge},we,{active:Q}))};w.displayName="MotionTreeNode";var v=p.forwardRef(w),i=v;function k(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ce=fe.length,ue=be.length;if(Math.abs(Ce-ue)!==1)return{add:!1,key:null};function ge(pe,oe){var ae=new Map;pe.forEach(function(he){ae.set(he,!0)});var re=oe.filter(function(he){return!ae.has(he)});return re.length===1?re[0]:null}return Ce<ue?{add:!0,key:ge(fe,be)}:{add:!1,key:ge(be,fe)}}function D(fe,be,Ce){var ue=fe.findIndex(function(ae){var re=ae.data;return re.key===Ce}),ge=fe[ue+1],pe=be.findIndex(function(ae){var re=ae.data;return re.key===Ce});if(ge){var oe=be.findIndex(function(ae){var re=ae.data;return re.key===ge.data.key});return be.slice(pe+1,oe)}return be.slice(pe+1)}var c={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},b=function(){},x="RC_TREE_MOTION_".concat(Math.random()),_={key:x},j={key:x,level:0,index:0,pos:"0",node:_},F={parent:null,children:[],pos:j.pos,data:_,isStart:[],isEnd:[]};function L(fe,be,Ce,ue){return be===!1||!Ce?fe:fe.slice(0,Math.ceil(Ce/ue)+1)}function X(fe){var be=fe.data.key,Ce=fe.pos;return Object(E.e)(be,Ce)}function z(fe){for(var be=String(fe.data.key),Ce=fe;Ce.parent;)Ce=Ce.parent,be="".concat(Ce.data.key," > ").concat(be);return be}var H=function(be,Ce){var ue=be.prefixCls,ge=be.data,pe=be.selectable,oe=be.checkable,ae=be.expandedKeys,re=be.selectedKeys,he=be.checkedKeys,Q=be.loadedKeys,ie=be.loadingKeys,we=be.halfCheckedKeys,ne=be.keyEntities,J=be.disabled,V=be.dragging,Z=be.dragOverNodeKey,Ee=be.dropPosition,xe=be.motion,_e=be.height,Ne=be.itemHeight,Be=be.virtual,We=be.focusable,Ue=be.activeItem,ze=be.focused,Ke=be.tabIndex,Ye=be.onKeyDown,Re=be.onFocus,tt=be.onBlur,rt=be.onActiveChange,He=be.onListChangeStart,$e=be.onListChangeEnd,Ie=Object(l.a)(be,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),Oe=p.useRef(null);p.useImperativeHandle(Ce,function(){return{scrollTo:function(Ct){Oe.current.scrollTo(Ct)}}});var Le=p.useState(ae),Te=Object(y.a)(Le,2),Ae=Te[0],De=Te[1],Me=p.useState(ge),Fe=Object(y.a)(Me,2),Xe=Fe[0],qe=Fe[1],pt=p.useState(ge),at=Object(y.a)(pt,2),ft=at[0],Et=at[1],xt=p.useState([]),lt=Object(y.a)(xt,2),Wt=lt[0],It=lt[1],ir=p.useState(null),$t=Object(y.a)(ir,2),At=$t[0],Rt=$t[1];function hr(){qe(ge),Et(ge),It([]),Rt(null),$e()}p.useEffect(function(){De(ae);var dt=k(Ae,ae);if(dt.key!==null)if(dt.add){var Ct=Xe.findIndex(function(Bt){var fr=Bt.data.key;return fr===dt.key}),Xt=L(D(Xe,ge,dt.key),Be,_e,Ne),Jt=Xe.slice();Jt.splice(Ct+1,0,F),Et(Jt),It(Xt),Rt("show")}else{var Mt=ge.findIndex(function(Bt){var fr=Bt.data.key;return fr===dt.key}),Pt=L(D(ge,Xe,dt.key),Be,_e,Ne),gt=ge.slice();gt.splice(Mt+1,0,F),Et(gt),It(Pt),Rt("hide")}else Xe!==ge&&(qe(ge),Et(ge))},[ae,ge]),p.useEffect(function(){V||hr()},[V]);var St=xe?ft:ge,Je={expandedKeys:ae,selectedKeys:re,loadedKeys:Q,loadingKeys:ie,checkedKeys:he,halfCheckedKeys:we,dragOverNodeKey:Z,dropPosition:Ee,keyEntities:ne};return p.createElement(p.Fragment,null,ze&&Ue&&p.createElement("span",{style:c,"aria-live":"assertive"},z(Ue)),p.createElement("div",{role:"tree"},p.createElement("input",{style:c,disabled:We===!1||J,tabIndex:We!==!1?Ke:null,onKeyDown:Ye,onFocus:Re,onBlur:tt,value:"",onChange:b})),p.createElement(n.a,Object.assign({},Ie,{data:St,itemKey:X,height:_e,fullHeight:!1,virtual:Be,itemHeight:Ne,prefixCls:"".concat(ue,"-list"),ref:Oe}),function(dt){var Ct=dt.pos,Xt=dt.data,Jt=Xt.key,Mt=Object(l.a)(Xt,["key"]),Pt=dt.isStart,gt=dt.isEnd,Bt=Object(E.e)(Jt,Ct);delete Mt.children;var fr=Object(E.f)(Bt,Je);return p.createElement(i,Object.assign({},Mt,fr,{active:Ue&&Jt===Ue.data.key,pos:Ct,data:dt.data,isStart:Pt,isEnd:gt,motion:xe,motionNodes:Jt===x?Wt:null,motionType:At,onMotionStart:He,onMotionEnd:hr,treeNodeRequiredProps:Je,onMouseMove:function(){rt(null)}}))}))},G=p.forwardRef(H);G.displayName="NodeList";var U=G,B=M("NvD2"),W=function(fe){Object(g.a)(Ce,fe);var be=Object(C.a)(Ce);function Ce(){var ue;return Object(R.a)(this,Ce),ue=be.apply(this,arguments),ue.destroyed=!1,ue.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},ue.listRef=p.createRef(),ue.onNodeDragStart=function(ge,pe){var oe=ue.state,ae=oe.expandedKeys,re=oe.keyEntities,he=ue.props.onDragStart,Q=pe.props.eventKey;ue.dragNode=pe;var ie=Object(f.b)(ae,Q);ue.setState({dragging:!0,dragNodesKeys:Object(f.g)(Q,re)}),ue.setExpandedKeys(ie),he&&he({event:ge,node:Object(E.b)(pe.props)})},ue.onNodeDragEnter=function(ge,pe){var oe=ue.state,ae=oe.expandedKeys,re=oe.keyEntities,he=oe.dragNodesKeys,Q=ue.props.onDragEnter,ie=pe.props,we=ie.pos,ne=ie.eventKey;if(!ue.dragNode||he.indexOf(ne)!==-1)return;var J=Object(f.c)(ge,pe);if(ue.dragNode.props.eventKey===ne&&J===0){ue.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ue.setState({dragOverNodeKey:ne,dropPosition:J}),ue.delayedDragEnterLogic||(ue.delayedDragEnterLogic={}),Object.keys(ue.delayedDragEnterLogic).forEach(function(V){clearTimeout(ue.delayedDragEnterLogic[V])}),ue.delayedDragEnterLogic[we]=window.setTimeout(function(){if(!ue.state.dragging)return;var V=Object(S.a)(ae),Z=re[ne];Z&&(Z.children||[]).length&&(V=Object(f.a)(ae,ne)),"expandedKeys"in ue.props||ue.setExpandedKeys(V),Q&&Q({event:ge,node:Object(E.b)(pe.props),expandedKeys:V})},400)},0)},ue.onNodeDragOver=function(ge,pe){var oe=ue.state.dragNodesKeys,ae=ue.props.onDragOver,re=pe.props.eventKey;if(oe.indexOf(re)!==-1)return;if(ue.dragNode&&re===ue.state.dragOverNodeKey){var he=Object(f.c)(ge,pe);if(he===ue.state.dropPosition)return;ue.setState({dropPosition:he})}ae&&ae({event:ge,node:Object(E.b)(pe.props)})},ue.onNodeDragLeave=function(ge,pe){var oe=ue.props.onDragLeave;ue.setState({dragOverNodeKey:""}),oe&&oe({event:ge,node:Object(E.b)(pe.props)})},ue.onNodeDragEnd=function(ge,pe){var oe=ue.props.onDragEnd;ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),oe&&oe({event:ge,node:Object(E.b)(pe.props)}),ue.dragNode=null},ue.onNodeDrop=function(ge,pe){var oe=ue.state,ae=oe.dragNodesKeys,re=ae===void 0?[]:ae,he=oe.dropPosition,Q=ue.props.onDrop,ie=pe.props,we=ie.eventKey,ne=ie.pos;if(ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),re.indexOf(we)!==-1){Object(a.a)(!1,"Can not drop to dragNode(include it's children node)");return}var J=Object(f.k)(ne),V={event:ge,node:Object(E.b)(pe.props),dragNode:ue.dragNode?Object(E.b)(ue.dragNode.props):null,dragNodesKeys:re.slice(),dropPosition:he+Number(J[J.length-1]),dropToGap:!1};he!==0&&(V.dropToGap=!0),Q&&Q(V),ue.dragNode=null},ue.cleanDragState=function(){var ge=ue.state.dragging;ge&&ue.setState({dragging:!1})},ue.onNodeClick=function(ge,pe){var oe=ue.props.onClick;oe&&oe(ge,pe)},ue.onNodeDoubleClick=function(ge,pe){var oe=ue.props.onDoubleClick;oe&&oe(ge,pe)},ue.onNodeSelect=function(ge,pe){var oe=ue.state.selectedKeys,ae=ue.state.keyEntities,re=ue.props,he=re.onSelect,Q=re.multiple,ie=pe.selected,we=pe.key,ne=!ie;ne?Q?oe=Object(f.a)(oe,we):oe=[we]:oe=Object(f.b)(oe,we);var J=oe.map(function(V){var Z=ae[V];return Z?Z.node:null}).filter(function(V){return V});ue.setUncontrolledState({selectedKeys:oe}),he&&he(oe,{event:"select",selected:ne,node:pe,selectedNodes:J,nativeEvent:ge.nativeEvent})},ue.onNodeCheck=function(ge,pe,oe){var ae=ue.state,re=ae.keyEntities,he=ae.checkedKeys,Q=ae.halfCheckedKeys,ie=ue.props,we=ie.checkStrictly,ne=ie.onCheck,J=pe.key,V,Z={event:"check",node:pe,checked:oe,nativeEvent:ge.nativeEvent};if(we){var Ee=oe?Object(f.a)(he,J):Object(f.b)(he,J),xe=Object(f.b)(Q,J);V={checked:Ee,halfChecked:xe},Z.checkedNodes=Ee.map(function(ze){return re[ze]}).filter(function(ze){return ze}).map(function(ze){return ze.node}),ue.setUncontrolledState({checkedKeys:Ee})}else{var _e=Object(B.a)([].concat(Object(S.a)(he),[J]),!0,re),Ne=_e.checkedKeys,Be=_e.halfCheckedKeys;if(!oe){var We=new Set(Ne);We.delete(J);var Ue=Object(B.a)(Array.from(We),{checked:!1,halfCheckedKeys:Be},re);Ne=Ue.checkedKeys,Be=Ue.halfCheckedKeys}V=Ne,Z.checkedNodes=[],Z.checkedNodesPositions=[],Z.halfCheckedKeys=Be,Ne.forEach(function(ze){var Ke=re[ze];if(!Ke)return;var Ye=Ke.node,Re=Ke.pos;Z.checkedNodes.push(Ye),Z.checkedNodesPositions.push({node:Ye,pos:Re})}),ue.setUncontrolledState({checkedKeys:Ne},!1,{halfCheckedKeys:Be})}ne&&ne(V,Z)},ue.onNodeLoad=function(ge){return new Promise(function(pe){ue.setState(function(oe){var ae=oe.loadedKeys,re=ae===void 0?[]:ae,he=oe.loadingKeys,Q=he===void 0?[]:he,ie=ue.props,we=ie.loadData,ne=ie.onLoad,J=ge.key;if(!we||re.indexOf(J)!==-1||Q.indexOf(J)!==-1)return{};var V=we(ge);return V.then(function(){var Z=ue.state,Ee=Z.loadedKeys,xe=Z.loadingKeys,_e=Object(f.a)(Ee,J),Ne=Object(f.b)(xe,J);ne&&ne(_e,{event:"load",node:ge}),ue.setUncontrolledState({loadedKeys:_e}),ue.setState({loadingKeys:Ne}),pe()}),{loadingKeys:Object(f.a)(Q,J)}})})},ue.onNodeMouseEnter=function(ge,pe){var oe=ue.props.onMouseEnter;oe&&oe({event:ge,node:pe})},ue.onNodeMouseLeave=function(ge,pe){var oe=ue.props.onMouseLeave;oe&&oe({event:ge,node:pe})},ue.onNodeContextMenu=function(ge,pe){var oe=ue.props.onRightClick;oe&&(ge.preventDefault(),oe({event:ge,node:pe}))},ue.onFocus=function(){var ge=ue.props.onFocus;ue.setState({focused:!0}),ge&&ge.apply(void 0,arguments)},ue.onBlur=function(){var ge=ue.props.onBlur;ue.setState({focused:!1}),ue.onActiveChange(null),ge&&ge.apply(void 0,arguments)},ue.getTreeNodeRequiredProps=function(){var ge=ue.state,pe=ge.expandedKeys,oe=ge.selectedKeys,ae=ge.loadedKeys,re=ge.loadingKeys,he=ge.checkedKeys,Q=ge.halfCheckedKeys,ie=ge.dragOverNodeKey,we=ge.dropPosition,ne=ge.keyEntities;return{expandedKeys:pe||[],selectedKeys:oe||[],loadedKeys:ae||[],loadingKeys:re||[],checkedKeys:he||[],halfCheckedKeys:Q||[],dragOverNodeKey:ie,dropPosition:we,keyEntities:ne}},ue.setExpandedKeys=function(ge){var pe=ue.state.treeData,oe=Object(E.d)(pe,ge);ue.setUncontrolledState({expandedKeys:ge,flattenNodes:oe},!0)},ue.onNodeExpand=function(ge,pe){var oe=ue.state.expandedKeys,ae=ue.state.listChanging,re=ue.props,he=re.onExpand,Q=re.loadData,ie=pe.key,we=pe.expanded;if(ae)return;var ne=oe.indexOf(ie),J=!we;if(Object(a.a)(we&&ne!==-1||!we&&ne===-1,"Expand state not sync with index check"),J?oe=Object(f.a)(oe,ie):oe=Object(f.b)(oe,ie),ue.setExpandedKeys(oe),he&&he(oe,{node:pe,expanded:J,nativeEvent:ge.nativeEvent}),J&&Q){var V=ue.onNodeLoad(pe);V&&V.then(function(){var Z=Object(E.d)(ue.state.treeData,oe);ue.setUncontrolledState({flattenNodes:Z})})}},ue.onListChangeStart=function(){ue.setUncontrolledState({listChanging:!0})},ue.onListChangeEnd=function(){setTimeout(function(){ue.setUncontrolledState({listChanging:!1})})},ue.onActiveChange=function(ge){var pe=ue.state.activeKey,oe=ue.props.onActiveChange;if(pe===ge)return;ue.setState({activeKey:ge}),ge!==null&&ue.scrollTo({key:ge}),oe&&oe(ge)},ue.getActiveItem=function(){var ge=ue.state,pe=ge.activeKey,oe=ge.flattenNodes;return pe===null?null:oe.find(function(ae){var re=ae.data.key;return re===pe})||null},ue.offsetActiveKey=function(ge){var pe=ue.state,oe=pe.flattenNodes,ae=pe.activeKey,re=oe.findIndex(function(ie){var we=ie.data.key;return we===ae});re===-1&&ge<0&&(re=oe.length),re=(re+ge+oe.length)%oe.length;var he=oe[re];if(he){var Q=he.data.key;ue.onActiveChange(Q)}else ue.onActiveChange(null)},ue.onKeyDown=function(ge){var pe=ue.state,oe=pe.activeKey,ae=pe.expandedKeys,re=pe.checkedKeys,he=ue.props,Q=he.onKeyDown,ie=he.checkable,we=he.selectable;switch(ge.which){case s.a.UP:{ue.offsetActiveKey(-1),ge.preventDefault();break}case s.a.DOWN:{ue.offsetActiveKey(1),ge.preventDefault();break}}var ne=ue.getActiveItem();if(ne&&ne.data){var J=ue.getTreeNodeRequiredProps(),V=ne.data.isLeaf===!1||!!(ne.data.children||[]).length,Z=Object(E.b)(Object(m.a)(Object(m.a)({},Object(E.f)(oe,J)),{},{data:ne.data,active:!0}));switch(ge.which){case s.a.LEFT:{V&&ae.includes(oe)?ue.onNodeExpand({},Z):ne.parent&&ue.onActiveChange(ne.parent.data.key),ge.preventDefault();break}case s.a.RIGHT:{V&&!ae.includes(oe)?ue.onNodeExpand({},Z):ne.children&&ne.children.length&&ue.onActiveChange(ne.children[0].data.key),ge.preventDefault();break}case s.a.ENTER:case s.a.SPACE:{ie&&!Z.disabled&&Z.checkable!==!1&&!Z.disableCheckbox?ue.onNodeCheck({},Z,!re.includes(oe)):!ie&&we&&!Z.disabled&&Z.selectable!==!1&&ue.onNodeSelect({},Z);break}}}Q&&Q(ge)},ue.setUncontrolledState=function(ge){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ue.destroyed)return;var ae=!1,re=!0,he={};Object.keys(ge).forEach(function(Q){if(Q in ue.props){re=!1;return}ae=!0,he[Q]=ge[Q]}),ae&&(!pe||re)&&ue.setState(Object(m.a)(Object(m.a)({},he),oe))},ue.scrollTo=function(ge){ue.listRef.current.scrollTo(ge)},ue}return Object(T.a)(Ce,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var ge,pe=this.state,oe=pe.focused,ae=pe.flattenNodes,re=pe.keyEntities,he=pe.dragging,Q=pe.activeKey,ie=this.props,we=ie.prefixCls,ne=ie.className,J=ie.style,V=ie.showLine,Z=ie.focusable,Ee=ie.tabIndex,xe=Ee===void 0?0:Ee,_e=ie.selectable,Ne=ie.showIcon,Be=ie.icon,We=ie.switcherIcon,Ue=ie.draggable,ze=ie.checkable,Ke=ie.checkStrictly,Ye=ie.disabled,Re=ie.motion,tt=ie.loadData,rt=ie.filterTreeNode,He=ie.height,$e=ie.itemHeight,Ie=ie.virtual,Oe=ie.titleRender,Le=ie.onContextMenu,Te=Object(f.f)(this.props);return p.createElement(d.a.Provider,{value:{prefixCls:we,selectable:_e,showIcon:Ne,icon:Be,switcherIcon:We,draggable:Ue,checkable:ze,checkStrictly:Ke,disabled:Ye,keyEntities:re,loadData:tt,filterTreeNode:rt,titleRender:Oe,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},p.createElement("div",{className:h()(we,ne,(ge={},Object(P.a)(ge,"".concat(we,"-show-line"),V),Object(P.a)(ge,"".concat(we,"-focused"),oe),Object(P.a)(ge,"".concat(we,"-active-focused"),Q!==null),ge))},p.createElement(U,Object.assign({ref:this.listRef,prefixCls:we,style:J,data:ae,disabled:Ye,selectable:_e,checkable:!!ze,motion:Re,dragging:he,height:He,itemHeight:$e,virtual:Ie,focusable:Z,focused:oe,tabIndex:xe,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Le},this.getTreeNodeRequiredProps(),Te))))}}],[{key:"getDerivedStateFromProps",value:function(ge,pe){var oe=pe.prevProps,ae={prevProps:ge};function re(Be){return!oe&&Be in ge||oe&&oe[Be]!==ge[Be]}var he;if(re("treeData")?he=ge.treeData:re("children")&&(Object(a.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),he=Object(E.c)(ge.children)),he){ae.treeData=he;var Q=Object(E.a)(he);ae.keyEntities=Object(m.a)(Object(P.a)({},x,j),Q.keyEntities)}var ie=ae.keyEntities||pe.keyEntities;if(re("expandedKeys")||oe&&re("autoExpandParent"))ae.expandedKeys=ge.autoExpandParent||!oe&&ge.defaultExpandParent?Object(f.e)(ge.expandedKeys,ie):ge.expandedKeys;else if(!oe&&ge.defaultExpandAll){var we=Object(m.a)({},ie);delete we[x],ae.expandedKeys=Object.keys(we).map(function(Be){return we[Be].key})}else!oe&&ge.defaultExpandedKeys&&(ae.expandedKeys=ge.autoExpandParent||ge.defaultExpandParent?Object(f.e)(ge.defaultExpandedKeys,ie):ge.defaultExpandedKeys);if(ae.expandedKeys||delete ae.expandedKeys,he||ae.expandedKeys){var ne=Object(E.d)(he||pe.treeData,ae.expandedKeys||pe.expandedKeys);ae.flattenNodes=ne}if(ge.selectable&&(re("selectedKeys")?ae.selectedKeys=Object(f.d)(ge.selectedKeys,ge):!oe&&ge.defaultSelectedKeys&&(ae.selectedKeys=Object(f.d)(ge.defaultSelectedKeys,ge))),ge.checkable){var J;if(re("checkedKeys")?J=Object(f.j)(ge.checkedKeys)||{}:!oe&&ge.defaultCheckedKeys?J=Object(f.j)(ge.defaultCheckedKeys)||{}:he&&(J=Object(f.j)(ge.checkedKeys)||{checkedKeys:pe.checkedKeys,halfCheckedKeys:pe.halfCheckedKeys}),J){var V=J,Z=V.checkedKeys,Ee=Z===void 0?[]:Z,xe=V.halfCheckedKeys,_e=xe===void 0?[]:xe;if(!ge.checkStrictly){var Ne=Object(B.a)(Ee,!0,ie);Ee=Ne.checkedKeys,_e=Ne.halfCheckedKeys}ae.checkedKeys=Ee,ae.halfCheckedKeys=_e}}return re("loadedKeys")&&(ae.loadedKeys=ge.loadedKeys),ae}}]),Ce}(p.Component);W.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},W.TreeNode=u.a;var te=W,de=q.b=te},fcSX:function(I,q,M){"use strict";var P=M("Ff2n"),m=M("1OyB"),S=M("vuIU"),R=M("Ji7U"),T=M("md7G"),g=M("foSv"),C=M("1W/9"),p=M("q1tI"),s=M("rePB"),a=M("JX7q"),r=M("TSYQ"),h=M.n(r),d=M("qx4F"),f=M("4IlW");function E(H){return Array.isArray(H)?H:[H]}var y={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(y).filter(function(H){if(typeof document=="undefined")return!1;var G=document.getElementsByTagName("html")[0];return H in(G?G.style:{})})[0],n=y[l];function o(H,G,U,B){H.addEventListener?H.addEventListener(G,U,B):H.attachEvent&&H.attachEvent("on".concat(G),U)}function u(H,G,U,B){H.removeEventListener?H.removeEventListener(G,U,B):H.attachEvent&&H.detachEvent("on".concat(G),U)}function w(H,G){var U=typeof H=="function"?H(G):H;return Array.isArray(U)?U.length===2?U:[U[0],U[1]]:[U]}var v=function(G){return!isNaN(parseFloat(G))&&isFinite(G)},i=!(typeof window!="undefined"&&window.document&&window.document.createElement),k=function H(G,U,B,W){if(!U||U===document||U instanceof Document)return!1;if(U===G.parentNode)return!0;var te=Math.max(Math.abs(B),Math.abs(W))===Math.abs(W),de=Math.max(Math.abs(B),Math.abs(W))===Math.abs(B),fe=U.scrollHeight-U.clientHeight,be=U.scrollWidth-U.clientWidth,Ce=document.defaultView.getComputedStyle(U),ue=Ce.overflowY==="auto"||Ce.overflowY==="scroll",ge=Ce.overflowX==="auto"||Ce.overflowX==="scroll",pe=fe&&ue,oe=be&&ge;return te&&(!pe||pe&&(U.scrollTop>=fe&&W<0||U.scrollTop<=0&&W>0))||de&&(!oe||oe&&(U.scrollLeft>=be&&B<0||U.scrollLeft<=0&&B>0))?H(G,U.parentNode,B,W):!1};function D(H){var G=c();return function(){var B=Object(g.a)(H),W;if(G){var te=Object(g.a)(this).constructor;W=Reflect.construct(B,arguments,te)}else W=B.apply(this,arguments);return Object(T.a)(this,W)}}function c(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(H){return!1}}var b={},x=function(H){Object(R.a)(U,H);var G=D(U);function U(B){var W;return Object(m.a)(this,U),W=G.call(this,B),W.domFocus=function(){W.dom&&W.dom.focus()},W.removeStartHandler=function(te){if(te.touches.length>1)return;W.startPos={x:te.touches[0].clientX,y:te.touches[0].clientY}},W.removeMoveHandler=function(te){if(te.changedTouches.length>1)return;var de=te.currentTarget,fe=te.changedTouches[0].clientX-W.startPos.x,be=te.changedTouches[0].clientY-W.startPos.y;(de===W.maskDom||de===W.handlerDom||de===W.contentDom&&k(de,te.target,fe,be))&&te.cancelable&&te.preventDefault()},W.transitionEnd=function(te){var de=te.target;u(de,n,W.transitionEnd),de.style.transition=""},W.onKeyDown=function(te){if(te.keyCode===f.a.ESC){var de=W.props.onClose;te.stopPropagation(),de&&de(te)}},W.onWrapperTransitionEnd=function(te){var de=W.props,fe=de.open,be=de.afterVisibleChange;te.target===W.contentWrapper&&te.propertyName.match(/transform$/)&&(W.dom.style.transition="",!fe&&W.getCurrentDrawerSome()&&(document.body.style.overflowX="",W.maskDom&&(W.maskDom.style.left="",W.maskDom.style.width="")),be&&be(!!fe))},W.openLevelTransition=function(){var te=W.props,de=te.open,fe=te.width,be=te.height,Ce=W.getHorizontalBoolAndPlacementName(),ue=Ce.isHorizontal,ge=Ce.placementName,pe=W.contentDom?W.contentDom.getBoundingClientRect()[ue?"width":"height"]:0,oe=(ue?fe:be)||pe;W.setLevelAndScrolling(de,ge,oe)},W.setLevelTransform=function(te,de,fe,be){var Ce=W.props,ue=Ce.placement,ge=Ce.levelMove,pe=Ce.duration,oe=Ce.ease,ae=Ce.showMask;W.levelDom.forEach(function(re){re.style.transition="transform ".concat(pe," ").concat(oe),o(re,n,W.transitionEnd);var he=te?fe:0;if(ge){var Q=w(ge,{target:re,open:te});he=te?Q[0]:Q[1]||0}var ie=typeof he=="number"?"".concat(he,"px"):he,we=ue==="left"||ue==="top"?ie:"-".concat(ie);we=ae&&ue==="right"&&be?"calc(".concat(we," + ").concat(be,"px)"):we,re.style.transform=he?"".concat(de,"(").concat(we,")"):""})},W.setLevelAndScrolling=function(te,de,fe){var be=W.props.onChange;if(!i){var Ce=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(d.a)(!0):0;W.setLevelTransform(te,de,fe,Ce),W.toggleScrollingToDrawerAndBody(Ce)}be&&be(te)},W.toggleScrollingToDrawerAndBody=function(te){var de=W.props,fe=de.getOpenCount,be=de.getContainer,Ce=de.showMask,ue=de.open,ge=be&&be(),pe=fe&&fe();if(ge&&ge.parentNode===document.body&&Ce){var oe=["touchstart"],ae=[document.body,W.maskDom,W.handlerDom,W.contentDom];ue&&document.body.style.overflow!=="hidden"?(te&&W.addScrollingEffect(te),pe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ae.forEach(function(re,he){if(!re)return;o(re,oe[he]||"touchmove",he?W.removeMoveHandler:W.removeStartHandler,W.passive)})):W.getCurrentDrawerSome()&&(pe||(document.body.style.overflow=""),document.body.style.touchAction="",te&&W.remScrollingEffect(te),ae.forEach(function(re,he){if(!re)return;u(re,oe[he]||"touchmove",he?W.removeMoveHandler:W.removeStartHandler,W.passive)}))}},W.addScrollingEffect=function(te){var de=W.props,fe=de.placement,be=de.duration,Ce=de.ease,ue=de.getOpenCount,ge=de.switchScrollingEffect,pe=ue&&ue();pe===1&&ge();var oe="width ".concat(be," ").concat(Ce),ae="transform ".concat(be," ").concat(Ce);W.dom.style.transition="none";switch(fe){case"right":W.dom.style.transform="translateX(-".concat(te,"px)");break;case"top":case"bottom":W.dom.style.width="calc(100% - ".concat(te,"px)"),W.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(W.timeout),W.timeout=setTimeout(function(){W.dom&&(W.dom.style.transition="".concat(ae,",").concat(oe),W.dom.style.width="",W.dom.style.transform="")})},W.remScrollingEffect=function(te){var de=W.props,fe=de.placement,be=de.duration,Ce=de.ease,ue=de.getOpenCount,ge=de.switchScrollingEffect,pe=ue&&ue();pe||ge(!0),l&&(document.body.style.overflowX="hidden"),W.dom.style.transition="none";var oe,ae="width ".concat(be," ").concat(Ce),re="transform ".concat(be," ").concat(Ce);switch(fe){case"left":{W.dom.style.width="100%",ae="width 0s ".concat(Ce," ").concat(be);break}case"right":{W.dom.style.transform="translateX(".concat(te,"px)"),W.dom.style.width="100%",ae="width 0s ".concat(Ce," ").concat(be),W.maskDom&&(W.maskDom.style.left="-".concat(te,"px"),W.maskDom.style.width="calc(100% + ".concat(te,"px)"));break}case"top":case"bottom":{W.dom.style.width="calc(100% + ".concat(te,"px)"),W.dom.style.height="100%",W.dom.style.transform="translateZ(0)",oe="height 0s ".concat(Ce," ").concat(be);break}default:break}clearTimeout(W.timeout),W.timeout=setTimeout(function(){W.dom&&(W.dom.style.transition="".concat(re,",").concat(oe?"".concat(oe,","):"").concat(ae),W.dom.style.transform="",W.dom.style.width="",W.dom.style.height="")})},W.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(te){return b[te]})},W.getLevelDom=function(te){var de=te.level,fe=te.getContainer;if(i)return;var be=fe&&fe(),Ce=be?be.parentNode:null;if(W.levelDom=[],de==="all"){var ue=Ce?Array.prototype.slice.call(Ce.children):[];ue.forEach(function(ge){ge.nodeName!=="SCRIPT"&&ge.nodeName!=="STYLE"&&ge.nodeName!=="LINK"&&ge!==be&&W.levelDom.push(ge)})}else de&&E(de).forEach(function(ge){document.querySelectorAll(ge).forEach(function(pe){W.levelDom.push(pe)})})},W.getHorizontalBoolAndPlacementName=function(){var te=W.props.placement,de=te==="left"||te==="right",fe="translate".concat(de?"X":"Y");return{isHorizontal:de,placementName:fe}},W.state={_self:Object(a.a)(W)},W}return Object(S.a)(U,[{key:"componentDidMount",value:function(){var W=this;if(!i){var te=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return te=!0,null}}))}catch(ue){}this.passive=te?{passive:!1}:!1}var de=this.props,fe=de.open,be=de.getContainer,Ce=be&&be();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),fe&&(Ce&&Ce.parentNode===document.body&&(b[this.drawerId]=fe),this.openLevelTransition(),this.forceUpdate(function(){W.domFocus()}))}},{key:"componentDidUpdate",value:function(W){var te=this.props,de=te.open,fe=te.getContainer,be=fe&&fe();de!==W.open&&(de&&this.domFocus(),be&&be.parentNode===document.body&&(b[this.drawerId]=!!de),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var W=this.props,te=W.getOpenCount,de=W.open,fe=W.switchScrollingEffect,be=typeof te=="function"&&te();delete b[this.drawerId],de&&(this.setLevelTransform(!1),document.body.style.touchAction=""),be||(document.body.style.overflow="",fe(!0))}},{key:"render",value:function(){var W,te=this,de=this.props,fe=de.className,be=de.children,Ce=de.style,ue=de.width,ge=de.height,pe=de.defaultOpen,oe=de.open,ae=de.prefixCls,re=de.placement,he=de.level,Q=de.levelMove,ie=de.ease,we=de.duration,ne=de.getContainer,J=de.handler,V=de.onChange,Z=de.afterVisibleChange,Ee=de.showMask,xe=de.maskClosable,_e=de.maskStyle,Ne=de.onClose,Be=de.onHandleClick,We=de.keyboard,Ue=de.getOpenCount,ze=de.switchScrollingEffect,Ke=Object(P.a)(de,["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"]),Ye=this.dom?oe:!1,Re=h()(ae,(W={},Object(s.a)(W,"".concat(ae,"-").concat(re),!0),Object(s.a)(W,"".concat(ae,"-open"),Ye),Object(s.a)(W,fe||"",!!fe),Object(s.a)(W,"no-mask",!Ee),W)),tt=this.getHorizontalBoolAndPlacementName(),rt=tt.placementName,He=re==="left"||re==="top"?"-100%":"100%",$e=Ye?"":"".concat(rt,"(").concat(He,")"),Ie=J&&p.cloneElement(J,{onClick:function(Le){J.props.onClick&&J.props.onClick(),Be&&Be(Le)},ref:function(Le){te.handlerDom=Le}});return p.createElement("div",Object.assign({},Ke,{tabIndex:-1,className:Re,style:Ce,ref:function(Le){te.dom=Le},onKeyDown:Ye&&We?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Ee&&p.createElement("div",{className:"".concat(ae,"-mask"),onClick:xe?Ne:void 0,style:_e,ref:function(Le){te.maskDom=Le}}),p.createElement("div",{className:"".concat(ae,"-content-wrapper"),style:{transform:$e,msTransform:$e,width:v(ue)?"".concat(ue,"px"):ue,height:v(ge)?"".concat(ge,"px"):ge},ref:function(Le){te.contentWrapper=Le}},p.createElement("div",{className:"".concat(ae,"-content"),ref:function(Le){te.contentDom=Le},onTouchStart:Ye&&Ee?this.removeStartHandler:void 0,onTouchMove:Ye&&Ee?this.removeMoveHandler:void 0},be),Ie))}}],[{key:"getDerivedStateFromProps",value:function(W,te){var de=te.prevProps,fe=te._self,be={prevProps:W};if(de!==void 0){var Ce=W.placement,ue=W.level;Ce!==de.placement&&(fe.contentDom=null),ue!==de.level&&fe.getLevelDom(W)}return be}}]),U}(p.Component);x.defaultProps={switchScrollingEffect:function(){}};var _=x;function j(H){var G=F();return function(){var B=Object(g.a)(H),W;if(G){var te=Object(g.a)(this).constructor;W=Reflect.construct(B,arguments,te)}else W=B.apply(this,arguments);return Object(T.a)(this,W)}}function F(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(H){return!1}}var L=function(H){Object(R.a)(U,H);var G=j(U);function U(B){var W;Object(m.a)(this,U),W=G.call(this,B),W.onHandleClick=function(de){var fe=W.props,be=fe.onHandleClick,Ce=fe.open;if(be&&be(de),typeof Ce=="undefined"){var ue=W.state.open;W.setState({open:!ue})}},W.onClose=function(de){var fe=W.props,be=fe.onClose,Ce=fe.open;be&&be(de),typeof Ce=="undefined"&&W.setState({open:!1})};var te=typeof B.open!="undefined"?B.open:!!B.defaultOpen;return W.state={open:te},"onMaskClick"in B&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),W}return Object(S.a)(U,[{key:"render",value:function(){var W=this,te=this.props,de=te.defaultOpen,fe=te.getContainer,be=te.wrapperClassName,Ce=te.forceRender,ue=te.handler,ge=Object(P.a)(te,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),pe=this.state.open;if(!fe)return p.createElement("div",{className:be,ref:function(re){W.dom=re}},p.createElement(_,Object.assign({},ge,{open:pe,handler:ue,getContainer:function(){return W.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var oe=!!ue||Ce;return p.createElement(C.a,{visible:pe,forceRender:oe,getContainer:fe,wrapperClassName:be},function(ae){var re=ae.visible,he=ae.afterClose,Q=Object(P.a)(ae,["visible","afterClose"]);return p.createElement(_,Object.assign({},ge,Q,{open:re!==void 0?re:pe,afterVisibleChange:he!==void 0?he:ge.afterVisibleChange,handler:ue,onClose:W.onClose,onHandleClick:W.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(W,te){var de=te.prevProps,fe={prevProps:W};return typeof de!="undefined"&&W.open!==de.open&&(fe.open=W.open),fe}}]),U}(p.Component);L.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:p.createElement("div",{className:"drawer-handle"},p.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var X=L,z=q.a=X},fcyK:function(I,q,M){},gRFJ:function(I,q,M){I.exports=[M("rdUC"),M("ynwM"),M("RELg"),M("DlR+"),M("CrYA"),M("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(I){return I<10?"0"+I:I}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(I){return rx_escapable.lastIndex=0,rx_escapable.test(I)?'"'+I.replace(rx_escapable,function(q){var M=meta[q];return typeof M=="string"?M:"\\u"+("0000"+q.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+I+'"'}function str(I,q){var M,P,m,S,R=gap,T,g=q[I];g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(I)),typeof rep=="function"&&(g=rep.call(q,I,g));switch(typeof g){case"string":return quote(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(gap+=indent,T=[],Object.prototype.toString.apply(g)==="[object Array]"){for(S=g.length,M=0;M<S;M+=1)T[M]=str(M,g)||"null";return m=T.length===0?"[]":gap?`[
`+gap+T.join(`,
`+gap)+`
`+R+"]":"["+T.join(",")+"]",gap=R,m}if(rep&&typeof rep=="object")for(S=rep.length,M=0;M<S;M+=1)typeof rep[M]=="string"&&(P=rep[M],m=str(P,g),m&&T.push(quote(P)+(gap?": ":":")+m));else for(P in g)Object.prototype.hasOwnProperty.call(g,P)&&(m=str(P,g),m&&T.push(quote(P)+(gap?": ":":")+m));return m=T.length===0?"{}":gap?`{
`+gap+T.join(`,
`+gap)+`
`+R+"}":"{"+T.join(",")+"}",gap=R,m}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(I,q,M){var P;if(gap="",indent="",typeof M=="number")for(P=0;P<M;P+=1)indent+=" ";else typeof M=="string"&&(indent=M);if(rep=q,q&&typeof q!="function"&&(typeof q!="object"||typeof q.length!="number"))throw new Error("JSON.stringify");return str("",{"":I})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(I,q){var M,P,m=I[q];if(m&&typeof m=="object")for(M in m)Object.prototype.hasOwnProperty.call(m,M)&&(P=walk(m,M),P!==void 0?m[M]=P:delete m[M]);return reviver.call(I,q,m)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(I){return"\\u"+("0000"+I.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(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return P.mode.ECB=function(){var m=P.lib.BlockCipherMode.extend();return m.Encryptor=m.extend({processBlock:function(S,R){this._cipher.encryptBlock(S,R)}}),m.Decryptor=m.extend({processBlock:function(S,R){this._cipher.decryptBlock(S,R)}}),m}(),P.mode.ECB})},h78n:function(I,q,M){"use strict";M.d(q,"a",function(){return L});var P=M("q1tI"),m=M.n(P),S=M("TSYQ"),R=M.n(S),T={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},g=function(H){var G=H.map(function(){return Object(P.useRef)()}),U=Object(P.useRef)();return Object(P.useEffect)(function(){var B=Date.now(),W=!1;Object.keys(G).forEach(function(te){var de=G[te].current;if(!de)return;W=!0;var fe=de.style;fe.transitionDuration=".3s, .3s, .3s, .06s",U.current&&B-U.current<100&&(fe.transitionDuration="0s, 0s")}),W&&(U.current=Date.now())}),[G]};function C(){return C=Object.assign||function(z){for(var H=1;H<arguments.length;H++){var G=arguments[H];for(var U in G)Object.prototype.hasOwnProperty.call(G,U)&&(z[U]=G[U])}return z},C.apply(this,arguments)}function p(z,H){return d(z)||h(z,H)||a(z,H)||s()}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(z,H){if(!z)return;if(typeof z=="string")return r(z,H);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 r(z,H)}function r(z,H){(H==null||H>z.length)&&(H=z.length);for(var G=0,U=new Array(H);G<H;G++)U[G]=z[G];return U}function h(z,H){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(z)))return;var G=[],U=!0,B=!1,W=void 0;try{for(var te=z[Symbol.iterator](),de;!(U=(de=te.next()).done)&&!(G.push(de.value),H&&G.length===H);U=!0);}catch(fe){B=!0,W=fe}finally{try{!U&&te.return!=null&&te.return()}finally{if(B)throw W}}return G}function d(z){if(Array.isArray(z))return z}function f(z,H){if(z==null)return{};var G=E(z,H),U,B;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(z);for(B=0;B<W.length;B++){if(U=W[B],H.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,U))continue;G[U]=z[U]}}return G}function E(z,H){if(z==null)return{};var G={},U=Object.keys(z),B,W;for(W=0;W<U.length;W++){if(B=U[W],H.indexOf(B)>=0)continue;G[B]=z[B]}return G}var y=function(H){var G=H.className,U=H.percent,B=H.prefixCls,W=H.strokeColor,te=H.strokeLinecap,de=H.strokeWidth,fe=H.style,be=H.trailColor,Ce=H.trailWidth,ue=H.transition,ge=f(H,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ge.gapPosition;var pe=Array.isArray(U)?U:[U],oe=Array.isArray(W)?W:[W],ae=g(pe),re=p(ae,1),he=re[0],Q=de/2,ie=100-de/2,we="M ".concat(te==="round"?Q:0,",").concat(Q,`
L `).concat(te==="round"?ie:100,",").concat(Q),ne="0 0 100 ".concat(de),J=0;return m.a.createElement("svg",C({className:R()("".concat(B,"-line"),G),viewBox:ne,preserveAspectRatio:"none",style:fe},ge),m.a.createElement("path",{className:"".concat(B,"-line-trail"),d:we,strokeLinecap:te,stroke:be,strokeWidth:Ce||de,fillOpacity:"0"}),pe.map(function(V,Z){var Ee={strokeDasharray:"".concat(V,"px, 100px"),strokeDashoffset:"-".concat(J,"px"),transition:ue||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},xe=oe[Z]||oe[oe.length-1];return J+=V,m.a.createElement("path",{key:Z,className:"".concat(B,"-line-path"),d:we,strokeLinecap:te,stroke:xe,strokeWidth:de,fillOpacity:"0",ref:he[Z],style:Ee})}))};y.defaultProps=T;var l=y;function n(){return n=Object.assign||function(z){for(var H=1;H<arguments.length;H++){var G=arguments[H];for(var U in G)Object.prototype.hasOwnProperty.call(G,U)&&(z[U]=G[U])}return z},n.apply(this,arguments)}function o(z,H){return k(z)||i(z,H)||w(z,H)||u()}function u(){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,H){if(!z)return;if(typeof z=="string")return v(z,H);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 v(z,H)}function v(z,H){(H==null||H>z.length)&&(H=z.length);for(var G=0,U=new Array(H);G<H;G++)U[G]=z[G];return U}function i(z,H){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(z)))return;var G=[],U=!0,B=!1,W=void 0;try{for(var te=z[Symbol.iterator](),de;!(U=(de=te.next()).done)&&!(G.push(de.value),H&&G.length===H);U=!0);}catch(fe){B=!0,W=fe}finally{try{!U&&te.return!=null&&te.return()}finally{if(B)throw W}}return G}function k(z){if(Array.isArray(z))return z}function D(z,H){if(z==null)return{};var G=c(z,H),U,B;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(z);for(B=0;B<W.length;B++){if(U=W[B],H.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,U))continue;G[U]=z[U]}}return G}function c(z,H){if(z==null)return{};var G={},U=Object.keys(z),B,W;for(W=0;W<U.length;W++){if(B=U[W],H.indexOf(B)>=0)continue;G[B]=z[B]}return G}var b=0;function x(z){return+z.replace("%","")}function _(z){return Array.isArray(z)?z:[z]}function j(z,H,G,U){var B=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,W=arguments.length>5?arguments[5]:void 0,te=50-U/2,de=0,fe=-te,be=0,Ce=-2*te;switch(W){case"left":de=-te,fe=0,be=2*te,Ce=0;break;case"right":de=te,fe=0,be=-2*te,Ce=0;break;case"bottom":fe=te,Ce=2*te;break;default:}var ue="M 50,50 m ".concat(de,",").concat(fe,`
a `).concat(te,",").concat(te," 0 1 1 ").concat(be,",").concat(-Ce,`
a `).concat(te,",").concat(te," 0 1 1 ").concat(-be,",").concat(Ce),ge=Math.PI*2*te,pe={stroke:G,strokeDasharray:"".concat(H/100*(ge-B),"px ").concat(ge,"px"),strokeDashoffset:"-".concat(B/2+z/100*(ge-B),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ue,pathStyle:pe}}var F=function(H){var G=H.prefixCls,U=H.strokeWidth,B=H.trailWidth,W=H.gapDegree,te=H.gapPosition,de=H.trailColor,fe=H.strokeLinecap,be=H.style,Ce=H.className,ue=H.strokeColor,ge=H.percent,pe=D(H,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),oe=Object(P.useMemo)(function(){return b+=1,b},[]),ae=j(0,100,de,U,W,te),re=ae.pathString,he=ae.pathStyle,Q=_(ge),ie=_(ue),we=ie.find(function(Ee){return Object.prototype.toString.call(Ee)==="[object Object]"}),ne=g(Q),J=o(ne,1),V=J[0],Z=function(){var xe=0;return Q.map(function(_e,Ne){var Be=ie[Ne]||ie[ie.length-1],We=Object.prototype.toString.call(Be)==="[object Object]"?"url(#".concat(G,"-gradient-").concat(oe,")"):"",Ue=j(xe,_e,Be,U,W,te);return xe+=_e,m.a.createElement("path",{key:Ne,className:"".concat(G,"-circle-path"),d:Ue.pathString,stroke:We,strokeLinecap:fe,strokeWidth:U,opacity:_e===0?0:1,fillOpacity:"0",style:Ue.pathStyle,ref:V[Ne]})})};return m.a.createElement("svg",n({className:R()("".concat(G,"-circle"),Ce),viewBox:"0 0 100 100",style:be},pe),we&&m.a.createElement("defs",null,m.a.createElement("linearGradient",{id:"".concat(G,"-gradient-").concat(oe),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(we).sort(function(Ee,xe){return x(Ee)-x(xe)}).map(function(Ee,xe){return m.a.createElement("stop",{key:xe,offset:Ee,stopColor:we[Ee]})}))),m.a.createElement("path",{className:"".concat(G,"-circle-trail"),d:re,stroke:de,strokeLinecap:fe,strokeWidth:B||U,fillOpacity:"0",style:he}),Z().reverse())};F.defaultProps=T;var L=F,X={Line:l,Circle:L}},hQp1:function(I,q,M){"use strict";M.d(q,"a",function(){return m});var P;(function(S){S.FirstPage="firstPage",S.PrevPage="prevPage",S.NextPage="nextPage"})(P||(P={}));var m;(function(S){S[S.Single=0]="Single",S[S.Multiple=1]="Multiple",S[S.Judge=2]="Judge",S[S.Fill=3]="Fill",S[S.Subjective=4]="Subjective",S[S.Shixun=5]="Shixun",S[S.Program=6]="Program",S[S.Combine=7]="Combine"})(m||(m={}))},i3hx:function(I,q,M){},i58Z:function(I,q,M){I.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},jO9C:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return P.pad.Iso97971={pad:function(m,S){m.concat(P.lib.WordArray.create([2147483648],1)),P.pad.ZeroPadding.pad(m,S)},unpad:function(m){P.pad.ZeroPadding.unpad(m),m.sigBytes--}},P.pad.Iso97971})},je13:function(I,q,M){var P=M("5nXd"),m=M("gRFJ"),S=[M("uQRt")];I.exports=P.createStore(m,S)},kSUc:function(I,q,M){},lOMy:function(I,q,M){},lPiR:function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){return function(m){var S=P,R=S.lib,T=R.WordArray,g=R.Hasher,C=S.algo,p=[],s=[];(function(){function h(y){for(var l=m.sqrt(y),n=2;n<=l;n++)if(!(y%n))return!1;return!0}function d(y){return(y-(y|0))*4294967296|0}for(var f=2,E=0;E<64;)h(f)&&(E<8&&(p[E]=d(m.pow(f,1/2))),s[E]=d(m.pow(f,1/3)),E++),f++})();var a=[],r=C.SHA256=g.extend({_doReset:function(){this._hash=new T.init(p.slice(0))},_doProcessBlock:function(h,d){for(var f=this._hash.words,E=f[0],y=f[1],l=f[2],n=f[3],o=f[4],u=f[5],w=f[6],v=f[7],i=0;i<64;i++){if(i<16)a[i]=h[d+i]|0;else{var k=a[i-15],D=(k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3,c=a[i-2],b=(c<<15|c>>>17)^(c<<13|c>>>19)^c>>>10;a[i]=D+a[i-7]+b+a[i-16]}var x=o&u^~o&w,_=E&y^E&l^y&l,j=(E<<30|E>>>2)^(E<<19|E>>>13)^(E<<10|E>>>22),F=(o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25),L=v+F+x+s[i]+a[i],X=j+_;v=w,w=u,u=o,o=n+L|0,n=l,l=y,y=E,E=L+X|0}f[0]=f[0]+E|0,f[1]=f[1]+y|0,f[2]=f[2]+l|0,f[3]=f[3]+n|0,f[4]=f[4]+o|0,f[5]=f[5]+u|0,f[6]=f[6]+w|0,f[7]=f[7]+v|0},_doFinalize:function(){var h=this._data,d=h.words,f=this._nDataBytes*8,E=h.sigBytes*8;return d[E>>>5]|=128<<24-E%32,d[(E+64>>>9<<4)+14]=m.floor(f/4294967296),d[(E+64>>>9<<4)+15]=f,h.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var h=g.clone.call(this);return h._hash=this._hash.clone(),h}});S.SHA256=g._createHelper(r),S.HmacSHA256=g._createHmacHelper(r)}(Math),P.SHA256})},lZu9:function(I,q,M){(function(P){P(M("VrN/"),M("1eCo"),M("8EBN"))})(function(P){"use strict";P.defineMode("markdown",function(m,S){var R=P.getMode(m,"text/html"),T=R.name=="null";function g(U){if(P.findModeByName){var B=P.findModeByName(U);B&&(U=B.mime||B.mimes[0])}var W=P.getMode(m,U);return W.name=="null"?null:W}S.highlightFormatting===void 0&&(S.highlightFormatting=!1),S.maxBlockquoteDepth===void 0&&(S.maxBlockquoteDepth=0),S.taskLists===void 0&&(S.taskLists=!1),S.strikethrough===void 0&&(S.strikethrough=!1),S.emoji===void 0&&(S.emoji=!1),S.fencedCodeBlockHighlighting===void 0&&(S.fencedCodeBlockHighlighting=!0),S.fencedCodeBlockDefaultMode===void 0&&(S.fencedCodeBlockDefaultMode="text/plain"),S.xml===void 0&&(S.xml=!0),S.tokenTypeOverrides===void 0&&(S.tokenTypeOverrides={});var C={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var p in C)C.hasOwnProperty(p)&&S.tokenTypeOverrides[p]&&(C[p]=S.tokenTypeOverrides[p]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,a=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,r=/^\[(x| )\](?=\s)/i,h=S.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,E=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,y=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,n=" ";function o(U,B,W){return B.f=B.inline=W,W(U,B)}function u(U,B,W){return B.f=B.block=W,W(U,B)}function w(U){return!U||!/\S/.test(U.string)}function v(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==k){var B=T;if(!B){var W=P.innerMode(R,U.htmlState);B=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}B&&(U.f=x,U.block=i,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function i(U,B){var W=U.column()===B.indentation,te=w(B.prevLine.stream),de=B.indentedCode,fe=B.prevLine.hr,be=B.list!==!1,Ce=(B.listStack[B.listStack.length-1]||0)+3;B.indentedCode=!1;var ue=B.indentation;if(B.indentationDiff===null&&(B.indentationDiff=B.indentation,be)){for(B.list=null;ue<B.listStack[B.listStack.length-1];)B.listStack.pop(),B.listStack.length?B.indentation=B.listStack[B.listStack.length-1]:B.list=!1;B.list!==!1&&(B.indentationDiff=ue-B.listStack[B.listStack.length-1])}var ge=!te&&!fe&&!B.prevLine.header&&(!be||!de)&&!B.prevLine.fencedCodeEnd,pe=(B.list===!1||fe||te)&&B.indentation<=Ce&&U.match(s),oe=null;if(B.indentationDiff>=4&&(de||B.prevLine.fencedCodeEnd||B.prevLine.header||te))return U.skipToEnd(),B.indentedCode=!0,C.code;if(U.eatSpace())return null;if(W&&B.indentation<=Ce&&(oe=U.match(h))&&oe[1].length<=6)return B.quote=0,B.header=oe[1].length,B.thisLine.header=!0,S.highlightFormatting&&(B.formatting="header"),B.f=B.inline,c(B);if(B.indentation<=Ce&&U.eat(">"))return B.quote=W?1:B.quote+1,S.highlightFormatting&&(B.formatting="quote"),U.eatSpace(),c(B);if(!pe&&!B.setext&&W&&B.indentation<=Ce&&(oe=U.match(a))){var ae=oe[1]?"ol":"ul";return B.indentation=ue+U.current().length,B.list=!0,B.quote=0,B.listStack.push(B.indentation),B.em=!1,B.strong=!1,B.code=!1,B.strikethrough=!1,S.taskLists&&U.match(r,!1)&&(B.taskList=!0),B.f=B.inline,S.highlightFormatting&&(B.formatting=["list","list-"+ae]),c(B)}else{if(W&&B.indentation<=Ce&&(oe=U.match(E,!0)))return B.quote=0,B.fencedEndRE=new RegExp(oe[1]+"+ *$"),B.localMode=S.fencedCodeBlockHighlighting&&g(oe[2]||S.fencedCodeBlockDefaultMode),B.localMode&&(B.localState=P.startState(B.localMode)),B.f=B.block=D,S.highlightFormatting&&(B.formatting="code-block"),B.code=-1,c(B);if(B.setext||(!ge||!be)&&!B.quote&&B.list===!1&&!B.code&&!pe&&!y.test(U.string)&&(oe=U.lookAhead(1))&&(oe=oe.match(d)))return B.setext?(B.header=B.setext,B.setext=0,U.skipToEnd(),S.highlightFormatting&&(B.formatting="header")):(B.header=oe[0].charAt(0)=="="?1:2,B.setext=B.header),B.thisLine.header=!0,B.f=B.inline,c(B);if(pe)return U.skipToEnd(),B.hr=!0,B.thisLine.hr=!0,C.hr;if(U.peek()==="[")return o(U,B,X)}return o(U,B,B.inline)}function k(U,B){var W=R.token(U,B.htmlState);if(!T){var te=P.innerMode(R,B.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||B.md_inside&&U.current().indexOf(">")>-1)&&(B.f=x,B.block=i,B.htmlState=null)}return W}function D(U,B){var W=B.listStack[B.listStack.length-1]||0,te=B.indentation<W,de=W+3;if(B.fencedEndRE&&B.indentation<=de&&(te||U.match(B.fencedEndRE))){S.highlightFormatting&&(B.formatting="code-block");var fe;return te||(fe=c(B)),B.localMode=B.localState=null,B.block=i,B.f=x,B.fencedEndRE=null,B.code=0,B.thisLine.fencedCodeEnd=!0,te?u(U,B,B.block):fe}else return B.localMode?B.localMode.token(U,B.localState):(U.skipToEnd(),C.code)}function c(U){var B=[];if(U.formatting){B.push(C.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var W=0;W<U.formatting.length;W++)B.push(C.formatting+"-"+U.formatting[W]),U.formatting[W]==="header"&&B.push(C.formatting+"-"+U.formatting[W]+"-"+U.header),U.formatting[W]==="quote"&&(!S.maxBlockquoteDepth||S.maxBlockquoteDepth>=U.quote?B.push(C.formatting+"-"+U.formatting[W]+"-"+U.quote):B.push("error"))}if(U.taskOpen)return B.push("meta"),B.length?B.join(" "):null;if(U.taskClosed)return B.push("property"),B.length?B.join(" "):null;if(U.linkHref?B.push(C.linkHref,"url"):(U.strong&&B.push(C.strong),U.em&&B.push(C.em),U.strikethrough&&B.push(C.strikethrough),U.emoji&&B.push(C.emoji),U.linkText&&B.push(C.linkText),U.code&&B.push(C.code),U.image&&B.push(C.image),U.imageAltText&&B.push(C.imageAltText,"link"),U.imageMarker&&B.push(C.imageMarker)),U.header&&B.push(C.header,C.header+"-"+U.header),U.quote&&(B.push(C.quote),!S.maxBlockquoteDepth||S.maxBlockquoteDepth>=U.quote?B.push(C.quote+"-"+U.quote):B.push(C.quote+"-"+S.maxBlockquoteDepth)),U.list!==!1){var te=(U.listStack.length-1)%3;te?te===1?B.push(C.list2):B.push(C.list3):B.push(C.list1)}return U.trailingSpaceNewLine?B.push("trailing-space-new-line"):U.trailingSpace&&B.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),B.length?B.join(" "):null}function b(U,B){return U.match(f,!0)?c(B):void 0}function x(U,B){var W=B.text(U,B);if(typeof W!="undefined")return W;if(B.list)return B.list=null,c(B);if(B.taskList){var te=U.match(r,!0)[1]===" ";return te?B.taskOpen=!0:B.taskClosed=!0,S.highlightFormatting&&(B.formatting="task"),B.taskList=!1,c(B)}if(B.taskOpen=!1,B.taskClosed=!1,B.header&&U.match(/^#+$/,!0))return S.highlightFormatting&&(B.formatting="header"),c(B);var de=U.next();if(B.linkTitle){B.linkTitle=!1;var fe=de;de==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var be="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(U.match(new RegExp(be),!0))return C.linkHref}if(de==="`"){var Ce=B.formatting;S.highlightFormatting&&(B.formatting="code"),U.eatWhile("`");var ue=U.current().length;if(B.code==0&&(!B.quote||ue==1))return B.code=ue,c(B);if(ue==B.code){var ge=c(B);return B.code=0,ge}else return B.formatting=Ce,c(B)}else if(B.code)return c(B);if(de==="\\"&&(U.next(),S.highlightFormatting)){var pe=c(B),oe=C.formatting+"-escape";return pe?pe+" "+oe:oe}if(de==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return B.imageMarker=!0,B.image=!0,S.highlightFormatting&&(B.formatting="image"),c(B);if(de==="["&&B.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return B.imageMarker=!1,B.imageAltText=!0,S.highlightFormatting&&(B.formatting="image"),c(B);if(de==="]"&&B.imageAltText){S.highlightFormatting&&(B.formatting="image");var pe=c(B);return B.imageAltText=!1,B.image=!1,B.inline=B.f=j,pe}if(de==="["&&!B.image)return B.linkText&&U.match(/^.*?\]/)||(B.linkText=!0,S.highlightFormatting&&(B.formatting="link")),c(B);if(de==="]"&&B.linkText){S.highlightFormatting&&(B.formatting="link");var pe=c(B);return B.linkText=!1,B.inline=B.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?j:x,pe}if(de==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){B.f=B.inline=_,S.highlightFormatting&&(B.formatting="link");var pe=c(B);return pe?pe+=" ":pe="",pe+C.linkInline}if(de==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){B.f=B.inline=_,S.highlightFormatting&&(B.formatting="link");var pe=c(B);return pe?pe+=" ":pe="",pe+C.linkEmail}if(S.xml&&de==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ae=U.string.indexOf(">",U.pos);if(ae!=-1){var re=U.string.substring(U.start,ae);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(re)&&(B.md_inside=!0)}return U.backUp(1),B.htmlState=P.startState(R),u(U,B,k)}if(S.xml&&de==="<"&&U.match(/^\/\w*?>/))return B.md_inside=!1,"tag";if(de==="*"||de==="_"){for(var he=1,Q=U.pos==1?" ":U.string.charAt(U.pos-2);he<3&&U.eat(de);)he++;var ie=U.peek()||" ",we=!/\s/.test(ie)&&(!l.test(ie)||/\s/.test(Q)||l.test(Q)),ne=!/\s/.test(Q)&&(!l.test(Q)||/\s/.test(ie)||l.test(ie)),J=null,V=null;if(he%2&&(!B.em&&we&&(de==="*"||!ne||l.test(Q))?J=!0:B.em==de&&ne&&(de==="*"||!we||l.test(ie))&&(J=!1)),he>1&&(!B.strong&&we&&(de==="*"||!ne||l.test(Q))?V=!0:B.strong==de&&ne&&(de==="*"||!we||l.test(ie))&&(V=!1)),V!=null||J!=null){S.highlightFormatting&&(B.formatting=J==null?"strong":V==null?"em":"strong em"),J===!0&&(B.em=de),V===!0&&(B.strong=de);var ge=c(B);return J===!1&&(B.em=!1),V===!1&&(B.strong=!1),ge}}else if(de===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return c(B);U.backUp(1)}if(S.strikethrough){if(de==="~"&&U.eatWhile(de)){if(B.strikethrough){S.highlightFormatting&&(B.formatting="strikethrough");var ge=c(B);return B.strikethrough=!1,ge}else if(U.match(/^[^\s]/,!1))return B.strikethrough=!0,S.highlightFormatting&&(B.formatting="strikethrough"),c(B)}else if(de===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return c(B);U.backUp(2)}}if(S.emoji&&de===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){B.emoji=!0,S.highlightFormatting&&(B.formatting="emoji");var Z=c(B);return B.emoji=!1,Z}return de===" "&&(U.match(/^ +$/,!1)?B.trailingSpace++:B.trailingSpace&&(B.trailingSpaceNewLine=!0)),c(B)}function _(U,B){var W=U.next();if(W===">"){B.f=B.inline=x,S.highlightFormatting&&(B.formatting="link");var te=c(B);return te?te+=" ":te="",te+C.linkInline}return U.match(/^[^>]+/,!0),C.linkInline}function j(U,B){if(U.eatSpace())return null;var W=U.next();return W==="("||W==="["?(B.f=B.inline=L(W==="("?")":"]"),S.highlightFormatting&&(B.formatting="link-string"),B.linkHref=!0,c(B)):"error"}var F={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function L(U){return function(B,W){var te=B.next();if(te===U){W.f=W.inline=x,S.highlightFormatting&&(W.formatting="link-string");var de=c(W);return W.linkHref=!1,de}return B.match(F[U]),W.linkHref=!0,c(W)}}function X(U,B){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(B.f=z,U.next(),S.highlightFormatting&&(B.formatting="link"),B.linkText=!0,c(B)):o(U,B,x)}function z(U,B){if(U.match(/^\]:/,!0)){B.f=B.inline=H,S.highlightFormatting&&(B.formatting="link");var W=c(B);return B.linkText=!1,W}return U.match(/^([^\]\\]|\\.)+/,!0),C.linkText}function H(U,B){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?B.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),B.f=B.inline=x,C.linkHref+" url")}var G={startState:function(){return{f:i,prevLine:{stream:null},thisLine:{stream:null},block:i,htmlState:null,indentation:0,inline:x,text:b,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&P.copyState(R,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?P.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,B){if(B.formatting=!1,U!=B.thisLine.stream){if(B.header=0,B.hr=!1,U.match(/^\s*$/,!0))return v(B),null;if(B.prevLine=B.thisLine,B.thisLine={stream:U},B.taskList=!1,B.trailingSpace=0,B.trailingSpaceNewLine=!1,!B.localState&&(B.f=B.block,B.f!=k)){var W=U.match(/^\s*/,!0)[0].replace(/\t/g,n).length;if(B.indentation=W,B.indentationDiff=null,W>0)return null}}return B.f(U,B)},innerMode:function(U){return U.block==k?{state:U.htmlState,mode:R}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:G}},indent:function(U,B,W){return U.block==k&&R.indent?R.indent(U.htmlState,B,W):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,B,W):P.Pass},blankLine:v,getType:c,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),P.defineMIME("text/markdown","markdown"),P.defineMIME("text/x-markdown","markdown")})},mxV5:function(module,exports,__webpack_require__){(function(global){var require,require;(function(I){if(!0)module.exports=I();else var q})(function(){var define,module,exports;return function(){function I(q,M,P){function m(T,g){if(!M[T]){if(!q[T]){var C=typeof require=="function"&&require;if(!g&&C)return require(T,!0);if(S)return S(T,!0);var p=new Error("Cannot find module '"+T+"'");throw p.code="MODULE_NOT_FOUND",p}var s=M[T]={exports:{}};q[T][0].call(s.exports,function(a){var r=q[T][1][a];return m(r||a)},s,s.exports,I,q,M,P)}return M[T].exports}for(var S=typeof require=="function"&&require,R=0;R<P.length;R++)m(P[R]);return m}return I}()({1:[function(I,q,M){"use strict";var P=I("./browser/client");P.Buffer=I("buffer").Buffer,P.urllib=I("../shims/xhr"),P.version=I("./browser/version").version,q.exports=P},{"../shims/xhr":291,"./browser/client":2,"./browser/version":5,buffer:73}],2:[function(I,q,M){(function(P,m){"use strict";var S=I("babel-runtime/core-js/promise"),R=s(S),T=I("babel-runtime/regenerator"),g=s(T),C=I("babel-runtime/core-js/object/assign"),p=s(C);function s(X){return X&&X.__esModule?X:{default:X}}var a=I("debug")("ali-oss"),r=I("copy-to"),h=I("xml2js"),d=I("agentkeepalive"),f=I("merge-descriptors"),E=I("url"),y=I("is-type-of"),l=I("platform"),n=I("utility"),o=I("urllib"),u=I("./version"),w=I("bowser"),v=I("../common/signUtils"),i=I("../common/utils/isIP"),k=i.isIP,D=I("../common/client/initOptions"),c=I("../common/utils/createRequest"),b=c.createRequest,x=new d;function _(){var X=l.name,z=l.version;X&&X.toLowerCase&&X.toLowerCase()==="ie"&&z.split(".")[0]<10&&console.warn("ali-oss does not support the current browser")}function j(){return location&&location.protocol==="https:"}function F(X,z){if(_(),!(this instanceof F))return new F(X,z);X&&X.inited?this.options=X:this.options=F.initOptions(X),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=o,this.agent=this.options.agent||x),this.ctx=z,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}q.exports=F,F.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 H=(0,p.default)({secure:j(),useFetch:!1},z);return D(H)};var L=F.prototype;L.debug=a,f(L,I("./object")),f(L,I("../common/bucket/getBucketWebsite")),f(L,I("../common/bucket/putBucketWebsite")),f(L,I("../common/bucket/deleteBucketWebsite")),f(L,I("../common/bucket/getBucketLifecycle")),f(L,I("../common/bucket/putBucketLifecycle")),f(L,I("../common/bucket/deleteBucketLifecycle")),f(L,I("../common/bucket/putBucketVersioning")),f(L,I("../common/bucket/getBucketVersioning")),f(L,I("./managed-upload")),f(L,I("../common/multipart")),f(L,I("../common/parallel")),L.signature=function(z){return this.debug("authorization stringToSign: %s",z,"info"),v.computeSignature(this.options.accessKeySecret,z)},L.authorization=function(z,H,G,U){var B=v.buildCanonicalString(z.toUpperCase(),H,{headers:U,parameters:G});return v.authorization(this.options.accessKeyId,this.options.accessKeySecret,B)},L.request=function(z){var H,G,U,B,W,te;return g.default.async(function(fe){for(;;)switch(fe.prev=fe.next){case 0:return H=b.call(this,z),this.options.useFetch||(H.params.mode="disable-fetch"),G=void 0,U=void 0,B=!!z.stream,fe.prev=5,fe.next=8,g.default.awrap(this.urllib.request(H.url,H.params));case 8:G=fe.sent,this.debug("response %s %s, got %s, headers: %j",z.method,H.url,G.status,G.headers,"info"),fe.next=15;break;case 12:fe.prev=12,fe.t0=fe.catch(5),U=fe.t0;case 15:if(W=void 0,!(G&&z.successStatuses&&z.successStatuses.indexOf(G.status)===-1)){fe.next=28;break}return fe.next=19,g.default.awrap(this.requestError(G));case 19:if(W=fe.sent,!(W.code==="RequestTimeTooSkewed"&&!B)){fe.next=25;break}return this.options.amendTimeSkewed=+new Date(W.serverTime)-new Date,fe.next=24,g.default.awrap(this.request(z));case 24:return fe.abrupt("return",fe.sent);case 25:W.params=z,fe.next=32;break;case 28:if(!U){fe.next=32;break}return fe.next=31,g.default.awrap(this.requestError(U));case 31:W=fe.sent;case 32:if(!W){fe.next=34;break}throw W;case 34:if(!z.xmlResponse){fe.next=39;break}return fe.next=37,g.default.awrap(this.parseXML(G.data));case 37:te=fe.sent,G.data=te;case 39:return fe.abrupt("return",G);case 40:case"end":return fe.stop()}},null,this,[[5,12]])},L._getResource=function(z){var H="/";return z.bucket&&(H+=z.bucket+"/"),z.object&&(H+=z.object),H},L._isIP=k,L._escape=function(z){return n.encodeURIComponent(z).replace(/%2F/g,"/")},L._getReqUrl=function(z){var H={};r(this.options.endpoint).to(H);var G=this._isIP(H.hostname),U=this.options.cname;z.bucket&&!U&&!G&&(H.host=z.bucket+"."+H.host);var B="/";z.bucket&&G&&(B+=z.bucket+"/"),z.object&&(B+=this._escape(z.object).replace(/\+/g,"%2B")),H.pathname=B;var W={};if(z.query&&f(W,z.query),z.subres){var te={};y.string(z.subres)?te[z.subres]="":y.array(z.subres)?z.subres.forEach(function(de){te[de]=""}):te=z.subres,f(W,te)}return H.query=W,E.format(H)},L._getUserAgent=function(){var z=m&&m.browser?"js":"nodejs",H="aliyun-sdk-"+z+"/"+u.version,G=l.description;return!G&&m&&(G="Node.js "+m.version.slice(1)+" on "+m.platform+" "+m.arch),this._checkUserAgent(H+" "+G)},L._checkUserAgent=function(z){var H=z.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta");return H},L.checkBrowserAndVersion=function(z,H){return w.name===z&&w.version.split(".")[0]===H},L.parseXML=function(z){return new R.default(function(H,G){P.isBuffer(z)&&(z=z.toString()),h.parseString(z,{explicitRoot:!1,explicitArray:!1},function(U,B){U?G(U):H(B)})})},L.requestError=function(z){var H,G,U,B;return g.default.async(function(te){for(;;)switch(te.prev=te.next){case 0:if(H=null,!(!z.data||!z.data.length)){te.next=5;break}z.status===-1||z.status===-2?(H=new Error(z.message),H.name=z.name,H.status=z.status,H.code=z.name):(z.status===404?(H=new Error("Object not exists"),H.name="NoSuchKeyError",H.status=404,H.code="NoSuchKey"):z.status===412?(H=new Error("Pre condition failed"),H.name="PreconditionFailedError",H.status=412,H.code="PreconditionFailed"):(H=new Error("Unknow error, status: "+z.status),H.name="UnknowError",H.status=z.status),H.requestId=z.headers["x-oss-request-id"],H.host=""),te.next=33;break;case 5:return G=String(z.data),this.debug("request response error data: %s",G,"error"),U=void 0,te.prev=8,te.next=11,g.default.awrap(this.parseXML(G));case 11:if(te.t0=te.sent,te.t0){te.next=14;break}te.t0={};case 14:U=te.t0,te.next=24;break;case 17:return te.prev=17,te.t1=te.catch(8),this.debug(G,"error"),te.t1.message+=`
raw xml: `+G,te.t1.status=z.status,te.t1.requestId=z.headers["x-oss-request-id"],te.abrupt("return",te.t1);case 24:B=U.Message||"unknow request error, status: "+z.status,U.Condition&&(B+=" (condition: "+U.Condition+")"),H=new Error(B),H.name=U.Code?U.Code+"Error":"UnknowError",H.status=z.status,H.code=U.Code,H.requestId=U.RequestId,H.hostId=U.HostId,H.serverTime=U.ServerTime;case 33:return this.debug("generate error %j",H,"error"),te.abrupt("return",H);case 35:case"end":return te.stop()}},null,this,[[8,17]])}}).call(this,{isBuffer:I("../../node_modules/is-buffer/index.js")},I("_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(I,q,M){(function(P){"use strict";var m=I("babel-runtime/core-js/array/from"),S=p(m),R=I("babel-runtime/core-js/promise"),T=p(R),g=I("babel-runtime/regenerator"),C=p(g);function p(v){return v&&v.__esModule?v:{default:v}}var s=I("is-type-of"),a=I("util"),r=I("path"),h=I("mime"),d=I("copy-to"),f=I("../common/utils/isBlob"),E=f.isBlob,y=I("../common/utils/isFile"),l=y.isFile,n=M;n.multipartUpload=function(i,k,D){var c,b,x,_,j,F,L,X,z;return C.default.async(function(G){for(;;)switch(G.prev=G.next){case 0:if(this.resetCancelFlag(),D=D||{},!(D.checkpoint&&D.checkpoint.uploadId)){G.next=6;break}return G.next=5,C.default.awrap(this._resumeMultipart(D.checkpoint,D));case 5:return G.abrupt("return",G.sent);case 6:return c=100*1024,D.mime||(l(k)?D.mime=h.getType(r.extname(k.name)):E(k)?D.mime=k.type:D.mime=h.getType(r.extname(k))),D.headers=D.headers||{},this._convertMetaToHeaders(D.meta,D.headers),G.next=12,C.default.awrap(this._getFileSize(k));case 12:if(b=G.sent,!(b<c)){G.next=25;break}return x=this._createStream(k,0,b),D.contentLength=b,G.next=18,C.default.awrap(this.putStream(i,x,D));case 18:if(_=G.sent,!(D&&D.progress)){G.next=22;break}return G.next=22,C.default.awrap(D.progress(1));case 22:return j={res:_.res,bucket:this.options.bucket,name:i,etag:_.res.headers.etag},(D.headers&&D.headers["x-oss-callback"]||D.callback)&&(j.data=_.data),G.abrupt("return",j);case 25:if(!(D.partSize&&!(parseInt(D.partSize,10)===D.partSize))){G.next=27;break}throw new Error("partSize must be int number");case 27:if(!(D.partSize&&D.partSize<c)){G.next=29;break}throw new Error("partSize must not be smaller than "+c);case 29:return G.next=31,C.default.awrap(this.initMultipartUpload(i,D));case 31:if(F=G.sent,L=F.uploadId,X=this._getPartSize(b,D.partSize),z={file:k,name:i,fileSize:b,partSize:X,uploadId:L,doneParts:[]},!(D&&D.progress)){G.next=38;break}return G.next=38,C.default.awrap(D.progress(0,z,F.res));case 38:return G.next=40,C.default.awrap(this._resumeMultipart(z,D));case 40:return G.abrupt("return",G.sent);case 41:case"end":return G.stop()}},null,this)},n._resumeMultipart=function(i,k){var D,c,b,x,_,j,F,L,X,z,H,G,U,B,W,te,de,fe;return C.default.async(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(D=this,!this.isCancel()){Ce.next=3;break}throw this._makeCancelEvent();case 3:return c=i.file,b=i.fileSize,x=i.partSize,_=i.uploadId,j=i.doneParts,F=i.name,L=[],j.length>0&&d(j).to(L),X=this._divideParts(b,x),z=X.length,H=!1,G=function(ge,pe){var oe=this;return new T.default(function(re,he){var Q,ie,we,ne;return C.default.async(function(V){for(;;)switch(V.prev=V.next){case 0:if(V.prev=0,ge.isCancel()){V.next=18;break}return Q=X[pe-1],ie={stream:ge._createStream(c,Q.start,Q.end),size:Q.end-Q.start},V.next=6,C.default.awrap(ge._uploadPart(F,_,pe,ie));case 6:if(we=V.sent,!(!ge.isCancel()&&!H)){V.next=15;break}if(i.doneParts.push({number:pe,etag:we.res.headers.etag}),!k.progress){V.next=12;break}return V.next=12,C.default.awrap(k.progress(j.length/z,i,we.res));case 12:re({number:pe,etag:we.res.headers.etag}),V.next=16;break;case 15:re();case 16:V.next=19;break;case 18:re();case 19:V.next=30;break;case 21:V.prev=21,V.t0=V.catch(0),ne=new Error,ne.name=V.t0.name,ne.message=V.t0.message,ne.stack=V.t0.stack,ne.partNum=pe,d(V.t0).to(ne),he(ne);case 30:case"end":return V.stop()}},null,oe,[[0,21]])})},U=(0,S.default)(new Array(z),function(ue,ge){return ge+1}),B=L.map(function(ue){return ue.number}),W=U.filter(function(ue){return B.indexOf(ue)<0}),te=5,de=k.parallel||te,Ce.next=17,C.default.awrap(this._parallel(W,de,function(ue){return new T.default(function(ge,pe){G(D,ue).then(function(oe){oe&&L.push(oe),ge()}).catch(function(oe){pe(oe)})})}));case 17:if(fe=Ce.sent,H=!0,!this.isCancel()){Ce.next=22;break}throw G=null,this._makeCancelEvent();case 22:if(!(fe&&fe.length>0)){Ce.next=25;break}throw fe[0].message="Failed to upload some parts with error: "+fe[0].toString()+" part_num: "+fe[0].partNum,fe[0];case 25:return Ce.next=27,C.default.awrap(this.completeMultipartUpload(F,_,L,k));case 27:return Ce.abrupt("return",Ce.sent);case 28:case"end":return Ce.stop()}},null,this)},n._getFileSize=function(i){return C.default.async(function(D){for(;;)switch(D.prev=D.next){case 0:if(!s.buffer(i)){D.next=4;break}return D.abrupt("return",i.length);case 4:if(!(E(i)||l(i))){D.next=6;break}return D.abrupt("return",i.size);case 6:throw new Error("_getFileSize requires Buffer/File/Blob.");case 7:case"end":return D.stop()}},null,this)};var o=I("stream"),u=o.Readable;function w(v,i){if(!(this instanceof w))return new w(v,i);u.call(this,i),this.file=v,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}a.inherits(w,u),w.prototype.readFileAndPush=function(i){if(this.fileBuffer)for(var k=!0;k&&this.fileBuffer&&this.start<this.fileBuffer.length;){var D=this.start,c=D+i;c=c>this.fileBuffer.length?this.fileBuffer.length:c,this.start=c,k=this.push(this.fileBuffer.slice(D,c))}},w.prototype._read=function(i){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file){this.finish||(this.fileBuffer=null,this.finish=!0),this.push(null);return}var k=16*1024;i=i||k;var D=this;this.reader.onload=function(b){D.fileBuffer=P.from(new Uint8Array(b.target.result)),D.file=null,D.readFileAndPush(i)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(i)},n._createStream=function(i,k,D){if(E(i)||l(i))return new w(i.slice(k,D));throw new Error("_createStream requires File/Blob.")},n._getPartSize=function(i,k){var D=10*1e3,c=1024*1024;return k?Math.max(Math.ceil(i/D),k):c},n._divideParts=function(i,k){for(var D=Math.ceil(i/k),c=[],b=0;b<D;b++){var x=k*b,_=Math.min(x+k,i);c.push({start:x,end:_})}return c}}).call(this,I("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(I,q,M){"use strict";var P=I("babel-runtime/core-js/promise"),m=s(P),S=I("babel-runtime/core-js/object/keys"),R=s(S),T=I("babel-runtime/core-js/object/assign"),g=s(T),C=I("babel-runtime/regenerator"),p=s(C);function s(D){return D&&D.__esModule?D:{default:D}}var a=I("utility"),r=I("fs"),h=I("is-type-of"),d=I("url"),f=I("copy-to"),E=I("path"),y=I("mime"),l=I("../common/callback"),n=I("../common/signUtils"),o=I("merge-descriptors"),u=I("../common/utils/isBlob"),w=u.isBlob,v=I("../common/utils/isFile"),i=v.isFile,k=M;k.append=function(c,b,x){var _;return p.default.async(function(F){for(;;)switch(F.prev=F.next){case 0:return x=x||{},x.position===void 0&&(x.position="0"),x.subres={append:"",position:x.position},x.method="POST",F.next=6,p.default.awrap(this.put(c,b,x));case 6:return _=F.sent,_.nextAppendPosition=_.res.headers["x-oss-next-append-position"],F.abrupt("return",_);case 9:case"end":return F.stop()}},null,this)},k.put=function(c,b,x){var _,j,F,L,X,z,H;return p.default.async(function(U){for(;;)switch(U.prev=U.next){case 0:if(_=void 0,x=x||{},c=this._objectName(c),!h.buffer(b)){U.next=7;break}_=b,U.next=33;break;case 7:if(!(w(b)||i(b))){U.next=32;break}return x.mime||(i(b)?x.mime=y.getType(E.extname(b.name)):x.mime=b.type),j=this._createStream(b,0,b.size),U.next=12,p.default.awrap(this._getFileSize(b));case 12:return x.contentLength=U.sent,U.prev=13,U.next=16,p.default.awrap(this.putStream(c,j,x));case 16:return F=U.sent,U.abrupt("return",F);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,p.default.awrap(this.put(c,b,x));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 x.headers=x.headers||{},this._convertMetaToHeaders(x.meta,x.headers),L=x.method||"PUT",X=this._objectRequestParams(L,c,x),l.encodeCallback(X,x),X.mime=x.mime,X.content=_,X.successStatuses=[200],U.next=43,p.default.awrap(this.request(X));case 43:return z=U.sent,H={name:c,url:this._objectUrl(c),res:z.res},X.headers&&X.headers["x-oss-callback"]&&(H.data=JSON.parse(z.data.toString())),U.abrupt("return",H);case 47:case"end":return U.stop()}},null,this,[[13,20]])},k.putStream=function(c,b,x){var _,j,F,L;return p.default.async(function(z){for(;;)switch(z.prev=z.next){case 0:return x=x||{},x.headers=x.headers||{},c=this._objectName(c),x.contentLength?x.headers["Content-Length"]=x.contentLength:x.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(x.meta,x.headers),_=x.method||"PUT",j=this._objectRequestParams(_,c,x),l.encodeCallback(j,x),j.mime=x.mime,j.stream=b,j.successStatuses=[200],z.next=13,p.default.awrap(this.request(j));case 13:return F=z.sent,L={name:c,url:this._objectUrl(c),res:F.res},j.headers&&j.headers["x-oss-callback"]&&(L.data=JSON.parse(F.data.toString())),z.abrupt("return",L);case 17:case"end":return z.stop()}},null,this)},o(k,I("../common/object/copyObject")),o(k,I("../common/object/getObjectTagging")),o(k,I("../common/object/putObjectTagging")),o(k,I("../common/object/deleteObjectTagging")),o(k,I("../common/image")),o(k,I("../common/object/getBucketVersions")),o(k,I("../common/object/getACL")),o(k,I("../common/object/putACL")),o(k,I("../common/object/head")),o(k,I("../common/object/delete")),o(k,I("../common/object/get")),o(k,I("../common/object/putSymlink")),o(k,I("../common/object/getSymlink")),o(k,I("../common/object/deleteMulti")),o(k,I("../common/object/getObjectMeta")),k.putMeta=function(c,b,x){var _;return p.default.async(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,p.default.awrap(this.copy(c,c,{meta:b||{},timeout:x&&x.timeout,ctx:x&&x.ctx}));case 2:return _=F.sent,F.abrupt("return",_);case 4:case"end":return F.stop()}},null,this)},k.list=function(c,b){var x,_,j,F,L;return p.default.async(function(z){for(;;)switch(z.prev=z.next){case 0:return x=this._objectRequestParams("GET","",b),x.query=c,x.xmlResponse=!0,x.successStatuses=[200],z.next=6,p.default.awrap(this.request(x));case 6:return _=z.sent,j=_.data.Contents,F=this,j&&(Array.isArray(j)||(j=[j]),j=j.map(function(H){return{name:H.Key,url:F._objectUrl(H.Key),lastModified:H.LastModified,etag:H.ETag,type:H.Type,size:Number(H.Size),storageClass:H.StorageClass,owner:{id:H.Owner.ID,displayName:H.Owner.DisplayName}}})),L=_.data.CommonPrefixes||null,L&&(Array.isArray(L)||(L=[L]),L=L.map(function(H){return H.Prefix})),z.abrupt("return",{res:_.res,objects:j,prefixes:L,nextMarker:_.data.NextMarker||null,isTruncated:_.data.IsTruncated==="true"});case 13:case"end":return z.stop()}},null,this)},k.restore=function(c,b){var x,_;return p.default.async(function(F){for(;;)switch(F.prev=F.next){case 0:return b=b||{},b.subres=(0,g.default)({restore:""},b.subres),b.versionId&&(b.subres.versionId=b.versionId),x=this._objectRequestParams("POST",c,b),x.successStatuses=[202],F.next=7,p.default.awrap(this.request(x));case 7:return _=F.sent,F.abrupt("return",{res:_.res});case 9:case"end":return F.stop()}},null,this)},k.signatureUrl=function(c,b){b=b||{},c=this._objectName(c),b.method=b.method||"GET";var x=a.timestamp()+(b.expires||1800),_={bucket:this.options.bucket,object:c},j=this._getResource(_);this.options.stsToken&&(b["security-token"]=this.options.stsToken);var F=n._signatureForURL(this.options.accessKeySecret,b,j,x),L=d.parse(this._getReqUrl(_));return L.query={OSSAccessKeyId:this.options.accessKeyId,Expires:x,Signature:F.Signature},f(F.subResource).to(L.query),L.format()},k.getObjectUrl=function(c,b){return b?b[b.length-1]!=="/"&&(b+="/"):b=this.options.endpoint.format(),b+this._escape(this._objectName(c))},k._objectUrl=function(c){return this._getReqUrl({bucket:this.options.bucket,object:c})},k.generateObjectUrl=function(D,c){if(c)c[c.length-1]!=="/"&&(c+="/");else{c=this.options.endpoint.format();var b=d.parse(c),x=this.options.bucket;b.hostname=x+"."+b.hostname,b.host=x+"."+b.host,c=b.format()}return c+this._escape(this._objectName(D))},k._objectRequestParams=function(c,b,x){if(!this.options.bucket)throw new Error("Please create a bucket first");x=x||{},b=this._objectName(b);var _={object:b,bucket:this.options.bucket,method:c,subres:x&&x.subres,timeout:x&&x.timeout,ctx:x&&x.ctx};return x.headers&&(_.headers={},f(x.headers).to(_.headers)),_},k._objectName=function(c){return c.replace(/^\/+/,"")},k._convertMetaToHeaders=function(c,b){if(!c)return;(0,R.default)(c).forEach(function(x){b["x-oss-meta-"+x]=c[x]})},k._deleteFileSafe=function(c){var b=this;return new m.default(function(x){r.exists(c,function(_){_?r.unlink(c,function(j){j&&b.debug("unlink %j error: %s",c,j,"error"),x()}):x()})})}},{"../common/callback":14,"../common/image":16,"../common/object/copyObject":19,"../common/object/delete":20,"../common/object/deleteMulti":21,"../common/object/deleteObjectTagging":22,"../common/object/get":23,"../common/object/getACL":24,"../common/object/getBucketVersions":25,"../common/object/getObjectMeta":26,"../common/object/getObjectTagging":27,"../common/object/getSymlink":28,"../common/object/head":29,"../common/object/putACL":30,"../common/object/putObjectTagging":31,"../common/object/putSymlink":32,"../common/signUtils":34,"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,"copy-to":76,fs:71,"is-type-of":289,"merge-descriptors":200,mime:202,path:205,url:238,utility:290}],5:[function(I,q,M){"use strict";M.version="6.10.0"},{}],6:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(C){return C&&C.__esModule?C:{default:C}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=M;g.deleteBucketLifecycle=function(p,s){var a,r;return m.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return T(p),a=this._bucketRequestParams("DELETE",p,"lifecycle",s),a.successStatuses=[204],d.next=5,m.default.awrap(this.request(a));case 5:return r=d.sent,d.abrupt("return",{res:r.res});case 7:case"end":return d.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],7:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(C){return C&&C.__esModule?C:{default:C}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=M;g.deleteBucketWebsite=function(p,s){var a,r;return m.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return T(p),a=this._bucketRequestParams("DELETE",p,"website",s),a.successStatuses=[204],d.next=5,m.default.awrap(this.request(a));case 5:return r=d.sent,d.abrupt("return",{res:r.res});case 7:case"end":return d.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],8:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(r){return r&&r.__esModule?r:{default:r}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=I("../utils/isArray"),C=g.isArray,p=I("../utils/formatObjKey"),s=p.formatObjKey,a=M;a.getBucketLifecycle=function(h,d){var f,E,y;return m.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return T(h),f=this._bucketRequestParams("GET",h,"lifecycle",d),f.successStatuses=[200],f.xmlResponse=!0,n.next=6,m.default.awrap(this.request(f));case 6:return E=n.sent,y=E.data.Rule||null,y&&(C(y)||(y=[y]),y=y.map(function(o){return o.ID&&(o.id=o.ID,delete o.ID),o.Tag&&!C(o.Tag)&&(o.Tag=[o.Tag]),s(o,"firstLowerCase")})),n.abrupt("return",{rules:y,res:E.res});case 10:case"end":return n.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/formatObjKey":40,"../utils/isArray":42,"babel-runtime/regenerator":68}],9:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(C){return C&&C.__esModule?C:{default:C}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=M;g.getBucketVersioning=function(p,s){var a,r,h;return m.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return T(p),a=this._bucketRequestParams("GET",p,"versioning",s),a.xmlResponse=!0,a.successStatuses=[200],f.next=6,m.default.awrap(this.request(a));case 6:return r=f.sent,h=r.data.Status,f.abrupt("return",{status:r.status,versionStatus:h,res:r.res});case 9:case"end":return f.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],10:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(s){return s&&s.__esModule?s:{default:s}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=I("../utils/isObject"),C=g.isObject,p=M;p.getBucketWebsite=function(a,r){var h,d,f;return m.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:return T(a),h=this._bucketRequestParams("GET",a,"website",r),h.successStatuses=[200],h.xmlResponse=!0,y.next=6,m.default.awrap(this.request(h));case 6:return d=y.sent,f=[],d.data.RoutingRules&&d.data.RoutingRules.RoutingRule&&(C(d.data.RoutingRules.RoutingRule)?f=[d.data.RoutingRules.RoutingRule]:f=d.data.RoutingRules.RoutingRule),y.abrupt("return",{index:d.data.IndexDocument&&d.data.IndexDocument.Suffix||"",supportSubDir:d.data.IndexDocument&&d.data.IndexDocument.SupportSubDir||"false",type:d.data.IndexDocument&&d.data.IndexDocument.Type,routingRules:f,error:d.data.ErrorDocument&&d.data.ErrorDocument.Key||null,res:d.res});case 10:case"end":return y.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isObject":46,"babel-runtime/regenerator":68}],11:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(i){return i&&i.__esModule?i:{default:i}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=I("../utils/isArray"),C=g.isArray,p=I("../utils/deepCopy"),s=p.deepCopy,a=I("../utils/isObject"),r=a.isObject,h=I("../utils/obj2xml"),d=h.obj2xml,f=I("../utils/checkObjectTag"),E=f.checkObjectTag,y=I("../utils/getStrBytesCount"),l=y.getStrBytesCount,n=M;n.putBucketLifecycle=function(k,D,c){var b,x,_,j,F;return m.default.async(function(X){for(;;)switch(X.prev=X.next){case 0:if(T(k),C(D)){X.next=3;break}throw new Error("rules must be Array");case 3:return b=this._bucketRequestParams("PUT",k,"lifecycle",c),x=[],_={LifecycleConfiguration:{Rule:x}},D.forEach(function(z){o(z),v(z),z.id&&(z.ID=z.id,delete z.id),x.push(z)}),j=d(_,{headers:!0,firstUpperCase:!0}),b.content=j,b.mime="xml",b.successStatuses=[200],X.next=13,m.default.awrap(this.request(b));case 13:return F=X.sent,X.abrupt("return",{res:F.res});case 15:case"end":return X.stop()}},null,this)};function o(i){i.days&&(i.expiration={days:i.days}),i.date&&(i.expiration={createdBeforeDate:i.date})}function u(i,k){var D=i.days,c=i.createdBeforeDate;if(!D&&!c)throw new Error(k+" must includes days or createdBeforeDate");if(D&&!/^[1-9][0-9]*$/.test(D))throw new Error("days must be a positive integer");if(c&&!/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(c))throw new Error("createdBeforeDate must be date and conform to iso8601 format")}function w(i){if(!C(i)&&!r(i))throw new Error("tag must be Object or Array");i=r(i)?[i]:i;var k={},D=s(i);D.forEach(function(c){k[c.key]=c.value}),E(k)}function v(i){if(i.id&&l(i.id)>255)throw new Error("ID is composed of 255 bytes at most");if(i.prefix===""||i.prefix===void 0)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(i.status))throw new Error("Status must be Enabled or Disabled");if(i.transition){if(!["IA","Archive"].includes(i.transition.storageClass))throw new Error("StorageClass must be IA or Archive");u(i.transition,"Transition")}if(i.expiration){if(!i.expiration.expiredObjectDeleteMarker)u(i.expiration,"Expiration");else if(i.expiration.days||i.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}if(i.abortMultipartUpload&&u(i.abortMultipartUpload,"AbortMultipartUpload"),!i.expiration&&!i.abortMultipartUpload&&!i.transition&&!i.noncurrentVersionTransition)throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(i.tag){if(i.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");w(i.tag)}}},{"../utils/checkBucketName":35,"../utils/checkObjectTag":36,"../utils/deepCopy":39,"../utils/getStrBytesCount":41,"../utils/isArray":42,"../utils/isObject":46,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],12:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(s){return s&&s.__esModule?s:{default:s}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=I("../utils/obj2xml"),C=g.obj2xml,p=M;p.putBucketVersioning=function(a,r){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d,f,E;return m.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:if(T(a),["Enabled","Suspended"].includes(r)){l.next=3;break}throw new Error("status must be Enabled or Suspended");case 3:return d=this._bucketRequestParams("PUT",a,"versioning",h),f={VersioningConfiguration:{Status:r}},d.mime="xml",d.content=C(f,{headers:!0}),l.next=9,m.default.awrap(this.request(d));case 9:return E=l.sent,l.abrupt("return",{res:E.res,status:E.status});case 11:case"end":return l.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],13:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(r){return r&&r.__esModule?r:{default:r}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=I("../utils/obj2xml"),C=g.obj2xml,p=I("../utils/isArray"),s=p.isArray,a=M;a.putBucketWebsite=function(h){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=arguments[2],E,y,l,n,o;return m.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:if(T(h),E=this._bucketRequestParams("PUT",h,"website",f),y={Suffix:d.index||"index.html"},l={IndexDocument:y},n={WebsiteConfiguration:l},d.supportSubDir&&(y.SupportSubDir=d.supportSubDir),d.type&&(y.Type=d.type),d.error&&(l.ErrorDocument={Key:d.error}),!(d.routingRules!==void 0)){w.next=12;break}if(s(d.routingRules)){w.next=11;break}throw new Error("RoutingRules must be Array");case 11:l.RoutingRules={RoutingRule:d.routingRules};case 12:return n=C(n),E.content=n,E.mime="xml",E.successStatuses=[200],w.next=18,m.default.awrap(this.request(E));case 18:return o=w.sent,w.abrupt("return",{res:o.res});case 20:case"end":return w.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isArray":42,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],14:[function(I,q,M){(function(P){"use strict";var m=I("babel-runtime/core-js/object/keys"),S=g(m),R=I("babel-runtime/core-js/json/stringify"),T=g(R);function g(C){return C&&C.__esModule?C:{default:C}}M.encodeCallback=function(p,s){if(p.headers=p.headers||{},!Object.prototype.hasOwnProperty.call(p.headers,"x-oss-callback")&&s.callback){var a={callbackUrl:encodeURI(s.callback.url),callbackBody:s.callback.body};s.callback.host&&(a.callbackHost=s.callback.host),s.callback.contentType&&(a.callbackBodyType=s.callback.contentType);var r=P.from((0,T.default)(a)).toString("base64");if(p.headers["x-oss-callback"]=r,s.callback.customValue){var h={};(0,S.default)(s.callback.customValue).forEach(function(d){h["x:"+d]=s.callback.customValue[d]}),p.headers["x-oss-callback-var"]=P.from((0,T.default)(h)).toString("base64")}}}}).call(this,I("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,buffer:73}],15:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/assign"),m=S(P);function S(a){return a&&a.__esModule?a:{default:a}}var R=I("humanize-ms"),T=I("url"),g=I("../utils/checkBucketName"),C=g.checkBucketName;function p(a,r){var h=T.parse(a);if(h.protocol||(h=T.parse("http"+(r?"s":"")+"://"+a)),h.protocol!=="http:"&&h.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return h}function s(a,r,h){var d=h?"https://":"http://",f=r?"-internal.aliyuncs.com":".aliyuncs.com",E="vpc100-oss-cn-";return a.substr(0,E.length)===E&&(f=".aliyuncs.com"),T.parse(d+a+f)}q.exports=function(a){if(!a||!a.accessKeyId||!a.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");a.bucket&&C(a.bucket);var r=(0,m.default)({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1},a);if(r.accessKeyId=r.accessKeyId.trim(),r.accessKeySecret=r.accessKeySecret.trim(),r.timeout&&(r.timeout=R(r.timeout)),r.endpoint)r.endpoint=p(r.endpoint,r.secure);else if(r.region)r.endpoint=s(r.region,r.internal,r.secure);else throw new Error("require options.endpoint or options.region");return r.inited=!0,r}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/assign":54,"humanize-ms":194,url:238}],16:[function(I,q,M){"use strict";var P=I("merge-descriptors"),m=M;P(m,I("./processObjectSave"))},{"./processObjectSave":17,"merge-descriptors":200}],17:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(r){return r&&r.__esModule?r:{default:r}}var R=I("../utils/checkBucketName"),T=R.checkBucketName,g=I("querystring"),C=I("js-base64"),p=C.Base64.encode,s=M;s.processObjectSave=function(h,d,f,E){var y,l,n,o;return m.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:return a(h,"sourceObject"),a(d,"targetObject"),a(f,"process"),d=this._objectName(d),E&&T(E),y=this._objectRequestParams("POST",h,{subres:"x-oss-process"}),l=E?",b_"+p(E):"",d=p(d),n={"x-oss-process":f+"|sys/saveas,o_"+d+l},y.content=g.stringify(n),w.next=12,m.default.awrap(this.request(y));case 12:return o=w.sent,w.abrupt("return",{res:o.res,status:o.res.status});case 14:case"end":return w.stop()}},null,this)};function a(r,h){if(!r)throw new Error(h+" is required");if(typeof r!="string")throw new Error(h+" must be String")}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68,"js-base64":199,querystring:212}],18:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=S(P);function S(s){return s&&s.__esModule?s:{default:s}}var R=I("copy-to"),T=I("./callback"),g=I("./utils/deepCopy"),C=g.deepCopy,p=M;p.listUploads=function(a,r){var h,d,f,E;return m.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return r=r||{},h={},R(r).to(h),h.subres="uploads",d=this._objectRequestParams("GET","",h),d.query=a,d.xmlResponse=!0,d.successStatuses=[200],l.next=10,m.default.awrap(this.request(d));case 10:return f=l.sent,E=f.data.Upload||[],Array.isArray(E)||(E=[E]),E=E.map(function(n){return{name:n.Key,uploadId:n.UploadId,initiated:n.Initiated}}),l.abrupt("return",{res:f.res,uploads:E,bucket:f.data.Bucket,nextKeyMarker:f.data.NextKeyMarker,nextUploadIdMarker:f.data.NextUploadIdMarker,isTruncated:f.data.IsTruncated==="true"});case 15:case"end":return l.stop()}},null,this)},p.listParts=function(a,r,h,d){var f,E,y;return m.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return d=d||{},f={},R(d).to(f),f.subres={uploadId:r},E=this._objectRequestParams("GET",a,f),E.query=h,E.xmlResponse=!0,E.successStatuses=[200],n.next=10,m.default.awrap(this.request(E));case 10:return y=n.sent,n.abrupt("return",{res:y.res,uploadId:y.data.UploadId,bucket:y.data.Bucket,name:y.data.Key,partNumberMarker:y.data.PartNumberMarker,nextPartNumberMarker:y.data.NextPartNumberMarker,maxParts:y.data.MaxParts,isTruncated:y.data.IsTruncated,parts:y.data.Part||[]});case 12:case"end":return n.stop()}},null,this)},p.abortMultipartUpload=function(a,r,h){var d,f,E;return m.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return this._stop(),h=h||{},d={},R(h).to(d),d.subres={uploadId:r},f=this._objectRequestParams("DELETE",a,d),f.successStatuses=[204],l.next=9,m.default.awrap(this.request(f));case 9:return E=l.sent,l.abrupt("return",{res:E.res});case 11:case"end":return l.stop()}},null,this)},p.initMultipartUpload=function(a,r){var h,d,f;return m.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:return r=r||{},h={},R(r).to(h),h.headers=h.headers||{},this._convertMetaToHeaders(r.meta,h.headers),h.subres="uploads",d=this._objectRequestParams("POST",a,h),d.mime=r.mime,d.xmlResponse=!0,d.successStatuses=[200],y.next=12,m.default.awrap(this.request(d));case 12:return f=y.sent,y.abrupt("return",{res:f.res,bucket:f.data.Bucket,name:f.data.Key,uploadId:f.data.UploadId});case 14:case"end":return y.stop()}},null,this)},p.uploadPart=function(a,r,h,d,f,E,y){var l;return m.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return l={stream:this._createStream(d,f,E),size:E-f},o.next=3,m.default.awrap(this._uploadPart(a,r,h,l,y));case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}},null,this)},p.completeMultipartUpload=function(a,r,h,d){var f,E,y,l,n,o,u,w;return m.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:for(f=h.concat().sort(function(k,D){return k.number-D.number}).filter(function(k,D,c){return!D||k.number!==c[D-1].number}),E=`<?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUpload>
`,y=0;y<f.length;y++)l=f[y],E+=`<Part>
`,E+="<PartNumber>"+l.number+`</PartNumber>
`,E+="<ETag>"+l.etag+`</ETag>
`,E+=`</Part>
`;return E+="</CompleteMultipartUpload>",d=d||{},n={},n=C(d),n.headers&&delete n.headers["x-oss-server-side-encryption"],n.subres={uploadId:r},o=this._objectRequestParams("POST",a,n),T.encodeCallback(o,n),o.mime="xml",o.content=E,o.headers&&o.headers["x-oss-callback"]||(o.xmlResponse=!0),o.successStatuses=[200],i.next=17,m.default.awrap(this.request(o));case 17:return u=i.sent,w={res:u.res,bucket:o.bucket,name:a,etag:u.res.headers.etag},o.headers&&o.headers["x-oss-callback"]&&(w.data=JSON.parse(u.data.toString())),i.abrupt("return",w);case 21:case"end":return i.stop()}},null,this)},p._uploadPart=function(a,r,h,d,f){var E,y,l;return m.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return f=f||{},E={},R(f).to(E),E.headers={"Content-Length":d.size},E.subres={partNumber:h,uploadId:r},y=this._objectRequestParams("PUT",a,E),y.mime=E.mime,y.stream=d.stream,y.successStatuses=[200],o.next=11,m.default.awrap(this.request(y));case 11:if(l=o.sent,l.res.headers.etag){o.next=14;break}throw new Error(`Please set the etag of expose-headers in OSS
https://help.aliyun.com/document_detail/32069.html`);case 14:return d.stream=null,y.stream=null,o.abrupt("return",{name:a,etag:l.res.headers.etag,res:l.res});case 17:case"end":return o.stop()}},null,this)}},{"./callback":14,"./utils/deepCopy":39,"babel-runtime/regenerator":68,"copy-to":76}],19:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=C(P),S=I("babel-runtime/core-js/object/keys"),R=C(S),T=I("babel-runtime/helpers/typeof"),g=C(T);function C(r){return r&&r.__esModule?r:{default:r}}var p=I("../utils/checkBucketName"),s=p.checkBucketName,a=M;a.copy=function(h,d,f,E){var y,l,n;return m.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return(typeof f=="undefined"?"undefined":(0,g.default)(f))==="object"&&(E=f),E=E||{},E.headers=E.headers||{},(0,R.default)(E.headers).forEach(function(w){E.headers["x-oss-copy-source-"+w.toLowerCase()]=E.headers[w]}),E.meta&&(E.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(E.meta,E.headers),d=this._getSourceName(d,f),E.versionId&&(d=d+"?versionId="+E.versionId),E.headers["x-oss-copy-source"]=d,y=this._objectRequestParams("PUT",h,E),y.xmlResponse=!0,y.successStatuses=[200,304],u.next=14,m.default.awrap(this.request(y));case 14:return l=u.sent,n=l.data,n&&(n={etag:n.ETag,lastModified:n.LastModified}),u.abrupt("return",{data:n,res:l.res});case 18:case"end":return u.stop()}},null,this)},a._getSourceName=function(h,d){return typeof d=="string"?h=this._objectName(h):h[0]!=="/"?d=this.options.bucket:(d=h.replace(/\/(.+?)(\/.*)/,"$1"),h=h.replace(/(\/.+?\/)(.*)/,"$2")),s(d),h=encodeURI(h),h="/"+d+"/"+h,h}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,"babel-runtime/regenerator":68}],20:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=M;g.delete=function(p){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return m.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return s.subres=(0,R.default)({},s.subres),s.versionId&&(s.subres.versionId=s.versionId),a=this._objectRequestParams("DELETE",p,s),a.successStatuses=[204],d.next=6,m.default.awrap(this.request(a));case 6:return r=d.sent,d.abrupt("return",{res:r.res});case 8:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],21:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(a){return a&&a.__esModule?a:{default:a}}var g=I("utility"),C=I("../utils/obj2xml"),p=C.obj2xml,s=M;s.deleteMulti=function(r){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d,f,E,y,l,n,o,u,w,v,i,k;return m.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(d=[],!(!r||!r.length)){c.next=3;break}throw new Error("names is required");case 3:for(f=0;f<r.length;f++)E={},typeof r[f]=="string"?E.Key=g.escape(this._objectName(r[f])):(y=r[f],l=y.key,n=y.versionId,E.Key=g.escape(this._objectName(l)),E.VersionId=n),d.push(E);return o={Delete:{Quiet:!!h.quiet,Object:d}},u=p(o,{headers:!0}),h.subres=(0,R.default)({delete:""},h.subres),h.versionId&&(h.subres.versionId=h.versionId),w=this._objectRequestParams("POST","",h),w.mime="xml",w.content=u,w.xmlResponse=!0,w.successStatuses=[200],c.next=15,m.default.awrap(this.request(w));case 15:return v=c.sent,i=v.data,k=i&&i.Deleted||null,k&&(Array.isArray(k)||(k=[k])),c.abrupt("return",{res:v.res,deleted:k||[]});case 20:case"end":return c.stop()}},null,this)}},{"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,utility:290}],22:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=M;g.deleteObjectTagging=function(p){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return m.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return s.subres=(0,R.default)({tagging:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),p=this._objectName(p),a=this._objectRequestParams("DELETE",p,s),a.successStatuses=[204],d.next=7,m.default.awrap(this.request(a));case 7:return r=d.sent,d.abrupt("return",{status:r.status,res:r.res});case 9:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],23:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(s){return s&&s.__esModule?s:{default:s}}var g=I("fs"),C=I("is-type-of"),p=M;p.get=function(a,r){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d,f,E,y;return m.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return d=null,f=!1,C.writableStream(r)?d=r:C.string(r)?(d=g.createWriteStream(r),f=!0):h=r,h=h||{},h.subres=(0,R.default)({},h.subres),h.versionId&&(h.subres.versionId=h.versionId),h.process&&(h.subres["x-oss-process"]=h.process),E=void 0,n.prev=8,y=this._objectRequestParams("GET",a,h),y.writeStream=d,y.successStatuses=[200,206,304],n.next=14,m.default.awrap(this.request(y));case 14:E=n.sent,f&&d.destroy(),n.next=25;break;case 18:if(n.prev=18,n.t0=n.catch(8),!f){n.next=24;break}return d.destroy(),n.next=24,m.default.awrap(this._deleteFileSafe(r));case 24:throw n.t0;case 25:return n.abrupt("return",{res:E.res,content:E.data});case 26:case"end":return n.stop()}},null,this,[[8,18]])}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,fs:71,"is-type-of":289}],24:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=M;g.getACL=function(p){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return m.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return s.subres=(0,R.default)({acl:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),p=this._objectName(p),a=this._objectRequestParams("GET",p,s),a.successStatuses=[200],a.xmlResponse=!0,d.next=8,m.default.awrap(this.request(a));case 8:return r=d.sent,d.abrupt("return",{acl:r.data.AccessControlList.Grant,owner:{id:r.data.Owner.ID,displayName:r.data.Owner.DisplayName},res:r.res});case 10:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],25:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=C(P),S=I("babel-runtime/regenerator"),R=C(S),T=I("babel-runtime/core-js/object/assign"),g=C(T);function C(y){return y&&y.__esModule?y:{default:y}}var p=M,s=I("../utils/isObject"),a=s.isObject,r=I("../utils/isArray"),h=r.isArray;p.getBucketVersions=d,p.listObjectVersions=d;function d(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,o,u,w,v,i;return R.default.async(function(D){for(;;)switch(D.prev=D.next){case 0:if(!(y.versionIdMarker&&y.keyMarker===void 0)){D.next=2;break}throw new Error("A version-id marker cannot be specified without a key marker");case 2:return l.subres=(0,g.default)({versions:""},l.subres),l.versionId&&(l.subres.versionId=l.versionId),n=this._objectRequestParams("GET","",l),n.xmlResponse=!0,n.successStatuses=[200],n.query=E(y),D.next=10,R.default.awrap(this.request(n));case 10:return o=D.sent,u=o.data.Version||[],w=o.data.DeleteMarker||[],v=this,u&&(Array.isArray(u)||(u=[u]),u=u.map(function(c){return{name:c.Key,url:v._objectUrl(c.Key),lastModified:c.LastModified,isLatest:c.IsLatest==="true",versionId:c.VersionId,etag:c.ETag,type:c.Type,size:Number(c.Size),storageClass:c.StorageClass,owner:{id:c.Owner.ID,displayName:c.Owner.DisplayName}}})),w&&(h(w)||(w=[w]),w=w.map(function(c){return{name:c.Key,lastModified:c.LastModified,versionId:c.VersionId,owner:{id:c.Owner.ID,displayName:c.Owner.DisplayName}}})),i=o.data.CommonPrefixes||null,i&&(h(i)||(i=[i]),i=i.map(function(c){return c.Prefix})),D.abrupt("return",{res:o.res,objects:u,deleteMarker:w,prefixes:i,nextMarker:o.data.NextMarker||null,NextVersionIdMarker:o.data.NextVersionIdMarker||null,isTruncated:o.data.IsTruncated==="true"});case 19:case"end":return D.stop()}},null,this)}function f(y){return y.replace(/([A-Z])/g,"-$1").toLowerCase()}function E(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l={};return a(y)&&(0,m.default)(y).forEach(function(n){l[f(n)]=y[n]}),l}},{"../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(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=M;g.getObjectMeta=function(p,s){var a,r;return m.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return s=s||{},p=this._objectName(p),s.subres=(0,R.default)({objectMeta:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),a=this._objectRequestParams("HEAD",p,s),a.successStatuses=[200],d.next=8,m.default.awrap(this.request(a));case 8:return r=d.sent,d.abrupt("return",{status:r.status,res:r.res});case 10:case"end":return d.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],27:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(s){return s&&s.__esModule?s:{default:s}}var g=M,C=I("../utils/isObject"),p=C.isObject;g.getObjectTagging=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h,d,f,E,y;return m.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return r.subres=(0,R.default)({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),a=this._objectName(a),h=this._objectRequestParams("GET",a,r),h.successStatuses=[200],n.next=7,m.default.awrap(this.request(h));case 7:return d=n.sent,n.next=10,m.default.awrap(this.parseXML(d.data));case 10:return f=n.sent,E=f.TagSet.Tag,E=E&&p(E)?[E]:E||[],y={},E.forEach(function(o){y[o.Key]=o.Value}),n.abrupt("return",{status:d.status,res:d.res,tag:y});case 16:case"end":return n.stop()}},null,this)}},{"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],28:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=M;g.getSymlink=function(p){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r,h;return m.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return s.subres=(0,R.default)({symlink:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),p=this._objectName(p),a=this._objectRequestParams("GET",p,s),a.successStatuses=[200],f.next=7,m.default.awrap(this.request(a));case 7:return r=f.sent,h=r.res.headers["x-oss-symlink-target"],f.abrupt("return",{targetName:decodeURIComponent(h),res:r.res});case 10:case"end":return f.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],29:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=C(P),S=I("babel-runtime/core-js/object/keys"),R=C(S),T=I("babel-runtime/core-js/object/assign"),g=C(T);function C(s){return s&&s.__esModule?s:{default:s}}var p=M;p.head=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h,d,f;return m.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:return r.subres=(0,g.default)({},r.subres),r.versionId&&(r.subres.versionId=r.versionId),h=this._objectRequestParams("HEAD",a,r),h.successStatuses=[200,304],y.next=6,m.default.awrap(this.request(h));case 6:return d=y.sent,f={meta:null,res:d.res,status:d.status},d.status===200&&(0,R.default)(d.headers).forEach(function(l){l.indexOf("x-oss-meta-")===0&&(f.meta||(f.meta={}),f.meta[l.substring(11)]=d.headers[l])}),y.abrupt("return",f);case 10:case"end":return y.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],30:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=M;g.putACL=function(p,s,a){var r,h;return m.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return a=a||{},a.subres=(0,R.default)({acl:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),a.headers=a.headers||{},a.headers["x-oss-object-acl"]=s,p=this._objectName(p),r=this._objectRequestParams("PUT",p,a),r.successStatuses=[200],f.next=10,m.default.awrap(this.request(r));case 10:return h=f.sent,f.abrupt("return",{res:h.res});case 12:case"end":return f.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],31:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=C(P),S=I("babel-runtime/core-js/object/keys"),R=C(S),T=I("babel-runtime/core-js/object/assign"),g=C(T);function C(d){return d&&d.__esModule?d:{default:d}}var p=I("../utils/obj2xml"),s=p.obj2xml,a=I("../utils/checkObjectTag"),r=a.checkObjectTag,h=M;h.putObjectTagging=function(f,E){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l,n,o;return m.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:return r(E),y.subres=(0,g.default)({tagging:""},y.subres),y.versionId&&(y.subres.versionId=y.versionId),f=this._objectName(f),l=this._objectRequestParams("PUT",f,y),l.successStatuses=[200],E=(0,R.default)(E).map(function(v){return{Key:v,Value:E[v]}}),n={Tagging:{TagSet:{Tag:E}}},l.mime="xml",l.content=s(n),w.next=12,m.default.awrap(this.request(l));case 12:return o=w.sent,w.abrupt("return",{res:o.res,status:o.status});case 14:case"end":return w.stop()}},null,this)}},{"../utils/checkObjectTag":36,"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],32:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/object/assign"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=M;g.putSymlink=function(p,s,a){var r,h;return m.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return a=a||{},a.headers=a.headers||{},s=this._escape(this._objectName(s)),this._convertMetaToHeaders(a.meta,a.headers),a.headers["x-oss-symlink-target"]=s,a.subres=(0,R.default)({symlink:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),a.storageClass&&(a.headers["x-oss-storage-class"]=a.storageClass),p=this._objectName(p),r=this._objectRequestParams("PUT",p,a),r.successStatuses=[200],f.next=13,m.default.awrap(this.request(r));case 13:return h=f.sent,f.abrupt("return",{res:h.res});case 15:case"end":return f.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],33:[function(I,q,M){"use strict";var P=I("babel-runtime/regenerator"),m=T(P),S=I("babel-runtime/core-js/promise"),R=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var g=M;g._parallelNode=function(p,s,a,r){var h,d,f,E,y,l,n,o;return m.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:h=this,d=[],f=[],E=p.length/s,y=p.length%s,l=y===0?E:(p.length-y)/s+1,n=1,o=0;case 8:if(!(o<p.length)){w.next=26;break}if(!h.isCancel()){w.next=11;break}return w.abrupt("break",26);case 11:if(r?f.push(a(h,p[o],r)):f.push(a(h,p[o])),!(f.length===s||n===l&&o===p.length-1)){w.next=23;break}return w.prev=13,n+=1,w.next=17,m.default.awrap(R.default.all(f));case 17:w.next=22;break;case 19:w.prev=19,w.t0=w.catch(13),d.push(w.t0);case 22:f=[];case 23:o++,w.next=8;break;case 26:return w.abrupt("return",d);case 27:case"end":return w.stop()}},null,this,[[13,19]])},g._parallel=function(p,s,a){var r=this;return new R.default(function(h){var d=[];if(s<=0||!p){h(d);return}function f(i){return function(){if(i===null)throw new Error("Callback was already called.");var k=i;i=null;for(var D=arguments.length,c=Array(D),b=0;b<D;b++)c[b]=arguments[b];k.apply(this,c)}}function E(i){var k=-1,D=i.length;return function(){return++k<D&&!r.isCancel()?{value:i[k],key:k}:null}}var y=E(p),l=!1,n=0,o=!1;function u(i,k){n-=1,i?(l=!0,d.push(i),h(d)):k==={}||l&&n<=0?(l=!0,h(d)):o||(r.isCancel()?h(d):v())}function w(i,k){a(i).then(function(D){k(null,D)}).catch(function(D){k(D)})}function v(){for(o=!0;n<s&&!l&&!r.isCancel();){var i=y();if(i===null||d.length>0){l=!0,n<=0&&h(d);return}n+=1,w(i.value,f(u))}o=!1}v()})},g.cancel=function(p){this.options.cancelFlag=!0,p&&this.abortMultipartUpload(p.name,p.uploadId,p.options)},g.isCancel=function(){return this.options.cancelFlag},g.resetCancelFlag=function(){this.options.cancelFlag=!1},g._stop=function(){this.options.cancelFlag=!0},g._makeCancelEvent=function(){var p={status:0,name:"cancel"};return p}},{"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68}],34:[function(I,q,M){(function(P){"use strict";var m=I("babel-runtime/core-js/json/stringify"),S=g(m),R=I("babel-runtime/core-js/object/keys"),T=g(R);function g(s){return s&&s.__esModule?s:{default:s}}var C=I("./../../shims/crypto/crypto.js"),p=I("is-type-of");M.buildCanonicalizedResource=function(a,r){var h=""+a,d="?";if(p.string(r)&&r.trim()!=="")h+=d+r;else if(p.array(r))r.sort(),h+=d+r.join("&");else if(r){var f=function(l,n){return l[0]>n[0]?1:l[0]<n[0]?-1:0},E=function(l){h+=d+l,r[l]&&(h+="="+r[l]),d="&"};(0,T.default)(r).sort(f).forEach(E)}return h},M.buildCanonicalString=function(a,r,h,d){h=h||{};var f=h.headers||{},E="x-oss-",y=[],l={},n=[a.toUpperCase(),f["Content-Md5"]||"",f["Content-Type"]||f["Content-Type".toLowerCase()],d||f["x-oss-date"]];return(0,T.default)(f).forEach(function(o){var u=o.toLowerCase();u.indexOf(E)===0&&(l[u]=String(f[o]).trim())}),(0,T.default)(l).sort().forEach(function(o){y.push(o+":"+l[o])}),n=n.concat(y),n.push(this.buildCanonicalizedResource(r,h.parameters)),n.join(`
`)},M.computeSignature=function(a,r){var h=C.createHmac("sha1",a);return h.update(P.from(r,"utf8")).digest("base64")},M.authorization=function(a,r,h){return"OSS "+a+":"+this.computeSignature(r,h)},M._signatureForURL=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=arguments[2],d=arguments[3],f={},E=r.subResource,y=E===void 0?{}:E;if(r.process){var l="x-oss-process";y[l]=r.process}if(r.trafficLimit){var n="x-oss-traffic-limit";y[n]=r.trafficLimit}if(r.response&&(0,T.default)(r.response).forEach(function(v){var i="response-"+v.toLowerCase();y[i]=r.response[v]}),(0,T.default)(r).forEach(function(v){var i=v.toLowerCase(),k=r[v];i.indexOf("x-oss-")===0?f[i]=k:(i.indexOf("content-md5")===0||i.indexOf("content-type")===0)&&(f[v]=k)}),Object.prototype.hasOwnProperty.call(r,"security-token")&&(y["security-token"]=r["security-token"]),Object.prototype.hasOwnProperty.call(r,"callback")){var o={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};if(r.callback.host&&(o.callbackHost=r.callback.host),r.callback.contentType&&(o.callbackBodyType=r.callback.contentType),y.callback=P.from((0,S.default)(o)).toString("base64"),r.callback.customValue){var u={};(0,T.default)(r.callback.customValue).forEach(function(v){u["x:"+v]=r.callback.customValue[v]}),y["callback-var"]=P.from((0,S.default)(u)).toString("base64")}}var w=this.buildCanonicalString(r.method,h,{headers:f,parameters:y},d.toString());return{Signature:this.computeSignature(a,w),subResource:y}}}).call(this,I("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(I,q,M){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.checkBucketName=void 0,M.checkBucketName=function(P,m){var S=m?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;if(!S.test(P))throw new Error("The bucket must be conform to the specifications")}},{}],36:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/entries"),m=S(P);function S(r){return r&&r.__esModule?r:{default:r}}Object.defineProperty(M,"__esModule",{value:!0}),M.checkObjectTag=void 0;var R=I("./checkValid"),T=R.checkValid,g=I("./isObject"),C=g.isObject,p=[{validator:function(h){if(typeof h!="string")throw new Error("the key and value of the tag must be String")}},{pattern:/^[a-zA-Z0-9 +-=._:/]+$/,msg:"tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)"}],s={key:[].concat(p,[{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}]),value:[].concat(p,[{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}])};function a(r){if(!C(r))throw new Error("tag must be Object");var h=(0,m.default)(r);if(h.length>10)throw new Error("maximum of 10 tags for a object");var d=["key","value"];h.forEach(function(f){f.forEach(function(E,y){T(E,s[d[y]])})})}M.checkObjectTag=a},{"./checkValid":37,"./isObject":46,"babel-runtime/core-js/object/entries":57}],37:[function(I,q,M){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.checkValid=void 0;function P(m,S){S.forEach(function(R){if(R.validator)R.validator(m);else if(R.pattern&&!R.pattern.test(m))throw new Error(R.msg)})}M.checkValid=P},{}],38:[function(I,q,M){(function(P){"use strict";var m=I("babel-runtime/core-js/object/assign"),S=R(m);function R(f){return f&&f.__esModule?f:{default:f}}Object.defineProperty(M,"__esModule",{value:!0}),M.createRequest=void 0;var T=I("./../../../shims/crypto/crypto.js"),g=I("debug")("ali-oss"),C=I("mime"),p=I("dateformat"),s=I("copy-to"),a=I("path");function r(f,E){return f[E]||f[E.toLowerCase()]}function h(f,E){delete f[E],delete f[E.toLowerCase()]}function d(f){var E=new Date;this.options.amendTimeSkewed&&(E=+new Date+this.options.amendTimeSkewed);var y={"x-oss-date":p(E,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.userAgent.includes("nodejs")&&(y["User-Agent"]=this.userAgent),this.options.isRequestPay&&(0,S.default)(y,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(y["x-oss-security-token"]=this.options.stsToken),s(f.headers).to(y),r(y,"Content-Type")||(f.mime&&f.mime.indexOf("/")>0?y["Content-Type"]=f.mime:y["Content-Type"]=C.getType(f.mime||a.extname(f.object||""))),r(y,"Content-Type")||h(y,"Content-Type"),f.content&&(y["Content-Md5"]=T.createHash("md5").update(P.from(f.content,"utf8")).digest("base64"),y["Content-Length"]||(y["Content-Length"]=f.content.length));var l=this._getResource(f);y.authorization=this.authorization(f.method,l,f.subres,y);var n=this._getReqUrl(f);g("request %s %s, with headers %j, !!stream: %s",f.method,n,y,!!f.stream);var o=f.timeout||this.options.timeout,u={method:f.method,content:f.content,stream:f.stream,headers:y,timeout:o,writeStream:f.writeStream,customResponse:f.customResponse,ctx:f.ctx||this.ctx};return this.agent&&(u.agent=this.agent),this.httpsAgent&&(u.httpsAgent=this.httpsAgent),{url:n,params:u}}M.createRequest=d}).call(this,I("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(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=T(P),S=I("babel-runtime/helpers/typeof"),R=T(S);function T(g){return g&&g.__esModule?g:{default:g}}Object.defineProperty(M,"__esModule",{value:!0}),M.deepCopy=void 0,M.deepCopy=function(g){if(g===null||(typeof g=="undefined"?"undefined":(0,R.default)(g))!=="object")return g;var C=Array.isArray(g)?[]:{};return(0,m.default)(g).forEach(function(p){C[p]=M.deepCopy(g[p])}),C}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],40:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=T(P),S=I("babel-runtime/helpers/typeof"),R=T(S);function T(p){return p&&p.__esModule?p:{default:p}}Object.defineProperty(M,"__esModule",{value:!0}),M.formatObjKey=void 0;function g(p,s){if(p===null||(typeof p=="undefined"?"undefined":(0,R.default)(p))!=="object")return p;var a=void 0;if(Array.isArray(p)){a=[];for(var r=0;r<p.length;r++)a.push(g(p[r],s))}else a={},(0,m.default)(p).forEach(function(h){a[C(h,s)]=g(p[h],s)});return a}M.formatObjKey=g;function C(p,s){return s==="firstUpperCase"?p=p.replace(/^./,function(a){return a.toUpperCase()}):s==="firstLowerCase"&&(p=p.replace(/^./,function(a){return a.toLowerCase()})),p}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],41:[function(I,q,M){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.getStrBytesCount=void 0;function P(m){for(var S=0,R=0;R<m.length;R++){var T=m.charAt(R);/^[\u00-\uff]$/.test(T)?S+=1:S+=2}return S}M.getStrBytesCount=P},{}],42:[function(I,q,M){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.isArray=void 0,M.isArray=function(P){return Object.prototype.toString.call(P)==="[object Array]"}},{}],43:[function(I,q,M){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.isBlob=void 0;function P(m){return typeof Blob!="undefined"&&m instanceof Blob}M.isBlob=P},{}],44:[function(I,q,M){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.isFile=void 0,M.isFile=function(P){return typeof File!="undefined"&&P instanceof File}},{}],45:[function(I,q,M){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.isIP=void 0,M.isIP=function(P){var m=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,S=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return m.test(P)||S.test(P)}},{}],46:[function(I,q,M){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.isObject=void 0,M.isObject=function(P){return Object.prototype.toString.call(P)==="[object Object]"}},{}],47:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=S(P);function S(C){return C&&C.__esModule?C:{default:C}}Object.defineProperty(M,"__esModule",{value:!0}),M.obj2xml=void 0;var R=I("./formatObjKey");function T(C){return Object.prototype.toString.call(C).replace(/(.*? |])/g,"").toLowerCase()}function g(C,p){var s="";return p&&p.headers&&(s=`<?xml version="1.0" encoding="UTF-8"?>
`),p&&p.firstUpperCase&&(C=R.formatObjKey(C,"firstUpperCase")),T(C)==="object"?(0,m.default)(C).forEach(function(a){T(C[a])==="string"||T(C[a])==="number"?s+="<"+a+">"+C[a]+"</"+a+">":T(C[a])==="object"?s+="<"+a+">"+g(C[a])+"</"+a+">":T(C[a])==="array"?s+=C[a].map(function(r){return"<"+a+">"+g(r)+"</"+a+">"}).join(""):s+="<"+a+">"+C[a].toString()+"</"+a+">"}):s+=C.toString(),s}M.obj2xml=g},{"./formatObjKey":40,"babel-runtime/core-js/object/keys":60}],48:[function(I,q,M){q.exports=P,q.exports.HttpsAgent=P;function P(){}},{}],49:[function(I,q,M){q.exports=I("./register")().Promise},{"./register":51}],50:[function(I,q,M){"use strict";var P="@@any-promise/REGISTRATION",m=null;q.exports=function(S,R){return function(g,C){g=g||null,C=C||{};var p=C.global!==!1;if(m===null&&p&&(m=S[P]||null),m!==null&&g!==null&&m.implementation!==g)throw new Error('any-promise already defined as "'+m.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return m===null&&(g!==null&&typeof C.Promise!="undefined"?m={Promise:C.Promise,implementation:g}:m=R(g),p&&(S[P]=m)),m}}},{}],51:[function(I,q,M){"use strict";q.exports=I("./loader")(window,P);function P(){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(I,q,M){q.exports={default:I("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":77}],53:[function(I,q,M){q.exports={default:I("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":78}],54:[function(I,q,M){q.exports={default:I("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":79}],55:[function(I,q,M){q.exports={default:I("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":80}],56:[function(I,q,M){q.exports={default:I("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":81}],57:[function(I,q,M){q.exports={default:I("core-js/library/fn/object/entries"),__esModule:!0}},{"core-js/library/fn/object/entries":82}],58:[function(I,q,M){q.exports={default:I("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":83}],59:[function(I,q,M){q.exports={default:I("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":84}],60:[function(I,q,M){q.exports={default:I("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":85}],61:[function(I,q,M){q.exports={default:I("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":86}],62:[function(I,q,M){q.exports={default:I("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":87}],63:[function(I,q,M){q.exports={default:I("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":88}],64:[function(I,q,M){q.exports={default:I("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":90}],65:[function(I,q,M){q.exports={default:I("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":89}],66:[function(I,q,M){q.exports={default:I("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":91}],67:[function(I,q,M){"use strict";M.__esModule=!0;var P=I("../core-js/symbol/iterator"),m=g(P),S=I("../core-js/symbol"),R=g(S),T=typeof R.default=="function"&&typeof m.default=="symbol"?function(C){return typeof C}:function(C){return C&&typeof R.default=="function"&&C.constructor===R.default&&C!==R.default.prototype?"symbol":typeof C};function g(C){return C&&C.__esModule?C:{default:C}}M.default=typeof R.default=="function"&&T(m.default)==="symbol"?function(C){return typeof C=="undefined"?"undefined":T(C)}:function(C){return C&&typeof R.default=="function"&&C.constructor===R.default&&C!==R.default.prototype?"symbol":typeof C=="undefined"?"undefined":T(C)}},{"../core-js/symbol":64,"../core-js/symbol/iterator":66}],68:[function(I,q,M){q.exports=I("regenerator-runtime")},{"regenerator-runtime":226}],69:[function(I,q,M){"use strict";M.byteLength=p,M.toByteArray=a,M.fromByteArray=d;for(var P=[],m=[],S=typeof Uint8Array!="undefined"?Uint8Array:Array,R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=0,g=R.length;T<g;++T)P[T]=R[T],m[R.charCodeAt(T)]=T;m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63;function C(f){var E=f.length;if(E%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=f.indexOf("=");y===-1&&(y=E);var l=y===E?0:4-y%4;return[y,l]}function p(f){var E=C(f),y=E[0],l=E[1];return(y+l)*3/4-l}function s(f,E,y){return(E+y)*3/4-y}function a(f){var E,y=C(f),l=y[0],n=y[1],o=new S(s(f,l,n)),u=0,w=n>0?l-4:l,v;for(v=0;v<w;v+=4)E=m[f.charCodeAt(v)]<<18|m[f.charCodeAt(v+1)]<<12|m[f.charCodeAt(v+2)]<<6|m[f.charCodeAt(v+3)],o[u++]=E>>16&255,o[u++]=E>>8&255,o[u++]=E&255;return n===2&&(E=m[f.charCodeAt(v)]<<2|m[f.charCodeAt(v+1)]>>4,o[u++]=E&255),n===1&&(E=m[f.charCodeAt(v)]<<10|m[f.charCodeAt(v+1)]<<4|m[f.charCodeAt(v+2)]>>2,o[u++]=E>>8&255,o[u++]=E&255),o}function r(f){return P[f>>18&63]+P[f>>12&63]+P[f>>6&63]+P[f&63]}function h(f,E,y){for(var l,n=[],o=E;o<y;o+=3)l=(f[o]<<16&16711680)+(f[o+1]<<8&65280)+(f[o+2]&255),n.push(r(l));return n.join("")}function d(f){for(var E,y=f.length,l=y%3,n=[],o=16383,u=0,w=y-l;u<w;u+=o)n.push(h(f,u,u+o>w?w:u+o));return l===1?(E=f[y-1],n.push(P[E>>2]+P[E<<4&63]+"==")):l===2&&(E=(f[y-2]<<8)+f[y-1],n.push(P[E>>10]+P[E>>4&63]+P[E<<2&63]+"=")),n.join("")}},{}],70:[function(I,q,M){/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2015
*/!function(P,m,S){typeof q!="undefined"&&q.exports?q.exports=S():typeof define=="function"&&define.amd?define(m,S):P[m]=S()}(this,"bowser",function(){var P=!0;function m(s){function a(G){var U=s.match(G);return U&&U.length>1&&U[1]||""}function r(G){var U=s.match(G);return U&&U.length>1&&U[2]||""}var h=a(/(ipod|iphone|ipad)/i).toLowerCase(),d=/like android/i.test(s),f=!d&&/android/i.test(s),E=/nexus\s*[0-6]\s*/i.test(s),y=!E&&/nexus\s*[0-9]+/i.test(s),l=/CrOS/.test(s),n=/silk/i.test(s),o=/sailfish/i.test(s),u=/tizen/i.test(s),w=/(web|hpw)(o|0)s/i.test(s),v=/windows phone/i.test(s),i=/SamsungBrowser/i.test(s),k=!v&&/windows/i.test(s),D=!h&&!n&&/macintosh/i.test(s),c=!f&&!o&&!u&&!w&&/linux/i.test(s),b=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),x=a(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(s)&&!/tablet pc/i.test(s),j=!_&&/[^-]mobi/i.test(s),F=/xbox/i.test(s),L;/opera/i.test(s)?L={name:"Opera",opera:P,version:x||a(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?L={name:"Opera",opera:P,version:a(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||x}:/SamsungBrowser/i.test(s)?L={name:"Samsung Internet for Android",samsungBrowser:P,version:x||a(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(s)?L={name:"NAVER Whale browser",whale:P,version:a(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(s)?L={name:"MZ Browser",mzbrowser:P,version:a(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(s)?L={name:"Opera Coast",coast:P,version:x||a(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(s)?L={name:"Focus",focus:P,version:a(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(s)?L={name:"Yandex Browser",yandexbrowser:P,version:x||a(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?L={name:"UC Browser",ucbrowser:P,version:a(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?L={name:"Maxthon",maxthon:P,version:a(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?L={name:"Epiphany",epiphany:P,version:a(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?L={name:"Puffin",puffin:P,version:a(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?L={name:"Sleipnir",sleipnir:P,version:a(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?L={name:"K-Meleon",kMeleon:P,version:a(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:v?(L={name:"Windows Phone",osname:"Windows Phone",windowsphone:P},b?(L.msedge=P,L.version=b):(L.msie=P,L.version=a(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?L={name:"Internet Explorer",msie:P,version:a(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:l?L={name:"Chrome",osname:"Chrome OS",chromeos:P,chromeBook:P,chrome:P,version:a(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(s)?L={name:"Microsoft Edge",msedge:P,version:b}:/vivaldi/i.test(s)?L={name:"Vivaldi",vivaldi:P,version:a(/vivaldi\/(\d+(\.\d+)?)/i)||x}:o?L={name:"Sailfish",osname:"Sailfish OS",sailfish:P,version:a(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?L={name:"SeaMonkey",seamonkey:P,version:a(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(L={name:"Firefox",firefox:P,version:a(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(L.firefoxos=P,L.osname="Firefox OS")):n?L={name:"Amazon Silk",silk:P,version:a(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?L={name:"PhantomJS",phantom:P,version:a(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?L={name:"SlimerJS",slimer:P,version:a(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(s)||/rim\stablet/i.test(s)?L={name:"BlackBerry",osname:"BlackBerry OS",blackberry:P,version:x||a(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:w?(L={name:"WebOS",osname:"WebOS",webos:P,version:x||a(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(s)&&(L.touchpad=P)):/bada/i.test(s)?L={name:"Bada",osname:"Bada",bada:P,version:a(/dolfin\/(\d+(\.\d+)?)/i)}:u?L={name:"Tizen",osname:"Tizen",tizen:P,version:a(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||x}:/qupzilla/i.test(s)?L={name:"QupZilla",qupzilla:P,version:a(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||x}:/chromium/i.test(s)?L={name:"Chromium",chromium:P,version:a(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||x}:/chrome|crios|crmo/i.test(s)?L={name:"Chrome",chrome:P,version:a(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:f?L={name:"Android",version:x}:/safari|applewebkit/i.test(s)?(L={name:"Safari",safari:P},x&&(L.version=x)):h?(L={name:h=="iphone"?"iPhone":h=="ipad"?"iPad":"iPod"},x&&(L.version=x)):/googlebot/i.test(s)?L={name:"Googlebot",googlebot:P,version:a(/googlebot\/(\d+(\.\d+))/i)||x}:L={name:a(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!L.msedge&&/(apple)?webkit/i.test(s)?(/(apple)?webkit\/537\.36/i.test(s)?(L.name=L.name||"Blink",L.blink=P):(L.name=L.name||"Webkit",L.webkit=P),!L.version&&x&&(L.version=x)):!L.opera&&/gecko\//i.test(s)&&(L.name=L.name||"Gecko",L.gecko=P,L.version=L.version||a(/gecko\/(\d+(\.\d+)?)/i)),!L.windowsphone&&(f||L.silk)?(L.android=P,L.osname="Android"):!L.windowsphone&&h?(L[h]=P,L.ios=P,L.osname="iOS"):D?(L.mac=P,L.osname="macOS"):F?(L.xbox=P,L.osname="Xbox"):k?(L.windows=P,L.osname="Windows"):c&&(L.linux=P,L.osname="Linux");function X(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="";L.windows?z=X(a(/Windows ((NT|XP)( \d\d?.\d)?)/i)):L.windowsphone?z=a(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):L.mac?(z=a(/Mac OS X (\d+([_\.\s]\d+)*)/i),z=z.replace(/[_\s]/g,".")):h?(z=a(/os (\d+([_\s]\d+)*) like mac os x/i),z=z.replace(/[_\s]/g,".")):f?z=a(/android[ \/-](\d+(\.\d+)*)/i):L.webos?z=a(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):L.blackberry?z=a(/rim\stablet\sos\s(\d+(\.\d+)*)/i):L.bada?z=a(/bada\/(\d+(\.\d+)*)/i):L.tizen&&(z=a(/tizen[\/\s](\d+(\.\d+)*)/i)),z&&(L.osversion=z);var H=!L.windows&&z.split(".")[0];return _||y||h=="ipad"||f&&(H==3||H>=4&&!j)||L.silk?L.tablet=P:(j||h=="iphone"||h=="ipod"||f||E||L.blackberry||L.webos||L.bada)&&(L.mobile=P),L.msedge||L.msie&&L.version>=10||L.yandexbrowser&&L.version>=15||L.vivaldi&&L.version>=1||L.chrome&&L.version>=20||L.samsungBrowser&&L.version>=4||L.whale&&g([L.version,"1.0"])===1||L.mzbrowser&&g([L.version,"6.0"])===1||L.focus&&g([L.version,"1.0"])===1||L.firefox&&L.version>=20||L.safari&&L.version>=6||L.opera&&L.version>=10||L.ios&&L.osversion&&L.osversion.split(".")[0]>=6||L.blackberry&&L.version>=10.1||L.chromium&&L.version>=20?L.a=P:L.msie&&L.version<10||L.chrome&&L.version<20||L.firefox&&L.version<20||L.safari&&L.version<6||L.opera&&L.version<10||L.ios&&L.osversion&&L.osversion.split(".")[0]<6||L.chromium&&L.version<20?L.c=P:L.x=P,L}var S=m(typeof navigator!="undefined"&&navigator.userAgent||"");S.test=function(s){for(var a=0;a<s.length;++a){var r=s[a];if(typeof r=="string"&&r in S)return!0}return!1};function R(s){return s.split(".").length}function T(s,a){var r=[],h;if(Array.prototype.map)return Array.prototype.map.call(s,a);for(h=0;h<s.length;h++)r.push(a(s[h]));return r}function g(s){for(var a=Math.max(R(s[0]),R(s[1])),r=T(s,function(h){var d=a-R(h);return h=h+new Array(d+1).join(".0"),T(h.split("."),function(f){return new Array(20-f.length).join("0")+f}).reverse()});--a>=0;){if(r[0][a]>r[1][a])return 1;if(r[0][a]===r[1][a]){if(a===0)return 0}else return-1}}function C(s,a,r){var h=S;typeof a=="string"&&(r=a,a=void 0),a===void 0&&(a=!1),r&&(h=m(r));var d=""+h.version;for(var f in s)if(s.hasOwnProperty(f)&&h[f]){if(typeof s[f]!="string")throw new Error("Browser version in the minVersion map should be a string: "+f+": "+String(s));return g([d,s[f]])<0}return a}function p(s,a,r){return!C(s,a,r)}return S.isUnsupportedBrowser=C,S.compareVersions=g,S.check=p,S._detect=m,S.detect=m,S})},{}],71:[function(I,q,M){},{}],72:[function(I,q,M){var P=I("buffer").Buffer,m=P.isEncoding||function(p){switch(p&&p.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function S(p){if(p&&!m(p))throw new Error("Unknown encoding: "+p)}var R=M.StringDecoder=function(p){this.encoding=(p||"utf8").toLowerCase().replace(/[-_]/,""),S(p);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=g;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=C;break;default:this.write=T;return}this.charBuffer=new P(6),this.charReceived=0,this.charLength=0};R.prototype.write=function(p){for(var s="";this.charLength;){var a=p.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:p.length;if(p.copy(this.charBuffer,this.charReceived,0,a),this.charReceived+=a,this.charReceived<this.charLength)return"";p=p.slice(a,p.length),s=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var h=s.charCodeAt(s.length-1);if(h>=55296&&h<=56319){this.charLength+=this.surrogateSize,s="";continue}if(this.charReceived=this.charLength=0,p.length===0)return s;break}this.detectIncompleteChar(p);var r=p.length;this.charLength&&(p.copy(this.charBuffer,0,p.length-this.charReceived,r),r-=this.charReceived),s+=p.toString(this.encoding,0,r);var r=s.length-1,h=s.charCodeAt(r);if(h>=55296&&h<=56319){var d=this.surrogateSize;return this.charLength+=d,this.charReceived+=d,this.charBuffer.copy(this.charBuffer,d,0,d),p.copy(this.charBuffer,0,0,d),s.substring(0,r)}return s},R.prototype.detectIncompleteChar=function(p){for(var s=p.length>=3?3:p.length;s>0;s--){var a=p[p.length-s];if(s==1&&a>>5==6){this.charLength=2;break}if(s<=2&&a>>4==14){this.charLength=3;break}if(s<=3&&a>>3==30){this.charLength=4;break}}this.charReceived=s},R.prototype.end=function(p){var s="";if(p&&p.length&&(s=this.write(p)),this.charReceived){var a=this.charReceived,r=this.charBuffer,h=this.encoding;s+=r.slice(0,a).toString(h)}return s};function T(p){return p.toString(this.encoding)}function g(p){this.charReceived=p.length%2,this.charLength=this.charReceived?2:0}function C(p){this.charReceived=p.length%3,this.charLength=this.charReceived?3:0}},{buffer:73}],73:[function(I,q,M){(function(P,m){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/"use strict";var S=I("base64-js"),R=I("ieee754"),T=I("isarray");M.Buffer=m,M.SlowBuffer=n,M.INSPECT_MAX_BYTES=50,m.TYPED_ARRAY_SUPPORT=P.TYPED_ARRAY_SUPPORT!==void 0?P.TYPED_ARRAY_SUPPORT:g(),M.kMaxLength=C();function g(){try{var ne=new Uint8Array(1);return ne.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},ne.foo()===42&&typeof ne.subarray=="function"&&ne.subarray(1,1).byteLength===0}catch(J){return!1}}function C(){return m.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function p(ne,J){if(C()<J)throw new RangeError("Invalid typed array length");return m.TYPED_ARRAY_SUPPORT?(ne=new Uint8Array(J),ne.__proto__=m.prototype):(ne===null&&(ne=new m(J)),ne.length=J),ne}function m(ne,J,V){if(!m.TYPED_ARRAY_SUPPORT&&!(this instanceof m))return new m(ne,J,V);if(typeof ne=="number"){if(typeof J=="string")throw new Error("If encoding is specified then the first argument must be a string");return h(this,ne)}return s(this,ne,J,V)}m.poolSize=8192,m._augment=function(ne){return ne.__proto__=m.prototype,ne};function s(ne,J,V,Z){if(typeof J=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&J instanceof ArrayBuffer?E(ne,J,V,Z):typeof J=="string"?d(ne,J,V):y(ne,J)}m.from=function(ne,J,V){return s(null,ne,J,V)},m.TYPED_ARRAY_SUPPORT&&(m.prototype.__proto__=Uint8Array.prototype,m.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&m[Symbol.species]===m&&Object.defineProperty(m,Symbol.species,{value:null,configurable:!0}));function a(ne){if(typeof ne!="number")throw new TypeError('"size" argument must be a number');if(ne<0)throw new RangeError('"size" argument must not be negative')}function r(ne,J,V,Z){return a(J),J<=0?p(ne,J):V!==void 0?typeof Z=="string"?p(ne,J).fill(V,Z):p(ne,J).fill(V):p(ne,J)}m.alloc=function(ne,J,V){return r(null,ne,J,V)};function h(ne,J){if(a(J),ne=p(ne,J<0?0:l(J)|0),!m.TYPED_ARRAY_SUPPORT)for(var V=0;V<J;++V)ne[V]=0;return ne}m.allocUnsafe=function(ne){return h(null,ne)},m.allocUnsafeSlow=function(ne){return h(null,ne)};function d(ne,J,V){if((typeof V!="string"||V==="")&&(V="utf8"),!m.isEncoding(V))throw new TypeError('"encoding" must be a valid string encoding');var Z=o(J,V)|0;ne=p(ne,Z);var Ee=ne.write(J,V);return Ee!==Z&&(ne=ne.slice(0,Ee)),ne}function f(ne,J){var V=J.length<0?0:l(J.length)|0;ne=p(ne,V);for(var Z=0;Z<V;Z+=1)ne[Z]=J[Z]&255;return ne}function E(ne,J,V,Z){if(J.byteLength,V<0||J.byteLength<V)throw new RangeError("'offset' is out of bounds");if(J.byteLength<V+(Z||0))throw new RangeError("'length' is out of bounds");return V===void 0&&Z===void 0?J=new Uint8Array(J):Z===void 0?J=new Uint8Array(J,V):J=new Uint8Array(J,V,Z),m.TYPED_ARRAY_SUPPORT?(ne=J,ne.__proto__=m.prototype):ne=f(ne,J),ne}function y(ne,J){if(m.isBuffer(J)){var V=l(J.length)|0;return ne=p(ne,V),ne.length===0||J.copy(ne,0,0,V),ne}if(J){if(typeof ArrayBuffer!="undefined"&&J.buffer instanceof ArrayBuffer||"length"in J)return typeof J.length!="number"||we(J.length)?p(ne,0):f(ne,J);if(J.type==="Buffer"&&T(J.data))return f(ne,J.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function l(ne){if(ne>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return ne|0}function n(ne){return+ne!=ne&&(ne=0),m.alloc(+ne)}m.isBuffer=function(J){return!!(J!=null&&J._isBuffer)},m.compare=function(J,V){if(!m.isBuffer(J)||!m.isBuffer(V))throw new TypeError("Arguments must be Buffers");if(J===V)return 0;for(var Z=J.length,Ee=V.length,xe=0,_e=Math.min(Z,Ee);xe<_e;++xe)if(J[xe]!==V[xe]){Z=J[xe],Ee=V[xe];break}return Z<Ee?-1:Ee<Z?1:0},m.isEncoding=function(J){switch(String(J).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}},m.concat=function(J,V){if(!T(J))throw new TypeError('"list" argument must be an Array of Buffers');if(J.length===0)return m.alloc(0);var Z;if(V===void 0)for(V=0,Z=0;Z<J.length;++Z)V+=J[Z].length;var Ee=m.allocUnsafe(V),xe=0;for(Z=0;Z<J.length;++Z){var _e=J[Z];if(!m.isBuffer(_e))throw new TypeError('"list" argument must be an Array of Buffers');_e.copy(Ee,xe),xe+=_e.length}return Ee};function o(ne,J){if(m.isBuffer(ne))return ne.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(ne)||ne instanceof ArrayBuffer))return ne.byteLength;typeof ne!="string"&&(ne=""+ne);var V=ne.length;if(V===0)return 0;for(var Z=!1;;)switch(J){case"ascii":case"latin1":case"binary":return V;case"utf8":case"utf-8":case void 0:return ae(ne).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V*2;case"hex":return V>>>1;case"base64":return Q(ne).length;default:if(Z)return ae(ne).length;J=(""+J).toLowerCase(),Z=!0}}m.byteLength=o;function u(ne,J,V){var Z=!1;if((J===void 0||J<0)&&(J=0),J>this.length)return"";if((V===void 0||V>this.length)&&(V=this.length),V<=0)return"";if(V>>>=0,J>>>=0,V<=J)return"";for(ne||(ne="utf8");;)switch(ne){case"hex":return G(this,J,V);case"utf8":case"utf-8":return F(this,J,V);case"ascii":return z(this,J,V);case"latin1":case"binary":return H(this,J,V);case"base64":return j(this,J,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,J,V);default:if(Z)throw new TypeError("Unknown encoding: "+ne);ne=(ne+"").toLowerCase(),Z=!0}}m.prototype._isBuffer=!0;function w(ne,J,V){var Z=ne[J];ne[J]=ne[V],ne[V]=Z}m.prototype.swap16=function(){var J=this.length;if(J%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var V=0;V<J;V+=2)w(this,V,V+1);return this},m.prototype.swap32=function(){var J=this.length;if(J%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var V=0;V<J;V+=4)w(this,V,V+3),w(this,V+1,V+2);return this},m.prototype.swap64=function(){var J=this.length;if(J%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var V=0;V<J;V+=8)w(this,V,V+7),w(this,V+1,V+6),w(this,V+2,V+5),w(this,V+3,V+4);return this},m.prototype.toString=function(){var J=this.length|0;return J===0?"":arguments.length===0?F(this,0,J):u.apply(this,arguments)},m.prototype.equals=function(J){if(!m.isBuffer(J))throw new TypeError("Argument must be a Buffer");return this===J?!0:m.compare(this,J)===0},m.prototype.inspect=function(){var J="",V=M.INSPECT_MAX_BYTES;return this.length>0&&(J=this.toString("hex",0,V).match(/.{2}/g).join(" "),this.length>V&&(J+=" ... ")),"<Buffer "+J+">"},m.prototype.compare=function(J,V,Z,Ee,xe){if(!m.isBuffer(J))throw new TypeError("Argument must be a Buffer");if(V===void 0&&(V=0),Z===void 0&&(Z=J?J.length:0),Ee===void 0&&(Ee=0),xe===void 0&&(xe=this.length),V<0||Z>J.length||Ee<0||xe>this.length)throw new RangeError("out of range index");if(Ee>=xe&&V>=Z)return 0;if(Ee>=xe)return-1;if(V>=Z)return 1;if(V>>>=0,Z>>>=0,Ee>>>=0,xe>>>=0,this===J)return 0;for(var _e=xe-Ee,Ne=Z-V,Be=Math.min(_e,Ne),We=this.slice(Ee,xe),Ue=J.slice(V,Z),ze=0;ze<Be;++ze)if(We[ze]!==Ue[ze]){_e=We[ze],Ne=Ue[ze];break}return _e<Ne?-1:Ne<_e?1:0};function v(ne,J,V,Z,Ee){if(ne.length===0)return-1;if(typeof V=="string"?(Z=V,V=0):V>2147483647?V=2147483647:V<-2147483648&&(V=-2147483648),V=+V,isNaN(V)&&(V=Ee?0:ne.length-1),V<0&&(V=ne.length+V),V>=ne.length){if(Ee)return-1;V=ne.length-1}else if(V<0)if(Ee)V=0;else return-1;if(typeof J=="string"&&(J=m.from(J,Z)),m.isBuffer(J))return J.length===0?-1:i(ne,J,V,Z,Ee);if(typeof J=="number")return J=J&255,m.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Ee?Uint8Array.prototype.indexOf.call(ne,J,V):Uint8Array.prototype.lastIndexOf.call(ne,J,V):i(ne,[J],V,Z,Ee);throw new TypeError("val must be string, number or Buffer")}function i(ne,J,V,Z,Ee){var xe=1,_e=ne.length,Ne=J.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(ne.length<2||J.length<2)return-1;xe=2,_e/=2,Ne/=2,V/=2}function Be(Ye,Re){return xe===1?Ye[Re]:Ye.readUInt16BE(Re*xe)}var We;if(Ee){var Ue=-1;for(We=V;We<_e;We++)if(Be(ne,We)===Be(J,Ue===-1?0:We-Ue)){if(Ue===-1&&(Ue=We),We-Ue+1===Ne)return Ue*xe}else Ue!==-1&&(We-=We-Ue),Ue=-1}else for(V+Ne>_e&&(V=_e-Ne),We=V;We>=0;We--){for(var ze=!0,Ke=0;Ke<Ne;Ke++)if(Be(ne,We+Ke)!==Be(J,Ke)){ze=!1;break}if(ze)return We}return-1}m.prototype.includes=function(J,V,Z){return this.indexOf(J,V,Z)!==-1},m.prototype.indexOf=function(J,V,Z){return v(this,J,V,Z,!0)},m.prototype.lastIndexOf=function(J,V,Z){return v(this,J,V,Z,!1)};function k(ne,J,V,Z){V=Number(V)||0;var Ee=ne.length-V;Z?(Z=Number(Z),Z>Ee&&(Z=Ee)):Z=Ee;var xe=J.length;if(xe%2!==0)throw new TypeError("Invalid hex string");Z>xe/2&&(Z=xe/2);for(var _e=0;_e<Z;++_e){var Ne=parseInt(J.substr(_e*2,2),16);if(isNaN(Ne))return _e;ne[V+_e]=Ne}return _e}function D(ne,J,V,Z){return ie(ae(J,ne.length-V),ne,V,Z)}function c(ne,J,V,Z){return ie(re(J),ne,V,Z)}function b(ne,J,V,Z){return c(ne,J,V,Z)}function x(ne,J,V,Z){return ie(Q(J),ne,V,Z)}function _(ne,J,V,Z){return ie(he(J,ne.length-V),ne,V,Z)}m.prototype.write=function(J,V,Z,Ee){if(V===void 0)Ee="utf8",Z=this.length,V=0;else if(Z===void 0&&typeof V=="string")Ee=V,Z=this.length,V=0;else if(isFinite(V))V=V|0,isFinite(Z)?(Z=Z|0,Ee===void 0&&(Ee="utf8")):(Ee=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var xe=this.length-V;if((Z===void 0||Z>xe)&&(Z=xe),J.length>0&&(Z<0||V<0)||V>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ee||(Ee="utf8");for(var _e=!1;;)switch(Ee){case"hex":return k(this,J,V,Z);case"utf8":case"utf-8":return D(this,J,V,Z);case"ascii":return c(this,J,V,Z);case"latin1":case"binary":return b(this,J,V,Z);case"base64":return x(this,J,V,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,J,V,Z);default:if(_e)throw new TypeError("Unknown encoding: "+Ee);Ee=(""+Ee).toLowerCase(),_e=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(ne,J,V){return J===0&&V===ne.length?S.fromByteArray(ne):S.fromByteArray(ne.slice(J,V))}function F(ne,J,V){V=Math.min(ne.length,V);for(var Z=[],Ee=J;Ee<V;){var xe=ne[Ee],_e=null,Ne=xe>239?4:xe>223?3:xe>191?2:1;if(Ee+Ne<=V){var Be,We,Ue,ze;switch(Ne){case 1:xe<128&&(_e=xe);break;case 2:Be=ne[Ee+1],(Be&192)===128&&(ze=(xe&31)<<6|Be&63,ze>127&&(_e=ze));break;case 3:Be=ne[Ee+1],We=ne[Ee+2],(Be&192)===128&&(We&192)===128&&(ze=(xe&15)<<12|(Be&63)<<6|We&63,ze>2047&&(ze<55296||ze>57343)&&(_e=ze));break;case 4:Be=ne[Ee+1],We=ne[Ee+2],Ue=ne[Ee+3],(Be&192)===128&&(We&192)===128&&(Ue&192)===128&&(ze=(xe&15)<<18|(Be&63)<<12|(We&63)<<6|Ue&63,ze>65535&&ze<1114112&&(_e=ze))}}_e===null?(_e=65533,Ne=1):_e>65535&&(_e-=65536,Z.push(_e>>>10&1023|55296),_e=56320|_e&1023),Z.push(_e),Ee+=Ne}return X(Z)}var L=4096;function X(ne){var J=ne.length;if(J<=L)return String.fromCharCode.apply(String,ne);for(var V="",Z=0;Z<J;)V+=String.fromCharCode.apply(String,ne.slice(Z,Z+=L));return V}function z(ne,J,V){var Z="";V=Math.min(ne.length,V);for(var Ee=J;Ee<V;++Ee)Z+=String.fromCharCode(ne[Ee]&127);return Z}function H(ne,J,V){var Z="";V=Math.min(ne.length,V);for(var Ee=J;Ee<V;++Ee)Z+=String.fromCharCode(ne[Ee]);return Z}function G(ne,J,V){var Z=ne.length;(!J||J<0)&&(J=0),(!V||V<0||V>Z)&&(V=Z);for(var Ee="",xe=J;xe<V;++xe)Ee+=oe(ne[xe]);return Ee}function U(ne,J,V){for(var Z=ne.slice(J,V),Ee="",xe=0;xe<Z.length;xe+=2)Ee+=String.fromCharCode(Z[xe]+Z[xe+1]*256);return Ee}m.prototype.slice=function(J,V){var Z=this.length;J=~~J,V=V===void 0?Z:~~V,J<0?(J+=Z,J<0&&(J=0)):J>Z&&(J=Z),V<0?(V+=Z,V<0&&(V=0)):V>Z&&(V=Z),V<J&&(V=J);var Ee;if(m.TYPED_ARRAY_SUPPORT)Ee=this.subarray(J,V),Ee.__proto__=m.prototype;else{var xe=V-J;Ee=new m(xe,void 0);for(var _e=0;_e<xe;++_e)Ee[_e]=this[_e+J]}return Ee};function B(ne,J,V){if(ne%1!==0||ne<0)throw new RangeError("offset is not uint");if(ne+J>V)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUIntLE=function(J,V,Z){J=J|0,V=V|0,Z||B(J,V,this.length);for(var Ee=this[J],xe=1,_e=0;++_e<V&&(xe*=256);)Ee+=this[J+_e]*xe;return Ee},m.prototype.readUIntBE=function(J,V,Z){J=J|0,V=V|0,Z||B(J,V,this.length);for(var Ee=this[J+--V],xe=1;V>0&&(xe*=256);)Ee+=this[J+--V]*xe;return Ee},m.prototype.readUInt8=function(J,V){return V||B(J,1,this.length),this[J]},m.prototype.readUInt16LE=function(J,V){return V||B(J,2,this.length),this[J]|this[J+1]<<8},m.prototype.readUInt16BE=function(J,V){return V||B(J,2,this.length),this[J]<<8|this[J+1]},m.prototype.readUInt32LE=function(J,V){return V||B(J,4,this.length),(this[J]|this[J+1]<<8|this[J+2]<<16)+this[J+3]*16777216},m.prototype.readUInt32BE=function(J,V){return V||B(J,4,this.length),this[J]*16777216+(this[J+1]<<16|this[J+2]<<8|this[J+3])},m.prototype.readIntLE=function(J,V,Z){J=J|0,V=V|0,Z||B(J,V,this.length);for(var Ee=this[J],xe=1,_e=0;++_e<V&&(xe*=256);)Ee+=this[J+_e]*xe;return xe*=128,Ee>=xe&&(Ee-=Math.pow(2,8*V)),Ee},m.prototype.readIntBE=function(J,V,Z){J=J|0,V=V|0,Z||B(J,V,this.length);for(var Ee=V,xe=1,_e=this[J+--Ee];Ee>0&&(xe*=256);)_e+=this[J+--Ee]*xe;return xe*=128,_e>=xe&&(_e-=Math.pow(2,8*V)),_e},m.prototype.readInt8=function(J,V){return V||B(J,1,this.length),this[J]&128?(255-this[J]+1)*-1:this[J]},m.prototype.readInt16LE=function(J,V){V||B(J,2,this.length);var Z=this[J]|this[J+1]<<8;return Z&32768?Z|4294901760:Z},m.prototype.readInt16BE=function(J,V){V||B(J,2,this.length);var Z=this[J+1]|this[J]<<8;return Z&32768?Z|4294901760:Z},m.prototype.readInt32LE=function(J,V){return V||B(J,4,this.length),this[J]|this[J+1]<<8|this[J+2]<<16|this[J+3]<<24},m.prototype.readInt32BE=function(J,V){return V||B(J,4,this.length),this[J]<<24|this[J+1]<<16|this[J+2]<<8|this[J+3]},m.prototype.readFloatLE=function(J,V){return V||B(J,4,this.length),R.read(this,J,!0,23,4)},m.prototype.readFloatBE=function(J,V){return V||B(J,4,this.length),R.read(this,J,!1,23,4)},m.prototype.readDoubleLE=function(J,V){return V||B(J,8,this.length),R.read(this,J,!0,52,8)},m.prototype.readDoubleBE=function(J,V){return V||B(J,8,this.length),R.read(this,J,!1,52,8)};function W(ne,J,V,Z,Ee,xe){if(!m.isBuffer(ne))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>Ee||J<xe)throw new RangeError('"value" argument is out of bounds');if(V+Z>ne.length)throw new RangeError("Index out of range")}m.prototype.writeUIntLE=function(J,V,Z,Ee){if(J=+J,V=V|0,Z=Z|0,!Ee){var xe=Math.pow(2,8*Z)-1;W(this,J,V,Z,xe,0)}var _e=1,Ne=0;for(this[V]=J&255;++Ne<Z&&(_e*=256);)this[V+Ne]=J/_e&255;return V+Z},m.prototype.writeUIntBE=function(J,V,Z,Ee){if(J=+J,V=V|0,Z=Z|0,!Ee){var xe=Math.pow(2,8*Z)-1;W(this,J,V,Z,xe,0)}var _e=Z-1,Ne=1;for(this[V+_e]=J&255;--_e>=0&&(Ne*=256);)this[V+_e]=J/Ne&255;return V+Z},m.prototype.writeUInt8=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,1,255,0),m.TYPED_ARRAY_SUPPORT||(J=Math.floor(J)),this[V]=J&255,V+1};function te(ne,J,V,Z){J<0&&(J=65535+J+1);for(var Ee=0,xe=Math.min(ne.length-V,2);Ee<xe;++Ee)ne[V+Ee]=(J&255<<8*(Z?Ee:1-Ee))>>>(Z?Ee:1-Ee)*8}m.prototype.writeUInt16LE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,2,65535,0),m.TYPED_ARRAY_SUPPORT?(this[V]=J&255,this[V+1]=J>>>8):te(this,J,V,!0),V+2},m.prototype.writeUInt16BE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,2,65535,0),m.TYPED_ARRAY_SUPPORT?(this[V]=J>>>8,this[V+1]=J&255):te(this,J,V,!1),V+2};function de(ne,J,V,Z){J<0&&(J=4294967295+J+1);for(var Ee=0,xe=Math.min(ne.length-V,4);Ee<xe;++Ee)ne[V+Ee]=J>>>(Z?Ee:3-Ee)*8&255}m.prototype.writeUInt32LE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,4,4294967295,0),m.TYPED_ARRAY_SUPPORT?(this[V+3]=J>>>24,this[V+2]=J>>>16,this[V+1]=J>>>8,this[V]=J&255):de(this,J,V,!0),V+4},m.prototype.writeUInt32BE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,4,4294967295,0),m.TYPED_ARRAY_SUPPORT?(this[V]=J>>>24,this[V+1]=J>>>16,this[V+2]=J>>>8,this[V+3]=J&255):de(this,J,V,!1),V+4},m.prototype.writeIntLE=function(J,V,Z,Ee){if(J=+J,V=V|0,!Ee){var xe=Math.pow(2,8*Z-1);W(this,J,V,Z,xe-1,-xe)}var _e=0,Ne=1,Be=0;for(this[V]=J&255;++_e<Z&&(Ne*=256);)J<0&&Be===0&&this[V+_e-1]!==0&&(Be=1),this[V+_e]=(J/Ne>>0)-Be&255;return V+Z},m.prototype.writeIntBE=function(J,V,Z,Ee){if(J=+J,V=V|0,!Ee){var xe=Math.pow(2,8*Z-1);W(this,J,V,Z,xe-1,-xe)}var _e=Z-1,Ne=1,Be=0;for(this[V+_e]=J&255;--_e>=0&&(Ne*=256);)J<0&&Be===0&&this[V+_e+1]!==0&&(Be=1),this[V+_e]=(J/Ne>>0)-Be&255;return V+Z},m.prototype.writeInt8=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,1,127,-128),m.TYPED_ARRAY_SUPPORT||(J=Math.floor(J)),J<0&&(J=255+J+1),this[V]=J&255,V+1},m.prototype.writeInt16LE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,2,32767,-32768),m.TYPED_ARRAY_SUPPORT?(this[V]=J&255,this[V+1]=J>>>8):te(this,J,V,!0),V+2},m.prototype.writeInt16BE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,2,32767,-32768),m.TYPED_ARRAY_SUPPORT?(this[V]=J>>>8,this[V+1]=J&255):te(this,J,V,!1),V+2},m.prototype.writeInt32LE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,4,2147483647,-2147483648),m.TYPED_ARRAY_SUPPORT?(this[V]=J&255,this[V+1]=J>>>8,this[V+2]=J>>>16,this[V+3]=J>>>24):de(this,J,V,!0),V+4},m.prototype.writeInt32BE=function(J,V,Z){return J=+J,V=V|0,Z||W(this,J,V,4,2147483647,-2147483648),J<0&&(J=4294967295+J+1),m.TYPED_ARRAY_SUPPORT?(this[V]=J>>>24,this[V+1]=J>>>16,this[V+2]=J>>>8,this[V+3]=J&255):de(this,J,V,!1),V+4};function fe(ne,J,V,Z,Ee,xe){if(V+Z>ne.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("Index out of range")}function be(ne,J,V,Z,Ee){return Ee||fe(ne,J,V,4,34028234663852886e22,-34028234663852886e22),R.write(ne,J,V,Z,23,4),V+4}m.prototype.writeFloatLE=function(J,V,Z){return be(this,J,V,!0,Z)},m.prototype.writeFloatBE=function(J,V,Z){return be(this,J,V,!1,Z)};function Ce(ne,J,V,Z,Ee){return Ee||fe(ne,J,V,8,17976931348623157e292,-17976931348623157e292),R.write(ne,J,V,Z,52,8),V+8}m.prototype.writeDoubleLE=function(J,V,Z){return Ce(this,J,V,!0,Z)},m.prototype.writeDoubleBE=function(J,V,Z){return Ce(this,J,V,!1,Z)},m.prototype.copy=function(J,V,Z,Ee){if(Z||(Z=0),!Ee&&Ee!==0&&(Ee=this.length),V>=J.length&&(V=J.length),V||(V=0),Ee>0&&Ee<Z&&(Ee=Z),Ee===Z)return 0;if(J.length===0||this.length===0)return 0;if(V<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("sourceStart out of bounds");if(Ee<0)throw new RangeError("sourceEnd out of bounds");Ee>this.length&&(Ee=this.length),J.length-V<Ee-Z&&(Ee=J.length-V+Z);var xe=Ee-Z,_e;if(this===J&&Z<V&&V<Ee)for(_e=xe-1;_e>=0;--_e)J[_e+V]=this[_e+Z];else if(xe<1e3||!m.TYPED_ARRAY_SUPPORT)for(_e=0;_e<xe;++_e)J[_e+V]=this[_e+Z];else Uint8Array.prototype.set.call(J,this.subarray(Z,Z+xe),V);return xe},m.prototype.fill=function(J,V,Z,Ee){if(typeof J=="string"){if(typeof V=="string"?(Ee=V,V=0,Z=this.length):typeof Z=="string"&&(Ee=Z,Z=this.length),J.length===1){var xe=J.charCodeAt(0);xe<256&&(J=xe)}if(Ee!==void 0&&typeof Ee!="string")throw new TypeError("encoding must be a string");if(typeof Ee=="string"&&!m.isEncoding(Ee))throw new TypeError("Unknown encoding: "+Ee)}else typeof J=="number"&&(J=J&255);if(V<0||this.length<V||this.length<Z)throw new RangeError("Out of range index");if(Z<=V)return this;V=V>>>0,Z=Z===void 0?this.length:Z>>>0,J||(J=0);var _e;if(typeof J=="number")for(_e=V;_e<Z;++_e)this[_e]=J;else{var Ne=m.isBuffer(J)?J:ae(new m(J,Ee).toString()),Be=Ne.length;for(_e=0;_e<Z-V;++_e)this[_e+V]=Ne[_e%Be]}return this};var ue=/[^+\/0-9A-Za-z-_]/g;function ge(ne){if(ne=pe(ne).replace(ue,""),ne.length<2)return"";for(;ne.length%4!==0;)ne=ne+"=";return ne}function pe(ne){return ne.trim?ne.trim():ne.replace(/^\s+|\s+$/g,"")}function oe(ne){return ne<16?"0"+ne.toString(16):ne.toString(16)}function ae(ne,J){J=J||Infinity;for(var V,Z=ne.length,Ee=null,xe=[],_e=0;_e<Z;++_e){if(V=ne.charCodeAt(_e),V>55295&&V<57344){if(!Ee){if(V>56319){(J-=3)>-1&&xe.push(239,191,189);continue}else if(_e+1===Z){(J-=3)>-1&&xe.push(239,191,189);continue}Ee=V;continue}if(V<56320){(J-=3)>-1&&xe.push(239,191,189),Ee=V;continue}V=(Ee-55296<<10|V-56320)+65536}else Ee&&((J-=3)>-1&&xe.push(239,191,189));if(Ee=null,V<128){if((J-=1)<0)break;xe.push(V)}else if(V<2048){if((J-=2)<0)break;xe.push(V>>6|192,V&63|128)}else if(V<65536){if((J-=3)<0)break;xe.push(V>>12|224,V>>6&63|128,V&63|128)}else if(V<1114112){if((J-=4)<0)break;xe.push(V>>18|240,V>>12&63|128,V>>6&63|128,V&63|128)}else throw new Error("Invalid code point")}return xe}function re(ne){for(var J=[],V=0;V<ne.length;++V)J.push(ne.charCodeAt(V)&255);return J}function he(ne,J){for(var V,Z,Ee,xe=[],_e=0;_e<ne.length&&!((J-=2)<0);++_e)V=ne.charCodeAt(_e),Z=V>>8,Ee=V%256,xe.push(Ee),xe.push(Z);return xe}function Q(ne){return S.toByteArray(ge(ne))}function ie(ne,J,V,Z){for(var Ee=0;Ee<Z&&!(Ee+V>=J.length||Ee>=ne.length);++Ee)J[Ee+V]=ne[Ee];return Ee}function we(ne){return ne!==ne}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},I("buffer").Buffer)},{"base64-js":69,buffer:73,ieee754:195,isarray:198}],74:[function(I,q,M){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(I,q,M){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(I,q,M){/*!
* copy-to - index.js
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
* MIT Licensed
*/"use strict";var P=Array.prototype.slice;q.exports=m;function m(R,T){if(!(this instanceof m))return new m(R,T);this.src=R,this._withAccess=T}m.prototype.withAccess=function(R){return this._withAccess=R!==!1,this},m.prototype.pick=function(R){return Array.isArray(R)||(R=P.call(arguments)),R.length&&(this.keys=R),this},m.prototype.to=function(R){if(R=R||{},!this.src)return R;var T=this.keys||Object.keys(this.src);if(!this._withAccess){for(var g=0;g<T.length;g++){if(C=T[g],R[C]!==void 0)continue;R[C]=this.src[C]}return R}for(var g=0;g<T.length;g++){var C=T[g];if(!S(R,C))continue;var p=this.src.__lookupGetter__(C),s=this.src.__lookupSetter__(C);p&&R.__defineGetter__(C,p),s&&R.__defineSetter__(C,s),!p&&!s&&(R[C]=this.src[C])}return R},m.prototype.toCover=function(R){for(var T=this.keys||Object.keys(this.src),g=0;g<T.length;g++){var C=T[g];delete R[C];var p=this.src.__lookupGetter__(C),s=this.src.__lookupSetter__(C);p&&R.__defineGetter__(C,p),s&&R.__defineSetter__(C,s),!p&&!s&&(R[C]=this.src[C])}},m.prototype.override=m.prototype.toCover,m.prototype.and=function(R){var T={};return this.to(T),this.src=R,this.to(T),this.src=T,this};function S(R,T){return R[T]===void 0&&R.__lookupGetter__(T)===void 0&&R.__lookupSetter__(T)===void 0}},{}],77:[function(I,q,M){I("../../modules/es6.string.iterator"),I("../../modules/es6.array.from"),q.exports=I("../../modules/_core").Array.from},{"../../modules/_core":99,"../../modules/es6.array.from":168,"../../modules/es6.string.iterator":180}],78:[function(I,q,M){var P=I("../../modules/_core"),m=P.JSON||(P.JSON={stringify:JSON.stringify});q.exports=function(R){return m.stringify.apply(m,arguments)}},{"../../modules/_core":99}],79:[function(I,q,M){I("../../modules/es6.object.assign"),q.exports=I("../../modules/_core").Object.assign},{"../../modules/_core":99,"../../modules/es6.object.assign":171}],80:[function(I,q,M){I("../../modules/es6.object.create");var P=I("../../modules/_core").Object;q.exports=function(S,R){return P.create(S,R)}},{"../../modules/_core":99,"../../modules/es6.object.create":172}],81:[function(I,q,M){I("../../modules/es6.object.define-property");var P=I("../../modules/_core").Object;q.exports=function(S,R,T){return P.defineProperty(S,R,T)}},{"../../modules/_core":99,"../../modules/es6.object.define-property":173}],82:[function(I,q,M){I("../../modules/es7.object.entries"),q.exports=I("../../modules/_core").Object.entries},{"../../modules/_core":99,"../../modules/es7.object.entries":182}],83:[function(I,q,M){I("../../modules/es6.object.get-own-property-names");var P=I("../../modules/_core").Object;q.exports=function(S){return P.getOwnPropertyNames(S)}},{"../../modules/_core":99,"../../modules/es6.object.get-own-property-names":174}],84:[function(I,q,M){I("../../modules/es6.object.get-prototype-of"),q.exports=I("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":99,"../../modules/es6.object.get-prototype-of":175}],85:[function(I,q,M){I("../../modules/es6.object.keys"),q.exports=I("../../modules/_core").Object.keys},{"../../modules/_core":99,"../../modules/es6.object.keys":176}],86:[function(I,q,M){I("../modules/es6.object.to-string"),I("../modules/es6.string.iterator"),I("../modules/web.dom.iterable"),I("../modules/es6.promise"),I("../modules/es7.promise.finally"),I("../modules/es7.promise.try"),q.exports=I("../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(I,q,M){I("../modules/web.immediate"),q.exports=I("../modules/_core").setImmediate},{"../modules/_core":99,"../modules/web.immediate":188}],88:[function(I,q,M){I("../../modules/es6.string.from-code-point"),q.exports=I("../../modules/_core").String.fromCodePoint},{"../../modules/_core":99,"../../modules/es6.string.from-code-point":179}],89:[function(I,q,M){I("../../modules/es6.function.has-instance"),q.exports=I("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":165,"../../modules/es6.function.has-instance":170}],90:[function(I,q,M){I("../../modules/es6.symbol"),I("../../modules/es6.object.to-string"),I("../../modules/es7.symbol.async-iterator"),I("../../modules/es7.symbol.observable"),q.exports=I("../../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(I,q,M){I("../../modules/es6.string.iterator"),I("../../modules/web.dom.iterable"),q.exports=I("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":165,"../../modules/es6.string.iterator":180,"../../modules/web.dom.iterable":187}],92:[function(I,q,M){q.exports=function(P){if(typeof P!="function")throw TypeError(P+" is not a function!");return P}},{}],93:[function(I,q,M){q.exports=function(){}},{}],94:[function(I,q,M){q.exports=function(P,m,S,R){if(!(P instanceof m)||R!==void 0&&R in P)throw TypeError(S+": incorrect invocation!");return P}},{}],95:[function(I,q,M){var P=I("./_is-object");q.exports=function(m){if(!P(m))throw TypeError(m+" is not an object!");return m}},{"./_is-object":119}],96:[function(I,q,M){var P=I("./_to-iobject"),m=I("./_to-length"),S=I("./_to-absolute-index");q.exports=function(R){return function(T,g,C){var p=P(T),s=m(p.length),a=S(C,s),r;if(R&&g!=g){for(;s>a;)if(r=p[a++],r!=r)return!0}else for(;s>a;a++)if((R||a in p)&&p[a]===g)return R||a||0;return!R&&-1}}},{"./_to-absolute-index":156,"./_to-iobject":158,"./_to-length":159}],97:[function(I,q,M){var P=I("./_cof"),m=I("./_wks")("toStringTag"),S=P(function(){return arguments}())=="Arguments",R=function(T,g){try{return T[g]}catch(C){}};q.exports=function(T){var g,C,p;return T===void 0?"Undefined":T===null?"Null":typeof(C=R(g=Object(T),m))=="string"?C:S?P(g):(p=P(g))=="Object"&&typeof g.callee=="function"?"Arguments":p}},{"./_cof":98,"./_wks":166}],98:[function(I,q,M){var P={}.toString;q.exports=function(m){return P.call(m).slice(8,-1)}},{}],99:[function(I,q,M){var P=q.exports={version:"2.6.11"};typeof __e=="number"&&(__e=P)},{}],100:[function(I,q,M){"use strict";var P=I("./_object-dp"),m=I("./_property-desc");q.exports=function(S,R,T){R in S?P.f(S,R,m(0,T)):S[R]=T}},{"./_object-dp":132,"./_property-desc":146}],101:[function(I,q,M){var P=I("./_a-function");q.exports=function(m,S,R){if(P(m),S===void 0)return m;switch(R){case 1:return function(T){return m.call(S,T)};case 2:return function(T,g){return m.call(S,T,g)};case 3:return function(T,g,C){return m.call(S,T,g,C)}}return function(){return m.apply(S,arguments)}}},{"./_a-function":92}],102:[function(I,q,M){q.exports=function(P){if(P==null)throw TypeError("Can't call method on "+P);return P}},{}],103:[function(I,q,M){q.exports=!I("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":108}],104:[function(I,q,M){var P=I("./_is-object"),m=I("./_global").document,S=P(m)&&P(m.createElement);q.exports=function(R){return S?m.createElement(R):{}}},{"./_global":110,"./_is-object":119}],105:[function(I,q,M){q.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],106:[function(I,q,M){var P=I("./_object-keys"),m=I("./_object-gops"),S=I("./_object-pie");q.exports=function(R){var T=P(R),g=m.f;if(g)for(var C=g(R),p=S.f,s=0,a;C.length>s;)p.call(R,a=C[s++])&&T.push(a);return T}},{"./_object-gops":137,"./_object-keys":140,"./_object-pie":141}],107:[function(I,q,M){var P=I("./_global"),m=I("./_core"),S=I("./_ctx"),R=I("./_hide"),T=I("./_has"),g="prototype",C=function(p,s,a){var r=p&C.F,h=p&C.G,d=p&C.S,f=p&C.P,E=p&C.B,y=p&C.W,l=h?m:m[s]||(m[s]={}),n=l[g],o=h?P:d?P[s]:(P[s]||{})[g],u,w,v;h&&(a=s);for(u in a){if(w=!r&&o&&o[u]!==void 0,w&&T(l,u))continue;v=w?o[u]:a[u],l[u]=h&&typeof o[u]!="function"?a[u]:E&&w?S(v,P):y&&o[u]==v?function(i){var k=function(D,c,b){if(this instanceof i){switch(arguments.length){case 0:return new i;case 1:return new i(D);case 2:return new i(D,c)}return new i(D,c,b)}return i.apply(this,arguments)};return k[g]=i[g],k}(v):f&&typeof v=="function"?S(Function.call,v):v,f&&((l.virtual||(l.virtual={}))[u]=v,p&C.R&&n&&!n[u]&&R(n,u,v))}};C.F=1,C.G=2,C.S=4,C.P=8,C.B=16,C.W=32,C.U=64,C.R=128,q.exports=C},{"./_core":99,"./_ctx":101,"./_global":110,"./_has":111,"./_hide":112}],108:[function(I,q,M){q.exports=function(P){try{return!!P()}catch(m){return!0}}},{}],109:[function(I,q,M){var P=I("./_ctx"),m=I("./_iter-call"),S=I("./_is-array-iter"),R=I("./_an-object"),T=I("./_to-length"),g=I("./core.get-iterator-method"),C={},p={},M=q.exports=function(s,a,r,h,d){var f=d?function(){return s}:g(s),E=P(r,h,a?2:1),y=0,l,n,o,u;if(typeof f!="function")throw TypeError(s+" is not iterable!");if(S(f)){for(l=T(s.length);l>y;y++)if(u=a?E(R(n=s[y])[0],n[1]):E(s[y]),u===C||u===p)return u}else for(o=f.call(s);!(n=o.next()).done;)if(u=m(o,E,n.value,a),u===C||u===p)return u};M.BREAK=C,M.RETURN=p},{"./_an-object":95,"./_ctx":101,"./_is-array-iter":117,"./_iter-call":120,"./_to-length":159,"./core.get-iterator-method":167}],110:[function(I,q,M){var P=q.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=P)},{}],111:[function(I,q,M){var P={}.hasOwnProperty;q.exports=function(m,S){return P.call(m,S)}},{}],112:[function(I,q,M){var P=I("./_object-dp"),m=I("./_property-desc");q.exports=I("./_descriptors")?function(S,R,T){return P.f(S,R,m(1,T))}:function(S,R,T){return S[R]=T,S}},{"./_descriptors":103,"./_object-dp":132,"./_property-desc":146}],113:[function(I,q,M){var P=I("./_global").document;q.exports=P&&P.documentElement},{"./_global":110}],114:[function(I,q,M){q.exports=!I("./_descriptors")&&!I("./_fails")(function(){return Object.defineProperty(I("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":103,"./_dom-create":104,"./_fails":108}],115:[function(I,q,M){q.exports=function(P,m,S){var R=S===void 0;switch(m.length){case 0:return R?P():P.call(S);case 1:return R?P(m[0]):P.call(S,m[0]);case 2:return R?P(m[0],m[1]):P.call(S,m[0],m[1]);case 3:return R?P(m[0],m[1],m[2]):P.call(S,m[0],m[1],m[2]);case 4:return R?P(m[0],m[1],m[2],m[3]):P.call(S,m[0],m[1],m[2],m[3])}return P.apply(S,m)}},{}],116:[function(I,q,M){var P=I("./_cof");q.exports=Object("z").propertyIsEnumerable(0)?Object:function(m){return P(m)=="String"?m.split(""):Object(m)}},{"./_cof":98}],117:[function(I,q,M){var P=I("./_iterators"),m=I("./_wks")("iterator"),S=Array.prototype;q.exports=function(R){return R!==void 0&&(P.Array===R||S[m]===R)}},{"./_iterators":125,"./_wks":166}],118:[function(I,q,M){var P=I("./_cof");q.exports=Array.isArray||function(S){return P(S)=="Array"}},{"./_cof":98}],119:[function(I,q,M){q.exports=function(P){return typeof P=="object"?P!==null:typeof P=="function"}},{}],120:[function(I,q,M){var P=I("./_an-object");q.exports=function(m,S,R,T){try{return T?S(P(R)[0],R[1]):S(R)}catch(C){var g=m.return;throw g!==void 0&&P(g.call(m)),C}}},{"./_an-object":95}],121:[function(I,q,M){"use strict";var P=I("./_object-create"),m=I("./_property-desc"),S=I("./_set-to-string-tag"),R={};I("./_hide")(R,I("./_wks")("iterator"),function(){return this}),q.exports=function(T,g,C){T.prototype=P(R,{next:m(1,C)}),S(T,g+" Iterator")}},{"./_hide":112,"./_object-create":131,"./_property-desc":146,"./_set-to-string-tag":150,"./_wks":166}],122:[function(I,q,M){"use strict";var P=I("./_library"),m=I("./_export"),S=I("./_redefine"),R=I("./_hide"),T=I("./_iterators"),g=I("./_iter-create"),C=I("./_set-to-string-tag"),p=I("./_object-gpo"),s=I("./_wks")("iterator"),a=!([].keys&&"next"in[].keys()),r="@@iterator",h="keys",d="values",f=function(){return this};q.exports=function(E,y,l,n,o,u,w){g(l,y,n);var v=function(z){if(!a&&z in c)return c[z];switch(z){case h:return function(){return new l(this,z)};case d:return function(){return new l(this,z)}}return function(){return new l(this,z)}},i=y+" Iterator",k=o==d,D=!1,c=E.prototype,b=c[s]||c[r]||o&&c[o],x=b||v(o),_=o?k?v("entries"):x:void 0,j=y=="Array"&&c.entries||b,F,L,X;if(j&&(X=p(j.call(new E)),X!==Object.prototype&&X.next&&(C(X,i,!0),!P&&typeof X[s]!="function"&&R(X,s,f))),k&&b&&b.name!==d&&(D=!0,x=function(){return b.call(this)}),(!P||w)&&(a||D||!c[s])&&R(c,s,x),T[y]=x,T[i]=f,o)if(F={values:k?x:v(d),keys:u?x:v(h),entries:_},w)for(L in F)L in c||S(c,L,F[L]);else m(m.P+m.F*(a||D),y,F);return F}},{"./_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(I,q,M){var P=I("./_wks")("iterator"),m=!1;try{var S=[7][P]();S.return=function(){m=!0},Array.from(S,function(){throw 2})}catch(R){}q.exports=function(R,T){if(!T&&!m)return!1;var g=!1;try{var C=[7],p=C[P]();p.next=function(){return{done:g=!0}},C[P]=function(){return p},R(C)}catch(s){}return g}},{"./_wks":166}],124:[function(I,q,M){q.exports=function(P,m){return{value:m,done:!!P}}},{}],125:[function(I,q,M){q.exports={}},{}],126:[function(I,q,M){q.exports=!0},{}],127:[function(I,q,M){var P=I("./_uid")("meta"),m=I("./_is-object"),S=I("./_has"),R=I("./_object-dp").f,T=0,g=Object.isExtensible||function(){return!0},C=!I("./_fails")(function(){return g(Object.preventExtensions({}))}),p=function(d){R(d,P,{value:{i:"O"+ ++T,w:{}}})},s=function(d,f){if(!m(d))return typeof d=="symbol"?d:(typeof d=="string"?"S":"P")+d;if(!S(d,P)){if(!g(d))return"F";if(!f)return"E";p(d)}return d[P].i},a=function(d,f){if(!S(d,P)){if(!g(d))return!0;if(!f)return!1;p(d)}return d[P].w},r=function(d){return C&&h.NEED&&g(d)&&!S(d,P)&&p(d),d},h=q.exports={KEY:P,NEED:!1,fastKey:s,getWeak:a,onFreeze:r}},{"./_fails":108,"./_has":111,"./_is-object":119,"./_object-dp":132,"./_uid":162}],128:[function(I,q,M){var P=I("./_global"),m=I("./_task").set,S=P.MutationObserver||P.WebKitMutationObserver,R=P.process,T=P.Promise,g=I("./_cof")(R)=="process";q.exports=function(){var C,p,s,a=function(){var f,E;for(g&&(f=R.domain)&&f.exit();C;){E=C.fn,C=C.next;try{E()}catch(y){throw C?s():p=void 0,y}}p=void 0,f&&f.enter()};if(g)s=function(){R.nextTick(a)};else if(S&&!(P.navigator&&P.navigator.standalone)){var r=!0,h=document.createTextNode("");new S(a).observe(h,{characterData:!0}),s=function(){h.data=r=!r}}else if(T&&T.resolve){var d=T.resolve(void 0);s=function(){d.then(a)}}else s=function(){m.call(P,a)};return function(f){var E={fn:f,next:void 0};p&&(p.next=E),C||(C=E,s()),p=E}}},{"./_cof":98,"./_global":110,"./_task":155}],129:[function(I,q,M){"use strict";var P=I("./_a-function");function m(S){var R,T;this.promise=new S(function(g,C){if(R!==void 0||T!==void 0)throw TypeError("Bad Promise constructor");R=g,T=C}),this.resolve=P(R),this.reject=P(T)}q.exports.f=function(S){return new m(S)}},{"./_a-function":92}],130:[function(I,q,M){"use strict";var P=I("./_descriptors"),m=I("./_object-keys"),S=I("./_object-gops"),R=I("./_object-pie"),T=I("./_to-object"),g=I("./_iobject"),C=Object.assign;q.exports=!C||I("./_fails")(function(){var p={},s={},a=Symbol(),r="abcdefghijklmnopqrst";return p[a]=7,r.split("").forEach(function(h){s[h]=h}),C({},p)[a]!=7||Object.keys(C({},s)).join("")!=r})?function(s,a){for(var r=T(s),h=arguments.length,d=1,f=S.f,E=R.f;h>d;)for(var y=g(arguments[d++]),l=f?m(y).concat(f(y)):m(y),n=l.length,o=0,u;n>o;)u=l[o++],(!P||E.call(y,u))&&(r[u]=y[u]);return r}:C},{"./_descriptors":103,"./_fails":108,"./_iobject":116,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_to-object":160}],131:[function(I,q,M){var P=I("./_an-object"),m=I("./_object-dps"),S=I("./_enum-bug-keys"),R=I("./_shared-key")("IE_PROTO"),T=function(){},g="prototype",C=function(){var p=I("./_dom-create")("iframe"),s=S.length,a="<",r=">",h;for(p.style.display="none",I("./_html").appendChild(p),p.src="javascript:",h=p.contentWindow.document,h.open(),h.write(a+"script"+r+"document.F=Object"+a+"/script"+r),h.close(),C=h.F;s--;)delete C[g][S[s]];return C()};q.exports=Object.create||function(s,a){var r;return s!==null?(T[g]=P(s),r=new T,T[g]=null,r[R]=s):r=C(),a===void 0?r:m(r,a)}},{"./_an-object":95,"./_dom-create":104,"./_enum-bug-keys":105,"./_html":113,"./_object-dps":133,"./_shared-key":151}],132:[function(I,q,M){var P=I("./_an-object"),m=I("./_ie8-dom-define"),S=I("./_to-primitive"),R=Object.defineProperty;M.f=I("./_descriptors")?Object.defineProperty:function(g,C,p){if(P(g),C=S(C,!0),P(p),m)try{return R(g,C,p)}catch(s){}if("get"in p||"set"in p)throw TypeError("Accessors not supported!");return"value"in p&&(g[C]=p.value),g}},{"./_an-object":95,"./_descriptors":103,"./_ie8-dom-define":114,"./_to-primitive":161}],133:[function(I,q,M){var P=I("./_object-dp"),m=I("./_an-object"),S=I("./_object-keys");q.exports=I("./_descriptors")?Object.defineProperties:function(T,g){m(T);for(var C=S(g),p=C.length,s=0,a;p>s;)P.f(T,a=C[s++],g[a]);return T}},{"./_an-object":95,"./_descriptors":103,"./_object-dp":132,"./_object-keys":140}],134:[function(I,q,M){var P=I("./_object-pie"),m=I("./_property-desc"),S=I("./_to-iobject"),R=I("./_to-primitive"),T=I("./_has"),g=I("./_ie8-dom-define"),C=Object.getOwnPropertyDescriptor;M.f=I("./_descriptors")?C:function(s,a){if(s=S(s),a=R(a,!0),g)try{return C(s,a)}catch(r){}if(T(s,a))return m(!P.f.call(s,a),s[a])}},{"./_descriptors":103,"./_has":111,"./_ie8-dom-define":114,"./_object-pie":141,"./_property-desc":146,"./_to-iobject":158,"./_to-primitive":161}],135:[function(I,q,M){var P=I("./_to-iobject"),m=I("./_object-gopn").f,S={}.toString,R=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],T=function(g){try{return m(g)}catch(C){return R.slice()}};q.exports.f=function(C){return R&&S.call(C)=="[object Window]"?T(C):m(P(C))}},{"./_object-gopn":136,"./_to-iobject":158}],136:[function(I,q,M){var P=I("./_object-keys-internal"),m=I("./_enum-bug-keys").concat("length","prototype");M.f=Object.getOwnPropertyNames||function(R){return P(R,m)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],137:[function(I,q,M){M.f=Object.getOwnPropertySymbols},{}],138:[function(I,q,M){var P=I("./_has"),m=I("./_to-object"),S=I("./_shared-key")("IE_PROTO"),R=Object.prototype;q.exports=Object.getPrototypeOf||function(T){return T=m(T),P(T,S)?T[S]:typeof T.constructor=="function"&&T instanceof T.constructor?T.constructor.prototype:T instanceof Object?R:null}},{"./_has":111,"./_shared-key":151,"./_to-object":160}],139:[function(I,q,M){var P=I("./_has"),m=I("./_to-iobject"),S=I("./_array-includes")(!1),R=I("./_shared-key")("IE_PROTO");q.exports=function(T,g){var C=m(T),p=0,s=[],a;for(a in C)a!=R&&(P(C,a)&&s.push(a));for(;g.length>p;)P(C,a=g[p++])&&(~S(s,a)||s.push(a));return s}},{"./_array-includes":96,"./_has":111,"./_shared-key":151,"./_to-iobject":158}],140:[function(I,q,M){var P=I("./_object-keys-internal"),m=I("./_enum-bug-keys");q.exports=Object.keys||function(R){return P(R,m)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],141:[function(I,q,M){M.f={}.propertyIsEnumerable},{}],142:[function(I,q,M){var P=I("./_export"),m=I("./_core"),S=I("./_fails");q.exports=function(R,T){var g=(m.Object||{})[R]||Object[R],C={};C[R]=T(g),P(P.S+P.F*S(function(){g(1)}),"Object",C)}},{"./_core":99,"./_export":107,"./_fails":108}],143:[function(I,q,M){var P=I("./_descriptors"),m=I("./_object-keys"),S=I("./_to-iobject"),R=I("./_object-pie").f;q.exports=function(T){return function(g){for(var C=S(g),p=m(C),s=p.length,a=0,r=[],h;s>a;)h=p[a++],(!P||R.call(C,h))&&r.push(T?[h,C[h]]:C[h]);return r}}},{"./_descriptors":103,"./_object-keys":140,"./_object-pie":141,"./_to-iobject":158}],144:[function(I,q,M){q.exports=function(P){try{return{e:!1,v:P()}}catch(m){return{e:!0,v:m}}}},{}],145:[function(I,q,M){var P=I("./_an-object"),m=I("./_is-object"),S=I("./_new-promise-capability");q.exports=function(R,T){if(P(R),m(T)&&T.constructor===R)return T;var g=S.f(R),C=g.resolve;return C(T),g.promise}},{"./_an-object":95,"./_is-object":119,"./_new-promise-capability":129}],146:[function(I,q,M){q.exports=function(P,m){return{enumerable:!(P&1),configurable:!(P&2),writable:!(P&4),value:m}}},{}],147:[function(I,q,M){var P=I("./_hide");q.exports=function(m,S,R){for(var T in S)R&&m[T]?m[T]=S[T]:P(m,T,S[T]);return m}},{"./_hide":112}],148:[function(I,q,M){q.exports=I("./_hide")},{"./_hide":112}],149:[function(I,q,M){"use strict";var P=I("./_global"),m=I("./_core"),S=I("./_object-dp"),R=I("./_descriptors"),T=I("./_wks")("species");q.exports=function(g){var C=typeof m[g]=="function"?m[g]:P[g];R&&C&&!C[T]&&S.f(C,T,{configurable:!0,get:function(){return this}})}},{"./_core":99,"./_descriptors":103,"./_global":110,"./_object-dp":132,"./_wks":166}],150:[function(I,q,M){var P=I("./_object-dp").f,m=I("./_has"),S=I("./_wks")("toStringTag");q.exports=function(R,T,g){R&&!m(R=g?R:R.prototype,S)&&P(R,S,{configurable:!0,value:T})}},{"./_has":111,"./_object-dp":132,"./_wks":166}],151:[function(I,q,M){var P=I("./_shared")("keys"),m=I("./_uid");q.exports=function(S){return P[S]||(P[S]=m(S))}},{"./_shared":152,"./_uid":162}],152:[function(I,q,M){var P=I("./_core"),m=I("./_global"),S="__core-js_shared__",R=m[S]||(m[S]={});(q.exports=function(T,g){return R[T]||(R[T]=g!==void 0?g:{})})("versions",[]).push({version:P.version,mode:I("./_library")?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},{"./_core":99,"./_global":110,"./_library":126}],153:[function(I,q,M){var P=I("./_an-object"),m=I("./_a-function"),S=I("./_wks")("species");q.exports=function(R,T){var g=P(R).constructor,C;return g===void 0||(C=P(g)[S])==null?T:m(C)}},{"./_a-function":92,"./_an-object":95,"./_wks":166}],154:[function(I,q,M){var P=I("./_to-integer"),m=I("./_defined");q.exports=function(S){return function(R,T){var g=String(m(R)),C=P(T),p=g.length,s,a;return C<0||C>=p?S?"":void 0:(s=g.charCodeAt(C),s<55296||s>56319||C+1===p||(a=g.charCodeAt(C+1))<56320||a>57343?S?g.charAt(C):s:S?g.slice(C,C+2):(s-55296<<10)+(a-56320)+65536)}}},{"./_defined":102,"./_to-integer":157}],155:[function(I,q,M){var P=I("./_ctx"),m=I("./_invoke"),S=I("./_html"),R=I("./_dom-create"),T=I("./_global"),g=T.process,C=T.setImmediate,p=T.clearImmediate,s=T.MessageChannel,a=T.Dispatch,r=0,h={},d="onreadystatechange",f,E,y,l=function(){var o=+this;if(h.hasOwnProperty(o)){var u=h[o];delete h[o],u()}},n=function(o){l.call(o.data)};(!C||!p)&&(C=function(u){for(var w=[],v=1;arguments.length>v;)w.push(arguments[v++]);return h[++r]=function(){m(typeof u=="function"?u:Function(u),w)},f(r),r},p=function(u){delete h[u]},I("./_cof")(g)=="process"?f=function(o){g.nextTick(P(l,o,1))}:a&&a.now?f=function(o){a.now(P(l,o,1))}:s?(E=new s,y=E.port2,E.port1.onmessage=n,f=P(y.postMessage,y,1)):T.addEventListener&&typeof postMessage=="function"&&!T.importScripts?(f=function(o){T.postMessage(o+"","*")},T.addEventListener("message",n,!1)):d in R("script")?f=function(o){S.appendChild(R("script"))[d]=function(){S.removeChild(this),l.call(o)}}:f=function(o){setTimeout(P(l,o,1),0)}),q.exports={set:C,clear:p}},{"./_cof":98,"./_ctx":101,"./_dom-create":104,"./_global":110,"./_html":113,"./_invoke":115}],156:[function(I,q,M){var P=I("./_to-integer"),m=Math.max,S=Math.min;q.exports=function(R,T){return R=P(R),R<0?m(R+T,0):S(R,T)}},{"./_to-integer":157}],157:[function(I,q,M){var P=Math.ceil,m=Math.floor;q.exports=function(S){return isNaN(S=+S)?0:(S>0?m:P)(S)}},{}],158:[function(I,q,M){var P=I("./_iobject"),m=I("./_defined");q.exports=function(S){return P(m(S))}},{"./_defined":102,"./_iobject":116}],159:[function(I,q,M){var P=I("./_to-integer"),m=Math.min;q.exports=function(S){return S>0?m(P(S),9007199254740991):0}},{"./_to-integer":157}],160:[function(I,q,M){var P=I("./_defined");q.exports=function(m){return Object(P(m))}},{"./_defined":102}],161:[function(I,q,M){var P=I("./_is-object");q.exports=function(m,S){if(!P(m))return m;var R,T;if(S&&typeof(R=m.toString)=="function"&&!P(T=R.call(m)))return T;if(typeof(R=m.valueOf)=="function"&&!P(T=R.call(m)))return T;if(!S&&typeof(R=m.toString)=="function"&&!P(T=R.call(m)))return T;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":119}],162:[function(I,q,M){var P=0,m=Math.random();q.exports=function(S){return"Symbol(".concat(S===void 0?"":S,")_",(++P+m).toString(36))}},{}],163:[function(I,q,M){var P=I("./_global"),m=P.navigator;q.exports=m&&m.userAgent||""},{"./_global":110}],164:[function(I,q,M){var P=I("./_global"),m=I("./_core"),S=I("./_library"),R=I("./_wks-ext"),T=I("./_object-dp").f;q.exports=function(g){var C=m.Symbol||(m.Symbol=S?{}:P.Symbol||{});g.charAt(0)!="_"&&!(g in C)&&T(C,g,{value:R.f(g)})}},{"./_core":99,"./_global":110,"./_library":126,"./_object-dp":132,"./_wks-ext":165}],165:[function(I,q,M){M.f=I("./_wks")},{"./_wks":166}],166:[function(I,q,M){var P=I("./_shared")("wks"),m=I("./_uid"),S=I("./_global").Symbol,R=typeof S=="function",T=q.exports=function(g){return P[g]||(P[g]=R&&S[g]||(R?S:m)("Symbol."+g))};T.store=P},{"./_global":110,"./_shared":152,"./_uid":162}],167:[function(I,q,M){var P=I("./_classof"),m=I("./_wks")("iterator"),S=I("./_iterators");q.exports=I("./_core").getIteratorMethod=function(R){if(R!=null)return R[m]||R["@@iterator"]||S[P(R)]}},{"./_classof":97,"./_core":99,"./_iterators":125,"./_wks":166}],168:[function(I,q,M){"use strict";var P=I("./_ctx"),m=I("./_export"),S=I("./_to-object"),R=I("./_iter-call"),T=I("./_is-array-iter"),g=I("./_to-length"),C=I("./_create-property"),p=I("./core.get-iterator-method");m(m.S+m.F*!I("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(a){var r=S(a),h=typeof this=="function"?this:Array,d=arguments.length,f=d>1?arguments[1]:void 0,E=f!==void 0,y=0,l=p(r),n,o,u,w;if(E&&(f=P(f,d>2?arguments[2]:void 0,2)),l!=null&&!(h==Array&&T(l)))for(w=l.call(r),o=new h;!(u=w.next()).done;y++)C(o,y,E?R(w,f,[u.value,y],!0):u.value);else for(n=g(r.length),o=new h(n);n>y;y++)C(o,y,E?f(r[y],y):r[y]);return o.length=y,o}})},{"./_create-property":100,"./_ctx":101,"./_export":107,"./_is-array-iter":117,"./_iter-call":120,"./_iter-detect":123,"./_to-length":159,"./_to-object":160,"./core.get-iterator-method":167}],169:[function(I,q,M){"use strict";var P=I("./_add-to-unscopables"),m=I("./_iter-step"),S=I("./_iterators"),R=I("./_to-iobject");q.exports=I("./_iter-define")(Array,"Array",function(T,g){this._t=R(T),this._i=0,this._k=g},function(){var T=this._t,g=this._k,C=this._i++;return!T||C>=T.length?(this._t=void 0,m(1)):g=="keys"?m(0,C):g=="values"?m(0,T[C]):m(0,[C,T[C]])},"values"),S.Arguments=S.Array,P("keys"),P("values"),P("entries")},{"./_add-to-unscopables":93,"./_iter-define":122,"./_iter-step":124,"./_iterators":125,"./_to-iobject":158}],170:[function(I,q,M){"use strict";var P=I("./_is-object"),m=I("./_object-gpo"),S=I("./_wks")("hasInstance"),R=Function.prototype;S in R||I("./_object-dp").f(R,S,{value:function(T){if(typeof this!="function"||!P(T))return!1;if(!P(this.prototype))return T instanceof this;for(;T=m(T);)if(this.prototype===T)return!0;return!1}})},{"./_is-object":119,"./_object-dp":132,"./_object-gpo":138,"./_wks":166}],171:[function(I,q,M){var P=I("./_export");P(P.S+P.F,"Object",{assign:I("./_object-assign")})},{"./_export":107,"./_object-assign":130}],172:[function(I,q,M){var P=I("./_export");P(P.S,"Object",{create:I("./_object-create")})},{"./_export":107,"./_object-create":131}],173:[function(I,q,M){var P=I("./_export");P(P.S+P.F*!I("./_descriptors"),"Object",{defineProperty:I("./_object-dp").f})},{"./_descriptors":103,"./_export":107,"./_object-dp":132}],174:[function(I,q,M){I("./_object-sap")("getOwnPropertyNames",function(){return I("./_object-gopn-ext").f})},{"./_object-gopn-ext":135,"./_object-sap":142}],175:[function(I,q,M){var P=I("./_to-object"),m=I("./_object-gpo");I("./_object-sap")("getPrototypeOf",function(){return function(R){return m(P(R))}})},{"./_object-gpo":138,"./_object-sap":142,"./_to-object":160}],176:[function(I,q,M){var P=I("./_to-object"),m=I("./_object-keys");I("./_object-sap")("keys",function(){return function(R){return m(P(R))}})},{"./_object-keys":140,"./_object-sap":142,"./_to-object":160}],177:[function(I,q,M){arguments[4][71][0].apply(M,arguments)},{dup:71}],178:[function(I,q,M){"use strict";var P=I("./_library"),m=I("./_global"),S=I("./_ctx"),R=I("./_classof"),T=I("./_export"),g=I("./_is-object"),C=I("./_a-function"),p=I("./_an-instance"),s=I("./_for-of"),a=I("./_species-constructor"),r=I("./_task").set,h=I("./_microtask")(),d=I("./_new-promise-capability"),f=I("./_perform"),E=I("./_user-agent"),y=I("./_promise-resolve"),l="Promise",n=m.TypeError,o=m.process,u=o&&o.versions,w=u&&u.v8||"",v=m[l],i=R(o)=="process",k=function(){},D,c,b,x,_=c=d.f,j=!!function(){try{var B=v.resolve(1),W=(B.constructor={})[I("./_wks")("species")]=function(te){te(k,k)};return(i||typeof PromiseRejectionEvent=="function")&&B.then(k)instanceof W&&w.indexOf("6.6")!==0&&E.indexOf("Chrome/66")===-1}catch(te){}}(),F=function(B){var W;return g(B)&&typeof(W=B.then)=="function"?W:!1},L=function(B,W){if(B._n)return;B._n=!0;var te=B._c;h(function(){for(var de=B._v,fe=B._s==1,be=0,Ce=function(ue){var ge=fe?ue.ok:ue.fail,pe=ue.resolve,oe=ue.reject,ae=ue.domain,re,he,Q;try{ge?(fe||(B._h==2&&H(B),B._h=1),ge===!0?re=de:(ae&&ae.enter(),re=ge(de),ae&&(ae.exit(),Q=!0)),re===ue.promise?oe(n("Promise-chain cycle")):(he=F(re))?he.call(re,pe,oe):pe(re)):oe(de)}catch(ie){ae&&!Q&&ae.exit(),oe(ie)}};te.length>be;)Ce(te[be++]);B._c=[],B._n=!1,W&&!B._h&&X(B)})},X=function(B){r.call(m,function(){var W=B._v,te=z(B),de,fe,be;if(te&&(de=f(function(){i?o.emit("unhandledRejection",W,B):(fe=m.onunhandledrejection)?fe({promise:B,reason:W}):(be=m.console)&&be.error&&be.error("Unhandled promise rejection",W)}),B._h=i||z(B)?2:1),B._a=void 0,te&&de.e)throw de.v})},z=function(B){return B._h!==1&&(B._a||B._c).length===0},H=function(B){r.call(m,function(){var W;i?o.emit("rejectionHandled",B):(W=m.onrejectionhandled)&&W({promise:B,reason:B._v})})},G=function(B){var W=this;if(W._d)return;W._d=!0,W=W._w||W,W._v=B,W._s=2,W._a||(W._a=W._c.slice()),L(W,!0)},U=function(B){var W=this,te;if(W._d)return;W._d=!0,W=W._w||W;try{if(W===B)throw n("Promise can't be resolved itself");(te=F(B))?h(function(){var de={_w:W,_d:!1};try{te.call(B,S(U,de,1),S(G,de,1))}catch(fe){G.call(de,fe)}}):(W._v=B,W._s=1,L(W,!1))}catch(de){G.call({_w:W,_d:!1},de)}};j||(v=function(W){p(this,v,l,"_h"),C(W),D.call(this);try{W(S(U,this,1),S(G,this,1))}catch(te){G.call(this,te)}},D=function(W){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},D.prototype=I("./_redefine-all")(v.prototype,{then:function(W,te){var de=_(a(this,v));return de.ok=typeof W=="function"?W:!0,de.fail=typeof te=="function"&&te,de.domain=i?o.domain:void 0,this._c.push(de),this._a&&this._a.push(de),this._s&&L(this,!1),de.promise},catch:function(B){return this.then(void 0,B)}}),b=function(){var B=new D;this.promise=B,this.resolve=S(U,B,1),this.reject=S(G,B,1)},d.f=_=function(B){return B===v||B===x?new b(B):c(B)}),T(T.G+T.W+T.F*!j,{Promise:v}),I("./_set-to-string-tag")(v,l),I("./_set-species")(l),x=I("./_core")[l],T(T.S+T.F*!j,l,{reject:function(W){var te=_(this),de=te.reject;return de(W),te.promise}}),T(T.S+T.F*(P||!j),l,{resolve:function(W){return y(P&&this===x?v:this,W)}}),T(T.S+T.F*!(j&&I("./_iter-detect")(function(B){v.all(B).catch(k)})),l,{all:function(W){var te=this,de=_(te),fe=de.resolve,be=de.reject,Ce=f(function(){var ue=[],ge=0,pe=1;s(W,!1,function(oe){var ae=ge++,re=!1;ue.push(void 0),pe++,te.resolve(oe).then(function(he){if(re)return;re=!0,ue[ae]=he,--pe||fe(ue)},be)}),--pe||fe(ue)});return Ce.e&&be(Ce.v),de.promise},race:function(W){var te=this,de=_(te),fe=de.reject,be=f(function(){s(W,!1,function(Ce){te.resolve(Ce).then(de.resolve,fe)})});return be.e&&fe(be.v),de.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(I,q,M){var P=I("./_export"),m=I("./_to-absolute-index"),S=String.fromCharCode,R=String.fromCodePoint;P(P.S+P.F*(!!R&&R.length!=1),"String",{fromCodePoint:function(g){for(var C=[],p=arguments.length,s=0,a;p>s;){if(a=+arguments[s++],m(a,1114111)!==a)throw RangeError(a+" is not a valid code point");C.push(a<65536?S(a):S(((a-=65536)>>10)+55296,a%1024+56320))}return C.join("")}})},{"./_export":107,"./_to-absolute-index":156}],180:[function(I,q,M){"use strict";var P=I("./_string-at")(!0);I("./_iter-define")(String,"String",function(m){this._t=String(m),this._i=0},function(){var m=this._t,S=this._i,R;return S>=m.length?{value:void 0,done:!0}:(R=P(m,S),this._i+=R.length,{value:R,done:!1})})},{"./_iter-define":122,"./_string-at":154}],181:[function(I,q,M){"use strict";var P=I("./_global"),m=I("./_has"),S=I("./_descriptors"),R=I("./_export"),T=I("./_redefine"),g=I("./_meta").KEY,C=I("./_fails"),p=I("./_shared"),s=I("./_set-to-string-tag"),a=I("./_uid"),r=I("./_wks"),h=I("./_wks-ext"),d=I("./_wks-define"),f=I("./_enum-keys"),E=I("./_is-array"),y=I("./_an-object"),l=I("./_is-object"),n=I("./_to-object"),o=I("./_to-iobject"),u=I("./_to-primitive"),w=I("./_property-desc"),v=I("./_object-create"),i=I("./_object-gopn-ext"),k=I("./_object-gopd"),D=I("./_object-gops"),c=I("./_object-dp"),b=I("./_object-keys"),x=k.f,_=c.f,j=i.f,F=P.Symbol,L=P.JSON,X=L&&L.stringify,z="prototype",H=r("_hidden"),G=r("toPrimitive"),U={}.propertyIsEnumerable,B=p("symbol-registry"),W=p("symbols"),te=p("op-symbols"),de=Object[z],fe=typeof F=="function"&&!!D.f,be=P.QObject,Ce=!be||!be[z]||!be[z].findChild,ue=S&&C(function(){return v(_({},"a",{get:function(){return _(this,"a",{value:7}).a}})).a!=7})?function(xe,_e,Ne){var Be=x(de,_e);Be&&delete de[_e],_(xe,_e,Ne),Be&&xe!==de&&_(de,_e,Be)}:_,ge=function(xe){var _e=W[xe]=v(F[z]);return _e._k=xe,_e},pe=fe&&typeof F.iterator=="symbol"?function(xe){return typeof xe=="symbol"}:function(xe){return xe instanceof F},oe=function(_e,Ne,Be){return _e===de&&oe(te,Ne,Be),y(_e),Ne=u(Ne,!0),y(Be),m(W,Ne)?(Be.enumerable?(m(_e,H)&&_e[H][Ne]&&(_e[H][Ne]=!1),Be=v(Be,{enumerable:w(0,!1)})):(m(_e,H)||_(_e,H,w(1,{})),_e[H][Ne]=!0),ue(_e,Ne,Be)):_(_e,Ne,Be)},ae=function(_e,Ne){y(_e);for(var Be=f(Ne=o(Ne)),We=0,Ue=Be.length,ze;Ue>We;)oe(_e,ze=Be[We++],Ne[ze]);return _e},re=function(_e,Ne){return Ne===void 0?v(_e):ae(v(_e),Ne)},he=function(_e){var Ne=U.call(this,_e=u(_e,!0));return this===de&&m(W,_e)&&!m(te,_e)?!1:Ne||!m(this,_e)||!m(W,_e)||m(this,H)&&this[H][_e]?Ne:!0},Q=function(_e,Ne){if(_e=o(_e),Ne=u(Ne,!0),_e===de&&m(W,Ne)&&!m(te,Ne))return;var Be=x(_e,Ne);return Be&&m(W,Ne)&&!(m(_e,H)&&_e[H][Ne])&&(Be.enumerable=!0),Be},ie=function(_e){for(var Ne=j(o(_e)),Be=[],We=0,Ue;Ne.length>We;)!m(W,Ue=Ne[We++])&&Ue!=H&&Ue!=g&&Be.push(Ue);return Be},we=function(_e){for(var Ne=_e===de,Be=j(Ne?te:o(_e)),We=[],Ue=0,ze;Be.length>Ue;)m(W,ze=Be[Ue++])&&(Ne?m(de,ze):!0)&&We.push(W[ze]);return We};fe||(F=function(){if(this instanceof F)throw TypeError("Symbol is not a constructor!");var _e=a(arguments.length>0?arguments[0]:void 0),Ne=function(Be){this===de&&Ne.call(te,Be),m(this,H)&&m(this[H],_e)&&(this[H][_e]=!1),ue(this,_e,w(1,Be))};return S&&Ce&&ue(de,_e,{configurable:!0,set:Ne}),ge(_e)},T(F[z],"toString",function(){return this._k}),k.f=Q,c.f=oe,I("./_object-gopn").f=i.f=ie,I("./_object-pie").f=he,D.f=we,S&&!I("./_library")&&T(de,"propertyIsEnumerable",he,!0),h.f=function(xe){return ge(r(xe))}),R(R.G+R.W+R.F*!fe,{Symbol:F});for(var ne="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),J=0;ne.length>J;)r(ne[J++]);for(var V=b(r.store),Z=0;V.length>Z;)d(V[Z++]);R(R.S+R.F*!fe,"Symbol",{for:function(xe){return m(B,xe+="")?B[xe]:B[xe]=F(xe)},keyFor:function(_e){if(!pe(_e))throw TypeError(_e+" is not a symbol!");for(var Ne in B)if(B[Ne]===_e)return Ne},useSetter:function(){Ce=!0},useSimple:function(){Ce=!1}}),R(R.S+R.F*!fe,"Object",{create:re,defineProperty:oe,defineProperties:ae,getOwnPropertyDescriptor:Q,getOwnPropertyNames:ie,getOwnPropertySymbols:we});var Ee=C(function(){D.f(1)});R(R.S+R.F*Ee,"Object",{getOwnPropertySymbols:function(_e){return D.f(n(_e))}}),L&&R(R.S+R.F*(!fe||C(function(){var xe=F();return X([xe])!="[null]"||X({a:xe})!="{}"||X(Object(xe))!="{}"})),"JSON",{stringify:function(_e){for(var Ne=[_e],Be=1,We,Ue;arguments.length>Be;)Ne.push(arguments[Be++]);return Ue=We=Ne[1],!l(We)&&_e===void 0||pe(_e)?void 0:(E(We)||(We=function(ze,Ke){if(typeof Ue=="function"&&(Ke=Ue.call(this,ze,Ke)),!pe(Ke))return Ke}),Ne[1]=We,X.apply(L,Ne))}}),F[z][G]||I("./_hide")(F[z],G,F[z].valueOf),s(F,"Symbol"),s(Math,"Math",!0),s(P.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(I,q,M){var P=I("./_export"),m=I("./_object-to-array")(!0);P(P.S,"Object",{entries:function(R){return m(R)}})},{"./_export":107,"./_object-to-array":143}],183:[function(I,q,M){"use strict";var P=I("./_export"),m=I("./_core"),S=I("./_global"),R=I("./_species-constructor"),T=I("./_promise-resolve");P(P.P+P.R,"Promise",{finally:function(g){var C=R(this,m.Promise||S.Promise),p=typeof g=="function";return this.then(p?function(s){return T(C,g()).then(function(){return s})}:g,p?function(s){return T(C,g()).then(function(){throw s})}:g)}})},{"./_core":99,"./_export":107,"./_global":110,"./_promise-resolve":145,"./_species-constructor":153}],184:[function(I,q,M){"use strict";var P=I("./_export"),m=I("./_new-promise-capability"),S=I("./_perform");P(P.S,"Promise",{try:function(R){var T=m.f(this),g=S(R);return(g.e?T.reject:T.resolve)(g.v),T.promise}})},{"./_export":107,"./_new-promise-capability":129,"./_perform":144}],185:[function(I,q,M){I("./_wks-define")("asyncIterator")},{"./_wks-define":164}],186:[function(I,q,M){I("./_wks-define")("observable")},{"./_wks-define":164}],187:[function(I,q,M){I("./es6.array.iterator");for(var P=I("./_global"),m=I("./_hide"),S=I("./_iterators"),R=I("./_wks")("toStringTag"),T="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),g=0;g<T.length;g++){var C=T[g],p=P[C],s=p&&p.prototype;s&&!s[R]&&m(s,R,C),S[C]=S.Array}},{"./_global":110,"./_hide":112,"./_iterators":125,"./_wks":166,"./es6.array.iterator":169}],188:[function(I,q,M){var P=I("./_export"),m=I("./_task");P(P.G+P.B,{setImmediate:m.set,clearImmediate:m.clear})},{"./_export":107,"./_task":155}],189:[function(I,q,M){(function(P){"use strict";var m=I("babel-runtime/helpers/typeof"),S=R(m);function R(u){return u&&u.__esModule?u:{default:u}}function T(u){return Array.isArray?Array.isArray(u):o(u)==="[object Array]"}M.isArray=T;function g(u){return typeof u=="boolean"}M.isBoolean=g;function C(u){return u===null}M.isNull=C;function p(u){return u==null}M.isNullOrUndefined=p;function s(u){return typeof u=="number"}M.isNumber=s;function a(u){return typeof u=="string"}M.isString=a;function r(u){return(typeof u=="undefined"?"undefined":(0,S.default)(u))==="symbol"}M.isSymbol=r;function h(u){return u===void 0}M.isUndefined=h;function d(u){return o(u)==="[object RegExp]"}M.isRegExp=d;function f(u){return(typeof u=="undefined"?"undefined":(0,S.default)(u))==="object"&&u!==null}M.isObject=f;function E(u){return o(u)==="[object Date]"}M.isDate=E;function y(u){return o(u)==="[object Error]"||u instanceof Error}M.isError=y;function l(u){return typeof u=="function"}M.isFunction=l;function n(u){return u===null||typeof u=="boolean"||typeof u=="number"||typeof u=="string"||(typeof u=="undefined"?"undefined":(0,S.default)(u))==="symbol"||typeof u=="undefined"}M.isPrimitive=n,M.isBuffer=P.isBuffer;function o(u){return Object.prototype.toString.call(u)}}).call(this,{isBuffer:I("../../is-buffer/index.js")})},{"../../is-buffer/index.js":197,"babel-runtime/helpers/typeof":67}],190:[function(I,q,M){"use strict";var P=I("babel-runtime/helpers/typeof"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(R){"use strict";var T=function(){var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,r=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,h=/[^-+\dA-Z]/g;return function(d,f,E,y){if(arguments.length===1&&s(d)==="string"&&!/\d/.test(d)&&(f=d,d=void 0),d=d||new Date,d instanceof Date||(d=new Date(d)),isNaN(d))throw TypeError("Invalid date");f=String(T.masks[f]||f||T.masks.default);var l=f.slice(0,4);(l==="UTC:"||l==="GMT:")&&(f=f.slice(4),E=!0,l==="GMT:"&&(y=!0));var n=E?"getUTC":"get",o=d[n+"Date"](),u=d[n+"Day"](),w=d[n+"Month"](),v=d[n+"FullYear"](),i=d[n+"Hours"](),k=d[n+"Minutes"](),D=d[n+"Seconds"](),c=d[n+"Milliseconds"](),b=E?0:d.getTimezoneOffset(),x=C(d),_=p(d),j={d:o,dd:g(o),ddd:T.i18n.dayNames[u],dddd:T.i18n.dayNames[u+7],m:w+1,mm:g(w+1),mmm:T.i18n.monthNames[w],mmmm:T.i18n.monthNames[w+12],yy:String(v).slice(2),yyyy:v,h:i%12||12,hh:g(i%12||12),H:i,HH:g(i),M:k,MM:g(k),s:D,ss:g(D),l:g(c,3),L:g(Math.round(c/10)),t:i<12?"a":"p",tt:i<12?"am":"pm",T:i<12?"A":"P",TT:i<12?"AM":"PM",Z:y?"GMT":E?"UTC":(String(d).match(r)||[""]).pop().replace(h,""),o:(b>0?"-":"+")+g(Math.floor(Math.abs(b)/60)*100+Math.abs(b)%60,4),S:["th","st","nd","rd"][o%10>3?0:(o%100-o%10!=10)*o%10],W:x,N:_};return f.replace(a,function(F){return F in j?j[F]:F.slice(1,F.length-1)})}}();T.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},T.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};function g(a,r){for(a=String(a),r=r||2;a.length<r;)a="0"+a;return a}function C(a){var r=new Date(a.getFullYear(),a.getMonth(),a.getDate());r.setDate(r.getDate()-(r.getDay()+6)%7+3);var h=new Date(r.getFullYear(),0,4);h.setDate(h.getDate()-(h.getDay()+6)%7+3);var d=r.getTimezoneOffset()-h.getTimezoneOffset();r.setHours(r.getHours()-d);var f=(r-h)/(864e5*7);return 1+Math.floor(f)}function p(a){var r=a.getDay();return r===0&&(r=7),r}function s(a){return a===null?"null":a===void 0?"undefined":(typeof a=="undefined"?"undefined":(0,m.default)(a))!=="object"?typeof a=="undefined"?"undefined":(0,m.default)(a):Array.isArray(a)?"array":{}.toString.call(a).slice(8,-1).toLowerCase()}typeof define=="function"&&define.amd?define(function(){return T}):(typeof M=="undefined"?"undefined":(0,m.default)(M))==="object"?q.exports=T:R.dateFormat=T})(void 0)},{"babel-runtime/helpers/typeof":67}],191:[function(I,q,M){/*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
*/"use strict";var P=/["'&<>]/;q.exports=m;function m(S){var R=""+S,T=P.exec(R);if(!T)return R;var g,C="",p=0,s=0;for(p=T.index;p<R.length;p++){switch(R.charCodeAt(p)){case 34:g="&quot;";break;case 38:g="&amp;";break;case 39:g="&#39;";break;case 60:g="&lt;";break;case 62:g="&gt;";break;default:continue}s!==p&&(C+=R.substring(s,p)),s=p+1,C+=g}return s!==p?C+R.substring(s,p):C}},{}],192:[function(I,q,M){function P(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}q.exports=P,P.EventEmitter=P,P.prototype._events=void 0,P.prototype._maxListeners=void 0,P.defaultMaxListeners=10,P.prototype.setMaxListeners=function(g){if(!S(g)||g<0||isNaN(g))throw TypeError("n must be a positive number");return this._maxListeners=g,this},P.prototype.emit=function(g){var C,p,s,a,r,h;if(this._events||(this._events={}),g==="error"&&(!this._events.error||R(this._events.error)&&!this._events.error.length)){if(C=arguments[1],C instanceof Error)throw C;var d=new Error('Uncaught, unspecified "error" event. ('+C+")");throw d.context=C,d}if(p=this._events[g],T(p))return!1;if(m(p))switch(arguments.length){case 1:p.call(this);break;case 2:p.call(this,arguments[1]);break;case 3:p.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),p.apply(this,a)}else if(R(p))for(a=Array.prototype.slice.call(arguments,1),h=p.slice(),s=h.length,r=0;r<s;r++)h[r].apply(this,a);return!0},P.prototype.addListener=function(g,C){var p;if(!m(C))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",g,m(C.listener)?C.listener:C),this._events[g]?R(this._events[g])?this._events[g].push(C):this._events[g]=[this._events[g],C]:this._events[g]=C,R(this._events[g])&&!this._events[g].warned&&(T(this._maxListeners)?p=P.defaultMaxListeners:p=this._maxListeners,p&&p>0&&this._events[g].length>p&&(this._events[g].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[g].length),typeof console.trace=="function"&&console.trace())),this},P.prototype.on=P.prototype.addListener,P.prototype.once=function(g,C){if(!m(C))throw TypeError("listener must be a function");var p=!1;function s(){this.removeListener(g,s),p||(p=!0,C.apply(this,arguments))}return s.listener=C,this.on(g,s),this},P.prototype.removeListener=function(g,C){var p,s,a,r;if(!m(C))throw TypeError("listener must be a function");if(!this._events||!this._events[g])return this;if(p=this._events[g],a=p.length,s=-1,p===C||m(p.listener)&&p.listener===C)delete this._events[g],this._events.removeListener&&this.emit("removeListener",g,C);else if(R(p)){for(r=a;r-- >0;)if(p[r]===C||p[r].listener&&p[r].listener===C){s=r;break}if(s<0)return this;p.length===1?(p.length=0,delete this._events[g]):p.splice(s,1),this._events.removeListener&&this.emit("removeListener",g,C)}return this},P.prototype.removeAllListeners=function(g){var C,p;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[g]&&delete this._events[g],this;if(arguments.length===0){for(C in this._events){if(C==="removeListener")continue;this.removeAllListeners(C)}return this.removeAllListeners("removeListener"),this._events={},this}if(p=this._events[g],m(p))this.removeListener(g,p);else if(p)for(;p.length;)this.removeListener(g,p[p.length-1]);return delete this._events[g],this},P.prototype.listeners=function(g){var C;return!this._events||!this._events[g]?C=[]:m(this._events[g])?C=[this._events[g]]:C=this._events[g].slice(),C},P.prototype.listenerCount=function(g){if(this._events){var C=this._events[g];if(m(C))return 1;if(C)return C.length}return 0},P.listenerCount=function(g,C){return g.listenerCount(C)};function m(g){return typeof g=="function"}function S(g){return typeof g=="number"}function R(g){return typeof g=="object"&&g!==null}function T(g){return g===void 0}},{}],193:[function(I,q,M){var P=I("http"),m=q.exports;for(var S in P)P.hasOwnProperty(S)&&(m[S]=P[S]);m.request=function(R,T){return R||(R={}),R.scheme="https",R.protocol="https:",P.request.call(this,R,T)}},{http:231}],194:[function(I,q,M){/*!
* humanize-ms - index.js
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
* MIT Licensed
*/"use strict";var P=I("util"),m=I("ms");q.exports=function(S){if(typeof S=="number")return S;var R=m(S);if(R===void 0){var T=new Error(P.format("humanize-ms(%j) result undefined",S));console.warn(T.stack)}return R}},{ms:204,util:243}],195:[function(I,q,M){M.read=function(P,m,S,R,T){var g,C,p=T*8-R-1,s=(1<<p)-1,a=s>>1,r=-7,h=S?T-1:0,d=S?-1:1,f=P[m+h];for(h+=d,g=f&(1<<-r)-1,f>>=-r,r+=p;r>0;g=g*256+P[m+h],h+=d,r-=8);for(C=g&(1<<-r)-1,g>>=-r,r+=R;r>0;C=C*256+P[m+h],h+=d,r-=8);if(g===0)g=1-a;else{if(g===s)return C?NaN:(f?-1:1)*Infinity;C=C+Math.pow(2,R),g=g-a}return(f?-1:1)*C*Math.pow(2,g-R)},M.write=function(P,m,S,R,T,g){var C,p,s,a=g*8-T-1,r=(1<<a)-1,h=r>>1,d=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=R?0:g-1,E=R?1:-1,y=m<0||m===0&&1/m<0?1:0;for(m=Math.abs(m),isNaN(m)||m===Infinity?(p=isNaN(m)?1:0,C=r):(C=Math.floor(Math.log(m)/Math.LN2),m*(s=Math.pow(2,-C))<1&&(C--,s*=2),C+h>=1?m+=d/s:m+=d*Math.pow(2,1-h),m*s>=2&&(C++,s/=2),C+h>=r?(p=0,C=r):C+h>=1?(p=(m*s-1)*Math.pow(2,T),C=C+h):(p=m*Math.pow(2,h-1)*Math.pow(2,T),C=0));T>=8;P[S+f]=p&255,f+=E,p/=256,T-=8);for(C=C<<T|p,a+=T;a>0;P[S+f]=C&255,f+=E,C/=256,a-=8);P[S+f-E]|=y*128}},{}],196:[function(I,q,M){typeof Object.create=="function"?q.exports=function(m,S){S&&(m.super_=S,m.prototype=Object.create(S.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}))}:q.exports=function(m,S){if(S){m.super_=S;var R=function(){};R.prototype=S.prototype,m.prototype=new R,m.prototype.constructor=m}}},{}],197:[function(I,q,M){/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/q.exports=function(S){return S!=null&&(P(S)||m(S)||!!S._isBuffer)};function P(S){return!!S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S)}function m(S){return typeof S.readFloatLE=="function"&&typeof S.slice=="function"&&P(S.slice(0,0))}},{}],198:[function(I,q,M){var P={}.toString;q.exports=Array.isArray||function(m){return P.call(m)=="[object Array]"}},{}],199:[function(require,module,exports){(function(global){(function(I,q){typeof exports=="object"&&typeof module!="undefined"?module.exports=q(I):typeof define=="function"&&define.amd?define(q):q(I)})(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(I){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(I){for(var q={},M=0,P=I.length;M<P;M++)q[I.charAt(M)]=M;return q}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(I){if(I.length<2){var q=I.charCodeAt(0);return q<128?I: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+(I.charCodeAt(0)-55296)*1024+(I.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(I){return I.replace(re_utob,cb_utob)},cb_encode=function(I){var q=[0,2,1][I.length%3],M=I.charCodeAt(0)<<16|(I.length>1?I.charCodeAt(1):0)<<8|(I.length>2?I.charCodeAt(2):0),P=[b64chars.charAt(M>>>18),b64chars.charAt(M>>>12&63),q>=2?"=":b64chars.charAt(M>>>6&63),q>=1?"=":b64chars.charAt(M&63)];return P.join("")},btoa=global.btoa?function(I){return global.btoa(I)}:function(I){return I.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(I){var q=Object.prototype.toString.call(I)==="[object Uint8Array]";return q?I.toString("base64"):btoa(utob(String(I)))},encode=function(I,q){return q?_encode(String(I)).replace(/[+\/]/g,function(M){return M=="+"?"-":"_"}).replace(/=/g,""):_encode(I)},encodeURI=function(I){return encode(I,!0)},re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(I){switch(I.length){case 4:var q=(7&I.charCodeAt(0))<<18|(63&I.charCodeAt(1))<<12|(63&I.charCodeAt(2))<<6|63&I.charCodeAt(3),M=q-65536;return fromCharCode((M>>>10)+55296)+fromCharCode((M&1023)+56320);case 3:return fromCharCode((15&I.charCodeAt(0))<<12|(63&I.charCodeAt(1))<<6|63&I.charCodeAt(2));default:return fromCharCode((31&I.charCodeAt(0))<<6|63&I.charCodeAt(1))}},btou=function(I){return I.replace(re_btou,cb_btou)},cb_decode=function(I){var q=I.length,M=q%4,P=(q>0?b64tab[I.charAt(0)]<<18:0)|(q>1?b64tab[I.charAt(1)]<<12:0)|(q>2?b64tab[I.charAt(2)]<<6:0)|(q>3?b64tab[I.charAt(3)]:0),m=[fromCharCode(P>>>16),fromCharCode(P>>>8&255),fromCharCode(P&255)];return m.length-=[0,0,2,1][M],m.join("")},_atob=global.atob?function(I){return global.atob(I)}:function(I){return I.replace(/\S{1,4}/g,cb_decode)},atob=function(I){return _atob(String(I).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(I){return(I.constructor===buffer.constructor?I:buffer.from(I,"base64")).toString()}:function(I){return(I.constructor===buffer.constructor?I:new buffer(I,"base64")).toString()}:function(I){return btou(_atob(I))},decode=function(I){return _decode(String(I).replace(/[-_]/g,function(q){return q=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var I=global.Base64;return global.Base64=_Base64,I};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(I){return{value:I,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(I){return encode(this,I)})),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(I,q,M){/*!
* merge-descriptors
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/"use strict";q.exports=m;var P=Object.prototype.hasOwnProperty;function m(S,R,T){if(!S)throw new TypeError("argument dest is required");if(!R)throw new TypeError("argument src is required");return T===void 0&&(T=!0),Object.getOwnPropertyNames(R).forEach(function(C){if(!T&&P.call(S,C))return;var p=Object.getOwnPropertyDescriptor(R,C);Object.defineProperty(S,C,p)}),S}},{}],201:[function(I,q,M){"use strict";function P(){this._types=Object.create(null),this._extensions=Object.create(null);for(var m=0;m<arguments.length;m++)this.define(arguments[m]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}P.prototype.define=function(m,S){for(var R in m){var T=m[R].map(function(p){return p.toLowerCase()});R=R.toLowerCase();for(var g=0;g<T.length;g++){var C=T[g];if(C[0]=="*")continue;if(!S&&C in this._types)throw new Error('Attempt to change mapping for "'+C+'" extension from "'+this._types[C]+'" to "'+R+'". Pass `force=true` to allow this, otherwise remove "'+C+'" from the list of extensions for "'+R+'".');this._types[C]=R}if(S||!this._extensions[R]){var C=T[0];this._extensions[R]=C[0]!="*"?C:C.substr(1)}}},P.prototype.getType=function(m){m=String(m);var S=m.replace(/^.*[/\\]/,"").toLowerCase(),R=S.replace(/^.*\./,"").toLowerCase(),T=S.length<m.length,g=R.length<S.length-1;return(g||!T)&&this._types[R]||null},P.prototype.getExtension=function(m){return m=/^\s*([^;\s]*)/.test(m)&&RegExp.$1,m&&this._extensions[m.toLowerCase()]||null},q.exports=P},{}],202:[function(I,q,M){"use strict";var P=I("./Mime");q.exports=new P(I("./types/standard"))},{"./Mime":201,"./types/standard":203}],203:[function(I,q,M){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(I,q,M){var P=1e3,m=P*60,S=m*60,R=S*24,T=R*7,g=R*365.25;q.exports=function(r,h){h=h||{};var d=typeof r;if(d==="string"&&r.length>0)return C(r);if(d==="number"&&isFinite(r))return h.long?s(r):p(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function C(r){if(r=String(r),r.length>100)return;var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(!h)return;var d=parseFloat(h[1]),f=(h[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return d*g;case"weeks":case"week":case"w":return d*T;case"days":case"day":case"d":return d*R;case"hours":case"hour":case"hrs":case"hr":case"h":return d*S;case"minutes":case"minute":case"mins":case"min":case"m":return d*m;case"seconds":case"second":case"secs":case"sec":case"s":return d*P;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}function p(r){var h=Math.abs(r);return h>=R?Math.round(r/R)+"d":h>=S?Math.round(r/S)+"h":h>=m?Math.round(r/m)+"m":h>=P?Math.round(r/P)+"s":r+"ms"}function s(r){var h=Math.abs(r);return h>=R?a(r,h,R,"day"):h>=S?a(r,h,S,"hour"):h>=m?a(r,h,m,"minute"):h>=P?a(r,h,P,"second"):r+" ms"}function a(r,h,d,f){var E=h>=d*1.5;return Math.round(r/d)+" "+f+(E?"s":"")}},{}],205:[function(I,q,M){(function(P){function m(g,C){for(var p=0,s=g.length-1;s>=0;s--){var a=g[s];a==="."?g.splice(s,1):a===".."?(g.splice(s,1),p++):p&&(g.splice(s,1),p--)}if(C)for(;p--;p)g.unshift("..");return g}M.resolve=function(){for(var g="",C=!1,p=arguments.length-1;p>=-1&&!C;p--){var s=p>=0?arguments[p]:P.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!s)continue;g=s+"/"+g,C=s.charAt(0)==="/"}return g=m(R(g.split("/"),function(a){return!!a}),!C).join("/"),(C?"/":"")+g||"."},M.normalize=function(g){var C=M.isAbsolute(g),p=T(g,-1)==="/";return g=m(R(g.split("/"),function(s){return!!s}),!C).join("/"),!g&&!C&&(g="."),g&&p&&(g+="/"),(C?"/":"")+g},M.isAbsolute=function(g){return g.charAt(0)==="/"},M.join=function(){var g=Array.prototype.slice.call(arguments,0);return M.normalize(R(g,function(C,p){if(typeof C!="string")throw new TypeError("Arguments to path.join must be strings");return C}).join("/"))},M.relative=function(g,C){g=M.resolve(g).substr(1),C=M.resolve(C).substr(1);function p(E){for(var y=0;y<E.length&&!(E[y]!=="");y++);for(var l=E.length-1;l>=0&&!(E[l]!=="");l--);return y>l?[]:E.slice(y,l-y+1)}for(var s=p(g.split("/")),a=p(C.split("/")),r=Math.min(s.length,a.length),h=r,d=0;d<r;d++)if(s[d]!==a[d]){h=d;break}for(var f=[],d=h;d<s.length;d++)f.push("..");return f=f.concat(a.slice(h)),f.join("/")},M.sep="/",M.delimiter=":",M.dirname=function(g){if(typeof g!="string"&&(g=g+""),g.length===0)return".";for(var C=g.charCodeAt(0),p=C===47,s=-1,a=!0,r=g.length-1;r>=1;--r)if(C=g.charCodeAt(r),C===47){if(!a){s=r;break}}else a=!1;return s===-1?p?"/":".":p&&s===1?"/":g.slice(0,s)};function S(g){typeof g!="string"&&(g=g+"");var C=0,p=-1,s=!0,a;for(a=g.length-1;a>=0;--a)if(g.charCodeAt(a)===47){if(!s){C=a+1;break}}else p===-1&&(s=!1,p=a+1);return p===-1?"":g.slice(C,p)}M.basename=function(g,C){var p=S(g);return C&&p.substr(-1*C.length)===C&&(p=p.substr(0,p.length-C.length)),p},M.extname=function(g){typeof g!="string"&&(g=g+"");for(var C=-1,p=0,s=-1,a=!0,r=0,h=g.length-1;h>=0;--h){var d=g.charCodeAt(h);if(d===47){if(!a){p=h+1;break}continue}s===-1&&(a=!1,s=h+1),d===46?C===-1?C=h:r!==1&&(r=1):C!==-1&&(r=-1)}return C===-1||s===-1||r===0||r===1&&C===s-1&&C===p+1?"":g.slice(C,s)};function R(g,C){if(g.filter)return g.filter(C);for(var p=[],s=0;s<g.length;s++)C(g[s],s,g)&&p.push(g[s]);return p}var T="ab".substr(-1)==="b"?function(g,C,p){return g.substr(C,p)}:function(g,C,p){return C<0&&(C=g.length+C),g.substr(C,p)}}).call(this,I("_process"))},{_process:208}],206:[function(I,q,M){(function(P){/*!
* 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 m={function:!0,object:!0},S=m[typeof window]&&window||this,R=S,T=m[typeof M]&&M,g=m[typeof q]&&q&&!q.nodeType&&q,C=T&&g&&typeof P=="object"&&P;C&&(C.global===C||C.window===C||C.self===C)&&(S=C);var p=Math.pow(2,53)-1,s=/\bOpera/,a=this,r=Object.prototype,h=r.hasOwnProperty,d=r.toString;function f(c){return c=String(c),c.charAt(0).toUpperCase()+c.slice(1)}function E(c,b,x){var _={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return b&&x&&/^Win/i.test(c)&&!/^Windows Phone /i.test(c)&&(_=_[/[\d.]+$/.exec(c)])&&(c="Windows "+_),c=String(c),b&&x&&(c=c.replace(RegExp(b,"i"),x)),c=l(c.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]),c}function y(c,b){var x=-1,_=c?c.length:0;if(typeof _=="number"&&_>-1&&_<=p)for(;++x<_;)b(c[x],x,c);else n(c,b)}function l(c){return c=i(c),/^(?:webOS|i(?:OS|P))/.test(c)?c:f(c)}function n(c,b){for(var x in c)h.call(c,x)&&b(c[x],x,c)}function o(c){return c==null?f(c):d.call(c).slice(8,-1)}function u(c,b){var x=c!=null?typeof c[b]:"number";return!/^(?:boolean|number|string|undefined)$/.test(x)&&(x=="object"?!!c[b]:!0)}function w(c){return String(c).replace(/([ -])(?!$)/g,"$1?")}function v(c,b){var x=null;return y(c,function(_,j){x=b(x,_,j,c)}),x}function i(c){return String(c).replace(/^ +| +$/g,"")}function k(c){var b=S,x=c&&typeof c=="object"&&o(c)!="String";x&&(b=c,c=null);var _=b.navigator||{},j=_.userAgent||"";c||(c=j);var F=x||a==R,L=x?!!_.likeChrome:/\bChrome\b/.test(c)&&!/internal|\n/i.test(d.toString()),X="Object",z=x?X:"ScriptBridgingProxyObject",H=x?X:"Environment",G=x&&b.java?"JavaPackage":o(b.java),U=x?X:"RuntimeObject",B=/\bJava/.test(G)&&b.java,W=B&&o(b.environment)==H,te=B?"a":"\u03B1",de=B?"b":"\u03B2",fe=b.document||{},be=b.operamini||b.opera,Ce=s.test(Ce=x&&be?be["[[Class]]"]:o(be))?Ce:be=null,ue,ge=c,pe=[],oe=null,ae=c==j,re=ae&&be&&typeof be.version=="function"&&be.version(),he,Q=V([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),ie=Ee(["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"]),we=_e([{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"]),ne=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}}),J=xe(["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 V(Ue){return v(Ue,function(ze,Ke){return ze||RegExp("\\b"+(Ke.pattern||w(Ke))+"\\b","i").exec(c)&&(Ke.label||Ke)})}function Z(Ue){return v(Ue,function(ze,Ke,Ye){return ze||(Ke[we]||Ke[/^[a-z]+(?: +[a-z]+\b)*/i.exec(we)]||RegExp("\\b"+w(Ye)+"(?:\\b|\\w*\\d)","i").exec(c))&&Ye})}function Ee(Ue){return v(Ue,function(ze,Ke){return ze||RegExp("\\b"+(Ke.pattern||w(Ke))+"\\b","i").exec(c)&&(Ke.label||Ke)})}function xe(Ue){return v(Ue,function(ze,Ke){var Ye=Ke.pattern||w(Ke);return!ze&&(ze=RegExp("\\b"+Ye+"(?:/[\\d.]+|[ \\w.]*)","i").exec(c))&&(ze=E(ze,Ye,Ke.label||Ke)),ze})}function _e(Ue){return v(Ue,function(ze,Ke){var Ye=Ke.pattern||w(Ke);return!ze&&(ze=RegExp("\\b"+Ye+" *\\d+[.\\w_]*","i").exec(c)||RegExp("\\b"+Ye+" *\\w+-[\\w]*","i").exec(c)||RegExp("\\b"+Ye+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(c))&&((ze=String(Ke.label&&!RegExp(Ye,"i").test(Ke.label)?Ke.label:ze).split("/"))[1]&&!/[\d.]+/.test(ze[0])&&(ze[0]+=" "+ze[1]),Ke=Ke.label||Ke,ze=l(ze[0].replace(RegExp(Ye,"i"),Ke).replace(RegExp("; *(?:"+Ke+"[_-])?","i")," ").replace(RegExp("("+Ke+")[-_.]?(\\w)","i"),"$1 $2"))),ze})}function Ne(Ue){return v(Ue,function(ze,Ke){return ze||(RegExp(Ke+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(c)||0)[1]||null})}function Be(){return this.description||""}if(Q&&(Q=[Q]),ne&&!we&&(we=_e([ne])),(ue=/\bGoogle TV\b/.exec(we))&&(we=ue[0]),/\bSimulator\b/i.test(c)&&(we=(we?we+" ":"")+"Simulator"),ie=="Opera Mini"&&/\bOPiOS\b/.test(c)&&pe.push("running in Turbo/Uncompressed mode"),ie=="IE"&&/\blike iPhone OS\b/.test(c)?(ue=k(c.replace(/like iPhone OS/,"")),ne=ue.manufacturer,we=ue.product):/^iP/.test(we)?(ie||(ie="Safari"),J="iOS"+((ue=/ OS ([\d_]+)/i.exec(c))?" "+ue[1].replace(/_/g,"."):"")):ie=="Konqueror"&&!/buntu/i.test(J)?J="Kubuntu":ne&&ne!="Google"&&(/Chrome/.test(ie)&&!/\bMobile Safari\b/i.test(c)||/\bVita\b/.test(we))||/\bAndroid\b/.test(J)&&/^Chrome/.test(ie)&&/\bVersion\//i.test(c)?(ie="Android Browser",J=/\bAndroid\b/.test(J)?J:"Android"):ie=="Silk"?(/\bMobi/i.test(c)||(J="Android",pe.unshift("desktop mode")),/Accelerated *= *true/i.test(c)&&pe.unshift("accelerated")):ie=="PaleMoon"&&(ue=/\bFirefox\/([\d.]+)\b/.exec(c))?pe.push("identifying as Firefox "+ue[1]):ie=="Firefox"&&(ue=/\b(Mobile|Tablet|TV)\b/i.exec(c))?(J||(J="Firefox OS"),we||(we=ue[1])):!ie||(ue=!/\bMinefield\b/i.test(c)&&/\b(?:Firefox|Safari)\b/.exec(ie))?(ie&&!we&&/[\/,]|^[^(]+?\)/.test(c.slice(c.indexOf(ue+"/")+8))&&(ie=null),(ue=we||ne||J)&&(we||ne||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(J))&&(ie=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(J)?J:ue)+" Browser")):ie=="Electron"&&(ue=(/\bChrome\/([\d.]+)\b/.exec(c)||0)[1])&&pe.push("Chromium "+ue),re||(re=Ne(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",w(ie),"(?:Firefox|Minefield|NetFront)"])),(ue=Q=="iCab"&&parseFloat(re)>3&&"WebKit"||/\bOpera\b/.test(ie)&&(/\bOPR\b/.test(c)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(c)&&!/^(?:Trident|EdgeHTML)$/.test(Q)&&"WebKit"||!Q&&/\bMSIE\b/i.test(c)&&(J=="Mac OS"?"Tasman":"Trident")||Q=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(ie)&&"NetFront")&&(Q=[ue]),ie=="IE"&&(ue=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(c)||0)[1])?(ie+=" Mobile",J="Windows Phone "+(/\+$/.test(ue)?ue:ue+".x"),pe.unshift("desktop mode")):/\bWPDesktop\b/i.test(c)?(ie="IE Mobile",J="Windows Phone 8.x",pe.unshift("desktop mode"),re||(re=(/\brv:([\d.]+)/.exec(c)||0)[1])):ie!="IE"&&Q=="Trident"&&(ue=/\brv:([\d.]+)/.exec(c))&&(ie&&pe.push("identifying as "+ie+(re?" "+re:"")),ie="IE",re=ue[1]),ae){if(u(b,"global"))if(B&&(ue=B.lang.System,ge=ue.getProperty("os.arch"),J=J||ue.getProperty("os.name")+" "+ue.getProperty("os.version")),W){try{re=b.require("ringo/engine").version.join("."),ie="RingoJS"}catch(Ue){(ue=b.system)&&ue.global.system==b.system&&(ie="Narwhal",J||(J=ue[0].os||null))}ie||(ie="Rhino")}else typeof b.process=="object"&&!b.process.browser&&(ue=b.process)&&(typeof ue.versions=="object"&&(typeof ue.versions.electron=="string"?(pe.push("Node "+ue.versions.node),ie="Electron",re=ue.versions.electron):typeof ue.versions.nw=="string"&&(pe.push("Chromium "+re,"Node "+ue.versions.node),ie="NW.js",re=ue.versions.nw)),ie||(ie="Node.js",ge=ue.arch,J=ue.platform,re=/[\d.]+/.exec(ue.version),re=re?re[0]:null));else o(ue=b.runtime)==z?(ie="Adobe AIR",J=ue.flash.system.Capabilities.os):o(ue=b.phantom)==U?(ie="PhantomJS",re=(ue=ue.version||null)&&ue.major+"."+ue.minor+"."+ue.patch):typeof fe.documentMode=="number"&&(ue=/\bTrident\/(\d+)/i.exec(c))?(re=[re,fe.documentMode],(ue=+ue[1]+4)!=re[1]&&(pe.push("IE "+re[1]+" mode"),Q&&(Q[1]=""),re[1]=ue),re=ie=="IE"?String(re[1].toFixed(1)):re[0]):typeof fe.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ie)&&(pe.push("masking as "+ie+" "+re),ie="IE",re="11.0",Q=["Trident"],J="Windows");J=J&&l(J)}if(re&&(ue=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(re)||/(?:alpha|beta)(?: ?\d)?/i.exec(c+";"+(ae&&_.appMinorVersion))||/\bMinefield\b/i.test(c)&&"a")&&(oe=/b/i.test(ue)?"beta":"alpha",re=re.replace(RegExp(ue+"\\+?$"),"")+(oe=="beta"?de:te)+(/\d+\+?/.exec(ue)||"")),ie=="Fennec"||ie=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(J))ie="Firefox Mobile";else if(ie=="Maxthon"&&re)re=re.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(we))we=="Xbox 360"&&(J=null),we=="Xbox 360"&&/\bIEMobile\b/.test(c)&&pe.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(ie)||ie&&!we&&!/Browser|Mobi/.test(ie))&&(J=="Windows CE"||/Mobi/i.test(c)))ie+=" Mobile";else if(ie=="IE"&&ae)try{b.external===null&&pe.unshift("platform preview")}catch(Ue){pe.unshift("embedded")}else(/\bBlackBerry\b/.test(we)||/\bBB10\b/.test(c))&&(ue=(RegExp(we.replace(/ +/g," *")+"/([.\\d]+)","i").exec(c)||0)[1]||re)?(ue=[ue,/BB10/.test(c)],J=(ue[1]?(we=null,ne="BlackBerry"):"Device Software")+" "+ue[0],re=null):this!=n&&we!="Wii"&&(ae&&be||/Opera/.test(ie)&&/\b(?:MSIE|Firefox)\b/i.test(c)||ie=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(J)||ie=="IE"&&(J&&!/^Win/.test(J)&&re>5.5||/\bWindows XP\b/.test(J)&&re>8||re==8&&!/\bTrident\b/.test(c)))&&!s.test(ue=k.call(n,c.replace(s,"")+";"))&&ue.name&&(ue="ing as "+ue.name+((ue=ue.version)?" "+ue:""),s.test(ie)?(/\bIE\b/.test(ue)&&J=="Mac OS"&&(J=null),ue="identify"+ue):(ue="mask"+ue,Ce?ie=l(Ce.replace(/([a-z])([A-Z])/g,"$1 $2")):ie="Opera",/\bIE\b/.test(ue)&&(J=null),ae||(re=null)),Q=["Presto"],pe.push(ue));(ue=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(c)||0)[1])&&(ue=[parseFloat(ue.replace(/\.(\d)$/,".0$1")),ue],ie=="Safari"&&ue[1].slice(-1)=="+"?(ie="WebKit Nightly",oe="alpha",re=ue[1].slice(0,-1)):(re==ue[1]||re==(ue[2]=(/\bSafari\/([\d.]+\+?)/i.exec(c)||0)[1]))&&(re=null),ue[1]=(/\bChrome\/([\d.]+)/i.exec(c)||0)[1],ue[0]==537.36&&ue[2]==537.36&&parseFloat(ue[1])>=28&&Q=="WebKit"&&(Q=["Blink"]),!ae||!L&&!ue[1]?(Q&&(Q[1]="like Safari"),ue=(ue=ue[0],ue<400?1:ue<500?2:ue<526?3:ue<533?4:ue<534?"4+":ue<535?5:ue<537?6:ue<538?7:ue<601?8:"8")):(Q&&(Q[1]="like Chrome"),ue=ue[1]||(ue=ue[0],ue<530?1:ue<532?2:ue<532.05?3:ue<533?4:ue<534.03?5:ue<534.07?6:ue<534.1?7:ue<534.13?8:ue<534.16?9:ue<534.24?10:ue<534.3?11:ue<535.01?12:ue<535.02?"13+":ue<535.07?15:ue<535.11?16:ue<535.19?17:ue<536.05?18:ue<536.1?19:ue<537.01?20:ue<537.11?"21+":ue<537.13?23:ue<537.18?24:ue<537.24?25:ue<537.36?26:Q!="Blink"?"27":"28")),Q&&(Q[1]+=" "+(ue+=typeof ue=="number"?".x":/[.+]/.test(ue)?"":"+")),ie=="Safari"&&(!re||parseInt(re)>45)&&(re=ue)),ie=="Opera"&&(ue=/\bzbov|zvav$/.exec(J))?(ie+=" ",pe.unshift("desktop mode"),ue=="zvav"?(ie+="Mini",re=null):ie+="Mobile",J=J.replace(RegExp(" *"+ue+"$"),"")):ie=="Safari"&&/\bChrome\b/.exec(Q&&Q[1])&&(pe.unshift("desktop mode"),ie="Chrome Mobile",re=null,/\bOS X\b/.test(J)?(ne="Apple",J="iOS 4.3+"):J=null),re&&re.indexOf(ue=/[\d.]+$/.exec(J))==0&&c.indexOf("/"+ue+"-")>-1&&(J=i(J.replace(ue,""))),Q&&!/\b(?:Avant|Nook)\b/.test(ie)&&(/Browser|Lunascape|Maxthon/.test(ie)||ie!="Safari"&&/^iOS/.test(J)&&/\bSafari\b/.test(Q[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(ie)&&Q[1])&&((ue=Q[Q.length-1])&&pe.push(ue)),pe.length&&(pe=["("+pe.join("; ")+")"]),ne&&we&&we.indexOf(ne)<0&&pe.push("on "+ne),we&&pe.push((/^on /.test(pe[pe.length-1])?"":"on ")+we),J&&(ue=/ ([\d.+]+)$/.exec(J),he=ue&&J.charAt(J.length-ue[0].length-1)=="/",J={architecture:32,family:ue&&!he?J.replace(ue[0],""):J,version:ue?ue[1]:null,toString:function(){var Ue=this.version;return this.family+(Ue&&!he?" "+Ue:"")+(this.architecture==64?" 64-bit":"")}}),(ue=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(ge))&&!/\bi686\b/i.test(ge)?(J&&(J.architecture=64,J.family=J.family.replace(RegExp(" *"+ue),"")),ie&&(/\bWOW64\b/i.test(c)||ae&&/\w(?:86|32)$/.test(_.cpuClass||_.platform)&&!/\bWin64; x64\b/i.test(c))&&pe.unshift("32-bit")):J&&/^OS X/.test(J.family)&&ie=="Chrome"&&parseFloat(re)>=39&&(J.architecture=64),c||(c=null);var We={};return We.description=c,We.layout=Q&&Q[0],We.manufacturer=ne,We.name=ie,We.prerelease=oe,We.product=we,We.ua=c,We.version=ie&&re,We.os=J||{architecture:null,family:null,version:null,toString:function(){return"null"}},We.parse=k,We.toString=Be,We.version&&pe.unshift(re),We.name&&pe.unshift(ie),J&&ie&&!(J==String(J).split(" ")[0]&&(J==ie.split(" ")[0]||we))&&pe.push(we?"("+J+")":"on "+J),pe.length&&(We.description=pe.join(" ")),We}var D=k();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(S.platform=D,define(function(){return D})):T&&g?n(D,function(c,b){T[b]=c}):S.platform=D}).call(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],207:[function(I,q,M){(function(P){"use strict";typeof P=="undefined"||!P.version||P.version.indexOf("v0.")===0||P.version.indexOf("v1.")===0&&P.version.indexOf("v1.8.")!==0?q.exports={nextTick:m}:q.exports=P;function m(S,R,T,g){if(typeof S!="function")throw new TypeError('"callback" argument must be a function');var C=arguments.length,p,s;switch(C){case 0:case 1:return P.nextTick(S);case 2:return P.nextTick(function(){S.call(null,R)});case 3:return P.nextTick(function(){S.call(null,R,T)});case 4:return P.nextTick(function(){S.call(null,R,T,g)});default:for(p=new Array(C-1),s=0;s<p.length;)p[s++]=arguments[s];return P.nextTick(function(){S.apply(null,p)})}}}).call(this,I("_process"))},{_process:208}],208:[function(I,q,M){var P=q.exports={},m,S;function R(){throw new Error("setTimeout has not been defined")}function T(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?m=setTimeout:m=R}catch(y){m=R}try{typeof clearTimeout=="function"?S=clearTimeout:S=T}catch(y){S=T}})();function g(y){if(m===setTimeout)return setTimeout(y,0);if((m===R||!m)&&setTimeout)return m=setTimeout,setTimeout(y,0);try{return m(y,0)}catch(l){try{return m.call(null,y,0)}catch(n){return m.call(this,y,0)}}}function C(y){if(S===clearTimeout)return clearTimeout(y);if((S===T||!S)&&clearTimeout)return S=clearTimeout,clearTimeout(y);try{return S(y)}catch(l){try{return S.call(null,y)}catch(n){return S.call(this,y)}}}var p=[],s=!1,a,r=-1;function h(){if(!s||!a)return;s=!1,a.length?p=a.concat(p):r=-1,p.length&&d()}function d(){if(s)return;var y=g(h);s=!0;for(var l=p.length;l;){for(a=p,p=[];++r<l;)a&&a[r].run();r=-1,l=p.length}a=null,s=!1,C(y)}P.nextTick=function(y){var l=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)l[n-1]=arguments[n];p.push(new f(y,l)),p.length===1&&!s&&g(d)};function f(y,l){this.fun=y,this.array=l}f.prototype.run=function(){this.fun.apply(null,this.array)},P.title="browser",P.browser=!0,P.env={},P.argv=[],P.version="",P.versions={};function E(){}P.on=E,P.addListener=E,P.once=E,P.off=E,P.removeListener=E,P.removeAllListeners=E,P.emit=E,P.prependListener=E,P.prependOnceListener=E,P.listeners=function(y){return[]},P.binding=function(y){throw new Error("process.binding is not supported")},P.cwd=function(){return"/"},P.chdir=function(y){throw new Error("process.chdir is not supported")},P.umask=function(){return 0}},{}],209:[function(I,q,M){(function(P){/*! https://mths.be/punycode v1.4.1 by @mathias */(function(m){var S=typeof M=="object"&&M&&!M.nodeType&&M,R=typeof q=="object"&&q&&!q.nodeType&&q,T=typeof P=="object"&&P;(T.global===T||T.window===T||T.self===T)&&(m=T);var g,C=2147483647,p=36,s=1,a=26,r=38,h=700,d=72,f=128,E="-",y=/^xn--/,l=/[^\x20-\x7E]/,n=/[\x2E\u3002\uFF0E\uFF61]/g,o={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},u=p-s,w=Math.floor,v=String.fromCharCode,i;function k(G){throw new RangeError(o[G])}function D(G,U){for(var B=G.length,W=[];B--;)W[B]=U(G[B]);return W}function c(G,U){var B=G.split("@"),W="";B.length>1&&(W=B[0]+"@",G=B[1]),G=G.replace(n,".");var te=G.split("."),de=D(te,U).join(".");return W+de}function b(G){for(var U=[],B=0,W=G.length,te,de;B<W;)te=G.charCodeAt(B++),te>=55296&&te<=56319&&B<W?(de=G.charCodeAt(B++),(de&64512)==56320?U.push(((te&1023)<<10)+(de&1023)+65536):(U.push(te),B--)):U.push(te);return U}function x(G){return D(G,function(U){var B="";return U>65535&&(U-=65536,B+=v(U>>>10&1023|55296),U=56320|U&1023),B+=v(U),B}).join("")}function _(G){return G-48<10?G-22:G-65<26?G-65:G-97<26?G-97:p}function j(G,U){return G+22+75*(G<26)-((U!=0)<<5)}function F(G,U,B){var W=0;for(G=B?w(G/h):G>>1,G+=w(G/U);G>u*a>>1;W+=p)G=w(G/u);return w(W+(u+1)*G/(G+r))}function L(G){var U=[],B=G.length,W,te=0,de=f,fe=d,be,Ce,ue,ge,pe,oe,ae,re,he;for(be=G.lastIndexOf(E),be<0&&(be=0),Ce=0;Ce<be;++Ce)G.charCodeAt(Ce)>=128&&k("not-basic"),U.push(G.charCodeAt(Ce));for(ue=be>0?be+1:0;ue<B;){for(ge=te,pe=1,oe=p;!(ue>=B&&k("invalid-input"),ae=_(G.charCodeAt(ue++)),(ae>=p||ae>w((C-te)/pe))&&k("overflow"),te+=ae*pe,re=oe<=fe?s:oe>=fe+a?a:oe-fe,ae<re);oe+=p)he=p-re,pe>w(C/he)&&k("overflow"),pe*=he;W=U.length+1,fe=F(te-ge,W,ge==0),w(te/W)>C-de&&k("overflow"),de+=w(te/W),te%=W,U.splice(te++,0,de)}return x(U)}function X(G){var U,B,W,te,de,fe,be,Ce,ue,ge,pe,oe=[],ae,re,he,Q;for(G=b(G),ae=G.length,U=f,B=0,de=d,fe=0;fe<ae;++fe)pe=G[fe],pe<128&&oe.push(v(pe));for(W=te=oe.length,te&&oe.push(E);W<ae;){for(be=C,fe=0;fe<ae;++fe)pe=G[fe],pe>=U&&pe<be&&(be=pe);for(re=W+1,be-U>w((C-B)/re)&&k("overflow"),B+=(be-U)*re,U=be,fe=0;fe<ae;++fe)if(pe=G[fe],pe<U&&++B>C&&k("overflow"),pe==U){for(Ce=B,ue=p;!(ge=ue<=de?s:ue>=de+a?a:ue-de,Ce<ge);ue+=p)Q=Ce-ge,he=p-ge,oe.push(v(j(ge+Q%he,0))),Ce=w(Q/he);oe.push(v(j(Ce,0))),de=F(B,re,W==te),B=0,++W}++B,++U}return oe.join("")}function z(G){return c(G,function(U){return y.test(U)?L(U.slice(4).toLowerCase()):U})}function H(G){return c(G,function(U){return l.test(U)?"xn--"+X(U):U})}if(g={version:"1.4.1",ucs2:{decode:b,encode:x},decode:L,encode:X,toASCII:H,toUnicode:z},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return g});else if(S&&R)if(q.exports==S)R.exports=g;else for(i in g)g.hasOwnProperty(i)&&(S[i]=g[i]);else m.punycode=g})(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],210:[function(I,q,M){"use strict";function P(S,R){return Object.prototype.hasOwnProperty.call(S,R)}q.exports=function(S,R,T,g){R=R||"&",T=T||"=";var C={};if(typeof S!="string"||S.length===0)return C;var p=/\+/g;S=S.split(R);var s=1e3;g&&typeof g.maxKeys=="number"&&(s=g.maxKeys);var a=S.length;s>0&&a>s&&(a=s);for(var r=0;r<a;++r){var h=S[r].replace(p,"%20"),d=h.indexOf(T),f,E,y,l;d>=0?(f=h.substr(0,d),E=h.substr(d+1)):(f=h,E=""),y=decodeURIComponent(f),l=decodeURIComponent(E),P(C,y)?m(C[y])?C[y].push(l):C[y]=[C[y],l]:C[y]=l}return C};var m=Array.isArray||function(S){return Object.prototype.toString.call(S)==="[object Array]"}},{}],211:[function(I,q,M){"use strict";var P=function(T){switch(typeof T){case"string":return T;case"boolean":return T?"true":"false";case"number":return isFinite(T)?T:"";default:return""}};q.exports=function(T,g,C,p){return g=g||"&",C=C||"=",T===null&&(T=void 0),typeof T=="object"?S(R(T),function(s){var a=encodeURIComponent(P(s))+C;return m(T[s])?S(T[s],function(r){return a+encodeURIComponent(P(r))}).join(g):a+encodeURIComponent(P(T[s]))}).join(g):p?encodeURIComponent(P(p))+C+encodeURIComponent(P(T)):""};var m=Array.isArray||function(T){return Object.prototype.toString.call(T)==="[object Array]"};function S(T,g){if(T.map)return T.map(g);for(var C=[],p=0;p<T.length;p++)C.push(g(T[p],p));return C}var R=Object.keys||function(T){var g=[];for(var C in T)Object.prototype.hasOwnProperty.call(T,C)&&g.push(C);return g}},{}],212:[function(I,q,M){"use strict";M.decode=M.parse=I("./decode"),M.encode=M.stringify=I("./encode")},{"./decode":210,"./encode":211}],213:[function(I,q,M){q.exports=I("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":214}],214:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=T(P),S=I("babel-runtime/core-js/object/keys"),R=T(S);function T(l){return l&&l.__esModule?l:{default:l}}var g=I("process-nextick-args"),C=R.default||function(l){var n=[];for(var o in l)n.push(o);return n};q.exports=f;var p=(0,m.default)(I("core-util-is"));p.inherits=I("inherits");var s=I("./_stream_readable"),a=I("./_stream_writable");p.inherits(f,s);for(var r=C(a.prototype),h=0;h<r.length;h++){var d=r[h];f.prototype[d]||(f.prototype[d]=a.prototype[d])}function f(l){if(!(this instanceof f))return new f(l);s.call(this,l),a.call(this,l),l&&l.readable===!1&&(this.readable=!1),l&&l.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,l&&l.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",E)}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function E(){if(this.allowHalfOpen||this._writableState.ended)return;g.nextTick(y,this)}function y(l){l.end()}Object.defineProperty(f.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(n){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=n,this._writableState.destroyed=n}}),f.prototype._destroy=function(l,n){this.push(null),this.end(),g.nextTick(n,l)}},{"./_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(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(C){return C&&C.__esModule?C:{default:C}}q.exports=g;var R=I("./_stream_transform"),T=(0,m.default)(I("core-util-is"));T.inherits=I("inherits"),T.inherits(g,R);function g(C){if(!(this instanceof g))return new g(C);R.call(this,C)}g.prototype._transform=function(C,p,s){s(null,C)}},{"./_stream_transform":217,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],216:[function(I,q,M){(function(P,m){"use strict";var S=I("babel-runtime/core-js/object/get-prototype-of"),R=C(S),T=I("babel-runtime/core-js/object/create"),g=C(T);function C(Q){return Q&&Q.__esModule?Q:{default:Q}}var p=I("process-nextick-args");q.exports=b;var s=I("isarray"),a;b.ReadableState=c;var r=I("events").EventEmitter,h=function(ie,we){return ie.listeners(we).length},d=I("./internal/streams/stream"),f=I("safe-buffer").Buffer,E=m.Uint8Array||function(){};function y(Q){return f.from(Q)}function l(Q){return f.isBuffer(Q)||Q instanceof E}var n=(0,g.default)(I("core-util-is"));n.inherits=I("inherits");var o=I("util"),u=void 0;o&&o.debuglog?u=o.debuglog("stream"):u=function(){};var w=I("./internal/streams/BufferList"),v=I("./internal/streams/destroy"),i;n.inherits(b,d);var k=["error","close","destroy","pause","resume"];function D(Q,ie,we){if(typeof Q.prependListener=="function")return Q.prependListener(ie,we);!Q._events||!Q._events[ie]?Q.on(ie,we):s(Q._events[ie])?Q._events[ie].unshift(we):Q._events[ie]=[we,Q._events[ie]]}function c(Q,ie){a=a||I("./_stream_duplex"),Q=Q||{};var we=ie instanceof a;this.objectMode=!!Q.objectMode,we&&(this.objectMode=this.objectMode||!!Q.readableObjectMode);var ne=Q.highWaterMark,J=Q.readableHighWaterMark,V=this.objectMode?16:16*1024;ne||ne===0?this.highWaterMark=ne:we&&(J||J===0)?this.highWaterMark=J:this.highWaterMark=V,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=Q.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Q.encoding&&(i||(i=I("string_decoder/").StringDecoder),this.decoder=new i(Q.encoding),this.encoding=Q.encoding)}function b(Q){if(a=a||I("./_stream_duplex"),!(this instanceof b))return new b(Q);this._readableState=new c(Q,this),this.readable=!0,Q&&(typeof Q.read=="function"&&(this._read=Q.read),typeof Q.destroy=="function"&&(this._destroy=Q.destroy)),d.call(this)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ie){if(!this._readableState)return;this._readableState.destroyed=ie}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(Q,ie){this.push(null),ie(Q)},b.prototype.push=function(Q,ie){var we=this._readableState,ne;return we.objectMode?ne=!0:typeof Q=="string"&&(ie=ie||we.defaultEncoding,ie!==we.encoding&&(Q=f.from(Q,ie),ie=""),ne=!0),x(this,Q,ie,!1,ne)},b.prototype.unshift=function(Q){return x(this,Q,null,!0,!1)};function x(Q,ie,we,ne,J){var V=Q._readableState;if(ie===null)V.reading=!1,H(Q,V);else{var Z;J||(Z=j(V,ie)),Z?Q.emit("error",Z):V.objectMode||ie&&ie.length>0?(typeof ie!="string"&&!V.objectMode&&(0,R.default)(ie)!==f.prototype&&(ie=y(ie)),ne?V.endEmitted?Q.emit("error",new Error("stream.unshift() after end event")):_(Q,V,ie,!0):V.ended?Q.emit("error",new Error("stream.push() after EOF")):(V.reading=!1,V.decoder&&!we?(ie=V.decoder.write(ie),V.objectMode||ie.length!==0?_(Q,V,ie,!1):B(Q,V)):_(Q,V,ie,!1))):ne||(V.reading=!1)}return F(V)}function _(Q,ie,we,ne){ie.flowing&&ie.length===0&&!ie.sync?(Q.emit("data",we),Q.read(0)):(ie.length+=ie.objectMode?1:we.length,ne?ie.buffer.unshift(we):ie.buffer.push(we),ie.needReadable&&G(Q)),B(Q,ie)}function j(Q,ie){var we;return!l(ie)&&typeof ie!="string"&&ie!==void 0&&!Q.objectMode&&(we=new TypeError("Invalid non-string/buffer chunk")),we}function F(Q){return!Q.ended&&(Q.needReadable||Q.length<Q.highWaterMark||Q.length===0)}b.prototype.isPaused=function(){return this._readableState.flowing===!1},b.prototype.setEncoding=function(Q){return i||(i=I("string_decoder/").StringDecoder),this._readableState.decoder=new i(Q),this._readableState.encoding=Q,this};var L=8388608;function X(Q){return Q>=L?Q=L:(Q--,Q|=Q>>>1,Q|=Q>>>2,Q|=Q>>>4,Q|=Q>>>8,Q|=Q>>>16,Q++),Q}function z(Q,ie){return Q<=0||ie.length===0&&ie.ended?0:ie.objectMode?1:Q!==Q?ie.flowing&&ie.length?ie.buffer.head.data.length:ie.length:(Q>ie.highWaterMark&&(ie.highWaterMark=X(Q)),Q<=ie.length?Q:ie.ended?ie.length:(ie.needReadable=!0,0))}b.prototype.read=function(Q){u("read",Q),Q=parseInt(Q,10);var ie=this._readableState,we=Q;if(Q!==0&&(ie.emittedReadable=!1),Q===0&&ie.needReadable&&(ie.length>=ie.highWaterMark||ie.ended))return u("read: emitReadable",ie.length,ie.ended),ie.length===0&&ie.ended?ae(this):G(this),null;if(Q=z(Q,ie),Q===0&&ie.ended)return ie.length===0&&ae(this),null;var ne=ie.needReadable;u("need readable",ne),(ie.length===0||ie.length-Q<ie.highWaterMark)&&(ne=!0,u("length less than watermark",ne)),ie.ended||ie.reading?(ne=!1,u("reading or ended",ne)):ne&&(u("do read"),ie.reading=!0,ie.sync=!0,ie.length===0&&(ie.needReadable=!0),this._read(ie.highWaterMark),ie.sync=!1,ie.reading||(Q=z(we,ie)));var J;return Q>0?J=ue(Q,ie):J=null,J===null?(ie.needReadable=!0,Q=0):ie.length-=Q,ie.length===0&&(ie.ended||(ie.needReadable=!0),we!==Q&&ie.ended&&ae(this)),J!==null&&this.emit("data",J),J};function H(Q,ie){if(ie.ended)return;if(ie.decoder){var we=ie.decoder.end();we&&we.length&&(ie.buffer.push(we),ie.length+=ie.objectMode?1:we.length)}ie.ended=!0,G(Q)}function G(Q){var ie=Q._readableState;ie.needReadable=!1,ie.emittedReadable||(u("emitReadable",ie.flowing),ie.emittedReadable=!0,ie.sync?p.nextTick(U,Q):U(Q))}function U(Q){u("emit readable"),Q.emit("readable"),Ce(Q)}function B(Q,ie){ie.readingMore||(ie.readingMore=!0,p.nextTick(W,Q,ie))}function W(Q,ie){for(var we=ie.length;!ie.reading&&!ie.flowing&&!ie.ended&&ie.length<ie.highWaterMark&&!(u("maybeReadMore read 0"),Q.read(0),we===ie.length);)we=ie.length;ie.readingMore=!1}b.prototype._read=function(Q){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(Q,ie){var we=this,ne=this._readableState;switch(ne.pipesCount){case 0:ne.pipes=Q;break;case 1:ne.pipes=[ne.pipes,Q];break;default:ne.pipes.push(Q);break}ne.pipesCount+=1,u("pipe count=%d opts=%j",ne.pipesCount,ie);var J=(!ie||ie.end!==!1)&&Q!==P.stdout&&Q!==P.stderr,V=J?Ee:Ye;ne.endEmitted?p.nextTick(V):we.once("end",V),Q.on("unpipe",Z);function Z(Re,tt){u("onunpipe"),Re===we&&(tt&&tt.hasUnpiped===!1&&(tt.hasUnpiped=!0,Ne()))}function Ee(){u("onend"),Q.end()}var xe=te(we);Q.on("drain",xe);var _e=!1;function Ne(){u("cleanup"),Q.removeListener("close",ze),Q.removeListener("finish",Ke),Q.removeListener("drain",xe),Q.removeListener("error",Ue),Q.removeListener("unpipe",Z),we.removeListener("end",Ee),we.removeListener("end",Ye),we.removeListener("data",We),_e=!0,ne.awaitDrain&&(!Q._writableState||Q._writableState.needDrain)&&xe()}var Be=!1;we.on("data",We);function We(Re){u("ondata"),Be=!1;var tt=Q.write(Re);tt===!1&&!Be&&((ne.pipesCount===1&&ne.pipes===Q||ne.pipesCount>1&&he(ne.pipes,Q)!==-1)&&!_e&&(u("false write response, pause",we._readableState.awaitDrain),we._readableState.awaitDrain++,Be=!0),we.pause())}function Ue(Re){u("onerror",Re),Ye(),Q.removeListener("error",Ue),h(Q,"error")===0&&Q.emit("error",Re)}D(Q,"error",Ue);function ze(){Q.removeListener("finish",Ke),Ye()}Q.once("close",ze);function Ke(){u("onfinish"),Q.removeListener("close",ze),Ye()}Q.once("finish",Ke);function Ye(){u("unpipe"),we.unpipe(Q)}return Q.emit("pipe",we),ne.flowing||(u("pipe resume"),we.resume()),Q};function te(Q){return function(){var ie=Q._readableState;u("pipeOnDrain",ie.awaitDrain),ie.awaitDrain&&ie.awaitDrain--,ie.awaitDrain===0&&h(Q,"data")&&(ie.flowing=!0,Ce(Q))}}b.prototype.unpipe=function(Q){var ie=this._readableState,we={hasUnpiped:!1};if(ie.pipesCount===0)return this;if(ie.pipesCount===1)return Q&&Q!==ie.pipes?this:(Q||(Q=ie.pipes),ie.pipes=null,ie.pipesCount=0,ie.flowing=!1,Q&&Q.emit("unpipe",this,we),this);if(!Q){var ne=ie.pipes,J=ie.pipesCount;ie.pipes=null,ie.pipesCount=0,ie.flowing=!1;for(var V=0;V<J;V++)ne[V].emit("unpipe",this,we);return this}var Z=he(ie.pipes,Q);return Z===-1?this:(ie.pipes.splice(Z,1),ie.pipesCount-=1,ie.pipesCount===1&&(ie.pipes=ie.pipes[0]),Q.emit("unpipe",this,we),this)},b.prototype.on=function(Q,ie){var we=d.prototype.on.call(this,Q,ie);if(Q==="data")this._readableState.flowing!==!1&&this.resume();else if(Q==="readable"){var ne=this._readableState;!ne.endEmitted&&!ne.readableListening&&(ne.readableListening=ne.needReadable=!0,ne.emittedReadable=!1,ne.reading?ne.length&&G(this):p.nextTick(de,this))}return we},b.prototype.addListener=b.prototype.on;function de(Q){u("readable nexttick read 0"),Q.read(0)}b.prototype.resume=function(){var Q=this._readableState;return Q.flowing||(u("resume"),Q.flowing=!0,fe(this,Q)),this};function fe(Q,ie){ie.resumeScheduled||(ie.resumeScheduled=!0,p.nextTick(be,Q,ie))}function be(Q,ie){ie.reading||(u("resume read 0"),Q.read(0)),ie.resumeScheduled=!1,ie.awaitDrain=0,Q.emit("resume"),Ce(Q),ie.flowing&&!ie.reading&&Q.read(0)}b.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Ce(Q){var ie=Q._readableState;for(u("flow",ie.flowing);ie.flowing&&Q.read()!==null;);}b.prototype.wrap=function(Q){var ie=this,we=this._readableState,ne=!1;Q.on("end",function(){if(u("wrapped end"),we.decoder&&!we.ended){var Z=we.decoder.end();Z&&Z.length&&ie.push(Z)}ie.push(null)}),Q.on("data",function(Z){if(u("wrapped data"),we.decoder&&(Z=we.decoder.write(Z)),we.objectMode&&Z==null)return;if(!we.objectMode&&(!Z||!Z.length))return;var Ee=ie.push(Z);Ee||(ne=!0,Q.pause())});for(var J in Q)this[J]===void 0&&typeof Q[J]=="function"&&(this[J]=function(Z){return function(){return Q[Z].apply(Q,arguments)}}(J));for(var V=0;V<k.length;V++)Q.on(k[V],this.emit.bind(this,k[V]));return this._read=function(Z){u("wrapped _read",Z),ne&&(ne=!1,Q.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=ue;function ue(Q,ie){if(ie.length===0)return null;var we;return ie.objectMode?we=ie.buffer.shift():!Q||Q>=ie.length?(ie.decoder?we=ie.buffer.join(""):ie.buffer.length===1?we=ie.buffer.head.data:we=ie.buffer.concat(ie.length),ie.buffer.clear()):we=ge(Q,ie.buffer,ie.decoder),we}function ge(Q,ie,we){var ne;return Q<ie.head.data.length?(ne=ie.head.data.slice(0,Q),ie.head.data=ie.head.data.slice(Q)):Q===ie.head.data.length?ne=ie.shift():ne=we?pe(Q,ie):oe(Q,ie),ne}function pe(Q,ie){var we=ie.head,ne=1,J=we.data;for(Q-=J.length;we=we.next;){var V=we.data,Z=Q>V.length?V.length:Q;if(Z===V.length?J+=V:J+=V.slice(0,Q),Q-=Z,Q===0){Z===V.length?(++ne,we.next?ie.head=we.next:ie.head=ie.tail=null):(ie.head=we,we.data=V.slice(Z));break}++ne}return ie.length-=ne,J}function oe(Q,ie){var we=f.allocUnsafe(Q),ne=ie.head,J=1;for(ne.data.copy(we),Q-=ne.data.length;ne=ne.next;){var V=ne.data,Z=Q>V.length?V.length:Q;if(V.copy(we,we.length-Q,0,Z),Q-=Z,Q===0){Z===V.length?(++J,ne.next?ie.head=ne.next:ie.head=ie.tail=null):(ie.head=ne,ne.data=V.slice(Z));break}++J}return ie.length-=J,we}function ae(Q){var ie=Q._readableState;if(ie.length>0)throw new Error('"endReadable()" called on non-empty stream');ie.endEmitted||(ie.ended=!0,p.nextTick(re,ie,Q))}function re(Q,ie){!Q.endEmitted&&Q.length===0&&(Q.endEmitted=!0,ie.readable=!1,ie.emit("end"))}function he(Q,ie){for(var we=0,ne=Q.length;we<ne;we++)if(Q[we]===ie)return we;return-1}}).call(this,I("_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(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(a){return a&&a.__esModule?a:{default:a}}q.exports=C;var R=I("./_stream_duplex"),T=(0,m.default)(I("core-util-is"));T.inherits=I("inherits"),T.inherits(C,R);function g(a,r){var h=this._transformState;h.transforming=!1;var d=h.writecb;if(!d)return this.emit("error",new Error("write callback called multiple times"));h.writechunk=null,h.writecb=null,r!=null&&this.push(r),d(a);var f=this._readableState;f.reading=!1,(f.needReadable||f.length<f.highWaterMark)&&this._read(f.highWaterMark)}function C(a){if(!(this instanceof C))return new C(a);R.call(this,a),this._transformState={afterTransform:g.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,a&&(typeof a.transform=="function"&&(this._transform=a.transform),typeof a.flush=="function"&&(this._flush=a.flush)),this.on("prefinish",p)}function p(){var a=this;typeof this._flush=="function"?this._flush(function(r,h){s(a,r,h)}):s(this,null,null)}C.prototype.push=function(a,r){return this._transformState.needTransform=!1,R.prototype.push.call(this,a,r)},C.prototype._transform=function(a,r,h){throw new Error("_transform() is not implemented")},C.prototype._write=function(a,r,h){var d=this._transformState;if(d.writecb=h,d.writechunk=a,d.writeencoding=r,!d.transforming){var f=this._readableState;(d.needTransform||f.needReadable||f.length<f.highWaterMark)&&this._read(f.highWaterMark)}},C.prototype._read=function(a){var r=this._transformState;r.writechunk!==null&&r.writecb&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0},C.prototype._destroy=function(a,r){var h=this;R.prototype._destroy.call(this,a,function(d){r(d),h.emit("close")})};function s(a,r,h){if(r)return a.emit("error",r);if(h!=null&&a.push(h),a._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(a._transformState.transforming)throw new Error("Calling transform done when still transforming");return a.push(null)}},{"./_stream_duplex":214,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],218:[function(I,q,M){(function(P,m){"use strict";var S=I("babel-runtime/core-js/object/define-property"),R=d(S),T=I("babel-runtime/core-js/symbol/has-instance"),g=d(T),C=I("babel-runtime/core-js/symbol"),p=d(C),s=I("babel-runtime/core-js/object/create"),a=d(s),r=I("babel-runtime/core-js/set-immediate"),h=d(r);function d(oe){return oe&&oe.__esModule?oe:{default:oe}}var f=I("process-nextick-args");q.exports=j;function E(oe,ae,re){this.chunk=oe,this.encoding=ae,this.callback=re,this.next=null}function y(oe){var ae=this;this.next=null,this.entry=null,this.finish=function(){pe(ae,oe)}}var l=!P.browser&&["v0.10","v0.9."].indexOf(P.version.slice(0,5))>-1?h.default:f.nextTick,n;j.WritableState=x;var o=(0,a.default)(I("core-util-is"));o.inherits=I("inherits");var u={deprecate:I("util-deprecate")},w=I("./internal/streams/stream"),v=I("safe-buffer").Buffer,i=m.Uint8Array||function(){};function k(oe){return v.from(oe)}function D(oe){return v.isBuffer(oe)||oe instanceof i}var c=I("./internal/streams/destroy");o.inherits(j,w);function b(){}function x(oe,ae){n=n||I("./_stream_duplex"),oe=oe||{};var re=ae instanceof n;this.objectMode=!!oe.objectMode,re&&(this.objectMode=this.objectMode||!!oe.writableObjectMode);var he=oe.highWaterMark,Q=oe.writableHighWaterMark,ie=this.objectMode?16:16*1024;he||he===0?this.highWaterMark=he:re&&(Q||Q===0)?this.highWaterMark=Q:this.highWaterMark=ie,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 we=oe.decodeStrings===!1;this.decodeStrings=!we,this.defaultEncoding=oe.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ne){B(ae,ne)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new y(this)}x.prototype.getBuffer=function(){for(var ae=this.bufferedRequest,re=[];ae;)re.push(ae),ae=ae.next;return re},function(){try{Object.defineProperty(x.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(oe){}}();var _;typeof p.default=="function"&&g.default&&typeof Function.prototype[g.default]=="function"?(_=Function.prototype[g.default],(0,R.default)(j,g.default,{value:function(ae){return _.call(this,ae)?!0:this!==j?!1:ae&&ae._writableState instanceof x}})):_=function(ae){return ae instanceof this};function j(oe){if(n=n||I("./_stream_duplex"),!_.call(j,this)&&!(this instanceof n))return new j(oe);this._writableState=new x(oe,this),this.writable=!0,oe&&(typeof oe.write=="function"&&(this._write=oe.write),typeof oe.writev=="function"&&(this._writev=oe.writev),typeof oe.destroy=="function"&&(this._destroy=oe.destroy),typeof oe.final=="function"&&(this._final=oe.final)),w.call(this)}j.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function F(oe,ae){var re=new Error("write after end");oe.emit("error",re),f.nextTick(ae,re)}function L(oe,ae,re,he){var Q=!0,ie=!1;return re===null?ie=new TypeError("May not write null values to stream"):typeof re!="string"&&re!==void 0&&!ae.objectMode&&(ie=new TypeError("Invalid non-string/buffer chunk")),ie&&(oe.emit("error",ie),f.nextTick(he,ie),Q=!1),Q}j.prototype.write=function(oe,ae,re){var he=this._writableState,Q=!1,ie=!he.objectMode&&D(oe);return ie&&!v.isBuffer(oe)&&(oe=k(oe)),typeof ae=="function"&&(re=ae,ae=null),ie?ae="buffer":ae||(ae=he.defaultEncoding),typeof re!="function"&&(re=b),he.ended?F(this,re):(ie||L(this,he,oe,re))&&(he.pendingcb++,Q=z(this,he,ie,oe,ae,re)),Q},j.prototype.cork=function(){var oe=this._writableState;oe.corked++},j.prototype.uncork=function(){var oe=this._writableState;oe.corked&&(oe.corked--,!oe.writing&&!oe.corked&&!oe.finished&&!oe.bufferProcessing&&oe.bufferedRequest&&de(this,oe))},j.prototype.setDefaultEncoding=function(ae){if(typeof ae=="string"&&(ae=ae.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ae+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+ae);return this._writableState.defaultEncoding=ae,this};function X(oe,ae,re){return!oe.objectMode&&oe.decodeStrings!==!1&&typeof ae=="string"&&(ae=v.from(ae,re)),ae}Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function z(oe,ae,re,he,Q,ie){if(!re){var we=X(ae,he,Q);he!==we&&(re=!0,Q="buffer",he=we)}var ne=ae.objectMode?1:he.length;ae.length+=ne;var J=ae.length<ae.highWaterMark;if(J||(ae.needDrain=!0),ae.writing||ae.corked){var V=ae.lastBufferedRequest;ae.lastBufferedRequest={chunk:he,encoding:Q,isBuf:re,callback:ie,next:null},V?V.next=ae.lastBufferedRequest:ae.bufferedRequest=ae.lastBufferedRequest,ae.bufferedRequestCount+=1}else H(oe,ae,!1,ne,he,Q,ie);return J}function H(oe,ae,re,he,Q,ie,we){ae.writelen=he,ae.writecb=we,ae.writing=!0,ae.sync=!0,re?oe._writev(Q,ae.onwrite):oe._write(Q,ie,ae.onwrite),ae.sync=!1}function G(oe,ae,re,he,Q){--ae.pendingcb,re?(f.nextTick(Q,he),f.nextTick(ue,oe,ae),oe._writableState.errorEmitted=!0,oe.emit("error",he)):(Q(he),oe._writableState.errorEmitted=!0,oe.emit("error",he),ue(oe,ae))}function U(oe){oe.writing=!1,oe.writecb=null,oe.length-=oe.writelen,oe.writelen=0}function B(oe,ae){var re=oe._writableState,he=re.sync,Q=re.writecb;if(U(re),ae)G(oe,re,he,ae,Q);else{var ie=fe(re);!ie&&!re.corked&&!re.bufferProcessing&&re.bufferedRequest&&de(oe,re),he?l(W,oe,re,ie,Q):W(oe,re,ie,Q)}}function W(oe,ae,re,he){re||te(oe,ae),ae.pendingcb--,he(),ue(oe,ae)}function te(oe,ae){ae.length===0&&ae.needDrain&&(ae.needDrain=!1,oe.emit("drain"))}function de(oe,ae){ae.bufferProcessing=!0;var re=ae.bufferedRequest;if(oe._writev&&re&&re.next){var he=ae.bufferedRequestCount,Q=new Array(he),ie=ae.corkedRequestsFree;ie.entry=re;for(var we=0,ne=!0;re;)Q[we]=re,re.isBuf||(ne=!1),re=re.next,we+=1;Q.allBuffers=ne,H(oe,ae,!0,ae.length,Q,"",ie.finish),ae.pendingcb++,ae.lastBufferedRequest=null,ie.next?(ae.corkedRequestsFree=ie.next,ie.next=null):ae.corkedRequestsFree=new y(ae),ae.bufferedRequestCount=0}else{for(;re;){var J=re.chunk,V=re.encoding,Z=re.callback,Ee=ae.objectMode?1:J.length;if(H(oe,ae,!1,Ee,J,V,Z),re=re.next,ae.bufferedRequestCount--,ae.writing)break}re===null&&(ae.lastBufferedRequest=null)}ae.bufferedRequest=re,ae.bufferProcessing=!1}j.prototype._write=function(oe,ae,re){re(new Error("_write() is not implemented"))},j.prototype._writev=null,j.prototype.end=function(oe,ae,re){var he=this._writableState;typeof oe=="function"?(re=oe,oe=null,ae=null):typeof ae=="function"&&(re=ae,ae=null),oe!=null&&this.write(oe,ae),he.corked&&(he.corked=1,this.uncork()),!he.ending&&!he.finished&&ge(this,he,re)};function fe(oe){return oe.ending&&oe.length===0&&oe.bufferedRequest===null&&!oe.finished&&!oe.writing}function be(oe,ae){oe._final(function(re){ae.pendingcb--,re&&oe.emit("error",re),ae.prefinished=!0,oe.emit("prefinish"),ue(oe,ae)})}function Ce(oe,ae){!ae.prefinished&&!ae.finalCalled&&(typeof oe._final=="function"?(ae.pendingcb++,ae.finalCalled=!0,f.nextTick(be,oe,ae)):(ae.prefinished=!0,oe.emit("prefinish")))}function ue(oe,ae){var re=fe(ae);return re&&(Ce(oe,ae),ae.pendingcb===0&&(ae.finished=!0,oe.emit("finish"))),re}function ge(oe,ae,re){ae.ending=!0,ue(oe,ae),re&&(ae.finished?f.nextTick(re):oe.once("finish",re)),ae.ended=!0,oe.writable=!1}function pe(oe,ae,re){var he=oe.entry;for(oe.entry=null;he;){var Q=he.callback;ae.pendingcb--,Q(re),he=he.next}ae.corkedRequestsFree?ae.corkedRequestsFree.next=oe:ae.corkedRequestsFree=oe}Object.defineProperty(j.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ae){if(!this._writableState)return;this._writableState.destroyed=ae}}),j.prototype.destroy=c.destroy,j.prototype._undestroy=c.undestroy,j.prototype._destroy=function(oe,ae){this.end(),ae(oe)}}).call(this,I("_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(I,q,M){"use strict";function P(T,g){if(!(T instanceof g))throw new TypeError("Cannot call a class as a function")}var m=I("safe-buffer").Buffer,S=I("util");function R(T,g,C){T.copy(g,C)}q.exports=function(){function T(){P(this,T),this.head=null,this.tail=null,this.length=0}return T.prototype.push=function(C){var p={data:C,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length},T.prototype.unshift=function(C){var p={data:C,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length},T.prototype.shift=function(){if(this.length===0)return;var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C},T.prototype.clear=function(){this.head=this.tail=null,this.length=0},T.prototype.join=function(C){if(this.length===0)return"";for(var p=this.head,s=""+p.data;p=p.next;)s+=C+p.data;return s},T.prototype.concat=function(C){if(this.length===0)return m.alloc(0);if(this.length===1)return this.head.data;for(var p=m.allocUnsafe(C>>>0),s=this.head,a=0;s;)R(s.data,p,a),a+=s.data.length,s=s.next;return p},T}(),S&&S.inspect&&S.inspect.custom&&(q.exports.prototype[S.inspect.custom]=function(){var T=S.inspect({length:this.length});return this.constructor.name+" "+T})},{"safe-buffer":228,util:71}],220:[function(I,q,M){"use strict";var P=I("process-nextick-args");function m(T,g){var C=this,p=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return p||s?(g?g(T):T&&(!this._writableState||!this._writableState.errorEmitted)&&P.nextTick(R,this,T),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(T||null,function(a){!g&&a?(P.nextTick(R,C,a),C._writableState&&(C._writableState.errorEmitted=!0)):g&&g(a)}),this)}function S(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function R(T,g){T.emit("error",g)}q.exports={destroy:m,undestroy:S}},{"process-nextick-args":207}],221:[function(I,q,M){"use strict";q.exports=I("events").EventEmitter},{events:192}],222:[function(I,q,M){q.exports=I("./readable").PassThrough},{"./readable":223}],223:[function(I,q,M){M=q.exports=I("./lib/_stream_readable.js"),M.Stream=M,M.Readable=M,M.Writable=I("./lib/_stream_writable.js"),M.Duplex=I("./lib/_stream_duplex.js"),M.Transform=I("./lib/_stream_transform.js"),M.PassThrough=I("./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(I,q,M){q.exports=I("./readable").Transform},{"./readable":223}],225:[function(I,q,M){q.exports=I("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":218}],226:[function(I,q,M){var P=function(){return this}()||Function("return this")(),m=P.regeneratorRuntime&&Object.getOwnPropertyNames(P).indexOf("regeneratorRuntime")>=0,S=m&&P.regeneratorRuntime;if(P.regeneratorRuntime=void 0,q.exports=I("./runtime"),m)P.regeneratorRuntime=S;else try{delete P.regeneratorRuntime}catch(R){P.regeneratorRuntime=void 0}},{"./runtime":227}],227:[function(I,q,M){!function(P){"use strict";var m=Object.prototype,S=m.hasOwnProperty,R,T=typeof Symbol=="function"?Symbol:{},g=T.iterator||"@@iterator",C=T.asyncIterator||"@@asyncIterator",p=T.toStringTag||"@@toStringTag",s=typeof q=="object",a=P.regeneratorRuntime;if(a){s&&(q.exports=a);return}a=P.regeneratorRuntime=s?q.exports:{};function r(z,H,G,U){var B=H&&H.prototype instanceof n?H:n,W=Object.create(B.prototype),te=new F(U||[]);return W._invoke=b(z,G,te),W}a.wrap=r;function h(z,H,G){try{return{type:"normal",arg:z.call(H,G)}}catch(U){return{type:"throw",arg:U}}}var d="suspendedStart",f="suspendedYield",E="executing",y="completed",l={};function n(){}function o(){}function u(){}var w={};w[g]=function(){return this};var v=Object.getPrototypeOf,i=v&&v(v(L([])));i&&i!==m&&S.call(i,g)&&(w=i);var k=u.prototype=n.prototype=Object.create(w);o.prototype=k.constructor=u,u.constructor=o,u[p]=o.displayName="GeneratorFunction";function D(z){["next","throw","return"].forEach(function(H){z[H]=function(G){return this._invoke(H,G)}})}a.isGeneratorFunction=function(z){var H=typeof z=="function"&&z.constructor;return H?H===o||(H.displayName||H.name)==="GeneratorFunction":!1},a.mark=function(z){return Object.setPrototypeOf?Object.setPrototypeOf(z,u):(z.__proto__=u,p in z||(z[p]="GeneratorFunction")),z.prototype=Object.create(k),z},a.awrap=function(z){return{__await:z}};function c(z){function H(B,W,te,de){var fe=h(z[B],z,W);if(fe.type==="throw")de(fe.arg);else{var be=fe.arg,Ce=be.value;return Ce&&typeof Ce=="object"&&S.call(Ce,"__await")?Promise.resolve(Ce.__await).then(function(ue){H("next",ue,te,de)},function(ue){H("throw",ue,te,de)}):Promise.resolve(Ce).then(function(ue){be.value=ue,te(be)},de)}}var G;function U(B,W){function te(){return new Promise(function(de,fe){H(B,W,de,fe)})}return G=G?G.then(te,te):te()}this._invoke=U}D(c.prototype),c.prototype[C]=function(){return this},a.AsyncIterator=c,a.async=function(z,H,G,U){var B=new c(r(z,H,G,U));return a.isGeneratorFunction(H)?B:B.next().then(function(W){return W.done?W.value:B.next()})};function b(z,H,G){var U=d;return function(W,te){if(U===E)throw new Error("Generator is already running");if(U===y){if(W==="throw")throw te;return X()}for(G.method=W,G.arg=te;;){var de=G.delegate;if(de){var fe=x(de,G);if(fe){if(fe===l)continue;return fe}}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(U===d)throw U=y,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);U=E;var be=h(z,H,G);if(be.type==="normal"){if(U=G.done?y:f,be.arg===l)continue;return{value:be.arg,done:G.done}}else be.type==="throw"&&(U=y,G.method="throw",G.arg=be.arg)}}}function x(z,H){var G=z.iterator[H.method];if(G===R){if(H.delegate=null,H.method==="throw"){if(z.iterator.return&&(H.method="return",H.arg=R,x(z,H),H.method==="throw"))return l;H.method="throw",H.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var U=h(G,z.iterator,H.arg);if(U.type==="throw")return H.method="throw",H.arg=U.arg,H.delegate=null,l;var B=U.arg;if(!B)return H.method="throw",H.arg=new TypeError("iterator result is not an object"),H.delegate=null,l;if(B.done)H[z.resultName]=B.value,H.next=z.nextLoc,H.method!=="return"&&(H.method="next",H.arg=R);else return B;return H.delegate=null,l}D(k),k[p]="Generator",k[g]=function(){return this},k.toString=function(){return"[object Generator]"};function _(z){var H={tryLoc:z[0]};1 in z&&(H.catchLoc=z[1]),2 in z&&(H.finallyLoc=z[2],H.afterLoc=z[3]),this.tryEntries.push(H)}function j(z){var H=z.completion||{};H.type="normal",delete H.arg,z.completion=H}function F(z){this.tryEntries=[{tryLoc:"root"}],z.forEach(_,this),this.reset(!0)}a.keys=function(z){var H=[];for(var G in z)H.push(G);return H.reverse(),function U(){for(;H.length;){var B=H.pop();if(B in z)return U.value=B,U.done=!1,U}return U.done=!0,U}};function L(z){if(z){var H=z[g];if(H)return H.call(z);if(typeof z.next=="function")return z;if(!isNaN(z.length)){var G=-1,U=function B(){for(;++G<z.length;)if(S.call(z,G))return B.value=z[G],B.done=!1,B;return B.value=R,B.done=!0,B};return U.next=U}}return{next:X}}a.values=L;function X(){return{value:R,done:!0}}F.prototype={constructor:F,reset:function(z){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(j),!z)for(var H in this)H.charAt(0)==="t"&&S.call(this,H)&&!isNaN(+H.slice(1))&&(this[H]=R)},stop:function(){this.done=!0;var z=this.tryEntries[0],H=z.completion;if(H.type==="throw")throw H.arg;return this.rval},dispatchException:function(z){if(this.done)throw z;var H=this;function G(fe,be){return W.type="throw",W.arg=z,H.next=fe,be&&(H.method="next",H.arg=R),!!be}for(var U=this.tryEntries.length-1;U>=0;--U){var B=this.tryEntries[U],W=B.completion;if(B.tryLoc==="root")return G("end");if(B.tryLoc<=this.prev){var te=S.call(B,"catchLoc"),de=S.call(B,"finallyLoc");if(te&&de){if(this.prev<B.catchLoc)return G(B.catchLoc,!0);if(this.prev<B.finallyLoc)return G(B.finallyLoc)}else if(te){if(this.prev<B.catchLoc)return G(B.catchLoc,!0)}else if(de){if(this.prev<B.finallyLoc)return G(B.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(z,H){for(var G=this.tryEntries.length-1;G>=0;--G){var U=this.tryEntries[G];if(U.tryLoc<=this.prev&&S.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var B=U;break}}B&&(z==="break"||z==="continue")&&B.tryLoc<=H&&H<=B.finallyLoc&&(B=null);var W=B?B.completion:{};return W.type=z,W.arg=H,B?(this.method="next",this.next=B.finallyLoc,l):this.complete(W)},complete:function(z,H){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"&&H&&(this.next=H),l},finish:function(z){for(var H=this.tryEntries.length-1;H>=0;--H){var G=this.tryEntries[H];if(G.finallyLoc===z)return this.complete(G.completion,G.afterLoc),j(G),l}},catch:function(z){for(var H=this.tryEntries.length-1;H>=0;--H){var G=this.tryEntries[H];if(G.tryLoc===z){var U=G.completion;if(U.type==="throw"){var B=U.arg;j(G)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(z,H,G){return this.delegate={iterator:L(z),resultName:H,nextLoc:G},this.method==="next"&&(this.arg=R),l}}}(function(){return this}()||Function("return this")())},{}],228:[function(I,q,M){var P=I("buffer"),m=P.Buffer;function S(T,g){for(var C in T)g[C]=T[C]}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?q.exports=P:(S(P,M),M.Buffer=R);function R(T,g,C){return m(T,g,C)}S(m,R),R.from=function(T,g,C){if(typeof T=="number")throw new TypeError("Argument must not be a number");return m(T,g,C)},R.alloc=function(T,g,C){if(typeof T!="number")throw new TypeError("Argument must be a number");var p=m(T);return g!==void 0?typeof C=="string"?p.fill(g,C):p.fill(g):p.fill(0),p},R.allocUnsafe=function(T){if(typeof T!="number")throw new TypeError("Argument must be a number");return m(T)},R.allocUnsafeSlow=function(T){if(typeof T!="number")throw new TypeError("Argument must be a number");return P.SlowBuffer(T)}},{buffer:73}],229:[function(I,q,M){(function(P){"use strict";var m=I("babel-runtime/core-js/string/from-code-point"),S=f(m),R=I("babel-runtime/core-js/json/stringify"),T=f(R),g=I("babel-runtime/helpers/typeof"),C=f(g),p=I("babel-runtime/core-js/object/define-property"),s=f(p),a=I("babel-runtime/core-js/object/keys"),r=f(a),h=I("babel-runtime/core-js/object/create"),d=f(h);function f(E){return E&&E.__esModule?E:{default:E}}(function(E){E.parser=function(V,Z){return new l(V,Z)},E.SAXParser=l,E.SAXStream=k,E.createStream=i,E.MAX_BUFFER_LENGTH=64*1024;var y=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];E.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function l(V,Z){if(!(this instanceof l))return new l(V,Z);var Ee=this;o(Ee),Ee.q=Ee.c="",Ee.bufferCheckPosition=E.MAX_BUFFER_LENGTH,Ee.opt=Z||{},Ee.opt.lowercase=Ee.opt.lowercase||Ee.opt.lowercasetags,Ee.looseCase=Ee.opt.lowercase?"toLowerCase":"toUpperCase",Ee.tags=[],Ee.closed=Ee.closedRoot=Ee.sawRoot=!1,Ee.tag=Ee.error=null,Ee.strict=!!V,Ee.noscript=!!(V||Ee.opt.noscript),Ee.state=W.BEGIN,Ee.strictEntities=Ee.opt.strictEntities,Ee.ENTITIES=Ee.strictEntities?(0,d.default)(E.XML_ENTITIES):(0,d.default)(E.ENTITIES),Ee.attribList=[],Ee.opt.xmlns&&(Ee.ns=(0,d.default)(_)),Ee.trackPosition=Ee.opt.position!==!1,Ee.trackPosition&&(Ee.position=Ee.line=Ee.column=0),de(Ee,"onready")}d.default||(Object.create=function(V){function Z(){}Z.prototype=V;var Ee=new Z;return Ee}),r.default||(Object.keys=function(V){var Z=[];for(var Ee in V)V.hasOwnProperty(Ee)&&Z.push(Ee);return Z});function n(V){for(var Z=Math.max(E.MAX_BUFFER_LENGTH,10),Ee=0,xe=0,_e=y.length;xe<_e;xe++){var Ne=V[y[xe]].length;if(Ne>Z)switch(y[xe]){case"textNode":be(V);break;case"cdata":fe(V,"oncdata",V.cdata),V.cdata="";break;case"script":fe(V,"onscript",V.script),V.script="";break;default:ue(V,"Max buffer length exceeded: "+y[xe])}Ee=Math.max(Ee,Ne)}var Be=E.MAX_BUFFER_LENGTH-Ee;V.bufferCheckPosition=Be+V.position}function o(V){for(var Z=0,Ee=y.length;Z<Ee;Z++)V[y[Z]]=""}function u(V){be(V),V.cdata!==""&&(fe(V,"oncdata",V.cdata),V.cdata=""),V.script!==""&&(fe(V,"onscript",V.script),V.script="")}l.prototype={end:function(){ge(this)},write:J,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){u(this)}};var w;try{w=I("stream").Stream}catch(V){w=function(){}}var v=E.EVENTS.filter(function(V){return V!=="error"&&V!=="end"});function i(V,Z){return new k(V,Z)}function k(V,Z){if(!(this instanceof k))return new k(V,Z);w.apply(this),this._parser=new l(V,Z),this.writable=!0,this.readable=!0;var Ee=this;this._parser.onend=function(){Ee.emit("end")},this._parser.onerror=function(xe){Ee.emit("error",xe),Ee._parser.error=null},this._decoder=null,v.forEach(function(xe){(0,s.default)(Ee,"on"+xe,{get:function(){return Ee._parser["on"+xe]},set:function(Ne){if(!Ne)return Ee.removeAllListeners(xe),Ee._parser["on"+xe]=Ne,Ne;Ee.on(xe,Ne)},enumerable:!0,configurable:!1})})}k.prototype=(0,d.default)(w.prototype,{constructor:{value:k}}),k.prototype.write=function(V){if(typeof P=="function"&&typeof P.isBuffer=="function"&&P.isBuffer(V)){if(!this._decoder){var Z=I("string_decoder").StringDecoder;this._decoder=new Z("utf8")}V=this._decoder.write(V)}return this._parser.write(V.toString()),this.emit("data",V),!0},k.prototype.end=function(V){return V&&V.length&&this.write(V),this._parser.end(),!0},k.prototype.on=function(V,Z){var Ee=this;return!Ee._parser["on"+V]&&v.indexOf(V)!==-1&&(Ee._parser["on"+V]=function(){var xe=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);xe.splice(0,0,V),Ee.emit.apply(Ee,xe)}),w.prototype.on.call(Ee,V,Z)};var D="[CDATA[",c="DOCTYPE",b="http://www.w3.org/XML/1998/namespace",x="http://www.w3.org/2000/xmlns/",_={xml:b,xmlns:x},j=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,F=/[:_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-]/,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]/,X=/[#:_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(V){return V===" "||V===`
`||V==="\r"||V===" "}function H(V){return V==='"'||V==="'"}function G(V){return V===">"||z(V)}function U(V,Z){return V.test(Z)}function B(V,Z){return!U(V,Z)}var W=0;E.STATE={BEGIN:W++,BEGIN_WHITESPACE:W++,TEXT:W++,TEXT_ENTITY:W++,OPEN_WAKA:W++,SGML_DECL:W++,SGML_DECL_QUOTED:W++,DOCTYPE:W++,DOCTYPE_QUOTED:W++,DOCTYPE_DTD:W++,DOCTYPE_DTD_QUOTED:W++,COMMENT_STARTING:W++,COMMENT:W++,COMMENT_ENDING:W++,COMMENT_ENDED:W++,CDATA:W++,CDATA_ENDING:W++,CDATA_ENDING_2:W++,PROC_INST:W++,PROC_INST_BODY:W++,PROC_INST_ENDING:W++,OPEN_TAG:W++,OPEN_TAG_SLASH:W++,ATTRIB:W++,ATTRIB_NAME:W++,ATTRIB_NAME_SAW_WHITE:W++,ATTRIB_VALUE:W++,ATTRIB_VALUE_QUOTED:W++,ATTRIB_VALUE_CLOSED:W++,ATTRIB_VALUE_UNQUOTED:W++,ATTRIB_VALUE_ENTITY_Q:W++,ATTRIB_VALUE_ENTITY_U:W++,CLOSE_TAG:W++,CLOSE_TAG_SAW_WHITE:W++,SCRIPT:W++,SCRIPT_ENDING:W++},E.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},E.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},(0,r.default)(E.ENTITIES).forEach(function(V){var Z=E.ENTITIES[V],Ee=typeof Z=="number"?String.fromCharCode(Z):Z;E.ENTITIES[V]=Ee});for(var te in E.STATE)E.STATE[E.STATE[te]]=te;W=E.STATE;function de(V,Z,Ee){V[Z]&&V[Z](Ee)}function fe(V,Z,Ee){V.textNode&&be(V),de(V,Z,Ee)}function be(V){V.textNode=Ce(V.opt,V.textNode),V.textNode&&de(V,"ontext",V.textNode),V.textNode=""}function Ce(V,Z){return V.trim&&(Z=Z.trim()),V.normalize&&(Z=Z.replace(/\s+/g," ")),Z}function ue(V,Z){return be(V),V.trackPosition&&(Z+=`
Line: `+V.line+`
Column: `+V.column+`
Char: `+V.c),Z=new Error(Z),V.error=Z,de(V,"onerror",Z),V}function ge(V){return V.sawRoot&&!V.closedRoot&&pe(V,"Unclosed root tag"),V.state!==W.BEGIN&&V.state!==W.BEGIN_WHITESPACE&&V.state!==W.TEXT&&ue(V,"Unexpected end"),be(V),V.c="",V.closed=!0,de(V,"onend"),l.call(V,V.strict,V.opt),V}function pe(V,Z){if((typeof V=="undefined"?"undefined":(0,C.default)(V))!=="object"||!(V instanceof l))throw new Error("bad call to strictFail");V.strict&&ue(V,Z)}function oe(V){V.strict||(V.tagName=V.tagName[V.looseCase]());var Z=V.tags[V.tags.length-1]||V,Ee=V.tag={name:V.tagName,attributes:{}};V.opt.xmlns&&(Ee.ns=Z.ns),V.attribList.length=0,fe(V,"onopentagstart",Ee)}function ae(V,Z){var Ee=V.indexOf(":"),xe=Ee<0?["",V]:V.split(":"),_e=xe[0],Ne=xe[1];return Z&&V==="xmlns"&&(_e="xmlns",Ne=""),{prefix:_e,local:Ne}}function re(V){if(V.strict||(V.attribName=V.attribName[V.looseCase]()),V.attribList.indexOf(V.attribName)!==-1||V.tag.attributes.hasOwnProperty(V.attribName)){V.attribName=V.attribValue="";return}if(V.opt.xmlns){var Z=ae(V.attribName,!0),Ee=Z.prefix,xe=Z.local;if(Ee==="xmlns")if(xe==="xml"&&V.attribValue!==b)pe(V,"xml: prefix must be bound to "+b+`
Actual: `+V.attribValue);else if(xe==="xmlns"&&V.attribValue!==x)pe(V,"xmlns: prefix must be bound to "+x+`
Actual: `+V.attribValue);else{var _e=V.tag,Ne=V.tags[V.tags.length-1]||V;_e.ns===Ne.ns&&(_e.ns=(0,d.default)(Ne.ns)),_e.ns[xe]=V.attribValue}V.attribList.push([V.attribName,V.attribValue])}else V.tag.attributes[V.attribName]=V.attribValue,fe(V,"onattribute",{name:V.attribName,value:V.attribValue});V.attribName=V.attribValue=""}function he(V,Z){if(V.opt.xmlns){var Ee=V.tag,xe=ae(V.tagName);Ee.prefix=xe.prefix,Ee.local=xe.local,Ee.uri=Ee.ns[xe.prefix]||"",Ee.prefix&&!Ee.uri&&(pe(V,"Unbound namespace prefix: "+(0,T.default)(V.tagName)),Ee.uri=xe.prefix);var _e=V.tags[V.tags.length-1]||V;Ee.ns&&_e.ns!==Ee.ns&&(0,r.default)(Ee.ns).forEach(function(He){fe(V,"onopennamespace",{prefix:He,uri:Ee.ns[He]})});for(var Ne=0,Be=V.attribList.length;Ne<Be;Ne++){var We=V.attribList[Ne],Ue=We[0],ze=We[1],Ke=ae(Ue,!0),Ye=Ke.prefix,Re=Ke.local,tt=Ye===""?"":Ee.ns[Ye]||"",rt={name:Ue,value:ze,prefix:Ye,local:Re,uri:tt};Ye&&Ye!=="xmlns"&&!tt&&(pe(V,"Unbound namespace prefix: "+(0,T.default)(Ye)),rt.uri=Ye),V.tag.attributes[Ue]=rt,fe(V,"onattribute",rt)}V.attribList.length=0}V.tag.isSelfClosing=!!Z,V.sawRoot=!0,V.tags.push(V.tag),fe(V,"onopentag",V.tag),Z||(!V.noscript&&V.tagName.toLowerCase()==="script"?V.state=W.SCRIPT:V.state=W.TEXT,V.tag=null,V.tagName=""),V.attribName=V.attribValue="",V.attribList.length=0}function Q(V){if(!V.tagName){pe(V,"Weird empty close tag."),V.textNode+="</>",V.state=W.TEXT;return}if(V.script){if(V.tagName!=="script"){V.script+="</"+V.tagName+">",V.tagName="",V.state=W.SCRIPT;return}fe(V,"onscript",V.script),V.script=""}var Z=V.tags.length,Ee=V.tagName;V.strict||(Ee=Ee[V.looseCase]());for(var xe=Ee;Z--;){var _e=V.tags[Z];if(_e.name!==xe)pe(V,"Unexpected close tag");else break}if(Z<0){pe(V,"Unmatched closing tag: "+V.tagName),V.textNode+="</"+V.tagName+">",V.state=W.TEXT;return}V.tagName=Ee;for(var Ne=V.tags.length;Ne-- >Z;){var Be=V.tag=V.tags.pop();V.tagName=V.tag.name,fe(V,"onclosetag",V.tagName);var We={};for(var Ue in Be.ns)We[Ue]=Be.ns[Ue];var ze=V.tags[V.tags.length-1]||V;V.opt.xmlns&&Be.ns!==ze.ns&&(0,r.default)(Be.ns).forEach(function(Ke){var Ye=Be.ns[Ke];fe(V,"onclosenamespace",{prefix:Ke,uri:Ye})})}Z===0&&(V.closedRoot=!0),V.tagName=V.attribValue=V.attribName="",V.attribList.length=0,V.state=W.TEXT}function ie(V){var Z=V.entity,Ee=Z.toLowerCase(),xe,_e="";return V.ENTITIES[Z]?V.ENTITIES[Z]:V.ENTITIES[Ee]?V.ENTITIES[Ee]:(Z=Ee,Z.charAt(0)==="#"&&(Z.charAt(1)==="x"?(Z=Z.slice(2),xe=parseInt(Z,16),_e=xe.toString(16)):(Z=Z.slice(1),xe=parseInt(Z,10),_e=xe.toString(10))),Z=Z.replace(/^0+/,""),isNaN(xe)||_e.toLowerCase()!==Z?(pe(V,"Invalid character entity"),"&"+V.entity+";"):(0,S.default)(xe))}function we(V,Z){Z==="<"?(V.state=W.OPEN_WAKA,V.startTagPosition=V.position):z(Z)||(pe(V,"Non-whitespace before first tag."),V.textNode=Z,V.state=W.TEXT)}function ne(V,Z){var Ee="";return Z<V.length&&(Ee=V.charAt(Z)),Ee}function J(V){var Z=this;if(this.error)throw this.error;if(Z.closed)return ue(Z,"Cannot write after close. Assign an onready handler.");if(V===null)return ge(Z);(typeof V=="undefined"?"undefined":(0,C.default)(V))==="object"&&(V=V.toString());for(var Ee=0,xe="";!(xe=ne(V,Ee++),Z.c=xe,!xe);){Z.trackPosition&&(Z.position++,xe===`
`?(Z.line++,Z.column=0):Z.column++);switch(Z.state){case W.BEGIN:if(Z.state=W.BEGIN_WHITESPACE,xe==="\uFEFF")continue;we(Z,xe);continue;case W.BEGIN_WHITESPACE:we(Z,xe);continue;case W.TEXT:if(Z.sawRoot&&!Z.closedRoot){for(var _e=Ee-1;xe&&xe!=="<"&&xe!=="&";)xe=ne(V,Ee++),xe&&Z.trackPosition&&(Z.position++,xe===`
`?(Z.line++,Z.column=0):Z.column++);Z.textNode+=V.substring(_e,Ee-1)}xe==="<"&&!(Z.sawRoot&&Z.closedRoot&&!Z.strict)?(Z.state=W.OPEN_WAKA,Z.startTagPosition=Z.position):(!z(xe)&&(!Z.sawRoot||Z.closedRoot)&&pe(Z,"Text data outside of root node."),xe==="&"?Z.state=W.TEXT_ENTITY:Z.textNode+=xe);continue;case W.SCRIPT:xe==="<"?Z.state=W.SCRIPT_ENDING:Z.script+=xe;continue;case W.SCRIPT_ENDING:xe==="/"?Z.state=W.CLOSE_TAG:(Z.script+="<"+xe,Z.state=W.SCRIPT);continue;case W.OPEN_WAKA:if(xe==="!")Z.state=W.SGML_DECL,Z.sgmlDecl="";else if(!z(xe))if(U(j,xe))Z.state=W.OPEN_TAG,Z.tagName=xe;else if(xe==="/")Z.state=W.CLOSE_TAG,Z.tagName="";else if(xe==="?")Z.state=W.PROC_INST,Z.procInstName=Z.procInstBody="";else{if(pe(Z,"Unencoded <"),Z.startTagPosition+1<Z.position){var Ne=Z.position-Z.startTagPosition;xe=new Array(Ne).join(" ")+xe}Z.textNode+="<"+xe,Z.state=W.TEXT}continue;case W.SGML_DECL:(Z.sgmlDecl+xe).toUpperCase()===D?(fe(Z,"onopencdata"),Z.state=W.CDATA,Z.sgmlDecl="",Z.cdata=""):Z.sgmlDecl+xe==="--"?(Z.state=W.COMMENT,Z.comment="",Z.sgmlDecl=""):(Z.sgmlDecl+xe).toUpperCase()===c?(Z.state=W.DOCTYPE,(Z.doctype||Z.sawRoot)&&pe(Z,"Inappropriately located doctype declaration"),Z.doctype="",Z.sgmlDecl=""):xe===">"?(fe(Z,"onsgmldeclaration",Z.sgmlDecl),Z.sgmlDecl="",Z.state=W.TEXT):(H(xe)&&(Z.state=W.SGML_DECL_QUOTED),Z.sgmlDecl+=xe);continue;case W.SGML_DECL_QUOTED:xe===Z.q&&(Z.state=W.SGML_DECL,Z.q=""),Z.sgmlDecl+=xe;continue;case W.DOCTYPE:xe===">"?(Z.state=W.TEXT,fe(Z,"ondoctype",Z.doctype),Z.doctype=!0):(Z.doctype+=xe,xe==="["?Z.state=W.DOCTYPE_DTD:H(xe)&&(Z.state=W.DOCTYPE_QUOTED,Z.q=xe));continue;case W.DOCTYPE_QUOTED:Z.doctype+=xe,xe===Z.q&&(Z.q="",Z.state=W.DOCTYPE);continue;case W.DOCTYPE_DTD:Z.doctype+=xe,xe==="]"?Z.state=W.DOCTYPE:H(xe)&&(Z.state=W.DOCTYPE_DTD_QUOTED,Z.q=xe);continue;case W.DOCTYPE_DTD_QUOTED:Z.doctype+=xe,xe===Z.q&&(Z.state=W.DOCTYPE_DTD,Z.q="");continue;case W.COMMENT:xe==="-"?Z.state=W.COMMENT_ENDING:Z.comment+=xe;continue;case W.COMMENT_ENDING:xe==="-"?(Z.state=W.COMMENT_ENDED,Z.comment=Ce(Z.opt,Z.comment),Z.comment&&fe(Z,"oncomment",Z.comment),Z.comment=""):(Z.comment+="-"+xe,Z.state=W.COMMENT);continue;case W.COMMENT_ENDED:xe!==">"?(pe(Z,"Malformed comment"),Z.comment+="--"+xe,Z.state=W.COMMENT):Z.state=W.TEXT;continue;case W.CDATA:xe==="]"?Z.state=W.CDATA_ENDING:Z.cdata+=xe;continue;case W.CDATA_ENDING:xe==="]"?Z.state=W.CDATA_ENDING_2:(Z.cdata+="]"+xe,Z.state=W.CDATA);continue;case W.CDATA_ENDING_2:xe===">"?(Z.cdata&&fe(Z,"oncdata",Z.cdata),fe(Z,"onclosecdata"),Z.cdata="",Z.state=W.TEXT):xe==="]"?Z.cdata+="]":(Z.cdata+="]]"+xe,Z.state=W.CDATA);continue;case W.PROC_INST:xe==="?"?Z.state=W.PROC_INST_ENDING:z(xe)?Z.state=W.PROC_INST_BODY:Z.procInstName+=xe;continue;case W.PROC_INST_BODY:if(!Z.procInstBody&&z(xe))continue;xe==="?"?Z.state=W.PROC_INST_ENDING:Z.procInstBody+=xe;continue;case W.PROC_INST_ENDING:xe===">"?(fe(Z,"onprocessinginstruction",{name:Z.procInstName,body:Z.procInstBody}),Z.procInstName=Z.procInstBody="",Z.state=W.TEXT):(Z.procInstBody+="?"+xe,Z.state=W.PROC_INST_BODY);continue;case W.OPEN_TAG:U(F,xe)?Z.tagName+=xe:(oe(Z),xe===">"?he(Z):xe==="/"?Z.state=W.OPEN_TAG_SLASH:(z(xe)||pe(Z,"Invalid character in tag name"),Z.state=W.ATTRIB));continue;case W.OPEN_TAG_SLASH:xe===">"?(he(Z,!0),Q(Z)):(pe(Z,"Forward-slash in opening tag not followed by >"),Z.state=W.ATTRIB);continue;case W.ATTRIB:if(z(xe))continue;xe===">"?he(Z):xe==="/"?Z.state=W.OPEN_TAG_SLASH:U(j,xe)?(Z.attribName=xe,Z.attribValue="",Z.state=W.ATTRIB_NAME):pe(Z,"Invalid attribute name");continue;case W.ATTRIB_NAME:xe==="="?Z.state=W.ATTRIB_VALUE:xe===">"?(pe(Z,"Attribute without value"),Z.attribValue=Z.attribName,re(Z),he(Z)):z(xe)?Z.state=W.ATTRIB_NAME_SAW_WHITE:U(F,xe)?Z.attribName+=xe:pe(Z,"Invalid attribute name");continue;case W.ATTRIB_NAME_SAW_WHITE:if(xe==="=")Z.state=W.ATTRIB_VALUE;else{if(z(xe))continue;pe(Z,"Attribute without value"),Z.tag.attributes[Z.attribName]="",Z.attribValue="",fe(Z,"onattribute",{name:Z.attribName,value:""}),Z.attribName="",xe===">"?he(Z):U(j,xe)?(Z.attribName=xe,Z.state=W.ATTRIB_NAME):(pe(Z,"Invalid attribute name"),Z.state=W.ATTRIB)}continue;case W.ATTRIB_VALUE:if(z(xe))continue;H(xe)?(Z.q=xe,Z.state=W.ATTRIB_VALUE_QUOTED):(pe(Z,"Unquoted attribute value"),Z.state=W.ATTRIB_VALUE_UNQUOTED,Z.attribValue=xe);continue;case W.ATTRIB_VALUE_QUOTED:if(xe!==Z.q){xe==="&"?Z.state=W.ATTRIB_VALUE_ENTITY_Q:Z.attribValue+=xe;continue}re(Z),Z.q="",Z.state=W.ATTRIB_VALUE_CLOSED;continue;case W.ATTRIB_VALUE_CLOSED:z(xe)?Z.state=W.ATTRIB:xe===">"?he(Z):xe==="/"?Z.state=W.OPEN_TAG_SLASH:U(j,xe)?(pe(Z,"No whitespace between attributes"),Z.attribName=xe,Z.attribValue="",Z.state=W.ATTRIB_NAME):pe(Z,"Invalid attribute name");continue;case W.ATTRIB_VALUE_UNQUOTED:if(!G(xe)){xe==="&"?Z.state=W.ATTRIB_VALUE_ENTITY_U:Z.attribValue+=xe;continue}re(Z),xe===">"?he(Z):Z.state=W.ATTRIB;continue;case W.CLOSE_TAG:if(Z.tagName)xe===">"?Q(Z):U(F,xe)?Z.tagName+=xe:Z.script?(Z.script+="</"+Z.tagName,Z.tagName="",Z.state=W.SCRIPT):(z(xe)||pe(Z,"Invalid tagname in closing tag"),Z.state=W.CLOSE_TAG_SAW_WHITE);else{if(z(xe))continue;B(j,xe)?Z.script?(Z.script+="</"+xe,Z.state=W.SCRIPT):pe(Z,"Invalid tagname in closing tag."):Z.tagName=xe}continue;case W.CLOSE_TAG_SAW_WHITE:if(z(xe))continue;xe===">"?Q(Z):pe(Z,"Invalid characters in closing tag");continue;case W.TEXT_ENTITY:case W.ATTRIB_VALUE_ENTITY_Q:case W.ATTRIB_VALUE_ENTITY_U:var Be,We;switch(Z.state){case W.TEXT_ENTITY:Be=W.TEXT,We="textNode";break;case W.ATTRIB_VALUE_ENTITY_Q:Be=W.ATTRIB_VALUE_QUOTED,We="attribValue";break;case W.ATTRIB_VALUE_ENTITY_U:Be=W.ATTRIB_VALUE_UNQUOTED,We="attribValue";break}xe===";"?(Z[We]+=ie(Z),Z.entity="",Z.state=Be):U(Z.entity.length?X:L,xe)?Z.entity+=xe:(pe(Z,"Invalid character in entity name"),Z[We]+="&"+Z.entity+xe,Z.entity="",Z.state=Be);continue;default:throw new Error(Z,"Unknown state: "+Z.state)}}return Z.position>=Z.bufferCheckPosition&&n(Z),Z}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */S.default||function(){var V=String.fromCharCode,Z=Math.floor,Ee=function(){var _e=16384,Ne=[],Be,We,Ue=-1,ze=arguments.length;if(!ze)return"";for(var Ke="";++Ue<ze;){var Ye=Number(arguments[Ue]);if(!isFinite(Ye)||Ye<0||Ye>1114111||Z(Ye)!==Ye)throw RangeError("Invalid code point: "+Ye);Ye<=65535?Ne.push(Ye):(Ye-=65536,Be=(Ye>>10)+55296,We=Ye%1024+56320,Ne.push(Be,We)),(Ue+1===ze||Ne.length>_e)&&(Ke+=V.apply(null,Ne),Ne.length=0)}return Ke};s.default?Object.defineProperty(String,"fromCodePoint",{value:Ee,configurable:!0,writable:!0}):String.fromCodePoint=Ee}()})(typeof M=="undefined"?(void 0).sax={}:M)}).call(this,I("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(I,q,M){q.exports=S;var P=I("events").EventEmitter,m=I("inherits");m(S,P),S.Readable=I("readable-stream/readable.js"),S.Writable=I("readable-stream/writable.js"),S.Duplex=I("readable-stream/duplex.js"),S.Transform=I("readable-stream/transform.js"),S.PassThrough=I("readable-stream/passthrough.js"),S.Stream=S;function S(){P.call(this)}S.prototype.pipe=function(R,T){var g=this;function C(f){R.writable&&(R.write(f)===!1&&g.pause&&g.pause())}g.on("data",C);function p(){g.readable&&g.resume&&g.resume()}R.on("drain",p),!R._isStdio&&(!T||T.end!==!1)&&(g.on("end",a),g.on("close",r));var s=!1;function a(){if(s)return;s=!0,R.end()}function r(){if(s)return;s=!0,typeof R.destroy=="function"&&R.destroy()}function h(f){if(d(),P.listenerCount(this,"error")===0)throw f}g.on("error",h),R.on("error",h);function d(){g.removeListener("data",C),R.removeListener("drain",p),g.removeListener("end",a),g.removeListener("close",r),g.removeListener("error",h),R.removeListener("error",h),g.removeListener("end",d),g.removeListener("close",d),R.removeListener("close",d)}return g.on("end",d),g.on("close",d),R.on("close",d),R.emit("pipe",g),R}},{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(I,q,M){(function(P){var m=I("./lib/request"),S=I("./lib/response"),R=I("xtend"),T=I("builtin-status-codes"),g=I("url"),C=M;C.request=function(p,s){typeof p=="string"?p=g.parse(p):p=R(p);var a=P.location.protocol.search(/^https?:$/)===-1?"http:":"",r=p.protocol||a,h=p.hostname||p.host,d=p.port,f=p.path||"/";h&&h.indexOf(":")!==-1&&(h="["+h+"]"),p.url=(h?r+"//"+h:"")+(d?":"+d:"")+f,p.method=(p.method||"GET").toUpperCase(),p.headers=p.headers||{};var E=new m(p);return s&&E.on("response",s),E},C.get=function(s,a){var r=C.request(s,a);return r.end(),r},C.ClientRequest=m,C.IncomingMessage=S.IncomingMessage,C.Agent=function(){},C.Agent.defaultMaxSockets=4,C.globalAgent=new C.Agent,C.STATUS_CODES=T,C.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":233,"./lib/response":234,"builtin-status-codes":74,url:238,xtend:283}],232:[function(I,q,M){(function(P){"use strict";M.fetch=C(P.fetch)&&C(P.ReadableStream),M.writableStream=C(P.WritableStream),M.abortController=C(P.AbortController),M.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),M.blobConstructor=!0}catch(p){}var m;function S(){if(m!==void 0)return m;if(P.XMLHttpRequest){m=new P.XMLHttpRequest;try{m.open("GET",P.XDomainRequest?"/":"https://example.com")}catch(p){m=null}}else m=null;return m}function R(p){var s=S();if(!s)return!1;try{return s.responseType=p,s.responseType===p}catch(a){}return!1}var T=typeof P.ArrayBuffer!="undefined",g=T&&C(P.ArrayBuffer.prototype.slice);M.arraybuffer=M.fetch||T&&R("arraybuffer"),M.msstream=!M.fetch&&g&&R("ms-stream"),M.mozchunkedarraybuffer=!M.fetch&&T&&R("moz-chunked-arraybuffer"),M.overrideMimeType=M.fetch||(S()?C(S().overrideMimeType):!1),M.vbArray=C(P.VBArray);function C(p){return typeof p=="function"}m=null}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],233:[function(I,q,M){(function(P,m,S){"use strict";var R=I("babel-runtime/core-js/object/keys"),T=g(R);function g(n){return n&&n.__esModule?n:{default:n}}var C=I("./capability"),p=I("inherits"),s=I("./response"),a=I("readable-stream"),r=I("to-arraybuffer"),h=s.IncomingMessage,d=s.readyStates;function f(n,o){return C.fetch&&o?"fetch":C.mozchunkedarraybuffer?"moz-chunked-arraybuffer":C.msstream?"ms-stream":C.arraybuffer&&n?"arraybuffer":C.vbArray&&n?"text:vbarray":"text"}var E=q.exports=function(n){var o=this;a.Writable.call(o),o._opts=n,o._body=[],o._headers={},n.auth&&o.setHeader("Authorization","Basic "+new S(n.auth).toString("base64")),(0,T.default)(n.headers).forEach(function(v){o.setHeader(v,n.headers[v])});var u,w=!0;if(n.mode==="disable-fetch"||"requestTimeout"in n&&!C.abortController)w=!1,u=!0;else if(n.mode==="prefer-streaming")u=!1;else if(n.mode==="allow-wrong-content-type")u=!C.overrideMimeType;else if(!n.mode||n.mode==="default"||n.mode==="prefer-fast")u=!0;else throw new Error("Invalid value for opts.mode");o._mode=f(u,w),o._fetchTimer=null,o.on("finish",function(){o._onFinish()})};p(E,a.Writable),E.prototype.setHeader=function(n,o){var u=this,w=n.toLowerCase();if(l.indexOf(w)!==-1)return;u._headers[w]={name:n,value:o}},E.prototype.getHeader=function(n){var o=this._headers[n.toLowerCase()];return o?o.value:null},E.prototype.removeHeader=function(n){var o=this;delete o._headers[n.toLowerCase()]},E.prototype._onFinish=function(){var n=this;if(n._destroyed)return;var o=n._opts,u=n._headers,w=null;o.method!=="GET"&&o.method!=="HEAD"&&(C.arraybuffer?w=r(S.concat(n._body)):C.blobConstructor?w=new m.Blob(n._body.map(function(b){return r(b)}),{type:(u["content-type"]||{}).value||""}):w=S.concat(n._body).toString());var v=[];if((0,T.default)(u).forEach(function(b){var x=u[b].name,_=u[b].value;Array.isArray(_)?_.forEach(function(j){v.push([x,j])}):v.push([x,_])}),n._mode==="fetch"){var i=null,k=null;if(C.abortController){var D=new AbortController;i=D.signal,n._fetchAbortController=D,"requestTimeout"in o&&o.requestTimeout!==0&&(n._fetchTimer=m.setTimeout(function(){n.emit("requestTimeout"),n._fetchAbortController&&n._fetchAbortController.abort()},o.requestTimeout))}m.fetch(n._opts.url,{method:n._opts.method,headers:v,body:w||void 0,mode:"cors",credentials:o.withCredentials?"include":"same-origin",signal:i}).then(function(b){n._fetchResponse=b,n._connect()},function(b){m.clearTimeout(n._fetchTimer),n._destroyed||n.emit("error",b)})}else{var c=n._xhr=new m.XMLHttpRequest;try{c.open(n._opts.method,n._opts.url,!0)}catch(b){P.nextTick(function(){n.emit("error",b)});return}"responseType"in c&&(c.responseType=n._mode.split(":")[0]),"withCredentials"in c&&(c.withCredentials=!!o.withCredentials),n._mode==="text"&&"overrideMimeType"in c&&c.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in o&&(c.timeout=o.requestTimeout,c.ontimeout=function(){n.emit("requestTimeout")}),v.forEach(function(b){c.setRequestHeader(b[0],b[1])}),n._response=null,c.onreadystatechange=function(){switch(c.readyState){case d.LOADING:case d.DONE:n._onXHRProgress();break}},n._mode==="moz-chunked-arraybuffer"&&(c.onprogress=function(){n._onXHRProgress()}),c.onerror=function(){if(n._destroyed)return;n.emit("error",new Error("XHR error"))};try{c.send(w)}catch(b){P.nextTick(function(){n.emit("error",b)});return}}};function y(n){try{var o=n.status;return o!==null&&o!==0}catch(u){return!1}}E.prototype._onXHRProgress=function(){var n=this;if(!y(n._xhr)||n._destroyed)return;n._response||n._connect(),n._response._onXHRProgress()},E.prototype._connect=function(){var n=this;if(n._destroyed)return;n._response=new h(n._xhr,n._fetchResponse,n._mode,n._fetchTimer),n._response.on("error",function(o){n.emit("error",o)}),n.emit("response",n._response)},E.prototype._write=function(n,o,u){var w=this;w._body.push(n),u()},E.prototype.abort=E.prototype.destroy=function(){var n=this;n._destroyed=!0,m.clearTimeout(n._fetchTimer),n._response&&(n._response._destroyed=!0),n._xhr?n._xhr.abort():n._fetchAbortController&&n._fetchAbortController.abort()},E.prototype.end=function(n,o,u){var w=this;typeof n=="function"&&(u=n,n=void 0),a.Writable.prototype.end.call(w,n,o,u)},E.prototype.flushHeaders=function(){},E.prototype.setTimeout=function(){},E.prototype.setNoDelay=function(){},E.prototype.setSocketKeepAlive=function(){};var l=["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,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},I("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(I,q,M){(function(P,m,S){"use strict";var R=I("babel-runtime/core-js/promise"),T=g(R);function g(h){return h&&h.__esModule?h:{default:h}}var C=I("./capability"),p=I("inherits"),s=I("readable-stream"),a=M.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},r=M.IncomingMessage=function(h,d,f,E){var y=this;if(s.Readable.call(y),y._mode=f,y.headers={},y.rawHeaders=[],y.trailers={},y.rawTrailers=[],y.on("end",function(){P.nextTick(function(){y.emit("close")})}),f==="fetch"){var l=function i(){o.read().then(function(k){if(y._destroyed)return;if(k.done){m.clearTimeout(E),y.push(null);return}y.push(new S(k.value)),i()}).catch(function(k){m.clearTimeout(E),y._destroyed||y.emit("error",k)})};if(y._fetchResponse=d,y.url=d.url,y.statusCode=d.status,y.statusMessage=d.statusText,d.headers.forEach(function(i,k){y.headers[k.toLowerCase()]=i,y.rawHeaders.push(k,i)}),C.writableStream){var n=new WritableStream({write:function(k){return new T.default(function(D,c){y._destroyed?c():y.push(new S(k))?D():y._resumeFetch=D})},close:function(){m.clearTimeout(E),y._destroyed||y.push(null)},abort:function(k){y._destroyed||y.emit("error",k)}});try{d.body.pipeTo(n).catch(function(i){m.clearTimeout(E),y._destroyed||y.emit("error",i)});return}catch(i){}}var o=d.body.getReader();l()}else{y._xhr=h,y._pos=0,y.url=h.responseURL,y.statusCode=h.status,y.statusMessage=h.statusText;var u=h.getAllResponseHeaders().split(/\r?\n/);if(u.forEach(function(i){var k=i.match(/^([^:]+):\s*(.*)/);if(k){var D=k[1].toLowerCase();D==="set-cookie"?(y.headers[D]===void 0&&(y.headers[D]=[]),y.headers[D].push(k[2])):y.headers[D]!==void 0?y.headers[D]+=", "+k[2]:y.headers[D]=k[2],y.rawHeaders.push(k[1],k[2])}}),y._charset="x-user-defined",!C.overrideMimeType){var w=y.rawHeaders["mime-type"];if(w){var v=w.match(/;\s*charset=([^;])(;|$)/);v&&(y._charset=v[1].toLowerCase())}y._charset||(y._charset="utf-8")}}};p(r,s.Readable),r.prototype._read=function(){var h=this,d=h._resumeFetch;d&&(h._resumeFetch=null,d())},r.prototype._onXHRProgress=function(){var h=this,d=h._xhr,f=null;switch(h._mode){case"text:vbarray":if(d.readyState!==a.DONE)break;try{f=new m.VBArray(d.responseBody).toArray()}catch(o){}if(f!==null){h.push(new S(f));break}case"text":try{f=d.responseText}catch(o){h._mode="text:vbarray";break}if(f.length>h._pos){var E=f.substr(h._pos);if(h._charset==="x-user-defined"){for(var y=new S(E.length),l=0;l<E.length;l++)y[l]=E.charCodeAt(l)&255;h.push(y)}else h.push(E,h._charset);h._pos=f.length}break;case"arraybuffer":if(d.readyState!==a.DONE||!d.response)break;f=d.response,h.push(new S(new Uint8Array(f)));break;case"moz-chunked-arraybuffer":if(f=d.response,d.readyState!==a.LOADING||!f)break;h.push(new S(new Uint8Array(f)));break;case"ms-stream":if(f=d.response,d.readyState!==a.LOADING)break;var n=new m.MSStreamReader;n.onprogress=function(){n.result.byteLength>h._pos&&(h.push(new S(new Uint8Array(n.result.slice(h._pos)))),h._pos=n.result.byteLength)},n.onload=function(){h.push(null)},n.readAsArrayBuffer(f);break}h._xhr.readyState===a.DONE&&h._mode!=="ms-stream"&&h.push(null)}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},I("buffer").Buffer)},{"./capability":232,_process:208,"babel-runtime/core-js/promise":61,buffer:73,inherits:196,"readable-stream":223}],235:[function(I,q,M){"use strict";var P=I("safe-buffer").Buffer,m=P.isEncoding||function(n){n=""+n;switch(n&&n.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function S(n){if(!n)return"utf8";for(var o;;)switch(n){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return n;default:if(o)return;n=(""+n).toLowerCase(),o=!0}}function R(n){var o=S(n);if(typeof o!="string"&&(P.isEncoding===m||!m(n)))throw new Error("Unknown encoding: "+n);return o||n}M.StringDecoder=T;function T(n){this.encoding=R(n);var o;switch(this.encoding){case"utf16le":this.text=h,this.end=d,o=4;break;case"utf8":this.fillLast=s,o=4;break;case"base64":this.text=f,this.end=E,o=3;break;default:this.write=y,this.end=l;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=P.allocUnsafe(o)}T.prototype.write=function(n){if(n.length===0)return"";var o,u;if(this.lastNeed){if(o=this.fillLast(n),o===void 0)return"";u=this.lastNeed,this.lastNeed=0}else u=0;return u<n.length?o?o+this.text(n,u):this.text(n,u):o||""},T.prototype.end=r,T.prototype.text=a,T.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};function g(n){return n<=127?0:n>>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function C(n,o,u){var w=o.length-1;if(w<u)return 0;var v=g(o[w]);return v>=0?(v>0&&(n.lastNeed=v-1),v):--w<u||v===-2?0:(v=g(o[w]),v>=0?(v>0&&(n.lastNeed=v-2),v):--w<u||v===-2?0:(v=g(o[w]),v>=0?(v>0&&(v===2?v=0:n.lastNeed=v-3),v):0))}function p(n,o,u){if((o[0]&192)!==128)return n.lastNeed=0,"\uFFFD";if(n.lastNeed>1&&o.length>1){if((o[1]&192)!==128)return n.lastNeed=1,"\uFFFD";if(n.lastNeed>2&&o.length>2&&(o[2]&192)!==128)return n.lastNeed=2,"\uFFFD"}}function s(n){var o=this.lastTotal-this.lastNeed,u=p(this,n,o);if(u!==void 0)return u;if(this.lastNeed<=n.length)return n.copy(this.lastChar,o,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,o,0,n.length),this.lastNeed-=n.length}function a(n,o){var u=C(this,n,o);if(!this.lastNeed)return n.toString("utf8",o);this.lastTotal=u;var w=n.length-(u-this.lastNeed);return n.copy(this.lastChar,0,w),n.toString("utf8",o,w)}function r(n){var o=n&&n.length?this.write(n):"";return this.lastNeed?o+"\uFFFD":o}function h(n,o){if((n.length-o)%2===0){var u=n.toString("utf16le",o);if(u){var w=u.charCodeAt(u.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],u.slice(0,-1)}return u}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",o,n.length-1)}function d(n){var o=n&&n.length?this.write(n):"";if(this.lastNeed){var u=this.lastTotal-this.lastNeed;return o+this.lastChar.toString("utf16le",0,u)}return o}function f(n,o){var u=(n.length-o)%3;return u===0?n.toString("base64",o):(this.lastNeed=3-u,this.lastTotal=3,u===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",o,n.length-u))}function E(n){var o=n&&n.length?this.write(n):"";return this.lastNeed?o+this.lastChar.toString("base64",0,3-this.lastNeed):o}function y(n){return n.toString(this.encoding)}function l(n){return n&&n.length?this.write(n):""}},{"safe-buffer":228}],236:[function(I,q,M){(function(P,m){var S=I("process/browser.js").nextTick,R=Function.prototype.apply,T=Array.prototype.slice,g={},C=0;M.setTimeout=function(){return new p(R.call(setTimeout,window,arguments),clearTimeout)},M.setInterval=function(){return new p(R.call(setInterval,window,arguments),clearInterval)},M.clearTimeout=M.clearInterval=function(s){s.close()};function p(s,a){this._id=s,this._clearFn=a}p.prototype.unref=p.prototype.ref=function(){},p.prototype.close=function(){this._clearFn.call(window,this._id)},M.enroll=function(s,a){clearTimeout(s._idleTimeoutId),s._idleTimeout=a},M.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},M._unrefActive=M.active=function(s){clearTimeout(s._idleTimeoutId);var a=s._idleTimeout;a>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},a))},M.setImmediate=typeof P=="function"?P:function(s){var a=C++,r=arguments.length<2?!1:T.call(arguments,1);return g[a]=!0,S(function(){g[a]&&(r?s.apply(null,r):s.call(null),M.clearImmediate(a))}),a},M.clearImmediate=typeof m=="function"?m:function(s){delete g[s]}}).call(this,I("timers").setImmediate,I("timers").clearImmediate)},{"process/browser.js":208,timers:236}],237:[function(I,q,M){var P=I("buffer").Buffer;q.exports=function(m){if(m instanceof Uint8Array){if(m.byteOffset===0&&m.byteLength===m.buffer.byteLength)return m.buffer;if(typeof m.buffer.slice=="function")return m.buffer.slice(m.byteOffset,m.byteOffset+m.byteLength)}if(P.isBuffer(m)){for(var S=new Uint8Array(m.length),R=m.length,T=0;T<R;T++)S[T]=m[T];return S.buffer}else throw new Error("Argument must be a Buffer")}},{buffer:73}],238:[function(I,q,M){"use strict";var P=I("punycode"),m=I("./util");M.parse=o,M.resolve=w,M.resolveObject=v,M.format=u,M.Url=S;function S(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var R=/^([a-z0-9.+-]+:)/i,T=/:[0-9]*$/,g=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,C=["<",">",'"',"`"," ","\r",`
`," "],p=["{","}","|","\\","^","`"].concat(C),s=["'"].concat(p),a=["%","/","?",";","#"].concat(s),r=["/","?","#"],h=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},l={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},n=I("querystring");function o(i,k,D){if(i&&m.isObject(i)&&i instanceof S)return i;var c=new S;return c.parse(i,k,D),c}S.prototype.parse=function(i,k,D){if(!m.isString(i))throw new TypeError("Parameter 'url' must be a string, not "+typeof i);var c=i.indexOf("?"),b=c!==-1&&c<i.indexOf("#")?"?":"#",x=i.split(b),_=/\\/g;x[0]=x[0].replace(_,"/"),i=x.join(b);var j=i;if(j=j.trim(),!D&&i.split("#").length===1){var F=g.exec(j);if(F)return this.path=j,this.href=j,this.pathname=F[1],F[2]?(this.search=F[2],k?this.query=n.parse(this.search.substr(1)):this.query=this.search.substr(1)):k&&(this.search="",this.query={}),this}var L=R.exec(j);if(L){L=L[0];var X=L.toLowerCase();this.protocol=X,j=j.substr(L.length)}if(D||L||j.match(/^\/\/[^@\/]+@[^@\/]+/)){var z=j.substr(0,2)==="//";z&&!(L&&y[L])&&(j=j.substr(2),this.slashes=!0)}if(!y[L]&&(z||L&&!l[L])){for(var H=-1,G=0;G<r.length;G++){var U=j.indexOf(r[G]);U!==-1&&(H===-1||U<H)&&(H=U)}var B,W;H===-1?W=j.lastIndexOf("@"):W=j.lastIndexOf("@",H),W!==-1&&(B=j.slice(0,W),j=j.slice(W+1),this.auth=decodeURIComponent(B)),H=-1;for(var G=0;G<a.length;G++){var U=j.indexOf(a[G]);U!==-1&&(H===-1||U<H)&&(H=U)}H===-1&&(H=j.length),this.host=j.slice(0,H),j=j.slice(H),this.parseHost(),this.hostname=this.hostname||"";var te=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!te)for(var de=this.hostname.split(/\./),G=0,fe=de.length;G<fe;G++){var be=de[G];if(!be)continue;if(!be.match(d)){for(var Ce="",ue=0,ge=be.length;ue<ge;ue++)be.charCodeAt(ue)>127?Ce+="x":Ce+=be[ue];if(!Ce.match(d)){var pe=de.slice(0,G),oe=de.slice(G+1),ae=be.match(f);ae&&(pe.push(ae[1]),oe.unshift(ae[2])),oe.length&&(j="/"+oe.join(".")+j),this.hostname=pe.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),te||(this.hostname=P.toASCII(this.hostname));var re=this.port?":"+this.port:"",he=this.hostname||"";this.host=he+re,this.href+=this.host,te&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),j[0]!=="/"&&(j="/"+j))}if(!E[X])for(var G=0,fe=s.length;G<fe;G++){var Q=s[G];if(j.indexOf(Q)===-1)continue;var ie=encodeURIComponent(Q);ie===Q&&(ie=escape(Q)),j=j.split(Q).join(ie)}var we=j.indexOf("#");we!==-1&&(this.hash=j.substr(we),j=j.slice(0,we));var ne=j.indexOf("?");if(ne!==-1?(this.search=j.substr(ne),this.query=j.substr(ne+1),k&&(this.query=n.parse(this.query)),j=j.slice(0,ne)):k&&(this.search="",this.query={}),j&&(this.pathname=j),l[X]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var re=this.pathname||"",J=this.search||"";this.path=re+J}return this.href=this.format(),this};function u(i){return m.isString(i)&&(i=o(i)),i instanceof S?i.format():S.prototype.format.call(i)}S.prototype.format=function(){var i=this.auth||"";i&&(i=encodeURIComponent(i),i=i.replace(/%3A/i,":"),i+="@");var k=this.protocol||"",D=this.pathname||"",c=this.hash||"",b=!1,x="";this.host?b=i+this.host:this.hostname&&(b=i+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(b+=":"+this.port)),this.query&&m.isObject(this.query)&&Object.keys(this.query).length&&(x=n.stringify(this.query));var _=this.search||x&&"?"+x||"";return k&&k.substr(-1)!==":"&&(k+=":"),this.slashes||(!k||l[k])&&b!==!1?(b="//"+(b||""),D&&D.charAt(0)!=="/"&&(D="/"+D)):b||(b=""),c&&c.charAt(0)!=="#"&&(c="#"+c),_&&_.charAt(0)!=="?"&&(_="?"+_),D=D.replace(/[?#]/g,function(j){return encodeURIComponent(j)}),_=_.replace("#","%23"),k+b+D+_+c};function w(i,k){return o(i,!1,!0).resolve(k)}S.prototype.resolve=function(i){return this.resolveObject(o(i,!1,!0)).format()};function v(i,k){return i?o(i,!1,!0).resolveObject(k):k}S.prototype.resolveObject=function(i){if(m.isString(i)){var k=new S;k.parse(i,!1,!0),i=k}for(var D=new S,c=Object.keys(this),b=0;b<c.length;b++){var x=c[b];D[x]=this[x]}if(D.hash=i.hash,i.href==="")return D.href=D.format(),D;if(i.slashes&&!i.protocol){for(var _=Object.keys(i),j=0;j<_.length;j++){var F=_[j];F!=="protocol"&&(D[F]=i[F])}return l[D.protocol]&&D.hostname&&!D.pathname&&(D.path=D.pathname="/"),D.href=D.format(),D}if(i.protocol&&i.protocol!==D.protocol){if(!l[i.protocol]){for(var L=Object.keys(i),X=0;X<L.length;X++){var z=L[X];D[z]=i[z]}return D.href=D.format(),D}if(D.protocol=i.protocol,!i.host&&!y[i.protocol]){for(var fe=(i.pathname||"").split("/");fe.length&&!(i.host=fe.shift()););i.host||(i.host=""),i.hostname||(i.hostname=""),fe[0]!==""&&fe.unshift(""),fe.length<2&&fe.unshift(""),D.pathname=fe.join("/")}else D.pathname=i.pathname;if(D.search=i.search,D.query=i.query,D.host=i.host||"",D.auth=i.auth,D.hostname=i.hostname||i.host,D.port=i.port,D.pathname||D.search){var H=D.pathname||"",G=D.search||"";D.path=H+G}return D.slashes=D.slashes||i.slashes,D.href=D.format(),D}var U=D.pathname&&D.pathname.charAt(0)==="/",B=i.host||i.pathname&&i.pathname.charAt(0)==="/",W=B||U||D.host&&i.pathname,te=W,de=D.pathname&&D.pathname.split("/")||[],fe=i.pathname&&i.pathname.split("/")||[],be=D.protocol&&!l[D.protocol];if(be&&(D.hostname="",D.port=null,D.host&&(de[0]===""?de[0]=D.host:de.unshift(D.host)),D.host="",i.protocol&&(i.hostname=null,i.port=null,i.host&&(fe[0]===""?fe[0]=i.host:fe.unshift(i.host)),i.host=null),W=W&&(fe[0]===""||de[0]==="")),B)D.host=i.host||i.host===""?i.host:D.host,D.hostname=i.hostname||i.hostname===""?i.hostname:D.hostname,D.search=i.search,D.query=i.query,de=fe;else if(fe.length)de||(de=[]),de.pop(),de=de.concat(fe),D.search=i.search,D.query=i.query;else if(!m.isNullOrUndefined(i.search)){if(be){D.hostname=D.host=de.shift();var Ce=D.host&&D.host.indexOf("@")>0?D.host.split("@"):!1;Ce&&(D.auth=Ce.shift(),D.host=D.hostname=Ce.shift())}return D.search=i.search,D.query=i.query,(!m.isNull(D.pathname)||!m.isNull(D.search))&&(D.path=(D.pathname?D.pathname:"")+(D.search?D.search:"")),D.href=D.format(),D}if(!de.length)return D.pathname=null,D.search?D.path="/"+D.search:D.path=null,D.href=D.format(),D;for(var ue=de.slice(-1)[0],ge=(D.host||i.host||de.length>1)&&(ue==="."||ue==="..")||ue==="",pe=0,oe=de.length;oe>=0;oe--)ue=de[oe],ue==="."?de.splice(oe,1):ue===".."?(de.splice(oe,1),pe++):pe&&(de.splice(oe,1),pe--);if(!W&&!te)for(;pe--;pe)de.unshift("..");W&&de[0]!==""&&(!de[0]||de[0].charAt(0)!=="/")&&de.unshift(""),ge&&de.join("/").substr(-1)!=="/"&&de.push("");var ae=de[0]===""||de[0]&&de[0].charAt(0)==="/";if(be){D.hostname=D.host=ae?"":de.length?de.shift():"";var Ce=D.host&&D.host.indexOf("@")>0?D.host.split("@"):!1;Ce&&(D.auth=Ce.shift(),D.host=D.hostname=Ce.shift())}return W=W||D.host&&de.length,W&&!ae&&de.unshift(""),de.length?D.pathname=de.join("/"):(D.pathname=null,D.path=null),(!m.isNull(D.pathname)||!m.isNull(D.search))&&(D.path=(D.pathname?D.pathname:"")+(D.search?D.search:"")),D.auth=i.auth||D.auth,D.slashes=D.slashes||i.slashes,D.href=D.format(),D},S.prototype.parseHost=function(){var i=this.host,k=T.exec(i);k&&(k=k[0],k!==":"&&(this.port=k.substr(1)),i=i.substr(0,i.length-k.length)),i&&(this.hostname=i)}},{"./util":239,punycode:209,querystring:212}],239:[function(I,q,M){"use strict";q.exports={isString:function(P){return typeof P=="string"},isObject:function(P){return typeof P=="object"&&P!==null},isNull:function(P){return P===null},isNullOrUndefined:function(P){return P==null}}},{}],240:[function(I,q,M){(function(P){q.exports=m;function m(R,T){if(S("noDeprecation"))return R;var g=!1;function C(){if(!g){if(S("throwDeprecation"))throw new Error(T);S("traceDeprecation")?console.trace(T):console.warn(T),g=!0}return R.apply(this,arguments)}return C}function S(R){try{if(!P.localStorage)return!1}catch(g){return!1}var T=P.localStorage[R];return T==null?!1:String(T).toLowerCase()==="true"}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],241:[function(I,q,M){typeof Object.create=="function"?q.exports=function(m,S){m.super_=S,m.prototype=Object.create(S.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}})}:q.exports=function(m,S){m.super_=S;var R=function(){};R.prototype=S.prototype,m.prototype=new R,m.prototype.constructor=m}},{}],242:[function(I,q,M){q.exports=function(m){return m&&typeof m=="object"&&typeof m.copy=="function"&&typeof m.fill=="function"&&typeof m.readUInt8=="function"}},{}],243:[function(I,q,M){(function(P,m){var S=/%[sdj%]/g;M.format=function(H){if(!w(H)){for(var G=[],U=0;U<arguments.length;U++)G.push(g(arguments[U]));return G.join(" ")}for(var U=1,B=arguments,W=B.length,te=String(H).replace(S,function(fe){if(fe==="%%")return"%";if(U>=W)return fe;switch(fe){case"%s":return String(B[U++]);case"%d":return Number(B[U++]);case"%j":try{return JSON.stringify(B[U++])}catch(be){return"[Circular]"}default:return fe}}),de=B[U];U<W;de=B[++U])n(de)||!D(de)?te+=" "+de:te+=" "+g(de);return te},M.deprecate=function(H,G){if(i(m.process))return function(){return M.deprecate(H,G).apply(this,arguments)};if(P.noDeprecation===!0)return H;var U=!1;function B(){if(!U){if(P.throwDeprecation)throw new Error(G);P.traceDeprecation?console.trace(G):console.error(G),U=!0}return H.apply(this,arguments)}return B};var R={},T;M.debuglog=function(H){if(i(T)&&(T=P.env.NODE_DEBUG||""),H=H.toUpperCase(),!R[H])if(new RegExp("\\b"+H+"\\b","i").test(T)){var G=P.pid;R[H]=function(){var U=M.format.apply(M,arguments);console.error("%s %d: %s",H,G,U)}}else R[H]=function(){};return R[H]};function g(H,G){var U={seen:[],stylize:p};return arguments.length>=3&&(U.depth=arguments[2]),arguments.length>=4&&(U.colors=arguments[3]),l(G)?U.showHidden=G:G&&M._extend(U,G),i(U.showHidden)&&(U.showHidden=!1),i(U.depth)&&(U.depth=2),i(U.colors)&&(U.colors=!1),i(U.customInspect)&&(U.customInspect=!0),U.colors&&(U.stylize=C),a(U,H,U.depth)}M.inspect=g,g.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]},g.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function C(H,G){var U=g.styles[G];return U?"["+g.colors[U][0]+"m"+H+"["+g.colors[U][1]+"m":H}function p(H,G){return H}function s(H){var G={};return H.forEach(function(U,B){G[U]=!0}),G}function a(H,G,U){if(H.customInspect&&G&&x(G.inspect)&&G.inspect!==M.inspect&&!(G.constructor&&G.constructor.prototype===G)){var B=G.inspect(U,H);return w(B)||(B=a(H,B,U)),B}var W=r(H,G);if(W)return W;var te=Object.keys(G),de=s(te);if(H.showHidden&&(te=Object.getOwnPropertyNames(G)),b(G)&&(te.indexOf("message")>=0||te.indexOf("description")>=0))return h(G);if(te.length===0){if(x(G)){var fe=G.name?": "+G.name:"";return H.stylize("[Function"+fe+"]","special")}if(k(G))return H.stylize(RegExp.prototype.toString.call(G),"regexp");if(c(G))return H.stylize(Date.prototype.toString.call(G),"date");if(b(G))return h(G)}var be="",Ce=!1,ue=["{","}"];if(y(G)&&(Ce=!0,ue=["[","]"]),x(G)){var ge=G.name?": "+G.name:"";be=" [Function"+ge+"]"}if(k(G)&&(be=" "+RegExp.prototype.toString.call(G)),c(G)&&(be=" "+Date.prototype.toUTCString.call(G)),b(G)&&(be=" "+h(G)),te.length===0&&(!Ce||G.length==0))return ue[0]+be+ue[1];if(U<0)return k(G)?H.stylize(RegExp.prototype.toString.call(G),"regexp"):H.stylize("[Object]","special");H.seen.push(G);var pe;return Ce?pe=d(H,G,U,de,te):pe=te.map(function(oe){return f(H,G,U,de,oe,Ce)}),H.seen.pop(),E(pe,be,ue)}function r(H,G){if(i(G))return H.stylize("undefined","undefined");if(w(G)){var U="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return H.stylize(U,"string")}if(u(G))return H.stylize(""+G,"number");if(l(G))return H.stylize(""+G,"boolean");if(n(G))return H.stylize("null","null")}function h(H){return"["+Error.prototype.toString.call(H)+"]"}function d(H,G,U,B,W){for(var te=[],de=0,fe=G.length;de<fe;++de)z(G,String(de))?te.push(f(H,G,U,B,String(de),!0)):te.push("");return W.forEach(function(be){be.match(/^\d+$/)||te.push(f(H,G,U,B,be,!0))}),te}function f(H,G,U,B,W,te){var de,fe,be;if(be=Object.getOwnPropertyDescriptor(G,W)||{value:G[W]},be.get?be.set?fe=H.stylize("[Getter/Setter]","special"):fe=H.stylize("[Getter]","special"):be.set&&(fe=H.stylize("[Setter]","special")),z(B,W)||(de="["+W+"]"),fe||(H.seen.indexOf(be.value)<0?(n(U)?fe=a(H,be.value,null):fe=a(H,be.value,U-1),fe.indexOf(`
`)>-1&&(te?fe=fe.split(`
`).map(function(Ce){return" "+Ce}).join(`
`).substr(2):fe=`
`+fe.split(`
`).map(function(Ce){return" "+Ce}).join(`
`))):fe=H.stylize("[Circular]","special")),i(de)){if(te&&W.match(/^\d+$/))return fe;de=JSON.stringify(""+W),de.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(de=de.substr(1,de.length-2),de=H.stylize(de,"name")):(de=de.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),de=H.stylize(de,"string"))}return de+": "+fe}function E(H,G,U){var B=0,W=H.reduce(function(te,de){return B++,de.indexOf(`
`)>=0&&B++,te+de.replace(/\u001b\[\d\d?m/g,"").length+1},0);return W>60?U[0]+(G===""?"":G+`
`)+" "+H.join(`,
`)+" "+U[1]:U[0]+G+" "+H.join(", ")+" "+U[1]}function y(H){return Array.isArray(H)}M.isArray=y;function l(H){return typeof H=="boolean"}M.isBoolean=l;function n(H){return H===null}M.isNull=n;function o(H){return H==null}M.isNullOrUndefined=o;function u(H){return typeof H=="number"}M.isNumber=u;function w(H){return typeof H=="string"}M.isString=w;function v(H){return typeof H=="symbol"}M.isSymbol=v;function i(H){return H===void 0}M.isUndefined=i;function k(H){return D(H)&&j(H)==="[object RegExp]"}M.isRegExp=k;function D(H){return typeof H=="object"&&H!==null}M.isObject=D;function c(H){return D(H)&&j(H)==="[object Date]"}M.isDate=c;function b(H){return D(H)&&(j(H)==="[object Error]"||H instanceof Error)}M.isError=b;function x(H){return typeof H=="function"}M.isFunction=x;function _(H){return H===null||typeof H=="boolean"||typeof H=="number"||typeof H=="string"||typeof H=="symbol"||typeof H=="undefined"}M.isPrimitive=_,M.isBuffer=I("./support/isBuffer");function j(H){return Object.prototype.toString.call(H)}function F(H){return H<10?"0"+H.toString(10):H.toString(10)}var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function X(){var H=new Date,G=[F(H.getHours()),F(H.getMinutes()),F(H.getSeconds())].join(":");return[H.getDate(),L[H.getMonth()],G].join(" ")}M.log=function(){console.log("%s - %s",X(),M.format.apply(M,arguments))},M.inherits=I("inherits"),M._extend=function(H,G){if(!G||!D(G))return H;for(var U=Object.keys(G),B=U.length;B--;)H[U[B]]=G[U[B]];return H};function z(H,G){return Object.prototype.hasOwnProperty.call(H,G)}}).call(this,I("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":242,_process:208,inherits:241}],244:[function(I,q,M){"use strict";(function(){"use strict";M.stripBOM=function(P){return P[0]==="\uFEFF"?P.substring(1):P}}).call(void 0)},{}],245:[function(I,q,M){"use strict";var P=I("babel-runtime/helpers/typeof"),m=T(P),S=I("babel-runtime/core-js/object/keys"),R=T(S);function T(g){return g&&g.__esModule?g:{default:g}}(function(){"use strict";var g,C,p,s,a,r={}.hasOwnProperty;g=I("xmlbuilder"),C=I("./defaults").defaults,s=function(d){return typeof d=="string"&&(d.indexOf("&")>=0||d.indexOf(">")>=0||d.indexOf("<")>=0)},a=function(d){return"<![CDATA["+p(d)+"]]>"},p=function(d){return d.replace("]]>","]]]]><![CDATA[>")},M.Builder=function(){function h(d){var f,E,y;this.options={},E=C["0.2"];for(f in E){if(!r.call(E,f))continue;y=E[f],this.options[f]=y}for(f in d){if(!r.call(d,f))continue;y=d[f],this.options[f]=y}}return h.prototype.buildObject=function(d){var f,E,y,l,n;return f=this.options.attrkey,E=this.options.charkey,(0,R.default)(d).length===1&&this.options.rootName===C["0.2"].rootName?(n=(0,R.default)(d)[0],d=d[n]):n=this.options.rootName,y=function(o){return function(u,w){var v,i,k,D,c,b;if((typeof w=="undefined"?"undefined":(0,m.default)(w))!=="object")o.options.cdata&&s(w)?u.raw(a(w)):u.txt(w);else if(Array.isArray(w))for(D in w){if(!r.call(w,D))continue;i=w[D];for(c in i)k=i[c],u=y(u.ele(c),k).up()}else for(c in w){if(!r.call(w,c))continue;if(i=w[c],c===f){if((typeof i=="undefined"?"undefined":(0,m.default)(i))==="object")for(v in i)b=i[v],u=u.att(v,b)}else if(c===E)o.options.cdata&&s(i)?u=u.raw(a(i)):u=u.txt(i);else if(Array.isArray(i))for(D in i){if(!r.call(i,D))continue;k=i[D],typeof k=="string"?o.options.cdata&&s(k)?u=u.ele(c).raw(a(k)).up():u=u.ele(c,k).up():u=y(u.ele(c),k).up()}else(typeof i=="undefined"?"undefined":(0,m.default)(i))==="object"?u=y(u.ele(c),i).up():typeof i=="string"&&o.options.cdata&&s(i)?u=u.ele(c).raw(a(i)).up():(i==null&&(i=""),u=u.ele(c,i.toString()).up())}return u}}(this),l=g.create(n,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(l,d).end(this.options.renderOpts)},h}()}).call(void 0)},{"./defaults":246,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,xmlbuilder:282}],246:[function(I,q,M){"use strict";(function(){M.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(I,q,M){"use strict";var P=I("babel-runtime/core-js/promise"),m=s(P),S=I("babel-runtime/core-js/object/get-own-property-names"),R=s(S),T=I("babel-runtime/core-js/object/keys"),g=s(T),C=I("babel-runtime/helpers/typeof"),p=s(C);function s(a){return a&&a.__esModule?a:{default:a}}(function(){"use strict";var a,r,h,d,f,E,y,l,n=function(v,i){return function(){return v.apply(i,arguments)}},o=function(v,i){for(var k in i)u.call(i,k)&&(v[k]=i[k]);function D(){this.constructor=v}return D.prototype=i.prototype,v.prototype=new D,v.__super__=i.prototype,v},u={}.hasOwnProperty;y=I("sax"),h=I("events"),a=I("./bom"),E=I("./processors"),l=I("timers").setImmediate,r=I("./defaults").defaults,d=function(v){return(typeof v=="undefined"?"undefined":(0,p.default)(v))==="object"&&v!=null&&(0,g.default)(v).length===0},f=function(v,i,k){var D,c,b;for(D=0,c=v.length;D<c;D++)b=v[D],i=b(i,k);return i},M.Parser=function(w){o(v,w);function v(i){this.parseStringPromise=n(this.parseStringPromise,this),this.parseString=n(this.parseString,this),this.reset=n(this.reset,this),this.assignOrPush=n(this.assignOrPush,this),this.processAsync=n(this.processAsync,this);var k,D,c;if(!(this instanceof M.Parser))return new M.Parser(i);this.options={},D=r["0.2"];for(k in D){if(!u.call(D,k))continue;c=D[k],this.options[k]=c}for(k in i){if(!u.call(i,k))continue;c=i[k],this.options[k]=c}this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(E.normalize)),this.reset()}return v.prototype.processAsync=function(){var i,k;try{return this.remaining.length<=this.options.chunkSize?(i=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(i),this.saxParser.close()):(i=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(i),l(this.processAsync))}catch(D){if(k=D,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(k)}},v.prototype.assignOrPush=function(i,k,D){return k in i?(i[k]instanceof Array||(i[k]=[i[k]]),i[k].push(D)):this.options.explicitArray?i[k]=[D]:i[k]=D},v.prototype.reset=function(){var i,k,D,c;return this.removeAllListeners(),this.saxParser=y.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(b){return function(x){if(b.saxParser.resume(),!b.saxParser.errThrown)return b.saxParser.errThrown=!0,b.emit("error",x)}}(this),this.saxParser.onend=function(b){return function(){if(!b.saxParser.ended)return b.saxParser.ended=!0,b.emit("end",b.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,c=[],i=this.options.attrkey,k=this.options.charkey,this.saxParser.onopentag=function(b){return function(x){var _,j,F,L,X;if(F={},F[k]="",!b.options.ignoreAttrs){X=x.attributes;for(_ in X){if(!u.call(X,_))continue;!(i in F)&&!b.options.mergeAttrs&&(F[i]={}),j=b.options.attrValueProcessors?f(b.options.attrValueProcessors,x.attributes[_],_):x.attributes[_],L=b.options.attrNameProcessors?f(b.options.attrNameProcessors,_):_,b.options.mergeAttrs?b.assignOrPush(F,L,j):F[i][L]=j}}return F["#name"]=b.options.tagNameProcessors?f(b.options.tagNameProcessors,x.name):x.name,b.options.xmlns&&(F[b.options.xmlnskey]={uri:x.uri,local:x.local}),c.push(F)}}(this),this.saxParser.onclosetag=function(b){return function(){var x,_,j,F,L,X,z,H,G,U;if(X=c.pop(),L=X["#name"],(!b.options.explicitChildren||!b.options.preserveChildrenOrder)&&delete X["#name"],X.cdata===!0&&(x=X.cdata,delete X.cdata),G=c[c.length-1],X[k].match(/^\s*$/)&&!x?(_=X[k],delete X[k]):(b.options.trim&&(X[k]=X[k].trim()),b.options.normalize&&(X[k]=X[k].replace(/\s{2,}/g," ").trim()),X[k]=b.options.valueProcessors?f(b.options.valueProcessors,X[k],L):X[k],(0,g.default)(X).length===1&&k in X&&!b.EXPLICIT_CHARKEY&&(X=X[k])),d(X)&&(X=b.options.emptyTag!==""?b.options.emptyTag:_),b.options.validator!=null&&(U="/"+function(){var B,W,te;for(te=[],B=0,W=c.length;B<W;B++)F=c[B],te.push(F["#name"]);return te}().concat(L).join("/"),function(){var B;try{return X=b.options.validator(U,G&&G[L],X)}catch(W){return B=W,b.emit("error",B)}}()),b.options.explicitChildren&&!b.options.mergeAttrs&&(typeof X=="undefined"?"undefined":(0,p.default)(X))==="object"){if(!b.options.preserveChildrenOrder)F={},b.options.attrkey in X&&(F[b.options.attrkey]=X[b.options.attrkey],delete X[b.options.attrkey]),!b.options.charsAsChildren&&b.options.charkey in X&&(F[b.options.charkey]=X[b.options.charkey],delete X[b.options.charkey]),(0,R.default)(X).length>0&&(F[b.options.childkey]=X),X=F;else if(G){G[b.options.childkey]=G[b.options.childkey]||[],z={};for(j in X){if(!u.call(X,j))continue;z[j]=X[j]}G[b.options.childkey].push(z),delete X["#name"],(0,g.default)(X).length===1&&k in X&&!b.EXPLICIT_CHARKEY&&(X=X[k])}}return c.length>0?b.assignOrPush(G,L,X):(b.options.explicitRoot&&(H=X,X={},X[L]=H),b.resultObject=X,b.saxParser.ended=!0,b.emit("end",b.resultObject))}}(this),D=function(b){return function(x){var _,j;if(j=c[c.length-1],j)return j[k]+=x,b.options.explicitChildren&&b.options.preserveChildrenOrder&&b.options.charsAsChildren&&(b.options.includeWhiteChars||x.replace(/\\n/g,"").trim()!=="")&&(j[b.options.childkey]=j[b.options.childkey]||[],_={"#name":"__text__"},_[k]=x,b.options.normalize&&(_[k]=_[k].replace(/\s{2,}/g," ").trim()),j[b.options.childkey].push(_)),j}}(this),this.saxParser.ontext=D,this.saxParser.oncdata=function(b){return function(x){var _;if(_=D(x),_)return _.cdata=!0}}(this)},v.prototype.parseString=function(i,k){var D;k!=null&&typeof k=="function"&&(this.on("end",function(c){return this.reset(),k(null,c)}),this.on("error",function(c){return this.reset(),k(c)}));try{return i=i.toString(),i.trim()===""?(this.emit("end",null),!0):(i=a.stripBOM(i),this.options.async?(this.remaining=i,l(this.processAsync),this.saxParser):this.saxParser.write(i).close())}catch(c){if(D=c,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw D}else return this.emit("error",D),this.saxParser.errThrown=!0}},v.prototype.parseStringPromise=function(i){return new m.default(function(k){return function(D,c){return k.parseString(i,function(b,x){return b?c(b):D(x)})}}(this))},v}(h),M.parseString=function(w,v,i){var k,D,c;return i!=null?(typeof i=="function"&&(k=i),(typeof v=="undefined"?"undefined":(0,p.default)(v))==="object"&&(D=v)):(typeof v=="function"&&(k=v),D={}),c=new M.Parser(D),c.parseString(w,k)},M.parseStringPromise=function(w,v){var i,k;return(typeof v=="undefined"?"undefined":(0,p.default)(v))==="object"&&(i=v),k=new M.Parser(i),k.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(I,q,M){"use strict";(function(){"use strict";var P;P=new RegExp(/(?!xmlns)^.*:/),M.normalize=function(m){return m.toLowerCase()},M.firstCharLowerCase=function(m){return m.charAt(0).toLowerCase()+m.slice(1)},M.stripPrefix=function(m){return m.replace(P,"")},M.parseNumbers=function(m){return isNaN(m)||(m=m%1===0?parseInt(m,10):parseFloat(m)),m},M.parseBooleans=function(m){return/^(?:true|false)$/i.test(m)&&(m=m.toLowerCase()==="true"),m}}).call(void 0)},{}],249:[function(I,q,M){"use strict";(function(){"use strict";var P,m,S,R,T=function(p,s){for(var a in s)g.call(s,a)&&(p[a]=s[a]);function r(){this.constructor=p}return r.prototype=s.prototype,p.prototype=new r,p.__super__=s.prototype,p},g={}.hasOwnProperty;m=I("./defaults"),P=I("./builder"),S=I("./parser"),R=I("./processors"),M.defaults=m.defaults,M.processors=R,M.ValidationError=function(C){T(p,C);function p(s){this.message=s}return p}(Error),M.Builder=P.Builder,M.Parser=S.Parser,M.parseString=S.parseString,M.parseStringPromise=S.parseStringPromise}).call(void 0)},{"./builder":245,"./defaults":246,"./parser":247,"./processors":248}],250:[function(I,q,M){"use strict";(function(){q.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(void 0)},{}],251:[function(I,q,M){"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(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/get-prototype-of"),m=C(P),S=I("babel-runtime/helpers/typeof"),R=C(S),T=I("babel-runtime/core-js/object/assign"),g=C(T);function C(p){return p&&p.__esModule?p:{default:p}}(function(){var p,s,a,r,h,d,f,E=[].slice,y={}.hasOwnProperty;p=function(){var n,o,u,w,v,i;if(i=arguments[0],v=2<=arguments.length?E.call(arguments,1):[],h(g.default))g.default.apply(null,arguments);else for(n=0,u=v.length;n<u;n++)if(w=v[n],w!=null)for(o in w){if(!y.call(w,o))continue;i[o]=w[o]}return i},h=function(n){return!!n&&Object.prototype.toString.call(n)==="[object Function]"},d=function(n){var o;return!!n&&((o=typeof n=="undefined"?"undefined":(0,R.default)(n))==="function"||o==="object")},a=function(n){return h(Array.isArray)?Array.isArray(n):Object.prototype.toString.call(n)==="[object Array]"},r=function(n){var o;if(a(n))return!n.length;for(o in n){if(!y.call(n,o))continue;return!1}return!0},f=function(n){var o,u;return d(n)&&(u=(0,m.default)(n))&&(o=u.constructor)&&typeof o=="function"&&o instanceof o&&Function.prototype.toString.call(o)===Function.prototype.toString.call(Object)},s=function(n){return h(n.valueOf)?n.valueOf():n},q.exports.assign=p,q.exports.isFunction=h,q.exports.isObject=d,q.exports.isArray=a,q.exports.isEmpty=r,q.exports.isPlainObject=f,q.exports.getValue=s}).call(void 0)},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/get-prototype-of":59,"babel-runtime/helpers/typeof":67}],253:[function(I,q,M){"use strict";(function(){q.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(void 0)},{}],254:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g;R=I("./NodeType"),g=I("./XMLNode"),q.exports=T=function(){function C(p,s,a){if(this.parent=p,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),s==null)throw new Error("Missing attribute name. "+this.debugInfo(s));this.name=this.stringify.name(s),this.value=this.stringify.attValue(a),this.type=R.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(C.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(C.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(C.prototype,"textContent",{get:function(){return this.value},set:function(s){return this.value=s||""}}),Object.defineProperty(C.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(C.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(C.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(C.prototype,"specified",{get:function(){return!0}}),C.prototype.clone=function(){return(0,m.default)(this)},C.prototype.toString=function(p){return this.options.writer.attribute(this,this.options.writer.filterOptions(p))},C.prototype.debugInfo=function(p){return p=p||this.name,p==null?"parent: <"+this.parent.name+">":"attribute: {"+p+"}, parent: <"+this.parent.name+">"},C.prototype.isEqualNode=function(p){return p.namespaceURI!==this.namespaceURI||(p.prefix!==this.prefix||p.localName!==this.localName)?!1:!(p.value!==this.value)},C}()}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],255:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C=function(a,r){for(var h in r)p.call(r,h)&&(a[h]=r[h]);function d(){this.constructor=a}return d.prototype=r.prototype,a.prototype=new d,a.__super__=r.prototype,a},p={}.hasOwnProperty;R=I("./NodeType"),g=I("./XMLCharacterData"),q.exports=T=function(s){C(a,s);function a(r,h){if(a.__super__.constructor.call(this,r),h==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=R.CData,this.value=this.stringify.cdata(h)}return a.prototype.clone=function(){return(0,m.default)(this)},a.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))},a}(g)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],256:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g=function(s,a){for(var r in a)C.call(a,r)&&(s[r]=a[r]);function h(){this.constructor=s}return h.prototype=a.prototype,s.prototype=new h,s.__super__=a.prototype,s},C={}.hasOwnProperty;T=I("./XMLNode"),q.exports=R=function(p){g(s,p);function s(a){s.__super__.constructor.call(this,a),this.value=""}return Object.defineProperty(s.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}}),Object.defineProperty(s.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(s.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}}),s.prototype.clone=function(){return(0,m.default)(this)},s.prototype.substringData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.appendData=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.insertData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.deleteData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.replaceData=function(a,r,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.isEqualNode=function(a){return s.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)?!(a.data!==this.data):!1},s}(T)}).call(void 0)},{"./XMLNode":273,"babel-runtime/core-js/object/create":55}],257:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C=function(a,r){for(var h in r)p.call(r,h)&&(a[h]=r[h]);function d(){this.constructor=a}return d.prototype=r.prototype,a.prototype=new d,a.__super__=r.prototype,a},p={}.hasOwnProperty;R=I("./NodeType"),T=I("./XMLCharacterData"),q.exports=g=function(s){C(a,s);function a(r,h){if(a.__super__.constructor.call(this,r),h==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=R.Comment,this.value=this.stringify.comment(h)}return a.prototype.clone=function(){return(0,m.default)(this)},a.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))},a}(T)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],258:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=T(P),S=I("babel-runtime/core-js/object/create"),R=T(S);function T(g){return g&&g.__esModule?g:{default:g}}(function(){var g,C,p;C=I("./XMLDOMErrorHandler"),p=I("./XMLDOMStringList"),q.exports=g=function(){function s(){var a;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new C,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=a=(0,R.default)(this.defaultParams)}return Object.defineProperty(s.prototype,"parameterNames",{get:function(){return new p((0,m.default)(this.defaultParams))}}),s.prototype.getParameter=function(a){return this.params.hasOwnProperty(a)?this.params[a]:null},s.prototype.canSetParameter=function(a,r){return!0},s.prototype.setParameter=function(a,r){return r!=null?this.params[a]=r:delete this.params[a]},s}()}).call(void 0)},{"./XMLDOMErrorHandler":259,"./XMLDOMStringList":261,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60}],259:[function(I,q,M){"use strict";(function(){var P;q.exports=P=function(){function m(){}return m.prototype.handleError=function(S){throw new Error(S)},m}()}).call(void 0)},{}],260:[function(I,q,M){"use strict";(function(){var P;q.exports=P=function(){function m(){}return m.prototype.hasFeature=function(S,R){return!0},m.prototype.createDocumentType=function(S,R,T){throw new Error("This DOM method is not implemented.")},m.prototype.createDocument=function(S,R,T){throw new Error("This DOM method is not implemented.")},m.prototype.createHTMLDocument=function(S){throw new Error("This DOM method is not implemented.")},m.prototype.getFeature=function(S,R){throw new Error("This DOM method is not implemented.")},m}()}).call(void 0)},{}],261:[function(I,q,M){"use strict";(function(){var P;q.exports=P=function(){function m(S){this.arr=S||[]}return Object.defineProperty(m.prototype,"length",{get:function(){return this.arr.length}}),m.prototype.item=function(S){return this.arr[S]||null},m.prototype.contains=function(S){return this.arr.indexOf(S)!==-1},m}()}).call(void 0)},{}],262:[function(I,q,M){"use strict";(function(){var P,m,S,R=function(C,p){for(var s in p)T.call(p,s)&&(C[s]=p[s]);function a(){this.constructor=C}return a.prototype=p.prototype,C.prototype=new a,C.__super__=p.prototype,C},T={}.hasOwnProperty;S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(g){R(C,g);function C(p,s,a,r,h,d){if(C.__super__.constructor.call(this,p),s==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(a==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(s));if(!r)throw new Error("Missing DTD attribute type. "+this.debugInfo(s));if(!h)throw new Error("Missing DTD attribute default. "+this.debugInfo(s));if(h.indexOf("#")!==0&&(h="#"+h),!h.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(s));if(d&&!h.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(s));this.elementName=this.stringify.name(s),this.type=P.AttributeDeclaration,this.attributeName=this.stringify.name(a),this.attributeType=this.stringify.dtdAttType(r),d&&(this.defaultValue=this.stringify.dtdAttDefault(d)),this.defaultValueType=h}return C.prototype.toString=function(p){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(p))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],263:[function(I,q,M){"use strict";(function(){var P,m,S,R=function(C,p){for(var s in p)T.call(p,s)&&(C[s]=p[s]);function a(){this.constructor=C}return a.prototype=p.prototype,C.prototype=new a,C.__super__=p.prototype,C},T={}.hasOwnProperty;S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(g){R(C,g);function C(p,s,a){if(C.__super__.constructor.call(this,p),s==null)throw new Error("Missing DTD element name. "+this.debugInfo());a||(a="(#PCDATA)"),Array.isArray(a)&&(a="("+a.join(",")+")"),this.name=this.stringify.name(s),this.type=P.ElementDeclaration,this.value=this.stringify.dtdElementValue(a)}return C.prototype.toString=function(p){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(p))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],264:[function(I,q,M){"use strict";(function(){var P,m,S,R,T=function(p,s){for(var a in s)g.call(s,a)&&(p[a]=s[a]);function r(){this.constructor=p}return r.prototype=s.prototype,p.prototype=new r,p.__super__=s.prototype,p},g={}.hasOwnProperty;R=I("./Utility").isObject,S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(C){T(p,C);function p(s,a,r,h){if(p.__super__.constructor.call(this,s),r==null)throw new Error("Missing DTD entity name. "+this.debugInfo(r));if(h==null)throw new Error("Missing DTD entity value. "+this.debugInfo(r));if(this.pe=!!a,this.name=this.stringify.name(r),this.type=P.EntityDeclaration,!R(h))this.value=this.stringify.dtdEntityValue(h),this.internal=!0;else{if(!h.pubID&&!h.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(r));if(h.pubID&&!h.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(r));if(this.internal=!1,h.pubID!=null&&(this.pubID=this.stringify.dtdPubID(h.pubID)),h.sysID!=null&&(this.sysID=this.stringify.dtdSysID(h.sysID)),h.nData!=null&&(this.nData=this.stringify.dtdNData(h.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(r))}}return Object.defineProperty(p.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(p.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(p.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(p.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(p.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(p.prototype,"xmlVersion",{get:function(){return null}}),p.prototype.toString=function(s){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(s))},p}(S)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],265:[function(I,q,M){"use strict";(function(){var P,m,S,R=function(C,p){for(var s in p)T.call(p,s)&&(C[s]=p[s]);function a(){this.constructor=C}return a.prototype=p.prototype,C.prototype=new a,C.__super__=p.prototype,C},T={}.hasOwnProperty;S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(g){R(C,g);function C(p,s,a){if(C.__super__.constructor.call(this,p),s==null)throw new Error("Missing DTD notation name. "+this.debugInfo(s));if(!a.pubID&&!a.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(s));this.name=this.stringify.name(s),this.type=P.NotationDeclaration,a.pubID!=null&&(this.pubID=this.stringify.dtdPubID(a.pubID)),a.sysID!=null&&(this.sysID=this.stringify.dtdSysID(a.sysID))}return Object.defineProperty(C.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(C.prototype,"systemId",{get:function(){return this.sysID}}),C.prototype.toString=function(p){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(p))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],266:[function(I,q,M){"use strict";(function(){var P,m,S,R,T=function(p,s){for(var a in s)g.call(s,a)&&(p[a]=s[a]);function r(){this.constructor=p}return r.prototype=s.prototype,p.prototype=new r,p.__super__=s.prototype,p},g={}.hasOwnProperty;R=I("./Utility").isObject,S=I("./XMLNode"),P=I("./NodeType"),q.exports=m=function(C){T(p,C);function p(s,a,r,h){var d;p.__super__.constructor.call(this,s),R(a)&&(d=a,a=d.version,r=d.encoding,h=d.standalone),a||(a="1.0"),this.type=P.Declaration,this.version=this.stringify.xmlVersion(a),r!=null&&(this.encoding=this.stringify.xmlEncoding(r)),h!=null&&(this.standalone=this.stringify.xmlStandalone(h))}return p.prototype.toString=function(s){return this.options.writer.declaration(this,this.options.writer.filterOptions(s))},p}(S)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],267:[function(I,q,M){"use strict";(function(){var P,m,S,R,T,g,C,p,s,a=function(d,f){for(var E in f)r.call(f,E)&&(d[E]=f[E]);function y(){this.constructor=d}return y.prototype=f.prototype,d.prototype=new y,d.__super__=f.prototype,d},r={}.hasOwnProperty;s=I("./Utility").isObject,p=I("./XMLNode"),P=I("./NodeType"),m=I("./XMLDTDAttList"),R=I("./XMLDTDEntity"),S=I("./XMLDTDElement"),T=I("./XMLDTDNotation"),C=I("./XMLNamedNodeMap"),q.exports=g=function(h){a(d,h);function d(f,E,y){var l,n,o,u,w,v;if(d.__super__.constructor.call(this,f),this.type=P.DocType,f.children){for(u=f.children,n=0,o=u.length;n<o;n++)if(l=u[n],l.type===P.Element){this.name=l.name;break}}this.documentObject=f,s(E)&&(w=E,E=w.pubID,y=w.sysID),y==null&&(v=[E,y],y=v[0],E=v[1]),E!=null&&(this.pubID=this.stringify.dtdPubID(E)),y!=null&&(this.sysID=this.stringify.dtdSysID(y))}return Object.defineProperty(d.prototype,"entities",{get:function(){var E,y,l,n,o;for(n={},o=this.children,y=0,l=o.length;y<l;y++)E=o[y],E.type===P.EntityDeclaration&&!E.pe&&(n[E.name]=E);return new C(n)}}),Object.defineProperty(d.prototype,"notations",{get:function(){var E,y,l,n,o;for(n={},o=this.children,y=0,l=o.length;y<l;y++)E=o[y],E.type===P.NotationDeclaration&&(n[E.name]=E);return new C(n)}}),Object.defineProperty(d.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(d.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(d.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),d.prototype.element=function(f,E){var y;return y=new S(this,f,E),this.children.push(y),this},d.prototype.attList=function(f,E,y,l,n){var o;return o=new m(this,f,E,y,l,n),this.children.push(o),this},d.prototype.entity=function(f,E){var y;return y=new R(this,!1,f,E),this.children.push(y),this},d.prototype.pEntity=function(f,E){var y;return y=new R(this,!0,f,E),this.children.push(y),this},d.prototype.notation=function(f,E){var y;return y=new T(this,f,E),this.children.push(y),this},d.prototype.toString=function(f){return this.options.writer.docType(this,this.options.writer.filterOptions(f))},d.prototype.ele=function(f,E){return this.element(f,E)},d.prototype.att=function(f,E,y,l,n){return this.attList(f,E,y,l,n)},d.prototype.ent=function(f,E){return this.entity(f,E)},d.prototype.pent=function(f,E){return this.pEntity(f,E)},d.prototype.not=function(f,E){return this.notation(f,E)},d.prototype.up=function(){return this.root()||this.documentObject},d.prototype.isEqualNode=function(f){return d.__super__.isEqualNode.apply(this,arguments).isEqualNode(f)?f.name!==this.name||f.publicId!==this.publicId?!1:!(f.systemId!==this.systemId):!1},d}(p)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLNamedNodeMap":272,"./XMLNode":273}],268:[function(I,q,M){"use strict";(function(){var P,m,S,R,T,g,C,p,s=function(h,d){for(var f in d)a.call(d,f)&&(h[f]=d[f]);function E(){this.constructor=h}return E.prototype=d.prototype,h.prototype=new E,h.__super__=d.prototype,h},a={}.hasOwnProperty;p=I("./Utility").isPlainObject,S=I("./XMLDOMImplementation"),m=I("./XMLDOMConfiguration"),T=I("./XMLNode"),P=I("./NodeType"),C=I("./XMLStringifier"),g=I("./XMLStringWriter"),q.exports=R=function(r){s(h,r);function h(d){h.__super__.constructor.call(this,null),this.name="#document",this.type=P.Document,this.documentURI=null,this.domConfig=new m,d||(d={}),d.writer||(d.writer=new g),this.options=d,this.stringify=new C(d)}return Object.defineProperty(h.prototype,"implementation",{value:new S}),Object.defineProperty(h.prototype,"doctype",{get:function(){var f,E,y,l;for(l=this.children,E=0,y=l.length;E<y;E++)if(f=l[E],f.type===P.DocType)return f;return null}}),Object.defineProperty(h.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(h.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(h.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(h.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===P.Declaration?this.children[0].encoding:null}}),Object.defineProperty(h.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===P.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(h.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===P.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(h.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(h.prototype,"origin",{get:function(){return null}}),Object.defineProperty(h.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(h.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(h.prototype,"contentType",{get:function(){return null}}),h.prototype.end=function(d){var f;return f={},d?p(d)&&(f=d,d=this.options.writer):d=this.options.writer,d.document(this,d.filterOptions(f))},h.prototype.toString=function(d){return this.options.writer.document(this,this.options.writer.filterOptions(d))},h.prototype.createElement=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createTextNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createComment=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createCDATASection=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createProcessingInstruction=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createAttribute=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createEntityReference=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.importNode=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createElementNS=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createAttributeNS=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementsByTagNameNS=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementById=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.adoptNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.renameNode=function(d,f,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementsByClassName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createEvent=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createNodeIterator=function(d,f,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createTreeWalker=function(d,f,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},h}(T)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDOMConfiguration":258,"./XMLDOMImplementation":260,"./XMLNode":273,"./XMLStringWriter":278,"./XMLStringifier":279}],269:[function(I,q,M){"use strict";(function(){var P,m,S,R,T,g,C,p,s,a,r,h,d,f,E,y,l,n,o,u,w,v,i,k,D={}.hasOwnProperty;k=I("./Utility"),v=k.isObject,w=k.isFunction,i=k.isPlainObject,u=k.getValue,P=I("./NodeType"),h=I("./XMLDocument"),f=I("./XMLElement"),R=I("./XMLCData"),T=I("./XMLComment"),y=I("./XMLRaw"),o=I("./XMLText"),E=I("./XMLProcessingInstruction"),a=I("./XMLDeclaration"),r=I("./XMLDocType"),g=I("./XMLDTDAttList"),p=I("./XMLDTDEntity"),C=I("./XMLDTDElement"),s=I("./XMLDTDNotation"),S=I("./XMLAttribute"),n=I("./XMLStringifier"),l=I("./XMLStringWriter"),m=I("./WriterState"),q.exports=d=function(){function c(b,x,_){var j;this.name="?xml",this.type=P.Document,b||(b={}),j={},b.writer?i(b.writer)&&(j=b.writer,b.writer=new l):b.writer=new l,this.options=b,this.writer=b.writer,this.writerOptions=this.writer.filterOptions(j),this.stringify=new n(b),this.onDataCallback=x||function(){},this.onEndCallback=_||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return c.prototype.createChildNode=function(b){var x,_,j,F,L,X,z,H;switch(b.type){case P.CData:this.cdata(b.value);break;case P.Comment:this.comment(b.value);break;case P.Element:j={},z=b.attribs;for(_ in z){if(!D.call(z,_))continue;x=z[_],j[_]=x.value}this.node(b.name,j);break;case P.Dummy:this.dummy();break;case P.Raw:this.raw(b.value);break;case P.Text:this.text(b.value);break;case P.ProcessingInstruction:this.instruction(b.target,b.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+b.constructor.name)}for(H=b.children,L=0,X=H.length;L<X;L++)F=H[L],this.createChildNode(F),F.type===P.Element&&this.up();return this},c.prototype.dummy=function(){return this},c.prototype.node=function(b,x,_){var j;if(b==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(b));return this.openCurrent(),b=u(b),x==null&&(x={}),x=u(x),v(x)||(j=[x,_],_=j[0],x=j[1]),this.currentNode=new f(this,b,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,_!=null&&this.text(_),this},c.prototype.element=function(b,x,_){var j,F,L,X,z,H;if(this.currentNode&&this.currentNode.type===P.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(b)||v(b)||w(b))for(X=this.options.noValidation,this.options.noValidation=!0,H=new h(this.options).element("TEMP_ROOT"),H.element(b),this.options.noValidation=X,z=H.children,F=0,L=z.length;F<L;F++)j=z[F],this.createChildNode(j),j.type===P.Element&&this.up();else this.node(b,x,_);return this},c.prototype.attribute=function(b,x){var _,j;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(b));if(b!=null&&(b=u(b)),v(b))for(_ in b){if(!D.call(b,_))continue;j=b[_],this.attribute(_,j)}else w(x)&&(x=x.apply()),this.options.keepNullAttributes&&x==null?this.currentNode.attribs[b]=new S(this,b,""):x!=null&&(this.currentNode.attribs[b]=new S(this,b,x));return this},c.prototype.text=function(b){var x;return this.openCurrent(),x=new o(this,b),this.onData(this.writer.text(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.prototype.cdata=function(b){var x;return this.openCurrent(),x=new R(this,b),this.onData(this.writer.cdata(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.prototype.comment=function(b){var x;return this.openCurrent(),x=new T(this,b),this.onData(this.writer.comment(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.prototype.raw=function(b){var x;return this.openCurrent(),x=new y(this,b),this.onData(this.writer.raw(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.prototype.instruction=function(b,x){var _,j,F,L,X;if(this.openCurrent(),b!=null&&(b=u(b)),x!=null&&(x=u(x)),Array.isArray(b))for(_=0,L=b.length;_<L;_++)j=b[_],this.instruction(j);else if(v(b))for(j in b){if(!D.call(b,j))continue;F=b[j],this.instruction(j,F)}else w(x)&&(x=x.apply()),X=new E(this,b,x),this.onData(this.writer.processingInstruction(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},c.prototype.declaration=function(b,x,_){var j;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return j=new a(this,b,x,_),this.onData(this.writer.declaration(j,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.prototype.doctype=function(b,x,_){if(this.openCurrent(),b==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new r(this,x,_),this.currentNode.rootNodeName=b,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},c.prototype.dtdElement=function(b,x){var _;return this.openCurrent(),_=new C(this,b,x),this.onData(this.writer.dtdElement(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.prototype.attList=function(b,x,_,j,F){var L;return this.openCurrent(),L=new g(this,b,x,_,j,F),this.onData(this.writer.dtdAttList(L,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.prototype.entity=function(b,x){var _;return this.openCurrent(),_=new p(this,!1,b,x),this.onData(this.writer.dtdEntity(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.prototype.pEntity=function(b,x){var _;return this.openCurrent(),_=new p(this,!0,b,x),this.onData(this.writer.dtdEntity(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.prototype.notation=function(b,x){var _;return this.openCurrent(),_=new s(this,b,x),this.onData(this.writer.dtdNotation(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},c.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},c.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},c.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},c.prototype.openNode=function(b){var x,_,j,F;if(!b.isOpen){if(!this.root&&this.currentLevel===0&&b.type===P.Element&&(this.root=b),_="",b.type===P.Element){this.writerOptions.state=m.OpenTag,_=this.writer.indent(b,this.writerOptions,this.currentLevel)+"<"+b.name,F=b.attribs;for(j in F){if(!D.call(F,j))continue;x=F[j],_+=this.writer.attribute(x,this.writerOptions,this.currentLevel)}_+=(b.children?">":"/>")+this.writer.endline(b,this.writerOptions,this.currentLevel),this.writerOptions.state=m.InsideTag}else this.writerOptions.state=m.OpenTag,_=this.writer.indent(b,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+b.rootNodeName,b.pubID&&b.sysID?_+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.sysID&&(_+=' SYSTEM "'+b.sysID+'"'),b.children?(_+=" [",this.writerOptions.state=m.InsideTag):(this.writerOptions.state=m.CloseTag,_+=">"),_+=this.writer.endline(b,this.writerOptions,this.currentLevel);return this.onData(_,this.currentLevel),b.isOpen=!0}},c.prototype.closeNode=function(b){var x;if(!b.isClosed)return x="",this.writerOptions.state=m.CloseTag,b.type===P.Element?x=this.writer.indent(b,this.writerOptions,this.currentLevel)+"</"+b.name+">"+this.writer.endline(b,this.writerOptions,this.currentLevel):x=this.writer.indent(b,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(b,this.writerOptions,this.currentLevel),this.writerOptions.state=m.None,this.onData(x,this.currentLevel),b.isClosed=!0},c.prototype.onData=function(b,x){return this.documentStarted=!0,this.onDataCallback(b,x+1)},c.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},c.prototype.debugInfo=function(b){return b==null?"":"node: <"+b+">"},c.prototype.ele=function(){return this.element.apply(this,arguments)},c.prototype.nod=function(b,x,_){return this.node(b,x,_)},c.prototype.txt=function(b){return this.text(b)},c.prototype.dat=function(b){return this.cdata(b)},c.prototype.com=function(b){return this.comment(b)},c.prototype.ins=function(b,x){return this.instruction(b,x)},c.prototype.dec=function(b,x,_){return this.declaration(b,x,_)},c.prototype.dtd=function(b,x,_){return this.doctype(b,x,_)},c.prototype.e=function(b,x,_){return this.element(b,x,_)},c.prototype.n=function(b,x,_){return this.node(b,x,_)},c.prototype.t=function(b){return this.text(b)},c.prototype.d=function(b){return this.cdata(b)},c.prototype.c=function(b){return this.comment(b)},c.prototype.r=function(b){return this.raw(b)},c.prototype.i=function(b,x){return this.instruction(b,x)},c.prototype.att=function(){return this.currentNode&&this.currentNode.type===P.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},c.prototype.a=function(){return this.currentNode&&this.currentNode.type===P.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},c.prototype.ent=function(b,x){return this.entity(b,x)},c.prototype.pent=function(b,x){return this.pEntity(b,x)},c.prototype.not=function(b,x){return this.notation(b,x)},c}()}).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(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C=function(a,r){for(var h in r)p.call(r,h)&&(a[h]=r[h]);function d(){this.constructor=a}return d.prototype=r.prototype,a.prototype=new d,a.__super__=r.prototype,a},p={}.hasOwnProperty;g=I("./XMLNode"),R=I("./NodeType"),q.exports=T=function(s){C(a,s);function a(r){a.__super__.constructor.call(this,r),this.type=R.Dummy}return a.prototype.clone=function(){return(0,m.default)(this)},a.prototype.toString=function(r){return""},a}(g)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],271:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C,p,s,a,r,h,d=function(y,l){for(var n in l)f.call(l,n)&&(y[n]=l[n]);function o(){this.constructor=y}return o.prototype=l.prototype,y.prototype=new o,y.__super__=l.prototype,y},f={}.hasOwnProperty;h=I("./Utility"),r=h.isObject,a=h.isFunction,s=h.getValue,p=I("./XMLNode"),R=I("./NodeType"),T=I("./XMLAttribute"),C=I("./XMLNamedNodeMap"),q.exports=g=function(E){d(y,E);function y(l,n,o){var u,w,v,i;if(y.__super__.constructor.call(this,l),n==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(n),this.type=R.Element,this.attribs={},this.schemaTypeInfo=null,o!=null&&this.attribute(o),l.type===R.Document&&(this.isRoot=!0,this.documentObject=l,l.rootObject=this,l.children)){for(i=l.children,w=0,v=i.length;w<v;w++)if(u=i[w],u.type===R.DocType){u.name=this.name;break}}}return Object.defineProperty(y.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(y.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(y.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(y.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(y.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new C(this.attribs)),this.attributeMap}}),y.prototype.clone=function(){var l,n,o,u;o=(0,m.default)(this),o.isRoot&&(o.documentObject=null),o.attribs={},u=this.attribs;for(n in u){if(!f.call(u,n))continue;l=u[n],o.attribs[n]=l.clone()}return o.children=[],this.children.forEach(function(w){var v;return v=w.clone(),v.parent=o,o.children.push(v)}),o},y.prototype.attribute=function(l,n){var o,u;if(l!=null&&(l=s(l)),r(l))for(o in l){if(!f.call(l,o))continue;u=l[o],this.attribute(o,u)}else a(n)&&(n=n.apply()),this.options.keepNullAttributes&&n==null?this.attribs[l]=new T(this,l,""):n!=null&&(this.attribs[l]=new T(this,l,n));return this},y.prototype.removeAttribute=function(l){var n,o,u;if(l==null)throw new Error("Missing attribute name. "+this.debugInfo());if(l=s(l),Array.isArray(l))for(o=0,u=l.length;o<u;o++)n=l[o],delete this.attribs[n];else delete this.attribs[l];return this},y.prototype.toString=function(l){return this.options.writer.element(this,this.options.writer.filterOptions(l))},y.prototype.att=function(l,n){return this.attribute(l,n)},y.prototype.a=function(l,n){return this.attribute(l,n)},y.prototype.getAttribute=function(l){return this.attribs.hasOwnProperty(l)?this.attribs[l].value:null},y.prototype.setAttribute=function(l,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNode=function(l){return this.attribs.hasOwnProperty(l)?this.attribs[l]:null},y.prototype.setAttributeNode=function(l){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNode=function(l){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagName=function(l){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNS=function(l,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNS=function(l,n,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNS=function(l,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNodeNS=function(l,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNodeNS=function(l){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagNameNS=function(l,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.hasAttribute=function(l){return this.attribs.hasOwnProperty(l)},y.prototype.hasAttributeNS=function(l,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttribute=function(l,n){return this.attribs.hasOwnProperty(l)?this.attribs[l].isId:n},y.prototype.setIdAttributeNS=function(l,n,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttributeNode=function(l,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagName=function(l){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagNameNS=function(l,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByClassName=function(l){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.isEqualNode=function(l){var n,o,u;if(!y.__super__.isEqualNode.apply(this,arguments).isEqualNode(l))return!1;if(l.namespaceURI!==this.namespaceURI)return!1;if(l.prefix!==this.prefix)return!1;if(l.localName!==this.localName)return!1;if(l.attribs.length!==this.attribs.length)return!1;for(n=o=0,u=this.attribs.length-1;0<=u?o<=u:o>=u;n=0<=u?++o:--o)if(!this.attribs[n].isEqualNode(l.attribs[n]))return!1;return!0},y}(p)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLAttribute":254,"./XMLNamedNodeMap":272,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],272:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/keys"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R;q.exports=R=function(){function T(g){this.nodes=g}return Object.defineProperty(T.prototype,"length",{get:function(){return(0,m.default)(this.nodes).length||0}}),T.prototype.clone=function(){return this.nodes=null},T.prototype.getNamedItem=function(g){return this.nodes[g]},T.prototype.setNamedItem=function(g){var C;return C=this.nodes[g.nodeName],this.nodes[g.nodeName]=g,C||null},T.prototype.removeNamedItem=function(g){var C;return C=this.nodes[g],delete this.nodes[g],C||null},T.prototype.item=function(g){return this.nodes[(0,m.default)(this.nodes)[g]]||null},T.prototype.getNamedItemNS=function(g,C){throw new Error("This DOM method is not implemented.")},T.prototype.setNamedItemNS=function(g){throw new Error("This DOM method is not implemented.")},T.prototype.removeNamedItemNS=function(g,C){throw new Error("This DOM method is not implemented.")},T}()}).call(void 0)},{"babel-runtime/core-js/object/keys":60}],273:[function(I,q,M){"use strict";(function(){var P,m,S,R,T,g,C,p,s,a,r,h,d,f,E,y,l,n,o,u={}.hasOwnProperty;o=I("./Utility"),n=o.isObject,l=o.isFunction,y=o.isEmpty,E=o.getValue,p=null,S=null,R=null,T=null,g=null,d=null,f=null,h=null,C=null,m=null,r=null,s=null,P=null,q.exports=a=function(){function w(v){this.parent=v,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,p||(p=I("./XMLElement"),S=I("./XMLCData"),R=I("./XMLComment"),T=I("./XMLDeclaration"),g=I("./XMLDocType"),d=I("./XMLRaw"),f=I("./XMLText"),h=I("./XMLProcessingInstruction"),C=I("./XMLDummy"),m=I("./NodeType"),r=I("./XMLNodeList"),s=I("./XMLNamedNodeMap"),P=I("./DocumentPosition"))}return Object.defineProperty(w.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(w.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(w.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(w.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(w.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new r(this.children)),this.childNodeList}}),Object.defineProperty(w.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(w.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(w.prototype,"previousSibling",{get:function(){var i;return i=this.parent.children.indexOf(this),this.parent.children[i-1]||null}}),Object.defineProperty(w.prototype,"nextSibling",{get:function(){var i;return i=this.parent.children.indexOf(this),this.parent.children[i+1]||null}}),Object.defineProperty(w.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(w.prototype,"textContent",{get:function(){var i,k,D,c,b;if(this.nodeType===m.Element||this.nodeType===m.DocumentFragment){for(b="",c=this.children,k=0,D=c.length;k<D;k++)i=c[k],i.textContent&&(b+=i.textContent);return b}else return null},set:function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),w.prototype.setParent=function(v){var i,k,D,c,b;for(this.parent=v,v&&(this.options=v.options,this.stringify=v.stringify),c=this.children,b=[],k=0,D=c.length;k<D;k++)i=c[k],b.push(i.setParent(this));return b},w.prototype.element=function(v,i,k){var D,c,b,x,_,j,F,L,X,z,H;if(j=null,i===null&&k==null&&(X=[{},null],i=X[0],k=X[1]),i==null&&(i={}),i=E(i),n(i)||(z=[i,k],k=z[0],i=z[1]),v!=null&&(v=E(v)),Array.isArray(v))for(b=0,F=v.length;b<F;b++)c=v[b],j=this.element(c);else if(l(v))j=this.element(v.apply());else if(n(v))for(_ in v){if(!u.call(v,_))continue;if(H=v[_],l(H)&&(H=H.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&_.indexOf(this.stringify.convertAttKey)===0)j=this.attribute(_.substr(this.stringify.convertAttKey.length),H);else if(!this.options.separateArrayItems&&Array.isArray(H)&&y(H))j=this.dummy();else if(n(H)&&y(H))j=this.element(_);else if(!this.options.keepNullNodes&&H==null)j=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(H))for(x=0,L=H.length;x<L;x++)c=H[x],D={},D[_]=c,j=this.element(D);else n(H)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&_.indexOf(this.stringify.convertTextKey)===0?j=this.element(H):(j=this.element(_),j.element(H)):j=this.element(_,H)}else!this.options.keepNullNodes&&k===null?j=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&v.indexOf(this.stringify.convertTextKey)===0?j=this.text(k):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&v.indexOf(this.stringify.convertCDataKey)===0?j=this.cdata(k):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&v.indexOf(this.stringify.convertCommentKey)===0?j=this.comment(k):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&v.indexOf(this.stringify.convertRawKey)===0?j=this.raw(k):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&v.indexOf(this.stringify.convertPIKey)===0?j=this.instruction(v.substr(this.stringify.convertPIKey.length),k):j=this.node(v,i,k);if(j==null)throw new Error("Could not create any elements with: "+v+". "+this.debugInfo());return j},w.prototype.insertBefore=function(v,i,k){var D,c,b,x,_;if(v!=null?v.type:void 0)return b=v,x=i,b.setParent(this),x?(c=children.indexOf(x),_=children.splice(c),children.push(b),Array.prototype.push.apply(children,_)):children.push(b),b;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(v));return c=this.parent.children.indexOf(this),_=this.parent.children.splice(c),D=this.parent.element(v,i,k),Array.prototype.push.apply(this.parent.children,_),D},w.prototype.insertAfter=function(v,i,k){var D,c,b;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(v));return c=this.parent.children.indexOf(this),b=this.parent.children.splice(c+1),D=this.parent.element(v,i,k),Array.prototype.push.apply(this.parent.children,b),D},w.prototype.remove=function(){var v,i;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return v=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[v,v-v+1].concat(i=[])),this.parent},w.prototype.node=function(v,i,k){var D,c;return v!=null&&(v=E(v)),i||(i={}),i=E(i),n(i)||(c=[i,k],k=c[0],i=c[1]),D=new p(this,v,i),k!=null&&D.text(k),this.children.push(D),D},w.prototype.text=function(v){var i;return n(v)&&this.element(v),i=new f(this,v),this.children.push(i),this},w.prototype.cdata=function(v){var i;return i=new S(this,v),this.children.push(i),this},w.prototype.comment=function(v){var i;return i=new R(this,v),this.children.push(i),this},w.prototype.commentBefore=function(v){var i,k,D;return k=this.parent.children.indexOf(this),D=this.parent.children.splice(k),i=this.parent.comment(v),Array.prototype.push.apply(this.parent.children,D),this},w.prototype.commentAfter=function(v){var i,k,D;return k=this.parent.children.indexOf(this),D=this.parent.children.splice(k+1),i=this.parent.comment(v),Array.prototype.push.apply(this.parent.children,D),this},w.prototype.raw=function(v){var i;return i=new d(this,v),this.children.push(i),this},w.prototype.dummy=function(){var v;return v=new C(this),v},w.prototype.instruction=function(v,i){var k,D,c,b,x;if(v!=null&&(v=E(v)),i!=null&&(i=E(i)),Array.isArray(v))for(b=0,x=v.length;b<x;b++)k=v[b],this.instruction(k);else if(n(v))for(k in v){if(!u.call(v,k))continue;D=v[k],this.instruction(k,D)}else l(i)&&(i=i.apply()),c=new h(this,v,i),this.children.push(c);return this},w.prototype.instructionBefore=function(v,i){var k,D,c;return D=this.parent.children.indexOf(this),c=this.parent.children.splice(D),k=this.parent.instruction(v,i),Array.prototype.push.apply(this.parent.children,c),this},w.prototype.instructionAfter=function(v,i){var k,D,c;return D=this.parent.children.indexOf(this),c=this.parent.children.splice(D+1),k=this.parent.instruction(v,i),Array.prototype.push.apply(this.parent.children,c),this},w.prototype.declaration=function(v,i,k){var D,c;return D=this.document(),c=new T(D,v,i,k),D.children.length===0?D.children.unshift(c):D.children[0].type===m.Declaration?D.children[0]=c:D.children.unshift(c),D.root()||D},w.prototype.dtd=function(v,i){var k,D,c,b,x,_,j,F,L,X;for(D=this.document(),c=new g(D,v,i),L=D.children,b=x=0,j=L.length;x<j;b=++x)if(k=L[b],k.type===m.DocType)return D.children[b]=c,c;for(X=D.children,b=_=0,F=X.length;_<F;b=++_)if(k=X[b],k.isRoot)return D.children.splice(b,0,c),c;return D.children.push(c),c},w.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},w.prototype.root=function(){var v;for(v=this;v;){if(v.type===m.Document)return v.rootObject;if(v.isRoot)return v;v=v.parent}},w.prototype.document=function(){var v;for(v=this;v;){if(v.type===m.Document)return v;v=v.parent}},w.prototype.end=function(v){return this.document().end(v)},w.prototype.prev=function(){var v;if(v=this.parent.children.indexOf(this),v<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[v-1]},w.prototype.next=function(){var v;if(v=this.parent.children.indexOf(this),v===-1||v===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[v+1]},w.prototype.importDocument=function(v){var i;return i=v.root().clone(),i.parent=this,i.isRoot=!1,this.children.push(i),this},w.prototype.debugInfo=function(v){var i,k;return v=v||this.name,v==null&&!((i=this.parent)!=null?i.name:void 0)?"":v==null?"parent: <"+this.parent.name+">":((k=this.parent)!=null?k.name:void 0)?"node: <"+v+">, parent: <"+this.parent.name+">":"node: <"+v+">"},w.prototype.ele=function(v,i,k){return this.element(v,i,k)},w.prototype.nod=function(v,i,k){return this.node(v,i,k)},w.prototype.txt=function(v){return this.text(v)},w.prototype.dat=function(v){return this.cdata(v)},w.prototype.com=function(v){return this.comment(v)},w.prototype.ins=function(v,i){return this.instruction(v,i)},w.prototype.doc=function(){return this.document()},w.prototype.dec=function(v,i,k){return this.declaration(v,i,k)},w.prototype.e=function(v,i,k){return this.element(v,i,k)},w.prototype.n=function(v,i,k){return this.node(v,i,k)},w.prototype.t=function(v){return this.text(v)},w.prototype.d=function(v){return this.cdata(v)},w.prototype.c=function(v){return this.comment(v)},w.prototype.r=function(v){return this.raw(v)},w.prototype.i=function(v,i){return this.instruction(v,i)},w.prototype.u=function(){return this.up()},w.prototype.importXMLBuilder=function(v){return this.importDocument(v)},w.prototype.replaceChild=function(v,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.removeChild=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.appendChild=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.hasChildNodes=function(){return this.children.length!==0},w.prototype.cloneNode=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isSupported=function(v,i){return!0},w.prototype.hasAttributes=function(){return this.attribs.length!==0},w.prototype.compareDocumentPosition=function(v){var i,k;return i=this,i===v?0:this.document()!==v.document()?(k=P.Disconnected|P.ImplementationSpecific,Math.random()<.5?k|=P.Preceding:k|=P.Following,k):i.isAncestor(v)?P.Contains|P.Preceding:i.isDescendant(v)?P.Contains|P.Following:i.isPreceding(v)?P.Preceding:P.Following},w.prototype.isSameNode=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.lookupPrefix=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isDefaultNamespace=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.lookupNamespaceURI=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isEqualNode=function(v){var i,k,D;if(v.nodeType!==this.nodeType)return!1;if(v.children.length!==this.children.length)return!1;for(i=k=0,D=this.children.length-1;0<=D?k<=D:k>=D;i=0<=D?++k:--k)if(!this.children[i].isEqualNode(v.children[i]))return!1;return!0},w.prototype.getFeature=function(v,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.setUserData=function(v,i,k){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.getUserData=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.contains=function(v){return v?v===this||this.isDescendant(v):!1},w.prototype.isDescendant=function(v){var i,k,D,c,b;for(b=this.children,D=0,c=b.length;D<c;D++){if(i=b[D],v===i)return!0;if(k=i.isDescendant(v),k)return!0}return!1},w.prototype.isAncestor=function(v){return v.isDescendant(this)},w.prototype.isPreceding=function(v){var i,k;return i=this.treePosition(v),k=this.treePosition(this),i===-1||k===-1?!1:i<k},w.prototype.isFollowing=function(v){var i,k;return i=this.treePosition(v),k=this.treePosition(this),i===-1||k===-1?!1:i>k},w.prototype.treePosition=function(v){var i,k;return k=0,i=!1,this.foreachTreeNode(this.document(),function(D){if(k++,!i&&D===v)return i=!0}),i?k:-1},w.prototype.foreachTreeNode=function(v,i){var k,D,c,b,x;for(v||(v=this.document()),b=v.children,D=0,c=b.length;D<c;D++){if(k=b[D],x=i(k))return x;if(x=this.foreachTreeNode(k,i),x)return x}},w}()}).call(void 0)},{"./DocumentPosition":250,"./NodeType":251,"./Utility":252,"./XMLCData":255,"./XMLComment":257,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDummy":270,"./XMLElement":271,"./XMLNamedNodeMap":272,"./XMLNodeList":274,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLText":280}],274:[function(I,q,M){"use strict";(function(){var P;q.exports=P=function(){function m(S){this.nodes=S}return Object.defineProperty(m.prototype,"length",{get:function(){return this.nodes.length||0}}),m.prototype.clone=function(){return this.nodes=null},m.prototype.item=function(S){return this.nodes[S]||null},m}()}).call(void 0)},{}],275:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C=function(a,r){for(var h in r)p.call(r,h)&&(a[h]=r[h]);function d(){this.constructor=a}return d.prototype=r.prototype,a.prototype=new d,a.__super__=r.prototype,a},p={}.hasOwnProperty;R=I("./NodeType"),T=I("./XMLCharacterData"),q.exports=g=function(s){C(a,s);function a(r,h,d){if(a.__super__.constructor.call(this,r),h==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=R.ProcessingInstruction,this.target=this.stringify.insTarget(h),this.name=this.target,d&&(this.value=this.stringify.insValue(d))}return a.prototype.clone=function(){return(0,m.default)(this)},a.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))},a.prototype.isEqualNode=function(r){return a.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)?!(r.target!==this.target):!1},a}(T)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],276:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C=function(a,r){for(var h in r)p.call(r,h)&&(a[h]=r[h]);function d(){this.constructor=a}return d.prototype=r.prototype,a.prototype=new d,a.__super__=r.prototype,a},p={}.hasOwnProperty;R=I("./NodeType"),T=I("./XMLNode"),q.exports=g=function(s){C(a,s);function a(r,h){if(a.__super__.constructor.call(this,r),h==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=R.Raw,this.value=this.stringify.raw(h)}return a.prototype.clone=function(){return(0,m.default)(this)},a.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))},a}(T)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],277:[function(I,q,M){"use strict";(function(){var P,m,S,R,T=function(p,s){for(var a in s)g.call(s,a)&&(p[a]=s[a]);function r(){this.constructor=p}return r.prototype=s.prototype,p.prototype=new r,p.__super__=s.prototype,p},g={}.hasOwnProperty;P=I("./NodeType"),R=I("./XMLWriterBase"),m=I("./WriterState"),q.exports=S=function(C){T(p,C);function p(s,a){this.stream=s,p.__super__.constructor.call(this,a)}return p.prototype.endline=function(s,a,r){return s.isLastRootNode&&a.state===m.CloseTag?"":p.__super__.endline.call(this,s,a,r)},p.prototype.document=function(s,a){var r,h,d,f,E,y,l,n,o;for(l=s.children,h=d=0,E=l.length;d<E;h=++d)r=l[h],r.isLastRootNode=h===s.children.length-1;for(a=this.filterOptions(a),n=s.children,o=[],f=0,y=n.length;f<y;f++)r=n[f],o.push(this.writeChildNode(r,a,0));return o},p.prototype.attribute=function(s,a,r){return this.stream.write(p.__super__.attribute.call(this,s,a,r))},p.prototype.cdata=function(s,a,r){return this.stream.write(p.__super__.cdata.call(this,s,a,r))},p.prototype.comment=function(s,a,r){return this.stream.write(p.__super__.comment.call(this,s,a,r))},p.prototype.declaration=function(s,a,r){return this.stream.write(p.__super__.declaration.call(this,s,a,r))},p.prototype.docType=function(s,a,r){var h,d,f,E;if(r||(r=0),this.openNode(s,a,r),a.state=m.OpenTag,this.stream.write(this.indent(s,a,r)),this.stream.write("<!DOCTYPE "+s.root().name),s.pubID&&s.sysID?this.stream.write(' PUBLIC "'+s.pubID+'" "'+s.sysID+'"'):s.sysID&&this.stream.write(' SYSTEM "'+s.sysID+'"'),s.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(s,a,r)),a.state=m.InsideTag,E=s.children,d=0,f=E.length;d<f;d++)h=E[d],this.writeChildNode(h,a,r+1);a.state=m.CloseTag,this.stream.write("]")}return a.state=m.CloseTag,this.stream.write(a.spaceBeforeSlash+">"),this.stream.write(this.endline(s,a,r)),a.state=m.None,this.closeNode(s,a,r)},p.prototype.element=function(s,a,r){var h,d,f,E,y,l,n,o,u,w;r||(r=0),this.openNode(s,a,r),a.state=m.OpenTag,this.stream.write(this.indent(s,a,r)+"<"+s.name),u=s.attribs;for(n in u){if(!g.call(u,n))continue;h=u[n],this.attribute(h,a,r)}if(f=s.children.length,E=f===0?null:s.children[0],f===0||s.children.every(function(v){return(v.type===P.Text||v.type===P.Raw)&&v.value===""}))a.allowEmpty?(this.stream.write(">"),a.state=m.CloseTag,this.stream.write("</"+s.name+">")):(a.state=m.CloseTag,this.stream.write(a.spaceBeforeSlash+"/>"));else if(a.pretty&&f===1&&(E.type===P.Text||E.type===P.Raw)&&E.value!=null)this.stream.write(">"),a.state=m.InsideTag,a.suppressPrettyCount++,o=!0,this.writeChildNode(E,a,r+1),a.suppressPrettyCount--,o=!1,a.state=m.CloseTag,this.stream.write("</"+s.name+">");else{for(this.stream.write(">"+this.endline(s,a,r)),a.state=m.InsideTag,w=s.children,y=0,l=w.length;y<l;y++)d=w[y],this.writeChildNode(d,a,r+1);a.state=m.CloseTag,this.stream.write(this.indent(s,a,r)+"</"+s.name+">")}return this.stream.write(this.endline(s,a,r)),a.state=m.None,this.closeNode(s,a,r)},p.prototype.processingInstruction=function(s,a,r){return this.stream.write(p.__super__.processingInstruction.call(this,s,a,r))},p.prototype.raw=function(s,a,r){return this.stream.write(p.__super__.raw.call(this,s,a,r))},p.prototype.text=function(s,a,r){return this.stream.write(p.__super__.text.call(this,s,a,r))},p.prototype.dtdAttList=function(s,a,r){return this.stream.write(p.__super__.dtdAttList.call(this,s,a,r))},p.prototype.dtdElement=function(s,a,r){return this.stream.write(p.__super__.dtdElement.call(this,s,a,r))},p.prototype.dtdEntity=function(s,a,r){return this.stream.write(p.__super__.dtdEntity.call(this,s,a,r))},p.prototype.dtdNotation=function(s,a,r){return this.stream.write(p.__super__.dtdNotation.call(this,s,a,r))},p}(R)}).call(void 0)},{"./NodeType":251,"./WriterState":253,"./XMLWriterBase":281}],278:[function(I,q,M){"use strict";(function(){var P,m,S=function(g,C){for(var p in C)R.call(C,p)&&(g[p]=C[p]);function s(){this.constructor=g}return s.prototype=C.prototype,g.prototype=new s,g.__super__=C.prototype,g},R={}.hasOwnProperty;m=I("./XMLWriterBase"),q.exports=P=function(T){S(g,T);function g(C){g.__super__.constructor.call(this,C)}return g.prototype.document=function(C,p){var s,a,r,h,d;for(p=this.filterOptions(p),h="",d=C.children,a=0,r=d.length;a<r;a++)s=d[a],h+=this.writeChildNode(s,p,0);return p.pretty&&h.slice(-p.newline.length)===p.newline&&(h=h.slice(0,-p.newline.length)),h},g}(m)}).call(void 0)},{"./XMLWriterBase":281}],279:[function(I,q,M){"use strict";(function(){var P,m=function(T,g){return function(){return T.apply(g,arguments)}},S={}.hasOwnProperty;q.exports=P=function(){function R(T){this.assertLegalName=m(this.assertLegalName,this),this.assertLegalChar=m(this.assertLegalChar,this);var g,C,p;T||(T={}),this.options=T,this.options.version||(this.options.version="1.0"),C=T.stringify||{};for(g in C){if(!S.call(C,g))continue;p=C[g],this[g]=p}}return R.prototype.name=function(T){return this.options.noValidation?T:this.assertLegalName(""+T||"")},R.prototype.text=function(T){return this.options.noValidation?T:this.assertLegalChar(this.textEscape(""+T||""))},R.prototype.cdata=function(T){return this.options.noValidation?T:(T=""+T||"",T=T.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(T))},R.prototype.comment=function(T){if(this.options.noValidation)return T;if(T=""+T||"",T.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+T);return this.assertLegalChar(T)},R.prototype.raw=function(T){return this.options.noValidation?T:""+T||""},R.prototype.attValue=function(T){return this.options.noValidation?T:this.assertLegalChar(this.attEscape(T=""+T||""))},R.prototype.insTarget=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.insValue=function(T){if(this.options.noValidation)return T;if(T=""+T||"",T.match(/\?>/))throw new Error("Invalid processing instruction value: "+T);return this.assertLegalChar(T)},R.prototype.xmlVersion=function(T){if(this.options.noValidation)return T;if(T=""+T||"",!T.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+T);return T},R.prototype.xmlEncoding=function(T){if(this.options.noValidation)return T;if(T=""+T||"",!T.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+T);return this.assertLegalChar(T)},R.prototype.xmlStandalone=function(T){return this.options.noValidation?T:T?"yes":"no"},R.prototype.dtdPubID=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdSysID=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdElementValue=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdAttType=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdAttDefault=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdEntityValue=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.dtdNData=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},R.prototype.convertAttKey="@",R.prototype.convertPIKey="?",R.prototype.convertTextKey="#text",R.prototype.convertCDataKey="#cdata",R.prototype.convertCommentKey="#comment",R.prototype.convertRawKey="#raw",R.prototype.assertLegalChar=function(T){var g,C;if(this.options.noValidation)return T;if(g="",this.options.version==="1.0"){if(g=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=T.match(g))throw new Error("Invalid character in string: "+T+" at index "+C.index)}else if(this.options.version==="1.1"&&(g=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=T.match(g)))throw new Error("Invalid character in string: "+T+" at index "+C.index);return T},R.prototype.assertLegalName=function(T){var g;if(this.options.noValidation)return T;if(this.assertLegalChar(T),g=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!T.match(g))throw new Error("Invalid character in name");return T},R.prototype.textEscape=function(T){var g;return this.options.noValidation?T:(g=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,T.replace(g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},R.prototype.attEscape=function(T){var g;return this.options.noValidation?T:(g=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,T.replace(g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},R}()}).call(void 0)},{}],280:[function(I,q,M){"use strict";var P=I("babel-runtime/core-js/object/create"),m=S(P);function S(R){return R&&R.__esModule?R:{default:R}}(function(){var R,T,g,C=function(a,r){for(var h in r)p.call(r,h)&&(a[h]=r[h]);function d(){this.constructor=a}return d.prototype=r.prototype,a.prototype=new d,a.__super__=r.prototype,a},p={}.hasOwnProperty;R=I("./NodeType"),T=I("./XMLCharacterData"),q.exports=g=function(s){C(a,s);function a(r,h){if(a.__super__.constructor.call(this,r),h==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=R.Text,this.value=this.stringify.text(h)}return Object.defineProperty(a.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(a.prototype,"wholeText",{get:function(){var h,d,f;for(f="",d=this.previousSibling;d;)f=d.data+f,d=d.previousSibling;for(f+=this.data,h=this.nextSibling;h;)f=f+h.data,h=h.nextSibling;return f}}),a.prototype.clone=function(){return(0,m.default)(this)},a.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))},a.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},a}(T)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],281:[function(I,q,M){"use strict";(function(){var P,m,S,R,T,g,C,p,s,a,r,h,d,f,E,y,l,n={}.hasOwnProperty;l=I("./Utility").assign,P=I("./NodeType"),s=I("./XMLDeclaration"),a=I("./XMLDocType"),S=I("./XMLCData"),R=I("./XMLComment"),h=I("./XMLElement"),f=I("./XMLRaw"),E=I("./XMLText"),d=I("./XMLProcessingInstruction"),r=I("./XMLDummy"),T=I("./XMLDTDAttList"),g=I("./XMLDTDElement"),C=I("./XMLDTDEntity"),p=I("./XMLDTDNotation"),m=I("./WriterState"),q.exports=y=function(){function o(u){var w,v,i;u||(u={}),this.options=u,v=u.writer||{};for(w in v){if(!n.call(v,w))continue;i=v[w],this["_"+w]=this[w],this[w]=i}}return o.prototype.filterOptions=function(u){var w,v,i,k,D,c,b,x;return u||(u={}),u=l({},this.options,u),w={writer:this},w.pretty=u.pretty||!1,w.allowEmpty=u.allowEmpty||!1,w.indent=(v=u.indent)!=null?v:" ",w.newline=(i=u.newline)!=null?i:`
`,w.offset=(k=u.offset)!=null?k:0,w.dontPrettyTextNodes=(D=(c=u.dontPrettyTextNodes)!=null?c:u.dontprettytextnodes)!=null?D:0,w.spaceBeforeSlash=(b=(x=u.spaceBeforeSlash)!=null?x:u.spacebeforeslash)!=null?b:"",w.spaceBeforeSlash===!0&&(w.spaceBeforeSlash=" "),w.suppressPrettyCount=0,w.user={},w.state=m.None,w},o.prototype.indent=function(u,w,v){var i;return!w.pretty||w.suppressPrettyCount?"":w.pretty&&(i=(v||0)+w.offset+1,i>0)?new Array(i).join(w.indent):""},o.prototype.endline=function(u,w,v){return!w.pretty||w.suppressPrettyCount?"":w.newline},o.prototype.attribute=function(u,w,v){var i;return this.openAttribute(u,w,v),i=" "+u.name+'="'+u.value+'"',this.closeAttribute(u,w,v),i},o.prototype.cdata=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"<![CDATA[",w.state=m.InsideTag,i+=u.value,w.state=m.CloseTag,i+="]]>"+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.comment=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"<!-- ",w.state=m.InsideTag,i+=u.value,w.state=m.CloseTag,i+=" -->"+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.declaration=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"<?xml",w.state=m.InsideTag,i+=' version="'+u.version+'"',u.encoding!=null&&(i+=' encoding="'+u.encoding+'"'),u.standalone!=null&&(i+=' standalone="'+u.standalone+'"'),w.state=m.CloseTag,i+=w.spaceBeforeSlash+"?>",i+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.docType=function(u,w,v){var i,k,D,c,b;if(v||(v=0),this.openNode(u,w,v),w.state=m.OpenTag,c=this.indent(u,w,v),c+="<!DOCTYPE "+u.root().name,u.pubID&&u.sysID?c+=' PUBLIC "'+u.pubID+'" "'+u.sysID+'"':u.sysID&&(c+=' SYSTEM "'+u.sysID+'"'),u.children.length>0){for(c+=" [",c+=this.endline(u,w,v),w.state=m.InsideTag,b=u.children,k=0,D=b.length;k<D;k++)i=b[k],c+=this.writeChildNode(i,w,v+1);w.state=m.CloseTag,c+="]"}return w.state=m.CloseTag,c+=w.spaceBeforeSlash+">",c+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),c},o.prototype.element=function(u,w,v){var i,k,D,c,b,x,_,j,F,L,X,z,H,G;v||(v=0),L=!1,X="",this.openNode(u,w,v),w.state=m.OpenTag,X+=this.indent(u,w,v)+"<"+u.name,z=u.attribs;for(F in z){if(!n.call(z,F))continue;i=z[F],X+=this.attribute(i,w,v)}if(D=u.children.length,c=D===0?null:u.children[0],D===0||u.children.every(function(U){return(U.type===P.Text||U.type===P.Raw)&&U.value===""}))w.allowEmpty?(X+=">",w.state=m.CloseTag,X+="</"+u.name+">"+this.endline(u,w,v)):(w.state=m.CloseTag,X+=w.spaceBeforeSlash+"/>"+this.endline(u,w,v));else if(w.pretty&&D===1&&(c.type===P.Text||c.type===P.Raw)&&c.value!=null)X+=">",w.state=m.InsideTag,w.suppressPrettyCount++,L=!0,X+=this.writeChildNode(c,w,v+1),w.suppressPrettyCount--,L=!1,w.state=m.CloseTag,X+="</"+u.name+">"+this.endline(u,w,v);else{if(w.dontPrettyTextNodes){for(H=u.children,b=0,_=H.length;b<_;b++)if(k=H[b],(k.type===P.Text||k.type===P.Raw)&&k.value!=null){w.suppressPrettyCount++,L=!0;break}}for(X+=">"+this.endline(u,w,v),w.state=m.InsideTag,G=u.children,x=0,j=G.length;x<j;x++)k=G[x],X+=this.writeChildNode(k,w,v+1);w.state=m.CloseTag,X+=this.indent(u,w,v)+"</"+u.name+">",L&&w.suppressPrettyCount--,X+=this.endline(u,w,v),w.state=m.None}return this.closeNode(u,w,v),X},o.prototype.writeChildNode=function(u,w,v){switch(u.type){case P.CData:return this.cdata(u,w,v);case P.Comment:return this.comment(u,w,v);case P.Element:return this.element(u,w,v);case P.Raw:return this.raw(u,w,v);case P.Text:return this.text(u,w,v);case P.ProcessingInstruction:return this.processingInstruction(u,w,v);case P.Dummy:return"";case P.Declaration:return this.declaration(u,w,v);case P.DocType:return this.docType(u,w,v);case P.AttributeDeclaration:return this.dtdAttList(u,w,v);case P.ElementDeclaration:return this.dtdElement(u,w,v);case P.EntityDeclaration:return this.dtdEntity(u,w,v);case P.NotationDeclaration:return this.dtdNotation(u,w,v);default:throw new Error("Unknown XML node type: "+u.constructor.name)}},o.prototype.processingInstruction=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"<?",w.state=m.InsideTag,i+=u.target,u.value&&(i+=" "+u.value),w.state=m.CloseTag,i+=w.spaceBeforeSlash+"?>",i+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.raw=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v),w.state=m.InsideTag,i+=u.value,w.state=m.CloseTag,i+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.text=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v),w.state=m.InsideTag,i+=u.value,w.state=m.CloseTag,i+=this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.dtdAttList=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"<!ATTLIST",w.state=m.InsideTag,i+=" "+u.elementName+" "+u.attributeName+" "+u.attributeType,u.defaultValueType!=="#DEFAULT"&&(i+=" "+u.defaultValueType),u.defaultValue&&(i+=' "'+u.defaultValue+'"'),w.state=m.CloseTag,i+=w.spaceBeforeSlash+">"+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.dtdElement=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"<!ELEMENT",w.state=m.InsideTag,i+=" "+u.name+" "+u.value,w.state=m.CloseTag,i+=w.spaceBeforeSlash+">"+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.dtdEntity=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"<!ENTITY",w.state=m.InsideTag,u.pe&&(i+=" %"),i+=" "+u.name,u.value?i+=' "'+u.value+'"':(u.pubID&&u.sysID?i+=' PUBLIC "'+u.pubID+'" "'+u.sysID+'"':u.sysID&&(i+=' SYSTEM "'+u.sysID+'"'),u.nData&&(i+=" NDATA "+u.nData)),w.state=m.CloseTag,i+=w.spaceBeforeSlash+">"+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.dtdNotation=function(u,w,v){var i;return this.openNode(u,w,v),w.state=m.OpenTag,i=this.indent(u,w,v)+"<!NOTATION",w.state=m.InsideTag,i+=" "+u.name,u.pubID&&u.sysID?i+=' PUBLIC "'+u.pubID+'" "'+u.sysID+'"':u.pubID?i+=' PUBLIC "'+u.pubID+'"':u.sysID&&(i+=' SYSTEM "'+u.sysID+'"'),w.state=m.CloseTag,i+=w.spaceBeforeSlash+">"+this.endline(u,w,v),w.state=m.None,this.closeNode(u,w,v),i},o.prototype.openNode=function(u,w,v){},o.prototype.closeNode=function(u,w,v){},o.prototype.openAttribute=function(u,w,v){},o.prototype.closeAttribute=function(u,w,v){},o}()}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLCData":255,"./XMLComment":257,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDummy":270,"./XMLElement":271,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLText":280}],282:[function(I,q,M){"use strict";(function(){var P,m,S,R,T,g,C,p,s,a;a=I("./Utility"),p=a.assign,s=a.isFunction,S=I("./XMLDOMImplementation"),R=I("./XMLDocument"),T=I("./XMLDocumentCB"),C=I("./XMLStringWriter"),g=I("./XMLStreamWriter"),P=I("./NodeType"),m=I("./WriterState"),q.exports.create=function(r,h,d,f){var E,y;if(r==null)throw new Error("Root element needs a name.");return f=p({},h,d,f),E=new R(f),y=E.element(r),f.headless||(E.declaration(f),(f.pubID!=null||f.sysID!=null)&&E.dtd(f)),y},q.exports.begin=function(r,h,d){var f;return s(r)&&(f=[r,h],h=f[0],d=f[1],r={}),h?new T(r,h,d):new R(r)},q.exports.stringWriter=function(r){return new C(r)},q.exports.streamWriter=function(r,h){return new g(r,h)},q.exports.implementation=new S,q.exports.nodeType=P,q.exports.writerState=m}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLDOMImplementation":260,"./XMLDocument":268,"./XMLDocumentCB":269,"./XMLStreamWriter":277,"./XMLStringWriter":278}],283:[function(I,q,M){q.exports=m;var P=Object.prototype.hasOwnProperty;function m(){for(var S={},R=0;R<arguments.length;R++){var T=arguments[R];for(var g in T)P.call(T,g)&&(S[g]=T[g])}return S}},{}],284:[function(I,q,M){"use strict";var P=I("buffer").Buffer,m=I("./sha"),S=I("./md5"),R={sha1:m,md5:S},T=64,g=P.alloc(T);g.fill(0);function C(a,r,h){P.isBuffer(r)||(r=P.from(r)),P.isBuffer(h)||(h=P.from(h)),r.length>T?r=a(r):r.length<T&&(r=P.concat([r,g],T));for(var d=P.alloc(T),f=P.alloc(T),E=0;E<T;E++)d[E]=r[E]^54,f[E]=r[E]^92;var y=a(P.concat([d,h]));return a(P.concat([f,y]))}function p(a,r){a=a||"sha1";var h=R[a],d=[],f=0;return h||s("algorithm:",a,"is not yet supported"),{update:function(y){return P.isBuffer(y)||(y=P.from(y)),d.push(y),f+=y.length,this},digest:function(y){var l=P.concat(d),n=r?C(h,r,l):h(l);return d=null,y?n.toString(y):n}}}function s(){var a=[].slice.call(arguments).join(" ");throw new Error([a,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
`))}M.createHash=function(a){return p(a)},M.createHmac=function(a,r){return p(a,r)},M.createCredentials=function(){s("sorry,createCredentials is not implemented yet")},M.createCipher=function(){s("sorry,createCipher is not implemented yet")},M.createCipheriv=function(){s("sorry,createCipheriv is not implemented yet")},M.createDecipher=function(){s("sorry,createDecipher is not implemented yet")},M.createDecipheriv=function(){s("sorry,createDecipheriv is not implemented yet")},M.createSign=function(){s("sorry,createSign is not implemented yet")},M.createVerify=function(){s("sorry,createVerify is not implemented yet")},M.createDiffieHellman=function(){s("sorry,createDiffieHellman is not implemented yet")},M.pbkdf2=function(){s("sorry,pbkdf2 is not implemented yet")}},{"./md5":286,"./sha":287,buffer:73}],285:[function(I,q,M){"use strict";var P=I("buffer").Buffer,m=4,S=P.alloc(m);S.fill(0);var R=8;function T(p,s){if(p.length%m!==0){var a=p.length+(m-p.length%m);p=P.concat([p,S],a)}for(var r=[],h=s?p.readInt32BE:p.readInt32LE,d=0;d<p.length;d+=m)r.push(h.call(p,d));return r}function g(p,s,a){for(var r=P.alloc(s),h=a?r.writeInt32BE:r.writeInt32LE,d=0;d<p.length;d++)h.call(r,p[d],d*4,!0);return r}function C(p,s,a,r){P.isBuffer(p)||(p=P.from(p));var h=s(T(p,r),p.length*R);return g(h,a,r)}q.exports={hash:C}},{buffer:73}],286:[function(I,q,M){"use strict";var P=I("./helpers");function m(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function S(r,h){r[h>>5]|=128<<h%32,r[(h+64>>>9<<4)+14]=h;for(var d=1732584193,f=-271733879,E=-1732584194,y=271733878,l=0;l<r.length;l+=16){var n=d,o=f,u=E,w=y;d=T(d,f,E,y,r[l+0],7,-680876936),y=T(y,d,f,E,r[l+1],12,-389564586),E=T(E,y,d,f,r[l+2],17,606105819),f=T(f,E,y,d,r[l+3],22,-1044525330),d=T(d,f,E,y,r[l+4],7,-176418897),y=T(y,d,f,E,r[l+5],12,1200080426),E=T(E,y,d,f,r[l+6],17,-1473231341),f=T(f,E,y,d,r[l+7],22,-45705983),d=T(d,f,E,y,r[l+8],7,1770035416),y=T(y,d,f,E,r[l+9],12,-1958414417),E=T(E,y,d,f,r[l+10],17,-42063),f=T(f,E,y,d,r[l+11],22,-1990404162),d=T(d,f,E,y,r[l+12],7,1804603682),y=T(y,d,f,E,r[l+13],12,-40341101),E=T(E,y,d,f,r[l+14],17,-1502002290),f=T(f,E,y,d,r[l+15],22,1236535329),d=g(d,f,E,y,r[l+1],5,-165796510),y=g(y,d,f,E,r[l+6],9,-1069501632),E=g(E,y,d,f,r[l+11],14,643717713),f=g(f,E,y,d,r[l+0],20,-373897302),d=g(d,f,E,y,r[l+5],5,-701558691),y=g(y,d,f,E,r[l+10],9,38016083),E=g(E,y,d,f,r[l+15],14,-660478335),f=g(f,E,y,d,r[l+4],20,-405537848),d=g(d,f,E,y,r[l+9],5,568446438),y=g(y,d,f,E,r[l+14],9,-1019803690),E=g(E,y,d,f,r[l+3],14,-187363961),f=g(f,E,y,d,r[l+8],20,1163531501),d=g(d,f,E,y,r[l+13],5,-1444681467),y=g(y,d,f,E,r[l+2],9,-51403784),E=g(E,y,d,f,r[l+7],14,1735328473),f=g(f,E,y,d,r[l+12],20,-1926607734),d=C(d,f,E,y,r[l+5],4,-378558),y=C(y,d,f,E,r[l+8],11,-2022574463),E=C(E,y,d,f,r[l+11],16,1839030562),f=C(f,E,y,d,r[l+14],23,-35309556),d=C(d,f,E,y,r[l+1],4,-1530992060),y=C(y,d,f,E,r[l+4],11,1272893353),E=C(E,y,d,f,r[l+7],16,-155497632),f=C(f,E,y,d,r[l+10],23,-1094730640),d=C(d,f,E,y,r[l+13],4,681279174),y=C(y,d,f,E,r[l+0],11,-358537222),E=C(E,y,d,f,r[l+3],16,-722521979),f=C(f,E,y,d,r[l+6],23,76029189),d=C(d,f,E,y,r[l+9],4,-640364487),y=C(y,d,f,E,r[l+12],11,-421815835),E=C(E,y,d,f,r[l+15],16,530742520),f=C(f,E,y,d,r[l+2],23,-995338651),d=p(d,f,E,y,r[l+0],6,-198630844),y=p(y,d,f,E,r[l+7],10,1126891415),E=p(E,y,d,f,r[l+14],15,-1416354905),f=p(f,E,y,d,r[l+5],21,-57434055),d=p(d,f,E,y,r[l+12],6,1700485571),y=p(y,d,f,E,r[l+3],10,-1894986606),E=p(E,y,d,f,r[l+10],15,-1051523),f=p(f,E,y,d,r[l+1],21,-2054922799),d=p(d,f,E,y,r[l+8],6,1873313359),y=p(y,d,f,E,r[l+15],10,-30611744),E=p(E,y,d,f,r[l+6],15,-1560198380),f=p(f,E,y,d,r[l+13],21,1309151649),d=p(d,f,E,y,r[l+4],6,-145523070),y=p(y,d,f,E,r[l+11],10,-1120210379),E=p(E,y,d,f,r[l+2],15,718787259),f=p(f,E,y,d,r[l+9],21,-343485551),d=s(d,n),f=s(f,o),E=s(E,u),y=s(y,w)}return Array(d,f,E,y)}function R(r,h,d,f,E,y){return s(a(s(s(h,r),s(f,y)),E),d)}function T(r,h,d,f,E,y,l){return R(h&d|~h&f,r,h,E,y,l)}function g(r,h,d,f,E,y,l){return R(h&f|d&~f,r,h,E,y,l)}function C(r,h,d,f,E,y,l){return R(h^d^f,r,h,E,y,l)}function p(r,h,d,f,E,y,l){return R(d^(h|~f),r,h,E,y,l)}function s(r,h){var d=(r&65535)+(h&65535),f=(r>>16)+(h>>16)+(d>>16);return f<<16|d&65535}function a(r,h){return r<<h|r>>>32-h}q.exports=function(h){return P.hash(h,S,16)}},{"./helpers":285}],287:[function(I,q,M){"use strict";var P=I("./helpers");function m(C,p){C[p>>5]|=128<<24-p%32,C[(p+64>>9<<4)+15]=p;for(var s=Array(80),a=1732584193,r=-271733879,h=-1732584194,d=271733878,f=-1009589776,E=0;E<C.length;E+=16){for(var y=a,l=r,n=h,o=d,u=f,w=0;w<80;w++){w<16?s[w]=C[E+w]:s[w]=g(s[w-3]^s[w-8]^s[w-14]^s[w-16],1);var v=T(T(g(a,5),S(w,r,h,d)),T(T(f,s[w]),R(w)));f=d,d=h,h=g(r,30),r=a,a=v}a=T(a,y),r=T(r,l),h=T(h,n),d=T(d,o),f=T(f,u)}return Array(a,r,h,d,f)}function S(C,p,s,a){return C<20?p&s|~p&a:C<40?p^s^a:C<60?p&s|p&a|s&a:p^s^a}function R(C){return C<20?1518500249:C<40?1859775393:C<60?-1894007588:-899497514}function T(C,p){var s=(C&65535)+(p&65535),a=(C>>16)+(p>>16)+(s>>16);return a<<16|s&65535}function g(C,p){return C<<p|C>>>32-p}q.exports=function(p){return P.hash(p,m,20,!0)}},{"./helpers":285}],288:[function(I,q,M){"use strict";q.exports=function(){return function(){}}},{}],289:[function(I,q,M){(function(P){"use strict";var m=I("babel-runtime/helpers/typeof"),S=R(m);function R(a){return a&&a.__esModule?a:{default:a}}var T=I("stream"),g=T.Stream,C=I("../lib/common/utils/isArray"),p=C.isArray;q.exports.string=function(r){return typeof r=="string"},q.exports.array=p,q.exports.buffer=P.isBuffer;function s(a){return a instanceof g}q.exports.writableStream=function(r){return s(r)&&typeof r._write=="function"&&(0,S.default)(r._writableState)==="object"}}).call(this,{isBuffer:I("../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(I,q,M){"use strict";M.encodeURIComponent=function(P){try{return encodeURIComponent(P)}catch(m){return P}},M.escape=I("escape-html"),M.timestamp=function(m){if(m){var S=m;return typeof S=="string"&&(S=Number(S)),String(m).length===10&&(S*=1e3),new Date(S)}return Math.round(Date.now()/1e3)}},{"escape-html":191}],291:[function(I,q,M){(function(P,m){"use strict";var S=I("babel-runtime/core-js/json/stringify"),R=C(S),T=I("babel-runtime/helpers/typeof"),g=C(T);function C(w){return w&&w.__esModule?w:{default:w}}var p=I("util"),s=I("url"),a=I("http"),r=I("https"),h=I("debug")("urllib"),d=I("humanize-ms"),f,E=0,y=Math.pow(2,31)-10,l=/^https?:\/\//i;function n(w,v){return w===void 0?v:w}function o(w,v){return function(i,k,D){if(i)return v(i);w({data:k,status:D.statusCode,headers:D.headers,res:D})}}M.TIMEOUTS=[d("300s"),d("300s")];var u=["json","text"];M.request=function(v,i,k){return arguments.length===2&&typeof i=="function"&&(k=i,i=null),typeof k=="function"?M.requestWithCallback(v,i,k):(f||(f=I("any-promise")),new f(function(D,c){M.requestWithCallback(v,i,o(D,c))}))},M.requestWithCallback=function(v,i,k){if(!v||typeof v!="string"&&(typeof v=="undefined"?"undefined":(0,g.default)(v))!=="object"){var D=p.format("expect request url to be a string or a http request options, but got %j",v);throw new Error(D)}arguments.length===2&&typeof i=="function"&&(k=i,i=null),i=i||{},E>=y&&(E=0);var c=++E;i.requestUrls=i.requestUrls||[];var b={requestId:c,url:v,args:i,ctx:i.ctx};i.emitter&&i.emitter.emit("request",b),i.timeout=i.timeout||M.TIMEOUTS,i.maxRedirects=i.maxRedirects||10,i.streaming=i.streaming||i.customResponse;var x=Date.now(),_;typeof v=="string"?(l.test(v)||(v="http://"+v),_=s.parse(v)):_=v;var j=(i.type||i.method||_.method||"GET").toUpperCase(),F=_.port||80,L=a,X=n(i.agent,M.agent),z=i.fixJSONCtlChars;_.protocol==="https:"&&(L=r,X=n(i.httpsAgent,M.httpsAgent),_.port||(F=443));var H={host:_.hostname||_.host||"localhost",path:_.path||"/",method:j,port:F,agent:X,headers:i.headers||{},lookup:i.lookup};Array.isArray(i.timeout)?H.requestTimeout=i.timeout[i.timeout.length-1]:typeof i.timeout!="undefined"&&(H.requestTimeout=i.timeout);for(var G=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],U=0;U<G.length;U++){var B=G[U];i.hasOwnProperty(B)&&(H[B]=i[B])}H.rejectUnauthorized===!1&&!H.hasOwnProperty("secureOptions")&&(H.secureOptions=I("constants").SSL_OP_NO_TLSv1_2);var W=i.auth||_.auth;W&&(H.auth=W);var te=i.content||i.data,de=j==="GET"||j==="HEAD"||i.dataAsQueryString;if(!i.content&&(te&&!(typeof te=="string"||m.isBuffer(te))))if(de)te=i.nestedQuerystring?qs.stringify(te):querystring.stringify(te);else{var fe=H.headers["Content-Type"]||H.headers["content-type"];fe||(i.contentType==="json"?fe="application/json":fe="application/x-www-form-urlencoded",H.headers["Content-Type"]=fe),parseContentType(fe).type==="application/json"?te=(0,R.default)(te):te=i.nestedQuerystring?qs.stringify(te):querystring.stringify(te)}de&&te&&(H.path+=(_.query?"&":"?")+te,te=null);var be=0;if(te){var Ce=te.length;m.isBuffer(te)||(Ce=m.byteLength(te)),be=H.headers["Content-Length"]=Ce}i.dataType==="json"&&(H.headers.Accept="application/json"),typeof i.beforeRequest=="function"&&i.beforeRequest(H);var ue=null,ge=null,pe=null,oe=!1,ae=!1,re=0,he=-1,Q=!1,ie="",we="",ne=null;i.timing&&(ne={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0});function J(){ue&&(clearTimeout(ue),ue=null)}function V(){ge&&(clearTimeout(ge),ge=null)}function Z(Re,tt,rt){if(V(),!k){console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),c,P.pid,H.method,v),Re&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
stack: %s`,Date(),c,P.pid,Re.name,Re.message,Re.stack);return}var He=k;k=null;var $e={};if(rt&&(he=rt.statusCode,$e=rt.headers),he===401&&$e["www-authenticate"]&&(!i.headers||!i.headers.Authorization)&&i.digestAuth){var Ie=$e["www-authenticate"];if(Ie.indexOf("Digest ")>=0)return h("Request#%d %s: got digest auth header WWW-Authenticate: %s",c,v,Ie),i.headers=i.headers||{},i.headers.Authorization=digestAuthHeader(H.method,H.path,Ie,i.digestAuth),h("Request#%d %s: auth with digest header: %s",c,v,i.headers.Authorization),rt.headers["set-cookie"]&&(i.headers.Cookie=rt.headers["set-cookie"].join(";")),M.requestWithCallback(v,i,He)}var Oe=Date.now()-x;ne&&(ne.contentDownload=Oe),h("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Oe,re,he,H.method,H.host,H.path,ae,ne);var Le={status:he,statusCode:he,headers:$e,size:re,aborted:Q,rt:Oe,keepAliveSocket:ae,data:tt,requestUrls:i.requestUrls,timing:ne,remoteAddress:ie,remotePort:we};if(Re){var Te="";X&&typeof X.getCurrentStatus=="function"&&(Te=", agent status: "+(0,R.default)(X.getCurrentStatus())),Re.message+=", "+H.method+" "+v+" "+he+" (connected: "+oe+", keepalive socket: "+ae+Te+`)
headers: `+(0,R.default)($e),Re.data=tt,Re.path=H.path,Re.status=he,Re.headers=$e,Re.res=Le}He(Re,tt,i.streaming?rt:Le),i.emitter&&(b.url=v,b.socket=Ke&&Ke.connection,b.options=H,b.size=be,i.emitter.emit("response",{requestId:c,error:Re,ctx:i.ctx,req:b,res:Le}))}function Ee(Re){var tt=null;if(i.followRedirect&&statuses.redirect[Re.statusCode]){i._followRedirectCount=(i._followRedirectCount||0)+1;var rt=Re.headers.location;if(!rt)tt=new Error("Got statusCode "+Re.statusCode+" but cannot resolve next location from headers"),tt.name="FollowRedirectError";else if(i._followRedirectCount>i.maxRedirects)tt=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+v),tt.name="MaxRedirectError";else{var He=i.formatRedirectUrl?i.formatRedirectUrl(v,rt):s.resolve(v,rt);h("Request#%d %s: `redirected` from %s to %s",c,H.path,v,He),V(),i.headers&&i.headers.Host&&l.test(rt)&&(i.headers.Host=null);var $e=k;return k=null,M.requestWithCallback(He,i,$e),{redirect:!0,error:null}}}return{redirect:!1,error:tt}}!H.headers["User-Agent"]&&!H.headers["user-agent"]&&(H.headers["User-Agent"]=navigator.userAgent),i.gzip&&(!H.headers["Accept-Encoding"]&&!H.headers["accept-encoding"]&&(H.headers["Accept-Encoding"]="gzip"));function xe(Re,tt,rt){var He=Re.headers["content-encoding"];return rt(null,tt,He)}var _e=i.writeStream;h("Request#%d %s %s with headers %j, options.path: %s",c,j,v,H.headers,H.path),i.requestUrls.push(v);function Ne(Re){if(ne&&(ne.waiting=Date.now()-x),h("Request#%d %s `req response` event emit: status %d, headers: %j",c,v,Re.statusCode,Re.headers),i.streaming){var tt=Ee(Re);if(tt.redirect){Re.resume();return}return tt.error?(Re.resume(),Z(tt.error,null,Re)):Z(null,null,Re)}if(Re.on("close",function(){h("Request#%d %s: `res close` event emit, total size %d",c,v,re)}),Re.on("error",function(){h("Request#%d %s: `res error` event emit, total size %d",c,v,re)}),Re.on("aborted",function(){Q=!0,h("Request#%d %s: `res aborted` event emit, total size %d",c,v,re)}),_e){var tt=Ee(Re);if(tt.redirect){Re.resume();return}return tt.error?(Re.resume(),_e.end(),Z(tt.error,null,Re)):(i.consumeWriteStream===!1?Re.on("end",Z.bind(null,null,null,Re)):isNode010||isNode012?first([[_e,"close"],[Re,"aborted"]],function($e,Ie,Oe){h("Request#%d %s: writeStream or res %s event emitted",c,v,Oe),Z(pe||null,null,Re)}):_e.on("close",function(){h("Request#%d %s: writeStream close event emitted",c,v),Z(pe||null,null,Re)}),Re.pipe(_e))}var rt=[];Re.on("data",function(He){h("Request#%d %s: `res data` event emit, size %d",c,v,He.length),re+=He.length,rt.push(He)}),Re.on("end",function(){var He=m.concat(rt,re);if(h("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",c,v,re,Re._dumped),pe)return Z(pe,He,Re);var $e=Ee(Re);if($e.error)return Z($e.error,He,Re);if($e.redirect)return;xe(Re,He,function(Ie,Oe,Le){if(Ie)return Z(Ie,He,Re);if(!Le&&u.indexOf(i.dataType)>=0){try{Oe=decodeBodyByCharset(Oe,Re)}catch(Ae){return h("decodeBodyByCharset error: %s",Ae),Z(null,Oe,Re)}if(i.dataType==="json")if(re===0)Oe=null;else{var Te=parseJSON(Oe,z);Te.error?Ie=Te.error:Oe=Te.data}}Q&&h("Request#%d %s: Remote socket was terminated before `response.end()` was called",c,v),Z(Ie,Oe,Re)})})}var Be,We;Array.isArray(i.timeout)?(Be=d(i.timeout[0]),We=d(i.timeout[1])):Be=We=d(i.timeout),h("ConnectTimeout: %d, ResponseTimeout: %d",Be,We);function Ue(){h("Connect timer ticking, timeout: %d",Be),ue=setTimeout(function(){ue=null,he===-1&&(he=-2);var Re="Connect timeout for "+Be+"ms",tt="ConnectionTimeoutError";Ke.socket||(tt="SocketAssignTimeoutError",Re+=", working sockets is full"),pe=new Error(Re),pe.name=tt,pe.requestId=c,h("ConnectTimeout: Request#%d %s %s: %s, connected: %s",c,v,pe.name,Re,oe),Ye()},Be)}function ze(){h("Response timer ticking, timeout: %d",We),ge=setTimeout(function(){ge=null;var Re="Response timeout for "+We+"ms",tt="ResponseTimeoutError";pe=new Error(Re),pe.name=tt,pe.requestId=c,h("ResponseTimeout: Request#%d %s %s: %s, connected: %s",c,v,pe.name,Re,oe),Ye()},We)}var Ke;H.mode=i.mode?i.mode:"";try{Ke=L.request(H,Ne)}catch(Re){return Z(Re)}typeof window=="undefined"?Ue():Ke.on("requestTimeout",function(){he===-1&&(he=-2);var Re="Connect timeout for "+Be+"ms",tt="ConnectionTimeoutError";pe=new Error(Re),pe.name=tt,pe.requestId=c,Ye()});function Ye(){h("Request#%d %s abort, connected: %s",c,v,oe),Ke.socket||(pe.noSocket=!0,Z(pe)),Ke.abort()}return ne&&Ke.on("finish",function(){ne.requestSent=Date.now()-x}),Ke.once("socket",function(Re){ne&&(ne.queuing=Date.now()-x),isNode010&&Re.socket&&(Re=Re.socket);var tt=Re.readyState;if(tt==="opening"){Re.once("lookup",function(rt,He,$e){h("Request#%d %s lookup: %s, %s, %s",c,v,rt,He,$e),ne&&(ne.dnslookup=Date.now()-x),He&&(ie=He)}),Re.once("connect",function(){ne&&(ne.connected=Date.now()-x),J(),ze(),h("Request#%d %s new socket connected",c,v),oe=!0,ie||(ie=Re.remoteAddress),we=Re.remotePort});return}h("Request#%d %s reuse socket connected, readyState: %s",c,v,tt),oe=!0,ae=!0,ie||(ie=Re.remoteAddress),we=Re.remotePort,J(),ze()}),Ke.on("error",function(Re){(Re.name==="Error"||Re.name==="TypeError")&&(Re.name=oe?"ResponseError":"RequestError"),Re.message+=' (req "error")',h("Request#%d %s `req error` event emit, %s: %s",c,v,Re.name,Re.message),Z(pe||Re)}),_e&&_e.once("error",function(Re){Re.message+=' (writeStream "error")',pe=Re,h("Request#%d %s `writeStream error` event emit, %s: %s",c,v,Re.name,Re.message),Ye()}),i.stream?(i.stream.pipe(Ke),i.stream.once("error",function(Re){Re.message+=' (stream "error")',pe=Re,h("Request#%d %s `readStream error` event emit, %s: %s",c,v,Re.name,Re.message),Ye()})):Ke.end(te),Ke.requestId=c,Ke}}).call(this,I("_process"),I("buffer").Buffer)},{_process:208,"any-promise":49,"babel-runtime/core-js/json/stringify":53,"babel-runtime/helpers/typeof":67,buffer:73,constants:75,debug:288,http:231,https:193,"humanize-ms":194,url:238,util:243}]},{},[1])(1)})}).call(this,__webpack_require__("IyRk"))},nj2k:function(I,q,M){I.exports=M.p+"static/nodata.8f2d5135.svg"},oRuE:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return P.pad.Iso10126={pad:function(m,S){var R=S*4,T=R-m.sigBytes%R;m.concat(P.lib.WordArray.random(T-1)).concat(P.lib.WordArray.create([T<<24],1))},unpad:function(m){var S=m.words[m.sigBytes-1>>>2]&255;m.sigBytes-=S}},P.pad.Iso10126})},osHv:function(I,q,M){(function(P){P(M("VrN/"))})(function(P){"use strict";var m=P.Pos;function S(l,n){return l.line-n.line||l.ch-n.ch}var R="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",T=R+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+R+"]["+T+"]*)","g");function C(l,n,o,u){this.line=n,this.ch=o,this.cm=l,this.text=l.getLine(n),this.min=u?Math.max(u.from,l.firstLine()):l.firstLine(),this.max=u?Math.min(u.to-1,l.lastLine()):l.lastLine()}function p(l,n){var o=l.cm.getTokenTypeAt(m(l.line,n));return o&&/\btag\b/.test(o)}function s(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function a(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function r(l){for(;;){var n=l.text.indexOf(">",l.ch);if(n==-1){if(s(l))continue;return}if(!p(l,n+1)){l.ch=n+1;continue}var o=l.text.lastIndexOf("/",n),u=o>-1&&!/\S/.test(l.text.slice(o+1,n));return l.ch=n+1,u?"selfClose":"regular"}}function h(l){for(;;){var n=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(n==-1){if(a(l))continue;return}if(!p(l,n+1)){l.ch=n;continue}g.lastIndex=n,l.ch=n;var o=g.exec(l.text);if(o&&o.index==n)return o}}function d(l){for(;;){g.lastIndex=l.ch;var n=g.exec(l.text);if(!n){if(s(l))continue;return}if(!p(l,n.index+1)){l.ch=n.index+1;continue}return l.ch=n.index+n[0].length,n}}function f(l){for(;;){var n=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(n==-1){if(a(l))continue;return}if(!p(l,n+1)){l.ch=n;continue}var o=l.text.lastIndexOf("/",n),u=o>-1&&!/\S/.test(l.text.slice(o+1,n));return l.ch=n+1,u?"selfClose":"regular"}}function E(l,n){for(var o=[];;){var u=d(l),w,v=l.line,i=l.ch-(u?u[0].length:0);if(!u||!(w=r(l)))return;if(w=="selfClose")continue;if(u[1]){for(var k=o.length-1;k>=0;--k)if(o[k]==u[2]){o.length=k;break}if(k<0&&(!n||n==u[2]))return{tag:u[2],from:m(v,i),to:m(l.line,l.ch)}}else o.push(u[2])}}function y(l,n){for(var o=[];;){var u=f(l);if(!u)return;if(u=="selfClose"){h(l);continue}var w=l.line,v=l.ch,i=h(l);if(!i)return;if(i[1])o.push(i[2]);else{for(var k=o.length-1;k>=0;--k)if(o[k]==i[2]){o.length=k;break}if(k<0&&(!n||n==i[2]))return{tag:i[2],from:m(l.line,l.ch),to:m(w,v)}}}}P.registerHelper("fold","xml",function(l,n){for(var o=new C(l,n.line,0);;){var u=d(o);if(!u||o.line!=n.line)return;var w=r(o);if(!w)return;if(!u[1]&&w!="selfClose"){var v=m(o.line,o.ch),i=E(o,u[2]);return i&&S(i.from,v)>0?{from:v,to:i.from}:null}}}),P.findMatchingTag=function(l,n,o){var u=new C(l,n.line,n.ch,o);if(u.text.indexOf(">")==-1&&u.text.indexOf("<")==-1)return;var w=r(u),v=w&&m(u.line,u.ch),i=w&&h(u);if(!w||!i||S(u,n)>0)return;var k={from:m(u.line,u.ch),to:v,tag:i[2]};return w=="selfClose"?{open:k,close:null,at:"open"}:i[1]?{open:y(u,i[2]),close:k,at:"close"}:(u=new C(l,v.line,v.ch,o),{open:k,close:E(u,i[2]),at:"open"})},P.findEnclosingTag=function(l,n,o,u){for(var w=new C(l,n.line,n.ch,o);;){var v=y(w,u);if(!v)break;var i=new C(l,n.line,n.ch,o),k=E(i,v.tag);if(k)return{open:v,close:k}}},P.scanForClosingTag=function(l,n,o,u){var w=new C(l,n.line,n.ch,u?{from:0,to:u}:null);return E(w,o)}})},p5ED:function(I,q,M){"use strict";var P=M("+L6B"),m=M("2/Rp"),S=M("5Dmo"),R=M("3S7+"),T=M("k1fw"),g=M("9og8"),C=M("tJVT"),p=M("WmNS"),s=M.n(p),a=M("q1tI"),r=M.n(a),h=M("vHTk"),d=M.n(h),f=M("yEEn"),E=M("ZW9T"),y=M("1vsH"),l=M("V0Rq"),n=M("m3rI");q.a=function(o){var u,w,v,i,k,D,c,b=o.editOffice,x=b===void 0?"view":b,_=o.data,j=o.theme,F=o.type,L=o.filename,X=o.monacoEditor,z=o.className,H=o.style,G=o.close,U=o.onClose,B=o.hasMask,W=o.disabledDownload,te=Object(a.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),de=Object(C.a)(te,2),fe=de[0],be=de[1],Ce=Object(a.useState)(""),ue=Object(C.a)(Ce,2),ge=ue[0],pe=ue[1],oe=Object(a.useState)(),ae=Object(C.a)(oe,2),re=ae[0],he=ae[1],Q=window.ENV==="build"?"/react/build":"",ie=n.a.PROXY_SERVER||location.origin,we,ne=1024*1024,J=10*ne,V=Object(a.useRef)();(u=_)!==null&&u!==void 0&&u.startsWith("/api")&&F!=="txt"&&(_=n.a.API_SERVER+_),F==="office"&&(we=Object(y.T)(_).filesize,we>J&&(F="other")),L&&X&&(X.filename=L),Object(a.useEffect)(function(){var _e,Ne,Be=(_e=document.cookie)===null||_e===void 0||((Ne=_e.replace(/\s/g,""))===null||Ne===void 0)?void 0:Ne.split(";");Be==null||Be.map(function(We){var Ue=We.split("=");Ue[0]==="_educoder_session"&&pe(Ue[1])})},[]),Object(a.useEffect)(function(){F==="office"&&Z()},[F,_]);var Z=function(){var _e=Object(g.a)(s.a.mark(function Ne(){var Be,We,Ue;return s.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return console.log("data:",_),Be=_,_.startsWith("http")||(Be=location.origin+Be),We=new URL(Be).pathname.split("/").pop(),Ke.next=6,Object(l.V)({attachment_id:We});case 6:Ue=Ke.sent,he(Ue);case 8:case"end":return Ke.stop()}},Ne)}));return function(){return _e.apply(this,arguments)}}(),Ee=function(){if(_.startsWith("http")||_.startsWith("blob:")){xe();return}Object(y.z)(L||"educoder",_,L)},xe=function(){Object(y.x)(L||"educoder",decodeURIComponent(_))};return r.a.createElement("div",{style:Object(T.a)({},H||{}),className:"".concat(B&&d.a.bgBlack," ").concat(F?d.a.wrp:"hide")},G&&r.a.createElement("div",{className:d.a.close,ref:V},!W&&r.a.createElement(R.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return V.current}},r.a.createElement("span",{onClick:xe},r.a.createElement("i",{className:"icon-quxiaozhiding"}))),r.a.createElement(R.a,{title:"\u5173\u95ED",getPopupContainer:function(){return V.current}},r.a.createElement("span",{className:"",onClick:U},r.a.createElement("i",{className:"icon-guanbi1"})))),r.a.createElement("div",{className:"".concat(d.a[z]," ").concat(z," ").concat(d.a.monaco," ").concat(F==="txt"?"show":"hide")},F==="txt"&&r.a.createElement(E.b,X)),F==="audio"&&r.a.createElement("audio",{src:"".concat(((w=_)===null||w===void 0?void 0:w.indexOf("http://"))>-1||((v=_)===null||v===void 0?void 0:v.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(_),autoPlay:!0}),F==="video"&&r.a.createElement(r.a.Fragment,null,((i=_)===null||i===void 0?void 0:i.indexOf("http"))>-1?r.a.createElement("video",{controls:!0,src:"".concat(_),autoPlay:!0}):r.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(_),autoPlay:!0})),F==="office"&&re&&r.a.createElement("iframe",{src:"".concat(Q,"/office.html?key=").concat(re.key,"&url=").concat(ie+re.url,"&callbackUrl=").concat(ie+re.callbackUrl,"&fileType=").concat(re.fileType,"&title=").concat(re.title,"&model=").concat(x,"&officeServer=").concat(n.a.OFFICE_SERVER,"&disabledDownload=").concat(!!W)}),F==="html"&&r.a.createElement("iframe",{src:_+"&disposition=inline"}),F==="pdf"&&r.a.createElement("iframe",{src:"".concat(Q,"/js/pdfview/index.html?url=").concat(_,"&disabledDownload=").concat(!!W)}),F==="image"&&r.a.createElement("img",{src:"".concat(((k=_)===null||k===void 0?void 0:k.indexOf("http://"))>-1||((D=_)===null||D===void 0?void 0:D.indexOf("https://"))>-1||(c=_)!==null&&c!==void 0&&c.startsWith("/api")?"":"data:image/png;base64,").concat(_)}),F==="other"&&r.a.createElement("div",null,r.a.createElement(m.a,{type:"primary",size:"large",onClick:Ee},r.a.createElement(f.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),F==="download"&&r.a.createElement(m.a,{type:"primary",size:"large",onClick:Ee},r.a.createElement(f.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(I,q,M){},pA7S:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("ETIr"),M("cv67"),M("K3mO"),M("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=S.BlockCipher,g=m.algo,C=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],p=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],s=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],a=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],r=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=g.DES=T.extend({_doReset:function(){for(var y=this._key,l=y.words,n=[],o=0;o<56;o++){var u=C[o]-1;n[o]=l[u>>>5]>>>31-u%32&1}for(var w=this._subKeys=[],v=0;v<16;v++){for(var i=w[v]=[],k=s[v],o=0;o<24;o++)i[o/6|0]|=n[(p[o]-1+k)%28]<<31-o%6,i[4+(o/6|0)]|=n[28+(p[o+24]-1+k)%28]<<31-o%6;i[0]=i[0]<<1|i[0]>>>31;for(var o=1;o<7;o++)i[o]=i[o]>>>(o-1)*4+3;i[7]=i[7]<<5|i[7]>>>27}for(var D=this._invSubKeys=[],o=0;o<16;o++)D[o]=w[15-o]},encryptBlock:function(y,l){this._doCryptBlock(y,l,this._subKeys)},decryptBlock:function(y,l){this._doCryptBlock(y,l,this._invSubKeys)},_doCryptBlock:function(y,l,n){this._lBlock=y[l],this._rBlock=y[l+1],d.call(this,4,252645135),d.call(this,16,65535),f.call(this,2,858993459),f.call(this,8,16711935),d.call(this,1,1431655765);for(var o=0;o<16;o++){for(var u=n[o],w=this._lBlock,v=this._rBlock,i=0,k=0;k<8;k++)i|=a[k][((v^u[k])&r[k])>>>0];this._lBlock=v,this._rBlock=w^i}var D=this._lBlock;this._lBlock=this._rBlock,this._rBlock=D,d.call(this,1,1431655765),f.call(this,8,16711935),f.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),y[l]=this._lBlock,y[l+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function d(y,l){var n=(this._lBlock>>>y^this._rBlock)&l;this._rBlock^=n,this._lBlock^=n<<y}function f(y,l){var n=(this._rBlock>>>y^this._lBlock)&l;this._lBlock^=n,this._rBlock^=n<<y}m.DES=T._createHelper(h);var E=g.TripleDES=T.extend({_doReset:function(){var y=this._key,l=y.words;if(l.length!==2&&l.length!==4&&l.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var n=l.slice(0,2),o=l.length<4?l.slice(0,2):l.slice(2,4),u=l.length<6?l.slice(0,2):l.slice(4,6);this._des1=h.createEncryptor(R.create(n)),this._des2=h.createEncryptor(R.create(o)),this._des3=h.createEncryptor(R.create(u))},encryptBlock:function(y,l){this._des1.encryptBlock(y,l),this._des2.decryptBlock(y,l),this._des3.encryptBlock(y,l)},decryptBlock:function(y,l){this._des3.decryptBlock(y,l),this._des2.encryptBlock(y,l),this._des1.decryptBlock(y,l)},keySize:192/32,ivSize:64/32,blockSize:64/32});m.TripleDES=T._createHelper(E)}(),P.TripleDES})},qBft:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return P.pad.AnsiX923={pad:function(m,S){var R=m.sigBytes,T=S*4,g=T-R%T,C=R+g-1;m.clamp(),m.words[C>>>2]|=g<<24-C%4*8,m.sigBytes+=g},unpad:function(m){var S=m.words[m.sigBytes-1>>>2]&255;m.sigBytes-=S}},P.pad.Ansix923})},qM6L:function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=m.enc,g=T.Utf16=T.Utf16BE={stringify:function(p){for(var s=p.words,a=p.sigBytes,r=[],h=0;h<a;h+=2){var d=s[h>>>2]>>>16-h%4*8&65535;r.push(String.fromCharCode(d))}return r.join("")},parse:function(p){for(var s=p.length,a=[],r=0;r<s;r++)a[r>>>1]|=p.charCodeAt(r)<<16-r%2*16;return R.create(a,s*2)}};T.Utf16LE={stringify:function(p){for(var s=p.words,a=p.sigBytes,r=[],h=0;h<a;h+=2){var d=C(s[h>>>2]>>>16-h%4*8&65535);r.push(String.fromCharCode(d))}return r.join("")},parse:function(p){for(var s=p.length,a=[],r=0;r<s;r++)a[r>>>1]|=C(p.charCodeAt(r)<<16-r%2*16);return R.create(a,s*2)}};function C(p){return p<<8&4278255360|p>>>8&16711935}}(),P.enc.Utf16})},qu8F:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){/** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/return P.mode.CTRGladman=function(){var m=P.lib.BlockCipherMode.extend();function S(g){if((g>>24&255)===255){var C=g>>16&255,p=g>>8&255,s=g&255;C===255?(C=0,p===255?(p=0,s===255?s=0:++s):++p):++C,g=0,g+=C<<16,g+=p<<8,g+=s}else g+=1<<24;return g}function R(g){return(g[0]=S(g[0]))===0&&(g[1]=S(g[1])),g}var T=m.Encryptor=m.extend({processBlock:function(g,C){var p=this._cipher,s=p.blockSize,a=this._iv,r=this._counter;a&&(r=this._counter=a.slice(0),this._iv=void 0),R(r);var h=r.slice(0);p.encryptBlock(h,0);for(var d=0;d<s;d++)g[C+d]^=h[d]}});return m.Decryptor=T,m}(),P.mode.CTRGladman})},rUJ1:function(I,q){const M=/[&<>"']/,P=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,R={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},T=D=>R[D];function g(D,c){if(c){if(M.test(D))return D.replace(P,T)}else if(m.test(D))return D.replace(S,T);return D}const C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function p(D){return D.replace(C,(c,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const s=/(^|[^\[])\^/g;function a(D,c){D=D.source||D,c=c||"";const b={replace:(x,_)=>(_=_.source||_,_=_.replace(s,"$1"),D=D.replace(x,_),b),getRegex:()=>new RegExp(D,c)};return b}const r=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(D,c,b){if(D){let x;try{x=decodeURIComponent(p(b)).replace(r,"").toLowerCase()}catch(_){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}c&&!h.test(b)&&(b=n(c,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(x){return null}return b}const f={},E=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(D,c){f[" "+D]||(E.test(D)?f[" "+D]=D+"/":f[" "+D]=v(D,"/",!0)),D=f[" "+D];const b=D.indexOf(":")===-1;return c.substring(0,2)==="//"?b?c:D.replace(y,"$1")+c:c.charAt(0)==="/"?b?c:D.replace(l,"$1")+c:D+c}const o={exec:function(){}};function u(D){let c=1,b,x;for(;c<arguments.length;c++){b=arguments[c];for(x in b)Object.prototype.hasOwnProperty.call(b,x)&&(D[x]=b[x])}return D}function w(D,c){const b=D.replace(/\|/g,(j,F,L)=>{let X=!1,z=F;for(;--z>=0&&L[z]==="\\";)X=!X;return X?"|":" |"}),x=b.split(/ \|/);let _=0;if(x.length>c)x.splice(c);else for(;x.length<c;)x.push("");for(;_<x.length;_++)x[_]=x[_].trim().replace(/\\\|/g,"|");return x}function v(D,c,b){const x=D.length;if(x===0)return"";let _=0;for(;_<x;){const j=D.charAt(x-_-1);if(j===c&&!b)_++;else if(j!==c&&b)_++;else break}return D.substr(0,x-_)}function i(D,c){if(D.indexOf(c[1])===-1)return-1;const b=D.length;let x=0,_=0;for(;_<b;_++)if(D[_]==="\\")_++;else if(D[_]===c[0])x++;else if(D[_]===c[1]&&(x--,x<0))return _;return-1}function k(D){D&&D.sanitize&&!D.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")}I.exports={escape:g,unescape:p,edit:a,cleanUrl:d,resolveUrl:n,noopTest:o,merge:u,splitCells:w,rtrim:v,findClosingBracket:i,checkSanitizeDeprecation:k}},rdUC:function(I,q,M){var P=M("MFOe"),m=P.Global;I.exports={name:"localStorage",read:R,write:T,each:g,remove:C,clearAll:p};function S(){return m.localStorage}function R(s){return S().getItem(s)}function T(s,a){return S().setItem(s,a)}function g(s){for(var a=S().length-1;a>=0;a--){var r=S().key(a);s(R(r),r)}}function C(s){return S().removeItem(s)}function p(){return S().clear()}},sboe:function(I,q,M){"use strict";M.d(q,"a",function(){return S});var P=M("q1tI"),m=M.n(P),S=P.createContext(null)},spXi:function(I,q,M){I.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},u2Z1:function(I,q,M){"use strict";M.d(q,"a",function(){return v});var P=M("miYZ"),m=M("tsqr"),S=M("9og8"),R=M("5NDa"),T=M("5rEg"),g=M("2qtc"),C=M("kLXV"),p=M("oBTY"),s=M("tJVT"),a=M("OaEy"),r=M("2fM7"),h=M("WmNS"),d=M.n(h),f=M("q1tI"),E=M.n(f),y=M("ErOA"),l=M("i58Z"),n=M.n(l),o=M("T1X5"),u=M.n(o),w=r.a.Option,v=function(k){var D=k.subId,c=k.value,b=k.selectvalues,x=k.disabled,_=k.knowledgeOptions,j=_===void 0?[]:_,F=k.onChange,L=F===void 0?function(){}:F,X=k.onAddKnowledgeFinish,z=X===void 0?function(){}:X,H=Object(f.useRef)(),G=Object(f.useState)([]),U=Object(s.a)(G,2),B=U[0],W=U[1];c=c||[];var te=function(be,Ce){be?(W([Ce.key]),L([Ce.key])):(W([]),L([]))};Object(f.useEffect)(function(){(b==null?void 0:b.length)>0&&(W(Object(p.a)(b)),L(Object(p.a)(b)))},[j]),Object(f.useEffect)(function(){var fe;((fe=c)===null||fe===void 0?void 0:fe.length)>0&&L(Object(p.a)(c))},[j]);var de=function(be){be.preventDefault(),H.current="",C.a.confirm({centered:!0,width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",icon:null,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",className:"custom-modal-divider",content:E.a.createElement("div",{className:"font14"},E.a.createElement("div",{style:{display:"flex",marginTop:"48px",marginBottom:"36px"}},E.a.createElement("img",{src:u.a,style:{width:"108px",height:"108px",marginRight:"29px"}}),"\u60A8\u586B\u5199\u7684\u77E5\u8BC6\u70B9\u6682\u65F6\u4EC5\u5BF9\u672C\u4EBA\u53EF\u89C1\uFF0C\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u540E\u5C06\u5217\u5165\u516C\u5F00\u77E5\u8BC6\u70B9\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF1B",E.a.createElement("br",null),"\u5E73\u53F0\u5BA1\u6838\u8FC7\u7A0B\u4E2D\u6709\u6743\u5220\u9664\u4E0D\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF08\u5305\u62EC\u4F46\u4E0D\u9650\u4E8E\u9519\u8BEF\u3001\u975E\u6CD5\u3001\u4E0D\u96C5\u3001\u4E0D\u5339\u914D\u5F53\u524D\u8BFE\u7A0B\u7B49\u60C5\u5F62\uFF09\uFF0C\u5220\u9664\u540E\u53EF\u80FD\u5F71\u54CD\u60A8\u7684\u8BD5\u9898\u7684\u6B63\u5E38\u4F7F\u7528\u3002",E.a.createElement("br",null),"\u8BF7\u8BA4\u771F\u586B\u5199\u4E0E\u6559\u5B66\u5185\u5BB9\u76F8\u5173\u7684\u771F\u5B9E\u77E5\u8BC6\u70B9 ",E.a.createElement("br",null)),E.a.createElement(T.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:H.current,onChange:function(ue){H.current=ue.target.value}})),onOk:function(){return new Promise(function(){var ue=Object(S.a)(d.a.mark(function ge(pe,oe){var ae,re;return d.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(H.current){Q.next=3;break}return m.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),Q.abrupt("return",oe());case 3:if(!(H.current.length>20)){Q.next=6;break}return m.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),Q.abrupt("return",oe());case 6:return Q.next=8,Object(y.a)("/api/tag_disciplines.json",{method:"post",body:{name:H.current,sub_discipline_id:D}});case 8:return ae=Q.sent,(ae==null?void 0:ae.status)===0&&(z({id:ae.tag_discipline_id,name:H.current,type:"personal"}),re=[],re.push(ae.tag_discipline_id),L([].concat(re)),W([ae.tag_discipline_id]),L([].concat(re))),Q.abrupt("return",pe());case 11:case"end":return Q.stop()}},ge)}));return function(ge,pe){return ue.apply(this,arguments)}}())}})};return E.a.createElement("div",{className:n.a.wrap},E.a.createElement(r.a,{disabled:!D||x,className:"mr5",style:{width:"242px"},onChange:te,showSearch:!0,allowClear:!0,value:j==null?void 0:j.filter(function(fe){return(B==null?void 0:B.includes(fe==null?void 0:fe.id))||(B==null?void 0:B.includes((fe==null?void 0:fe.id)+""))}).map(function(fe){return fe.name})},j==null?void 0:j.map(function(fe){return E.a.createElement(w,{key:fe.id,value:fe.name},E.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},E.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},fe.name),E.a.createElement("span",null,fe.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),E.a.createElement("button",{disabled:!D,className:"".concat(n.a.addKnowledge," ").concat(D?"":n.a.disabled),onClick:de},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uGsb:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("MlIO"),M("1uat"))})(this,function(P){return function(){var m=P,S=m.x64,R=S.Word,T=S.WordArray,g=m.algo,C=g.SHA512,p=g.SHA384=C.extend({_doReset:function(){this._hash=new T.init([new R.init(3418070365,3238371032),new R.init(1654270250,914150663),new R.init(2438529370,812702999),new R.init(355462360,4144912697),new R.init(1731405415,4290775857),new R.init(2394180231,1750603025),new R.init(3675008525,1694076839),new R.init(1203062813,3204075428)])},_doFinalize:function(){var s=C._doFinalize.call(this);return s.sigBytes-=16,s}});m.SHA384=C._createHelper(p),m.HmacSHA384=C._createHmacHelper(p)}(),P.SHA384})},uGxW:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("OLod"))})(this,function(P){return P.pad.NoPadding={pad:function(){},unpad:function(){}},P.pad.NoPadding})},uK0f:function(I,q,M){(function(P,m){I.exports=m()})(this,function(){"use strict";function P(m,S,R){R=R||{},R.childrenKeyName=R.childrenKeyName||"children";var T=m||[],g=[],C=0;do{var p=T.filter(function(s){return S(s,C)})[0];if(!p)break;g.push(p),T=p[R.childrenKeyName]||[],C+=1}while(T.length>0);return g}return P})},uMZB:function(I,q,M){I.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(I,q,M){I.exports=P;function P(){return M("gaXo"),{}}},ulZh:function(I,q,M){typeof window!="undefined"&&function(m,S){I.exports=S()}(this,function(){return function(P){var m={};function S(R){if(m[R])return m[R].exports;var T=m[R]={i:R,l:!1,exports:{}};return P[R].call(T.exports,T,T.exports,S),T.l=!0,T.exports}return S.m=P,S.c=m,S.d=function(R,T,g){S.o(R,T)||Object.defineProperty(R,T,{enumerable:!0,get:g})},S.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})},S.t=function(R,T){if(T&1&&(R=S(R)),T&8)return R;if(T&4&&typeof R=="object"&&R&&R.__esModule)return R;var g=Object.create(null);if(S.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:R}),T&2&&typeof R!="string")for(var C in R)S.d(g,C,function(p){return R[p]}.bind(null,C));return g},S.n=function(R){var T=R&&R.__esModule?function(){return R.default}:function(){return R};return S.d(T,"a",T),T},S.o=function(R,T){return Object.prototype.hasOwnProperty.call(R,T)},S.p="/dist/",S(S.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(P,m,S){"use strict";var R=Object.prototype.hasOwnProperty,T="~";function g(){}Object.create&&(g.prototype=Object.create(null),new g().__proto__||(T=!1));function C(r,h,d){this.fn=r,this.context=h,this.once=d||!1}function p(r,h,d,f,E){if(typeof d!="function")throw new TypeError("The listener must be a function");var y=new C(d,f||r,E),l=T?T+h:h;return r._events[l]?r._events[l].fn?r._events[l]=[r._events[l],y]:r._events[l].push(y):(r._events[l]=y,r._eventsCount++),r}function s(r,h){--r._eventsCount===0?r._events=new g:delete r._events[h]}function a(){this._events=new g,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],d,f;if(this._eventsCount===0)return h;for(f in d=this._events)R.call(d,f)&&h.push(T?f.slice(1):f);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},a.prototype.listeners=function(h){var d=T?T+h:h,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var E=0,y=f.length,l=new Array(y);E<y;E++)l[E]=f[E].fn;return l},a.prototype.listenerCount=function(h){var d=T?T+h:h,f=this._events[d];return f?f.fn?1:f.length:0},a.prototype.emit=function(h,d,f,E,y,l){var n=T?T+h:h;if(!this._events[n])return!1;var o=this._events[n],u=arguments.length,w,v;if(o.fn){o.once&&this.removeListener(h,o.fn,void 0,!0);switch(u){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,d),!0;case 3:return o.fn.call(o.context,d,f),!0;case 4:return o.fn.call(o.context,d,f,E),!0;case 5:return o.fn.call(o.context,d,f,E,y),!0;case 6:return o.fn.call(o.context,d,f,E,y,l),!0}for(v=1,w=new Array(u-1);v<u;v++)w[v-1]=arguments[v];o.fn.apply(o.context,w)}else{var i=o.length,k;for(v=0;v<i;v++){o[v].once&&this.removeListener(h,o[v].fn,void 0,!0);switch(u){case 1:o[v].fn.call(o[v].context);break;case 2:o[v].fn.call(o[v].context,d);break;case 3:o[v].fn.call(o[v].context,d,f);break;case 4:o[v].fn.call(o[v].context,d,f,E);break;default:if(!w)for(k=1,w=new Array(u-1);k<u;k++)w[k-1]=arguments[k];o[v].fn.apply(o[v].context,w)}}}return!0},a.prototype.on=function(h,d,f){return p(this,h,d,f,!1)},a.prototype.once=function(h,d,f){return p(this,h,d,f,!0)},a.prototype.removeListener=function(h,d,f,E){var y=T?T+h:h;if(!this._events[y])return this;if(!d)return s(this,y),this;var l=this._events[y];if(l.fn)l.fn===d&&(!E||l.once)&&(!f||l.context===f)&&s(this,y);else{for(var n=0,o=[],u=l.length;n<u;n++)(l[n].fn!==d||E&&!l[n].once||f&&l[n].context!==f)&&o.push(l[n]);o.length?this._events[y]=o.length===1?o[0]:o:s(this,y)}return this},a.prototype.removeAllListeners=function(h){var d;return h?(d=T?T+h:h,this._events[d]&&s(this,d)):(this._events=new g,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=T,a.EventEmitter=a,P.exports=a},"./node_modules/url-toolkit/src/url-toolkit.js":function(P,m,S){(function(R){var T=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,g=/^([^\/?#]*)([^]*)$/,C=/(?:\/|^)\.(?=\/)/g,p=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(a,r,h){if(h=h||{},a=a.trim(),r=r.trim(),!r){if(!h.alwaysNormalize)return a;var d=s.parseURL(a);if(!d)throw new Error("Error trying to parse base URL.");return d.path=s.normalizePath(d.path),s.buildURLFromParts(d)}var f=s.parseURL(r);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return h.alwaysNormalize?(f.path=s.normalizePath(f.path),s.buildURLFromParts(f)):r;var E=s.parseURL(a);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&E.path[0]!=="/"){var y=g.exec(E.path);E.netLoc=y[1],E.path=y[2]}E.netLoc&&!E.path&&(E.path="/");var l={scheme:E.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(l.netLoc=E.netLoc,f.path[0]!=="/"))if(!f.path)l.path=E.path,f.params||(l.params=E.params,f.query||(l.query=E.query));else{var n=E.path,o=n.substring(0,n.lastIndexOf("/")+1)+f.path;l.path=s.normalizePath(o)}return l.path===null&&(l.path=h.alwaysNormalize?s.normalizePath(f.path):f.path),s.buildURLFromParts(l)},parseURL:function(a){var r=T.exec(a);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(a){for(a=a.split("").reverse().join("").replace(C,"");a.length!==(a=a.replace(p,"")).length;);return a.split("").reverse().join("")},buildURLFromParts:function(a){return a.scheme+a.netLoc+a.path+a.params+a.query+a.fragment}};P.exports=s})(this)},"./node_modules/webworkify-webpack/index.js":function(P,m,S){function R(h){var d={};function f(y){if(d[y])return d[y].exports;var l=d[y]={i:y,l:!1,exports:{}};return h[y].call(l.exports,l,l.exports,f),l.l=!0,l.exports}f.m=h,f.c=d,f.i=function(y){return y},f.d=function(y,l,n){f.o(y,l)||Object.defineProperty(y,l,{configurable:!1,enumerable:!0,get:n})},f.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},f.n=function(y){var l=y&&y.__esModule?function(){return y.default}:function(){return y};return f.d(l,"a",l),l},f.o=function(y,l){return Object.prototype.hasOwnProperty.call(y,l)},f.p="/",f.oe=function(y){throw console.error(y),y};var E=f(f.s=ENTRY_MODULE);return E.default||E}var T="[\\.|\\-|\\+|\\w|/|@]+",g="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+T+").*?\\)";function C(h){return(h+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function p(h){return!isNaN(1*h)}function s(h,d,f){var E={};E[f]=[];var y=d.toString(),l=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return E;for(var n=l[1],o=new RegExp("(\\\\n|\\W)"+C(n)+g,"g"),u;u=o.exec(y);){if(u[3]==="dll-reference")continue;E[f].push(u[3])}for(o=new RegExp("\\("+C(n)+'\\("(dll-reference\\s('+T+'))"\\)\\)'+g,"g");u=o.exec(y);)h[u[2]]||(E[f].push(u[1]),h[u[2]]=S(u[1]).m),E[u[2]]=E[u[2]]||[],E[u[2]].push(u[4]);for(var w=Object.keys(E),v=0;v<w.length;v++)for(var i=0;i<E[w[v]].length;i++)p(E[w[v]][i])&&(E[w[v]][i]=1*E[w[v]][i]);return E}function a(h){var d=Object.keys(h);return d.reduce(function(f,E){return f||h[E].length>0},!1)}function r(h,d){for(var f={main:[d]},E={main:[]},y={main:{}};a(f);)for(var l=Object.keys(f),n=0;n<l.length;n++){var o=l[n],u=f[o],w=u.pop();if(y[o]=y[o]||{},y[o][w]||!h[o][w])continue;y[o][w]=!0,E[o]=E[o]||[],E[o].push(w);for(var v=s(h,h[o][w],o),i=Object.keys(v),k=0;k<i.length;k++)f[i[k]]=f[i[k]]||[],f[i[k]]=f[i[k]].concat(v[i[k]])}return E}P.exports=function(h,d){d=d||{};var f={main:S.m},E=d.all?{main:Object.keys(f.main)}:r(f,h),y="";Object.keys(E).filter(function(w){return w!=="main"}).forEach(function(w){for(var v=0;E[w][v];)v++;E[w].push(v),f[w][v]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+w+" = ("+R.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+E[w].map(function(i){return""+JSON.stringify(i)+": "+f[w][i].toString()}).join(",")+`});
`}),y=y+"new (("+R.toString().replace("ENTRY_MODULE",JSON.stringify(h))+")({"+E.main.map(function(w){return""+JSON.stringify(w)+": "+f.main[w].toString()}).join(",")+"}))(self);";var l=new window.Blob([y],{type:"text/javascript"});if(d.bare)return l;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,o=n.createObjectURL(l),u=new window.Worker(o);return u.objectURL=o,u}},"./src/config.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"hlsDefaultConfig",function(){return k}),S.d(m,"mergeConfig",function(){return c}),S.d(m,"enableStreamingMode",function(){return b});var R=S("./src/controller/abr-controller.ts"),T=S("./src/controller/audio-stream-controller.ts"),g=S("./src/controller/audio-track-controller.ts"),C=S("./src/controller/subtitle-stream-controller.ts"),p=S("./src/controller/subtitle-track-controller.ts"),s=S("./src/controller/buffer-controller.ts"),a=S("./src/controller/timeline-controller.ts"),r=S("./src/controller/cap-level-controller.ts"),h=S("./src/controller/fps-controller.ts"),d=S("./src/controller/eme-controller.ts"),f=S("./src/controller/cmcd-controller.ts"),E=S("./src/utils/xhr-loader.ts"),y=S("./src/utils/fetch-loader.ts"),l=S("./src/utils/cues.ts"),n=S("./src/utils/mediakeys-helper.ts"),o=S("./src/utils/logger.ts");function u(){return u=Object.assign||function(x){for(var _=1;_<arguments.length;_++){var j=arguments[_];for(var F in j)Object.prototype.hasOwnProperty.call(j,F)&&(x[F]=j[F])}return x},u.apply(this,arguments)}function w(x,_){var j=Object.keys(x);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(x);_&&(F=F.filter(function(L){return Object.getOwnPropertyDescriptor(x,L).enumerable})),j.push.apply(j,F)}return j}function v(x){for(var _=1;_<arguments.length;_++){var j=arguments[_]!=null?arguments[_]:{};_%2?w(Object(j),!0).forEach(function(F){i(x,F,j[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(j)):w(Object(j)).forEach(function(F){Object.defineProperty(x,F,Object.getOwnPropertyDescriptor(j,F))})}return x}function i(x,_,j){return _ in x?Object.defineProperty(x,_,{value:j,enumerable:!0,configurable:!0,writable:!0}):x[_]=j,x}var k=v(v({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:E.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:R.default,bufferController:s.default,capLevelController:r.default,fpsController:h.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},D()),{},{subtitleStreamController:C.SubtitleStreamController,subtitleTrackController:p.default,timelineController:a.TimelineController,audioStreamController:T.default,audioTrackController:g.default,emeController:d.default,cmcdController:f.default});function D(){return{cueHandler:l.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 c(x,_){if((_.liveSyncDurationCount||_.liveMaxLatencyDurationCount)&&(_.liveSyncDuration||_.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(_.liveMaxLatencyDurationCount!==void 0&&(_.liveSyncDurationCount===void 0||_.liveMaxLatencyDurationCount<=_.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(_.liveMaxLatencyDuration!==void 0&&(_.liveSyncDuration===void 0||_.liveMaxLatencyDuration<=_.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return u({},x,_)}function b(x){var _=x.loader;if(_!==y.default&&_!==E.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var j=Object(y.fetchSupported)();j&&(x.loader=y.default,x.progressive=!0,x.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/polyfills/number.ts"),T=S("./src/utils/ewma-bandwidth-estimator.ts"),g=S("./src/events.ts"),C=S("./src/utils/buffer-helper.ts"),p=S("./src/errors.ts"),s=S("./src/types/loader.ts"),a=S("./src/utils/logger.ts");function r(f,E){for(var y=0;y<E.length;y++){var l=E[y];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,l.key,l)}}function h(f,E,y){return E&&r(f.prototype,E),y&&r(f,y),f}var d=function(){function f(y){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=y;var l=y.config;this.bwEstimator=new T.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var E=f.prototype;return E.registerListeners=function(){var l=this.hls;l.on(g.Events.FRAG_LOADING,this.onFragLoading,this),l.on(g.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(g.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(g.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(g.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){var l=this.hls;l.off(g.Events.FRAG_LOADING,this.onFragLoading,this),l.off(g.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(g.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(g.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(g.Events.ERROR,this.onError,this)},E.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},E.onFragLoading=function(l,n){var o=n.frag;if(o.type===s.PlaylistLevelType.MAIN&&!this.timer){var u;this.fragCurrent=o,this.partCurrent=(u=n.part)!=null?u:null,this.timer=self.setInterval(this.onCheck,100)}},E.onLevelLoaded=function(l,n){var o=this.hls.config;n.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},E._abandonRulesCheck=function(){var l=this.fragCurrent,n=this.partCurrent,o=this.hls,u=o.autoLevelEnabled,w=o.config,v=o.media;if(!l||!v)return;var i=n?n.stats:l.stats,k=n?n.duration:l.duration;if(i.aborted){a.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!u||v.paused||!v.playbackRate||!v.readyState)return;var D=performance.now()-i.loading.start,c=Math.abs(v.playbackRate);if(D<=500*k/c)return;var b=o.levels,x=o.minAutoLevel,_=b[l.level],j=i.total||Math.max(i.loaded,Math.round(k*_.maxBitrate/8)),F=Math.max(1,i.bwEstimate?i.bwEstimate/8:i.loaded*1e3/D),L=(j-i.loaded)/F,X=v.currentTime,z=(C.BufferHelper.bufferInfo(v,X,w.maxBufferHole).end-X)/c;if(z>=2*k/c||L<=z)return;var H=Number.POSITIVE_INFINITY,G;for(G=l.level-1;G>x;G--){var U=b[G].maxBitrate;if(H=k*U/(8*.8*F),H<z)break}if(H>=L)return;var B=this.bwEstimator.getEstimate();a.logger.warn("Fragment "+l.sn+(n?" part "+n.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
Current BW estimate: `+(Object(R.isFiniteNumber)(B)?(B/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+L.toFixed(3)+` s
Estimated load time for the next fragment: `+H.toFixed(3)+` s
Time to underbuffer: `+z.toFixed(3)+" s"),o.nextLoadLevel=G,this.bwEstimator.sample(D,i.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),o.trigger(g.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:n,stats:i})},E.onFragLoaded=function(l,n){var o=n.frag,u=n.part;if(o.type===s.PlaylistLevelType.MAIN&&Object(R.isFiniteNumber)(o.sn)){var w=u?u.stats:o.stats,v=u?u.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var i=this.hls.levels[o.level],k=(i.loaded?i.loaded.bytes:0)+w.loaded,D=(i.loaded?i.loaded.duration:0)+v;i.loaded={bytes:k,duration:D},i.realBitrate=Math.round(8*k/D)}if(o.bitrateTest){var c={stats:w,frag:o,part:u,id:o.type};this.onFragBuffered(g.Events.FRAG_BUFFERED,c),o.bitrateTest=!1}}},E.onFragBuffered=function(l,n){var o=n.frag,u=n.part,w=u?u.stats:o.stats;if(w.aborted)return;if(o.type!==s.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var v=w.parsing.end-w.loading.start;this.bwEstimator.sample(v,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},E.onError=function(l,n){switch(n.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},E.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},E.getNextABRAutoLevel=function(){var l=this.fragCurrent,n=this.partCurrent,o=this.hls,u=o.maxAutoLevel,w=o.config,v=o.minAutoLevel,i=o.media,k=n?n.duration:l?l.duration:0,D=i?i.currentTime:0,c=i&&i.playbackRate!==0?Math.abs(i.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,x=(C.BufferHelper.bufferInfo(i,D,w.maxBufferHole).end-D)/c,_=this.findBestLevel(b,v,u,x,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(_>=0)return _;a.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var j=k?Math.min(k,w.maxStarvationDelay):w.maxStarvationDelay,F=w.abrBandWidthFactor,L=w.abrBandWidthUpFactor;if(!x){var X=this.bitrateTestDelay;if(X){var z=k?Math.min(k,w.maxLoadingDelay):w.maxLoadingDelay;j=z-X,a.logger.trace("bitrate test took "+Math.round(1e3*X)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*j)+" ms"),F=L=1}}return _=this.findBestLevel(b,v,u,x+j,F,L),Math.max(_,0)},E.findBestLevel=function(l,n,o,u,w,v){for(var i,k=this.fragCurrent,D=this.partCurrent,c=this.lastLoadedFragLevel,b=this.hls.levels,x=b[c],_=!!(x!=null&&(i=x.details)!==null&&i!==void 0&&i.live),j=x==null?void 0:x.codecSet,F=D?D.duration:k?k.duration:0,L=o;L>=n;L--){var X=b[L];if(!X||j&&X.codecSet!==j)continue;var z=X.details,H=(D?z==null?void 0:z.partTarget:z==null?void 0:z.averagetargetduration)||F,G=void 0;L<=c?G=w*l:G=v*l;var U=b[L].maxBitrate,B=U*H/G;if(a.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+L+"/"+Math.round(G)+"/"+U+"/"+H+"/"+u+"/"+B),G>U&&(!B||_&&!this.bitrateTestDelay||B<u))return L}return-1},h(f,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,n=this.bwEstimator;if(l!==-1&&(!n||!n.canEstimate()))return l;var o=this.getNextABRAutoLevel();return l!==-1&&(o=Math.min(l,o)),o},set:function(l){this._nextAutoLevel=l}}]),f}();m.default=d},"./src/controller/audio-stream-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/polyfills/number.ts"),T=S("./src/controller/base-stream-controller.ts"),g=S("./src/events.ts"),C=S("./src/utils/buffer-helper.ts"),p=S("./src/controller/fragment-tracker.ts"),s=S("./src/types/level.ts"),a=S("./src/types/loader.ts"),r=S("./src/loader/fragment.ts"),h=S("./src/demux/chunk-cache.ts"),d=S("./src/demux/transmuxer-interface.ts"),f=S("./src/types/transmuxer.ts"),E=S("./src/controller/fragment-finders.ts"),y=S("./src/utils/discontinuities.ts"),l=S("./src/errors.ts"),n=S("./src/utils/logger.ts");function o(){return o=Object.assign||function(k){for(var D=1;D<arguments.length;D++){var c=arguments[D];for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(k[b]=c[b])}return k},o.apply(this,arguments)}function u(k,D){k.prototype=Object.create(D.prototype),k.prototype.constructor=k,w(k,D)}function w(k,D){return w=Object.setPrototypeOf||function(b,x){return b.__proto__=x,b},w(k,D)}var v=100,i=function(k){u(D,k);function D(b,x){var _;return _=k.call(this,b,x,"[audio-stream-controller]")||this,_.videoBuffer=null,_.videoTrackCC=-1,_.waitingVideoCC=-1,_.audioSwitch=!1,_.trackId=-1,_.waitingData=null,_.mainDetails=null,_.bufferFlushed=!1,_._registerListeners(),_}var c=D.prototype;return c.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},c._registerListeners=function(){var x=this.hls;x.on(g.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(g.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(g.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(g.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(g.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.on(g.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(g.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.on(g.Events.ERROR,this.onError,this),x.on(g.Events.BUFFER_RESET,this.onBufferReset,this),x.on(g.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(g.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(g.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.on(g.Events.FRAG_BUFFERED,this.onFragBuffered,this)},c._unregisterListeners=function(){var x=this.hls;x.off(g.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(g.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(g.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(g.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(g.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.off(g.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(g.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.off(g.Events.ERROR,this.onError,this),x.off(g.Events.BUFFER_RESET,this.onBufferReset,this),x.off(g.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(g.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(g.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(g.Events.FRAG_BUFFERED,this.onFragBuffered,this)},c.onInitPtsFound=function(x,_){var j=_.frag,F=_.id,L=_.initPTS;if(F==="main"){var X=j.cc;this.initPTS[j.cc]=L,this.log("InitPTS for cc: "+X+" found from main: "+L),this.videoTrackCC=X,this.state===T.State.WAITING_INIT_PTS&&this.tick()}},c.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=T.State.STOPPED;return}var _=this.lastCurrentTime;this.stopLoad(),this.setInterval(v),this.fragLoadError=0,_>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+_.toFixed(3)),this.state=T.State.IDLE):(this.loadedmetadata=!1,this.state=T.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},c.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_TRACK:{var x,_=this.levels,j=this.trackId,F=_==null||((x=_[j])===null||x===void 0)?void 0:x.details;if(F){if(this.waitForCdnTuneIn(F))break;this.state=T.State.WAITING_INIT_PTS}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var L,X=performance.now(),z=this.retryDate;(!z||X>=z||(L=this.media)!==null&&L!==void 0&&L.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=T.State.IDLE);break}case T.State.WAITING_INIT_PTS:{var H=this.waitingData;if(H){var G=H.frag,U=H.part,B=H.cache,W=H.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.FRAG_LOADING;var te=B.flush(),de={frag:G,part:U,payload:te,networkDetails:null};this._handleFragmentLoadProgress(de),W&&k.prototype._handleFragmentLoadComplete.call(this,de)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),be=C.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Ce=Object(E.fragmentWithinToleranceTest)(be.end,this.config.maxFragLookUpTolerance,G);Ce<0&&(n.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+be.end+" is needed"),this.clearWaitingFragment())}}else this.state=T.State.IDLE}}this.onTickEnd()},c.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.IDLE)},c.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var _=this.mediaBuffer?this.mediaBuffer:x,j=_.buffered;!this.loadedmetadata&&j.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},c.doTickIdle=function(){var x,_,j=this.hls,F=this.levels,L=this.media,X=this.trackId,z=j.config;if(!F||!F[X])return;if(!L&&(this.startFragRequested||!z.startFragPrefetch))return;var H=F[X],G=H.details;if(!G||G.live&&this.levelLastLoaded!==X||this.waitForCdnTuneIn(G)){this.state=T.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,r.ElementaryStreamTypes.AUDIO,a.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,a.PlaylistLevelType.AUDIO);if(U===null)return;var B=U.len,W=this.getMaxBufferLength(),te=this.audioSwitch;if(B>=W&&!te)return;if(!te&&this._streamEnded(U,G)){j.trigger(g.Events.BUFFER_EOS,{type:"audio"}),this.state=T.State.ENDED;return}var de=G.fragments,fe=de[0].start,be=U.end;if(te){var Ce=this.getLoadPosition();be=Ce,G.PTSKnown&&Ce<fe&&((U.end>fe||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),L.currentTime=fe+.05))}var ue=this.getNextFragment(be,G);if(!ue){this.bufferFlushed=!0;return}((x=ue.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((_=ue.decryptdata)!==null&&_!==void 0&&_.key)?this.loadKey(ue,G):this.loadFragment(ue,G,be)},c.getMaxBufferLength=function(){var x=k.prototype.getMaxBufferLength.call(this),_=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,a.PlaylistLevelType.MAIN);return _===null?x:Math.max(x,_.len)},c.onMediaDetaching=function(){this.videoBuffer=null,k.prototype.onMediaDetaching.call(this)},c.onAudioTracksUpdated=function(x,_){var j=_.audioTracks;this.resetTransmuxer(),this.levels=j.map(function(F){return new s.Level(F)})},c.onAudioTrackSwitching=function(x,_){var j=!!_.url;this.trackId=_.id;var F=this.fragCurrent;F!=null&&F.loader&&F.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),j?this.setInterval(v):this.resetTransmuxer(),j?(this.audioSwitch=!0,this.state=T.State.IDLE):this.state=T.State.STOPPED,this.tick()},c.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},c.onLevelLoaded=function(x,_){this.mainDetails=_.details},c.onAudioTrackLoaded=function(x,_){var j,F=this.levels,L=_.details,X=_.id;if(!F){this.warn("Audio tracks were reset while loading level "+X);return}this.log("Track "+X+" loaded ["+L.startSN+","+L.endSN+"],duration:"+L.totalduration);var z=F[X],H=0;if(L.live||(j=z.details)!==null&&j!==void 0&&j.live){var G=this.mainDetails;if(L.fragments[0]||(L.deltaUpdateFailed=!0),L.deltaUpdateFailed||!G)return;!z.details&&L.hasProgramDateTime&&G.hasProgramDateTime?(Object(y.alignMediaPlaylistByPDT)(L,G),H=L.fragments[0].start):H=this.alignPlaylists(L,z.details)}z.details=L,this.levelLastLoaded=X,!this.startFragRequested&&(this.mainDetails||!L.live)&&this.setStartPosition(z.details,H),this.state===T.State.WAITING_TRACK&&!this.waitForCdnTuneIn(L)&&(this.state=T.State.IDLE),this.tick()},c._handleFragmentLoadProgress=function(x){var _,j=x.frag,F=x.part,L=x.payload,X=this.config,z=this.trackId,H=this.levels;if(!H){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+j.sn+" of level "+j.level+" will not be buffered");return}var G=H[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 B=X.defaultAudioCodec||G.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new d.default(this.hls,a.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[j.cc],de=(_=j.initSegment)===null||_===void 0?void 0:_.data;if(te!==void 0){var fe=!1,be=F?F.index:-1,Ce=be!==-1,ue=new f.ChunkMetadata(j.level,j.sn,j.stats.chunkCount,L.byteLength,be,Ce);W.push(L,de,B,"",j,F,U.totalduration,fe,ue,te)}else{n.logger.log("Unknown video PTS for cc "+j.cc+", waiting for video PTS before demuxing audio frag "+j.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+z);var ge=this.waitingData=this.waitingData||{frag:j,part:F,cache:new h.default,complete:!1},pe=ge.cache;pe.push(new Uint8Array(L)),this.waitingVideoCC=this.videoTrackCC,this.state=T.State.WAITING_INIT_PTS}},c._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}k.prototype._handleFragmentLoadComplete.call(this,x)},c.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},c.onBufferCreated=function(x,_){var j=_.tracks.audio;j&&(this.mediaBuffer=j.buffer),_.tracks.video&&(this.videoBuffer=_.tracks.video.buffer)},c.onFragBuffered=function(x,_){var j=_.frag,F=_.part;if(j.type!==a.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(j)){this.warn("Fragment "+j.sn+(F?" p: "+F.index:"")+" of level "+j.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}j.sn!=="initSegment"&&(this.fragPrevious=j,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(g.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(j,F)},c.onError=function(x,_){switch(_.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(a.PlaylistLevelType.AUDIO,_);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==T.State.ERROR&&this.state!==T.State.STOPPED&&(this.state=_.fatal?T.State.ERROR:T.State.IDLE,this.warn(_.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(_.parent==="audio"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var j=!0,F=this.getFwdBufferInfo(this.mediaBuffer,a.PlaylistLevelType.AUDIO);F&&F.len>.5&&(j=!this.reduceMaxBufferLength(F.len)),j&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},c.onBufferFlushed=function(x,_){var j=_.type;j===r.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},c._handleTransmuxComplete=function(x){var _,j="audio",F=this.hls,L=x.remuxResult,X=x.chunkMeta,z=this.getCurrentContext(X);if(!z){this.warn("The loading context changed while buffering fragment "+X.sn+" of level "+X.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(X.level);return}var H=z.frag,G=z.part,U=L.audio,B=L.text,W=L.id3,te=L.initSegment;if(this.fragContextChanged(H))return;if(this.state=T.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,H,X),F.trigger(g.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:j,tracks:te.tracks})),U){var de=U.startPTS,fe=U.endPTS,be=U.startDTS,Ce=U.endDTS;G&&(G.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:de,endPTS:fe,startDTS:be,endDTS:Ce}),H.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,de,fe,be,Ce),this.bufferFragmentData(U,H,G,X)}if(W!=null&&(_=W.samples)!==null&&_!==void 0&&_.length){var ue=o({frag:H,id:j},W);F.trigger(g.Events.FRAG_PARSING_METADATA,ue)}if(B){var ge=o({frag:H,id:j},B);F.trigger(g.Events.FRAG_PARSING_USERDATA,ge)}},c._bufferInitSegment=function(x,_,j){if(this.state!==T.State.PARSING)return;x.video&&delete x.video;var F=x.audio;if(!F)return;F.levelCodec=F.codec,F.id="audio",this.log("Init audio buffer, container:"+F.container+", codecs[parsed]=["+F.codec+"]"),this.hls.trigger(g.Events.BUFFER_CODECS,x);var L=F.initSegment;if(L!=null&&L.byteLength){var X={type:"audio",frag:_,part:null,chunkMeta:j,parent:_.type,data:L};this.hls.trigger(g.Events.BUFFER_APPENDING,X)}this.tick()},c.loadFragment=function(x,_,j){var F=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||F===p.FragmentState.NOT_LOADED||F===p.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):_.live&&!Object(R.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=T.State.WAITING_INIT_PTS):(this.startFragRequested=!0,k.prototype.loadFragment.call(this,x,_,j)))},c.completeAudioSwitch=function(){var x=this.hls,_=this.media,j=this.trackId;_&&(this.log("Switching audio track : flushing all audio"),k.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(g.Events.AUDIO_TRACK_SWITCHED,{id:j})},D}(T.default);m.default=i},"./src/controller/audio-track-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/events.ts"),T=S("./src/errors.ts"),g=S("./src/controller/base-playlist-controller.ts"),C=S("./src/types/loader.ts");function p(d,f){for(var E=0;E<f.length;E++){var y=f[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(d,y.key,y)}}function s(d,f,E){return f&&p(d.prototype,f),E&&p(d,E),d}function a(d,f){d.prototype=Object.create(f.prototype),d.prototype.constructor=d,r(d,f)}function r(d,f){return r=Object.setPrototypeOf||function(y,l){return y.__proto__=l,y},r(d,f)}var h=function(d){a(f,d);function f(y){var l;return l=d.call(this,y,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var E=f.prototype;return E.registerListeners=function(){var l=this.hls;l.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(R.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){var l=this.hls;l.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(R.Events.ERROR,this.onError,this)},E.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,d.prototype.destroy.call(this)},E.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},E.onManifestParsed=function(l,n){this.tracks=n.audioTracks||[]},E.onAudioTrackLoaded=function(l,n){var o=n.id,u=n.details,w=this.tracksInGroup[o];if(!w){this.warn("Invalid audio track id "+o);return}var v=w.details;w.details=n.details,this.log("audioTrack "+o+" loaded ["+u.startSN+"-"+u.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,n,v))},E.onLevelLoading=function(l,n){this.switchLevel(n.level)},E.onLevelSwitching=function(l,n){this.switchLevel(n.level)},E.switchLevel=function(l){var n=this.hls.levels[l];if(!(n!=null&&n.audioGroupIds))return;var o=n.audioGroupIds[n.urlId];if(this.groupId!==o){this.groupId=o;var u=this.tracks.filter(function(v){return!o||v.groupId===o});this.selectDefaultTrack&&!u.some(function(v){return v.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=u;var w={audioTracks:u};this.log("Updating audio tracks, "+u.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(R.Events.AUDIO_TRACKS_UPDATED,w),this.selectInitialTrack()}},E.onError=function(l,n){if(d.prototype.onError.call(this,l,n),n.fatal||!n.context)return;n.context.type===C.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},E.setAudioTrack=function(l){var n=this.tracksInGroup;if(l<0||l>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=n[this.trackId];this.log("Now switching to audio-track index "+l);var u=n[l],w=u.id,v=u.groupId,i=v===void 0?"":v,k=u.name,D=u.type,c=u.url;if(this.trackId=l,this.trackName=k,this.selectDefaultTrack=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:i,name:k,type:D,url:c}),u.details&&!u.details.live)return;var b=this.switchParams(u.url,o==null?void 0:o.details);this.loadPlaylist(b)},E.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,o=this.findTrackId(n)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},E.findTrackId=function(l){for(var n=this.tracksInGroup,o=0;o<n.length;o++){var u=n[o];if((!this.selectDefaultTrack||u.default)&&(!l||l===u.name))return u.id}return-1},E.loadPlaylist=function(l){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var o=n.id,u=n.groupId,w=n.url;if(l)try{w=l.addDirectives(w)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("loading audio-track playlist for id: "+o),this.clearTimer(),this.hls.trigger(R.Events.AUDIO_TRACK_LOADING,{url:w,id:o,groupId:u,deliveryDirectives:l||null})}},s(f,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),f}(g.default);m.default=h},"./src/controller/base-playlist-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return s});var R=S("./src/polyfills/number.ts"),T=S("./src/types/level.ts"),g=S("./src/controller/level-helper.ts"),C=S("./src/utils/logger.ts"),p=S("./src/errors.ts"),s=function(){function a(h,d){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=C.logger.log.bind(C.logger,d+":"),this.warn=C.logger.warn.bind(C.logger,d+":"),this.hls=h}var r=a.prototype;return r.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},r.onError=function(d,f){f.fatal&&f.type===p.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},r.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},r.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},r.stopLoad=function(){this.canLoad=!1,this.clearTimer()},r.switchParams=function(d,f){var E=f==null?void 0:f.renditionReports;if(E)for(var y=0;y<E.length;y++){var l=E[y],n=""+l.URI;if(n===d.substr(-n.length)){var o=parseInt(l["LAST-MSN"]),u=parseInt(l["LAST-PART"]);if(f&&this.hls.config.lowLatencyMode){var w=Math.min(f.age-f.partTarget,f.targetduration);u!==void 0&&w>f.partTarget&&(u+=1)}if(Object(R.isFiniteNumber)(o))return new T.HlsUrlParameters(o,Object(R.isFiniteNumber)(u)?u:void 0,T.HlsSkip.No)}}},r.loadPlaylist=function(d){},r.shouldLoadTrack=function(d){return this.canLoad&&d&&!!d.url&&(!d.details||d.details.live)},r.playlistLoaded=function(d,f,E){var y=this,l=f.details,n=f.stats,o=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(l.advancedDateTime=Date.now()-o,l.live||E!=null&&E.live){if(l.reloaded(E),E&&this.log("live playlist "+d+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),E&&l.fragments.length>0&&Object(g.mergeDetails)(E,l),!this.canLoad||!l.live)return;var u,w=void 0,v=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var i=this.hls.config.lowLatencyMode,k=l.lastPartSn,D=l.endSN,c=l.lastPartIndex,b=c!==-1,x=k===D,_=i?0:c;b?(w=x?D+1:k,v=x?_:c+1):w=D+1;var j=l.age,F=j+l.ageHeader,L=Math.min(F-l.partTarget,l.targetduration*1.5);if(L>0){if(E&&L>E.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+E.tuneInGoal+" to: "+L+" with playlist age: "+l.age),L=0;else{var X=Math.floor(L/l.targetduration);if(w+=X,v!==void 0){var z=Math.round(L%l.targetduration/l.partTarget);v+=z}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+j.toFixed(2)+"s goal: "+L+" skip sn "+X+" to part "+v)}l.tuneInGoal=L}if(u=this.getDeliveryDirectives(l,f.deliveryDirectives,w,v),i||!x){this.loadPlaylist(u);return}}else u=this.getDeliveryDirectives(l,f.deliveryDirectives,w,v);var H=Object(g.computeReloadInterval)(l,n);w!==void 0&&l.canBlockReload&&(H-=l.partTarget||1),this.log("reload live playlist "+d+" in "+Math.round(H)+" ms"),this.timer=self.setTimeout(function(){return y.loadPlaylist(u)},H)}else this.clearTimer()},r.getDeliveryDirectives=function(d,f,E,y){var l=Object(T.getSkipValue)(d,E);return f!=null&&f.skip&&d.deltaUpdateFailed&&(E=f.msn,y=f.part,l=T.HlsSkip.No),new T.HlsUrlParameters(E,y,l)},r.retryLoadingOrFail=function(d){var f=this,E=this.hls.config,y=this.retryCount<E.levelLoadingMaxRetry;if(y){var l;if(this.retryCount++,d.details.indexOf("LoadTimeOut")>-1&&(l=d.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+d.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*E.levelLoadingRetryDelay,E.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return f.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+d.details+'"')}}else this.warn('cannot recover from error "'+d.details+'"'),this.clearTimer(),d.fatal=!0;return y},a}()},"./src/controller/base-stream-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"State",function(){return D}),S.d(m,"default",function(){return c});var R=S("./src/polyfills/number.ts"),T=S("./src/task-loop.ts"),g=S("./src/controller/fragment-tracker.ts"),C=S("./src/utils/buffer-helper.ts"),p=S("./src/utils/logger.ts"),s=S("./src/events.ts"),a=S("./src/errors.ts"),r=S("./src/types/transmuxer.ts"),h=S("./src/utils/mp4-tools.ts"),d=S("./src/utils/discontinuities.ts"),f=S("./src/controller/fragment-finders.ts"),E=S("./src/controller/level-helper.ts"),y=S("./src/loader/fragment-loader.ts"),l=S("./src/crypt/decrypter.ts"),n=S("./src/utils/time-ranges.ts"),o=S("./src/types/loader.ts");function u(b,x){for(var _=0;_<x.length;_++){var j=x[_];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(b,j.key,j)}}function w(b,x,_){return x&&u(b.prototype,x),_&&u(b,_),b}function v(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function i(b,x){b.prototype=Object.create(x.prototype),b.prototype.constructor=b,k(b,x)}function k(b,x){return k=Object.setPrototypeOf||function(j,F){return j.__proto__=F,j},k(b,x)}var D={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"},c=function(b){i(x,b);function x(j,F,L){var X;return X=b.call(this)||this,X.hls=void 0,X.fragPrevious=null,X.fragCurrent=null,X.fragmentTracker=void 0,X.transmuxer=null,X._state=D.STOPPED,X.media=void 0,X.mediaBuffer=void 0,X.config=void 0,X.bitrateTest=!1,X.lastCurrentTime=0,X.nextLoadPosition=0,X.startPosition=0,X.loadedmetadata=!1,X.fragLoadError=0,X.retryDate=0,X.levels=null,X.fragmentLoader=void 0,X.levelLastLoaded=null,X.startFragRequested=!1,X.decrypter=void 0,X.initPTS=[],X.onvseeking=null,X.onvended=null,X.logPrefix="",X.log=void 0,X.warn=void 0,X.logPrefix=L,X.log=p.logger.log.bind(p.logger,L+":"),X.warn=p.logger.warn.bind(p.logger,L+":"),X.hls=j,X.fragmentLoader=new y.default(j.config),X.fragmentTracker=F,X.config=j.config,X.decrypter=new l.default(j,j.config),j.on(s.Events.KEY_LOADED,X.onKeyLoaded,v(X)),X}var _=x.prototype;return _.doTick=function(){this.onTickEnd()},_.onTickEnd=function(){},_.startLoad=function(F){},_.stopLoad=function(){this.fragmentLoader.abort();var F=this.fragCurrent;F&&this.fragmentTracker.removeFragment(F),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=D.STOPPED},_._streamEnded=function(F,L){var X=this.fragCurrent,z=this.fragmentTracker;if(!L.live&&X&&X.sn===L.endSN&&!F.nextStart){var H=z.getState(X);return H===g.FragmentState.PARTIAL||H===g.FragmentState.OK}return!1},_.onMediaAttached=function(F,L){var X=this.media=this.mediaBuffer=L.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),X.addEventListener("seeking",this.onvseeking),X.addEventListener("ended",this.onvended);var z=this.config;this.levels&&z.autoStartLoad&&this.state===D.STOPPED&&this.startLoad(z.startPosition)},_.onMediaDetaching=function(){var F=this.media;F!=null&&F.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),F&&(F.removeEventListener("seeking",this.onvseeking),F.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},_.onMediaSeeking=function(){var F=this.config,L=this.fragCurrent,X=this.media,z=this.mediaBuffer,H=this.state,G=X?X.currentTime:0,U=C.BufferHelper.bufferInfo(z||X,G,F.maxBufferHole);if(this.log("media seeking to "+(Object(R.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+H),H===D.ENDED)this.resetLoadingState();else if(L&&!U.len){var B=F.maxFragLookUpTolerance,W=L.start-B,te=L.start+L.duration+B,de=G>te;(G<W||de)&&(de&&L.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),L.loader.abort()),this.resetLoadingState())}X&&(this.lastCurrentTime=G),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},_.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},_.onKeyLoaded=function(F,L){if(this.state!==D.KEY_LOADING||L.frag!==this.fragCurrent||!this.levels)return;this.state=D.IDLE;var X=this.levels[L.frag.level].details;X&&this.loadFragment(L.frag,X,L.frag.start)},_.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},_.onHandlerDestroyed=function(){this.state=D.STOPPED,this.hls.off(s.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,b.prototype.onHandlerDestroyed.call(this)},_.loadKey=function(F,L){this.log("Loading key for "+F.sn+" of ["+L.startSN+"-"+L.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+F.level),this.state=D.KEY_LOADING,this.fragCurrent=F,this.hls.trigger(s.Events.KEY_LOADING,{frag:F})},_.loadFragment=function(F,L,X){this._loadFragForPlayback(F,L,X)},_._loadFragForPlayback=function(F,L,X){var z=this,H=function(U){if(z.fragContextChanged(F)){z.warn("Fragment "+F.sn+(U.part?" p: "+U.part.index:"")+" of level "+F.level+" was dropped during download."),z.fragmentTracker.removeFragment(F);return}F.stats.chunkCount++,z._handleFragmentLoadProgress(U)};this._doFragLoad(F,L,X,H).then(function(G){if(!G)return;z.fragLoadError=0;var U=z.state;if(z.fragContextChanged(F)){(U===D.FRAG_LOADING||U===D.BACKTRACKING||!z.fragCurrent&&U===D.PARSING)&&(z.fragmentTracker.removeFragment(F),z.state=D.IDLE);return}if("payload"in G&&(z.log("Loaded fragment "+F.sn+" of level "+F.level),z.hls.trigger(s.Events.FRAG_LOADED,G),z.state===D.BACKTRACKING)){z.fragmentTracker.backtrack(F,G),z.resetFragmentLoading(F);return}z._handleFragmentLoadComplete(G)}).catch(function(G){z.warn(G),z.resetFragmentLoading(F)})},_.flushMainBuffer=function(F,L,X){if(X===void 0&&(X=null),!(F-L))return;var z={startOffset:F,endOffset:L,type:X};this.fragLoadError=0,this.hls.trigger(s.Events.BUFFER_FLUSHING,z)},_._loadInitSegment=function(F){var L=this;this._doFragLoad(F).then(function(X){if(!X||L.fragContextChanged(F)||!L.levels)throw new Error("init load aborted");return X}).then(function(X){var z=L.hls,H=X.payload,G=F.decryptdata;if(H&&H.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var U=self.performance.now();return L.decrypter.webCryptoDecrypt(new Uint8Array(H),G.key.buffer,G.iv.buffer).then(function(B){var W=self.performance.now();return z.trigger(s.Events.FRAG_DECRYPTED,{frag:F,payload:B,stats:{tstart:U,tdecrypt:W}}),X.payload=B,X})}return X}).then(function(X){var z=L.fragCurrent,H=L.hls,G=L.levels;if(!G)throw new Error("init load aborted, missing levels");var U=G[F.level].details;console.assert(U,"Level details are defined when init segment is loaded");var B=F.stats;L.state=D.IDLE,L.fragLoadError=0,F.data=new Uint8Array(X.payload),B.parsing.start=B.buffering.start=self.performance.now(),B.parsing.end=B.buffering.end=self.performance.now(),X.frag===z&&H.trigger(s.Events.FRAG_BUFFERED,{stats:B,frag:z,part:null,id:F.type}),L.tick()}).catch(function(X){L.warn(X),L.resetFragmentLoading(F)})},_.fragContextChanged=function(F){var L=this.fragCurrent;return!F||!L||F.level!==L.level||F.sn!==L.sn||F.urlId!==L.urlId},_.fragBufferedComplete=function(F,L){var X=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+F.type+" sn: "+F.sn+(L?" part: "+L.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+F.level+" "+n.default.toString(C.BufferHelper.getBuffered(X))),this.state=D.IDLE,this.tick()},_._handleFragmentLoadComplete=function(F){var L=this.transmuxer;if(!L)return;var X=F.frag,z=F.part,H=F.partsLoaded,G=!H||H.length===0||H.some(function(B){return!B}),U=new r.ChunkMetadata(X.level,X.sn,X.stats.chunkCount+1,0,z?z.index:-1,!G);L.flush(U)},_._handleFragmentLoadProgress=function(F){},_._doFragLoad=function(F,L,X,z){var H=this;if(X===void 0&&(X=null),!this.levels)throw new Error("frag load aborted, missing levels");if(X=Math.max(F.start,X||0),this.config.lowLatencyMode&&L){var G=L.partList;if(G&&z){X>F.end&&L.fragmentHint&&(F=L.fragmentHint);var U=this.getNextPart(G,F,X);if(U>-1){var B=G[U];return this.log("Loading part sn: "+F.sn+" p: "+B.index+" cc: "+F.cc+" of playlist ["+L.startSN+"-"+L.endSN+"] parts [0-"+U+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+F.level+", target: "+parseFloat(X.toFixed(3))),this.nextLoadPosition=B.start+B.duration,this.state=D.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:F,part:G[U],targetBufferTime:X}),this.doFragPartsLoad(F,G,U,z).catch(function(W){return H.handleFragLoadError(W)})}else if(!F.url||this.loadedEndOfParts(G,X))return Promise.resolve(null)}}return this.log("Loading fragment "+F.sn+" cc: "+F.cc+" "+(L?"of ["+L.startSN+"-"+L.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+F.level+", target: "+parseFloat(X.toFixed(3))),Object(R.isFiniteNumber)(F.sn)&&!this.bitrateTest&&(this.nextLoadPosition=F.start+F.duration),this.state=D.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:F,targetBufferTime:X}),this.fragmentLoader.load(F,z).catch(function(W){return H.handleFragLoadError(W)})},_.doFragPartsLoad=function(F,L,X,z){var H=this;return new Promise(function(G,U){var B=[],W=function te(de){var fe=L[de];H.fragmentLoader.loadPart(F,fe,z).then(function(be){B[fe.index]=be;var Ce=be.part;H.hls.trigger(s.Events.FRAG_LOADED,be);var ue=L[de+1];if(ue&&ue.fragment===F)te(de+1);else return G({frag:F,part:Ce,partsLoaded:B})}).catch(U)};W(X)})},_.handleFragLoadError=function(F){var L=F.data;return L&&L.details===a.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(L.frag,L.part):this.hls.trigger(s.Events.ERROR,L),null},_._handleTransmuxerFlush=function(F){var L=this.getCurrentContext(F);if(!L||this.state!==D.PARSING){this.fragCurrent||(this.state=D.IDLE);return}var X=L.frag,z=L.part,H=L.level,G=self.performance.now();X.stats.parsing.end=G,z&&(z.stats.parsing.end=G),this.updateLevelTiming(X,z,H,F.partial)},_.getCurrentContext=function(F){var L=this.levels,X=F.level,z=F.sn,H=F.part;if(!L||!L[X])return this.warn("Levels object was unset while buffering fragment "+z+" of level "+X+". The current chunk will not be buffered."),null;var G=L[X],U=H>-1?Object(E.getPartWith)(G,z,H):null,B=U?U.fragment:Object(E.getFragmentWithSN)(G,z,this.fragCurrent);return B?{frag:B,part:U,level:G}:null},_.bufferFragmentData=function(F,L,X,z){if(!F||this.state!==D.PARSING)return;var H=F.data1,G=F.data2,U=H;if(H&&G&&(U=Object(h.appendUint8Array)(H,G)),!U||!U.length)return;var B={type:F.type,frag:L,part:X,chunkMeta:z,parent:L.type,data:U};this.hls.trigger(s.Events.BUFFER_APPENDING,B),F.dropped&&F.independent&&!X&&this.flushBufferGap(L)},_.flushBufferGap=function(F){var L=this.media;if(!L)return;if(!C.BufferHelper.isBuffered(L,L.currentTime)){this.flushMainBuffer(0,F.start);return}var X=L.currentTime,z=C.BufferHelper.bufferInfo(L,X,0),H=F.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,H*.25),U=Math.max(Math.min(F.start-G,z.end-G),X+G);F.start-U>G&&this.flushMainBuffer(U,F.start)},_.getFwdBufferInfo=function(F,L){var X=this.config,z=this.getLoadPosition();if(!Object(R.isFiniteNumber)(z))return null;var H=C.BufferHelper.bufferInfo(F,z,X.maxBufferHole);if(H.len===0&&H.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(z,L);if(G&&H.nextStart<G.end)return C.BufferHelper.bufferInfo(F,z,Math.max(H.nextStart,X.maxBufferHole))}return H},_.getMaxBufferLength=function(F){var L=this.config,X;return F?X=Math.max(8*L.maxBufferSize/F,L.maxBufferLength):X=L.maxBufferLength,Math.min(X,L.maxMaxBufferLength)},_.reduceMaxBufferLength=function(F){var L=this.config,X=F||L.maxBufferLength;return L.maxMaxBufferLength>=X?(L.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+L.maxMaxBufferLength+"s"),!0):!1},_.getNextFragment=function(F,L){var X,z,H=L.fragments,G=H.length;if(!G)return null;var U=this.config,B=H[0].start,W;if(L.live){var te=U.initialLiveManifestSize;if(G<te)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+te+")"),null;!L.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(L,H),this.startPosition=W?this.hls.liveSyncPosition||W.start:F)}else F<=B&&(W=H[0]);if(!W){var de=U.lowLatencyMode?L.partEnd:L.fragmentEnd;W=this.getFragmentAtPosition(F,de,L)}return(X=W)!==null&&X!==void 0&&X.initSegment&&!((z=W)!==null&&z!==void 0&&z.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},_.getNextPart=function(F,L,X){for(var z=-1,H=!1,G=!0,U=0,B=F.length;U<B;U++){var W=F[U];if(G=G&&!W.independent,z>-1&&X<W.start)break;var te=W.loaded;!te&&(H||W.independent||G)&&W.fragment===L&&(z=U),H=te}return z},_.loadedEndOfParts=function(F,L){var X=F[F.length-1];return X&&L>X.start&&X.loaded},_.getInitialLiveFragment=function(F,L){var X=this.fragPrevious,z=null;if(X){if(F.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+X.programDateTime),z=Object(f.findFragmentByPDT)(L,X.endProgramDateTime,this.config.maxFragLookUpTolerance)),!z){var H=X.sn+1;if(H>=F.startSN&&H<=F.endSN){var G=L[H-F.startSN];X.cc===G.cc&&(z=G,this.log("Live playlist, switching playlist, load frag with next SN: "+z.sn))}z||(z=Object(f.findFragWithCC)(L,X.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?F.fragmentEnd:F.edge,F))}return z},_.getFragmentAtPosition=function(F,L,X){var z=this.config,H=this.fragPrevious,G=X.fragments,U=X.endSN,B=X.fragmentHint,W=z.maxFragLookUpTolerance,te=!!(z.lowLatencyMode&&X.partList&&B);te&&B&&!this.bitrateTest&&(G=G.concat(B),U=B.sn);var de;if(F<L){var fe=F>L-W?0:W;de=Object(f.findFragmentByPTS)(H,G,F,fe)}else de=G[G.length-1];if(de){var be=de.sn-X.startSN,Ce=H&&de.level===H.level,ue=G[be+1],ge=this.fragmentTracker.getState(de);if(ge===g.FragmentState.BACKTRACKED){de=null;for(var pe=be;G[pe]&&this.fragmentTracker.getState(G[pe])===g.FragmentState.BACKTRACKED;)H?de=G[pe--]:de=G[--pe];de||(de=ue)}else H&&de.sn===H.sn&&!te&&(Ce&&(de.sn<U&&this.fragmentTracker.getState(ue)!==g.FragmentState.OK?(this.log("SN "+de.sn+" just loaded, load next one: "+ue.sn),de=ue):de=null))}return de},_.synchronizeToLiveEdge=function(F){var L=this.config,X=this.media;if(!X)return;var z=this.hls.liveSyncPosition,H=X.currentTime,G=F.fragments[0].start,U=F.edge,B=H>=G-L.maxFragLookUpTolerance&&H<=U;if(z!==null&&X.duration>z&&(H<z||!B)){var W=L.liveMaxLatencyDuration!==void 0?L.liveMaxLatencyDuration:L.liveMaxLatencyDurationCount*F.targetduration;(!B&&X.readyState<4||H<U-W)&&(this.loadedmetadata||(this.nextLoadPosition=z),X.readyState&&(this.warn("Playback: "+H.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+z.toFixed(3)),X.currentTime=z))}},_.alignPlaylists=function(F,L){var X=this.levels,z=this.levelLastLoaded,H=this.fragPrevious,G=z!==null?X[z]:null,U=F.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var B=F.fragments[0].start,W=!L,te=F.alignedSliding&&Object(R.isFiniteNumber)(B);if(W||!te&&!B){Object(d.alignStream)(H,G,F);var de=F.fragments[0].start;return this.log("Live playlist sliding: "+de.toFixed(2)+" start-sn: "+(L?L.startSN:"na")+"->"+F.startSN+" prev-sn: "+(H?H.sn:"na")+" fragments: "+U),de}return B},_.waitForCdnTuneIn=function(F){var L=3;return F.live&&F.canBlockReload&&F.tuneInGoal>Math.max(F.partHoldBack,F.partTarget*L)},_.setStartPosition=function(F,L){var X=this.startPosition;if(X<L&&(X=-1),X===-1||this.lastCurrentTime===-1){var z=F.startTimeOffset;Object(R.isFiniteNumber)(z)?(X=L+z,z<0&&(X+=F.totalduration),X=Math.min(Math.max(L,X),L+F.totalduration),this.log("Start time offset "+z+" found in playlist, adjust startPosition to "+X),this.startPosition=X):F.live?X=this.hls.liveSyncPosition||L:this.startPosition=X=0,this.lastCurrentTime=X}this.nextLoadPosition=X},_.getLoadPosition=function(){var F=this.media,L=0;return this.loadedmetadata&&F?L=F.currentTime:this.nextLoadPosition&&(L=this.nextLoadPosition),L},_.handleFragLoadAborted=function(F,L){this.transmuxer&&F.sn!=="initSegment"&&F.stats.aborted&&(this.warn("Fragment "+F.sn+(L?" part"+L.index:"")+" of level "+F.level+" was aborted"),this.resetFragmentLoading(F))},_.resetFragmentLoading=function(F){(!this.fragCurrent||!this.fragContextChanged(F))&&(this.state=D.IDLE)},_.onFragmentOrKeyLoadError=function(F,L){if(L.fatal)return;var X=L.frag;if(!X||X.type!==F)return;var z=this.fragCurrent;console.assert(z&&X.sn===z.sn&&X.level===z.level&&X.urlId===z.urlId,"Frag load error must match current frag to retry");var H=this.config;if(this.fragLoadError+1<=H.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(X.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*H.fragLoadingRetryDelay,H.fragLoadingMaxRetryTimeout);this.warn("Fragment "+X.sn+" of "+F+" "+X.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=D.FRAG_LOADING_WAITING_RETRY}else L.levelRetry?(F===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=D.IDLE):(p.logger.error(L.details+" reaches max retry, redispatch as fatal ..."),L.fatal=!0,this.hls.stopLoad(),this.state=D.ERROR)},_.afterBufferFlushed=function(F,L,X){if(!F)return;var z=C.BufferHelper.getBuffered(F);this.fragmentTracker.detectEvictedFragments(L,z,X),this.state===D.ENDED&&this.resetLoadingState()},_.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=D.IDLE},_.resetLiveStartWhenNotLoaded=function(F){if(!this.loadedmetadata){this.startFragRequested=!1;var L=this.levels?this.levels[F].details:null;if(L!=null&&L.live)return this.startPosition=-1,this.setStartPosition(L,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},_.updateLevelTiming=function(F,L,X,z){var H=this,G=X.details;console.assert(!!G,"level.details must be defined");var U=Object.keys(F.elementaryStreams).reduce(function(B,W){var te=F.elementaryStreams[W];if(te){var de=te.endPTS-te.startPTS;if(de<=0)return H.warn("Could not parse fragment "+F.sn+" "+W+" duration reliably ("+de+") resetting transmuxer to fallback to playlist timing"),H.resetTransmuxer(),B||!1;var fe=z?0:Object(E.updateFragPTSDTS)(G,F,te.startPTS,te.endPTS,te.startDTS,te.endDTS);return H.hls.trigger(s.Events.LEVEL_PTS_UPDATED,{details:G,level:X,drift:fe,type:W,frag:F,start:te.startPTS,end:te.endPTS}),!0}return B},!1);U?(this.state=D.PARSED,this.hls.trigger(s.Events.FRAG_PARSED,{frag:F,part:L})):this.resetLoadingState()},_.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},w(x,[{key:"state",get:function(){return this._state},set:function(F){var L=this._state;L!==F&&(this._state=F,this.log(L+"->"+F))}}]),x}(T.default)},"./src/controller/buffer-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return f});var R=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),g=S("./src/utils/logger.ts"),C=S("./src/errors.ts"),p=S("./src/utils/buffer-helper.ts"),s=S("./src/utils/mediasource-helper.ts"),a=S("./src/loader/fragment.ts"),r=S("./src/controller/buffer-operation-queue.ts"),h=Object(s.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,f=function(){function E(l){var n=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var o=n.hls,u=n.media,w=n.mediaSource;g.logger.log("[buffer-controller]: Media source opened"),u&&(n.updateMediaElementDuration(),o.trigger(T.Events.MEDIA_ATTACHED,{media:u})),w&&w.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){g.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){g.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var y=E.prototype;return y.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},y.destroy=function(){this.unregisterListeners(),this.details=null},y.registerListeners=function(){var n=this.hls;n.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(T.Events.BUFFER_RESET,this.onBufferReset,this),n.on(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(T.Events.BUFFER_EOS,this.onBufferEos,this),n.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(T.Events.FRAG_PARSED,this.onFragParsed,this),n.on(T.Events.FRAG_CHANGED,this.onFragChanged,this)},y.unregisterListeners=function(){var n=this.hls;n.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(T.Events.BUFFER_RESET,this.onBufferReset,this),n.off(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(T.Events.BUFFER_EOS,this.onBufferEos,this),n.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(T.Events.FRAG_PARSED,this.onFragParsed,this),n.off(T.Events.FRAG_CHANGED,this.onFragChanged,this)},y._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new r.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},y.onManifestParsed=function(n,o){var u=2;(o.audio&&!o.video||!o.altAudio)&&(u=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=u,this.details=null,g.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},y.onMediaAttaching=function(n,o){var u=this.media=o.media;if(u&&h){var w=this.mediaSource=new h;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),u.src=self.URL.createObjectURL(w),this._objectUrl=u.src}},y.onMediaDetaching=function(){var n=this.media,o=this.mediaSource,u=this._objectUrl;if(o){if(g.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(w){g.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(u&&self.URL.revokeObjectURL(u),n.src===u?(n.removeAttribute("src"),n.load()):g.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(T.Events.MEDIA_DETACHED,void 0)},y.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(o){var u=n.sourceBuffer[o];try{u&&(n.removeBufferListeners(o),n.mediaSource&&n.mediaSource.removeSourceBuffer(u),n.sourceBuffer[o]=void 0)}catch(w){g.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",w)}}),this._initSourceBuffer()},y.onBufferCodecs=function(n,o){var u=this,w=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(v){if(w){var i=u.tracks[v];if(i&&typeof i.buffer.changeType=="function"){var k=o[v],D=k.codec,c=k.levelCodec,b=k.container,x=(i.levelCodec||i.codec).replace(d,"$1"),_=(c||D).replace(d,"$1");if(x!==_){var j=b+";codecs="+(c||D);u.appendChangeType(v,j)}}}else u.pendingTracks[v]=o[v]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},y.appendChangeType=function(n,o){var u=this,w=this.operationQueue,v={execute:function(){var k=u.sourceBuffer[n];k&&(g.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+o),k.changeType(o)),w.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(k){g.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",k)}};w.append(v,n)},y.onBufferAppending=function(n,o){var u=this,w=this.hls,v=this.operationQueue,i=this.tracks,k=o.data,D=o.type,c=o.frag,b=o.part,x=o.chunkMeta,_=x.buffering[D],j=self.performance.now();_.start=j;var F=c.stats.buffering,L=b?b.stats.buffering:null;F.start===0&&(F.start=j),L&&L.start===0&&(L.start=j);var X=i.audio,z=D==="audio"&&x.id===1&&(X==null?void 0:X.container)==="audio/mpeg",H={execute:function(){if(_.executeStart=self.performance.now(),z){var U=u.sourceBuffer[D];if(U){var B=c.start-U.timestampOffset;Math.abs(B)>=.1&&(g.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+c.start+" (delta: "+B+") sn: "+c.sn+")"),U.timestampOffset=c.start)}}u.appendExecutor(k,D)},onStart:function(){},onComplete:function(){var U=self.performance.now();_.executeEnd=_.end=U,F.first===0&&(F.first=U),L&&L.first===0&&(L.first=U);var B=u.sourceBuffer,W={};for(var te in B)W[te]=p.BufferHelper.getBuffered(B[te]);u.appendError=0,u.hls.trigger(T.Events.BUFFER_APPENDED,{type:D,frag:c,part:b,chunkMeta:x,parent:c.type,timeRanges:W})},onError:function(U){g.logger.error("[buffer-controller]: Error encountered while trying to append to the "+D+" SourceBuffer",U);var B={type:C.ErrorTypes.MEDIA_ERROR,parent:c.type,details:C.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?B.details=C.ErrorDetails.BUFFER_FULL_ERROR:(u.appendError++,B.details=C.ErrorDetails.BUFFER_APPEND_ERROR,u.appendError>w.config.appendErrorMaxRetry&&(g.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),B.fatal=!0)),w.trigger(T.Events.ERROR,B)}};v.append(H,D)},y.onBufferFlushing=function(n,o){var u=this,w=this.operationQueue,v=function(k){return{execute:u.removeExecutor.bind(u,k,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){u.hls.trigger(T.Events.BUFFER_FLUSHED,{type:k})},onError:function(c){g.logger.warn("[buffer-controller]: Failed to remove from "+k+" SourceBuffer",c)}}};o.type?w.append(v(o.type),o.type):this.getSourceBufferTypes().forEach(function(i){w.append(v(i),i)})},y.onFragParsed=function(n,o){var u=this,w=o.frag,v=o.part,i=[],k=v?v.elementaryStreams:w.elementaryStreams;k[a.ElementaryStreamTypes.AUDIOVIDEO]?i.push("audiovideo"):(k[a.ElementaryStreamTypes.AUDIO]&&i.push("audio"),k[a.ElementaryStreamTypes.VIDEO]&&i.push("video"));var D=function(){var b=self.performance.now();w.stats.buffering.end=b,v&&(v.stats.buffering.end=b);var x=v?v.stats:w.stats;u.hls.trigger(T.Events.FRAG_BUFFERED,{frag:w,part:v,stats:x,id:w.type})};i.length===0&&g.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(D,i)},y.onFragChanged=function(n,o){this.flushBackBuffer()},y.onBufferEos=function(n,o){var u=this,w=this.getSourceBufferTypes().reduce(function(v,i){var k=u.sourceBuffer[i];return(!o.type||o.type===i)&&(k&&!k.ended&&(k.ended=!0,g.logger.log("[buffer-controller]: "+i+" sourceBuffer now EOS"))),v&&!!(!k||k.ended)},!0);w&&this.blockBuffers(function(){var v=u.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},y.onLevelUpdated=function(n,o){var u=o.details;if(!u.fragments.length)return;this.details=u,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},y.flushBackBuffer=function(){var n=this.hls,o=this.details,u=this.media,w=this.sourceBuffer;if(!u||o===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var i=o.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(R.isFiniteNumber)(i)||i<0)return;var k=u.currentTime,D=o.levelTargetDuration,c=Math.max(i,D),b=Math.floor(k/D)*D-c;v.forEach(function(x){var _=w[x];if(_){var j=p.BufferHelper.getBuffered(_);j.length>0&&b>j.start(0)&&(n.trigger(T.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),o.live&&n.trigger(T.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),n.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:x}))}})},y.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,o=this.hls,u=this.media,w=this.mediaSource,v=n.fragments[0].start+n.totalduration,i=u.duration,k=Object(R.isFiniteNumber)(w.duration)?w.duration:0;n.live&&o.config.liveDurationInfinity?(g.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(n)):(v>k&&v>i||!Object(R.isFiniteNumber)(i))&&(g.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),w.duration=v)},y.updateSeekableRange=function(n){var o=this.mediaSource,u=n.fragments,w=u.length;if(w&&n.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var v=Math.max(0,u[0].start),i=Math.max(v,v+n.totalduration);o.setLiveSeekableRange(v,i)}},y.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,o=this.operationQueue,u=this.pendingTracks,w=Object.keys(u).length;if(w&&!n||w===2){this.createSourceBuffers(u),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(T.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(i){o.executeNext(i)})}},y.createSourceBuffers=function(n){var o=this.sourceBuffer,u=this.mediaSource;if(!u)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var v in n)if(!o[v]){var i=n[v];if(!i)throw Error("source buffer exists for track "+v+", however track does not");var k=i.levelCodec||i.codec,D=i.container+";codecs="+k;g.logger.log("[buffer-controller]: creating sourceBuffer("+D+")");try{var c=o[v]=u.addSourceBuffer(D),b=v;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[v]={buffer:c,codec:k,container:i.container,levelCodec:i.levelCodec,id:i.id},w++}catch(x){g.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(T.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:D})}}w&&this.hls.trigger(T.Events.BUFFER_CREATED,{tracks:this.tracks})},y._onSBUpdateStart=function(n){var o=this.operationQueue,u=o.current(n);u.onStart()},y._onSBUpdateEnd=function(n){var o=this.operationQueue,u=o.current(n);u.onComplete(),o.shiftAndExecuteNext(n)},y._onSBUpdateError=function(n,o){g.logger.error("[buffer-controller]: "+n+" SourceBuffer error",o),this.hls.trigger(T.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var u=this.operationQueue.current(n);u&&u.onError(o)},y.removeExecutor=function(n,o,u){var w=this.media,v=this.mediaSource,i=this.operationQueue,k=this.sourceBuffer,D=k[n];if(!w||!v||!D){g.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(n);return}var c=Object(R.isFiniteNumber)(w.duration)?w.duration:Infinity,b=Object(R.isFiniteNumber)(v.duration)?v.duration:Infinity,x=Math.max(0,o),_=Math.min(u,c,b);_>x?(g.logger.log("[buffer-controller]: Removing ["+x+","+_+"] from the "+n+" SourceBuffer"),console.assert(!D.updating,n+" sourceBuffer must not be updating"),D.remove(x,_)):i.shiftAndExecuteNext(n)},y.appendExecutor=function(n,o){var u=this.operationQueue,w=this.sourceBuffer,v=w[o];if(!v){g.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),u.shiftAndExecuteNext(o);return}v.ended=!1,console.assert(!v.updating,o+" sourceBuffer must not be updating"),v.appendBuffer(n)},y.blockBuffers=function(n,o){var u=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){g.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var w=this.operationQueue,v=o.map(function(i){return w.appendBlocker(i)});Promise.all(v).then(function(){n(),o.forEach(function(i){var k=u.sourceBuffer[i];(!k||!k.updating)&&w.shiftAndExecuteNext(i)})})},y.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},y.addBufferListener=function(n,o,u){var w=this.sourceBuffer[n];if(!w)return;var v=u.bind(this,n);this.listeners[n].push({event:o,listener:v}),w.addEventListener(o,v)},y.removeBufferListeners=function(n){var o=this.sourceBuffer[n];if(!o)return;this.listeners[n].forEach(function(u){o.removeEventListener(u.event,u.listener)})},E}()},"./src/controller/buffer-operation-queue.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return T});var R=S("./src/utils/logger.ts"),T=function(){function g(p){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=p}var C=g.prototype;return C.append=function(s,a){var r=this.queues[a];r.push(s),r.length===1&&this.buffers[a]&&this.executeNext(a)},C.insertAbort=function(s,a){var r=this.queues[a];r.unshift(s),this.executeNext(a)},C.appendBlocker=function(s){var a,r=new Promise(function(d){a=d}),h={execute:a,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(h,s),r},C.executeNext=function(s){var a=this.buffers,r=this.queues,h=a[s],d=r[s];if(d.length){var f=d[0];try{f.execute()}catch(E){R.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),f.onError(E),(!h||!h.updating)&&(d.shift(),this.executeNext(s))}}},C.shiftAndExecuteNext=function(s){this.queues[s].shift(),this.executeNext(s)},C.current=function(s){return this.queues[s][0]},g}()},"./src/controller/cap-level-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/events.ts");function T(p,s){for(var a=0;a<s.length;a++){var r=s[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(p,r.key,r)}}function g(p,s,a){return s&&T(p.prototype,s),a&&T(p,a),p}var C=function(){function p(a){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=a,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var s=p.prototype;return s.setStreamController=function(r){this.streamController=r},s.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},s.registerListeners=function(){var r=this.hls;r.on(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},s.unregisterListener=function(){var r=this.hls;r.off(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},s.onFpsDropLevelCapping=function(r,h){p.isLevelAllowed(h.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(h.droppedLevel)},s.onMediaAttaching=function(r,h){this.media=h.media instanceof HTMLVideoElement?h.media:null},s.onManifestParsed=function(r,h){var d=this.hls;this.restrictedLevels=[],this.firstLevel=h.firstLevel,d.config.capLevelToPlayerSize&&h.video&&this.startCapping()},s.onBufferCodecs=function(r,h){var d=this.hls;d.config.capLevelToPlayerSize&&h.video&&this.startCapping()},s.onMediaDetaching=function(){this.stopCapping()},s.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var r=this.hls.levels;if(r.length){var h=this.hls;h.autoLevelCapping=this.getMaxLevel(r.length-1),h.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=h.autoLevelCapping}}},s.getMaxLevel=function(r){var h=this,d=this.hls.levels;if(!d.length)return-1;var f=d.filter(function(E,y){return p.isLevelAllowed(y,h.restrictedLevels)&&y<=r});return this.clientRect=null,p.getMaxLevelByMediaSize(f,this.mediaWidth,this.mediaHeight)},s.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},s.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},s.getDimensions=function(){if(this.clientRect)return this.clientRect;var r=this.media,h={width:0,height:0};if(r){var d=r.getBoundingClientRect();h.width=d.width,h.height=d.height,!h.width&&!h.height&&(h.width=d.right-d.left||r.width||0,h.height=d.bottom-d.top||r.height||0)}return this.clientRect=h,h},p.isLevelAllowed=function(r,h){return h===void 0&&(h=[]),h.indexOf(r)===-1},p.getMaxLevelByMediaSize=function(r,h,d){if(!r||!r.length)return-1;for(var f=function(o,u){return u?o.width!==u.width||o.height!==u.height:!0},E=r.length-1,y=0;y<r.length;y+=1){var l=r[y];if((l.width>=h||l.height>=d)&&f(l,r[y+1])){E=y;break}}return E},g(p,[{key:"mediaWidth",get:function(){return this.getDimensions().width*p.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*p.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var r=1;try{r=self.devicePixelRatio}catch(h){}return r}}]),p}();m.default=C},"./src/controller/cmcd-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return f});var R=S("./src/events.ts"),T=S("./src/types/cmcd.ts"),g=S("./src/utils/buffer-helper.ts"),C=S("./src/utils/logger.ts");function p(E,y){for(var l=0;l<y.length;l++){var n=y[l];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(E,n.key,n)}}function s(E,y,l){return y&&p(E.prototype,y),l&&p(E,l),E}function a(E,y){var l=typeof Symbol!="undefined"&&E[Symbol.iterator]||E["@@iterator"];if(l)return(l=l.call(E)).next.bind(l);if(Array.isArray(E)||(l=r(E))||y&&E&&typeof E.length=="number"){l&&(E=l);var n=0;return function(){return n>=E.length?{done:!0}:{done:!1,value:E[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(E,y){if(!E)return;if(typeof E=="string")return h(E,y);var l=Object.prototype.toString.call(E).slice(8,-1);if(l==="Object"&&E.constructor&&(l=E.constructor.name),l==="Map"||l==="Set")return Array.from(E);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return h(E,y)}function h(E,y){(y==null||y>E.length)&&(y=E.length);for(var l=0,n=new Array(y);l<y;l++)n[l]=E[l];return n}function d(){return d=Object.assign||function(E){for(var y=1;y<arguments.length;y++){var l=arguments[y];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(E[n]=l[n])}return E},d.apply(this,arguments)}var f=function(){function E(l){var n=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(w){try{n.apply(w,{ot:T.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(v){C.logger.warn("Could not generate manifest CMCD data.",v)}},this.applyFragmentData=function(w){try{var v=w.frag,i=n.hls.levels[v.level],k=n.getObjectType(v),D={d:v.duration*1e3,ot:k};(k===T.CMCDObjectType.VIDEO||k===T.CMCDObjectType.AUDIO||k==T.CMCDObjectType.MUXED)&&(D.br=i.bitrate/1e3,D.tb=n.getTopBandwidth(k),D.bl=n.getBufferLength(k)),n.apply(w,D)}catch(c){C.logger.warn("Could not generate segment CMCD data.",c)}},this.hls=l;var o=this.config=l.config,u=o.cmcd;u!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=u.sessionId||E.uuid(),this.cid=u.contentId,this.useHeaders=u.useHeaders===!0,this.registerListeners())}var y=E.prototype;return y.registerListeners=function(){var n=this.hls;n.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this)},y.unregisterListeners=function(){var n=this.hls;n.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},y.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},y.onMediaAttached=function(n,o){this.media=o.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},y.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},y.onBufferCreated=function(n,o){var u,w;this.audioBuffer=(u=o.tracks.audio)===null||u===void 0?void 0:u.buffer,this.videoBuffer=(w=o.tracks.video)===null||w===void 0?void 0:w.buffer},y.createData=function(){var n;return{v:T.CMCDVersion,sf:T.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(n=this.media)===null||n===void 0?void 0:n.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},y.apply=function(n,o){o===void 0&&(o={}),d(o,this.createData());var u=o.ot===T.CMCDObjectType.INIT||o.ot===T.CMCDObjectType.VIDEO||o.ot===T.CMCDObjectType.MUXED;if(this.starved&&u&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var w=E.toHeaders(o);if(!Object.keys(w).length)return;n.headers||(n.headers={}),d(n.headers,w)}else{var v=E.toQuery(o);if(!v)return;n.url=E.appendQueryToUri(n.url,v)}},y.getObjectType=function(n){var o=n.type;return o==="subtitle"?T.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?T.CMCDObjectType.INIT:o==="audio"?T.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?T.CMCDObjectType.VIDEO:T.CMCDObjectType.MUXED:void 0},y.getTopBandwidth=function(n){for(var o=0,u=n===T.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,w=a(u),v;!(v=w()).done;){var i=v.value;i.bitrate>o&&(o=i.bitrate)}return o>0?o:NaN},y.getBufferLength=function(n){var o=this.hls.media,u=n===T.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!u||!o)return NaN;var w=g.BufferHelper.bufferInfo(u,o.currentTime,this.config.maxBufferHole);return w.len*1e3},y.createPlaylistLoader=function(){var n=this.config.pLoader,o=this.applyPlaylistData,u=n||this.config.loader;return function(){function w(i){this.loader=void 0,this.loader=new u(i)}var v=w.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(k,D,c){o(k),this.loader.load(k,D,c)},s(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},y.createFragmentLoader=function(){var n=this.config.fLoader,o=this.applyFragmentData,u=n||this.config.loader;return function(){function w(i){this.loader=void 0,this.loader=new u(i)}var v=w.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(k,D,c){o(k),this.loader.load(k,D,c)},s(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},E.uuid=function(){var n=URL.createObjectURL(new Blob),o=n.toString();return URL.revokeObjectURL(n),o.substr(o.lastIndexOf("/")+1)},E.serialize=function(n){for(var o=[],u=function(z){return!Number.isNaN(z)&&z!=null&&z!==""&&z!==!1},w=function(z){return Math.round(z)},v=function(z){return w(z/100)*100},i=function(z){return encodeURIComponent(z)},k={br:w,d:w,bl:v,dl:v,mtp:v,nor:i,rtp:v,tb:w},D=Object.keys(n||{}).sort(),c=a(D),b;!(b=c()).done;){var x=b.value,_=n[x];if(!u(_))continue;if(x==="v"&&_===1)continue;if(x=="pr"&&_===1)continue;var j=k[x];j&&(_=j(_));var F=typeof _,L=void 0;x==="ot"||x==="sf"||x==="st"?L=x+"="+_:F==="boolean"?L=x:F==="number"?L=x+"="+_:L=x+"="+JSON.stringify(_),o.push(L)}return o.join(",")},E.toHeaders=function(n){for(var o=Object.keys(n),u={},w=["Object","Request","Session","Status"],v=[{},{},{},{}],i={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},k=0,D=o;k<D.length;k++){var c=D[k],b=i[c]!=null?i[c]:1;v[b][c]=n[c]}for(var x=0;x<v.length;x++){var _=E.serialize(v[x]);_&&(u["CMCD-"+w[x]]=_)}return u},E.toQuery=function(n){return"CMCD="+encodeURIComponent(E.serialize(n))},E.appendQueryToUri=function(n,o){if(!o)return n;var u=n.includes("?")?"&":"?";return""+n+u+o},E}()},"./src/controller/eme-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/events.ts"),T=S("./src/errors.ts"),g=S("./src/utils/logger.ts"),C=S("./src/utils/mediakeys-helper.ts");function p(f,E){for(var y=0;y<E.length;y++){var l=E[y];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,l.key,l)}}function s(f,E,y){return E&&p(f.prototype,E),y&&p(f,y),f}var a=3,r=function(E,y,l){var n={audioCapabilities:[],videoCapabilities:[]};return E.forEach(function(o){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:l.audioRobustness||""})}),y.forEach(function(o){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:l.videoRobustness||""})}),[n]},h=function(E,y,l,n){switch(E){case C.KeySystems.WIDEVINE:return r(y,l,n);default:throw new Error("Unknown key-system: "+E)}},d=function(){function f(y){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=y,this._config=y.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var E=f.prototype;return E.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},E._registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this)},E._unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this)},E.getLicenseServerUrl=function(l){switch(l){case C.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},E._attemptKeySystemAccess=function(l,n,o){var u=this,w=h(l,n,o,this._drmSystemOptions);g.logger.log("Requesting encrypted media key-system access");var v=this.requestMediaKeySystemAccess(l,w);this.mediaKeysPromise=v.then(function(i){return u._onMediaKeySystemAccessObtained(l,i)}),v.catch(function(i){g.logger.error('Failed to obtain key-system "'+l+'" access:',i)})},E._onMediaKeySystemAccessObtained=function(l,n){var o=this;g.logger.log('Access for key-system "'+l+'" obtained');var u={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:l};this._mediaKeysList.push(u);var w=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(v){return u.mediaKeys=v,g.logger.log('Media-keys created for key-system "'+l+'"'),o._onMediaKeysCreated(),v});return w.catch(function(v){g.logger.error("Failed to create media-keys:",v)}),w},E._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),l._onNewMediaKeySession(n.mediaKeysSession))})},E._onNewMediaKeySession=function(l){var n=this;g.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(o){n._onKeySessionMessage(l,o.message)},!1)},E._onKeySessionMessage=function(l,n){g.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(o){g.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),l.update(o)})},E.onMediaEncrypted=function(l){var n=this;if(g.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){g.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(w){if(!n._media)return;n._attemptSetMediaKeys(w),n._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(o).catch(o)},E._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){g.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}g.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},E._generateRequestWithPreferredKeySession=function(l,n){var o=this,u=this._mediaKeysList[0];if(!u){g.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(u.mediaKeysSessionInitialized){g.logger.warn("Key-Session already initialized but requested again");return}var w=u.mediaKeysSession;if(!w){g.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){g.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}g.logger.log('Generating key-session request for "'+l+'" init data type'),u.mediaKeysSessionInitialized=!0,w.generateRequest(l,n).then(function(){g.logger.debug("Key-session generation succeeded")}).catch(function(v){g.logger.error("Error generating key-session request:",v),o.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},E._createLicenseXhr=function(l,n,o){var u=new XMLHttpRequest;u.responseType="arraybuffer",u.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,u,l,n,o);var w=this._licenseXhrSetup;if(w)try{w.call(this.hls,u,l),w=void 0}catch(v){g.logger.error(v)}try{u.readyState||u.open("POST",l,!0),w&&w.call(this.hls,u,l)}catch(v){throw new Error("issue setting up KeySystem license XHR "+v)}return u},E._onLicenseRequestReadyStageChange=function(l,n,o,u){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,g.logger.log("License request succeeded");var w=l.response,v=this._licenseResponseCallback;if(v)try{w=v.call(this.hls,l,n)}catch(k){g.logger.error(k)}u(w)}else{if(g.logger.error("License Request XHR failed ("+n+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>a){this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var i=a-this._requestLicenseFailureCount+1;g.logger.warn("Retrying license request, "+i+" attempts left"),this._requestLicense(o,u)}break}},E._generateLicenseRequestChallenge=function(l,n){switch(l.mediaKeySystemDomain){case C.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},E._requestLicense=function(l,n){g.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){g.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var u=this.getLicenseServerUrl(o.mediaKeySystemDomain),w=this._createLicenseXhr(u,l,n);g.logger.log("Sending license request to URL: "+u);var v=this._generateLicenseRequestChallenge(o,l);w.send(v)}catch(i){g.logger.error("Failure requesting DRM license: "+i),this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},E.onMediaAttached=function(l,n){if(!this._emeEnabled)return;var o=n.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},E.onMediaDetached=function(){var l=this._media,n=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},E.onManifestParsed=function(l,n){if(!this._emeEnabled)return;var o=n.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),u=n.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(C.KeySystems.WIDEVINE,o,u)},s(f,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),f}();m.default=d},"./src/controller/fps-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/events.ts"),T=S("./src/utils/logger.ts"),g=function(){function C(s){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=s,this.registerListeners()}var p=C.prototype;return p.setStreamController=function(a){this.streamController=a},p.registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},p.unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching)},p.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},p.onMediaAttaching=function(a,r){var h=this.hls.config;if(h.capLevelOnFPSDrop){var d=r.media instanceof self.HTMLVideoElement?r.media:null;this.media=d,d&&typeof d.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),h.fpsDroppedMonitoringPeriod)}},p.checkFPS=function(a,r,h){var d=performance.now();if(r){if(this.lastTime){var f=d-this.lastTime,E=h-this.lastDroppedFrames,y=r-this.lastDecodedFrames,l=1e3*E/f,n=this.hls;if(n.trigger(R.Events.FPS_DROP,{currentDropped:E,currentDecoded:y,totalDroppedFrames:h}),l>0&&E>n.config.fpsDroppedMonitoringThreshold*y){var o=n.currentLevel;T.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=o)&&(o=o-1,n.trigger(R.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:n.currentLevel}),n.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=d,this.lastDroppedFrames=h,this.lastDecodedFrames=r}},p.checkFPSInterval=function(){var a=this.media;if(a)if(this.isVideoPlaybackQualityAvailable){var r=a.getVideoPlaybackQuality();this.checkFPS(a,r.totalVideoFrames,r.droppedVideoFrames)}else this.checkFPS(a,a.webkitDecodedFrameCount,a.webkitDroppedFrameCount)},C}();m.default=g},"./src/controller/fragment-finders.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"findFragmentByPDT",function(){return g}),S.d(m,"findFragmentByPTS",function(){return C}),S.d(m,"fragmentWithinToleranceTest",function(){return p}),S.d(m,"pdtWithinToleranceTest",function(){return s}),S.d(m,"findFragWithCC",function(){return a});var R=S("./src/polyfills/number.ts"),T=S("./src/utils/binary-search.ts");function g(r,h,d){if(h===null||!Array.isArray(r)||!r.length||!Object(R.isFiniteNumber)(h))return null;var f=r[0].programDateTime;if(h<(f||0))return null;var E=r[r.length-1].endProgramDateTime;if(h>=(E||0))return null;d=d||0;for(var y=0;y<r.length;++y){var l=r[y];if(s(h,d,l))return l}return null}function C(r,h,d,f){d===void 0&&(d=0),f===void 0&&(f=0);var E=null;if(r?E=h[r.sn-h[0].sn+1]||null:d===0&&h[0].start===0&&(E=h[0]),E&&p(d,f,E)===0)return E;var y=T.default.search(h,p.bind(null,d,f));return y||E}function p(r,h,d){r===void 0&&(r=0),h===void 0&&(h=0);var f=Math.min(h,d.duration+(d.deltaPTS?d.deltaPTS:0));return d.start+d.duration-f<=r?1:d.start-f>r&&d.start?-1:0}function s(r,h,d){var f=Math.min(h,d.duration+(d.deltaPTS?d.deltaPTS:0))*1e3,E=d.endProgramDateTime||0;return E-f>r}function a(r,h){return T.default.search(r,function(d){return d.cc<h?1:d.cc>h?-1:0})}},"./src/controller/fragment-tracker.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"FragmentState",function(){return g}),S.d(m,"FragmentTracker",function(){return C});var R=S("./src/events.ts"),T=S("./src/types/loader.ts"),g;(function(a){a.NOT_LOADED="NOT_LOADED",a.BACKTRACKED="BACKTRACKED",a.APPENDING="APPENDING",a.PARTIAL="PARTIAL",a.OK="OK"})(g||(g={}));var C=function(){function a(h){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=h,this._registerListeners()}var r=a.prototype;return r._registerListeners=function(){var d=this.hls;d.on(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(R.Events.FRAG_LOADED,this.onFragLoaded,this)},r._unregisterListeners=function(){var d=this.hls;d.off(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(R.Events.FRAG_LOADED,this.onFragLoaded,this)},r.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},r.getAppendedFrag=function(d,f){if(f===T.PlaylistLevelType.MAIN){var E=this.activeFragment,y=this.activeParts;if(!E)return null;if(y)for(var l=y.length;l--;){var n=y[l],o=n?n.end:E.appendedPTS;if(n.start<=d&&o!==void 0&&d<=o)return l>9&&(this.activeParts=y.slice(l-9)),n}else if(E.start<=d&&E.appendedPTS!==void 0&&d<=E.appendedPTS)return E}return this.getBufferedFrag(d,f)},r.getBufferedFrag=function(d,f){for(var E=this.fragments,y=Object.keys(E),l=y.length;l--;){var n=E[y[l]];if((n==null?void 0:n.body.type)===f&&n.buffered){var o=n.body;if(o.start<=d&&d<=o.end)return o}}return null},r.detectEvictedFragments=function(d,f,E){var y=this;Object.keys(this.fragments).forEach(function(l){var n=y.fragments[l];if(!n)return;if(!n.buffered){n.body.type===E&&y.removeFragment(n.body);return}var o=n.range[d];if(!o)return;o.time.some(function(u){var w=!y.isTimeBuffered(u.startPTS,u.endPTS,f);return w&&y.removeFragment(n.body),w})})},r.detectPartialFragments=function(d){var f=this,E=this.timeRanges,y=d.frag,l=d.part;if(!E||y.sn==="initSegment")return;var n=s(y),o=this.fragments[n];if(!o)return;Object.keys(E).forEach(function(u){var w=y.elementaryStreams[u];if(!w)return;var v=E[u],i=l!==null||w.partial===!0;o.range[u]=f.getBufferedTimes(y,l,i,v)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},r.fragBuffered=function(d){var f=s(d),E=this.fragments[f];E&&(E.backtrack=E.loaded=null,E.buffered=!0)},r.getBufferedTimes=function(d,f,E,y){for(var l={time:[],partial:E},n=f?f.start:d.start,o=f?f.end:d.end,u=d.minEndPTS||o,w=d.maxStartPTS||n,v=0;v<y.length;v++){var i=y.start(v)-this.bufferPadding,k=y.end(v)+this.bufferPadding;if(w>=i&&u<=k){l.time.push({startPTS:Math.max(n,y.start(v)),endPTS:Math.min(o,y.end(v))});break}else if(n<k&&o>i)l.partial=!0,l.time.push({startPTS:Math.max(n,y.start(v)),endPTS:Math.min(o,y.end(v))});else if(o<=i)break}return l},r.getPartialFragment=function(d){var f=null,E,y,l,n=0,o=this.bufferPadding,u=this.fragments;return Object.keys(u).forEach(function(w){var v=u[w];if(!v)return;p(v)&&(y=v.body.start-o,l=v.body.end+o,d>=y&&d<=l&&(E=Math.min(d-y,l-d),n<=E&&(f=v.body,n=E)))}),f},r.getState=function(d){var f=s(d),E=this.fragments[f];return E?E.buffered?p(E)?g.PARTIAL:g.OK:E.backtrack?g.BACKTRACKED:g.APPENDING:g.NOT_LOADED},r.backtrack=function(d,f){var E=s(d),y=this.fragments[E];if(!y||y.backtrack)return null;var l=y.backtrack=f||y.loaded;return y.loaded=null,l},r.getBacktrackData=function(d){var f=s(d),E=this.fragments[f];if(E){var y,l=E.backtrack;if(l!=null&&(y=l.payload)!==null&&y!==void 0&&y.byteLength)return l;this.removeFragment(d)}return null},r.isTimeBuffered=function(d,f,E){for(var y,l,n=0;n<E.length;n++){if(y=E.start(n)-this.bufferPadding,l=E.end(n)+this.bufferPadding,d>=y&&f<=l)return!0;if(f<=y)return!1}return!1},r.onFragLoaded=function(d,f){var E=f.frag,y=f.part;if(E.sn==="initSegment"||E.bitrateTest||y)return;var l=s(E);this.fragments[l]={body:E,loaded:f,backtrack:null,buffered:!1,range:Object.create(null)}},r.onBufferAppended=function(d,f){var E=this,y=f.frag,l=f.part,n=f.timeRanges;if(y.type===T.PlaylistLevelType.MAIN)if(this.activeFragment=y,l){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(l)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(u){var w=n[u];if(E.detectEvictedFragments(u,w),!l)for(var v=0;v<w.length;v++)y.appendedPTS=Math.max(w.end(v),y.appendedPTS||0)})},r.onFragBuffered=function(d,f){this.detectPartialFragments(f)},r.hasFragment=function(d){var f=s(d);return!!this.fragments[f]},r.removeFragmentsInRange=function(d,f,E){var y=this;Object.keys(this.fragments).forEach(function(l){var n=y.fragments[l];if(!n)return;if(n.buffered){var o=n.body;o.type===E&&o.start<f&&o.end>d&&y.removeFragment(o)}})},r.removeFragment=function(d){var f=s(d);d.stats.loaded=0,d.clearElementaryStreamInfo(),delete this.fragments[f]},r.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},a}();function p(a){var r,h;return a.buffered&&(((r=a.range.video)===null||r===void 0?void 0:r.partial)||((h=a.range.audio)===null||h===void 0?void 0:h.partial))}function s(a){return a.type+"_"+a.level+"_"+a.urlId+"_"+a.sn}},"./src/controller/gap-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"STALL_MINIMUM_DURATION_MS",function(){return p}),S.d(m,"MAX_START_GAP_JUMP",function(){return s}),S.d(m,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return a}),S.d(m,"SKIP_BUFFER_RANGE_START",function(){return r}),S.d(m,"default",function(){return h});var R=S("./src/utils/buffer-helper.ts"),T=S("./src/errors.ts"),g=S("./src/events.ts"),C=S("./src/utils/logger.ts"),p=250,s=2,a=.1,r=.05,h=function(){function d(E,y,l,n){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=E,this.media=y,this.fragmentTracker=l,this.hls=n}var f=d.prototype;return f.destroy=function(){this.hls=this.fragmentTracker=this.media=null},f.poll=function(y){var l=this.config,n=this.media,o=this.stalled,u=n.currentTime,w=n.seeking,v=this.seeking&&!w,i=!this.seeking&&w;if(this.seeking=w,u!==y){if(this.moved=!0,o!==null){if(this.stallReported){var k=self.performance.now()-o;C.logger.warn("playback not stuck anymore @"+u+", after "+Math.round(k)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((i||v)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!R.BufferHelper.getBuffered(n).length)return;var D=R.BufferHelper.bufferInfo(n,u,0),c=D.len>0,b=D.nextStart||0;if(!c&&!b)return;if(w){var x=D.len>s,_=!b||b-u>s&&!this.fragmentTracker.getPartialFragment(u);if(x||_)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var j,F=Math.max(b,D.start||0)-u,L=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,X=L==null||((j=L.details)===null||j===void 0)?void 0:j.live,z=X?L.details.targetduration*2:s;if(F>0&&F<=z){this._trySkipBufferHole(null);return}}var H=self.performance.now();if(o===null){this.stalled=H;return}var G=H-o;!w&&G>=p&&this._reportStall(D.len);var U=R.BufferHelper.bufferInfo(n,u,l.maxBufferHole);this._tryFixBufferStall(U,G)},f._tryFixBufferStall=function(y,l){var n=this.config,o=this.fragmentTracker,u=this.media,w=u.currentTime,v=o.getPartialFragment(w);if(v){var i=this._trySkipBufferHole(v);if(i)return}y.len>n.maxBufferHole&&l>n.highBufferWatchdogPeriod*1e3&&(C.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},f._reportStall=function(y){var l=this.hls,n=this.media,o=this.stallReported;o||(this.stallReported=!0,C.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+y+")"),l.trigger(g.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:y}))},f._trySkipBufferHole=function(y){for(var l=this.config,n=this.hls,o=this.media,u=o.currentTime,w=0,v=R.BufferHelper.getBuffered(o),i=0;i<v.length;i++){var k=v.start(i);if(u+l.maxBufferHole>=w&&u<k){var D=Math.max(k+r,o.currentTime+a);return C.logger.warn("skipping hole, adjusting currentTime from "+u+" to "+D),this.moved=!0,this.stalled=null,o.currentTime=D,y&&n.trigger(g.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+u+" to "+D,frag:y}),D}w=v.end(i)}return 0},f._tryNudgeBuffer=function(){var y=this.config,l=this.hls,n=this.media,o=n.currentTime,u=(this.nudgeRetry||0)+1;if(this.nudgeRetry=u,u<y.nudgeMaxRetry){var w=o+u*y.nudgeOffset;C.logger.warn("Nudging 'currentTime' from "+o+" to "+w),n.currentTime=w,l.trigger(g.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else C.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+y.nudgeMaxRetry+" nudges"),l.trigger(g.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},d}()},"./src/controller/id3-track-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/events.ts"),T=S("./src/utils/texttrack-utils.ts"),g=S("./src/demux/id3.ts"),C=.25,p=function(){function s(r){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=r,this._registerListeners()}var a=s.prototype;return a.destroy=function(){this._unregisterListeners()},a._registerListeners=function(){var h=this.hls;h.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(R.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},a._unregisterListeners=function(){var h=this.hls;h.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(R.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},a.onMediaAttached=function(h,d){this.media=d.media},a.onMediaDetaching=function(){if(!this.id3Track)return;Object(T.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},a.getID3Track=function(h){if(!this.media)return;for(var d=0;d<h.length;d++){var f=h[d];if(f.kind==="metadata"&&f.label==="id3")return Object(T.sendAddTrackEvent)(f,this.media),f}return this.media.addTextTrack("metadata","id3")},a.onFragParsingMetadata=function(h,d){if(!this.media)return;var f=d.frag,E=d.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var y=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<E.length;l++){var n=g.getID3Frames(E[l].data);if(n){var o=E[l].pts,u=l<E.length-1?E[l+1].pts:f.end,w=u-o;w<=0&&(u=o+C);for(var v=0;v<n.length;v++){var i=n[v];if(!g.isTimeStampFrame(i)){var k=new y(o,u,"");k.value=i,this.id3Track.addCue(k)}}}}},a.onBufferFlushing=function(h,d){var f=d.startOffset,E=d.endOffset,y=d.type;if(!y||y==="audio"){var l=this.id3Track;l&&Object(T.removeCuesInRange)(l,f,E)}},s}();m.default=p},"./src/controller/latency-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return s});var R=S("./src/errors.ts"),T=S("./src/events.ts"),g=S("./src/utils/logger.ts");function C(a,r){for(var h=0;h<r.length;h++){var d=r[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function p(a,r,h){return r&&C(a.prototype,r),h&&C(a,h),a}var s=function(){function a(h){var d=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 d.timeupdate()},this.hls=h,this.config=h.config,this.registerListeners()}var r=a.prototype;return r.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},r.registerListeners=function(){this.hls.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(T.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){this.hls.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(T.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(T.Events.ERROR,this.onError)},r.onMediaAttached=function(d,f){this.media=f.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},r.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},r.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},r.onLevelUpdated=function(d,f){var E=f.details;this.levelDetails=E,E.advanced&&this.timeupdate(),!E.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},r.onError=function(d,f){if(f.details!==R.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,g.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},r.timeupdate=function(){var d=this.media,f=this.levelDetails;if(!d||!f)return;this.currentTime=d.currentTime;var E=this.computeLatency();if(E===null)return;this._latency=E;var y=this.config,l=y.lowLatencyMode,n=y.maxLiveSyncPlaybackRate;if(!l||n===1)return;var o=this.targetLatency;if(o===null)return;var u=E-o,w=Math.min(this.maxLatency,o+f.targetduration),v=u<w;if(f.live&&v&&u>.05&&this.forwardBufferLength>1){var i=Math.min(2,Math.max(1,n)),k=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20;d.playbackRate=Math.min(i,Math.max(1,k))}else d.playbackRate!==1&&d.playbackRate!==0&&(d.playbackRate=1)},r.estimateLiveEdge=function(){var d=this.levelDetails;return d===null?null:d.edge+d.age},r.computeLatency=function(){var d=this.estimateLiveEdge();return d===null?null:d-this.currentTime},p(a,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var d=this.config,f=this.levelDetails;return d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:f?d.liveMaxLatencyDurationCount*f.targetduration:0}},{key:"targetLatency",get:function(){var d=this.levelDetails;if(d===null)return null;var f=d.holdBack,E=d.partHoldBack,y=d.targetduration,l=this.config,n=l.liveSyncDuration,o=l.liveSyncDurationCount,u=l.lowLatencyMode,w=this.hls.userConfig,v=u&&E||f;(w.liveSyncDuration||w.liveSyncDurationCount||v===0)&&(v=n!==void 0?n:o*y);var i=y,k=1;return v+Math.min(this.stallCount*k,i)}},{key:"liveSyncPosition",get:function(){var d=this.estimateLiveEdge(),f=this.targetLatency,E=this.levelDetails;if(d===null||f===null||E===null)return null;var y=E.edge,l=d-f-this.edgeStalled,n=y-E.totalduration,o=y-(this.config.lowLatencyMode&&E.partTarget||E.targetduration);return Math.min(Math.max(n,l),o)}},{key:"drift",get:function(){var d=this.levelDetails;return d===null?1:d.drift}},{key:"edgeStalled",get:function(){var d=this.levelDetails;if(d===null)return 0;var f=(this.config.lowLatencyMode&&d.partTarget||d.targetduration)*3;return Math.max(d.age-f,0)}},{key:"forwardBufferLength",get:function(){var d=this.media,f=this.levelDetails;if(!d||!f)return 0;var E=d.buffered.length;return E?d.buffered.end(E-1):f.edge-this.currentTime}}]),a}()},"./src/controller/level-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return l});var R=S("./src/types/level.ts"),T=S("./src/events.ts"),g=S("./src/errors.ts"),C=S("./src/utils/codecs.ts"),p=S("./src/controller/level-helper.ts"),s=S("./src/controller/base-playlist-controller.ts"),a=S("./src/types/loader.ts");function r(){return r=Object.assign||function(n){for(var o=1;o<arguments.length;o++){var u=arguments[o];for(var w in u)Object.prototype.hasOwnProperty.call(u,w)&&(n[w]=u[w])}return n},r.apply(this,arguments)}function h(n,o){for(var u=0;u<o.length;u++){var w=o[u];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}function d(n,o,u){return o&&h(n.prototype,o),u&&h(n,u),n}function f(n,o){n.prototype=Object.create(o.prototype),n.prototype.constructor=n,E(n,o)}function E(n,o){return E=Object.setPrototypeOf||function(w,v){return w.__proto__=v,w},E(n,o)}var y=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(n){f(o,n);function o(w){var v;return v=n.call(this,w,"[level-controller]")||this,v._levels=[],v._firstLevel=-1,v._startLevel=void 0,v.currentLevelIndex=-1,v.manualLevelIndex=-1,v.onParsedComplete=void 0,v._registerListeners(),v}var u=o.prototype;return u._registerListeners=function(){var v=this.hls;v.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),v.on(T.Events.ERROR,this.onError,this)},u._unregisterListeners=function(){var v=this.hls;v.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),v.off(T.Events.ERROR,this.onError,this)},u.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},u.startLoad=function(){var v=this._levels;v.forEach(function(i){i.loadError=0}),n.prototype.startLoad.call(this)},u.onManifestLoaded=function(v,i){var k=[],D=[],c=[],b,x={},_,j=!1,F=!1,L=!1;if(i.levels.forEach(function(G){var U=G.attrs;j=j||!!(G.width&&G.height),F=F||!!G.videoCodec,L=L||!!G.audioCodec,y&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var B=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;_=x[B],_?_.url.push(G.url):(_=new R.Level(G),x[B]=_,k.push(_)),U&&(U.AUDIO&&Object(p.addGroupId)(_,"audio",U.AUDIO),U.SUBTITLES&&Object(p.addGroupId)(_,"text",U.SUBTITLES))}),(j||F)&&L&&(k=k.filter(function(G){var U=G.videoCodec,B=G.width,W=G.height;return!!U||!!(B&&W)})),k=k.filter(function(G){var U=G.audioCodec,B=G.videoCodec;return(!U||Object(C.isCodecSupportedInMp4)(U,"audio"))&&(!B||Object(C.isCodecSupportedInMp4)(B,"video"))}),i.audioTracks&&(D=i.audioTracks.filter(function(G){return!G.audioCodec||Object(C.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(p.assignTrackIdsByGroup)(D)),i.subtitles&&(c=i.subtitles,Object(p.assignTrackIdsByGroup)(c)),k.length>0){b=k[0].bitrate,k.sort(function(G,U){return G.bitrate-U.bitrate}),this._levels=k;for(var X=0;X<k.length;X++)if(k[X].bitrate===b){this._firstLevel=X,this.log("manifest loaded, "+k.length+" level(s) found, first bitrate: "+b);break}var z=L&&!F,H={levels:k,audioTracks:D,subtitleTracks:c,firstLevel:this._firstLevel,stats:i.stats,audio:L,video:F,altAudio:!z&&D.some(function(G){return!!G.url})};this.hls.trigger(T.Events.MANIFEST_PARSED,H),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(T.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:i.url,reason:"no level with compatible codecs found in manifest"})},u.onError=function(v,i){if(n.prototype.onError.call(this,v,i),i.fatal)return;var k=i.context,D=this._levels[this.currentLevelIndex];if(k&&(k.type===a.PlaylistContextType.AUDIO_TRACK&&D.audioGroupIds&&k.groupId===D.audioGroupIds[D.urlId]||k.type===a.PlaylistContextType.SUBTITLE_TRACK&&D.textGroupIds&&k.groupId===D.textGroupIds[D.urlId])){this.redundantFailover(this.currentLevelIndex);return}var c=!1,b=!0,x;switch(i.details){case g.ErrorDetails.FRAG_LOAD_ERROR:case g.ErrorDetails.FRAG_LOAD_TIMEOUT:case g.ErrorDetails.KEY_LOAD_ERROR:case g.ErrorDetails.KEY_LOAD_TIMEOUT:if(i.frag){var _=this._levels[i.frag.level];_?(_.fragmentError++,_.fragmentError>this.hls.config.fragLoadingMaxRetry&&(x=i.frag.level)):x=i.frag.level}break;case g.ErrorDetails.LEVEL_LOAD_ERROR:case g.ErrorDetails.LEVEL_LOAD_TIMEOUT:k&&(k.deliveryDirectives&&(b=!1),x=k.level),c=!0;break;case g.ErrorDetails.REMUX_ALLOC_ERROR:x=i.level,c=!0;break}x!==void 0&&this.recoverLevel(i,x,c,b)},u.recoverLevel=function(v,i,k,D){var c=v.details,b=this._levels[i];if(b.loadError++,k){var x=this.retryLoadingOrFail(v);if(x)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(D){var _=b.url.length;if(_>1&&b.loadError<_)v.levelRetry=!0,this.redundantFailover(i);else if(this.manualLevelIndex===-1){var j=i===0?this._levels.length-1:i-1;this.currentLevelIndex!==j&&this._levels[j].loadError===0&&(this.warn(c+": switch to "+j),v.levelRetry=!0,this.hls.nextAutoLevel=j)}}},u.redundantFailover=function(v){var i=this._levels[v],k=i.url.length;if(k>1){var D=(i.urlId+1)%k;this.warn("Switching to redundant URL-id "+D),this._levels.forEach(function(c){c.urlId=D}),this.level=v}},u.onFragLoaded=function(v,i){var k=i.frag;if(k!==void 0&&k.type===a.PlaylistLevelType.MAIN){var D=this._levels[k.level];D!==void 0&&(D.fragmentError=0,D.loadError=0)}},u.onLevelLoaded=function(v,i){var k,D=i.level,c=i.details,b=this._levels[D];if(!b){var x;this.warn("Invalid level index "+D),(x=i.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(c.deltaUpdateFailed=!0);return}D===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(D,i,b.details)):(k=i.deliveryDirectives)!==null&&k!==void 0&&k.skip&&(c.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(v,i){var k=this.hls.levels[this.currentLevelIndex];if(!k)return;if(k.audioGroupIds){for(var D=-1,c=this.hls.audioTracks[i.id].groupId,b=0;b<k.audioGroupIds.length;b++)if(k.audioGroupIds[b]===c){D=b;break}D!==k.urlId&&(k.urlId=D,this.startLoad())}},u.loadPlaylist=function(v){var i=this.currentLevelIndex,k=this._levels[i];if(this.canLoad&&k&&k.url.length>0){var D=k.urlId,c=k.url[D];if(v)try{c=v.addDirectives(c)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+i+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+D+" "+c),this.clearTimer(),this.hls.trigger(T.Events.LEVEL_LOADING,{url:c,level:i,id:D,deliveryDirectives:v||null})}},u.removeLevel=function(v,i){var k=function(b,x){return x!==i},D=this._levels.filter(function(c,b){return b!==v?!0:c.url.length>1&&i!==void 0?(c.url=c.url.filter(k),c.audioGroupIds&&(c.audioGroupIds=c.audioGroupIds.filter(k)),c.textGroupIds&&(c.textGroupIds=c.textGroupIds.filter(k)),c.urlId=0,!0):!1}).map(function(c,b){var x=c.details;return x!=null&&x.fragments&&x.fragments.forEach(function(_){_.level=b}),c});this._levels=D,this.hls.trigger(T.Events.LEVELS_UPDATED,{levels:D})},d(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var i,k=this._levels;if(k.length===0)return;if(this.currentLevelIndex===v&&(i=k[v])!==null&&i!==void 0&&i.details)return;if(v<0||v>=k.length){var D=v<0;if(this.hls.trigger(T.Events.ERROR,{type:g.ErrorTypes.OTHER_ERROR,details:g.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:D,reason:"invalid level idx"}),D)return;v=Math.min(v,k.length-1)}this.clearTimer();var c=this.currentLevelIndex,b=k[c],x=k[v];this.log("switching to level "+v+" from "+c),this.currentLevelIndex=v;var _=r({},x,{level:v,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete _._urlId,this.hls.trigger(T.Events.LEVEL_SWITCHING,_);var j=x.details;if(!j||j.live){var F=this.switchParams(x.uri,b==null?void 0:b.details);this.loadPlaylist(F)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),o}(s.default)},"./src/controller/level-helper.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"addGroupId",function(){return g}),S.d(m,"assignTrackIdsByGroup",function(){return C}),S.d(m,"updatePTS",function(){return p}),S.d(m,"updateFragPTSDTS",function(){return a}),S.d(m,"mergeDetails",function(){return r}),S.d(m,"mapPartIntersection",function(){return h}),S.d(m,"mapFragmentIntersection",function(){return d}),S.d(m,"adjustSliding",function(){return f}),S.d(m,"addSliding",function(){return E}),S.d(m,"computeReloadInterval",function(){return y}),S.d(m,"getFragmentWithSN",function(){return l}),S.d(m,"getPartWith",function(){return n});var R=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts");function g(o,u,w){switch(u){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(w);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(w);break}}function C(o){var u={};o.forEach(function(w){var v=w.groupId||"";w.id=u[v]=u[v]||0,u[v]++})}function p(o,u,w){var v=o[u],i=o[w];s(v,i)}function s(o,u){var w=u.startPTS;if(Object(R.isFiniteNumber)(w)){var v=0,i;u.sn>o.sn?(v=w-o.start,i=o):(v=o.start-w,i=u),i.duration!==v&&(i.duration=v)}else if(u.sn>o.sn){var k=o.cc===u.cc;k&&o.minEndPTS?u.start=o.start+(o.minEndPTS-o.start):u.start=o.start+o.duration}else u.start=Math.max(o.start-u.duration,0)}function a(o,u,w,v,i,k){var D=v-w;D<=0&&(T.logger.warn("Fragment should have a positive duration",u),v=w+u.duration,k=i+u.duration);var c=w,b=v,x=u.startPTS,_=u.endPTS;if(Object(R.isFiniteNumber)(x)){var j=Math.abs(x-w);Object(R.isFiniteNumber)(u.deltaPTS)?u.deltaPTS=Math.max(j,u.deltaPTS):u.deltaPTS=j,c=Math.max(w,x),w=Math.min(w,x),i=Math.min(i,u.startDTS),b=Math.min(v,_),v=Math.max(v,_),k=Math.max(k,u.endDTS)}u.duration=v-w;var F=w-u.start;u.appendedPTS=v,u.start=u.startPTS=w,u.maxStartPTS=c,u.startDTS=i,u.endPTS=v,u.minEndPTS=b,u.endDTS=k;var L=u.sn;if(!o||L<o.startSN||L>o.endSN)return 0;var X,z=L-o.startSN,H=o.fragments;for(H[z]=u,X=z;X>0;X--)s(H[X],H[X-1]);for(X=z;X<H.length-1;X++)s(H[X],H[X+1]);return o.fragmentHint&&s(H[H.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,F}function r(o,u){for(var w=null,v=o.fragments,i=v.length-1;i>=0;i--){var k=v[i].initSegment;if(k){w=k;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var D=0,c;if(d(o,u,function(X,z){X.relurl&&(D=X.cc-z.cc),Object(R.isFiniteNumber)(X.startPTS)&&Object(R.isFiniteNumber)(X.endPTS)&&(z.start=z.startPTS=X.startPTS,z.startDTS=X.startDTS,z.appendedPTS=X.appendedPTS,z.maxStartPTS=X.maxStartPTS,z.endPTS=X.endPTS,z.endDTS=X.endDTS,z.minEndPTS=X.minEndPTS,z.duration=X.endPTS-X.startPTS,z.duration&&(c=z),u.PTSKnown=u.alignedSliding=!0),z.elementaryStreams=X.elementaryStreams,z.loader=X.loader,z.stats=X.stats,z.urlId=X.urlId,X.initSegment&&(z.initSegment=X.initSegment,w=X.initSegment)}),w){var b=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments;b.forEach(function(X){var z;(!X.initSegment||X.initSegment.relurl===((z=w)===null||z===void 0?void 0:z.relurl))&&(X.initSegment=w)})}if(u.skippedSegments&&(u.deltaUpdateFailed=u.fragments.some(function(X){return!X}),u.deltaUpdateFailed)){T.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=u.skippedSegments;x--;)u.fragments.shift();u.startSN=u.fragments[0].sn,u.startCC=u.fragments[0].cc}var _=u.fragments;if(D){T.logger.warn("discontinuity sliding from playlist, take drift into account");for(var j=0;j<_.length;j++)_[j].cc+=D}u.skippedSegments&&(u.startCC=u.fragments[0].cc),h(o.partList,u.partList,function(X,z){z.elementaryStreams=X.elementaryStreams,z.stats=X.stats}),c?a(u,c,c.startPTS,c.endPTS,c.startDTS,c.endDTS):f(o,u),_.length&&(u.totalduration=u.edge-_[0].start),u.driftStartTime=o.driftStartTime,u.driftStart=o.driftStart;var F=u.advancedDateTime;if(u.advanced&&F){var L=u.edge;u.driftStart||(u.driftStartTime=F,u.driftStart=L),u.driftEndTime=F,u.driftEnd=L}else u.driftEndTime=o.driftEndTime,u.driftEnd=o.driftEnd,u.advancedDateTime=o.advancedDateTime}function h(o,u,w){if(o&&u)for(var v=0,i=0,k=o.length;i<=k;i++){var D=o[i],c=u[i+v];D&&c&&D.index===c.index&&D.fragment.sn===c.fragment.sn?w(D,c):v--}}function d(o,u,w){for(var v=u.skippedSegments,i=Math.max(o.startSN,u.startSN)-u.startSN,k=(o.fragmentHint?1:0)+(v?u.endSN:Math.min(o.endSN,u.endSN))-u.startSN,D=u.startSN-o.startSN,c=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,b=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,x=i;x<=k;x++){var _=b[D+x],j=c[x];v&&!j&&x<v&&(j=u.fragments[x]=_),_&&j&&w(_,j)}}function f(o,u){var w=u.startSN+u.skippedSegments-o.startSN,v=o.fragments;if(w<0||w>=v.length)return;E(u,v[w].start)}function E(o,u){if(u){for(var w=o.fragments,v=o.skippedSegments;v<w.length;v++)w[v].start+=u;o.fragmentHint&&(o.fragmentHint.start+=u)}}function y(o,u){var w=1e3*o.levelTargetDuration,v=w/2,i=o.age,k=i>0&&i<w*3,D=u.loading.end-u.loading.start,c,b=o.availabilityDelay;if(o.updated===!1)if(k){var x=333*o.misses;c=Math.max(Math.min(v,D*2),x),o.availabilityDelay=(o.availabilityDelay||0)+c}else c=v;else k?(b=Math.min(b||w/2,i),o.availabilityDelay=b,c=b+w-i):c=w-D;return Math.round(c)}function l(o,u,w){if(!o||!o.details)return null;var v=o.details,i=v.fragments[u-v.startSN];return i||(i=v.fragmentHint,i&&i.sn===u?i:u<v.startSN&&w&&w.sn===u?w:null)}function n(o,u,w){if(!o||!o.details)return null;var v=o.details.partList;if(v)for(var i=v.length;i--;){var k=v[i];if(k.index===w&&k.fragment.sn===u)return k}return null}},"./src/controller/stream-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return v});var R=S("./src/polyfills/number.ts"),T=S("./src/controller/base-stream-controller.ts"),g=S("./src/is-supported.ts"),C=S("./src/events.ts"),p=S("./src/utils/buffer-helper.ts"),s=S("./src/controller/fragment-tracker.ts"),a=S("./src/types/loader.ts"),r=S("./src/loader/fragment.ts"),h=S("./src/demux/transmuxer-interface.ts"),d=S("./src/types/transmuxer.ts"),f=S("./src/controller/gap-controller.ts"),E=S("./src/errors.ts"),y=S("./src/utils/logger.ts");function l(i,k){for(var D=0;D<k.length;D++){var c=k[D];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(i,c.key,c)}}function n(i,k,D){return k&&l(i.prototype,k),D&&l(i,D),i}function o(i,k){i.prototype=Object.create(k.prototype),i.prototype.constructor=i,u(i,k)}function u(i,k){return u=Object.setPrototypeOf||function(c,b){return c.__proto__=b,c},u(i,k)}var w=100,v=function(i){o(k,i);function k(c,b){var x;return x=i.call(this,c,b,"[stream-controller]")||this,x.audioCodecSwap=!1,x.gapController=null,x.level=-1,x._forceStartLoad=!1,x.altAudio=!1,x.audioOnly=!1,x.fragPlaying=null,x.onvplaying=null,x.onvseeked=null,x.fragLastKbps=0,x.stalled=!1,x.couldBacktrack=!1,x.audioCodecSwitch=!1,x.videoBuffer=null,x._registerListeners(),x}var D=k.prototype;return D._registerListeners=function(){var b=this.hls;b.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(C.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(C.Events.ERROR,this.onError,this),b.on(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(C.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(C.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},D._unregisterListeners=function(){var b=this.hls;b.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(C.Events.ERROR,this.onError,this),b.off(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(C.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(C.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},D.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},D.startLoad=function(b){if(this.levels){var x=this.lastCurrentTime,_=this.hls;if(this.stopLoad(),this.setInterval(w),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var j=_.startLevel;j===-1&&(_.config.testBandwidth?(j=0,this.bitrateTest=!0):j=_.nextAutoLevel),this.level=_.nextLoadLevel=j,this.loadedmetadata=!1}x>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),b=x),this.state=T.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=T.State.STOPPED},D.stopLoad=function(){this._forceStartLoad=!1,i.prototype.stopLoad.call(this)},D.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_LEVEL:{var b,x=this.levels,_=this.level,j=x==null||((b=x[_])===null||b===void 0)?void 0:b.details;if(j&&(!j.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(j))break;this.state=T.State.IDLE;break}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var F,L=self.performance.now(),X=this.retryDate;(!X||L>=X||(F=this.media)!==null&&F!==void 0&&F.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=T.State.IDLE)}break;default:break}this.onTickEnd()},D.onTickEnd=function(){i.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},D.doTickIdle=function(){var b,x,_=this.hls,j=this.levelLastLoaded,F=this.levels,L=this.media,X=_.config,z=_.nextLoadLevel;if(j===null||!L&&(this.startFragRequested||!X.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!F||!F[z])return;var H=F[z];this.level=_.nextLoadLevel=z;var G=H.details;if(!G||this.state===T.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==z){this.state=T.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:L,a.PlaylistLevelType.MAIN);if(U===null)return;var B=U.len,W=this.getMaxBufferLength(H.maxBitrate);if(B>=W)return;if(this._streamEnded(U,G)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(C.Events.BUFFER_EOS,te),this.state=T.State.ENDED;return}var de=U.end,fe=this.getNextFragment(de,G);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var be=fe.sn-G.startSN;be>1&&(fe=G.fragments[be-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===s.FragmentState.OK&&this.nextLoadPosition>de){var Ce=this.audioOnly&&!this.altAudio?r.ElementaryStreamTypes.AUDIO:r.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(L,Ce,a.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,G)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((b=fe.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((x=fe.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(fe,G):this.loadFragment(fe,G,de)},D.loadFragment=function(b,x,_){var j,F=this.fragmentTracker.getState(b);if(this.fragCurrent=b,F===s.FragmentState.BACKTRACKED){var L=this.fragmentTracker.getBacktrackData(b);if(L){this._handleFragmentLoadProgress(L),this._handleFragmentLoadComplete(L);return}else F=s.FragmentState.NOT_LOADED}F===s.FragmentState.NOT_LOADED||F===s.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,i.prototype.loadFragment.call(this,b,x,_)):F===s.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((j=this.media)===null||j===void 0?void 0:j.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},D.getAppendedFrag=function(b){var x=this.fragmentTracker.getAppendedFrag(b,a.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},D.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,a.PlaylistLevelType.MAIN)},D.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},D.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},D.nextLevelSwitch=function(){var b=this.levels,x=this.media;if(x!=null&&x.readyState){var _,j=this.getAppendedFrag(x.currentTime);if(j&&j.start>1&&this.flushMainBuffer(0,j.start-1),!x.paused&&b){var F=this.hls.nextLoadLevel,L=b[F],X=this.fragLastKbps;X&&this.fragCurrent?_=this.fragCurrent.duration*L.maxBitrate/(1e3*X)+1:_=0}else _=0;var z=this.getBufferedFrag(x.currentTime+_);if(z){var H=this.followingBufferedFrag(z);if(H){this.abortCurrentFrag();var G=H.maxStartPTS?H.maxStartPTS:H.start,U=H.duration,B=Math.max(z.end,G+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(B,Number.POSITIVE_INFINITY)}}}},D.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===T.State.KEY_LOADING&&(this.state=T.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},D.flushMainBuffer=function(b,x){i.prototype.flushMainBuffer.call(this,b,x,this.altAudio?"video":null)},D.onMediaAttached=function(b,x){i.prototype.onMediaAttached.call(this,b,x);var _=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),_.addEventListener("playing",this.onvplaying),_.addEventListener("seeked",this.onvseeked),this.gapController=new f.default(this.config,_,this.fragmentTracker,this.hls)},D.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),i.prototype.onMediaDetaching.call(this)},D.onMediaPlaying=function(){this.tick()},D.onMediaSeeked=function(){var b=this.media,x=b?b.currentTime:null;Object(R.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},D.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(C.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},D.onManifestParsed=function(b,x){var _=!1,j=!1,F;x.levels.forEach(function(L){F=L.audioCodec,F&&(F.indexOf("mp4a.40.2")!==-1&&(_=!0),F.indexOf("mp4a.40.5")!==-1&&(j=!0))}),this.audioCodecSwitch=_&&j&&!Object(g.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},D.onLevelLoading=function(b,x){var _=this.levels;if(!_||this.state!==T.State.IDLE)return;var j=_[x.level];(!j.details||j.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(j.details))&&(this.state=T.State.WAITING_LEVEL)},D.onLevelLoaded=function(b,x){var _,j=this.levels,F=x.level,L=x.details,X=L.totalduration;if(!j){this.warn("Levels were reset while loading level "+F);return}this.log("Level "+F+" loaded ["+L.startSN+","+L.endSN+"], cc ["+L.startCC+", "+L.endCC+"] duration:"+X);var z=this.fragCurrent;z&&(this.state===T.State.FRAG_LOADING||this.state===T.State.FRAG_LOADING_WAITING_RETRY)&&(z.level!==x.level&&z.loader&&(this.state=T.State.IDLE,z.loader.abort()));var H=j[F],G=0;if(L.live||(_=H.details)!==null&&_!==void 0&&_.live){if(L.fragments[0]||(L.deltaUpdateFailed=!0),L.deltaUpdateFailed)return;G=this.alignPlaylists(L,H.details)}if(H.details=L,this.levelLastLoaded=F,this.hls.trigger(C.Events.LEVEL_UPDATED,{details:L,level:F}),this.state===T.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(L))return;this.state=T.State.IDLE}this.startFragRequested?L.live&&this.synchronizeToLiveEdge(L):this.setStartPosition(L,G),this.tick()},D._handleFragmentLoadProgress=function(b){var x,_=b.frag,j=b.part,F=b.payload,L=this.levels;if(!L){this.warn("Levels were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var X=L[_.level],z=X.details;if(!z){this.warn("Dropping fragment "+_.sn+" of level "+_.level+" after level details were reset");return}var H=X.videoCodec,G=z.PTSKnown||!z.live,U=(x=_.initSegment)===null||x===void 0?void 0:x.data,B=this._getAudioCodec(X),W=this.transmuxer=this.transmuxer||new h.default(this.hls,a.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=j?j.index:-1,de=te!==-1,fe=new d.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,F.byteLength,te,de),be=this.initPTS[_.cc];W.push(F,U,B,H,_,j,z.totalduration,G,fe,be)},D.onAudioTrackSwitching=function(b,x){var _=this.altAudio,j=!!x.url,F=x.id;if(!j){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var L=this.fragCurrent;L!=null&&L.loader&&(this.log("Switching to main audio track, cancel main fragment load"),L.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var X=this.hls;_&&X.trigger(C.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),X.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:F})}},D.onAudioTrackSwitched=function(b,x){var _=x.id,j=!!this.hls.audioTracks[_].url;if(j){var F=this.videoBuffer;F&&this.mediaBuffer!==F&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=F)}this.altAudio=j,this.tick()},D.onBufferCreated=function(b,x){var _=x.tracks,j,F,L=!1;for(var X in _){var z=_[X];if(z.id==="main"){if(F=X,j=z,X==="video"){var H=_[X];H&&(this.videoBuffer=H.buffer)}}else L=!0}L&&j?(this.log("Alternate track found, use "+F+".buffered to schedule main fragment loading"),this.mediaBuffer=j.buffer):this.mediaBuffer=this.media},D.onFragBuffered=function(b,x){var _=x.frag,j=x.part;if(_&&_.type!==a.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(j?" p: "+j.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state),this.state===T.State.PARSED&&(this.state=T.State.IDLE);return}var F=j?j.stats:_.stats;this.fragLastKbps=Math.round(8*F.total/(F.buffering.end-F.loading.first)),_.sn!=="initSegment"&&(this.fragPrevious=_),this.fragBufferedComplete(_,j)},D.onError=function(b,x){switch(x.details){case E.ErrorDetails.FRAG_LOAD_ERROR:case E.ErrorDetails.FRAG_LOAD_TIMEOUT:case E.ErrorDetails.KEY_LOAD_ERROR:case E.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(a.PlaylistLevelType.MAIN,x);break;case E.ErrorDetails.LEVEL_LOAD_ERROR:case E.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==T.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=T.State.ERROR):!x.levelRetry&&this.state===T.State.WAITING_LEVEL&&(this.state=T.State.IDLE));break;case E.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var _=!0,j=this.getFwdBufferInfo(this.media,a.PlaylistLevelType.MAIN);j&&j.len>.5&&(_=!this.reduceMaxBufferLength(j.len)),_&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},D.checkBuffer=function(){var b=this.media,x=this.gapController;if(!b||!x||!b.readyState)return;var _=p.BufferHelper.getBuffered(b);!this.loadedmetadata&&_.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},D.onFragLoadEmergencyAborted=function(){this.state=T.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},D.onBufferFlushed=function(b,x){var _=x.type;if(_!==r.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var j=(_===r.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(j,_,a.PlaylistLevelType.MAIN)}},D.onLevelsUpdated=function(b,x){this.levels=x.levels},D.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},D.seekToStartPos=function(){var b=this.media,x=b.currentTime,_=this.startPosition;if(_>=0&&x<_){if(b.seeking){y.logger.log("could not seek to "+_+", already seeking at "+x);return}var j=p.BufferHelper.getBuffered(b),F=j.length?j.start(0):0,L=F-_;L>0&&(L<this.config.maxBufferHole||L<this.config.maxFragLookUpTolerance)&&(y.logger.log("adjusting start position by "+L+" to match buffer start"),_+=L,this.startPosition=_),this.log("seek to target start position "+_+" from current time "+x),b.currentTime=_}},D._getAudioCodec=function(b){var x=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&x&&(this.log("Swapping audio codec"),x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),x},D._loadBitrateTestFrag=function(b){var x=this;this._doFragLoad(b).then(function(_){var j=x.hls;if(!_||j.nextLoadLevel||x.fragContextChanged(b))return;x.fragLoadError=0,x.state=T.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var F=b.stats;F.parsing.start=F.parsing.end=F.buffering.start=F.buffering.end=self.performance.now(),j.trigger(C.Events.FRAG_LOADED,_)})},D._handleTransmuxComplete=function(b){var x,_="main",j=this.hls,F=b.remuxResult,L=b.chunkMeta,X=this.getCurrentContext(L);if(!X){this.warn("The loading context changed while buffering fragment "+L.sn+" of level "+L.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(L.level);return}var z=X.frag,H=X.part,G=X.level,U=F.video,B=F.text,W=F.id3,te=F.initSegment,de=this.altAudio?void 0:F.audio;if(this.fragContextChanged(z))return;if(this.state=T.State.PARSING,te){te.tracks&&(this._bufferInitSegment(G,te.tracks,z,L),j.trigger(C.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:_,tracks:te.tracks}));var fe=te.initPTS,be=te.timescale;Object(R.isFiniteNumber)(fe)&&(this.initPTS[z.cc]=fe,j.trigger(C.Events.INIT_PTS_FOUND,{frag:z,id:_,initPTS:fe,timescale:be}))}if(U&&F.independent!==!1){if(G.details){var Ce=U.startPTS,ue=U.endPTS,ge=U.startDTS,pe=U.endDTS;if(H)H.elementaryStreams[U.type]={startPTS:Ce,endPTS:ue,startDTS:ge,endDTS:pe};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var oe=this.getLoadPosition()+this.config.maxBufferHole;if(oe<Ce){this.backtrack(z);return}z.setElementaryStreamInfo(U.type,z.start,ue,z.start,pe,!0)}z.setElementaryStreamInfo(U.type,Ce,ue,ge,pe),this.bufferFragmentData(U,z,H,L)}}else if(F.independent===!1){this.backtrack(z);return}if(de){var ae=de.startPTS,re=de.endPTS,he=de.startDTS,Q=de.endDTS;H&&(H.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:re,startDTS:he,endDTS:Q}),z.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,ae,re,he,Q),this.bufferFragmentData(de,z,H,L)}if(W!=null&&(x=W.samples)!==null&&x!==void 0&&x.length){var ie={frag:z,id:_,samples:W.samples};j.trigger(C.Events.FRAG_PARSING_METADATA,ie)}if(B){var we={frag:z,id:_,samples:B.samples};j.trigger(C.Events.FRAG_PARSING_USERDATA,we)}},D._bufferInitSegment=function(b,x,_,j){var F=this;if(this.state!==T.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var L=x.audio,X=x.video,z=x.audiovideo;if(L){var H=b.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(H&&(H.indexOf("mp4a.40.5")!==-1?H="mp4a.40.2":H="mp4a.40.5"),L.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(H="mp4a.40.5")),G.indexOf("android")!==-1&&L.container!=="audio/mpeg"&&(H="mp4a.40.2",this.log("Android: force audio codec to "+H)),b.audioCodec&&b.audioCodec!==H&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+H+'"'),L.levelCodec=H,L.id="main",this.log("Init audio buffer, container:"+L.container+", codecs[selected/level/parsed]=["+(H||"")+"/"+(b.audioCodec||"")+"/"+L.codec+"]")}X&&(X.levelCodec=b.videoCodec,X.id="main",this.log("Init video buffer, container:"+X.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+X.codec+"]")),z&&this.log("Init audiovideo buffer, container:"+z.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+z.codec+"]"),this.hls.trigger(C.Events.BUFFER_CODECS,x),Object.keys(x).forEach(function(U){var B=x[U],W=B.initSegment;W!=null&&W.byteLength&&F.hls.trigger(C.Events.BUFFER_APPENDING,{type:U,data:W,frag:_,part:null,chunkMeta:j,parent:_.type})}),this.tick()},D.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var x=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,x?this.resetFragmentLoading(b):this.state=T.State.BACKTRACKING},D.checkFragmentChanged=function(){var b=this.media,x=null;if(b&&b.readyState>1&&b.seeking===!1){var _=b.currentTime;if(p.BufferHelper.isBuffered(b,_)?x=this.getAppendedFrag(_):p.BufferHelper.isBuffered(b,_+.1)&&(x=this.getAppendedFrag(_+.1)),x){var j=this.fragPlaying,F=x.level;(!j||x.sn!==j.sn||j.level!==F||x.urlId!==j.urlId)&&(this.hls.trigger(C.Events.FRAG_CHANGED,{frag:x}),(!j||j.level!==F)&&this.hls.trigger(C.Events.LEVEL_SWITCHED,{level:F}),this.fragPlaying=x)}}},n(k,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var x=this.getAppendedFrag(b.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var x=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),k}(T.default)},"./src/controller/subtitle-stream-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"SubtitleStreamController",function(){return o});var R=S("./src/events.ts"),T=S("./src/utils/logger.ts"),g=S("./src/utils/buffer-helper.ts"),C=S("./src/controller/fragment-finders.ts"),p=S("./src/utils/discontinuities.ts"),s=S("./src/controller/level-helper.ts"),a=S("./src/controller/fragment-tracker.ts"),r=S("./src/controller/base-stream-controller.ts"),h=S("./src/types/loader.ts"),d=S("./src/types/level.ts");function f(u,w){for(var v=0;v<w.length;v++){var i=w[v];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function E(u,w,v){return w&&f(u.prototype,w),v&&f(u,v),u}function y(u,w){u.prototype=Object.create(w.prototype),u.prototype.constructor=u,l(u,w)}function l(u,w){return l=Object.setPrototypeOf||function(i,k){return i.__proto__=k,i},l(u,w)}var n=500,o=function(u){y(w,u);function w(i,k){var D;return D=u.call(this,i,k,"[subtitle-stream-controller]")||this,D.levels=[],D.currentTrackId=-1,D.tracksBuffered=[],D.mainDetails=null,D._registerListeners(),D}var v=w.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var k=this.hls;k.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.on(R.Events.ERROR,this.onError,this),k.on(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),k.on(R.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),k.on(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),k.on(R.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),k.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v._unregisterListeners=function(){var k=this.hls;k.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),k.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),k.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),k.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),k.off(R.Events.ERROR,this.onError,this),k.off(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),k.off(R.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),k.off(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),k.off(R.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),k.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v.startLoad=function(){this.stopLoad(),this.state=r.State.IDLE,this.setInterval(n),this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},v.onLevelLoaded=function(k,D){this.mainDetails=D.details},v.onSubtitleFragProcessed=function(k,D){var c=D.frag,b=D.success;if(this.fragPrevious=c,this.state=r.State.IDLE,!b)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var _,j=c.start,F=0;F<x.length;F++)if(j>=x[F].start&&j<=x[F].end){_=x[F];break}var L=c.start+c.duration;_?_.end=L:(_={start:j,end:L},x.push(_)),this.fragmentTracker.fragBuffered(c)},v.onBufferFlushing=function(k,D){var c=D.startOffset,b=D.endOffset;if(c===0&&b!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,_=this.levels;if(!_.length||!_[x]||!_[x].details)return;var j=_[x].details,F=j.targetduration,L=b-F;if(L<=0)return;D.endOffsetSubtitles=Math.max(0,L),this.tracksBuffered.forEach(function(X){for(var z=0;z<X.length;){if(X[z].end<=L){X.shift();continue}else if(X[z].start<L)X[z].start=L;else break;z++}}),this.fragmentTracker.removeFragmentsInRange(c,L,h.PlaylistLevelType.SUBTITLE)}},v.onError=function(k,D){var c,b=D.frag;if(!b||b.type!==h.PlaylistLevelType.SUBTITLE)return;(c=this.fragCurrent)!==null&&c!==void 0&&c.loader&&this.fragCurrent.loader.abort(),this.state=r.State.IDLE},v.onSubtitleTracksUpdated=function(k,D){var c=this,b=D.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(x){return new d.Level(x)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(x){c.tracksBuffered[x.id]=[]}),this.mediaBuffer=null},v.onSubtitleTrackSwitch=function(k,D){if(this.currentTrackId=D.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var c=this.levels[this.currentTrackId];c!=null&&c.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,c&&this.setInterval(n)},v.onSubtitleTrackLoaded=function(k,D){var c,b=D.details,x=D.id,_=this.currentTrackId,j=this.levels;if(!j.length)return;var F=j[_];if(x>=j.length||x!==_||!F)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(c=F.details)!==null&&c!==void 0&&c.live){var L=this.mainDetails;if(b.deltaUpdateFailed||!L)return;var X=L.fragments[0];if(!F.details)b.hasProgramDateTime&&L.hasProgramDateTime?Object(p.alignMediaPlaylistByPDT)(b,L):X&&Object(s.addSliding)(b,X.start);else{var z=this.alignPlaylists(b,F.details);z===0&&X&&Object(s.addSliding)(b,X.start)}}if(F.details=b,this.levelLastLoaded=x,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===r.State.IDLE){var H=Object(C.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);H||(this.warn("Subtitle playlist not aligned with playback"),F.details=void 0)}},v._handleFragmentLoadComplete=function(k){var D=k.frag,c=k.payload,b=D.decryptdata,x=this.hls;if(this.fragContextChanged(D))return;if(c&&c.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var _=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(c),b.key.buffer,b.iv.buffer).then(function(j){var F=performance.now();x.trigger(R.Events.FRAG_DECRYPTED,{frag:D,payload:j,stats:{tstart:_,tdecrypt:F}})})}},v.doTick=function(){if(!this.media){this.state=r.State.IDLE;return}if(this.state===r.State.IDLE){var k,D=this.currentTrackId,c=this.levels;if(!c.length||!c[D]||!c[D].details)return;var b=c[D].details,x=b.targetduration,_=this.config,j=this.media,F=g.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,j.currentTime-x,_.maxBufferHole),L=F.end,X=F.len,z=this.getMaxBufferLength()+x;if(X>z)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var H=b.fragments,G=H.length,U=b.edge,B,W=this.fragPrevious;if(L<U){var te=_.maxFragLookUpTolerance;W&&b.hasProgramDateTime&&(B=Object(C.findFragmentByPDT)(H,W.endProgramDateTime,te)),B||(B=Object(C.findFragmentByPTS)(W,H,L,te),!B&&W&&W.start<H[0].start&&(B=H[0]))}else B=H[G-1];(k=B)!==null&&k!==void 0&&k.encrypted?(T.logger.log("Loading key for "+B.sn),this.state=r.State.KEY_LOADING,this.hls.trigger(R.Events.KEY_LOADING,{frag:B})):B&&this.fragmentTracker.getState(B)===a.FragmentState.NOT_LOADED&&this.loadFragment(B,b,L)}},v.loadFragment=function(k,D,c){this.fragCurrent=k,u.prototype.loadFragment.call(this,k,D,c)},E(w,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),w}(r.default)},"./src/controller/subtitle-track-controller.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/events.ts"),T=S("./src/utils/texttrack-utils.ts"),g=S("./src/controller/base-playlist-controller.ts"),C=S("./src/types/loader.ts");function p(f,E){for(var y=0;y<E.length;y++){var l=E[y];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,l.key,l)}}function s(f,E,y){return E&&p(f.prototype,E),y&&p(f,y),f}function a(f,E){f.prototype=Object.create(E.prototype),f.prototype.constructor=f,r(f,E)}function r(f,E){return r=Object.setPrototypeOf||function(l,n){return l.__proto__=n,l},r(f,E)}var h=function(f){a(E,f);function E(l){var n;return n=f.call(this,l,"[subtitle-track-controller]")||this,n.media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}var y=E.prototype;return y.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,f.prototype.destroy.call(this)},y.registerListeners=function(){var n=this.hls;n.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(R.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){var n=this.hls;n.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(R.Events.ERROR,this.onError,this)},y.onMediaAttached=function(n,o){if(this.media=o.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},y.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},y.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var n=d(this.media.textTracks);n.forEach(function(o){Object(T.clearCurrentCues)(o)}),this.subtitleTrack=-1,this.media=null},y.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},y.onManifestParsed=function(n,o){this.tracks=o.subtitleTracks},y.onSubtitleTrackLoaded=function(n,o){var u=o.id,w=o.details,v=this.trackId,i=this.tracksInGroup[v];if(!i){this.warn("Invalid subtitle track id "+u);return}var k=i.details;i.details=o.details,this.log("subtitle track "+u+" loaded ["+w.startSN+"-"+w.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,o,k))},y.onLevelLoading=function(n,o){this.switchLevel(o.level)},y.onLevelSwitching=function(n,o){this.switchLevel(o.level)},y.switchLevel=function(n){var o=this.hls.levels[n];if(!(o!=null&&o.textGroupIds))return;var u=o.textGroupIds[o.urlId];if(this.groupId!==u){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(D){return!u||D.groupId===u});this.tracksInGroup=v;var i=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=u;var k={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(R.Events.SUBTITLE_TRACKS_UPDATED,k),i!==-1&&this.setSubtitleTrack(i,w)}},y.findTrackId=function(n){for(var o=this.tracksInGroup,u=0;u<o.length;u++){var w=o[u];if((!this.selectDefaultTrack||w.default)&&(!n||n===w.name))return w.id}return-1},y.onError=function(n,o){if(f.prototype.onError.call(this,n,o),o.fatal||!o.context)return;o.context.type===C.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},y.loadPlaylist=function(n){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var u=o.id,w=o.groupId,v=o.url;if(n)try{v=n.addDirectives(v)}catch(i){this.warn("Could not construct new URL with HLS Delivery Directives: "+i)}this.log("Loading subtitle playlist for id "+u),this.hls.trigger(R.Events.SUBTITLE_TRACK_LOADING,{url:v,id:u,groupId:w,deliveryDirectives:n||null})}},y.toggleTrackModes=function(n){var o=this,u=this.media,w=this.subtitleDisplay,v=this.trackId;if(!u)return;var i=d(u.textTracks),k=i.filter(function(b){return b.groupId===o.groupId});if(n===-1)[].slice.call(i).forEach(function(b){b.mode="disabled"});else{var D=k[v];D&&(D.mode="disabled")}var c=k[n];c&&(c.mode=w?"showing":"hidden")},y.setSubtitleTrack=function(n,o){var u,w=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(u=w[n])!==null&&u!==void 0&&u.details)||n<-1||n>=w.length)return;this.clearTimer();var v=w[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,v){var i=v.id,k=v.groupId,D=k===void 0?"":k,c=v.name,b=v.type,x=v.url;this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:i,groupId:D,name:c,type:b,url:x});var _=this.switchParams(v.url,o==null?void 0:o.details);this.loadPlaylist(_)}else this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:n})},y.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,o=d(this.media.textTracks),u=0;u<o.length;u++)if(o[u].mode==="hidden")n=u;else if(o[u].mode==="showing"){n=u;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},s(E,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,o)}}]),E}(g.default);function d(f){for(var E=[],y=0;y<f.length;y++){var l=f[y];l.kind==="subtitles"&&l.label&&E.push(f[y])}return E}m.default=h},"./src/controller/timeline-controller.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"TimelineController",function(){return d});var R=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),g=S("./src/utils/cea-608-parser.ts"),C=S("./src/utils/output-filter.ts"),p=S("./src/utils/webvtt-parser.ts"),s=S("./src/utils/texttrack-utils.ts"),a=S("./src/utils/imsc1-ttml-parser.ts"),r=S("./src/types/loader.ts"),h=S("./src/utils/logger.ts"),d=function(){function l(o){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=y(),this.captionsProperties=void 0,this.hls=o,this.config=o.config,this.Cues=o.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var u=new C.default(this,"textTrack1"),w=new C.default(this,"textTrack2"),v=new C.default(this,"textTrack3"),i=new C.default(this,"textTrack4");this.cea608Parser1=new g.default(1,u,w),this.cea608Parser2=new g.default(3,v,i)}o.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(T.Events.FRAG_LOADING,this.onFragLoading,this),o.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=l.prototype;return n.destroy=function(){var u=this.hls;u.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.off(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.off(T.Events.FRAG_LOADING,this.onFragLoading,this),u.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.off(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.off(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(u,w,v,i,k){for(var D=!1,c=k.length;c--;){var b=k[c],x=E(b[0],b[1],w,v);if(x>=0&&(b[0]=Math.min(b[0],w),b[1]=Math.max(b[1],v),D=!0,x/(v-w)>.5))return}if(D||k.push([w,v]),this.config.renderTextTracksNatively){var _=this.captionsTracks[u];this.Cues.newCue(_,w,v,i)}else{var j=this.Cues.newCue(null,w,v,i);this.hls.trigger(T.Events.CUES_PARSED,{type:"captions",cues:j,track:u})}},n.onInitPtsFound=function(u,w){var v=this,i=w.frag,k=w.id,D=w.initPTS,c=w.timescale,b=this.unparsedVttFrags;k==="main"&&(this.initPTS[i.cc]=D,this.timescale[i.cc]=c),b.length&&(this.unparsedVttFrags=[],b.forEach(function(x){v.onFragLoaded(T.Events.FRAG_LOADED,x)}))},n.getExistingTrack=function(u){var w=this.media;if(w)for(var v=0;v<w.textTracks.length;v++){var i=w.textTracks[v];if(i[u])return i}return null},n.createCaptionsTrack=function(u){this.config.renderTextTracksNatively?this.createNativeTrack(u):this.createNonNativeTrack(u)},n.createNativeTrack=function(u){if(this.captionsTracks[u])return;var w=this.captionsProperties,v=this.captionsTracks,i=this.media,k=w[u],D=k.label,c=k.languageCode,b=this.getExistingTrack(u);if(b)v[u]=b,Object(s.clearCurrentCues)(v[u]),Object(s.sendAddTrackEvent)(v[u],i);else{var x=this.createTextTrack("captions",D,c);x&&(x[u]=!0,v[u]=x)}},n.createNonNativeTrack=function(u){if(this.nonNativeCaptionsTracks[u])return;var w=this.captionsProperties[u];if(!w)return;var v=w.label,i={_id:u,label:v,kind:"captions",default:w.media?!!w.media.default:!1,closedCaptions:w.media};this.nonNativeCaptionsTracks[u]=i,this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})},n.createTextTrack=function(u,w,v){var i=this.media;return i?i.addTextTrack(u,w,v):void 0},n.onMediaAttaching=function(u,w){this.media=w.media,this._cleanTracks()},n.onMediaDetaching=function(){var u=this.captionsTracks;Object.keys(u).forEach(function(w){Object(s.clearCurrentCues)(u[w]),delete u[w]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=y(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},n._cleanTracks=function(){var u=this.media;if(!u)return;var w=u.textTracks;if(w)for(var v=0;v<w.length;v++)Object(s.clearCurrentCues)(w[v])},n.onSubtitleTracksUpdated=function(u,w){var v=this;this.textTracks=[];var i=w.subtitleTracks||[],k=i.some(function(x){return x.textCodec===a.IMSC1_CODEC});if(this.config.enableWebVTT||k&&this.config.enableIMSC1){var D=this.tracks&&i&&this.tracks.length===i.length;if(this.tracks=i||[],this.config.renderTextTracksNatively){var c=this.media?this.media.textTracks:[];this.tracks.forEach(function(x,_){var j;if(_<c.length){for(var F=null,L=0;L<c.length;L++)if(f(c[L],x)){F=c[L];break}F&&(j=F)}j?Object(s.clearCurrentCues)(j):(j=v.createTextTrack("subtitles",x.name,x.lang),j&&(j.mode="disabled")),j&&(j.groupId=x.groupId,v.textTracks.push(j))})}else if(!D&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},n.onManifestLoaded=function(u,w){var v=this;this.config.enableCEA708Captions&&w.captions&&w.captions.forEach(function(i){var k=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!k)return;var D="textTrack"+k[1],c=v.captionsProperties[D];if(!c)return;c.label=i.name,i.lang&&(c.languageCode=i.lang),c.media=i})},n.onFragLoading=function(u,w){var v=this.cea608Parser1,i=this.cea608Parser2,k=this.lastSn,D=this.lastPartIndex;if(!this.enabled||!(v&&i))return;if(w.frag.type===r.PlaylistLevelType.MAIN){var c,b,x=w.frag.sn,_=(c=w==null||((b=w.part)===null||b===void 0)?void 0:b.index)!=null?c:-1;x===k+1||x===k&&_===D+1||(v.reset(),i.reset()),this.lastSn=x,this.lastPartIndex=_}},n.onFragLoaded=function(u,w){var v=w.frag,i=w.payload,k=this.initPTS,D=this.unparsedVttFrags;if(v.type===r.PlaylistLevelType.SUBTITLE)if(i.byteLength){if(!Object(R.isFiniteNumber)(k[v.cc])){D.push(w),k.length&&this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Missing initial subtitle PTS")});return}var c=v.decryptdata;if(c==null||c.key==null||c.method!=="AES-128"){var b=this.tracks[v.level],x=this.vttCCs;x[v.cc]||(x[v.cc]={start:v.start,prevCC:this.prevCC,new:!0},this.prevCC=v.cc),b&&b.textCodec===a.IMSC1_CODEC?this._parseIMSC1(v,i):this._parseVTTs(v,i,x)}}else this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(u,w){var v=this,i=this.hls;Object(a.parseIMSC1)(w,this.initPTS[u.cc],this.timescale[u.cc],function(k){v._appendCues(k,u.level),i.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(k){h.logger.log("Failed to parse IMSC1: "+k),i.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:k})})},n._parseVTTs=function(u,w,v){var i=this,k=this.hls;Object(p.parseWebVTT)(w,this.initPTS[u.cc],this.timescale[u.cc],v,u.cc,u.start,function(D){i._appendCues(D,u.level),k.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(D){i._fallbackToIMSC1(u,w),h.logger.log("Failed to parse VTT cue: "+D),k.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:D})})},n._fallbackToIMSC1=function(u,w){var v=this,i=this.tracks[u.level];i.textCodec||Object(a.parseIMSC1)(w,this.initPTS[u.cc],this.timescale[u.cc],function(){i.textCodec=a.IMSC1_CODEC,v._parseIMSC1(u,w)},function(){i.textCodec="wvtt"})},n._appendCues=function(u,w){var v=this.hls;if(this.config.renderTextTracksNatively){var i=this.textTracks[w];if(i.mode==="disabled")return;u.forEach(function(c){return Object(s.addCueToTrack)(i,c)})}else{var k=this.tracks[w],D=k.default?"default":"subtitles"+w;v.trigger(T.Events.CUES_PARSED,{type:"subtitles",cues:u,track:D})}},n.onFragDecrypted=function(u,w){var v=w.frag;if(v.type===r.PlaylistLevelType.SUBTITLE){if(!Object(R.isFiniteNumber)(this.initPTS[v.cc])){this.unparsedVttFrags.push(w);return}this.onFragLoaded(T.Events.FRAG_LOADED,w)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(u,w){var v=this.cea608Parser1,i=this.cea608Parser2;if(!this.enabled||!(v&&i))return;for(var k=0;k<w.samples.length;k++){var D=w.samples[k].bytes;if(D){var c=this.extractCea608Data(D);v.addData(w.samples[k].pts,c[0]),i.addData(w.samples[k].pts,c[1])}}},n.onBufferFlushing=function(u,w){var v=w.startOffset,i=w.endOffset,k=w.endOffsetSubtitles,D=w.type,c=this.media;if(!c||c.currentTime<i)return;if(!D||D==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(_){return Object(s.removeCuesInRange)(b[_],v,i)})}if(this.config.renderTextTracksNatively&&(v===0&&k!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(_){return Object(s.removeCuesInRange)(x[_],v,k)})}},n.extractCea608Data=function(u){for(var w=u[0]&31,v=2,i=[[],[]],k=0;k<w;k++){var D=u[v++],c=127&u[v++],b=127&u[v++],x=(4&D)!==0,_=3&D;if(c===0&&b===0)continue;x&&((_===0||_===1)&&(i[_].push(c),i[_].push(b)))}return i},l}();function f(l,n){return l&&l.label===n.name&&!(l.textTrack1||l.textTrack2)}function E(l,n,o,u){return Math.min(n,u)-Math.max(l,o)}function y(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return R});var R=function(){function T(C,p){this.subtle=void 0,this.aesIV=void 0,this.subtle=C,this.aesIV=p}var g=T.prototype;return g.decrypt=function(p,s){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},s,p)},T}()},"./src/crypt/aes-decryptor.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"removePadding",function(){return T}),S.d(m,"default",function(){return g});var R=S("./src/utils/typed-array.ts");function T(C){var p=C.byteLength,s=p&&new DataView(C.buffer).getUint8(p-1);return s?Object(R.sliceUint8)(C,0,p-s):C}var g=function(){function C(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var p=C.prototype;return p.uint8ArrayToUint32Array_=function(a){for(var r=new DataView(a),h=new Uint32Array(4),d=0;d<4;d++)h[d]=r.getUint32(d*4);return h},p.initTable=function(){var a=this.sBox,r=this.invSBox,h=this.subMix,d=h[0],f=h[1],E=h[2],y=h[3],l=this.invSubMix,n=l[0],o=l[1],u=l[2],w=l[3],v=new Uint32Array(256),i=0,k=0,D=0;for(D=0;D<256;D++)D<128?v[D]=D<<1:v[D]=D<<1^283;for(D=0;D<256;D++){var c=k^k<<1^k<<2^k<<3^k<<4;c=c>>>8^c&255^99,a[i]=c,r[c]=i;var b=v[i],x=v[b],_=v[x],j=v[c]*257^c*16843008;d[i]=j<<24|j>>>8,f[i]=j<<16|j>>>16,E[i]=j<<8|j>>>24,y[i]=j,j=_*16843009^x*65537^b*257^i*16843008,n[c]=j<<24|j>>>8,o[c]=j<<16|j>>>16,u[c]=j<<8|j>>>24,w[c]=j,i?(i=b^v[v[v[_^b]]],k^=v[v[k]]):i=k=1}},p.expandKey=function(a){for(var r=this.uint8ArrayToUint32Array_(a),h=!0,d=0;d<r.length&&h;)h=r[d]===this.key[d],d++;if(h)return;this.key=r;var f=this.keySize=r.length;if(f!==4&&f!==6&&f!==8)throw new Error("Invalid aes key size="+f);var E=this.ksRows=(f+6+1)*4,y,l,n=this.keySchedule=new Uint32Array(E),o=this.invKeySchedule=new Uint32Array(E),u=this.sBox,w=this.rcon,v=this.invSubMix,i=v[0],k=v[1],D=v[2],c=v[3],b,x;for(y=0;y<E;y++){if(y<f){b=n[y]=r[y];continue}x=b,y%f===0?(x=x<<8|x>>>24,x=u[x>>>24]<<24|u[x>>>16&255]<<16|u[x>>>8&255]<<8|u[x&255],x^=w[y/f|0]<<24):f>6&&y%f===4&&(x=u[x>>>24]<<24|u[x>>>16&255]<<16|u[x>>>8&255]<<8|u[x&255]),n[y]=b=(n[y-f]^x)>>>0}for(l=0;l<E;l++)y=E-l,l&3?x=n[y]:x=n[y-4],l<4||y<=4?o[l]=x:o[l]=i[u[x>>>24]]^k[u[x>>>16&255]]^D[u[x>>>8&255]]^c[u[x&255]],o[l]=o[l]>>>0},p.networkToHostOrderSwap=function(a){return a<<24|(a&65280)<<8|(a&16711680)>>8|a>>>24},p.decrypt=function(a,r,h){for(var d=this.keySize+6,f=this.invKeySchedule,E=this.invSBox,y=this.invSubMix,l=y[0],n=y[1],o=y[2],u=y[3],w=this.uint8ArrayToUint32Array_(h),v=w[0],i=w[1],k=w[2],D=w[3],c=new Int32Array(a),b=new Int32Array(c.length),x,_,j,F,L,X,z,H,G,U,B,W,te,de,fe=this.networkToHostOrderSwap;r<c.length;){for(G=fe(c[r]),U=fe(c[r+1]),B=fe(c[r+2]),W=fe(c[r+3]),L=G^f[0],X=W^f[1],z=B^f[2],H=U^f[3],te=4,de=1;de<d;de++)x=l[L>>>24]^n[X>>16&255]^o[z>>8&255]^u[H&255]^f[te],_=l[X>>>24]^n[z>>16&255]^o[H>>8&255]^u[L&255]^f[te+1],j=l[z>>>24]^n[H>>16&255]^o[L>>8&255]^u[X&255]^f[te+2],F=l[H>>>24]^n[L>>16&255]^o[X>>8&255]^u[z&255]^f[te+3],L=x,X=_,z=j,H=F,te=te+4;x=E[L>>>24]<<24^E[X>>16&255]<<16^E[z>>8&255]<<8^E[H&255]^f[te],_=E[X>>>24]<<24^E[z>>16&255]<<16^E[H>>8&255]<<8^E[L&255]^f[te+1],j=E[z>>>24]<<24^E[H>>16&255]<<16^E[L>>8&255]<<8^E[X&255]^f[te+2],F=E[H>>>24]<<24^E[L>>16&255]<<16^E[X>>8&255]<<8^E[z&255]^f[te+3],b[r]=fe(x^v),b[r+1]=fe(F^i),b[r+2]=fe(j^k),b[r+3]=fe(_^D),v=G,i=U,k=B,D=W,r=r+4}return b.buffer},C}()},"./src/crypt/decrypter.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return r});var R=S("./src/crypt/aes-crypto.ts"),T=S("./src/crypt/fast-aes-key.ts"),g=S("./src/crypt/aes-decryptor.ts"),C=S("./src/utils/logger.ts"),p=S("./src/utils/mp4-tools.ts"),s=S("./src/utils/typed-array.ts"),a=16,r=function(){function h(f,E,y){var l=y===void 0?{}:y,n=l.removePKCS7Padding,o=n===void 0?!0:n;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=f,this.config=E,this.removePKCS7Padding=o,o)try{var u=self.crypto;u&&(this.subtle=u.subtle||u.webkitSubtle)}catch(w){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var d=h.prototype;return d.destroy=function(){this.observer=null},d.isSync=function(){return this.config.enableSoftwareAES},d.flush=function(){var E=this.currentResult;if(!E){this.reset();return}var y=new Uint8Array(E);return this.reset(),this.removePKCS7Padding?Object(g.removePadding)(y):y},d.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},d.decrypt=function(E,y,l,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(E),y,l);var o=this.flush();o&&n(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(E),y,l).then(n)},d.softwareDecrypt=function(E,y,l){var n=this.currentIV,o=this.currentResult,u=this.remainderData;this.logOnce("JS AES decrypt"),u&&(E=Object(p.appendUint8Array)(u,E),this.remainderData=null);var w=this.getValidChunk(E);if(!w.length)return null;n&&(l=n);var v=this.softwareDecrypter;v||(v=this.softwareDecrypter=new g.default),v.expandKey(y);var i=o;return this.currentResult=v.decrypt(w.buffer,0,l),this.currentIV=Object(s.sliceUint8)(w,-16).buffer,i||null},d.webCryptoDecrypt=function(E,y,l){var n=this,o=this.subtle;return(this.key!==y||!this.fastAesKey)&&(this.key=y,this.fastAesKey=new T.default(o,y)),this.fastAesKey.expandKey().then(function(u){if(!o)return Promise.reject(new Error("web crypto not initialized"));var w=new R.default(o,l);return w.decrypt(E.buffer,u)}).catch(function(u){return n.onWebCryptoError(u,E,y,l)})},d.onWebCryptoError=function(E,y,l,n){return C.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",E),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(y,l,n)},d.getValidChunk=function(E){var y=E,l=E.length-E.length%a;return l!==E.length&&(y=Object(s.sliceUint8)(E,0,l),this.remainderData=Object(s.sliceUint8)(E,l)),y},d.logOnce=function(E){if(!this.logEnabled)return;C.logger.log("[decrypter.ts]: "+E),this.logEnabled=!1},h}()},"./src/crypt/fast-aes-key.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return R});var R=function(){function T(C,p){this.subtle=void 0,this.key=void 0,this.subtle=C,this.key=p}var g=T.prototype;return g.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},T}()},"./src/demux/aacdemuxer.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/demux/base-audio-demuxer.ts"),T=S("./src/demux/adts.ts"),g=S("./src/utils/logger.ts"),C=S("./src/demux/id3.ts");function p(r,h){r.prototype=Object.create(h.prototype),r.prototype.constructor=r,s(r,h)}function s(r,h){return s=Object.setPrototypeOf||function(f,E){return f.__proto__=E,f},s(r,h)}var a=function(r){p(h,r);function h(f,E){var y;return y=r.call(this)||this,y.observer=void 0,y.config=void 0,y.observer=f,y.config=E,y}var d=h.prototype;return d.resetInitSegment=function(E,y,l){r.prototype.resetInitSegment.call(this,E,y,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:E,duration:l,inputTimeScale:9e4,dropped:0}},h.probe=function(E){if(!E)return!1;for(var y=C.getID3Data(E,0)||[],l=y.length,n=E.length;l<n;l++)if(T.probe(E,l))return g.logger.log("ADTS sync word found !"),!0;return!1},d.canParse=function(E,y){return T.canParse(E,y)},d.appendFrame=function(E,y,l){T.initTrackConfig(E,this.observer,y,l,E.manifestCodec);var n=T.appendFrame(E,y,l,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},h}(R.default);a.minProbeByteLength=9,m.default=a},"./src/demux/adts.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"getAudioConfig",function(){return C}),S.d(m,"isHeaderPattern",function(){return p}),S.d(m,"getHeaderLength",function(){return s}),S.d(m,"getFullFrameLength",function(){return a}),S.d(m,"canGetFrameLength",function(){return r}),S.d(m,"isHeader",function(){return h}),S.d(m,"canParse",function(){return d}),S.d(m,"probe",function(){return f}),S.d(m,"initTrackConfig",function(){return E}),S.d(m,"getFrameDuration",function(){return y}),S.d(m,"parseFrameHeader",function(){return l}),S.d(m,"appendFrame",function(){return n});var R=S("./src/utils/logger.ts"),T=S("./src/errors.ts"),g=S("./src/events.ts");function C(o,u,w,v){var i,k,D,c,b=navigator.userAgent.toLowerCase(),x=v,_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((u[w+2]&192)>>>6)+1;var j=(u[w+2]&60)>>>2;if(j>_.length-1){o.trigger(g.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+j});return}return D=(u[w+2]&1)<<2,D|=(u[w+3]&192)>>>6,R.logger.log("manifest codec:"+v+", ADTS type:"+i+", samplingIndex:"+j),/firefox/i.test(b)?j>=6?(i=5,c=new Array(4),k=j-3):(i=2,c=new Array(2),k=j):b.indexOf("android")!==-1?(i=2,c=new Array(2),k=j):(i=5,c=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&j>=6?k=j-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(j>=6&&D===1||/vivaldi/i.test(b))||!v&&D===1)&&(i=2,c=new Array(2)),k=j)),c[0]=i<<3,c[0]|=(j&14)>>1,c[1]|=(j&1)<<7,c[1]|=D<<3,i===5&&(c[1]|=(k&14)>>1,c[2]=(k&1)<<7,c[2]|=2<<2,c[3]=0),{config:c,samplerate:_[j],channelCount:D,codec:"mp4a.40."+i,manifestCodec:x}}function p(o,u){return o[u]===255&&(o[u+1]&246)===240}function s(o,u){return o[u+1]&1?7:9}function a(o,u){return(o[u+3]&3)<<11|o[u+4]<<3|(o[u+5]&224)>>>5}function r(o,u){return u+5<o.length}function h(o,u){return u+1<o.length&&p(o,u)}function d(o,u){return r(o,u)&&p(o,u)&&a(o,u)<=o.length-u}function f(o,u){if(h(o,u)){var w=s(o,u);if(u+w>=o.length)return!1;var v=a(o,u);if(v<=w)return!1;var i=u+v;return i===o.length||h(o,i)}return!1}function E(o,u,w,v,i){if(!o.samplerate){var k=C(u,w,v,i);if(!k)return;o.config=k.config,o.samplerate=k.samplerate,o.channelCount=k.channelCount,o.codec=k.codec,o.manifestCodec=k.manifestCodec,R.logger.log("parsed codec:"+o.codec+", rate:"+k.samplerate+", channels:"+k.channelCount)}}function y(o){return 1024*9e4/o}function l(o,u,w,v,i){var k=s(o,u),D=a(o,u);if(D-=k,D>0){var c=w+v*i;return{headerLength:k,frameLength:D,stamp:c}}}function n(o,u,w,v,i){var k=y(o.samplerate),D=l(u,w,v,i,k);if(D){var c=D.frameLength,b=D.headerLength,x=D.stamp,_=b+c,j=Math.max(0,w+_-u.length),F;j?(F=new Uint8Array(_-b),F.set(u.subarray(w+b,u.length),0)):F=u.subarray(w+b,w+_);var L={unit:F,pts:x};return j||o.samples.push(L),{sample:L,length:_,missing:j}}}},"./src/demux/base-audio-demuxer.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"initPTSFn",function(){return a});var R=S("./src/polyfills/number.ts"),T=S("./src/demux/id3.ts"),g=S("./src/demux/dummy-demuxed-track.ts"),C=S("./src/utils/mp4-tools.ts"),p=S("./src/utils/typed-array.ts"),s=function(){function r(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var h=r.prototype;return h.resetInitSegment=function(f,E,y){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},h.resetTimeStamp=function(){},h.resetContiguity=function(){},h.canParse=function(f,E){return!1},h.appendFrame=function(f,E,y){},h.demux=function(f,E){this.cachedData&&(f=Object(C.appendUint8Array)(this.cachedData,f),this.cachedData=null);var y=T.getID3Data(f,0),l=y?y.length:0,n,o,u=this._audioTrack,w=this._id3Track,v=y?T.getTimeStamp(y):void 0,i=f.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=a(v,E)),y&&y.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:y}),o=this.initPTS;l<i;){if(this.canParse(f,l)){var k=this.appendFrame(u,f,l);k?(this.frameIndex++,o=k.sample.pts,l+=k.length,n=l):l=i}else T.canParse(f,l)?(y=T.getID3Data(f,l),w.samples.push({pts:o,dts:o,data:y}),l+=y.length,n=l):l++;if(l===i&&n!==i){var D=Object(p.sliceUint8)(f,n);this.cachedData?this.cachedData=Object(C.appendUint8Array)(this.cachedData,D):this.cachedData=D}}return{audioTrack:u,avcTrack:Object(g.dummyTrack)(),id3Track:w,textTrack:Object(g.dummyTrack)()}},h.demuxSampleAes=function(f,E,y){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},h.flush=function(f){var E=this.cachedData;return E&&(this.cachedData=null,this.demux(E,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(g.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(g.dummyTrack)()}},h.destroy=function(){},r}(),a=function(h,d){return Object(R.isFiniteNumber)(h)?h*90:d*9e4};m.default=s},"./src/demux/chunk-cache.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return R});var R=function(){function g(){this.chunks=[],this.dataLength=0}var C=g.prototype;return C.push=function(s){this.chunks.push(s),this.dataLength+=s.length},C.flush=function(){var s=this.chunks,a=this.dataLength,r;if(s.length)s.length===1?r=s[0]:r=T(s,a);else return new Uint8Array(0);return this.reset(),r},C.reset=function(){this.chunks.length=0,this.dataLength=0},g}();function T(g,C){for(var p=new Uint8Array(C),s=0,a=0;a<g.length;a++){var r=g[a];p.set(r,s),s+=r.length}return p}},"./src/demux/dummy-demuxed-track.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"dummyTrack",function(){return R});function R(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/utils/logger.ts"),T=function(){function g(p){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=p,this.bytesAvailable=p.byteLength,this.word=0,this.bitsAvailable=0}var C=g.prototype;return C.loadWord=function(){var s=this.data,a=this.bytesAvailable,r=s.byteLength-a,h=new Uint8Array(4),d=Math.min(4,a);if(d===0)throw new Error("no bytes available");h.set(s.subarray(r,r+d)),this.word=new DataView(h.buffer).getUint32(0),this.bitsAvailable=d*8,this.bytesAvailable-=d},C.skipBits=function(s){var a;this.bitsAvailable>s?(this.word<<=s,this.bitsAvailable-=s):(s-=this.bitsAvailable,a=s>>3,s-=a>>3,this.bytesAvailable-=a,this.loadWord(),this.word<<=s,this.bitsAvailable-=s)},C.readBits=function(s){var a=Math.min(this.bitsAvailable,s),r=this.word>>>32-a;return s>32&&R.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=a,this.bitsAvailable>0?this.word<<=a:this.bytesAvailable>0&&this.loadWord(),a=s-a,a>0&&this.bitsAvailable?r<<a|this.readBits(a):r},C.skipLZ=function(){var s;for(s=0;s<this.bitsAvailable;++s)if((this.word&2147483648>>>s)!==0)return this.word<<=s,this.bitsAvailable-=s,s;return this.loadWord(),s+this.skipLZ()},C.skipUEG=function(){this.skipBits(1+this.skipLZ())},C.skipEG=function(){this.skipBits(1+this.skipLZ())},C.readUEG=function(){var s=this.skipLZ();return this.readBits(s+1)-1},C.readEG=function(){var s=this.readUEG();return 1&s?1+s>>>1:-1*(s>>>1)},C.readBoolean=function(){return this.readBits(1)===1},C.readUByte=function(){return this.readBits(8)},C.readUShort=function(){return this.readBits(16)},C.readUInt=function(){return this.readBits(32)},C.skipScalingList=function(s){for(var a=8,r=8,h,d=0;d<s;d++)r!==0&&(h=this.readEG(),r=(a+h+256)%256),a=r===0?a:r},C.readSPS=function(){var s=0,a=0,r=0,h=0,d,f,E,y=this.readUByte.bind(this),l=this.readBits.bind(this),n=this.readUEG.bind(this),o=this.readBoolean.bind(this),u=this.skipBits.bind(this),w=this.skipEG.bind(this),v=this.skipUEG.bind(this),i=this.skipScalingList.bind(this);y();var k=y();if(l(5),u(3),y(),v(),k===100||k===110||k===122||k===244||k===44||k===83||k===86||k===118||k===128){var D=n();if(D===3&&u(1),v(),v(),u(1),o())for(f=D!==3?8:12,E=0;E<f;E++)o()&&(E<6?i(16):i(64))}v();var c=n();if(c===0)n();else if(c===1)for(u(1),w(),w(),d=n(),E=0;E<d;E++)w();v(),u(1);var b=n(),x=n(),_=l(1);_===0&&u(1),u(1),o()&&(s=n(),a=n(),r=n(),h=n());var j=[1,1];if(o()&&o()){var F=y();switch(F){case 1:j=[1,1];break;case 2:j=[12,11];break;case 3:j=[10,11];break;case 4:j=[16,11];break;case 5:j=[40,33];break;case 6:j=[24,11];break;case 7:j=[20,11];break;case 8:j=[32,11];break;case 9:j=[80,33];break;case 10:j=[18,11];break;case 11:j=[15,11];break;case 12:j=[64,33];break;case 13:j=[160,99];break;case 14:j=[4,3];break;case 15:j=[3,2];break;case 16:j=[2,1];break;case 255:{j=[y()<<8|y(),y()<<8|y()];break}}}return{width:Math.ceil((b+1)*16-s*2-a*2),height:(2-_)*(x+1)*16-(_?2:4)*(r+h),pixelRatio:j}},C.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},g}();m.default=T},"./src/demux/id3.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"isHeader",function(){return R}),S.d(m,"isFooter",function(){return T}),S.d(m,"getID3Data",function(){return g}),S.d(m,"canParse",function(){return p}),S.d(m,"getTimeStamp",function(){return s}),S.d(m,"isTimeStampFrame",function(){return a}),S.d(m,"getID3Frames",function(){return h}),S.d(m,"decodeFrame",function(){return d}),S.d(m,"utf8ArrayToStr",function(){return n}),S.d(m,"testables",function(){return o});var R=function(i,k){return k+10<=i.length&&(i[k]===73&&i[k+1]===68&&i[k+2]===51&&(i[k+3]<255&&i[k+4]<255&&(i[k+6]<128&&i[k+7]<128&&i[k+8]<128&&i[k+9]<128)))},T=function(i,k){return k+10<=i.length&&(i[k]===51&&i[k+1]===68&&i[k+2]===73&&(i[k+3]<255&&i[k+4]<255&&(i[k+6]<128&&i[k+7]<128&&i[k+8]<128&&i[k+9]<128)))},g=function(i,k){for(var D=k,c=0;R(i,k);){c+=10;var b=C(i,k+6);c+=b,T(i,k+10)&&(c+=10),k+=c}return c>0?i.subarray(D,D+c):void 0},C=function(i,k){var D=0;return D=(i[k]&127)<<21,D|=(i[k+1]&127)<<14,D|=(i[k+2]&127)<<7,D|=i[k+3]&127,D},p=function(i,k){return R(i,k)&&C(i,k+6)+10<=i.length-k},s=function(i){for(var k=h(i),D=0;D<k.length;D++){var c=k[D];if(a(c))return l(c)}return},a=function(i){return i&&i.key==="PRIV"&&i.info==="com.apple.streaming.transportStreamTimestamp"},r=function(i){var k=String.fromCharCode(i[0],i[1],i[2],i[3]),D=C(i,4),c=10;return{type:k,size:D,data:i.subarray(c,c+D)}},h=function(i){for(var k=0,D=[];R(i,k);){var c=C(i,k+6);k+=10;for(var b=k+c;k+8<b;){var x=r(i.subarray(k)),_=d(x);_&&D.push(_),k+=x.size+10}T(i,k)&&(k+=10)}return D},d=function(i){return i.type==="PRIV"?f(i):i.type[0]==="W"?y(i):E(i)},f=function(i){if(i.size<2)return;var k=n(i.data,!0),D=new Uint8Array(i.data.subarray(k.length+1));return{key:i.type,info:k,data:D.buffer}},E=function(i){if(i.size<2)return;if(i.type==="TXXX"){var k=1,D=n(i.data.subarray(k),!0);k+=D.length+1;var c=n(i.data.subarray(k));return{key:i.type,info:D,data:c}}var b=n(i.data.subarray(1));return{key:i.type,data:b}},y=function(i){if(i.type==="WXXX"){if(i.size<2)return;var k=1,D=n(i.data.subarray(k),!0);k+=D.length+1;var c=n(i.data.subarray(k));return{key:i.type,info:D,data:c}}var b=n(i.data);return{key:i.type,data:b}},l=function(i){if(i.data.byteLength===8){var k=new Uint8Array(i.data),D=k[3]&1,c=(k[4]<<23)+(k[5]<<15)+(k[6]<<7)+k[7];return c/=45,D&&(c+=4772185884e-2),Math.round(c)}return},n=function(i,k){k===void 0&&(k=!1);var D=w();if(D){var c=D.decode(i);if(k){var b=c.indexOf("\0");return b!==-1?c.substring(0,b):c}return c.replace(/\0/g,"")}for(var x=i.length,_,j,F,L="",X=0;X<x;){if(_=i[X++],_===0&&k)return L;if(_===0||_===3)continue;switch(_>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:L+=String.fromCharCode(_);break;case 12:case 13:j=i[X++],L+=String.fromCharCode((_&31)<<6|j&63);break;case 14:j=i[X++],F=i[X++],L+=String.fromCharCode((_&15)<<12|(j&63)<<6|(F&63)<<0);break;default:}}return L},o={decodeTextFrame:E},u;function w(){return!u&&typeof self.TextDecoder!="undefined"&&(u=new self.TextDecoder("utf-8")),u}},"./src/demux/mp3demuxer.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/demux/base-audio-demuxer.ts"),T=S("./src/demux/id3.ts"),g=S("./src/utils/logger.ts"),C=S("./src/demux/mpegaudio.ts");function p(r,h){r.prototype=Object.create(h.prototype),r.prototype.constructor=r,s(r,h)}function s(r,h){return s=Object.setPrototypeOf||function(f,E){return f.__proto__=E,f},s(r,h)}var a=function(r){p(h,r);function h(){return r.apply(this,arguments)||this}var d=h.prototype;return d.resetInitSegment=function(E,y,l){r.prototype.resetInitSegment.call(this,E,y,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:E,duration:l,inputTimeScale:9e4,dropped:0}},h.probe=function(E){if(!E)return!1;for(var y=T.getID3Data(E,0)||[],l=y.length,n=E.length;l<n;l++)if(C.probe(E,l))return g.logger.log("MPEG Audio sync word found !"),!0;return!1},d.canParse=function(E,y){return C.canParse(E,y)},d.appendFrame=function(E,y,l){return this.initPTS===null?void 0:C.appendFrame(E,y,l,this.initPTS,this.frameIndex)},h}(R.default);a.minProbeByteLength=4,m.default=a},"./src/demux/mp4demuxer.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/utils/mp4-tools.ts"),T=S("./src/demux/dummy-demuxed-track.ts"),g=function(){function C(s,a){this.remainderData=null,this.config=void 0,this.config=a}var p=C.prototype;return p.resetTimeStamp=function(){},p.resetInitSegment=function(){},p.resetContiguity=function(){},C.probe=function(a){return Object(R.findBox)({data:a,start:0,end:Math.min(a.length,16384)},["moof"]).length>0},p.demux=function(a){var r=a,h=Object(T.dummyTrack)();if(this.config.progressive){this.remainderData&&(r=Object(R.appendUint8Array)(this.remainderData,a));var d=Object(R.segmentValidRange)(r);this.remainderData=d.remainder,h.samples=d.valid||new Uint8Array}else h.samples=r;return{audioTrack:Object(T.dummyTrack)(),avcTrack:h,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},p.flush=function(){var a=Object(T.dummyTrack)();return a.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(T.dummyTrack)(),avcTrack:a,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},p.demuxSampleAes=function(a,r,h){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},p.destroy=function(){},C}();g.minProbeByteLength=1024,m.default=g},"./src/demux/mpegaudio.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"appendFrame",function(){return s}),S.d(m,"parseHeader",function(){return a}),S.d(m,"isHeaderPattern",function(){return r}),S.d(m,"isHeader",function(){return h}),S.d(m,"canParse",function(){return d}),S.d(m,"probe",function(){return f});var R=null,T=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],g=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],C=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],p=[0,1,1,4];function s(E,y,l,n,o){if(l+24>y.length)return;var u=a(y,l);if(u&&l+u.frameLength<=y.length){var w=u.samplesPerFrame*9e4/u.sampleRate,v=n+o*w,i={unit:y.subarray(l,l+u.frameLength),pts:v,dts:v};return E.config=[],E.channelCount=u.channelCount,E.samplerate=u.sampleRate,E.samples.push(i),{sample:i,length:u.frameLength,missing:0}}}function a(E,y){var l=E[y+1]>>3&3,n=E[y+1]>>1&3,o=E[y+2]>>4&15,u=E[y+2]>>2&3;if(l!==1&&o!==0&&o!==15&&u!==3){var w=E[y+2]>>1&1,v=E[y+3]>>6,i=l===3?3-n:n===3?3:4,k=T[i*14+o-1]*1e3,D=l===3?0:l===2?1:2,c=g[D*3+u],b=v===3?1:2,x=C[l][n],_=p[n],j=x*8*_,F=Math.floor(x*k/c+w)*_;if(R===null){var L=navigator.userAgent||"",X=L.match(/Chrome\/(\d+)/i);R=X?parseInt(X[1]):0}var z=!!R&&R<=87;return z&&n===2&&k>=224e3&&v===0&&(E[y+3]=E[y+3]|128),{sampleRate:c,channelCount:b,frameLength:F,samplesPerFrame:j}}}function r(E,y){return E[y]===255&&(E[y+1]&224)===224&&(E[y+1]&6)!==0}function h(E,y){return y+1<E.length&&r(E,y)}function d(E,y){var l=4;return r(E,y)&&l<=E.length-y}function f(E,y){if(y+1<E.length&&r(E,y)){var l=4,n=a(E,y),o=l;n!=null&&n.frameLength&&(o=n.frameLength);var u=y+o;return u===E.length||h(E,u)}return!1}},"./src/demux/sample-aes.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/crypt/decrypter.ts"),T=S("./src/demux/tsdemuxer.ts"),g=function(){function C(s,a,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new R.default(s,a,{removePKCS7Padding:!1})}var p=C.prototype;return p.decryptBuffer=function(a,r){this.decrypter.decrypt(a,this.keyData.key.buffer,this.keyData.iv.buffer,r)},p.decryptAacSample=function(a,r,h,d){var f=a[r].unit,E=f.subarray(16,f.length-f.length%16),y=E.buffer.slice(E.byteOffset,E.byteOffset+E.length),l=this;this.decryptBuffer(y,function(n){var o=new Uint8Array(n);f.set(o,16),d||l.decryptAacSamples(a,r+1,h)})},p.decryptAacSamples=function(a,r,h){for(;;r++){if(r>=a.length){h();return}if(a[r].unit.length<32)continue;var d=this.decrypter.isSync();if(this.decryptAacSample(a,r,h,d),!d)return}},p.getAvcEncryptedData=function(a){for(var r=Math.floor((a.length-48)/160)*16+16,h=new Int8Array(r),d=0,f=32;f<=a.length-16;f+=160,d+=16)h.set(a.subarray(f,f+16),d);return h},p.getAvcDecryptedUnit=function(a,r){for(var h=new Uint8Array(r),d=0,f=32;f<=a.length-16;f+=160,d+=16)a.set(h.subarray(d,d+16),f);return a},p.decryptAvcSample=function(a,r,h,d,f,E){var y=Object(T.discardEPB)(f.data),l=this.getAvcEncryptedData(y),n=this;this.decryptBuffer(l.buffer,function(o){f.data=n.getAvcDecryptedUnit(y,o),E||n.decryptAvcSamples(a,r,h+1,d)})},p.decryptAvcSamples=function(a,r,h,d){if(a instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;r++,h=0){if(r>=a.length){d();return}for(var f=a[r].units;!(h>=f.length);h++){var E=f[h];if(E.data.length<=48||E.type!==1&&E.type!==5)continue;var y=this.decrypter.isSync();if(this.decryptAvcSample(a,r,h,d,E,y),!y)return}}},C}();m.default=g},"./src/demux/transmuxer-interface.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return f});var R=S("./node_modules/webworkify-webpack/index.js"),T=S.n(R),g=S("./src/events.ts"),C=S("./src/demux/transmuxer.ts"),p=S("./src/utils/logger.ts"),s=S("./src/errors.ts"),a=S("./src/utils/mediasource-helper.ts"),r=S("./node_modules/eventemitter3/index.js"),h=S.n(r),d=Object(a.getMediaSource)()||{isTypeSupported:function(){return!1}},f=function(){function E(l,n,o,u){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=l,this.id=n,this.onTransmuxComplete=o,this.onFlush=u;var v=l.config,i=function(x,_){_=_||{},_.frag=w.frag,_.id=w.id,l.trigger(x,_)};this.observer=new r.EventEmitter,this.observer.on(g.Events.FRAG_DECRYPTED,i),this.observer.on(g.Events.ERROR,i);var k={mp4:d.isTypeSupported("video/mp4"),mpeg:d.isTypeSupported("audio/mpeg"),mp3:d.isTypeSupported('audio/mp4; codecs="mp3"')},D=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){p.logger.log("demuxing in webworker");var c;try{c=this.worker=R("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),c.addEventListener("message",this.onwmsg),c.onerror=function(b){l.trigger(g.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},c.postMessage({cmd:"init",typeSupported:k,vendor:D,id:n,config:JSON.stringify(v)})}catch(b){p.logger.warn("Error in worker:",b),p.logger.error("Error while initializing DemuxerWorker, fallback to inline"),c&&self.URL.revokeObjectURL(c.objectURL),this.transmuxer=new C.default(this.observer,k,v,D,n),this.worker=null}}else this.transmuxer=new C.default(this.observer,k,v,D,n)}var y=E.prototype;return y.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var u=this.observer;u&&u.removeAllListeners(),this.observer=null},y.push=function(n,o,u,w,v,i,k,D,c,b){var x=this;c.transmuxing.start=self.performance.now();var _=this.transmuxer,j=this.worker,F=i?i.start:v.start,L=v.decryptdata,X=this.frag,z=!(X&&v.cc===X.cc),H=!(X&&c.level===X.level),G=X?c.sn-X.sn:-1,U=this.part?c.part-this.part.index:1,B=!H&&(G===1||G===0&&U===1),W=self.performance.now();(H||G||v.stats.parsing.start===0)&&(v.stats.parsing.start=W),i&&(U||!B)&&(i.stats.parsing.start=W);var te=new C.TransmuxState(z,B,D,H,F);if(!B||z){p.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+`
discontinuity: `+z+`
trackSwitch: `+H+`
contiguous: `+B+`
accurateTimeOffset: `+D+`
timeOffset: `+F);var de=new C.TransmuxConfig(u,w,o,k,b);this.configureTransmuxer(de)}if(this.frag=v,this.part=i,j)j.postMessage({cmd:"demux",data:n,decryptdata:L,chunkMeta:c,state:te},n instanceof ArrayBuffer?[n]:[]);else if(_){var fe=_.push(n,L,c,te);Object(C.isPromise)(fe)?fe.then(function(be){x.handleTransmuxComplete(be)}):this.handleTransmuxComplete(fe)}},y.flush=function(n){var o=this;n.transmuxing.start=self.performance.now();var u=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:n});else if(u){var v=u.flush(n);Object(C.isPromise)(v)?v.then(function(i){o.handleFlushResult(i,n)}):this.handleFlushResult(v,n)}},y.handleFlushResult=function(n,o){var u=this;n.forEach(function(w){u.handleTransmuxComplete(w)}),this.onFlush(o)},y.onWorkerMessage=function(n){var o=n.data,u=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,u.trigger(o.event,o.data);break}}},y.configureTransmuxer=function(n){var o=this.worker,u=this.transmuxer;o?o.postMessage({cmd:"configure",config:n}):u&&u.configure(n)},y.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},E}()},"./src/demux/transmuxer-worker.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return s});var R=S("./src/demux/transmuxer.ts"),T=S("./src/events.ts"),g=S("./src/utils/logger.ts"),C=S("./node_modules/eventemitter3/index.js"),p=S.n(C);function s(f){var E=new C.EventEmitter,y=function(n,o){f.postMessage({event:n,data:o})};E.on(T.Events.FRAG_DECRYPTED,y),E.on(T.Events.ERROR,y),f.addEventListener("message",function(l){var n=l.data;switch(n.cmd){case"init":{var o=JSON.parse(n.config);f.transmuxer=new R.default(E,n.typeSupported,o,n.vendor,n.id),Object(g.enableLogs)(o.debug),y("init",null);break}case"configure":{f.transmuxer.configure(n.config);break}case"demux":{var u=f.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(R.isPromise)(u)?u.then(function(i){a(f,i)}):a(f,u);break}case"flush":{var w=n.chunkMeta,v=f.transmuxer.flush(w);Object(R.isPromise)(v)?v.then(function(i){h(f,i,w)}):h(f,v,w);break}default:break}})}function a(f,E){if(d(E.remuxResult))return;var y=[],l=E.remuxResult,n=l.audio,o=l.video;n&&r(y,n),o&&r(y,o),f.postMessage({event:"transmuxComplete",data:E},y)}function r(f,E){E.data1&&f.push(E.data1.buffer),E.data2&&f.push(E.data2.buffer)}function h(f,E,y){E.forEach(function(l){a(f,l)}),f.postMessage({event:"flush",data:y})}function d(f){return!f.audio&&!f.video&&!f.text&&!f.id3&&!f.initSegment}},"./src/demux/transmuxer.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return o}),S.d(m,"isPromise",function(){return v}),S.d(m,"TransmuxConfig",function(){return i}),S.d(m,"TransmuxState",function(){return k});var R=S("./src/events.ts"),T=S("./src/errors.ts"),g=S("./src/crypt/decrypter.ts"),C=S("./src/demux/aacdemuxer.ts"),p=S("./src/demux/mp4demuxer.ts"),s=S("./src/demux/tsdemuxer.ts"),a=S("./src/demux/mp3demuxer.ts"),r=S("./src/remux/mp4-remuxer.ts"),h=S("./src/remux/passthrough-remuxer.ts"),d=S("./src/demux/chunk-cache.ts"),f=S("./src/utils/mp4-tools.ts"),E=S("./src/utils/logger.ts"),y;try{y=self.performance.now.bind(self.performance)}catch(D){E.logger.debug("Unable to use Performance API on this environment"),y=self.Date.now}var l=[{demux:s.default,remux:r.default},{demux:p.default,remux:h.default},{demux:C.default,remux:r.default},{demux:a.default,remux:r.default}],n=1024;l.forEach(function(D){var c=D.demux;n=Math.max(n,c.minProbeByteLength)});var o=function(){function D(b,x,_,j,F){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 d.default,this.observer=b,this.typeSupported=x,this.config=_,this.vendor=j,this.id=F}var c=D.prototype;return c.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},c.push=function(x,_,j,F){var L=this,X=j.transmuxing;X.executeStart=y();var z=new Uint8Array(x),H=this.cache,G=this.config,U=this.currentTransmuxState,B=this.transmuxConfig;F&&(this.currentTransmuxState=F);var W=u(z,_);if(W&&W.method==="AES-128"){var te=this.getDecrypter();if(G.enableSoftwareAES){var de=te.softwareDecrypt(z,W.key.buffer,W.iv.buffer);if(!de)return X.executeEnd=y(),w(j);z=new Uint8Array(de)}else return this.decryptionPromise=te.webCryptoDecrypt(z,W.key.buffer,W.iv.buffer).then(function(J){var V=L.push(J,null,j);return L.decryptionPromise=null,V}),this.decryptionPromise}var fe=F||U,be=fe.contiguous,Ce=fe.discontinuity,ue=fe.trackSwitch,ge=fe.accurateTimeOffset,pe=fe.timeOffset,oe=B.audioCodec,ae=B.videoCodec,re=B.defaultInitPts,he=B.duration,Q=B.initSegmentData;if((Ce||ue)&&this.resetInitSegment(Q,oe,ae,he),Ce&&this.resetInitialTimestamp(re),be||this.resetContiguity(),this.needsProbing(z,Ce,ue)){if(H.dataLength){var ie=H.flush();z=Object(f.appendUint8Array)(ie,z)}this.configureTransmuxer(z,B)}var we=this.transmux(z,W,pe,ge,j),ne=this.currentTransmuxState;return ne.contiguous=!0,ne.discontinuity=!1,ne.trackSwitch=!1,X.executeEnd=y(),we},c.flush=function(x){var _=this,j=x.transmuxing;j.executeStart=y();var F=this.decrypter,L=this.cache,X=this.currentTransmuxState,z=this.decryptionPromise;if(z)return z.then(function(){return _.flush(x)});var H=[],G=X.timeOffset;if(F){var U=F.flush();U&&H.push(this.push(U,null,x))}var B=L.dataLength;L.reset();var W=this.demuxer,te=this.remuxer;if(!W||!te)return B>=n&&this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),j.executeEnd=y(),[w(x)];var de=W.flush(G);return v(de)?de.then(function(fe){return _.flushRemux(H,fe,x),H}):(this.flushRemux(H,de,x),H)},c.flushRemux=function(x,_,j){var F=_.audioTrack,L=_.avcTrack,X=_.id3Track,z=_.textTrack,H=this.currentTransmuxState,G=H.accurateTimeOffset,U=H.timeOffset;E.logger.log("[transmuxer.ts]: Flushed fragment "+j.sn+(j.part>-1?" p: "+j.part:"")+" of level "+j.level);var B=this.remuxer.remux(F,L,X,z,U,G,!0,this.id);x.push({remuxResult:B,chunkMeta:j}),j.transmuxing.executeEnd=y()},c.resetInitialTimestamp=function(x){var _=this.demuxer,j=this.remuxer;if(!_||!j)return;_.resetTimeStamp(x),j.resetTimeStamp(x)},c.resetContiguity=function(){var x=this.demuxer,_=this.remuxer;if(!x||!_)return;x.resetContiguity(),_.resetNextTimestamp()},c.resetInitSegment=function(x,_,j,F){var L=this.demuxer,X=this.remuxer;if(!L||!X)return;L.resetInitSegment(_,j,F),X.resetInitSegment(x,_,j)},c.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},c.transmux=function(x,_,j,F,L){var X;return _&&_.method==="SAMPLE-AES"?X=this.transmuxSampleAes(x,_,j,F,L):X=this.transmuxUnencrypted(x,j,F,L),X},c.transmuxUnencrypted=function(x,_,j,F){var L=this.demuxer.demux(x,_,!1,!this.config.progressive),X=L.audioTrack,z=L.avcTrack,H=L.id3Track,G=L.textTrack,U=this.remuxer.remux(X,z,H,G,_,j,!1,this.id);return{remuxResult:U,chunkMeta:F}},c.transmuxSampleAes=function(x,_,j,F,L){var X=this;return this.demuxer.demuxSampleAes(x,_,j).then(function(z){var H=X.remuxer.remux(z.audioTrack,z.avcTrack,z.id3Track,z.textTrack,j,F,!1,X.id);return{remuxResult:H,chunkMeta:L}})},c.configureTransmuxer=function(x,_){for(var j=this.config,F=this.observer,L=this.typeSupported,X=this.vendor,z=_.audioCodec,H=_.defaultInitPts,G=_.duration,U=_.initSegmentData,B=_.videoCodec,W,te=0,de=l.length;te<de;te++)if(l[te].demux.probe(x)){W=l[te];break}W||(E.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:p.default,remux:h.default});var fe=this.demuxer,be=this.remuxer,Ce=W.remux,ue=W.demux;(!be||!(be instanceof Ce))&&(this.remuxer=new Ce(F,j,L,X)),(!fe||!(fe instanceof ue))&&(this.demuxer=new ue(F,j,L),this.probe=ue.probe),this.resetInitSegment(U,z,B,G),this.resetInitialTimestamp(H)},c.needsProbing=function(x,_,j){return!this.demuxer||!this.remuxer||_||j},c.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new g.default(this.observer,this.config)),x},D}();function u(D,c){var b=null;return D.byteLength>0&&c!=null&&c.key!=null&&c.iv!==null&&c.method!=null&&(b=c),b}var w=function(c){return{remuxResult:{},chunkMeta:c}};function v(D){return"then"in D&&D.then instanceof Function}var i=function(c,b,x,_,j){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=c,this.videoCodec=b,this.initSegmentData=x,this.duration=_,this.defaultInitPts=j},k=function(c,b,x,_,j){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=c,this.contiguous=b,this.accurateTimeOffset=x,this.trackSwitch=_,this.timeOffset=j}},"./src/demux/tsdemuxer.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"discardEPB",function(){return w});var R=S("./src/demux/adts.ts"),T=S("./src/demux/mpegaudio.ts"),g=S("./src/demux/exp-golomb.ts"),C=S("./src/demux/id3.ts"),p=S("./src/demux/sample-aes.ts"),s=S("./src/events.ts"),a=S("./src/utils/mp4-tools.ts"),r=S("./src/utils/logger.ts"),h=S("./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},f=function(){function v(k,D,c){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=k,this.config=D,this.typeSupported=c}v.probe=function(D){var c=v.syncOffset(D);return c<0?!1:(c&&r.logger.warn("MPEG2-TS detected but first sync word found @ offset "+c+", junk ahead ?"),!0)},v.syncOffset=function(D){for(var c=Math.min(1e3,D.length-3*188),b=0;b<c;){if(D[b]===71&&D[b+188]===71&&D[b+2*188]===71)return b;b++}return-1},v.createTrack=function(D,c){return{container:D==="video"||D==="audio"?"video/mp2t":void 0,type:D,id:d[D],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:D==="audio"?c:void 0}};var i=v.prototype;return i.resetInitSegment=function(D,c,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=v.createTrack("video",b),this._audioTrack=v.createTrack("audio",b),this._id3Track=v.createTrack("id3",b),this._txtTrack=v.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=D,this.videoCodec=c,this._duration=b},i.resetTimeStamp=function(){},i.resetContiguity=function(){var D=this._audioTrack,c=this._avcTrack,b=this._id3Track;D&&(D.pesData=null),c&&(c.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},i.demux=function(D,c,b,x){b===void 0&&(b=!1),x===void 0&&(x=!1),b||(this.sampleAes=null);var _,j=this._avcTrack,F=this._audioTrack,L=this._id3Track,X=j.pid,z=j.pesData,H=F.pid,G=L.pid,U=F.pesData,B=L.pesData,W=!1,te=this.pmtParsed,de=this._pmtId,fe=D.length;if(this.remainderData&&(D=Object(a.appendUint8Array)(this.remainderData,D),fe=D.length,this.remainderData=null),fe<188&&!x)return this.remainderData=D,{audioTrack:F,avcTrack:j,id3Track:L,textTrack:this._txtTrack};var be=Math.max(0,v.syncOffset(D));fe-=(fe+be)%188,fe<D.byteLength&&!x&&(this.remainderData=new Uint8Array(D.buffer,fe,D.buffer.byteLength-fe));for(var Ce=be;Ce<fe;Ce+=188)if(D[Ce]===71){var ue=!!(D[Ce+1]&64),ge=((D[Ce+1]&31)<<8)+D[Ce+2],pe=(D[Ce+3]&48)>>4,oe=void 0;if(pe>1){if(oe=Ce+5+D[Ce+4],oe===Ce+188)continue}else oe=Ce+4;switch(ge){case X:ue&&(z&&(_=n(z))&&this.parseAVCPES(_,!1),z={data:[],size:0}),z&&(z.data.push(D.subarray(oe,Ce+188)),z.size+=Ce+188-oe);break;case H:ue&&(U&&(_=n(U))&&(F.isAAC?this.parseAACPES(_):this.parseMPEGPES(_)),U={data:[],size:0}),U&&(U.data.push(D.subarray(oe,Ce+188)),U.size+=Ce+188-oe);break;case G:ue&&(B&&(_=n(B))&&this.parseID3PES(_),B={data:[],size:0}),B&&(B.data.push(D.subarray(oe,Ce+188)),B.size+=Ce+188-oe);break;case 0:ue&&(oe+=D[oe]+1),de=this._pmtId=y(D,oe);break;case de:{ue&&(oe+=D[oe]+1);var ae=l(D,oe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);X=ae.avc,X>0&&(j.pid=X),H=ae.audio,H>0&&(F.pid=H,F.isAAC=ae.isAAC),G=ae.id3,G>0&&(L.pid=G),W&&!te&&(r.logger.log("reparse from beginning"),W=!1,Ce=be-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});j.pesData=z,F.pesData=U,L.pesData=B;var re={audioTrack:F,avcTrack:j,id3Track:L,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(re),re},i.flush=function(){var D=this.remainderData;this.remainderData=null;var c;return D?c=this.demux(D,-1,!1,!0):c={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(c),this.sampleAes?this.decrypt(c,this.sampleAes):c},i.extractRemainingSamples=function(D){var c=D.audioTrack,b=D.avcTrack,x=D.id3Track,_=b.pesData,j=c.pesData,F=x.pesData,L;_&&(L=n(_))?(this.parseAVCPES(L,!0),b.pesData=null):b.pesData=_,j&&(L=n(j))?(c.isAAC?this.parseAACPES(L):this.parseMPEGPES(L),c.pesData=null):(j!=null&&j.size&&r.logger.log("last AAC PES packet truncated,might overlap between fragments"),c.pesData=j),F&&(L=n(F))?(this.parseID3PES(L),x.pesData=null):x.pesData=F},i.demuxSampleAes=function(D,c,b){var x=this.demux(D,b,!0,!this.config.progressive),_=this.sampleAes=new p.default(this.observer,this.config,c);return this.decrypt(x,_)},i.decrypt=function(D,c){return new Promise(function(b){var x=D.audioTrack,_=D.avcTrack;x.samples&&x.isAAC?c.decryptAacSamples(x.samples,0,function(){_.samples?c.decryptAvcSamples(_.samples,0,0,function(){b(D)}):b(D)}):_.samples&&c.decryptAvcSamples(_.samples,0,0,function(){b(D)})})},i.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},i.parseAVCPES=function(D,c){var b=this,x=this._avcTrack,_=this.parseAVCNALu(D.data),j=!1,F=this.avcSample,L,X=!1;D.data=null,F&&_.length&&!x.audFound&&(o(F,x),F=this.avcSample=E(!1,D.pts,D.dts,"")),_.forEach(function(z){switch(z.type){case 1:{L=!0,F||(F=b.avcSample=E(!0,D.pts,D.dts,"")),j&&(F.debug+="NDR "),F.frame=!0;var H=z.data;if(X&&H.length>4){var G=new g.default(H).readSliceType();(G===2||G===4||G===7||G===9)&&(F.key=!0)}break}case 5:L=!0,F||(F=b.avcSample=E(!0,D.pts,D.dts,"")),j&&(F.debug+="IDR "),F.key=!0,F.frame=!0;break;case 6:{L=!0,j&&F&&(F.debug+="SEI ");var U=new g.default(w(z.data));U.readUByte();for(var B=0,W=0,te=!1,de=0;!te&&U.bytesAvailable>1;){B=0;do de=U.readUByte(),B+=de;while(de===255);W=0;do de=U.readUByte(),W+=de;while(de===255);if(B===4&&U.bytesAvailable!==0){te=!0;var fe=U.readUByte();if(fe===181){var be=U.readUShort();if(be===49){var Ce=U.readUInt();if(Ce===1195456820){var ue=U.readUByte();if(ue===3){for(var ge=U.readUByte(),pe=U.readUByte(),oe=31&ge,ae=[ge,pe],re=0;re<oe;re++)ae.push(U.readUByte()),ae.push(U.readUByte()),ae.push(U.readUByte());u(b._txtTrack.samples,{type:3,pts:D.pts,bytes:ae})}}}}}else if(B===5&&U.bytesAvailable!==0){if(te=!0,W>16){for(var he=[],Q=0;Q<16;Q++)he.push(U.readUByte().toString(16)),(Q===3||Q===5||Q===7||Q===9)&&he.push("-");for(var ie=W-16,we=new Uint8Array(ie),ne=0;ne<ie;ne++)we[ne]=U.readUByte();u(b._txtTrack.samples,{pts:D.pts,payloadType:B,uuid:he.join(""),userData:Object(C.utf8ArrayToStr)(we),userDataBytes:we})}}else if(W<U.bytesAvailable)for(var J=0;J<W;J++)U.readUByte()}break}case 7:if(L=!0,X=!0,j&&F&&(F.debug+="SPS "),!x.sps){var V=new g.default(z.data),Z=V.readSPS();x.width=Z.width,x.height=Z.height,x.pixelRatio=Z.pixelRatio,x.sps=[z.data],x.duration=b._duration;for(var Ee=z.data.subarray(1,4),xe="avc1.",_e=0;_e<3;_e++){var Ne=Ee[_e].toString(16);Ne.length<2&&(Ne="0"+Ne),xe+=Ne}x.codec=xe}break;case 8:L=!0,j&&F&&(F.debug+="PPS "),x.pps||(x.pps=[z.data]);break;case 9:L=!1,x.audFound=!0,F&&o(F,x),F=b.avcSample=E(!1,D.pts,D.dts,j?"AUD ":"");break;case 12:L=!1;break;default:L=!1,F&&(F.debug+="unknown NAL "+z.type+" ");break}if(F&&L){var Be=F.units;Be.push(z)}}),c&&F&&(o(F,x),this.avcSample=null)},i.getLastNalUnit=function(){var D,c=this.avcSample,b;if(!c||c.units.length===0){var x=this._avcTrack.samples;c=x[x.length-1]}if((D=c)!==null&&D!==void 0&&D.units){var _=c.units;b=_[_.length-1]}return b},i.parseAVCNALu=function(D){var c=D.byteLength,b=this._avcTrack,x=b.naluState||0,_=x,j=[],F=0,L,X,z,H=-1,G=0;for(x===-1&&(H=0,G=D[0]&31,x=0,F=1);F<c;){if(L=D[F++],!x){x=L?0:1;continue}if(x===1){x=L?0:2;continue}if(!L)x=3;else if(L===1){if(H>=0){var U={data:D.subarray(H,F-x-1),type:G};j.push(U)}else{var B=this.getLastNalUnit();if(B&&(_&&F<=4-_&&(B.state&&(B.data=B.data.subarray(0,B.data.byteLength-_))),X=F-x-1,X>0)){var W=new Uint8Array(B.data.byteLength+X);W.set(B.data,0),W.set(D.subarray(0,X),B.data.byteLength),B.data=W,B.state=0}}F<c?(z=D[F]&31,H=F,G=z,x=0):x=-1}else x=0}if(H>=0&&x>=0){var te={data:D.subarray(H,c),type:G,state:x};j.push(te)}if(j.length===0){var de=this.getLastNalUnit();if(de){var fe=new Uint8Array(de.data.byteLength+D.byteLength);fe.set(de.data,0),fe.set(D,de.data.byteLength),de.data=fe}}return b.naluState=x,j},i.parseAACPES=function(D){var c=0,b=this._audioTrack,x=this.aacOverFlow,_=D.data;if(x){this.aacOverFlow=null;var j=x.sample.unit.byteLength,F=Math.min(x.missing,j),L=j-F;x.sample.unit.set(_.subarray(0,F),L),b.samples.push(x.sample),c=x.missing}var X,z;for(X=c,z=_.length;X<z-1&&!R.isHeader(_,X);X++);if(X!==c){var H,G;if(X<z-1?(H="AAC PES did not start with ADTS header,offset:"+X,G=!1):(H="no ADTS header found in AAC PES",G=!0),r.logger.warn("parsing error:"+H),this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:H}),G)return}R.initTrackConfig(b,this.observer,_,X,this.audioCodec);var U;if(D.pts!==void 0)U=D.pts;else if(x){var B=R.getFrameDuration(b.samplerate);U=x.sample.pts+B}else{r.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;X<z;)if(R.isHeader(_,X)){if(X+5<z){var te=R.appendFrame(b,_,X,U,W);if(te)if(te.missing)this.aacOverFlow=te;else{X+=te.length,W++;continue}}break}else X++},i.parseMPEGPES=function(D){var c=D.data,b=c.length,x=0,_=0,j=D.pts;if(j===void 0){r.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;_<b;)if(T.isHeader(c,_)){var F=T.appendFrame(this._audioTrack,c,_,j,x);if(F)_+=F.length,x++;else break}else _++},i.parseID3PES=function(D){if(D.pts===void 0){r.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(D)},v}();f.minProbeByteLength=188;function E(v,i,k,D){return{key:v,frame:!1,pts:i,dts:k,units:[],debug:D,length:0}}function y(v,i){return(v[i+10]&31)<<8|v[i+11]}function l(v,i,k,D){var c={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(v[i+1]&15)<<8|v[i+2],x=i+3+b-4,_=(v[i+10]&15)<<8|v[i+11];for(i+=12+_;i<x;){var j=(v[i+1]&31)<<8|v[i+2];switch(v[i]){case 207:if(!D){r.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:c.audio===-1&&(c.audio=j);break;case 21:c.id3===-1&&(c.id3=j);break;case 219:if(!D){r.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:c.avc===-1&&(c.avc=j);break;case 3:case 4:k?c.audio===-1&&(c.audio=j,c.isAAC=!1):r.logger.log("MPEG audio found, not supported in this browser");break;case 36:r.logger.warn("Unsupported HEVC stream type found");break;default:break}i+=((v[i+3]&15)<<8|v[i+4])+5}return c}function n(v){var i=0,k,D,c,b,x,_=v.data;if(!v||v.size===0)return null;for(;_[0].length<19&&_.length>1;){var j=new Uint8Array(_[0].length+_[1].length);j.set(_[0]),j.set(_[1],_[0].length),_[0]=j,_.splice(1,1)}k=_[0];var F=(k[0]<<16)+(k[1]<<8)+k[2];if(F===1){if(D=(k[4]<<8)+k[5],D&&D>v.size-6)return null;var L=k[7];L&192&&(b=(k[9]&14)*536870912+(k[10]&255)*4194304+(k[11]&254)*16384+(k[12]&255)*128+(k[13]&254)/2,L&64?(x=(k[14]&14)*536870912+(k[15]&255)*4194304+(k[16]&254)*16384+(k[17]&255)*128+(k[18]&254)/2,b-x>60*9e4&&(r.logger.warn(Math.round((b-x)/9e4)+"s delta between PTS and DTS, align them"),b=x)):x=b),c=k[8];var X=c+9;if(v.size<=X)return null;v.size-=X;for(var z=new Uint8Array(v.size),H=0,G=_.length;H<G;H++){k=_[H];var U=k.byteLength;if(X)if(X>U){X-=U;continue}else k=k.subarray(X),U-=X,X=0;z.set(k,i),i+=U}return D&&(D-=c+3),{data:z,pts:b,dts:x,len:D}}return null}function o(v,i){if(v.units.length&&v.frame){if(v.pts===void 0){var k=i.samples,D=k.length;if(D){var c=k[D-1];v.pts=c.pts,v.dts=c.dts}else{i.dropped++;return}}i.samples.push(v)}v.debug.length&&r.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function u(v,i){var k=v.length;if(k>0){if(i.pts>=v[k-1].pts)v.push(i);else for(var D=k-1;D>=0;D--)if(i.pts<v[D].pts){v.splice(D,0,i);break}}else v.push(i)}function w(v){for(var i=v.byteLength,k=[],D=1;D<i-2;)v[D]===0&&v[D+1]===0&&v[D+2]===3?(k.push(D+2),D+=2):D++;if(k.length===0)return v;var c=i-k.length,b=new Uint8Array(c),x=0;for(D=0;D<c;x++,D++)x===k[0]&&(x++,k.shift()),b[D]=v[x];return b}m.default=f},"./src/errors.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"ErrorTypes",function(){return R}),S.d(m,"ErrorDetails",function(){return T});var R;(function(g){g.NETWORK_ERROR="networkError",g.MEDIA_ERROR="mediaError",g.KEY_SYSTEM_ERROR="keySystemError",g.MUX_ERROR="muxError",g.OTHER_ERROR="otherError"})(R||(R={}));var T;(function(g){g.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",g.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",g.KEY_SYSTEM_NO_SESSION="keySystemNoSession",g.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",g.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",g.MANIFEST_LOAD_ERROR="manifestLoadError",g.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",g.MANIFEST_PARSING_ERROR="manifestParsingError",g.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",g.LEVEL_EMPTY_ERROR="levelEmptyError",g.LEVEL_LOAD_ERROR="levelLoadError",g.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",g.LEVEL_SWITCH_ERROR="levelSwitchError",g.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",g.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",g.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",g.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",g.FRAG_LOAD_ERROR="fragLoadError",g.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",g.FRAG_DECRYPT_ERROR="fragDecryptError",g.FRAG_PARSING_ERROR="fragParsingError",g.REMUX_ALLOC_ERROR="remuxAllocError",g.KEY_LOAD_ERROR="keyLoadError",g.KEY_LOAD_TIMEOUT="keyLoadTimeOut",g.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",g.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",g.BUFFER_APPEND_ERROR="bufferAppendError",g.BUFFER_APPENDING_ERROR="bufferAppendingError",g.BUFFER_STALLED_ERROR="bufferStalledError",g.BUFFER_FULL_ERROR="bufferFullError",g.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",g.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",g.INTERNAL_EXCEPTION="internalException",g.INTERNAL_ABORTED="aborted",g.UNKNOWN="unknown"})(T||(T={}))},"./src/events.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"Events",function(){return R});var R;(function(T){T.MEDIA_ATTACHING="hlsMediaAttaching",T.MEDIA_ATTACHED="hlsMediaAttached",T.MEDIA_DETACHING="hlsMediaDetaching",T.MEDIA_DETACHED="hlsMediaDetached",T.BUFFER_RESET="hlsBufferReset",T.BUFFER_CODECS="hlsBufferCodecs",T.BUFFER_CREATED="hlsBufferCreated",T.BUFFER_APPENDING="hlsBufferAppending",T.BUFFER_APPENDED="hlsBufferAppended",T.BUFFER_EOS="hlsBufferEos",T.BUFFER_FLUSHING="hlsBufferFlushing",T.BUFFER_FLUSHED="hlsBufferFlushed",T.MANIFEST_LOADING="hlsManifestLoading",T.MANIFEST_LOADED="hlsManifestLoaded",T.MANIFEST_PARSED="hlsManifestParsed",T.LEVEL_SWITCHING="hlsLevelSwitching",T.LEVEL_SWITCHED="hlsLevelSwitched",T.LEVEL_LOADING="hlsLevelLoading",T.LEVEL_LOADED="hlsLevelLoaded",T.LEVEL_UPDATED="hlsLevelUpdated",T.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",T.LEVELS_UPDATED="hlsLevelsUpdated",T.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",T.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",T.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",T.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",T.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",T.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",T.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",T.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",T.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",T.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",T.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",T.CUES_PARSED="hlsCuesParsed",T.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",T.INIT_PTS_FOUND="hlsInitPtsFound",T.FRAG_LOADING="hlsFragLoading",T.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",T.FRAG_LOADED="hlsFragLoaded",T.FRAG_DECRYPTED="hlsFragDecrypted",T.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",T.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",T.FRAG_PARSING_METADATA="hlsFragParsingMetadata",T.FRAG_PARSED="hlsFragParsed",T.FRAG_BUFFERED="hlsFragBuffered",T.FRAG_CHANGED="hlsFragChanged",T.FPS_DROP="hlsFpsDrop",T.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",T.ERROR="hlsError",T.DESTROYING="hlsDestroying",T.KEY_LOADING="hlsKeyLoading",T.KEY_LOADED="hlsKeyLoaded",T.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",T.BACK_BUFFER_REACHED="hlsBackBufferReached"})(R||(R={}))},"./src/hls.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return v});var R=S("./node_modules/url-toolkit/src/url-toolkit.js"),T=S.n(R),g=S("./src/loader/playlist-loader.ts"),C=S("./src/loader/key-loader.ts"),p=S("./src/controller/id3-track-controller.ts"),s=S("./src/controller/latency-controller.ts"),a=S("./src/controller/level-controller.ts"),r=S("./src/controller/fragment-tracker.ts"),h=S("./src/controller/stream-controller.ts"),d=S("./src/is-supported.ts"),f=S("./src/utils/logger.ts"),E=S("./src/config.ts"),y=S("./node_modules/eventemitter3/index.js"),l=S.n(y),n=S("./src/events.ts"),o=S("./src/errors.ts");function u(i,k){for(var D=0;D<k.length;D++){var c=k[D];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(i,c.key,c)}}function w(i,k,D){return k&&u(i.prototype,k),D&&u(i,D),i}var v=function(){i.isSupported=function(){return Object(d.isSupported)()};function i(D){D===void 0&&(D={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new y.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var c=this.config=Object(E.mergeConfig)(i.DefaultConfig,D);this.userConfig=D,Object(f.enableLogs)(c.debug),this._autoLevelCapping=-1,c.progressive&&Object(E.enableStreamingMode)(c);var b=c.abrController,x=c.bufferController,_=c.capLevelController,j=c.fpsController,F=this.abrController=new b(this),L=this.bufferController=new x(this),X=this.capLevelController=new _(this),z=new j(this),H=new g.default(this),G=new C.default(this),U=new p.default(this),B=this.levelController=new a.default(this),W=new r.FragmentTracker(this),te=this.streamController=new h.default(this,W);X.setStreamController(te),z.setStreamController(te);var de=[B,te];this.networkControllers=de;var fe=[H,G,F,L,X,z,U,W];this.audioTrackController=this.createController(c.audioTrackController,null,de),this.createController(c.audioStreamController,W,de),this.subtitleTrackController=this.createController(c.subtitleTrackController,null,de),this.createController(c.subtitleStreamController,W,de),this.createController(c.timelineController,null,fe),this.emeController=this.createController(c.emeController,null,fe),this.cmcdController=this.createController(c.cmcdController,null,fe),this.latencyController=this.createController(s.default,null,fe),this.coreComponents=fe}var k=i.prototype;return k.createController=function(c,b,x){if(c){var _=b?new c(this,b):new c(this);return x&&x.push(_),_}return null},k.on=function(c,b,x){x===void 0&&(x=this),this._emitter.on(c,b,x)},k.once=function(c,b,x){x===void 0&&(x=this),this._emitter.once(c,b,x)},k.removeAllListeners=function(c){this._emitter.removeAllListeners(c)},k.off=function(c,b,x,_){x===void 0&&(x=this),this._emitter.off(c,b,x,_)},k.listeners=function(c){return this._emitter.listeners(c)},k.emit=function(c,b,x){return this._emitter.emit(c,b,x)},k.trigger=function(c,b){if(this.config.debug)return this.emit(c,c,b);try{return this.emit(c,c,b)}catch(x){f.logger.error("An internal error happened while handling event "+c+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(n.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:c,error:x})}return!1},k.listenerCount=function(c){return this._emitter.listenerCount(c)},k.destroy=function(){f.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(c){return c.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(c){return c.destroy()}),this.coreComponents.length=0},k.attachMedia=function(c){f.logger.log("attachMedia"),this._media=c,this.trigger(n.Events.MEDIA_ATTACHING,{media:c})},k.detachMedia=function(){f.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},k.loadSource=function(c){this.stopLoad();var b=this.media,x=this.url,_=this.url=R.buildAbsoluteURL(self.location.href,c,{alwaysNormalize:!0});f.logger.log("loadSource:"+_),b&&x&&x!==_&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(n.Events.MANIFEST_LOADING,{url:c})},k.startLoad=function(c){c===void 0&&(c=-1),f.logger.log("startLoad("+c+")"),this.networkControllers.forEach(function(b){b.startLoad(c)})},k.stopLoad=function(){f.logger.log("stopLoad"),this.networkControllers.forEach(function(c){c.stopLoad()})},k.swapAudioCodec=function(){f.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},k.recoverMediaError=function(){f.logger.log("recoverMediaError");var c=this._media;this.detachMedia(),c&&this.attachMedia(c)},k.removeLevel=function(c,b){b===void 0&&(b=0),this.levelController.removeLevel(c,b)},w(i,[{key:"levels",get:function(){var c=this.levelController.levels;return c||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(c){f.logger.log("set currentLevel:"+c),this.loadLevel=c,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(c){f.logger.log("set nextLevel:"+c),this.levelController.manualLevel=c,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(c){f.logger.log("set loadLevel:"+c),this.levelController.manualLevel=c}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(c){this.levelController.nextLoadLevel=c}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(c){f.logger.log("set firstLevel:"+c),this.levelController.firstLevel=c}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(c){f.logger.log("set startLevel:"+c),c!==-1&&(c=Math.max(c,this.minAutoLevel)),this.levelController.startLevel=c}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(c){var b=!!c;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(c){this._autoLevelCapping!==c&&(f.logger.log("set autoLevelCapping:"+c),this._autoLevelCapping=c)}},{key:"bandwidthEstimate",get:function(){var c=this.abrController.bwEstimator;return c?c.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var c=this.levels,b=this.config.minAutoBitrate;if(!c)return 0;for(var x=c.length,_=0;_<x;_++)if(c[_].maxBitrate>b)return _;return 0}},{key:"maxAutoLevel",get:function(){var c=this.levels,b=this.autoLevelCapping,x;return b===-1&&c&&c.length?x=c.length-1:x=b,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(c){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,c)}},{key:"audioTracks",get:function(){var c=this.audioTrackController;return c?c.audioTracks:[]}},{key:"audioTrack",get:function(){var c=this.audioTrackController;return c?c.audioTrack:-1},set:function(c){var b=this.audioTrackController;b&&(b.audioTrack=c)}},{key:"subtitleTracks",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTrack:-1},set:function(c){var b=this.subtitleTrackController;b&&(b.subtitleTrack=c)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var c=this.subtitleTrackController;return c?c.subtitleDisplay:!1},set:function(c){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=c)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(c){this.config.lowLatencyMode=c}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return n.Events}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return i.defaultConfig?i.defaultConfig:E.hlsDefaultConfig},set:function(c){i.defaultConfig=c}}]),i}();v.defaultConfig=void 0},"./src/is-supported.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"isSupported",function(){return g}),S.d(m,"changeTypeSupported",function(){return C});var R=S("./src/utils/mediasource-helper.ts");function T(){return self.SourceBuffer||self.WebKitSourceBuffer}function g(){var p=Object(R.getMediaSource)();if(!p)return!1;var s=T(),a=p&&typeof p.isTypeSupported=="function"&&p.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!s||s.prototype&&typeof s.prototype.appendBuffer=="function"&&typeof s.prototype.remove=="function";return!!a&&!!r}function C(){var p,s=T();return typeof(s==null||((p=s.prototype)===null||p===void 0)?void 0:p.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return f}),S.d(m,"LoadError",function(){return y});var R=S("./src/polyfills/number.ts"),T=S("./src/errors.ts");function g(l,n){l.prototype=Object.create(n.prototype),l.prototype.constructor=l,r(l,n)}function C(l){var n=typeof Map=="function"?new Map:void 0;return C=function(u){if(u===null||!a(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(u))return n.get(u);n.set(u,w)}function w(){return p(u,arguments,h(this).constructor)}return w.prototype=Object.create(u.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),r(w,u)},C(l)}function p(l,n,o){return s()?p=Reflect.construct:p=function(w,v,i){var k=[null];k.push.apply(k,v);var D=Function.bind.apply(w,k),c=new D;return i&&r(c,i.prototype),c},p.apply(null,arguments)}function s(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function a(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function r(l,n){return r=Object.setPrototypeOf||function(u,w){return u.__proto__=w,u},r(l,n)}function h(l){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},h(l)}var d=Math.pow(2,17),f=function(){function l(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var n=l.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(u,w){var v=this,i=u.url;if(!i)return Promise.reject(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,networkDetails:null},"Fragment does not have a "+(i?"part list":"url")));this.abort();var k=this.config,D=k.fLoader,c=k.loader;return new Promise(function(b,x){v.loader&&v.loader.destroy();var _=v.loader=u.loader=D?new D(k):new c(k),j=E(u),F={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:d};u.stats=_.stats,_.load(j,F,{onSuccess:function(X,z,H,G){v.resetLoader(u,_),b({frag:u,part:null,payload:X.data,networkDetails:G})},onError:function(X,z,H){v.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,response:X,networkDetails:H}))},onAbort:function(X,z,H){v.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,networkDetails:H}))},onTimeout:function(X,z,H){v.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,networkDetails:H}))},onProgress:function(X,z,H,G){w&&w({frag:u,part:null,payload:H,networkDetails:G})}})})},n.loadPart=function(u,w,v){var i=this;this.abort();var k=this.config,D=k.fLoader,c=k.loader;return new Promise(function(b,x){i.loader&&i.loader.destroy();var _=i.loader=u.loader=D?new D(k):new c(k),j=E(u,w),F={timeout:k.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:k.fragLoadingMaxRetryTimeout,highWaterMark:d};w.stats=_.stats,_.load(j,F,{onSuccess:function(X,z,H,G){i.resetLoader(u,_),i.updateStatsFromPart(u,w);var U={frag:u,part:w,payload:X.data,networkDetails:G};v(U),b(U)},onError:function(X,z,H){i.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,part:w,response:X,networkDetails:H}))},onAbort:function(X,z,H){u.stats.aborted=w.stats.aborted,i.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,part:w,networkDetails:H}))},onTimeout:function(X,z,H){i.resetLoader(u,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,part:w,networkDetails:H}))}})})},n.updateStatsFromPart=function(u,w){var v=u.stats,i=w.stats,k=i.total;if(v.loaded+=i.loaded,k){var D=Math.round(u.duration/w.duration),c=Math.min(Math.round(v.loaded/k),D),b=D-c,x=b*Math.round(v.loaded/c);v.total=v.loaded+x}else v.total=Math.max(v.loaded,v.total);var _=v.loading,j=i.loading;_.start?_.first+=j.first-j.start:(_.start=j.start,_.first=j.first),_.end=j.end},n.resetLoader=function(u,w){u.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},l}();function E(l,n){n===void 0&&(n=null);var o=n||l,u={frag:l,part:n,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},w=o.byteRangeStartOffset,v=o.byteRangeEndOffset;return Object(R.isFiniteNumber)(w)&&Object(R.isFiniteNumber)(v)&&(u.rangeStart=w,u.rangeEnd=v),u}var y=function(l){g(n,l);function n(o){for(var u,w=arguments.length,v=new Array(w>1?w-1:0),i=1;i<w;i++)v[i-1]=arguments[i];return u=l.call.apply(l,[this].concat(v))||this,u.data=void 0,u.data=o,u}return n}(C(Error))},"./src/loader/fragment.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"ElementaryStreamTypes",function(){return f}),S.d(m,"BaseSegment",function(){return E}),S.d(m,"Fragment",function(){return y}),S.d(m,"Part",function(){return l});var R=S("./src/polyfills/number.ts"),T=S("./node_modules/url-toolkit/src/url-toolkit.js"),g=S.n(T),C=S("./src/utils/logger.ts"),p=S("./src/loader/level-key.ts"),s=S("./src/loader/load-stats.ts");function a(n,o){n.prototype=Object.create(o.prototype),n.prototype.constructor=n,r(n,o)}function r(n,o){return r=Object.setPrototypeOf||function(w,v){return w.__proto__=v,w},r(n,o)}function h(n,o){for(var u=0;u<o.length;u++){var w=o[u];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}function d(n,o,u){return o&&h(n.prototype,o),u&&h(n,u),n}var f;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(f||(f={}));var E=function(){function n(u){var w;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(w={},w[f.AUDIO]=null,w[f.VIDEO]=null,w[f.AUDIOVIDEO]=null,w),this.baseurl=u}var o=n.prototype;return o.setByteRange=function(w,v){var i=w.split("@",2),k=[];i.length===1?k[0]=v?v.byteRangeEndOffset:0:k[0]=parseInt(i[1]),k[1]=parseInt(i[0])+k[0],this._byteRange=k},d(n,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(T.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(w){this._url=w}}]),n}(),y=function(n){a(o,n);function o(w,v){var i;return i=n.call(this,v)||this,i._decryptdata=null,i.rawProgramDateTime=null,i.programDateTime=null,i.tagList=[],i.duration=0,i.sn=0,i.levelkey=void 0,i.type=void 0,i.loader=null,i.level=-1,i.cc=0,i.startPTS=void 0,i.endPTS=void 0,i.appendedPTS=void 0,i.startDTS=void 0,i.endDTS=void 0,i.start=0,i.deltaPTS=void 0,i.maxStartPTS=void 0,i.minEndPTS=void 0,i.stats=new s.LoadStats,i.urlId=0,i.data=void 0,i.bitrateTest=!1,i.title=null,i.initSegment=null,i.type=w,i}var u=o.prototype;return u.createInitializationVector=function(v){for(var i=new Uint8Array(16),k=12;k<16;k++)i[k]=v>>8*(15-k)&255;return i},u.setDecryptDataFromLevelKey=function(v,i){var k=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(k=p.LevelKey.fromURI(v.uri),k.method=v.method,k.iv=this.createInitializationVector(i),k.keyFormat="identity"),k},u.setElementaryStreamInfo=function(v,i,k,D,c,b){b===void 0&&(b=!1);var x=this.elementaryStreams,_=x[v];if(!_){x[v]={startPTS:i,endPTS:k,startDTS:D,endDTS:c,partial:b};return}_.startPTS=Math.min(_.startPTS,i),_.endPTS=Math.max(_.endPTS,k),_.startDTS=Math.min(_.startDTS,D),_.endDTS=Math.max(_.endDTS,c)},u.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[f.AUDIO]=null,v[f.VIDEO]=null,v[f.AUDIOVIDEO]=null},d(o,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&C.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(R.isFiniteNumber)(this.programDateTime))return null;var v=Object(R.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),o}(E),l=function(n){a(o,n);function o(u,w,v,i,k){var D;D=n.call(this,v)||this,D.fragOffset=0,D.duration=0,D.gap=!1,D.independent=!1,D.relurl=void 0,D.fragment=void 0,D.index=void 0,D.stats=new s.LoadStats,D.duration=u.decimalFloatingPoint("DURATION"),D.gap=u.bool("GAP"),D.independent=u.bool("INDEPENDENT"),D.relurl=u.enumeratedString("URI"),D.fragment=w,D.index=i;var c=u.enumeratedString("BYTERANGE");return c&&D.setByteRange(c,k),k&&(D.fragOffset=k.fragOffset+k.duration),D}return d(o,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var w=this.elementaryStreams;return!!(w.audio||w.video||w.audiovideo)}}]),o}(E)},"./src/loader/key-loader.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return C});var R=S("./src/events.ts"),T=S("./src/errors.ts"),g=S("./src/utils/logger.ts"),C=function(){function p(a){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=a,this._registerListeners()}var s=p.prototype;return s._registerListeners=function(){this.hls.on(R.Events.KEY_LOADING,this.onKeyLoading,this)},s._unregisterListeners=function(){this.hls.off(R.Events.KEY_LOADING,this.onKeyLoading)},s.destroy=function(){this._unregisterListeners();for(var r in this.loaders){var h=this.loaders[r];h&&h.destroy()}this.loaders={}},s.onKeyLoading=function(r,h){var d=h.frag,f=d.type,E=this.loaders[f];if(!d.decryptdata){g.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var y=d.decryptdata.uri;if(y!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(E&&(g.logger.warn("abort previous key loader for type:"+f),E.abort()),!y){g.logger.warn("key uri is falsy");return}var n=l.loader,o=d.loader=this.loaders[f]=new n(l);this.decrypturl=y,this.decryptkey=null;var u={url:y,frag:d,responseType:"arraybuffer"},w={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(u,w,v)}else this.decryptkey&&(d.decryptdata.key=this.decryptkey,this.hls.trigger(R.Events.KEY_LOADED,{frag:d}))},s.loadsuccess=function(r,h,d){var f=d.frag;if(!f.decryptdata){g.logger.error("after key load, decryptdata unset");return}this.decryptkey=f.decryptdata.key=new Uint8Array(r.data),f.loader=null,delete this.loaders[f.type],this.hls.trigger(R.Events.KEY_LOADED,{frag:f})},s.loaderror=function(r,h){var d=h.frag,f=d.loader;f&&f.abort(),delete this.loaders[d.type],this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:d,response:r})},s.loadtimeout=function(r,h){var d=h.frag,f=d.loader;f&&f.abort(),delete this.loaders[d.type],this.hls.trigger(R.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:d})},p}()},"./src/loader/level-details.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"LevelDetails",function(){return p});var R=S("./src/polyfills/number.ts");function T(s,a){for(var r=0;r<a.length;r++){var h=a[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(s,h.key,h)}}function g(s,a,r){return a&&T(s.prototype,a),r&&T(s,r),s}var C=10,p=function(){function s(r){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=r}var a=s.prototype;return a.reloaded=function(h){if(!h){this.advanced=!0,this.updated=!0;return}var d=this.lastPartSn-h.lastPartSn,f=this.lastPartIndex-h.lastPartIndex;this.updated=this.endSN!==h.endSN||!!f||!!d,this.advanced=this.endSN>h.endSN||d>0||d===0&&f>0,this.updated||this.advanced?this.misses=Math.floor(h.misses*.6):this.misses=h.misses+1,this.availabilityDelay=h.availabilityDelay},g(s,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(R.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||C}},{key:"drift",get:function(){var h=this.driftEndTime-this.driftStartTime;if(h>0){var d=this.driftEnd-this.driftStart;return d*1e3/h}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var h;return(h=this.fragments)!==null&&h!==void 0&&h.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 h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),s}()},"./src/loader/level-key.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"LevelKey",function(){return p});var R=S("./node_modules/url-toolkit/src/url-toolkit.js"),T=S.n(R);function g(s,a){for(var r=0;r<a.length;r++){var h=a[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(s,h.key,h)}}function C(s,a,r){return a&&g(s.prototype,a),r&&g(s,r),s}var p=function(){s.fromURL=function(r,h){return new s(r,h)},s.fromURI=function(r){return new s(r)};function s(a,r){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,r?this._uri=Object(R.buildAbsoluteURL)(a,r,{alwaysNormalize:!0}):this._uri=a}return C(s,[{key:"uri",get:function(){return this._uri}}]),s}()},"./src/loader/load-stats.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"LoadStats",function(){return R});var R=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(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return o});var R=S("./src/polyfills/number.ts"),T=S("./node_modules/url-toolkit/src/url-toolkit.js"),g=S.n(T),C=S("./src/loader/fragment.ts"),p=S("./src/loader/level-details.ts"),s=S("./src/loader/level-key.ts"),a=S("./src/utils/attr-list.ts"),r=S("./src/utils/logger.ts"),h=S("./src/utils/codecs.ts"),d=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,f=/#EXT-X-MEDIA:(.*)/g,E=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),y=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function n(k){var D,c;return l.test((D=(c=T.parseURL(k))===null||c===void 0?void 0:c.path)!=null?D:"")}var o=function(){function k(){}return k.findGroup=function(c,b){for(var x=0;x<c.length;x++){var _=c[x];if(_.id===b)return _}},k.convertAVC1ToAVCOTI=function(c){var b=c.split(".");if(b.length>2){var x=b.shift()+".";return x+=parseInt(b.shift()).toString(16),x+=("000"+parseInt(b.shift()).toString(16)).substr(-4),x}return c},k.resolve=function(c,b){return T.buildAbsoluteURL(b,c,{alwaysNormalize:!0})},k.parseMasterPlaylist=function(c,b){var x=[],_={},j=!1;d.lastIndex=0;for(var F;(F=d.exec(c))!=null;)if(F[1]){var L=new a.AttrList(F[1]),X={attrs:L,bitrate:L.decimalInteger("AVERAGE-BANDWIDTH")||L.decimalInteger("BANDWIDTH"),name:L.NAME,url:k.resolve(F[2],b)},z=L.decimalResolution("RESOLUTION");z&&(X.width=z.width,X.height=z.height),u((L.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),X),X.videoCodec&&X.videoCodec.indexOf("avc1")!==-1&&(X.videoCodec=k.convertAVC1ToAVCOTI(X.videoCodec)),x.push(X)}else if(F[3]){var H=new a.AttrList(F[3]);H["DATA-ID"]&&(j=!0,_[H["DATA-ID"]]=H)}return{levels:x,sessionData:j?_:null}},k.parseMasterPlaylistMedia=function(c,b,x,_){_===void 0&&(_=[]);var j,F=[],L=0;for(f.lastIndex=0;(j=f.exec(c))!==null;){var X=new a.AttrList(j[1]);if(X.TYPE===x){var z={attrs:X,bitrate:0,id:L++,groupId:X["GROUP-ID"],instreamId:X["INSTREAM-ID"],name:X.NAME||X.LANGUAGE||"",type:x,default:X.bool("DEFAULT"),autoselect:X.bool("AUTOSELECT"),forced:X.bool("FORCED"),lang:X.LANGUAGE,url:X.URI?k.resolve(X.URI,b):""};if(_.length){var H=k.findGroup(_,z.groupId)||_[0];w(z,H,"audioCodec"),w(z,H,"textCodec")}F.push(z)}}return F},k.parseLevelPlaylist=function(c,b,x,_,j){var F=new p.LevelDetails(b),L=F.fragments,X=null,z=0,H=0,G=0,U=0,B=null,W=new C.Fragment(_,b),te,de,fe,be=-1,Ce=!1;for(E.lastIndex=0,F.m3u8=c;(te=E.exec(c))!==null;){Ce&&(Ce=!1,W=new C.Fragment(_,b),W.start=G,W.sn=z,W.cc=U,W.level=x,X&&(W.initSegment=X,W.rawProgramDateTime=X.rawProgramDateTime));var ue=te[1];if(ue){W.duration=parseFloat(ue);var ge=(" "+te[2]).slice(1);W.title=ge||null,W.tagList.push(ge?["INF",ue,ge]:["INF",ue])}else if(te[3])Object(R.isFiniteNumber)(W.duration)&&(W.start=G,fe&&(W.levelkey=fe),W.sn=z,W.level=x,W.cc=U,W.urlId=j,L.push(W),W.relurl=(" "+te[3]).slice(1),i(W,B),B=W,G+=W.duration,z++,H=0,Ce=!0);else if(te[4]){var pe=(" "+te[4]).slice(1);B?W.setByteRange(pe,B):W.setByteRange(pe)}else if(te[5])W.rawProgramDateTime=(" "+te[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),be===-1&&(be=L.length);else{if(te=te[0].match(y),!te){r.logger.warn("No matches on slow regex match for level playlist!");continue}for(de=1;de<te.length&&!(typeof te[de]!="undefined");de++);var oe=(" "+te[de]).slice(1),ae=(" "+te[de+1]).slice(1),re=te[de+2]?(" "+te[de+2]).slice(1):"";switch(oe){case"PLAYLIST-TYPE":F.type=ae.toUpperCase();break;case"MEDIA-SEQUENCE":z=F.startSN=parseInt(ae);break;case"SKIP":{var he=new a.AttrList(ae),Q=he.decimalInteger("SKIPPED-SEGMENTS");if(Object(R.isFiniteNumber)(Q)){F.skippedSegments=Q;for(var ie=Q;ie--;)L.unshift(null);z+=Q}var we=he.enumeratedString("RECENTLY-REMOVED-DATERANGES");we&&(F.recentlyRemovedDateranges=we.split(" "));break}case"TARGETDURATION":F.targetduration=parseFloat(ae);break;case"VERSION":F.version=parseInt(ae);break;case"EXTM3U":break;case"ENDLIST":F.live=!1;break;case"#":(ae||re)&&W.tagList.push(re?[ae,re]:[ae]);break;case"DIS":U++;case"GAP":W.tagList.push([oe]);break;case"BITRATE":W.tagList.push([oe,ae]);break;case"DISCONTINUITY-SEQ":U=parseInt(ae);break;case"KEY":{var ne,J=new a.AttrList(ae),V=J.enumeratedString("METHOD"),Z=J.URI,Ee=J.hexadecimalInteger("IV"),xe=J.enumeratedString("KEYFORMATVERSIONS"),_e=J.enumeratedString("KEYID"),Ne=(ne=J.enumeratedString("KEYFORMAT"))!=null?ne:"identity",Be=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Be.indexOf(Ne)>-1){r.logger.warn("Keyformat "+Ne+" is not supported from the manifest");continue}else if(Ne!=="identity")continue;V&&(fe=s.LevelKey.fromURL(b,Z),Z&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(V)>=0&&(fe.method=V,fe.keyFormat=Ne,_e&&(fe.keyID=_e),xe&&(fe.keyFormatVersions=xe),fe.iv=Ee));break}case"START":{var We=new a.AttrList(ae),Ue=We.decimalFloatingPoint("TIME-OFFSET");Object(R.isFiniteNumber)(Ue)&&(F.startTimeOffset=Ue);break}case"MAP":{var ze=new a.AttrList(ae);W.relurl=ze.URI,ze.BYTERANGE&&W.setByteRange(ze.BYTERANGE),W.level=x,W.sn="initSegment",fe&&(W.levelkey=fe),W.initSegment=null,X=W,Ce=!0;break}case"SERVER-CONTROL":{var Ke=new a.AttrList(ae);F.canBlockReload=Ke.bool("CAN-BLOCK-RELOAD"),F.canSkipUntil=Ke.optionalFloat("CAN-SKIP-UNTIL",0),F.canSkipDateRanges=F.canSkipUntil>0&&Ke.bool("CAN-SKIP-DATERANGES"),F.partHoldBack=Ke.optionalFloat("PART-HOLD-BACK",0),F.holdBack=Ke.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ye=new a.AttrList(ae);F.partTarget=Ye.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Re=F.partList;Re||(Re=F.partList=[]);var tt=H>0?Re[Re.length-1]:void 0,rt=H++,He=new C.Part(new a.AttrList(ae),W,b,rt,tt);Re.push(He),W.duration+=He.duration;break}case"PRELOAD-HINT":{var $e=new a.AttrList(ae);F.preloadHint=$e;break}case"RENDITION-REPORT":{var Ie=new a.AttrList(ae);F.renditionReports=F.renditionReports||[],F.renditionReports.push(Ie);break}default:r.logger.warn("line parsed but not handled: "+te);break}}}B&&!B.relurl?(L.pop(),G-=B.duration,F.partList&&(F.fragmentHint=B)):F.partList&&(i(W,B),W.cc=U,F.fragmentHint=W);var Oe=L.length,Le=L[0],Te=L[Oe-1];if(G+=F.skippedSegments*F.targetduration,G>0&&Oe&&Te){F.averagetargetduration=G/Oe;var Ae=Te.sn;F.endSN=Ae!=="initSegment"?Ae:0,Le&&(F.startCC=Le.cc,Le.initSegment||F.fragments.every(function(De){return De.relurl&&n(De.relurl)})&&(r.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new C.Fragment(_,b),W.relurl=Te.relurl,W.level=x,W.sn="initSegment",Le.initSegment=W,F.needSidxRanges=!0))}else F.endSN=0,F.startCC=0;return F.fragmentHint&&(G+=F.fragmentHint.duration),F.totalduration=G,F.endCC=U,be>0&&v(L,be),F},k}();function u(k,D){["video","audio","text"].forEach(function(c){var b=k.filter(function(_){return Object(h.isCodecType)(_,c)});if(b.length){var x=b.filter(function(_){return _.lastIndexOf("avc1",0)===0||_.lastIndexOf("mp4a",0)===0});D[c+"Codec"]=x.length>0?x[0]:b[0],k=k.filter(function(_){return b.indexOf(_)===-1})}}),D.unknownCodecs=k}function w(k,D,c){var b=D[c];b&&(k[c]=b)}function v(k,D){for(var c=k[D],b=D;b--;){var x=k[b];if(!x)return;x.programDateTime=c.programDateTime-x.duration*1e3,c=x}}function i(k,D){k.rawProgramDateTime?k.programDateTime=Date.parse(k.rawProgramDateTime):D!=null&&D.programDateTime&&(k.programDateTime=D.endProgramDateTime),Object(R.isFiniteNumber)(k.programDateTime)||(k.programDateTime=null,k.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),g=S("./src/errors.ts"),C=S("./src/utils/logger.ts"),p=S("./src/utils/mp4-tools.ts"),s=S("./src/loader/m3u8-parser.ts"),a=S("./src/types/loader.ts"),r=S("./src/utils/attr-list.ts");function h(E){var y=E.type;switch(y){case a.PlaylistContextType.AUDIO_TRACK:return a.PlaylistLevelType.AUDIO;case a.PlaylistContextType.SUBTITLE_TRACK:return a.PlaylistLevelType.SUBTITLE;default:return a.PlaylistLevelType.MAIN}}function d(E,y){var l=E.url;return(l===void 0||l.indexOf("data:")===0)&&(l=y.url),l}var f=function(){function E(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var y=E.prototype;return y.registerListeners=function(){var n=this.hls;n.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(T.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.unregisterListeners=function(){var n=this.hls;n.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(T.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.createInternalLoader=function(n){var o=this.hls.config,u=o.pLoader,w=o.loader,v=u||w,i=new v(o);return n.loader=i,this.loaders[n.type]=i,i},y.getInternalLoader=function(n){return this.loaders[n.type]},y.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},y.destroyInternalLoaders=function(){for(var n in this.loaders){var o=this.loaders[n];o&&o.destroy(),this.resetInternalLoader(n)}},y.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},y.onManifestLoading=function(n,o){var u=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:a.PlaylistContextType.MANIFEST,url:u,deliveryDirectives:null})},y.onLevelLoading=function(n,o){var u=o.id,w=o.level,v=o.url,i=o.deliveryDirectives;this.load({id:u,groupId:null,level:w,responseType:"text",type:a.PlaylistContextType.LEVEL,url:v,deliveryDirectives:i})},y.onAudioTrackLoading=function(n,o){var u=o.id,w=o.groupId,v=o.url,i=o.deliveryDirectives;this.load({id:u,groupId:w,level:null,responseType:"text",type:a.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:i})},y.onSubtitleTrackLoading=function(n,o){var u=o.id,w=o.groupId,v=o.url,i=o.deliveryDirectives;this.load({id:u,groupId:w,level:null,responseType:"text",type:a.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:i})},y.load=function(n){var o,u=this.hls.config,w=this.getInternalLoader(n);if(w){var v=w.context;if(v&&v.url===n.url){C.logger.trace("[playlist-loader]: playlist request ongoing");return}C.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),w.abort()}var i,k,D,c;switch(n.type){case a.PlaylistContextType.MANIFEST:i=u.manifestLoadingMaxRetry,k=u.manifestLoadingTimeOut,D=u.manifestLoadingRetryDelay,c=u.manifestLoadingMaxRetryTimeout;break;case a.PlaylistContextType.LEVEL:case a.PlaylistContextType.AUDIO_TRACK:case a.PlaylistContextType.SUBTITLE_TRACK:i=0,k=u.levelLoadingTimeOut;break;default:i=u.levelLoadingMaxRetry,k=u.levelLoadingTimeOut,D=u.levelLoadingRetryDelay,c=u.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(n),(o=n.deliveryDirectives)!==null&&o!==void 0&&o.part){var b;if(n.type===a.PlaylistContextType.LEVEL&&n.level!==null?b=this.hls.levels[n.level].details:n.type===a.PlaylistContextType.AUDIO_TRACK&&n.id!==null?b=this.hls.audioTracks[n.id].details:n.type===a.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(b=this.hls.subtitleTracks[n.id].details),b){var x=b.partTarget,_=b.targetduration;x&&_&&(k=Math.min(Math.max(x*3,_*.8)*1e3,k))}}var j={timeout:k,maxRetry:i,retryDelay:D,maxRetryDelay:c,highWaterMark:0},F={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(n,j,F)},y.loadsuccess=function(n,o,u,w){if(w===void 0&&(w=null),u.isSidxRequest){this.handleSidxRequest(n,u),this.handlePlaylistLoaded(n,o,u,w);return}this.resetInternalLoader(u.type);var v=n.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,u,"no EXTM3U delimiter",w);return}o.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,o,u,w):this.handleMasterPlaylist(n,o,u,w)},y.loaderror=function(n,o,u){u===void 0&&(u=null),this.handleNetworkError(o,u,!1,n)},y.loadtimeout=function(n,o,u){u===void 0&&(u=null),this.handleNetworkError(o,u,!0)},y.handleMasterPlaylist=function(n,o,u,w){var v=this.hls,i=n.data,k=d(n,u),D=s.default.parseMasterPlaylist(i,k),c=D.levels,b=D.sessionData;if(!c.length){this.handleManifestParsingError(n,u,"no level found in manifest",w);return}var x=c.map(function(z){return{id:z.attrs.AUDIO,audioCodec:z.audioCodec}}),_=c.map(function(z){return{id:z.attrs.SUBTITLES,textCodec:z.textCodec}}),j=s.default.parseMasterPlaylistMedia(i,k,"AUDIO",x),F=s.default.parseMasterPlaylistMedia(i,k,"SUBTITLES",_),L=s.default.parseMasterPlaylistMedia(i,k,"CLOSED-CAPTIONS");if(j.length){var X=j.some(function(z){return!z.url});!X&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(C.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),j.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new r.AttrList({}),bitrate:0,url:""}))}v.trigger(T.Events.MANIFEST_LOADED,{levels:c,audioTracks:j,subtitles:F,captions:L,url:k,stats:o,networkDetails:w,sessionData:b})},y.handleTrackOrLevelPlaylist=function(n,o,u,w){var v=this.hls,i=u.id,k=u.level,D=u.type,c=d(n,u),b=Object(R.isFiniteNumber)(i)?i:0,x=Object(R.isFiniteNumber)(k)?k:b,_=h(u),j=s.default.parseLevelPlaylist(n.data,c,x,_,b);if(!j.fragments.length){v.trigger(T.Events.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:c,reason:"no fragments found in level",level:typeof u.level=="number"?u.level:void 0});return}if(D===a.PlaylistContextType.MANIFEST){var F={attrs:new r.AttrList({}),bitrate:0,details:j,name:"",url:c};v.trigger(T.Events.MANIFEST_LOADED,{levels:[F],audioTracks:[],url:c,stats:o,networkDetails:w,sessionData:null})}if(o.parsing.end=performance.now(),j.needSidxRanges){var L,X=(L=j.fragments[0].initSegment)===null||L===void 0?void 0:L.url;this.load({url:X,isSidxRequest:!0,type:D,level:k,levelDetails:j,id:i,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}u.levelDetails=j,this.handlePlaylistLoaded(n,o,u,w)},y.handleSidxRequest=function(n,o){var u=Object(p.parseSegmentIndex)(new Uint8Array(n.data));if(!u)return;var w=u.references,v=o.levelDetails;w.forEach(function(i,k){var D=i.info,c=v.fragments[k];c.byteRange.length===0&&c.setByteRange(String(1+D.end-D.start)+"@"+String(D.start)),c.initSegment&&c.initSegment.setByteRange(String(u.moovEndOffset)+"@0")})},y.handleManifestParsingError=function(n,o,u,w){this.hls.trigger(T.Events.ERROR,{type:g.ErrorTypes.NETWORK_ERROR,details:g.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===a.PlaylistContextType.MANIFEST,url:n.url,reason:u,response:n,context:o,networkDetails:w})},y.handleNetworkError=function(n,o,u,w){u===void 0&&(u=!1),C.logger.warn("[playlist-loader]: A network "+(u?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var v=g.ErrorDetails.UNKNOWN,i=!1,k=this.getInternalLoader(n);switch(n.type){case a.PlaylistContextType.MANIFEST:v=u?g.ErrorDetails.MANIFEST_LOAD_TIMEOUT:g.ErrorDetails.MANIFEST_LOAD_ERROR,i=!0;break;case a.PlaylistContextType.LEVEL:v=u?g.ErrorDetails.LEVEL_LOAD_TIMEOUT:g.ErrorDetails.LEVEL_LOAD_ERROR,i=!1;break;case a.PlaylistContextType.AUDIO_TRACK:v=u?g.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,i=!1;break;case a.PlaylistContextType.SUBTITLE_TRACK:v=u?g.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:g.ErrorDetails.SUBTITLE_LOAD_ERROR,i=!1;break}k&&this.resetInternalLoader(n.type);var D={type:g.ErrorTypes.NETWORK_ERROR,details:v,fatal:i,url:n.url,loader:k,context:n,networkDetails:o};w&&(D.response=w),this.hls.trigger(T.Events.ERROR,D)},y.handlePlaylistLoaded=function(n,o,u,w){var v=u.type,i=u.level,k=u.id,D=u.groupId,c=u.loader,b=u.levelDetails,x=u.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(n,u,"invalid target duration",w);return}if(!c)return;b.live&&(c.getCacheAge&&(b.ageHeader=c.getCacheAge()||0),(!c.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(v){case a.PlaylistContextType.MANIFEST:case a.PlaylistContextType.LEVEL:this.hls.trigger(T.Events.LEVEL_LOADED,{details:b,level:i||0,id:k||0,stats:o,networkDetails:w,deliveryDirectives:x});break;case a.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(T.Events.AUDIO_TRACK_LOADED,{details:b,id:k||0,groupId:D||"",stats:o,networkDetails:w,deliveryDirectives:x});break;case a.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(T.Events.SUBTITLE_TRACK_LOADED,{details:b,id:k||0,groupId:D||"",stats:o,networkDetails:w,deliveryDirectives:x});break}},E}();m.default=f},"./src/polyfills/number.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"isFiniteNumber",function(){return R}),S.d(m,"MAX_SAFE_INTEGER",function(){return T});var R=Number.isFinite||function(g){return typeof g=="number"&&isFinite(g)},T=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(P,m,S){"use strict";S.r(m);var R=function(){function T(){}return T.getSilentFrame=function(C,p){switch(C){case"mp4a.40.2":if(p===1)return new Uint8Array([0,200,0,128,35,128]);if(p===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(p===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(p===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(p===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(p===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(p===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(p===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(p===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},T}();m.default=R},"./src/remux/mp4-generator.ts":function(P,m,S){"use strict";S.r(m);var R=Math.pow(2,32)-1,T=function(){function g(){}return g.init=function(){g.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 p;for(p in g.types)g.types.hasOwnProperty(p)&&(g.types[p]=[p.charCodeAt(0),p.charCodeAt(1),p.charCodeAt(2),p.charCodeAt(3)]);var s=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),a=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);g.HDLR_TYPES={video:s,audio:a};var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),h=new Uint8Array([0,0,0,0,0,0,0,0]);g.STTS=g.STSC=g.STCO=h,g.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),g.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),g.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),g.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var d=new Uint8Array([105,115,111,109]),f=new Uint8Array([97,118,99,49]),E=new Uint8Array([0,0,0,1]);g.FTYP=g.box(g.types.ftyp,d,E,d,f),g.DINF=g.box(g.types.dinf,g.box(g.types.dref,r))},g.box=function(p){for(var s=8,a=arguments.length,r=new Array(a>1?a-1:0),h=1;h<a;h++)r[h-1]=arguments[h];for(var d=r.length,f=d;d--;)s+=r[d].byteLength;var E=new Uint8Array(s);for(E[0]=s>>24&255,E[1]=s>>16&255,E[2]=s>>8&255,E[3]=s&255,E.set(p,4),d=0,s=8;d<f;d++)E.set(r[d],s),s+=r[d].byteLength;return E},g.hdlr=function(p){return g.box(g.types.hdlr,g.HDLR_TYPES[p])},g.mdat=function(p){return g.box(g.types.mdat,p)},g.mdhd=function(p,s){s*=p;var a=Math.floor(s/(R+1)),r=Math.floor(s%(R+1));return g.box(g.types.mdhd,new Uint8Array([1,0,0,0,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,a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))},g.mdia=function(p){return g.box(g.types.mdia,g.mdhd(p.timescale,p.duration),g.hdlr(p.type),g.minf(p))},g.mfhd=function(p){return g.box(g.types.mfhd,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255]))},g.minf=function(p){return p.type==="audio"?g.box(g.types.minf,g.box(g.types.smhd,g.SMHD),g.DINF,g.stbl(p)):g.box(g.types.minf,g.box(g.types.vmhd,g.VMHD),g.DINF,g.stbl(p))},g.moof=function(p,s,a){return g.box(g.types.moof,g.mfhd(p),g.traf(a,s))},g.moov=function(p){for(var s=p.length,a=[];s--;)a[s]=g.trak(p[s]);return g.box.apply(null,[g.types.moov,g.mvhd(p[0].timescale,p[0].duration)].concat(a).concat(g.mvex(p)))},g.mvex=function(p){for(var s=p.length,a=[];s--;)a[s]=g.trex(p[s]);return g.box.apply(null,[g.types.mvex].concat(a))},g.mvhd=function(p,s){s*=p;var a=Math.floor(s/(R+1)),r=Math.floor(s%(R+1)),h=new Uint8Array([1,0,0,0,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,a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return g.box(g.types.mvhd,h)},g.sdtp=function(p){var s=p.samples||[],a=new Uint8Array(4+s.length),r,h;for(r=0;r<s.length;r++)h=s[r].flags,a[r+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return g.box(g.types.sdtp,a)},g.stbl=function(p){return g.box(g.types.stbl,g.stsd(p),g.box(g.types.stts,g.STTS),g.box(g.types.stsc,g.STSC),g.box(g.types.stsz,g.STSZ),g.box(g.types.stco,g.STCO))},g.avc1=function(p){var s=[],a=[],r,h,d;for(r=0;r<p.sps.length;r++)h=p.sps[r],d=h.byteLength,s.push(d>>>8&255),s.push(d&255),s=s.concat(Array.prototype.slice.call(h));for(r=0;r<p.pps.length;r++)h=p.pps[r],d=h.byteLength,a.push(d>>>8&255),a.push(d&255),a=a.concat(Array.prototype.slice.call(h));var f=g.box(g.types.avcC,new Uint8Array([1,s[3],s[4],s[5],252|3,224|p.sps.length].concat(s).concat([p.pps.length]).concat(a))),E=p.width,y=p.height,l=p.pixelRatio[0],n=p.pixelRatio[1];return g.box(g.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,E>>8&255,E&255,y>>8&255,y&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),f,g.box(g.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),g.box(g.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,n>>24,n>>16&255,n>>8&255,n&255])))},g.esds=function(p){var s=p.config.length;return new Uint8Array([0,0,0,0,3,23+s,0,1,0,4,15+s,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([s]).concat(p.config).concat([6,1,2]))},g.mp4a=function(p){var s=p.samplerate;return g.box(g.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,p.channelCount,0,16,0,0,0,0,s>>8&255,s&255,0,0]),g.box(g.types.esds,g.esds(p)))},g.mp3=function(p){var s=p.samplerate;return g.box(g.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,p.channelCount,0,16,0,0,0,0,s>>8&255,s&255,0,0]))},g.stsd=function(p){return p.type==="audio"?!p.isAAC&&p.codec==="mp3"?g.box(g.types.stsd,g.STSD,g.mp3(p)):g.box(g.types.stsd,g.STSD,g.mp4a(p)):g.box(g.types.stsd,g.STSD,g.avc1(p))},g.tkhd=function(p){var s=p.id,a=p.duration*p.timescale,r=p.width,h=p.height,d=Math.floor(a/(R+1)),f=Math.floor(a%(R+1));return g.box(g.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,s>>24&255,s>>16&255,s>>8&255,s&255,0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,f>>24,f>>16&255,f>>8&255,f&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,r&255,0,0,h>>8&255,h&255,0,0]))},g.traf=function(p,s){var a=g.sdtp(p),r=p.id,h=Math.floor(s/(R+1)),d=Math.floor(s%(R+1));return g.box(g.types.traf,g.box(g.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),g.box(g.types.tfdt,new Uint8Array([1,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,d>>24,d>>16&255,d>>8&255,d&255])),g.trun(p,a.length+16+20+8+16+8+8),a)},g.trak=function(p){return p.duration=p.duration||4294967295,g.box(g.types.trak,g.tkhd(p),g.mdia(p))},g.trex=function(p){var s=p.id;return g.box(g.types.trex,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},g.trun=function(p,s){var a=p.samples||[],r=a.length,h=12+16*r,d=new Uint8Array(h),f,E,y,l,n,o;for(s+=8+h,d.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255],0),f=0;f<r;f++)E=a[f],y=E.duration,l=E.size,n=E.flags,o=E.cts,d.set([y>>>24&255,y>>>16&255,y>>>8&255,y&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*f);return g.box(g.types.trun,d)},g.initSegment=function(p){g.types||g.init();var s=g.moov(p),a=new Uint8Array(g.FTYP.byteLength+s.byteLength);return a.set(g.FTYP),a.set(s,g.FTYP.byteLength),a},g}();T.types=void 0,T.HDLR_TYPES=void 0,T.STTS=void 0,T.STSC=void 0,T.STCO=void 0,T.STSZ=void 0,T.VMHD=void 0,T.SMHD=void 0,T.STSD=void 0,T.FTYP=void 0,T.DINF=void 0,m.default=T},"./src/remux/mp4-remuxer.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return o}),S.d(m,"normalizePts",function(){return u});var R=S("./src/polyfills/number.ts"),T=S("./src/remux/aac-helper.ts"),g=S("./src/remux/mp4-generator.ts"),C=S("./src/events.ts"),p=S("./src/errors.ts"),s=S("./src/utils/logger.ts"),a=S("./src/types/loader.ts"),r=S("./src/utils/timescale-conversion.ts");function h(){return h=Object.assign||function(k){for(var D=1;D<arguments.length;D++){var c=arguments[D];for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(k[b]=c[b])}return k},h.apply(this,arguments)}var d=10*1e3,f=1024,E=1152,y=null,l=null,n=!1,o=function(){function k(c,b,x,_){if(_===void 0&&(_=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=c,this.config=b,this.typeSupported=x,this.ISGenerated=!1,y===null){var j=navigator.userAgent||"",F=j.match(/Chrome\/(\d+)/i);y=F?parseInt(F[1]):0}if(l===null){var L=navigator.userAgent.match(/Safari\/(\d+)/i);l=L?parseInt(L[1]):0}n=!!y&&y<75||!!l&&l<600}var D=k.prototype;return D.destroy=function(){},D.resetTimeStamp=function(b){s.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},D.resetNextTimestamp=function(){s.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},D.resetInitSegment=function(){s.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},D.getVideoStartPts=function(b){var x=!1,_=b.reduce(function(j,F){var L=F.pts-j;return L<-4294967296?(x=!0,u(j,F.pts)):L>0?j:F.pts},b[0].pts);return x&&s.logger.debug("PTS rollover detected"),_},D.remux=function(b,x,_,j,F,L,X,z){var H,G,U,B,W,te,de=F,fe=F,be=b.pid>-1,Ce=x.pid>-1,ue=x.samples.length,ge=b.samples.length>0,pe=ue>1,oe=(!be||ge)&&(!Ce||pe)||this.ISGenerated||X;if(oe){this.ISGenerated||(U=this.generateIS(b,x,F));var ae=this.isVideoContiguous,re=-1;if(pe&&(re=w(x.samples),!ae&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,re>0){s.logger.warn("[mp4-remuxer]: Dropped "+re+" out of "+ue+" video samples due to a missing keyframe");var he=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(re),x.dropped+=re,fe+=(x.samples[0].pts-he)/(x.timescale||9e4)}else re===-1&&(s.logger.warn("[mp4-remuxer]: No keyframe found out of "+ue+" video samples"),te=!1);if(this.ISGenerated){if(ge&&pe){var Q=this.getVideoStartPts(x.samples),ie=u(b.samples[0].pts,Q)-Q,we=ie/x.inputTimeScale;de+=Math.max(0,we),fe+=Math.max(0,-we)}if(ge){if(b.samplerate||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(b,x,F)),G=this.remuxAudio(b,de,this.isAudioContiguous,L,Ce||pe||z===a.PlaylistLevelType.AUDIO?fe:void 0),pe){var ne=G?G.endPTS-G.startPTS:0;x.inputTimeScale||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(b,x,F)),H=this.remuxVideo(x,fe,ae,ne)}}else pe&&(H=this.remuxVideo(x,fe,ae,0));H&&(H.firstKeyFrame=re,H.independent=re!==-1)}}return this.ISGenerated&&(_.samples.length&&(W=this.remuxID3(_,F)),j.samples.length&&(B=this.remuxText(j,F))),{audio:G,video:H,initSegment:U,independent:te,text:B,id3:W}},D.generateIS=function(b,x,_){var j=b.samples,F=x.samples,L=this.typeSupported,X={},z=!Object(R.isFiniteNumber)(this._initPTS),H="audio/mp4",G,U,B;if(z&&(G=U=Infinity),b.config&&j.length&&(b.timescale=b.samplerate,b.isAAC||(L.mpeg?(H="audio/mpeg",b.codec=""):L.mp3&&(b.codec="mp3")),X.audio={id:"audio",container:H,codec:b.codec,initSegment:!b.isAAC&&L.mpeg?new Uint8Array(0):g.default.initSegment([b]),metadata:{channelCount:b.channelCount}},z&&(B=b.inputTimeScale,G=U=j[0].pts-Math.round(B*_))),x.sps&&x.pps&&F.length&&(x.timescale=x.inputTimeScale,X.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:g.default.initSegment([x]),metadata:{width:x.width,height:x.height}},z)){B=x.inputTimeScale;var W=this.getVideoStartPts(F),te=Math.round(B*_);U=Math.min(U,u(F[0].dts,W)-te),G=Math.min(G,W-te)}if(Object.keys(X).length)return this.ISGenerated=!0,z&&(this._initPTS=G,this._initDTS=U),{tracks:X,initPTS:G,timescale:B}},D.remuxVideo=function(b,x,_,j){var F=b.inputTimeScale,L=b.samples,X=[],z=L.length,H=this._initPTS,G=this.nextAvcDts,U=8,B,W,te,de=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,be=0,Ce=!1;if(!_||G===null){var ue=x*F,ge=L[0].pts-u(L[0].dts,L[0].pts);G=ue-ge}for(var pe=0;pe<z;pe++){var oe=L[pe];if(oe.pts=u(oe.pts-H,G),oe.dts=u(oe.dts-H,G),oe.dts>oe.pts){var ae=9e4*.2;be=Math.max(Math.min(be,oe.pts-oe.dts),-1*ae)}oe.dts<L[pe>0?pe-1:pe].dts&&(Ce=!0)}Ce&&L.sort(function(Et,xt){var lt=Et.dts-xt.dts,Wt=Et.pts-xt.pts;return lt||Wt}),W=L[0].dts,te=L[L.length-1].dts;var re=Math.round((te-W)/(z-1));if(be<0){if(be<re*-2){s.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(r.toMsFromMpegTsClock)(-re,!0)+" ms");for(var he=be,Q=0;Q<z;Q++)L[Q].dts=he=Math.max(he,L[Q].pts-re),L[Q].pts=Math.max(he,L[Q].pts)}else{s.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(r.toMsFromMpegTsClock)(be,!0)+" ms to overcome this issue");for(var ie=0;ie<z;ie++)L[ie].dts=L[ie].dts+be}W=L[0].dts}if(_){var we=W-G,ne=we>re,J=we<-1;if(ne||J){ne?s.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(we,!0)+" ms ("+we+"dts) hole between fragments detected, filling it"):s.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(-we,!0)+" ms ("+we+"dts) overlapping between fragments detected"),W=G;var V=L[0].pts-we;L[0].dts=W,L[0].pts=V,s.logger.log("Video: First PTS/DTS adjusted: "+Object(r.toMsFromMpegTsClock)(V,!0)+"/"+Object(r.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(r.toMsFromMpegTsClock)(we,!0)+" ms")}}n&&(W=Math.max(0,W));for(var Z=0,Ee=0,xe=0;xe<z;xe++){for(var _e=L[xe],Ne=_e.units,Be=Ne.length,We=0,Ue=0;Ue<Be;Ue++)We+=Ne[Ue].data.length;Ee+=We,Z+=Be,_e.length=We,_e.dts=Math.max(_e.dts,W),_e.pts=Math.max(_e.pts,_e.dts,0),de=Math.min(_e.pts,de),fe=Math.max(_e.pts,fe)}te=L[z-1].dts;var ze=Ee+4*Z+8,Ke;try{Ke=new Uint8Array(ze)}catch(Et){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:p.ErrorTypes.MUX_ERROR,details:p.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ze,reason:"fail allocating video mdat "+ze});return}var Ye=new DataView(Ke.buffer);Ye.setUint32(0,ze),Ke.set(g.default.types.mdat,4);for(var Re=0;Re<z;Re++){for(var tt=L[Re],rt=tt.units,He=0,$e=0,Ie=rt.length;$e<Ie;$e++){var Oe=rt[$e],Le=Oe.data,Te=Oe.data.byteLength;Ye.setUint32(U,Te),U+=4,Ke.set(Le,U),U+=Te,He+=4+Te}if(Re<z-1)B=L[Re+1].dts-tt.dts;else{var Ae=this.config,De=tt.dts-L[Re>0?Re-1:Re].dts;if(Ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var Me=Math.floor(Ae.maxBufferHole*F),Fe=(j?de+j*F:this.nextAudioPts)-tt.pts;Fe>Me?(B=Fe-De,B<0&&(B=De),s.logger.log("[mp4-remuxer]: It is approximately "+Fe/90+" ms to the next segment; using duration "+B/90+" ms for the last video frame.")):B=De}else B=De}var Xe=Math.round(tt.pts-tt.dts);X.push(new v(tt.key,B,He,Xe))}if(X.length&&y&&y<70){var qe=X[0].flags;qe.dependsOn=2,qe.isNonSync=0}console.assert(B!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=te+B,this.isVideoContiguous=!0;var pt=g.default.moof(b.sequenceNumber++,W,h({},b,{samples:X})),at="video",ft={data1:pt,data2:Ke,startPTS:de/F,endPTS:(fe+B)/F,startDTS:W/F,endDTS:G/F,type:at,hasAudio:!1,hasVideo:!0,nb:X.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(Ke.length,"MDAT length must not be zero"),ft},D.remuxAudio=function(b,x,_,j,F){var L=b.inputTimeScale,X=b.samplerate?b.samplerate:L,z=L/X,H=b.isAAC?f:E,G=H*z,U=this._initPTS,B=!b.isAAC&&this.typeSupported.mpeg,W=[],te=b.samples,de=B?0:8,fe=this.nextAudioPts||-1,be=x*L;if(this.isAudioContiguous=_=_||te.length&&fe>0&&(j&&Math.abs(be-fe)<9e3||Math.abs(u(te[0].pts-U,be)-fe)<20*G),te.forEach(function(Le){Le.pts=u(Le.pts-U,be)}),!_||fe<0){if(te=te.filter(function(Le){return Le.pts>=0}),!te.length)return;F===0?fe=0:j?fe=Math.max(0,be):fe=te[0].pts}if(b.isAAC)for(var Ce=F!==void 0,ue=this.config.maxAudioFramesDrift,ge=0,pe=fe;ge<te.length;ge++){var oe=te[ge],ae=oe.pts,re=ae-pe,he=Math.abs(1e3*re/L);if(re<=-ue*G&&Ce)ge===0&&(s.logger.warn("Audio frame @ "+(ae/L).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*re/L)+" ms."),this.nextAudioPts=fe=pe=ae);else if(re>=ue*G&&he<d&&Ce){var Q=Math.round(re/G);pe=ae-Q*G,pe<0&&(Q--,pe+=G),ge===0&&(this.nextAudioPts=fe=pe),s.logger.warn("[mp4-remuxer]: Injecting "+Q+" audio frame @ "+(pe/L).toFixed(3)+"s due to "+Math.round(1e3*re/L)+" ms gap.");for(var ie=0;ie<Q;ie++){var we=Math.max(pe,0),ne=T.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);ne||(s.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ne=oe.unit.subarray()),te.splice(ge,0,{unit:ne,pts:we}),pe+=G,ge++}}oe.pts=pe,pe+=G}for(var J=null,V=null,Z,Ee=0,xe=te.length;xe--;)Ee+=te[xe].unit.byteLength;for(var _e=0,Ne=te.length;_e<Ne;_e++){var Be=te[_e],We=Be.unit,Ue=Be.pts;if(V!==null){var ze=W[_e-1];ze.duration=Math.round((Ue-V)/z)}else if(_&&b.isAAC&&(Ue=fe),J=Ue,Ee>0){Ee+=de;try{Z=new Uint8Array(Ee)}catch(Le){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:p.ErrorTypes.MUX_ERROR,details:p.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ee,reason:"fail allocating audio mdat "+Ee});return}if(!B){var Ke=new DataView(Z.buffer);Ke.setUint32(0,Ee),Z.set(g.default.types.mdat,4)}}else return;Z.set(We,de);var Ye=We.byteLength;de+=Ye,W.push(new v(!0,H,Ye,0)),V=Ue}var Re=W.length;if(!Re)return;var tt=W[W.length-1];this.nextAudioPts=fe=V+z*tt.duration;var rt=B?new Uint8Array(0):g.default.moof(b.sequenceNumber++,J/z,h({},b,{samples:W}));b.samples=[];var He=J/L,$e=fe/L,Ie="audio",Oe={data1:rt,data2:Z,startPTS:He,endPTS:$e,startDTS:He,endDTS:$e,type:Ie,hasAudio:!0,hasVideo:!1,nb:Re};return this.isAudioContiguous=!0,console.assert(Z.length,"MDAT length must not be zero"),Oe},D.remuxEmptyAudio=function(b,x,_,j){var F=b.inputTimeScale,L=b.samplerate?b.samplerate:F,X=F/L,z=this.nextAudioPts,H=(z!==null?z:j.startDTS*F)+this._initDTS,G=j.endDTS*F+this._initDTS,U=X*f,B=Math.ceil((G-H)/U),W=T.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(s.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){s.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],de=0;de<B;de++){var fe=H+de*U;te.push({unit:W,pts:fe,dts:fe})}return b.samples=te,this.remuxAudio(b,x,_,!1)},D.remuxID3=function(b,x){var _=b.samples.length;if(!_)return;for(var j=b.inputTimeScale,F=this._initPTS,L=this._initDTS,X=0;X<_;X++){var z=b.samples[X];z.pts=u(z.pts-F,x*j)/j,z.dts=u(z.dts-L,x*j)/j}var H=b.samples;return b.samples=[],{samples:H}},D.remuxText=function(b,x){var _=b.samples.length;if(!_)return;for(var j=b.inputTimeScale,F=this._initPTS,L=0;L<_;L++){var X=b.samples[L];X.pts=u(X.pts-F,x*j)/j}b.samples.sort(function(H,G){return H.pts-G.pts});var z=b.samples;return b.samples=[],{samples:z}},k}();function u(k,D){var c;if(D===null)return k;for(D<k?c=-8589934592:c=8589934592;Math.abs(k-D)>4294967296;)k+=c;return k}function w(k){for(var D=0;D<k.length;D++)if(k[D].key)return D;return-1}var v=function(D,c,b,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=c,this.size=b,this.cts=x,this.flags=new i(D)},i=function(D){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=D?2:1,this.isNonSync=D?0:1}},"./src/remux/passthrough-remuxer.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/polyfills/number.ts"),T=S("./src/utils/mp4-tools.ts"),g=S("./src/loader/fragment.ts"),C=S("./src/utils/logger.ts"),p=function(){function r(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var h=r.prototype;return h.destroy=function(){},h.resetTimeStamp=function(f){this.initPTS=f,this.lastEndDTS=null},h.resetNextTimestamp=function(){this.lastEndDTS=null},h.resetInitSegment=function(f,E,y){this.audioCodec=E,this.videoCodec=y,this.generateInitSegment(f),this.emitInitSegment=!0},h.generateInitSegment=function(f){var E=this.audioCodec,y=this.videoCodec;if(!f||!f.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(T.parseInitSegment)(f);E||(E=a(l.audio,g.ElementaryStreamTypes.AUDIO)),y||(y=a(l.video,g.ElementaryStreamTypes.VIDEO));var n={};l.audio&&l.video?n.audiovideo={container:"video/mp4",codec:E+","+y,initSegment:f,id:"main"}:l.audio?n.audio={container:"audio/mp4",codec:E,initSegment:f,id:"audio"}:l.video?n.video={container:"video/mp4",codec:y,initSegment:f,id:"main"}:C.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},h.remux=function(f,E,y,l,n){var o=this.initPTS,u=this.lastEndDTS,w={audio:void 0,video:void 0,text:l,id3:y,initSegment:void 0};Object(R.isFiniteNumber)(u)||(u=this.lastEndDTS=n||0);var v=E.samples;if(!v||!v.length)return w;var i={initPTS:void 0,timescale:1},k=this.initData;if((!k||!k.length)&&(this.generateInitSegment(v),k=this.initData),!k||!k.length)return C.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),w;this.emitInitSegment&&(i.tracks=this.initTracks,this.emitInitSegment=!1),Object(R.isFiniteNumber)(o)||(this.initPTS=i.initPTS=o=s(k,v,u));var D=Object(T.getDuration)(v,k),c=u,b=D+c;Object(T.offsetStartDTS)(k,v,o),D>0?this.lastEndDTS=b:(C.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!k.audio,_=!!k.video,j="";x&&(j+="audio"),_&&(j+="video");var F={data1:v,startPTS:c,startDTS:c,endPTS:b,endDTS:b,type:j,hasAudio:x,hasVideo:_,nb:1,dropped:0};return w.audio=F.type==="audio"?F:void 0,w.video=F.type!=="audio"?F:void 0,w.text=l,w.id3=y,w.initSegment=i,w},r}(),s=function(h,d,f){return Object(T.getStartDTS)(h,d)-f};function a(r,h){var d=r==null?void 0:r.codec;return d&&d.length>4?d:d==="hvc1"?"hvc1.1.c.L120.90":d==="av01"?"av01.0.04M.08":d==="avc1"||h===g.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}m.default=p},"./src/task-loop.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return R});var R=function(){function T(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var g=T.prototype;return g.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},g.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},g.onHandlerDestroyed=function(){},g.hasInterval=function(){return!!this._tickInterval},g.hasNextTick=function(){return!!this._tickTimer},g.setInterval=function(p){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,p),!0)},g.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},g.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},g.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},g.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},g.doTick=function(){},T}()},"./src/types/cmcd.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"CMCDVersion",function(){return R}),S.d(m,"CMCDObjectType",function(){return T}),S.d(m,"CMCDStreamingFormat",function(){return g}),S.d(m,"CMCDStreamType",function(){return C});var R=1,T;(function(p){p.MANIFEST="m",p.AUDIO="a",p.VIDEO="v",p.MUXED="av",p.INIT="i",p.CAPTION="c",p.TIMED_TEXT="tt",p.KEY="k",p.OTHER="o"})(T||(T={}));var g;(function(p){p.DASH="d",p.HLS="h",p.SMOOTH="s",p.OTHER="o"})(g||(g={}));var C;(function(p){p.VOD="v",p.LIVE="l"})(C||(C={}))},"./src/types/level.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"HlsSkip",function(){return g}),S.d(m,"getSkipValue",function(){return C}),S.d(m,"HlsUrlParameters",function(){return p}),S.d(m,"Level",function(){return s});function R(a,r){for(var h=0;h<r.length;h++){var d=r[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function T(a,r,h){return r&&R(a.prototype,r),h&&R(a,h),a}var g;(function(a){a.No="",a.Yes="YES",a.v2="v2"})(g||(g={}));function C(a,r){var h=a.canSkipUntil,d=a.canSkipDateRanges,f=a.endSN,E=r!==void 0?r-f:0;return h&&E<h?d?g.v2:g.Yes:g.No}var p=function(){function a(h,d,f){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=h,this.part=d,this.skip=f}var r=a.prototype;return r.addDirectives=function(d){var f=new self.URL(d);return this.msn!==void 0&&f.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&f.searchParams.set("_HLS_part",this.part.toString()),this.skip&&f.searchParams.set("_HLS_skip",this.skip),f.toString()},a}(),s=function(){function a(r){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[r.url],this.attrs=r.attrs,this.bitrate=r.bitrate,r.details&&(this.details=r.details),this.id=r.id||0,this.name=r.name,this.width=r.width||0,this.height=r.height||0,this.audioCodec=r.audioCodec,this.videoCodec=r.videoCodec,this.unknownCodecs=r.unknownCodecs,this.codecSet=[r.videoCodec,r.audioCodec].filter(function(h){return h}).join(",").replace(/\.[^.,]+/g,"")}return T(a,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(h){var d=h%this.url.length;this._urlId!==d&&(this.details=void 0,this._urlId=d)}}]),a}()},"./src/types/loader.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"PlaylistContextType",function(){return R}),S.d(m,"PlaylistLevelType",function(){return T});var R;(function(g){g.MANIFEST="manifest",g.LEVEL="level",g.AUDIO_TRACK="audioTrack",g.SUBTITLE_TRACK="subtitleTrack"})(R||(R={}));var T;(function(g){g.MAIN="main",g.AUDIO="audio",g.SUBTITLE="subtitle"})(T||(T={}))},"./src/types/transmuxer.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"ChunkMetadata",function(){return R});var R=function(C,p,s,a,r,h){a===void 0&&(a=0),r===void 0&&(r=-1),h===void 0&&(h=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=T(),this.buffering={audio:T(),video:T(),audiovideo:T()},this.level=C,this.sn=p,this.id=s,this.size=a,this.part=r,this.partial=h};function T(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"AttrList",function(){return g});var R=/^(\d+)x(\d+)$/,T=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,g=function(){function C(s){typeof s=="string"&&(s=C.parseAttrList(s));for(var a in s)s.hasOwnProperty(a)&&(this[a]=s[a])}var p=C.prototype;return p.decimalInteger=function(a){var r=parseInt(this[a],10);return r>Number.MAX_SAFE_INTEGER?Infinity:r},p.hexadecimalInteger=function(a){if(this[a]){var r=(this[a]||"0x").slice(2);r=(r.length&1?"0":"")+r;for(var h=new Uint8Array(r.length/2),d=0;d<r.length/2;d++)h[d]=parseInt(r.slice(d*2,d*2+2),16);return h}else return null},p.hexadecimalIntegerAsNumber=function(a){var r=parseInt(this[a],16);return r>Number.MAX_SAFE_INTEGER?Infinity:r},p.decimalFloatingPoint=function(a){return parseFloat(this[a])},p.optionalFloat=function(a,r){var h=this[a];return h?parseFloat(h):r},p.enumeratedString=function(a){return this[a]},p.bool=function(a){return this[a]==="YES"},p.decimalResolution=function(a){var r=R.exec(this[a]);return r===null?void 0:{width:parseInt(r[1],10),height:parseInt(r[2],10)}},C.parseAttrList=function(a){var r,h={},d='"';for(T.lastIndex=0;(r=T.exec(a))!==null;){var f=r[2];f.indexOf(d)===0&&f.lastIndexOf(d)===f.length-1&&(f=f.slice(1,-1)),h[r[1]]=f}return h},C}()},"./src/utils/binary-search.ts":function(P,m,S){"use strict";S.r(m);var R={search:function(g,C){for(var p=0,s=g.length-1,a=null,r=null;p<=s;){a=(p+s)/2|0,r=g[a];var h=C(r);if(h>0)p=a+1;else if(h<0)s=a-1;else return r}return null}};m.default=R},"./src/utils/buffer-helper.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"BufferHelper",function(){return g});var R=S("./src/utils/logger.ts"),T={length:0,start:function(){return 0},end:function(){return 0}},g=function(){function C(){}return C.isBuffered=function(s,a){try{if(s){for(var r=C.getBuffered(s),h=0;h<r.length;h++)if(a>=r.start(h)&&a<=r.end(h))return!0}}catch(d){}return!1},C.bufferInfo=function(s,a,r){try{if(s){var h=C.getBuffered(s),d=[],f;for(f=0;f<h.length;f++)d.push({start:h.start(f),end:h.end(f)});return this.bufferedInfo(d,a,r)}}catch(E){}return{len:0,start:a,end:a,nextStart:void 0}},C.bufferedInfo=function(s,a,r){a=Math.max(0,a),s.sort(function(i,k){var D=i.start-k.start;return D||k.end-i.end});var h=[];if(r)for(var d=0;d<s.length;d++){var f=h.length;if(f){var E=h[f-1].end;s[d].start-E<r?s[d].end>E&&(h[f-1].end=s[d].end):h.push(s[d])}else h.push(s[d])}else h=s;for(var y=0,l,n=a,o=a,u=0;u<h.length;u++){var w=h[u].start,v=h[u].end;if(a+r>=w&&a<v)n=w,o=v,y=o-a;else if(a+r<w){l=w;break}}return{len:y,start:n||0,end:o||0,nextStart:l}},C.getBuffered=function(s){try{return s.buffered}catch(a){return R.logger.log("failed to get media.buffered",a),T}},C}()},"./src/utils/cea-608-parser.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"Row",function(){return o}),S.d(m,"CaptionScreen",function(){return u});var R=S("./src/utils/logger.ts"),T={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},g=function(b){var x=b;return T.hasOwnProperty(b)&&(x=T[b]),String.fromCharCode(x)},C=15,p=100,s={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},a={17:2,18:4,21:6,22:8,23:10,19:13,20:15},r={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},d=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],f;(function(c){c[c.ERROR=0]="ERROR",c[c.TEXT=1]="TEXT",c[c.WARNING=2]="WARNING",c[c.INFO=2]="INFO",c[c.DEBUG=3]="DEBUG",c[c.DATA=3]="DATA"})(f||(f={}));var E=function(){function c(){this.time=null,this.verboseLevel=f.ERROR}var b=c.prototype;return b.log=function(_,j){this.verboseLevel>=_&&R.logger.log(this.time+" ["+_+"] "+j)},c}(),y=function(b){for(var x=[],_=0;_<b.length;_++)x.push(b[_].toString(16));return x},l=function(){function c(x,_,j,F,L){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=x||"white",this.underline=_||!1,this.italics=j||!1,this.background=F||"black",this.flash=L||!1}var b=c.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(_){for(var j=["foreground","underline","italics","background","flash"],F=0;F<j.length;F++){var L=j[F];_.hasOwnProperty(L)&&(this[L]=_[L])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(_){return this.foreground===_.foreground&&this.underline===_.underline&&this.italics===_.italics&&this.background===_.background&&this.flash===_.flash},b.copy=function(_){this.foreground=_.foreground,this.underline=_.underline,this.italics=_.italics,this.background=_.background,this.flash=_.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},c}(),n=function(){function c(x,_,j,F,L,X){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new l(_,j,F,L,X)}var b=c.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(_,j){this.uchar=_,this.penState.copy(j)},b.setPenState=function(_){this.penState.copy(_)},b.equals=function(_){return this.uchar===_.uchar&&this.penState.equals(_.penState)},b.copy=function(_){this.uchar=_.uchar,this.penState.copy(_.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},c}(),o=function(){function c(x){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var _=0;_<p;_++)this.chars.push(new n);this.logger=x,this.pos=0,this.currPenState=new l}var b=c.prototype;return b.equals=function(_){for(var j=!0,F=0;F<p;F++)if(!this.chars[F].equals(_.chars[F])){j=!1;break}return j},b.copy=function(_){for(var j=0;j<p;j++)this.chars[j].copy(_.chars[j])},b.isEmpty=function(){for(var _=!0,j=0;j<p;j++)if(!this.chars[j].isEmpty()){_=!1;break}return _},b.setCursor=function(_){this.pos!==_&&(this.pos=_),this.pos<0?(this.logger.log(f.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>p&&(this.logger.log(f.DEBUG,"Too large cursor position "+this.pos),this.pos=p)},b.moveCursor=function(_){var j=this.pos+_;if(_>1)for(var F=this.pos+1;F<j+1;F++)this.chars[F].setPenState(this.currPenState);this.setCursor(j)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(_){_>=144&&this.backSpace();var j=g(_);if(this.pos>=p){this.logger.log(f.ERROR,"Cannot insert "+_.toString(16)+" ("+j+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(j,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(_){var j;for(j=_;j<p;j++)this.chars[j].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var _=[],j=!0,F=0;F<p;F++){var L=this.chars[F].uchar;L!==" "&&(j=!1),_.push(L)}return j?"":_.join("")},b.setPenStyles=function(_){this.currPenState.setStyles(_);var j=this.chars[this.pos];j.setPenState(this.currPenState)},c}(),u=function(){function c(x){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var _=0;_<C;_++)this.rows.push(new o(x));this.logger=x,this.currRow=C-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=c.prototype;return b.reset=function(){for(var _=0;_<C;_++)this.rows[_].clear();this.currRow=C-1},b.equals=function(_){for(var j=!0,F=0;F<C;F++)if(!this.rows[F].equals(_.rows[F])){j=!1;break}return j},b.copy=function(_){for(var j=0;j<C;j++)this.rows[j].copy(_.rows[j])},b.isEmpty=function(){for(var _=!0,j=0;j<C;j++)if(!this.rows[j].isEmpty()){_=!1;break}return _},b.backSpace=function(){var _=this.rows[this.currRow];_.backSpace()},b.clearToEndOfRow=function(){var _=this.rows[this.currRow];_.clearToEndOfRow()},b.insertChar=function(_){var j=this.rows[this.currRow];j.insertChar(_)},b.setPen=function(_){var j=this.rows[this.currRow];j.setPenStyles(_)},b.moveCursor=function(_){var j=this.rows[this.currRow];j.moveCursor(_)},b.setCursor=function(_){this.logger.log(f.INFO,"setCursor: "+_);var j=this.rows[this.currRow];j.setCursor(_)},b.setPAC=function(_){this.logger.log(f.INFO,"pacData = "+JSON.stringify(_));var j=_.row-1;if(this.nrRollUpRows&&j<this.nrRollUpRows-1&&(j=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==j){for(var F=0;F<C;F++)this.rows[F].clear();var L=this.currRow+1-this.nrRollUpRows,X=this.lastOutputScreen;if(X){var z=X.rows[L].cueStartTime,H=this.logger.time;if(z&&H!==null&&z<H)for(var G=0;G<this.nrRollUpRows;G++)this.rows[j-this.nrRollUpRows+G+1].copy(X.rows[L+G])}}this.currRow=j;var U=this.rows[this.currRow];if(_.indent!==null){var B=_.indent,W=Math.max(B-1,0);U.setCursor(_.indent),_.color=U.chars[W].penState.foreground}var te={foreground:_.color,underline:_.underline,italics:_.italics,background:"black",flash:!1};this.setPen(te)},b.setBkgData=function(_){this.logger.log(f.INFO,"bkgData = "+JSON.stringify(_)),this.backSpace(),this.setPen(_),this.insertChar(32)},b.setRollUpRows=function(_){this.nrRollUpRows=_},b.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(f.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(f.TEXT,this.getDisplayText());var _=this.currRow+1-this.nrRollUpRows,j=this.rows.splice(_,1)[0];j.clear(),this.rows.splice(this.currRow,0,j),this.logger.log(f.INFO,"Rolling up")},b.getDisplayText=function(_){_=_||!1;for(var j=[],F="",L=-1,X=0;X<C;X++){var z=this.rows[X].getTextString();z&&(L=X+1,_?j.push("Row "+L+": '"+z+"'"):j.push(z.trim()))}return j.length>0&&(_?F="["+j.join(" | ")+"]":F=j.join(`
`)),F},b.getTextAndFormat=function(){return this.rows},c}(),w=function(){function c(x,_,j){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=x,this.outputFilter=_,this.mode=null,this.verbose=0,this.displayedMemory=new u(j),this.nonDisplayedMemory=new u(j),this.lastOutputScreen=new u(j),this.currRollUpRow=this.displayedMemory.rows[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=j}var b=c.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(_){this.outputFilter=_},b.setPAC=function(_){this.writeScreen.setPAC(_)},b.setBkgData=function(_){this.writeScreen.setBkgData(_)},b.setMode=function(_){if(_===this.mode)return;this.mode=_,this.logger.log(f.INFO,"MODE="+_),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=_},b.insertChars=function(_){for(var j=0;j<_.length;j++)this.writeScreen.insertChar(_[j]);var F=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(f.INFO,F+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(f.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},b.ccRCL=function(){this.logger.log(f.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(f.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(f.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(_){this.logger.log(f.INFO,"RU("+_+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(_)},b.ccFON=function(){this.logger.log(f.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(f.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(f.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(f.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(f.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(f.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(f.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(f.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var _=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=_,this.writeScreen=this.nonDisplayedMemory,this.logger.log(f.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(_){this.logger.log(f.INFO,"TO("+_+") - Tab Offset"),this.writeScreen.moveCursor(_)},b.ccMIDROW=function(_){var j={flash:!1};if(j.underline=_%2===1,j.italics=_>=46,j.italics)j.foreground="white";else{var F=Math.floor(_/2)-16,L=["white","green","blue","cyan","red","yellow","magenta"];j.foreground=L[F]}this.logger.log(f.INFO,"MIDROW: "+JSON.stringify(j)),this.writeScreen.setPen(j)},b.outputDataUpdate=function(_){_===void 0&&(_=!1);var j=this.logger.time;if(j===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=j:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,j,this.lastOutputScreen),_&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:j),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(_){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,_,this.displayedMemory),this.cueStartTime=_))},c}(),v=function(){function c(x,_,j){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var F=new E;this.channels=[null,new w(x,_,F),new w(x+1,j,F)],this.cmdHistory=D(),this.logger=F}var b=c.prototype;return b.getHandler=function(_){return this.channels[_].getHandler()},b.setHandler=function(_,j){this.channels[_].setHandler(j)},b.addData=function(_,j){var F,L,X,z=!1;this.logger.time=_;for(var H=0;H<j.length;H+=2){if(L=j[H]&127,X=j[H+1]&127,L===0&&X===0)continue;if(this.logger.log(f.DATA,"["+y([j[H],j[H+1]])+"] -> ("+y([L,X])+")"),F=this.parseCmd(L,X),F||(F=this.parseMidrow(L,X)),F||(F=this.parsePAC(L,X)),F||(F=this.parseBackgroundAttributes(L,X)),!F&&(z=this.parseChars(L,X),z)){var G=this.currentChannel;if(G&&G>0){var U=this.channels[G];U.insertChars(z)}else this.logger.log(f.WARNING,"No channel found yet. TEXT-MODE?")}!F&&!z&&this.logger.log(f.WARNING,"Couldn't parse cleaned data "+y([L,X])+" orig: "+y([j[H],j[H+1]]))}},b.parseCmd=function(_,j){var F=this.cmdHistory,L=(_===20||_===28||_===21||_===29)&&j>=32&&j<=47,X=(_===23||_===31)&&j>=33&&j<=35;if(!(L||X))return!1;if(k(_,j,F))return i(null,null,F),this.logger.log(f.DEBUG,"Repeated command ("+y([_,j])+") is dropped"),!0;var z=_===20||_===21||_===23?1:2,H=this.channels[z];return _===20||_===21||_===28||_===29?j===32?H.ccRCL():j===33?H.ccBS():j===34?H.ccAOF():j===35?H.ccAON():j===36?H.ccDER():j===37?H.ccRU(2):j===38?H.ccRU(3):j===39?H.ccRU(4):j===40?H.ccFON():j===41?H.ccRDC():j===42?H.ccTR():j===43?H.ccRTD():j===44?H.ccEDM():j===45?H.ccCR():j===46?H.ccENM():j===47&&H.ccEOC():H.ccTO(j-32),i(_,j,F),this.currentChannel=z,!0},b.parseMidrow=function(_,j){var F=0;if((_===17||_===25)&&j>=32&&j<=47){if(_===17?F=1:F=2,F!==this.currentChannel)return this.logger.log(f.ERROR,"Mismatch channel in midrow parsing"),!1;var L=this.channels[F];return L?(L.ccMIDROW(j),this.logger.log(f.DEBUG,"MIDROW ("+y([_,j])+")"),!0):!1}return!1},b.parsePAC=function(_,j){var F,L=this.cmdHistory,X=(_>=17&&_<=23||_>=25&&_<=31)&&j>=64&&j<=127,z=(_===16||_===24)&&j>=64&&j<=95;if(!(X||z))return!1;if(k(_,j,L))return i(null,null,L),!0;var H=_<=23?1:2;j>=64&&j<=95?F=H===1?s[_]:r[_]:F=H===1?a[_]:h[_];var G=this.channels[H];return G?(G.setPAC(this.interpretPAC(F,j)),i(_,j,L),this.currentChannel=H,!0):!1},b.interpretPAC=function(_,j){var F,L={color:null,italics:!1,indent:null,underline:!1,row:_};return j>95?F=j-96:F=j-64,L.underline=(F&1)===1,F<=13?L.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(F/2)]:F<=15?(L.italics=!0,L.color="white"):L.indent=Math.floor((F-16)/2)*4,L},b.parseChars=function(_,j){var F,L=null,X=null;if(_>=25?(F=2,X=_-8):(F=1,X=_),X>=17&&X<=19){var z;X===17?z=j+80:X===18?z=j+112:z=j+144,this.logger.log(f.INFO,"Special char '"+g(z)+"' in channel "+F),L=[z]}else _>=32&&_<=127&&(L=j===0?[_]:[_,j]);if(L){var H=y(L);this.logger.log(f.DEBUG,"Char codes = "+H.join(",")),i(_,j,this.cmdHistory)}return L},b.parseBackgroundAttributes=function(_,j){var F=(_===16||_===24)&&j>=32&&j<=47,L=(_===23||_===31)&&j>=45&&j<=47;if(!(F||L))return!1;var X,z={};_===16||_===24?(X=Math.floor((j-32)/2),z.background=d[X],j%2===1&&(z.background=z.background+"_semi")):j===45?z.background="transparent":(z.foreground="black",j===47&&(z.underline=!0));var H=_<=23?1:2,G=this.channels[H];return G.setBkgData(z),i(_,j,this.cmdHistory),!0},b.reset=function(){for(var _=0;_<Object.keys(this.channels).length;_++){var j=this.channels[_];j&&j.reset()}this.cmdHistory=D()},b.cueSplitAtTime=function(_){for(var j=0;j<this.channels.length;j++){var F=this.channels[j];F&&F.cueSplitAtTime(_)}},c}();function i(c,b,x){x.a=c,x.b=b}function k(c,b,x){return x.a===c&&x.b===b}function D(){return{a:null,b:null}}m.default=v},"./src/utils/codecs.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"isCodecType",function(){return T}),S.d(m,"isCodecSupportedInMp4",function(){return g});var R={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function T(C,p){var s=R[p];return!!s&&s[C.slice(0,4)]===!0}function g(C,p){return MediaSource.isTypeSupported((p||"video")+'/mp4;codecs="'+C+'"')}},"./src/utils/cues.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/utils/vttparser.ts"),T=S("./src/utils/webvtt-parser.ts"),g=S("./src/utils/texttrack-utils.ts"),C=/\s/,p={newCue:function(a,r,h,d){for(var f=[],E,y,l,n,o,u=self.VTTCue||self.TextTrackCue,w=0;w<d.rows.length;w++)if(E=d.rows[w],l=!0,n=0,o="",!E.isEmpty()){for(var v=0;v<E.chars.length;v++)C.test(E.chars[v].uchar)&&l?n++:(o+=E.chars[v].uchar,l=!1);E.cueStartTime=r,r===h&&(h+=1e-4),n>=16?n--:n++;var i=Object(R.fixLineBreaks)(o.trim()),k=Object(T.generateCueId)(r,h,i);(!a||!a.cues||!a.cues.getCueById(k))&&(y=new u(r,h,i),y.id=k,y.line=w+1,y.align="left",y.position=10+Math.min(80,Math.floor(n*8/32)*10),f.push(y))}return a&&f.length&&(f.sort(function(D,c){return D.line==="auto"||c.line==="auto"?0:D.line>8&&c.line>8?c.line-D.line:D.line-c.line}),f.forEach(function(D){return Object(g.addCueToTrack)(a,D)})),f}};m.default=p},"./src/utils/discontinuities.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"findFirstFragWithCC",function(){return C}),S.d(m,"shouldAlignOnDiscontinuities",function(){return p}),S.d(m,"findDiscontinuousReferenceFrag",function(){return s}),S.d(m,"adjustSlidingStart",function(){return r}),S.d(m,"alignStream",function(){return h}),S.d(m,"alignPDT",function(){return f}),S.d(m,"alignFragmentByPDTDelta",function(){return E}),S.d(m,"alignMediaPlaylistByPDT",function(){return y});var R=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts"),g=S("./src/controller/level-helper.ts");function C(l,n){for(var o=null,u=0,w=l.length;u<w;u++){var v=l[u];if(v&&v.cc===n){o=v;break}}return o}function p(l,n,o){return!!(n.details&&(o.endCC>o.startCC||l&&l.cc<o.startCC))}function s(l,n){var o=l.fragments,u=n.fragments;if(!u.length||!o.length){T.logger.log("No fragments to align");return}var w=C(o,u[0].cc);if(!w||w&&!w.startPTS){T.logger.log("No frag in previous level to align on");return}return w}function a(l,n){if(l){var o=l.start+n;l.start=l.startPTS=o,l.endPTS=o+l.duration}}function r(l,n){for(var o=n.fragments,u=0,w=o.length;u<w;u++)a(o[u],l);n.fragmentHint&&a(n.fragmentHint,l),n.alignedSliding=!0}function h(l,n,o){if(!n)return;d(l,o,n),!o.alignedSliding&&n.details&&f(o,n.details),!o.alignedSliding&&n.details&&!o.skippedSegments&&Object(g.adjustSliding)(n.details,o)}function d(l,n,o){if(p(l,o,n)){var u=s(o.details,n);u&&Object(R.isFiniteNumber)(u.start)&&(T.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),r(u.start,n))}}function f(l,n){if(!n.fragments.length||!l.hasProgramDateTime||!n.hasProgramDateTime)return;var o=n.fragments[0].programDateTime,u=l.fragments[0].programDateTime,w=(u-o)/1e3+n.fragments[0].start;w&&Object(R.isFiniteNumber)(w)&&(T.logger.log("Adjusting PTS using programDateTime delta "+(u-o)+"ms, sliding:"+w.toFixed(3)+" "+l.url+" "),r(w,l))}function E(l,n){var o=l.programDateTime;if(!o)return;var u=(o-n)/1e3;l.start=l.startPTS=u,l.endPTS=u+l.duration}function y(l,n){if(!n.fragments.length||!l.hasProgramDateTime||!n.hasProgramDateTime)return;var o=n.fragments[0].programDateTime,u=n.fragments[0].start,w=o-u*1e3;l.fragments.forEach(function(v){E(v,w)}),l.fragmentHint&&E(l.fragmentHint,w),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/utils/ewma.ts"),T=function(){function g(p,s,a){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new R.default(p),this.fast_=new R.default(s)}var C=g.prototype;return C.update=function(s,a){var r=this.slow_,h=this.fast_;this.slow_.halfLife!==s&&(this.slow_=new R.default(s,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==a&&(this.fast_=new R.default(a,h.getEstimate(),h.getTotalWeight()))},C.sample=function(s,a){s=Math.max(s,this.minDelayMs_);var r=8*a,h=s/1e3,d=r/h;this.fast_.sample(h,d),this.slow_.sample(h,d)},C.canEstimate=function(){var s=this.fast_;return s&&s.getTotalWeight()>=this.minWeight_},C.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},C.destroy=function(){},g}();m.default=T},"./src/utils/ewma.ts":function(P,m,S){"use strict";S.r(m);var R=function(){function T(C,p,s){p===void 0&&(p=0),s===void 0&&(s=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=C,this.alpha_=C?Math.exp(Math.log(.5)/C):0,this.estimate_=p,this.totalWeight_=s}var g=T.prototype;return g.sample=function(p,s){var a=Math.pow(this.alpha_,p);this.estimate_=s*(1-a)+a*this.estimate_,this.totalWeight_+=p},g.getTotalWeight=function(){return this.totalWeight_},g.getEstimate=function(){if(this.alpha_){var p=1-Math.pow(this.alpha_,this.totalWeight_);if(p)return this.estimate_/p}return this.estimate_},T}();m.default=R},"./src/utils/fetch-loader.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"fetchSupported",function(){return E});var R=S("./src/polyfills/number.ts"),T=S("./src/loader/load-stats.ts"),g=S("./src/demux/chunk-cache.ts");function C(u,w){u.prototype=Object.create(w.prototype),u.prototype.constructor=u,h(u,w)}function p(u){var w=typeof Map=="function"?new Map:void 0;return p=function(i){if(i===null||!r(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(i))return w.get(i);w.set(i,k)}function k(){return s(i,arguments,d(this).constructor)}return k.prototype=Object.create(i.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),h(k,i)},p(u)}function s(u,w,v){return a()?s=Reflect.construct:s=function(k,D,c){var b=[null];b.push.apply(b,D);var x=Function.bind.apply(k,b),_=new x;return c&&h(_,c.prototype),_},s.apply(null,arguments)}function a(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function r(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function h(u,w){return h=Object.setPrototypeOf||function(i,k){return i.__proto__=k,i},h(u,w)}function d(u){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},d(u)}function f(){return f=Object.assign||function(u){for(var w=1;w<arguments.length;w++){var v=arguments[w];for(var i in v)Object.prototype.hasOwnProperty.call(v,i)&&(u[i]=v[i])}return u},f.apply(this,arguments)}function E(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(u){}return!1}var y=function(){function u(v){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=v.fetchSetup||n,this.controller=new self.AbortController,this.stats=new T.LoadStats}var w=u.prototype;return w.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},w.abortInternal=function(){var i=this.response;(!i||!i.ok)&&(this.stats.aborted=!0,this.controller.abort())},w.abort=function(){var i;this.abortInternal(),(i=this.callbacks)!==null&&i!==void 0&&i.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},w.load=function(i,k,D){var c=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var x=l(i,this.controller.signal),_=D.onProgress,j=i.responseType==="arraybuffer",F=j?"byteLength":"length";this.context=i,this.config=k,this.callbacks=D,this.request=this.fetchSetup(i,x),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){c.abortInternal(),D.onTimeout(b,i,c.response)},k.timeout),self.fetch(this.request).then(function(L){if(c.response=c.loader=L,!L.ok){var X=L.status,z=L.statusText;throw new o(z||"fetch, bad network response",X,L)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(L.headers.get("Content-Length")||"0"),_&&Object(R.isFiniteNumber)(k.highWaterMark)?c.loadProgressively(L,b,i,k.highWaterMark,_):j?L.arrayBuffer():L.text()}).then(function(L){var X=c.response;self.clearTimeout(c.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=L[F];var z={url:X.url,data:L};_&&!Object(R.isFiniteNumber)(k.highWaterMark)&&_(b,i,L,X),D.onSuccess(z,b,i,X)}).catch(function(L){if(self.clearTimeout(c.requestTimeout),b.aborted)return;var X=L.code||0;D.onError({code:X,text:L.message},i,L.details)})},w.getCacheAge=function(){var i=null;if(this.response){var k=this.response.headers.get("age");i=k?parseFloat(k):null}return i},w.loadProgressively=function(i,k,D,c,b){c===void 0&&(c=0);var x=new g.default,_=i.body.getReader(),j=function F(){return _.read().then(function(L){if(L.done)return x.dataLength&&b(k,D,x.flush(),i),Promise.resolve(new ArrayBuffer(0));var X=L.value,z=X.length;return k.loaded+=z,z<c||x.dataLength?(x.push(X),x.dataLength>=c&&b(k,D,x.flush(),i)):b(k,D,X,i),F()}).catch(function(){return Promise.reject()})};return j()},u}();function l(u,w){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(f({},u.headers))};return u.rangeEnd&&v.headers.set("Range","bytes="+u.rangeStart+"-"+String(u.rangeEnd-1)),v}function n(u,w){return new self.Request(u.url,w)}var o=function(u){C(w,u);function w(v,i,k){var D;return D=u.call(this,v)||this,D.code=void 0,D.details=void 0,D.code=i,D.details=k,D}return w}(p(Error));m.default=y},"./src/utils/imsc1-ttml-parser.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"IMSC1_CODEC",function(){return r}),S.d(m,"parseIMSC1",function(){return E});var R=S("./src/utils/mp4-tools.ts"),T=S("./src/utils/vttparser.ts"),g=S("./src/utils/vttcue.ts"),C=S("./src/demux/id3.ts"),p=S("./src/utils/timescale-conversion.ts"),s=S("./src/utils/webvtt-parser.ts");function a(){return a=Object.assign||function(c){for(var b=1;b<arguments.length;b++){var x=arguments[b];for(var _ in x)Object.prototype.hasOwnProperty.call(x,_)&&(c[_]=x[_])}return c},a.apply(this,arguments)}var r="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,f={left:"start",center:"center",right:"end",start:"start",end:"end"};function E(c,b,x,_,j){var F=Object(R.findBox)(new Uint8Array(c),["mdat"]);if(F.length===0){j(new Error("Could not parse IMSC1 mdat"));return}var L=F[0],X=Object(C.utf8ArrayToStr)(new Uint8Array(c,L.start,L.end-L.start)),z=Object(p.toTimescaleFromScale)(b,1,x);try{_(y(X,z))}catch(H){j(H)}}function y(c,b){var x=new DOMParser,_=x.parseFromString(c,"text/xml"),j=_.getElementsByTagName("tt")[0];if(!j)throw new Error("Invalid ttml");var F={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},L=Object.keys(F).reduce(function(U,B){return U[B]=j.getAttribute("ttp:"+B)||F[B],U},{}),X=j.getAttribute("xml:space")!=="preserve",z=n(l(j,"styling","style")),H=n(l(j,"layout","region")),G=l(j,"body","[begin]");return[].map.call(G,function(U){var B=o(U,X);if(!B||!U.hasAttribute("begin"))return null;var W=i(U.getAttribute("begin"),L),te=i(U.getAttribute("dur"),L),de=i(U.getAttribute("end"),L);if(W===null)throw v(U);if(de===null){if(te===null)throw v(U);de=W+te}var fe=new g.default(W-b,de-b,B);fe.id=Object(s.generateCueId)(fe.startTime,fe.endTime,fe.text);var be=H[U.getAttribute("region")],Ce=z[U.getAttribute("style")];fe.position=10,fe.size=80;var ue=u(be,Ce),ge=ue.textAlign;if(ge){var pe=f[ge];pe&&(fe.lineAlign=pe),fe.align=ge}return a(fe,ue),fe}).filter(function(U){return U!==null})}function l(c,b,x){var _=c.getElementsByTagName(b)[0];return _?[].slice.call(_.querySelectorAll(x)):[]}function n(c){return c.reduce(function(b,x){var _=x.getAttribute("xml:id");return _&&(b[_]=x),b},{})}function o(c,b){return[].slice.call(c.childNodes).reduce(function(x,_,j){var F;return _.nodeName==="br"&&j?x+`
`:(F=_.childNodes)!==null&&F!==void 0&&F.length?o(_,b):b?x+_.textContent.trim().replace(/\s+/g," "):x+_.textContent},"")}function u(c,b){var x="http://www.w3.org/ns/ttml#styling",_=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return _.reduce(function(j,F){var L=w(b,x,F)||w(c,x,F);return L&&(j[F]=L),j},{})}function w(c,b,x){return c.hasAttributeNS(b,x)?c.getAttributeNS(b,x):null}function v(c){return new Error("Could not parse ttml timestamp "+c)}function i(c,b){if(!c)return null;var x=Object(T.parseTimeStamp)(c);return x===null&&(h.test(c)?x=k(c,b):d.test(c)&&(x=D(c,b))),x}function k(c,b){var x=h.exec(c),_=(x[4]|0)+(x[5]|0)/b.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+_/b.frameRate}function D(c,b){var x=d.exec(c),_=Number(x[1]),j=x[2];switch(j){case"h":return _*3600;case"m":return _*60;case"ms":return _*1e3;case"f":return _/b.frameRate;case"t":return _/b.tickRate}return _}},"./src/utils/logger.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"enableLogs",function(){return s}),S.d(m,"logger",function(){return a});var R=function(){},T={trace:R,debug:R,log:R,warn:R,info:R,error:R},g=T;function C(r){var h=self.console[r];return h?h.bind(self.console,"["+r+"] >"):R}function p(r){for(var h=arguments.length,d=new Array(h>1?h-1:0),f=1;f<h;f++)d[f-1]=arguments[f];d.forEach(function(E){g[E]=r[E]?r[E].bind(r):C(E)})}function s(r){if(self.console&&r===!0||typeof r=="object"){p(r,"debug","log","info","warn","error");try{g.log()}catch(h){g=T}}else g=T}var a=g},"./src/utils/mediakeys-helper.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"KeySystems",function(){return R}),S.d(m,"requestMediaKeySystemAccess",function(){return T});var R;(function(g){g.WIDEVINE="com.widevine.alpha",g.PLAYREADY="com.microsoft.playready"})(R||(R={}));var T=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"getMediaSource",function(){return R});function R(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"bin2str",function(){return p}),S.d(m,"readUint16",function(){return s}),S.d(m,"readUint32",function(){return a}),S.d(m,"writeUint32",function(){return r}),S.d(m,"findBox",function(){return h}),S.d(m,"parseSegmentIndex",function(){return d}),S.d(m,"parseInitSegment",function(){return f}),S.d(m,"getStartDTS",function(){return E}),S.d(m,"getDuration",function(){return y}),S.d(m,"computeRawDurationFromSamples",function(){return l}),S.d(m,"offsetStartDTS",function(){return n}),S.d(m,"segmentValidRange",function(){return o}),S.d(m,"appendUint8Array",function(){return u});var R=S("./src/utils/typed-array.ts"),T=S("./src/loader/fragment.ts"),g=Math.pow(2,32)-1,C=[].push;function p(w){return String.fromCharCode.apply(null,w)}function s(w,v){"data"in w&&(v+=w.start,w=w.data);var i=w[v]<<8|w[v+1];return i<0?65536+i:i}function a(w,v){"data"in w&&(v+=w.start,w=w.data);var i=w[v]<<24|w[v+1]<<16|w[v+2]<<8|w[v+3];return i<0?4294967296+i:i}function r(w,v,i){"data"in w&&(v+=w.start,w=w.data),w[v]=i>>24,w[v+1]=i>>16&255,w[v+2]=i>>8&255,w[v+3]=i&255}function h(w,v){var i=[];if(!v.length)return i;var k,D,c;"data"in w?(k=w.data,D=w.start,c=w.end):(k=w,D=0,c=k.byteLength);for(var b=D;b<c;){var x=a(k,b),_=p(k.subarray(b+4,b+8)),j=x>1?b+x:c;if(_===v[0])if(v.length===1)i.push({data:k,start:b+8,end:j});else{var F=h({data:k,start:b+8,end:j},v.slice(1));F.length&&C.apply(i,F)}b=j}return i}function d(w){var v=h(w,["moov"]),i=v[0],k=i?i.end:null,D=h(w,["sidx"]);if(!D||!D[0])return null;var c=[],b=D[0],x=b.data[0],_=x===0?8:16,j=a(b,_);_+=4;var F=0,L=0;x===0?_+=8:_+=16,_+=2;var X=b.end+L,z=s(b,_);_+=2;for(var H=0;H<z;H++){var G=_,U=a(b,G);G+=4;var B=U&2147483647,W=(U&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=a(b,G);G+=4,c.push({referenceSize:B,subsegmentDuration:te,info:{duration:te/j,start:X,end:X+B-1}}),X+=B,G+=4,_=G}return{earliestPresentationTime:F,timescale:j,version:x,referencesCount:z,references:c,moovEndOffset:k}}function f(w){for(var v=[],i=h(w,["moov","trak"]),k=0;k<i.length;k++){var D=i[k],c=h(D,["tkhd"])[0];if(c){var b=c.data[c.start],x=b===0?12:20,_=a(c,x),j=h(D,["mdia","mdhd"])[0];if(j){b=j.data[j.start],x=b===0?12:20;var F=a(j,x),L=h(D,["mdia","hdlr"])[0];if(L){var X=p(L.data.subarray(L.start+8,L.start+12)),z={soun:T.ElementaryStreamTypes.AUDIO,vide:T.ElementaryStreamTypes.VIDEO}[X];if(z){var H=h(D,["mdia","minf","stbl","stsd"])[0],G=void 0;H&&(G=p(H.data.subarray(H.start+12,H.start+16))),v[_]={timescale:F,type:z},v[z]={timescale:F,id:_,codec:G}}}}}}var U=h(w,["moov","mvex","trex"]);return U.forEach(function(B){var W=a(B,4),te=v[W];te&&(te.default={duration:a(B,12),flags:a(B,20)})}),v}function E(w,v){return h(v,["moof","traf"]).reduce(function(i,k){var D=h(k,["tfdt"])[0],c=D.data[D.start],b=h(k,["tfhd"]).reduce(function(x,_){var j=a(_,4),F=w[j];if(F){var L=a(D,4);c===1&&(L*=Math.pow(2,32),L+=a(D,8));var X=F.timescale||9e4,z=L/X;if(isFinite(z)&&(x===null||z<x))return z}return x},null);return b!==null&&isFinite(b)&&(i===null||b<i)?b:i},null)||0}function y(w,v){for(var i=0,k=0,D=0,c=h(w,["moof","traf"]),b=0;b<c.length;b++){var x=c[b],_=h(x,["tfhd"])[0],j=a(_,4),F=v[j];if(!F)continue;var L=F.default,X=a(_,0)|(L==null?void 0:L.flags),z=L==null?void 0:L.duration;X&8&&(X&2?z=a(_,12):z=a(_,8));for(var H=F.timescale||9e4,G=h(x,["trun"]),U=0;U<G.length;U++){if(z){var B=a(G[U],4);i=z*B}else i=l(G[U]);F.type===T.ElementaryStreamTypes.VIDEO?k+=i/H:F.type===T.ElementaryStreamTypes.AUDIO&&(D+=i/H)}}if(k===0&&D===0){var W=d(w);if(W!=null&&W.references)return W.references.reduce(function(te,de){return te+de.info.duration||0},0)}return k||D}function l(w){var v=a(w,0),i=8;v&1&&(i+=4),v&4&&(i+=4);for(var k=0,D=a(w,4),c=0;c<D;c++){if(v&256){var b=a(w,i);k+=b,i+=4}v&512&&(i+=4),v&1024&&(i+=4),v&2048&&(i+=4)}return k}function n(w,v,i){h(v,["moof","traf"]).forEach(function(k){h(k,["tfhd"]).forEach(function(D){var c=a(D,4),b=w[c];if(!b)return;var x=b.timescale||9e4;h(k,["tfdt"]).forEach(function(_){var j=_.data[_.start],F=a(_,4);if(j===0)r(_,4,F-i*x);else{F*=Math.pow(2,32),F+=a(_,8),F-=i*x,F=Math.max(F,0);var L=Math.floor(F/(g+1)),X=Math.floor(F%(g+1));r(_,4,L),r(_,8,X)}})})})}function o(w){var v={valid:null,remainder:null},i=h(w,["moof"]);if(i){if(i.length<2)return v.remainder=w,v}else return v;var k=i[i.length-1];return v.valid=Object(R.sliceUint8)(w,0,k.start-8),v.remainder=Object(R.sliceUint8)(w,k.start-8),v}function u(w,v){var i=new Uint8Array(w.length+v.length);return i.set(w),i.set(v,w.length),i}},"./src/utils/output-filter.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"default",function(){return R});var R=function(){function T(C,p){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=C,this.trackName=p}var g=T.prototype;return g.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},g.newCue=function(p,s,a){(this.startTime===null||this.startTime>p)&&(this.startTime=p),this.endTime=s,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},g.reset=function(){this.cueRanges=[]},T}()},"./src/utils/texttrack-utils.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"sendAddTrackEvent",function(){return T}),S.d(m,"addCueToTrack",function(){return g}),S.d(m,"clearCurrentCues",function(){return C}),S.d(m,"removeCuesInRange",function(){return p}),S.d(m,"getCuesInRange",function(){return a});var R=S("./src/utils/logger.ts");function T(r,h){var d;try{d=new Event("addtrack")}catch(f){d=document.createEvent("Event"),d.initEvent("addtrack",!1,!1)}d.track=r,h.dispatchEvent(d)}function g(r,h){var d=r.mode;if(d==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(h.id))try{if(r.addCue(h),!r.cues.getCueById(h.id))throw new Error("addCue is failed for: "+h)}catch(E){R.logger.debug("[texttrack-utils]: "+E);var f=new self.TextTrackCue(h.startTime,h.endTime,h.text);f.id=h.id,r.addCue(f)}d==="disabled"&&(r.mode=d)}function C(r){var h=r.mode;if(h==="disabled"&&(r.mode="hidden"),r.cues)for(var d=r.cues.length;d--;)r.removeCue(r.cues[d]);h==="disabled"&&(r.mode=h)}function p(r,h,d){var f=r.mode;if(f==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0)for(var E=a(r.cues,h,d),y=0;y<E.length;y++)r.removeCue(E[y]);f==="disabled"&&(r.mode=f)}function s(r,h){if(h<r[0].startTime)return 0;var d=r.length-1;if(h>r[d].endTime)return-1;for(var f=0,E=d;f<=E;){var y=Math.floor((E+f)/2);if(h<r[y].startTime)E=y-1;else if(h>r[y].startTime&&f<d)f=y+1;else return y}return r[f].startTime-h<h-r[E].startTime?f:E}function a(r,h,d){var f=[],E=s(r,h);if(E>-1)for(var y=E,l=r.length;y<l;y++){var n=r[y];if(n.startTime>=h&&n.endTime<=d)f.push(n);else if(n.startTime>d)return f}return f}},"./src/utils/time-ranges.ts":function(P,m,S){"use strict";S.r(m);var R={toString:function(g){for(var C="",p=g.length,s=0;s<p;s++)C+="["+g.start(s).toFixed(3)+","+g.end(s).toFixed(3)+"]";return C}};m.default=R},"./src/utils/timescale-conversion.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"toTimescaleFromBase",function(){return T}),S.d(m,"toTimescaleFromScale",function(){return g}),S.d(m,"toMsFromMpegTsClock",function(){return C}),S.d(m,"toMpegTsClockFromTimescale",function(){return p});var R=9e4;function T(s,a,r,h){r===void 0&&(r=1),h===void 0&&(h=!1);var d=s*a*r;return h?Math.round(d):d}function g(s,a,r,h){return r===void 0&&(r=1),h===void 0&&(h=!1),T(s,a,1/r,h)}function C(s,a){return a===void 0&&(a=!1),T(s,1e3,1/R,a)}function p(s,a){return a===void 0&&(a=1),T(s,R,1/a)}},"./src/utils/typed-array.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"sliceUint8",function(){return R});function R(T,g,C){return Uint8Array.prototype.slice?T.slice(g,C):new Uint8Array(Array.prototype.slice.call(T,g,C))}},"./src/utils/vttcue.ts":function(P,m,S){"use strict";S.r(m),m.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var R=["","lr","rl"],T=["start","middle","end","left","right"];function g(r,h){if(typeof h!="string")return!1;if(!Array.isArray(r))return!1;var d=h.toLowerCase();return~r.indexOf(d)?d:!1}function C(r){return g(R,r)}function p(r){return g(T,r)}function s(r){for(var h=arguments.length,d=new Array(h>1?h-1:0),f=1;f<h;f++)d[f-1]=arguments[f];for(var E=1;E<arguments.length;E++){var y=arguments[E];for(var l in y)r[l]=y[l]}return r}function a(r,h,d){var f=this,E={enumerable:!0};f.hasBeenReset=!1;var y="",l=!1,n=r,o=h,u=d,w=null,v="",i=!0,k="auto",D="start",c=50,b="middle",x=50,_="middle";Object.defineProperty(f,"id",s({},E,{get:function(){return y},set:function(F){y=""+F}})),Object.defineProperty(f,"pauseOnExit",s({},E,{get:function(){return l},set:function(F){l=!!F}})),Object.defineProperty(f,"startTime",s({},E,{get:function(){return n},set:function(F){if(typeof F!="number")throw new TypeError("Start time must be set to a number.");n=F,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",s({},E,{get:function(){return o},set:function(F){if(typeof F!="number")throw new TypeError("End time must be set to a number.");o=F,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",s({},E,{get:function(){return u},set:function(F){u=""+F,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",s({},E,{get:function(){return w},set:function(F){w=F,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",s({},E,{get:function(){return v},set:function(F){var L=C(F);if(L===!1)throw new SyntaxError("An invalid or illegal string was specified.");v=L,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",s({},E,{get:function(){return i},set:function(F){i=!!F,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",s({},E,{get:function(){return k},set:function(F){if(typeof F!="number"&&F!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");k=F,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",s({},E,{get:function(){return D},set:function(F){var L=p(F);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");D=L,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",s({},E,{get:function(){return c},set:function(F){if(F<0||F>100)throw new Error("Position must be between 0 and 100.");c=F,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",s({},E,{get:function(){return b},set:function(F){var L=p(F);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");b=L,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",s({},E,{get:function(){return x},set:function(F){if(F<0||F>100)throw new Error("Size must be between 0 and 100.");x=F,this.hasBeenReset=!0}})),Object.defineProperty(f,"align",s({},E,{get:function(){return _},set:function(F){var L=p(F);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");_=L,this.hasBeenReset=!0}})),f.displayState=void 0}return a.prototype.getCueAsHTML=function(){var r=self.WebVTT;return r.convertCueToDOMTree(self,this.text)},a}()},"./src/utils/vttparser.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"parseTimeStamp",function(){return g}),S.d(m,"fixLineBreaks",function(){return h}),S.d(m,"VTTParser",function(){return d});var R=S("./src/utils/vttcue.ts"),T=function(){function f(){}var E=f.prototype;return E.decode=function(l,n){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},f}();function g(f){function E(l,n,o,u){return(l|0)*3600+(n|0)*60+(o|0)+parseFloat(u||0)}var y=f.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return y?parseFloat(y[2])>59?E(y[2],y[3],0,y[4]):E(y[1],y[2],y[3],y[4]):null}var C=function(){function f(){this.values=Object.create(null)}var E=f.prototype;return E.set=function(l,n){!this.get(l)&&n!==""&&(this.values[l]=n)},E.get=function(l,n,o){return o?this.has(l)?this.values[l]:n[o]:this.has(l)?this.values[l]:n},E.has=function(l){return l in this.values},E.alt=function(l,n,o){for(var u=0;u<o.length;++u)if(n===o[u]){this.set(l,n);break}},E.integer=function(l,n){/^-?\d+$/.test(n)&&this.set(l,parseInt(n,10))},E.percent=function(l,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var o=parseFloat(n);if(o>=0&&o<=100)return this.set(l,o),!0}return!1},f}();function p(f,E,y,l){var n=l?f.split(l):[f];for(var o in n){if(typeof n[o]!="string")continue;var u=n[o].split(y);if(u.length!==2)continue;var w=u[0],v=u[1];E(w,v)}}var s=new R.default(0,0,""),a=s.align==="middle"?"middle":"center";function r(f,E,y){var l=f;function n(){var w=g(f);if(w===null)throw new Error("Malformed timestamp: "+l);return f=f.replace(/^[^\sa-zA-Z-]+/,""),w}function o(w,v){var i=new C;p(w,function(c,b){var x;switch(c){case"region":for(var _=y.length-1;_>=0;_--)if(y[_].id===b){i.set(c,y[_].region);break}break;case"vertical":i.alt(c,b,["rl","lr"]);break;case"line":x=b.split(","),i.integer(c,x[0]),i.percent(c,x[0])&&i.set("snapToLines",!1),i.alt(c,x[0],["auto"]),x.length===2&&i.alt("lineAlign",x[1],["start",a,"end"]);break;case"position":x=b.split(","),i.percent(c,x[0]),x.length===2&&i.alt("positionAlign",x[1],["start",a,"end","line-left","line-right","auto"]);break;case"size":i.percent(c,b);break;case"align":i.alt(c,b,["start",a,"end","left","right"]);break}},/:/,/\s/),v.region=i.get("region",null),v.vertical=i.get("vertical","");var k=i.get("line","auto");k==="auto"&&s.line===-1&&(k=-1),v.line=k,v.lineAlign=i.get("lineAlign","start"),v.snapToLines=i.get("snapToLines",!0),v.size=i.get("size",100),v.align=i.get("align",a);var D=i.get("position","auto");D==="auto"&&s.position===50&&(D=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=D}function u(){f=f.replace(/^\s+/,"")}if(u(),E.startTime=n(),u(),f.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);f=f.substr(3),u(),E.endTime=n(),u(),o(f,E)}function h(f){return f.replace(/<br(?: \/)?>/gi,`
`)}var d=function(){function f(){this.state="INITIAL",this.buffer="",this.decoder=new T,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var E=f.prototype;return E.parse=function(l){var n=this;l&&(n.buffer+=n.decoder.decode(l,{stream:!0}));function o(){var D=n.buffer,c=0;for(D=h(D);c<D.length&&D[c]!=="\r"&&D[c]!==`
`;)++c;var b=D.substr(0,c);return D[c]==="\r"&&++c,D[c]===`
`&&++c,n.buffer=D.substr(c),b}function u(D){p(D,function(c,b){},/:/)}try{var w="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;w=o();var v=w.match(/^()?WEBVTT([ \t].*)?$/);if(!v||!v[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var i=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;i?i=!1:w=o();switch(n.state){case"HEADER":/:/.test(w)?u(w):w||(n.state="ID");continue;case"NOTE":w||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(w)){n.state="NOTE";break}if(!w)continue;if(n.cue=new R.default(0,0,""),n.state="CUE",w.indexOf("-->")===-1){n.cue.id=w;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{r(w,n.cue,n.regionList)}catch(D){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var k=w.indexOf("-->")!==-1;if(!w||k&&(i=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=`
`),n.cue.text+=w}continue;case"BADCUE":w||(n.state="ID")}}}catch(D){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},E.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){l.onparsingerror&&l.onparsingerror(n)}return l.onflush&&l.onflush(),this},f}()},"./src/utils/webvtt-parser.ts":function(P,m,S){"use strict";S.r(m),S.d(m,"generateCueId",function(){return d}),S.d(m,"parseWebVTT",function(){return E});var R=S("./src/polyfills/number.ts"),T=S("./src/utils/vttparser.ts"),g=S("./src/demux/id3.ts"),C=S("./src/utils/timescale-conversion.ts"),p=S("./src/remux/mp4-remuxer.ts"),s=/\r\n|\n\r|\n|\r/g,a=function(l,n,o){return o===void 0&&(o=0),l.substr(o,n.length)===n},r=function(l){var n=parseInt(l.substr(-3)),o=parseInt(l.substr(-6,2)),u=parseInt(l.substr(-9,2)),w=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(R.isFiniteNumber)(n)||!Object(R.isFiniteNumber)(o)||!Object(R.isFiniteNumber)(u)||!Object(R.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return n+=1e3*o,n+=60*1e3*u,n+=60*60*1e3*w,n},h=function(l){for(var n=5381,o=l.length;o;)n=n*33^l.charCodeAt(--o);return(n>>>0).toString()};function d(y,l,n){return h(y.toString())+h(l.toString())+h(n)}var f=function(l,n,o){var u=l[n],w=l[u.prevCC];if(!w||!w.new&&u.new){l.ccOffset=l.presentationOffset=u.start,u.new=!1;return}for(;(v=w)!==null&&v!==void 0&&v.new;){var v;l.ccOffset+=u.start-w.start,u.new=!1,u=w,w=l[u.prevCC]}l.presentationOffset=o};function E(y,l,n,o,u,w,v,i){var k=new T.VTTParser,D=Object(g.utf8ArrayToStr)(new Uint8Array(y)).trim().replace(s,`
`).split(`
`),c=[],b=Object(C.toMpegTsClockFromTimescale)(l,n),x="00:00.000",_=0,j=0,F,L=!0,X=!1;k.oncue=function(z){var H=o[u],G=o.ccOffset,U=(_-b)/9e4;if(H!=null&&H.new&&(j!==void 0?G=o.ccOffset=H.start:f(o,u,U)),U&&(G=U-o.presentationOffset),X){var B=z.endTime-z.startTime,W=Object(p.normalizePts)((z.startTime+G-j)*9e4,w*9e4)/9e4;z.startTime=W,z.endTime=W+B}var te=z.text.trim();z.text=decodeURIComponent(encodeURIComponent(te)),z.id||(z.id=d(z.startTime,z.endTime,te)),z.endTime>0&&c.push(z)},k.onparsingerror=function(z){F=z},k.onflush=function(){if(F){i(F);return}v(c)},D.forEach(function(z){if(L)if(a(z,"X-TIMESTAMP-MAP=")){L=!1,X=!0,z.substr(16).split(",").forEach(function(H){a(H,"LOCAL:")?x=H.substr(6):a(H,"MPEGTS:")&&(_=parseInt(H.substr(7)))});try{j=r(x)/1e3}catch(H){X=!1,F=H}return}else z===""&&(L=!1);k.parse(z+`
`)}),k.flush()}},"./src/utils/xhr-loader.ts":function(P,m,S){"use strict";S.r(m);var R=S("./src/utils/logger.ts"),T=S("./src/loader/load-stats.ts"),g=/^age:\s*[\d.]+\s*$/m,C=function(){function p(a){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=a?a.xhrSetup:null,this.stats=new T.LoadStats,this.retryDelay=0}var s=p.prototype;return s.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},s.abortInternal=function(){var r=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),r&&(r.onreadystatechange=null,r.onprogress=null,r.readyState!==4&&(this.stats.aborted=!0,r.abort()))},s.abort=function(){var r;this.abortInternal(),(r=this.callbacks)!==null&&r!==void 0&&r.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},s.load=function(r,h,d){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=r,this.config=h,this.callbacks=d,this.retryDelay=h.retryDelay,this.loadInternal()},s.loadInternal=function(){var r=this.config,h=this.context;if(!r)return;var d=this.loader=new self.XMLHttpRequest,f=this.stats;f.loading.first=0,f.loaded=0;var E=this.xhrSetup;try{if(E)try{E(d,h.url)}catch(n){d.open("GET",h.url,!0),E(d,h.url)}d.readyState||d.open("GET",h.url,!0);var y=this.context.headers;if(y)for(var l in y)d.setRequestHeader(l,y[l])}catch(n){this.callbacks.onError({code:d.status,text:n.message},h,d);return}h.rangeEnd&&d.setRequestHeader("Range","bytes="+h.rangeStart+"-"+(h.rangeEnd-1)),d.onreadystatechange=this.readystatechange.bind(this),d.onprogress=this.loadprogress.bind(this),d.responseType=h.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),d.send()},s.readystatechange=function(){var r=this.context,h=this.loader,d=this.stats;if(!r||!h)return;var f=h.readyState,E=this.config;if(d.aborted)return;if(f>=2)if(self.clearTimeout(this.requestTimeout),d.loading.first===0&&(d.loading.first=Math.max(self.performance.now(),d.loading.start)),f===4){h.onreadystatechange=null,h.onprogress=null;var y=h.status;if(y>=200&&y<300){d.loading.end=Math.max(self.performance.now(),d.loading.first);var l,n;if(r.responseType==="arraybuffer"?(l=h.response,n=l.byteLength):(l=h.responseText,n=l.length),d.loaded=d.total=n,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(d,r,l,h),!this.callbacks)return;var u={url:h.responseURL,data:l};this.callbacks.onSuccess(u,d,r,h)}else d.retry>=E.maxRetry||y>=400&&y<499?(R.logger.error(y+" while loading "+r.url),this.callbacks.onError({code:y,text:h.statusText},r,h)):(R.logger.warn(y+" while loading "+r.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,E.maxRetryDelay),d.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout)},s.loadtimeout=function(){R.logger.warn("timeout while loading "+this.context.url);var r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))},s.loadprogress=function(r){var h=this.stats;h.loaded=r.loaded,r.lengthComputable&&(h.total=r.total)},s.getCacheAge=function(){var r=null;if(this.loader&&g.test(this.loader.getAllResponseHeaders())){var h=this.loader.getResponseHeader("age");r=h?parseFloat(h):null}return r},p}();m.default=C}}).default})},vHTk:function(I,q,M){I.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},w7YG:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("ETIr"),M("cv67"),M("K3mO"),M("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.StreamCipher,T=m.algo,g=T.RC4=R.extend({_doReset:function(){for(var s=this._key,a=s.words,r=s.sigBytes,h=this._S=[],d=0;d<256;d++)h[d]=d;for(var d=0,f=0;d<256;d++){var E=d%r,y=a[E>>>2]>>>24-E%4*8&255;f=(f+h[d]+y)%256;var l=h[d];h[d]=h[f],h[f]=l}this._i=this._j=0},_doProcessBlock:function(s,a){s[a]^=C.call(this)},keySize:256/32,ivSize:0});function C(){for(var s=this._S,a=this._i,r=this._j,h=0,d=0;d<4;d++){a=(a+1)%256,r=(r+s[a])%256;var f=s[a];s[a]=s[r],s[r]=f,h|=s[(s[a]+s[r])%256]<<24-d*8}return this._i=a,this._j=r,h}m.RC4=R._createHelper(g);var p=T.RC4Drop=g.extend({cfg:g.cfg.extend({drop:192}),_doReset:function(){g._doReset.call(this);for(var s=this.cfg.drop;s>0;s--)C.call(this)}});m.RC4Drop=R._createHelper(p)}(),P.RC4})},wZgz:function(I,q,M){(function(P,m,S){I.exports=q=m(M("Ib8C"),M("ETIr"),M("cv67"),M("K3mO"),M("OLod"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.BlockCipher,T=m.algo,g=[],C=[],p=[],s=[],a=[],r=[],h=[],d=[],f=[],E=[];(function(){for(var n=[],o=0;o<256;o++)o<128?n[o]=o<<1:n[o]=o<<1^283;for(var u=0,w=0,o=0;o<256;o++){var v=w^w<<1^w<<2^w<<3^w<<4;v=v>>>8^v&255^99,g[u]=v,C[v]=u;var i=n[u],k=n[i],D=n[k],c=n[v]*257^v*16843008;p[u]=c<<24|c>>>8,s[u]=c<<16|c>>>16,a[u]=c<<8|c>>>24,r[u]=c;var c=D*16843009^k*65537^i*257^u*16843008;h[v]=c<<24|c>>>8,d[v]=c<<16|c>>>16,f[v]=c<<8|c>>>24,E[v]=c,u?(u=i^n[n[n[D^i]]],w^=n[n[w]]):u=w=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],l=T.AES=R.extend({_doReset:function(){var n;if(this._nRounds&&this._keyPriorReset===this._key)return;for(var o=this._keyPriorReset=this._key,u=o.words,w=o.sigBytes/4,v=this._nRounds=w+6,i=(v+1)*4,k=this._keySchedule=[],D=0;D<i;D++)D<w?k[D]=u[D]:(n=k[D-1],D%w?w>6&&D%w==4&&(n=g[n>>>24]<<24|g[n>>>16&255]<<16|g[n>>>8&255]<<8|g[n&255]):(n=n<<8|n>>>24,n=g[n>>>24]<<24|g[n>>>16&255]<<16|g[n>>>8&255]<<8|g[n&255],n^=y[D/w|0]<<24),k[D]=k[D-w]^n);for(var c=this._invKeySchedule=[],b=0;b<i;b++){var D=i-b;if(b%4)var n=k[D];else var n=k[D-4];b<4||D<=4?c[b]=n:c[b]=h[g[n>>>24]]^d[g[n>>>16&255]]^f[g[n>>>8&255]]^E[g[n&255]]}},encryptBlock:function(n,o){this._doCryptBlock(n,o,this._keySchedule,p,s,a,r,g)},decryptBlock:function(n,o){var u=n[o+1];n[o+1]=n[o+3],n[o+3]=u,this._doCryptBlock(n,o,this._invKeySchedule,h,d,f,E,C);var u=n[o+1];n[o+1]=n[o+3],n[o+3]=u},_doCryptBlock:function(n,o,u,w,v,i,k,D){for(var c=this._nRounds,b=n[o]^u[0],x=n[o+1]^u[1],_=n[o+2]^u[2],j=n[o+3]^u[3],F=4,L=1;L<c;L++){var X=w[b>>>24]^v[x>>>16&255]^i[_>>>8&255]^k[j&255]^u[F++],z=w[x>>>24]^v[_>>>16&255]^i[j>>>8&255]^k[b&255]^u[F++],H=w[_>>>24]^v[j>>>16&255]^i[b>>>8&255]^k[x&255]^u[F++],G=w[j>>>24]^v[b>>>16&255]^i[x>>>8&255]^k[_&255]^u[F++];b=X,x=z,_=H,j=G}var X=(D[b>>>24]<<24|D[x>>>16&255]<<16|D[_>>>8&255]<<8|D[j&255])^u[F++],z=(D[x>>>24]<<24|D[_>>>16&255]<<16|D[j>>>8&255]<<8|D[b&255])^u[F++],H=(D[_>>>24]<<24|D[j>>>16&255]<<16|D[b>>>8&255]<<8|D[x&255])^u[F++],G=(D[j>>>24]<<24|D[b>>>16&255]<<16|D[x>>>8&255]<<8|D[_&255])^u[F++];n[o]=X,n[o+1]=z,n[o+2]=H,n[o+3]=G},keySize:256/32});m.AES=R._createHelper(l)}(),P.AES})},wbyO:function(I,q,M){(function(P,m){I.exports=q=m(M("Ib8C"))})(this,function(P){return function(){var m=P,S=m.lib,R=S.WordArray,T=m.enc,g=T.Base64url={stringify:function(p,s=!0){var a=p.words,r=p.sigBytes,h=s?this._safe_map:this._map;p.clamp();for(var d=[],f=0;f<r;f+=3)for(var E=a[f>>>2]>>>24-f%4*8&255,y=a[f+1>>>2]>>>24-(f+1)%4*8&255,l=a[f+2>>>2]>>>24-(f+2)%4*8&255,n=E<<16|y<<8|l,o=0;o<4&&f+o*.75<r;o++)d.push(h.charAt(n>>>6*(3-o)&63));var u=h.charAt(64);if(u)for(;d.length%4;)d.push(u);return d.join("")},parse:function(p,s=!0){var a=p.length,r=s?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var d=0;d<r.length;d++)h[r.charCodeAt(d)]=d}var f=r.charAt(64);if(f){var E=p.indexOf(f);E!==-1&&(a=E)}return C(p,a,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function C(p,s,a){for(var r=[],h=0,d=0;d<s;d++)if(d%4){var f=a[p.charCodeAt(d-1)]<<d%4*2,E=a[p.charCodeAt(d)]>>>6-d%4*2,y=f|E;r[h>>>2]|=y<<24-h%4*8,h++}return R.create(r,h)}}(),P.enc.Base64url})},ynwM:function(I,q,M){var P=M("MFOe"),m=P.Global;I.exports={name:"oldFF-globalStorage",read:R,write:T,each:g,remove:C,clearAll:p};var S=m.globalStorage;function R(s){return S[s]}function T(s,a){S[s]=a}function g(s){for(var a=S.length-1;a>=0;a--){var r=S.key(a);s(S[r],r)}}function C(s){return S.removeItem(s)}function p(){g(function(s,a){delete S[s]})}}}]);