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__Classrooms__Lists__Gradu...

431 lines
1.2 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[79,5,7,8,13],{"+NIl":function(Rt,$e,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";ae.defineMode("stex",function(X,P){"use strict";function V(c,r){c.cmdState.push(r)}function L(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function M(c){var r=c.cmdState.pop();r&&r.closeBracket()}function H(c){for(var r=c.cmdState,l=r.length-1;l>=0;l--){var u=r[l];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function U(c,r,l){return function(){this.name=c,this.bracketNo=0,this.style=r,this.styles=l,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=U("importmodule","tag",["string","builtin"]),k.documentclass=U("documentclass","tag",["","atom"]),k.usepackage=U("usepackage","tag",["atom"]),k.begin=U("begin","tag",["atom"]),k.end=U("end","tag",["atom"]),k.label=U("label","tag",["atom"]),k.ref=U("ref","tag",["atom"]),k.eqref=U("eqref","tag",["atom"]),k.cite=U("cite","tag",["atom"]),k.bibitem=U("bibitem","tag",["atom"]),k.Bibitem=U("Bibitem","tag",["atom"]),k.RBibitem=U("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(c,r){c.f=r}function b(c,r){var l;if(c.match(/^\\[a-zA-Z@]+/)){var u=c.current().slice(1);return l=k.hasOwnProperty(u)?k[u]:k.DEFAULT,l=new l,V(r,l),I(r,p),l.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(r,function(s,f){return y(s,f,"\\]")}),"keyword";if(c.match("\\("))return I(r,function(s,f){return y(s,f,"\\)")}),"keyword";if(c.match("$$"))return I(r,function(s,f){return y(s,f,"$$")}),"keyword";if(c.match("$"))return I(r,function(s,f){return y(s,f,"$")}),"keyword";var a=c.next();if(a=="%")return c.skipToEnd(),"comment";if(a=="}"||a=="]"){if(l=L(r),l)l.closeBracket(a),I(r,p);else return"error";return"bracket"}else return a=="{"||a=="["?(l=k.DEFAULT,l=new l,V(r,l),"bracket"):/\d/.test(a)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),l=H(r),l.name=="begin"&&(l.argument=c.current()),l.styleIdentifier())}function y(c,r,l){if(c.eatSpace())return null;if(l&&c.match(l))return I(r,b),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variable-2";if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/]/))return"tag";if(c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=c.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(c.skipToEnd(),"comment"):"error"}function p(c,r){var l=c.peek(),u;return l=="{"||l=="["?(u=L(r),u.openBracket(l),c.eat(l),I(r,b),"bracket"):/[ \t\r]/.test(l)?(c.eat(l),null):(I(r,b),M(r),b(c,r))}return{startState:function(){var c=P.inMathMode?function(r,l){return y(r,l)}:b;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,r){return r.f(c,r)},blankLine:function(c){c.f=b,c.cmdState.length=0},lineComment:"%"}}),ae.defineMIME("text/x-stex","stex"),ae.defineMIME("text/x-latex","stex")})},"+ua5":function(Rt,$e,Q){},"19Vz":function(Rt,$e,Q){(function(ae){ae(Q("VrN/"))})(function(ae){ae.defineOption("placeholder","",function(U,k,I){var b=I&&I!=ae.Init;if(k&&!b)U.on("blur",L),U.on("change",M),U.on("swapDoc",M),ae.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){V(U)}),M(U);else if(!k&&b){U.off("blur",L),U.off("change",M),U.off("swapDoc",M),ae.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),X(U);var y=U.getWrapperElement();y.className=y.className.replace(" CodeMirror-empty","")}k&&!U.hasFocus()&&L(U)});function X(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function P(U){X(U);var k=U.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=U.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var I=U.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),k.appendChild(I),U.display.lineSpace.insertBefore(k,U.display.lineSpace.firstChild)}function V(U){setTimeout(function(){var k=!1,I=U.getInputField();I.nodeName=="TEXTAREA"?k=!I.value:U.lineCount()==1&&(k=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),k?P(U):X(U)},20)}function L(U){H(U)&&P(U)}function M(U){var k=U.getWrapperElement(),I=H(U);k.className=k.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?P(U):X(U)}function H(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(Rt,$e,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";var X={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ae.defineMode("xml",function(V,L){var M=V.indentUnit,H={},U=L.htmlMode?X:P;for(var k in U)H[k]=U[k];for(var k in L)H[k]=L[k];var I,b;function y(o,_){function m(j){return _.tokenize=j,j(o,_)}var T=o.next();if(T=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?m(r("atom","]]>")):null:o.match("--")?m(r("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),m(l(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),_.tokenize=r("meta","?>"),"meta"):(I=o.eat("/")?"closeTag":"openTag",_.tokenize=p,"tag bracket");if(T=="&"){var N;return o.eat("#")?o.eat("x")?N=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):N=o.eatWhile(/[\d]/)&&o.eat(";"):N=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),N?"atom":"error"}else return o.eatWhile(/[^&<]/),null}y.isInText=!0;function p(o,_){var m=o.next();if(m==">"||m=="/"&&o.eat(">"))return _.tokenize=y,I=m==">"?"endTag":"selfcloseTag","tag bracket";if(m=="=")return I="equals",null;if(m=="<"){_.tokenize=y,_.state=f,_.tagName=_.tagStart=null;var T=_.tokenize(o,_);return T?T+" tag error":"tag error"}else return/[\'\"]/.test(m)?(_.tokenize=c(m),_.stringStartCol=o.column(),_.tokenize(o,_)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(o){var _=function(m,T){for(;!m.eol();)if(m.next()==o){T.tokenize=p;break}return"string"};return _.isInAttribute=!0,_}function r(o,_){return function(m,T){for(;!m.eol();){if(m.match(_)){T.tokenize=y;break}m.next()}return o}}function l(o){return function(_,m){for(var T;(T=_.next())!=null;){if(T=="<")return m.tokenize=l(o+1),m.tokenize(_,m);if(T==">")if(o==1){m.tokenize=y;break}else return m.tokenize=l(o-1),m.tokenize(_,m)}return"meta"}}function u(o,_,m){this.prev=o.context,this.tagName=_,this.indent=o.indented,this.startOfLine=m,(H.doNotIndent.hasOwnProperty(_)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function a(o){o.context&&(o.context=o.context.prev)}function s(o,_){for(var m;;){if(!o.context)return;if(m=o.context.tagName,!H.contextGrabbers.hasOwnProperty(m)||!H.contextGrabbers[m].hasOwnProperty(_))return;a(o)}}function f(o,_,m){return o=="openTag"?(m.tagStart=_.column(),O):o=="closeTag"?S:f}function O(o,_,m){return o=="word"?(m.tagName=_.current(),b="tag",w):H.allowMissingTagName&&o=="endTag"?(b="tag bracket",w(o,_,m)):(b="error",O)}function S(o,_,m){if(o=="word"){var T=_.current();return m.context&&m.context.tagName!=T&&H.implicitlyClosed.hasOwnProperty(m.context.tagName)&&a(m),m.context&&m.context.tagName==T||H.matchClosing===!1?(b="tag",E):(b="tag error",C)}else return H.allowMissingTagName&&o=="endTag"?(b="tag bracket",E(o,_,m)):(b="error",C)}function E(o,_,m){return o!="endTag"?(b="error",E):(a(m),f)}function C(o,_,m){return b="error",E(o,_,m)}function w(o,_,m){if(o=="word")return b="attribute",g;if(o=="endTag"||o=="selfcloseTag"){var T=m.tagName,N=m.tagStart;return m.tagName=m.tagStart=null,o=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(T)?s(m,T):(s(m,T),m.context=new u(m,T,N==m.indented)),f}return b="error",w}function g(o,_,m){return o=="equals"?v:(H.allowMissing||(b="error"),w(o,_,m))}function v(o,_,m){return o=="string"?h:o=="word"&&H.allowUnquoted?(b="string",w):(b="error",w(o,_,m))}function h(o,_,m){return o=="string"?h:w(o,_,m)}return{startState:function(o){var _={tokenize:y,state:f,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(_.baseIndent=o),_},token:function(o,_){if(!_.tagName&&o.sol()&&(_.indented=o.indentation()),o.eatSpace())return null;I=null;var m=_.tokenize(o,_);return(m||I)&&m!="comment"&&(b=null,_.state=_.state(I||m,o,_),b&&(m=b=="error"?m+" error":b)),m},indent:function(o,_,m){var T=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+M;if(T&&T.noIndent)return ae.Pass;if(o.tokenize!=p&&o.tokenize!=y)return m?m.match(/^(\s*)/)[0].length:0;if(o.tagName)return H.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+M*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(_))return 0;var N=_&&/^<(\/)?([\w_:\.-]*)/.exec(_);if(N&&N[1])for(;T;)if(T.tagName==N[2]){T=T.prev;break}else if(H.implicitlyClosed.hasOwnProperty(T.tagName))T=T.prev;else break;else if(N)for(;T;){var j=H.contextGrabbers[T.tagName];if(j&&j.hasOwnProperty(N[2]))T=T.prev;else break}for(;T&&T.prev&&!T.startOfLine;)T=T.prev;return T?T.indent+M:o.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(o){o.state==v&&(o.state=w)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var _=[],m=o.context;m;m=m.prev)m.tagName&&_.push(m.tagName);return _.reverse()}}}),ae.defineMIME("text/xml","xml"),ae.defineMIME("application/xml","xml"),ae.mimeModes.hasOwnProperty("text/html")||ae.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return s});var ae=Q("Ty5D"),X=Q("dI71"),P=Q("q1tI"),V=Q.n(P),L=Q("YS25"),M=Q("17x9"),H=Q.n(M),U=Q("wx14"),k=Q("zLVn"),I=Q("9R94"),b=function(v){Object(X.a)(h,v);function h(){for(var _,m=arguments.length,T=new Array(m),N=0;N<m;N++)T[N]=arguments[N];return _=v.call.apply(v,[this].concat(T))||this,_.history=Object(L.a)(_.props),_}var o=h.prototype;return o.render=function(){return V.a.createElement(ae.c,{history:this.history,children:this.props.children})},h}(V.a.Component),y=function(v){Object(X.a)(h,v);function h(){for(var _,m=arguments.length,T=new Array(m),N=0;N<m;N++)T[N]=arguments[N];return _=v.call.apply(v,[this].concat(T))||this,_.history=Object(L.b)(_.props),_}var o=h.prototype;return o.render=function(){return V.a.createElement(ae.c,{history:this.history,children:this.props.children})},h}(V.a.Component),p=function(h,o){return typeof h=="function"?h(o):h},c=function(h,o){return typeof h=="string"?Object(L.c)(h,null,null,o):h},r=function(h){return h},l=V.a.forwardRef;typeof l=="undefined"&&(l=r);function u(v){return!!(v.metaKey||v.altKey||v.ctrlKey||v.shiftKey)}var a=l(function(v,h){var o=v.innerRef,_=v.navigate,m=v.onClick,T=Object(k.a)(v,["innerRef","navigate","onClick"]),N=T.target,j=Object(U.a)({},T,{onClick:function(Y){try{m&&m(Y)}catch(B){throw Y.preventDefault(),B}!Y.defaultPrevented&&Y.button===0&&(!N||N==="_self")&&!u(Y)&&(Y.preventDefault(),_())}});return r!==l?j.ref=h||o:j.ref=o,V.a.createElement("a",j)}),s=l(function(v,h){var o=v.component,_=o===void 0?a:o,m=v.replace,T=v.to,N=v.innerRef,j=Object(k.a)(v,["component","replace","to","innerRef"]);return V.a.createElement(ae.e.Consumer,null,function(W){W||Object(I.a)(!1);var Y=W.history,B=c(p(T,W.location),W.location),R=B?Y.createHref(B):"",$=Object(U.a)({},j,{href:R,navigate:function(){var ue=p(T,W.location),me=m?Y.replace:Y.push;me(ue)}});return r!==l?$.ref=h||N:$.innerRef=N,V.a.createElement(_,$)})});if(!1)var f,O;var S=function(h){return h},E=V.a.forwardRef;typeof E=="undefined"&&(E=S);function C(){for(var v=arguments.length,h=new Array(v),o=0;o<v;o++)h[o]=arguments[o];return h.filter(function(_){return _}).join(" ")}var w=E(function(v,h){var o=v["aria-current"],_=o===void 0?"page":o,m=v.activeClassName,T=m===void 0?"active":m,N=v.activeStyle,j=v.className,W=v.exact,Y=v.isActive,B=v.location,R=v.sensitive,$=v.strict,te=v.style,ue=v.to,me=v.innerRef,Me=Object(k.a)(v,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return V.a.createElement(ae.e.Consumer,null,function(Ae){Ae||Object(I.a)(!1);var De=B||Ae.location,Fe=c(p(ue,De),De),Ne=Fe.pathname,Ee=Ne&&Ne.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),se=Ee?Object(ae.f)(De.pathname,{path:Ee,exact:W,sensitive:R,strict:$}):null,He=!!(Y?Y(se,De):se),ft=He?C(j,T):j,lt=He?Object(U.a)({},te,{},N):te,it=Object(U.a)({"aria-current":He&&_||null,className:ft,style:lt,to:Fe},Me);return S!==E?it.ref=h||me:it.innerRef=me,V.a.createElement(s,it)})});if(!1)var g},"5VLF":function(Rt,$e,Q){"use strict";var ae,X;function P(V,L,M){var H=function(U,k){return V.js_beautify(U,k)};return H.js=V.js_beautify,H.css=L.css_beautify,H.html=M.html_beautify,H.js_beautify=V.js_beautify,H.css_beautify=L.css_beautify,H.html_beautify=M.html_beautify,H}!(ae=[Q("6UM0"),Q("TXwP"),Q("psGv")],X=function(V,L,M){return P(V,L,M)}.apply($e,ae),X!==void 0&&(Rt.exports=X))},"6+eU":function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return E});var ae=Q("wx14"),X=Q("rePB"),P=Q("VTBJ"),V=Q("1OyB"),L=Q("vuIU"),M=Q("Ji7U"),H=Q("LK+K"),U=Q("q1tI"),k=Q.n(U),I=Q("TSYQ"),b=Q.n(I),y=function(w){var g,v="".concat(w.rootPrefixCls,"-item"),h=b()(v,"".concat(v,"-").concat(w.page),(g={},Object(X.a)(g,"".concat(v,"-active"),w.active),Object(X.a)(g,w.className,!!w.className),Object(X.a)(g,"".concat(v,"-disabled"),!w.page),g)),o=function(){w.onClick(w.page)},_=function(T){w.onKeyPress(T,w.onClick,w.page)};return k.a.createElement("li",{title:w.showTitle?w.page:null,className:h,onClick:o,onKeyPress:_,tabIndex:"0"},w.itemRender(w.page,"page",k.a.createElement("a",{rel:"nofollow"},w.page)))},p=y,c={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},r=function(C){Object(M.a)(g,C);var w=Object(H.a)(g);function g(){var v;Object(V.a)(this,g);for(var h=arguments.length,o=new Array(h),_=0;_<h;_++)o[_]=arguments[_];return v=w.call.apply(w,[this].concat(o)),v.state={goInputText:""},v.buildOptionText=function(m){return"".concat(m," ").concat(v.props.locale.items_per_page)},v.changeSize=function(m){v.props.changeSize(Number(m))},v.handleChange=function(m){v.setState({goInputText:m.target.value})},v.handleBlur=function(m){var T=v.props,N=T.goButton,j=T.quickGo,W=T.rootPrefixCls,Y=v.state.goInputText;if(N||Y==="")return;if(m.relatedTarget&&(m.relatedTarget.className.indexOf("".concat(W,"-prev"))>=0||m.relatedTarget.className.indexOf("".concat(W,"-next"))>=0))return;v.setState({goInputText:""}),j(v.getValidValue())},v.go=function(m){var T=v.state.goInputText;if(T==="")return;(m.keyCode===c.ENTER||m.type==="click")&&(v.setState({goInputText:""}),v.props.quickGo(v.getValidValue()))},v}return Object(L.a)(g,[{key:"getValidValue",value:function(){var h=this.state,o=h.goInputText,_=h.current;return!o||isNaN(o)?_:Number(o)}},{key:"getPageSizeOptions",value:function(){var h=this.props,o=h.pageSize,_=h.pageSizeOptions;return _.some(function(m){return m.toString()===o.toString()})?_:_.concat([o.toString()]).sort(function(m,T){var N=isNaN(Number(m))?0:Number(m),j=isNaN(Number(T))?0:Number(T);return N-j})}},{key:"render",value:function(){var h=this,o=this.props,_=o.pageSize,m=o.locale,T=o.rootPrefixCls,N=o.changeSize,j=o.quickGo,W=o.goButton,Y=o.selectComponentClass,B=o.buildOptionText,R=o.selectPrefixCls,$=o.disabled,te=this.state.goInputText,ue="".concat(T,"-options"),me=Y,Me=null,Ae=null,De=null;if(!N&&!j)return null;var Fe=this.getPageSizeOptions();if(N&&me){var Ne=Fe.map(function(Ee,se){return k.a.createElement(me.Option,{key:se,value:Ee.toString()},(B||h.buildOptionText)(Ee))});Me=k.a.createElement(me,{disabled:$,prefixCls:R,showSearch:!1,className:"".concat(ue,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(_||Fe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(se){return se.parentNode}},Ne)}return j&&(W&&(De=typeof W=="boolean"?k.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:$,className:"".concat(ue,"-quick-jumper-button")},m.jump_to_confirm):k.a.createElement("span",{onClick:this.go,onKeyUp:this.go},W)),Ae=k.a.createElement("div",{className:"".concat(ue,"-quick-jumper")},m.jump_to,k.a.createElement("input",{disabled:$,type:"text",value:te,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),m.page,De)),k.a.createElement("li",{className:"".concat(ue)},Me,Ae)}}]),g}(k.a.Component);r.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=r,u=Q("N2Kk");function a(){}function s(C){return typeof C=="number"&&isFinite(C)&&Math.floor(C)===C}function f(C,w,g){return g}function O(C,w,g){var v=typeof C=="undefined"?w.pageSize:C;return Math.floor((g.total-1)/v)+1}var S=function(C){Object(M.a)(g,C);var w=Object(H.a)(g);function g(v){var h;Object(V.a)(this,g),h=w.call(this,v),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(O(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(N,j){var W=h.props.prefixCls,Y=N||k.a.createElement("button",{type:"button","aria-label":j,className:"".concat(W,"-item-link")});return typeof N=="function"&&(Y=k.a.createElement(N,Object(P.a)({},h.props))),Y},h.savePaginationNode=function(N){h.paginationNode=N},h.isValid=function(N){return s(N)&&N!==h.state.current},h.shouldDisplayQuickJumper=function(){var N=h.props,j=N.showQuickJumper,W=N.pageSize,Y=N.total;return Y<=W?!1:j},h.handleKeyDown=function(N){(N.keyCode===c.ARROW_UP||N.keyCode===c.ARROW_DOWN)&&N.preventDefault()},h.handleKeyUp=function(N){var j=h.getValidValue(N),W=h.state.currentInputValue;j!==W&&h.setState({currentInputValue:j}),N.keyCode===c.ENTER?h.handleChange(j):N.keyCode===c.ARROW_UP?h.handleChange(j-1):N.keyCode===c.ARROW_DOWN&&h.handleChange(j+1)},h.changePageSize=function(N){var j=h.state.current,W=O(N,h.state,h.props);j=j>W?W:j,W===0&&(j=h.state.current),typeof N=="number"&&("pageSize"in h.props||h.setState({pageSize:N}),"current"in h.props||h.setState({current:j,currentInputValue:j})),h.props.onShowSizeChange(j,N),"onChange"in h.props&&h.props.onChange&&h.props.onChange(j,N)},h.handleChange=function(N){var j=h.props.disabled,W=N;if(h.isValid(W)&&!j){var Y=O(void 0,h.state,h.props);W>Y?W=Y:W<1&&(W=1),"current"in h.props||h.setState({current:W,currentInputValue:W});var B=h.state.pageSize;return h.props.onChange(W,B),W}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current<O(void 0,h.state,h.props)},h.runIfEnter=function(N,j){if(N.key==="Enter"||N.charCode===13){for(var W=arguments.length,Y=new Array(W>2?W-2:0),B=2;B<W;B++)Y[B-2]=arguments[B];j.apply(void 0,Y)}},h.runIfEnterPrev=function(N){h.runIfEnter(N,h.prev)},h.runIfEnterNext=function(N){h.runIfEnter(N,h.next)},h.runIfEnterJumpPrev=function(N){h.runIfEnter(N,h.jumpPrev)},h.runIfEnterJumpNext=function(N){h.runIfEnter(N,h.jumpNext)},h.handleGoTO=function(N){(N.keyCode===c.ENTER||N.type==="click")&&h.handleChange(h.state.currentInputValue)};var o=v.onChange!==a,_="current"in v;_&&!o&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var m=v.defaultCurrent;"current"in v&&(m=v.current);var T=v.defaultPageSize;return"pageSize"in v&&(T=v.pageSize),m=Math.min(m,O(T,void 0,v)),h.state={current:m,currentInputValue:m,pageSize:T},h}return Object(L.a)(g,[{key:"componentDidUpdate",value:function(h,o){var _=this.props.prefixCls;if(o.current!==this.state.current&&this.paginationNode){var m=this.paginationNode.querySelector(".".concat(_,"-item-").concat(o.current));m&&document.activeElement===m&&m.blur()}}},{key:"getValidValue",value:function(h){var o=h.target.value,_=O(void 0,this.state,this.props),m=this.state.currentInputValue,T;return o===""?T=o:isNaN(Number(o))?T=m:o>=_?T=_:T=Number(o),T}},{key:"getShowSizeChanger",value:function(){var h=this.props,o=h.showSizeChanger,_=h.total,m=h.totalBoundaryShowSizeChanger;return typeof o!="undefined"?o:_>m}},{key:"renderPrev",value:function(h){var o=this.props,_=o.prevIcon,m=o.itemRender,T=m(h,"prev",this.getItemIcon(_,"prev page")),N=!this.hasPrev();return Object(U.isValidElement)(T)?Object(U.cloneElement)(T,{disabled:N}):T}},{key:"renderNext",value:function(h){var o=this.props,_=o.nextIcon,m=o.itemRender,T=m(h,"next",this.getItemIcon(_,"next page")),N=!this.hasNext();return Object(U.isValidElement)(T)?Object(U.cloneElement)(T,{disabled:N}):T}},{key:"render",value:function(){var h=this,o=this.props,_=o.prefixCls,m=o.className,T=o.style,N=o.disabled,j=o.hideOnSinglePage,W=o.total,Y=o.locale,B=o.showQuickJumper,R=o.showLessItems,$=o.showTitle,te=o.showTotal,ue=o.simple,me=o.itemRender,Me=o.showPrevNextJumpers,Ae=o.jumpPrevIcon,De=o.jumpNextIcon,Fe=o.selectComponentClass,Ne=o.selectPrefixCls,Ee=o.pageSizeOptions,se=this.state,He=se.current,ft=se.pageSize,lt=se.currentInputValue;if(j===!0&&W<=ft)return null;var it=O(void 0,this.state,this.props),ct=[],Ve=null,Je=null,st=null,gt=null,ut=null,et=B&&B.goButton,qe=R?1:2,St=He-1>0?He-1:0,pt=He+1<it?He+1:it,nt=Object.keys(this.props).reduce(function(ne,oe){return(oe.substr(0,5)==="data-"||oe.substr(0,5)==="aria-"||oe==="role")&&(ne[oe]=h.props[oe]),ne},{});if(ue)return et&&(typeof et=="boolean"?ut=k.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Y.jump_to_confirm):ut=k.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},et),ut=k.a.createElement("li",{title:$?"".concat(Y.jump_to).concat(He,"/").concat(it):null,className:"".concat(_,"-simple-pager")},ut)),k.a.createElement("ul",Object(ae.a)({className:b()(_,"".concat(_,"-simple"),Object(X.a)({},"".concat(_,"-disabled"),N),m),style:T,ref:this.savePaginationNode},nt),k.a.createElement("li",{title:$?Y.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:b()("".concat(_,"-prev"),Object(X.a)({},"".concat(_,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(St)),k.a.createElement("li",{title:$?"".concat(He,"/").concat(it):null,className:"".concat(_,"-simple-pager")},k.a.createElement("input",{type:"text",value:lt,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),k.a.createElement("span",{className:"".concat(_,"-slash")},"/"),it),k.a.createElement("li",{title:$?Y.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:b()("".concat(_,"-next"),Object(X.a)({},"".concat(_,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(pt)),ut);if(it<=3+qe*2){var at={locale:Y,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:$,itemRender:me};it||ct.push(k.a.createElement(p,Object(ae.a)({},at,{key:"noPager",page:it,className:"".concat(_,"-disabled")})));for(var bt=1;bt<=it;bt+=1){var Et=He===bt;ct.push(k.a.createElement(p,Object(ae.a)({},at,{key:bt,page:bt,active:Et})))}}else{var Re=R?Y.prev_3:Y.prev_5,Te=R?Y.next_3:Y.next_5;Me&&(Ve=k.a.createElement("li",{title:$?Re:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:b()("".concat(_,"-jump-prev"),Object(X.a)({},"".concat(_,"-jump-prev-custom-icon"),!!Ae))},me(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ae,"prev page"))),Je=k.a.createElement("li",{title:$?Te:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:b()("".concat(_,"-jump-next"),Object(X.a)({},"".concat(_,"-jump-next-custom-icon"),!!De))},me(this.getJumpNextPage(),"jump-next",this.getItemIcon(De,"next page")))),gt=k.a.createElement(p,{locale:Y,last:!0,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:it,page:it,active:!1,showTitle:$,itemRender:me}),st=k.a.createElement(p,{locale:Y,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:$,itemRender:me});var Ke=Math.max(1,He-qe),ze=Math.min(He+qe,it);He-1<=qe&&(ze=1+qe*2),it-He<=qe&&(Ke=it-qe*2);for(var Ce=Ke;Ce<=ze;Ce+=1){var We=He===Ce;ct.push(k.a.createElement(p,{locale:Y,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ce,page:Ce,active:We,showTitle:$,itemRender:me}))}He-1>=qe*2&&He!==1+2&&(ct[0]=Object(U.cloneElement)(ct[0],{className:"".concat(_,"-item-after-jump-prev")}),ct.unshift(Ve)),it-He>=qe*2&&He!==it-2&&(ct[ct.length-1]=Object(U.cloneElement)(ct[ct.length-1],{className:"".concat(_,"-item-before-jump-next")}),ct.push(Je)),Ke!==1&&ct.unshift(st),ze!==it&&ct.push(gt)}var ve=null;te&&(ve=k.a.createElement("li",{className:"".concat(_,"-total-text")},te(W,[W===0?0:(He-1)*ft+1,He*ft>W?W:He*ft])));var ce=!this.hasPrev()||!it,he=!this.hasNext()||!it;return k.a.createElement("ul",Object(ae.a)({className:b()(_,m,Object(X.a)({},"".concat(_,"-disabled"),N)),style:T,unselectable:"unselectable",ref:this.savePaginationNode},nt),ve,k.a.createElement("li",{title:$?Y.prev_page:null,onClick:this.prev,tabIndex:ce?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(_,"-prev"),Object(X.a)({},"".concat(_,"-disabled"),ce)),"aria-disabled":ce},this.renderPrev(St)),ct,k.a.createElement("li",{title:$?Y.next_page:null,onClick:this.next,tabIndex:he?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(_,"-next"),Object(X.a)({},"".concat(_,"-disabled"),he)),"aria-disabled":he},this.renderNext(pt)),k.a.createElement(l,{disabled:N,locale:Y,rootPrefixCls:_,selectComponentClass:Fe,selectPrefixCls:Ne,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:He,pageSize:ft,pageSizeOptions:Ee,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:et}))}}],[{key:"getDerivedStateFromProps",value:function(h,o){var _={};if("current"in h&&(_.current=h.current,h.current!==o.current&&(_.currentInputValue=_.current)),"pageSize"in h&&h.pageSize!==o.pageSize){var m=o.current,T=O(h.pageSize,o,h);m=m>T?T:m,"current"in h||(_.current=m,_.currentInputValue=m),_.pageSize=h.pageSize}return _}}]),g}(k.a.Component);S.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:u.a,style:{},itemRender:f,totalBoundaryShowSizeChanger:50};var E=S},"6RRn":function(Rt,$e,Q){"use strict";var ae=Q("wCXF"),X=Q("n6Qo");Q.d($e,"b",function(){return X.a});var P=Q("IBYe"),V=Q("6eGT"),L=Q("hW8S");Q.d($e,"a",function(){return L.a}),$e.c=ae.b},"6UM0":function(Rt,$e,Q){var ae,X;(function(){var P;(function(){"use strict";var L=[function(k,I,b){var y=b(1).Beautifier,p=b(5).Options;function c(r,l){var u=new y(r,l);return u.beautify()}k.exports=c,k.exports.defaultOptions=function(){return new p}},function(k,I,b){var y=b(2).Output,p=b(3).Token,c=b(4),r=b(5).Options,l=b(7).Tokenizer,u=b(7).line_starters,a=b(7).positionable_operators,s=b(7).TOKEN;function f(R,$){return $.indexOf(R)!==-1}function O(R){return R.replace(/^\s+/g,"")}function S(R){for(var $={},te=0;te<R.length;te++)$[R[te].replace(/-/g,"_")]=R[te];return $}function E(R,$){return R&&R.type===s.RESERVED&&R.text===$}function C(R,$){return R&&R.type===s.RESERVED&&f(R.text,$)}var w=["case","return","do","if","throw","else","await","break","continue","async"],g=["before-newline","after-newline","preserve-newline"],v=S(g),h=[v.before_newline,v.preserve_newline],o={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(R,$){if($.multiline_frame||$.mode===o.ForInitializer||$.mode===o.Conditional)return;R.remove_indent($.start_line_index)}function m(R){R=R.replace(c.allLineBreaks,`
`);for(var $=[],te=R.indexOf(`
`);te!==-1;)$.push(R.substring(0,te)),R=R.substring(te+1),te=R.indexOf(`
`);return R.length&&$.push(R),$}function T(R){return R===o.ArrayLiteral}function N(R){return f(R,[o.Expression,o.ForInitializer,o.Conditional])}function j(R,$){for(var te=0;te<R.length;te++){var ue=R[te].trim();if(ue.charAt(0)!==$)return!1}return!0}function W(R,$){for(var te=0,ue=R.length,me;te<ue;te++)if(me=R[te],me&&me.indexOf($)!==0)return!1;return!0}function Y(R,$){$=$||{},this._source_text=R||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r($)}Y.prototype.create_flags=function(R,$){var te=0;R&&(te=R.indentation_level,!this._output.just_added_newline()&&R.line_indent_level>te&&(te=R.line_indent_level));var ue={mode:$,parent:R,last_token:R?R.last_token:new p(s.START_BLOCK,""),last_word:R?R.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:te,alignment:0,line_indent_level:R?R.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return ue},Y.prototype._reset=function(R){var $=R.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new y(this._options,$),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(o.BlockStatement);var te=new l(R,this._options);return this._tokens=te.tokenize(),R},Y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R,$=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
`,$&&c.lineBreak.test($||"")&&(te=$.match(c.lineBreak)[0]));for(var ue=this._tokens.next();ue;)this.handle_token(ue),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ue,ue=this._tokens.next();return R=this._output.get_code(te),R},Y.prototype.handle_token=function(R,$){R.type===s.START_EXPR?this.handle_start_expr(R):R.type===s.END_EXPR?this.handle_end_expr(R):R.type===s.START_BLOCK?this.handle_start_block(R):R.type===s.END_BLOCK?this.handle_end_block(R):R.type===s.WORD?this.handle_word(R):R.type===s.RESERVED?this.handle_word(R):R.type===s.SEMICOLON?this.handle_semicolon(R):R.type===s.STRING?this.handle_string(R):R.type===s.EQUALS?this.handle_equals(R):R.type===s.OPERATOR?this.handle_operator(R):R.type===s.COMMA?this.handle_comma(R):R.type===s.BLOCK_COMMENT?this.handle_block_comment(R,$):R.type===s.COMMENT?this.handle_comment(R,$):R.type===s.DOT?this.handle_dot(R):R.type===s.EOF?this.handle_eof(R):R.type===s.UNKNOWN?this.handle_unknown(R,$):this.handle_unknown(R,$)},Y.prototype.handle_whitespace_and_comments=function(R,$){var te=R.newlines,ue=this._options.keep_array_indentation&&T(this._flags.mode);if(R.comments_before)for(var me=R.comments_before.next();me;)this.handle_whitespace_and_comments(me,$),this.handle_token(me,$),me=R.comments_before.next();if(ue)for(var Me=0;Me<te;Me+=1)this.print_newline(Me>0,$);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,$);for(var Ae=1;Ae<te;Ae+=1)this.print_newline(!0,$)}};var B=["async","break","continue","return","throw","yield"];Y.prototype.allow_wrap_or_preserved_newline=function(R,$){if($=$===void 0?!1:$,this._output.just_added_newline())return;var te=this._options.preserve_newlines&&R.newlines||$,ue=f(this._flags.last_token.text,a)||f(R.text,a);if(ue){var me=f(this._flags.last_token.text,a)&&f(this._options.operator_position,h)||f(R.text,a);te=te&&me}if(te)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(C(this._flags.last_token,B))return;this._output.set_wrap_point()}},Y.prototype.print_newline=function(R,$){if(!$&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var te=this._tokens.peek();this._flags.mode===o.Statement&&!(this._flags.if_block&&E(te,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(R)&&(this._flags.multiline_frame=!0)},Y.prototype.print_token_line_indentation=function(R){this._output.just_added_newline()&&(this._options.keep_array_indentation&&R.newlines&&(R.text==="["||T(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(R.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Y.prototype.print_token=function(R){if(this._output.raw){this._output.add_raw_token(R);return}if(this._options.comma_first&&R.previous&&R.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var $=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push($),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(R),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(R),this._output.non_breaking_space=!0,this._output.add_token(R.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Y.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Y.prototype.set_mode=function(R){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,R),this._flags=this.create_flags(this._previous_flags,R),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===o.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Y.prototype.start_of_object_property=function(){return this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"]))},Y.prototype.start_of_statement=function(R){var $=!1;return $=$||C(this._flags.last_token,["var","let","const"])&&R.type===s.WORD,$=$||E(this._flags.last_token,"do"),$=$||!(this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement)&&C(this._flags.last_token,B)&&!R.newlines,$=$||E(this._flags.last_token,"else")&&!(E(R,"if")&&!R.comments_before),$=$||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===o.ForInitializer||this._previous_flags.mode===o.Conditional),$=$||this._flags.last_token.type===s.WORD&&this._flags.mode===o.BlockStatement&&!this._flags.in_case&&!(R.text==="--"||R.text==="++")&&this._last_last_text!=="function"&&R.type!==s.WORD&&R.type!==s.RESERVED,$=$||this._flags.mode===o.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"])),$?(this.set_mode(o.Statement),this.indent(),this.handle_whitespace_and_comments(R,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R,C(R,["do","for","if","while"])),!0):!1},Y.prototype.handle_start_expr=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R);var $=o.Expression;if(R.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){C(this._flags.last_token,u)&&(this._output.space_before_token=!0),this.print_token(R),this.set_mode($),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}$=o.ArrayLiteral,T(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),f(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,$=o.ForInitializer):f(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,$=o.Conditional):f(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&R.whitespace_before===""?this._output.space_before_token=!1:(f(this._flags.last_token.text,u)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var ue=this._tokens.peek(-4);C(te,["async","function"])||te.text==="*"&&C(ue,["async","function"])?this._output.space_before_token=!0:this._flags.mode===o.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(ue.text==="{"||ue.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(R);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===o.ObjectLiteral&&f(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(R,R.newlines),this.print_token(R),this.set_mode($),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Y.prototype.handle_end_expr=function(R){for(;this._flags.mode===o.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(R,R.text==="]"&&T(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(R),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===o.Conditional&&(this._previous_flags.mode=o.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Y.prototype.handle_start_block=function(R){this.handle_whitespace_and_comments(R);var $=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(o.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(o.BlockStatement):te&&(f(te.text,[":",","])&&f($.type,[s.STRING,s.WORD,s.RESERVED])||f($.text,["get","set","..."])&&f(te.type,[s.WORD,s.RESERVED]))?f(this._last_last_text,["class","interface"])&&!f(te.text,[":",","])?this.set_mode(o.BlockStatement):this.set_mode(o.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(o.BlockStatement):f(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||C(this._flags.last_token,["return","throw","import","default"])?this.set_mode(o.ObjectLiteral):this.set_mode(o.BlockStatement),this._flags.last_token&&(C(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ue=!$.comments_before&&$.text==="}",me=ue&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Me=0,Ae=null;this._flags.inline_frame=!0;do if(Me+=1,Ae=this._tokens.peek(Me-1),Ae.newlines){this._flags.inline_frame=!1;break}while(Ae.type!==s.EOF&&!(Ae.type===s.END_BLOCK&&Ae.opened===R))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(me||this._flags.last_token.type===s.EQUALS||C(this._flags.last_token,w)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(T(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(R),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(R),this.indent(),!ue&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Y.prototype.handle_end_block=function(R){for(this.handle_whitespace_and_comments(R);this._flags.mode===o.Statement;)this.restore_mode();var $=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!$?this._output.space_before_token=!0:this._options.brace_style==="expand"?$||this.print_newline():$||(T(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(R)},Y.prototype.handle_word=function(R){if(R.type===s.RESERVED){if(f(R.text,["set","get"])&&this._flags.mode!==o.ObjectLiteral)R.type=s.WORD;else if(R.text==="import"&&f(this._tokens.peek().text,["(","."]))R.type=s.WORD;else if(f(R.text,["as","from"])&&!this._flags.import_block)R.type=s.WORD;else if(this._flags.mode===o.ObjectLiteral){var $=this._tokens.peek();$.text===":"&&(R.type=s.WORD)}}if(this.start_of_statement(R)?C(this._flags.last_token,["var","let","const"])&&R.type===s.WORD&&(this._flags.declaration_statement=!0):R.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!C(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(R),this.print_newline()):this.handle_whitespace_and_comments(R),this._flags.do_block&&!this._flags.do_while)if(E(R,"while")){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&E(R,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===o.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&C(R,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(R),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R)),E(R,"function")){(f(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(f(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!R.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?C(this._flags.last_token,["get","set","new","export"])||C(this._flags.last_token,B)?this._output.space_before_token=!0:E(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(R),this._flags.last_word=R.text;return}var te="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":C(R,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===o.BlockStatement?te="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&N(this._flags.mode)?te="SPACE":this._flags.last_token.type===s.STRING?te="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===o.ObjectLiteral&&f(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),C(R,u)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),C(R,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===o.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ue=this._output.current_line;ue.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?C(this._flags.last_token,w)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&C(R,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!C(R,["var","let","const"]))&&this._flags.last_token.text!==":"&&(E(R,"if")&&E(R.previous,"else")?this._output.space_before_token=!0:this.print_newline()):C(R,u)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);R.previous&&(R.previous.type===s.WORD||R.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(R),this._flags.last_word=R.text,R.type===s.RESERVED&&(R.text==="do"?this._flags.do_block=!0:R.text==="if"?this._flags.if_block=!0:R.text==="import"?this._flags.import_block=!0:this._flags.import_block&&E(R,"from")&&(this._flags.import_block=!1))},Y.prototype.handle_semicolon=function(R){this.start_of_statement(R)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(R);for(var $=this._tokens.peek();this._flags.mode===o.Statement&&!(this._flags.if_block&&E($,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(R)},Y.prototype.handle_string=function(R){R.text.startsWith("`")&&R.newlines===0&&R.whitespace_before===""&&(R.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(R)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(R),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R):R.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(R.previous.text==="]"||R.previous.text===")")&&R.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(R)},Y.prototype.handle_equals=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0},Y.prototype.handle_comma=function(R){this.handle_whitespace_and_comments(R,!0),this.print_token(R),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)):this._flags.mode===o.ObjectLiteral||this._flags.mode===o.Statement&&this._flags.parent.mode===o.ObjectLiteral?(this._flags.mode===o.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)},Y.prototype.handle_operator=function(R){var $=R.text==="*"&&(C(this._flags.last_token,["function","yield"])||f(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),te=f(R.text,["-","+"])&&(f(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||f(this._flags.last_token.text,u)||this._flags.last_token.text===",");if(!this.start_of_statement(R)){var ue=!$;this.handle_whitespace_and_comments(R,ue)}if(R.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(R);return}if(R.text==="::"){this.print_token(R);return}if(this._flags.last_token.type===s.OPERATOR&&f(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(R),R.text===":"&&this._flags.in_case){this.print_token(R),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var me=!0,Me=!0,Ae=!1;if(R.text===":"?this._flags.ternary_depth===0?me=!1:(this._flags.ternary_depth-=1,Ae=!0):R.text==="?"&&(this._flags.ternary_depth+=1),!te&&!$&&this._options.preserve_newlines&&f(R.text,a)){var De=R.text===":",Fe=De&&Ae,Ne=De&&!Ae;switch(this._options.operator_position){case v.before_newline:this._output.space_before_token=!Ne,this.print_token(R),(!De||Fe)&&this.allow_wrap_or_preserved_newline(R),this._output.space_before_token=!0;return;case v.after_newline:this._output.space_before_token=!0,!De||Fe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(R):this._output.space_before_token=!1,this.print_token(R),this._output.space_before_token=!0;return;case v.preserve_newline:Ne||this.allow_wrap_or_preserved_newline(R),me=!(this._output.just_added_newline()||Ne),this._output.space_before_token=me,this.print_token(R),this._output.space_before_token=!0;return}}if($){this.allow_wrap_or_preserved_newline(R),me=!1;var Ee=this._tokens.peek();Me=Ee&&f(Ee.type,[s.WORD,s.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),me=this._flags.last_token.type===s.START_BLOCK,Me=!1;else if(f(R.text,["--","++","!","~"])||te){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),me=!1,Me=!1,R.newlines&&(R.text==="--"||R.text==="++"||R.text==="~")){var se=C(this._flags.last_token,w)&&R.newlines;se&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(se,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(me=!0),this._flags.last_token.type===s.RESERVED?me=!0:this._flags.last_token.type===s.END_EXPR?me=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===s.OPERATOR&&(me=f(R.text,["--","-","++","+"])&&f(this._flags.last_token.text,["--","-","++","+"]),f(R.text,["+","-"])&&f(this._flags.last_token.text,["--","++"])&&(Me=!0)),(this._flags.mode===o.BlockStatement&&!this._flags.inline_frame||this._flags.mode===o.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||me,this.print_token(R),this._output.space_before_token=Me},Y.prototype.handle_block_comment=function(R,$){if(this._output.raw){this._output.add_raw_token(R),R.directives&&R.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(R.directives){this.print_newline(!1,$),this.print_token(R),R.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(R.text)&&!R.newlines){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0;return}else this.print_block_commment(R,$)},Y.prototype.print_block_commment=function(R,$){var te=m(R.text),ue,me=!1,Me=!1,Ae=R.whitespace_before,De=Ae.length;if(this.print_newline(!1,$),this.print_token_line_indentation(R),this._output.add_token(te[0]),this.print_newline(!1,$),te.length>1){for(te=te.slice(1),me=j(te,"*"),Me=W(te,Ae),me&&(this._flags.alignment=1),ue=0;ue<te.length;ue++)me?(this.print_token_line_indentation(R),this._output.add_token(O(te[ue]))):Me&&te[ue]?(this.print_token_line_indentation(R),this._output.add_token(te[ue].substring(De))):(this._output.current_line.set_indent(-1),this._output.add_token(te[ue])),this.print_newline(!1,$);this._flags.alignment=0}},Y.prototype.handle_comment=function(R,$){R.newlines?this.print_newline(!1,$):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(R),this.print_newline(!1,$)},Y.prototype.handle_dot=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),C(this._flags.last_token,w)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(R,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(R)},Y.prototype.handle_unknown=function(R,$){this.print_token(R),R.text[R.text.length-1]===`
`&&this.print_newline(!1,$)},Y.prototype.handle_eof=function(R){for(;this._flags.mode===o.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R)},k.exports.Beautifier=Y},function(k){function I(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}I.prototype.clone_empty=function(){var p=new I(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},I.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},I.prototype.has_match=function(p){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(p))return!0;return!1},I.prototype.set_indent=function(p,c){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(p){this.__items.push(p);var c=p.lastIndexOf(`
`);c!==-1?this.__character_count=p.length-c:this.__character_count+=p.length},I.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function b(p,c){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),c=c||"",p.indent_level>0&&(c=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}b.prototype.get_indent_size=function(p,c){var r=this.__base_string_length;return c=c||0,p<0&&(r=0),r+=p*this.__indent_size,r+=c,r},b.prototype.get_indent_string=function(p,c){var r=this.__base_string;return c=c||0,p<0&&(p=0,r=""),c+=p*this.__indent_size,this.__ensure_cache(c),r+=this.__cache[c],r},b.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var p=this.__cache.length,c=0,r="";this.__indent_size&&p>=this.__indent_size&&(c=Math.floor(p/this.__indent_size),p-=c*this.__indent_size,r=new Array(c+1).join(this.__indent_string)),p&&(r+=new Array(p+1).join(" ")),this.__cache.push(r)};function y(p,c){this.__indent_cache=new b(p,c),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}y.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},y.prototype.get_line_number=function(){return this.__lines.length},y.prototype.get_indent_string=function(p,c){return this.__indent_cache.get_indent_string(p,c)},y.prototype.get_indent_size=function(p,c){return this.__indent_cache.get_indent_size(p,c)},y.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},y.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},y.prototype.get_code=function(p){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return p!==`
`&&(r=r.replace(/[\n]/g,p)),r},y.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},y.prototype.set_indent=function(p,c){return p=p||0,c=c||0,this.next_line.set_indent(p,c),this.__lines.length>1?(this.current_line.set_indent(p,c),!0):(this.current_line.set_indent(),!1)},y.prototype.add_raw_token=function(p){for(var c=0;c<p.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},y.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},y.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},y.prototype.remove_indent=function(p){for(var c=this.__lines.length;p<c;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},y.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},y.prototype.just_added_newline=function(){return this.current_line.is_empty()},y.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},y.prototype.ensure_empty_line_above=function(p,c){for(var r=this.__lines.length-2;r>=0;){var l=this.__lines[r];if(l.is_empty())break;if(l.item(0).indexOf(p)!==0&&l.item(-1)!==c){this.__lines.splice(r+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},k.exports.Output=y},function(k){function I(b,y,p,c){this.type=b,this.text=y,this.comments_before=null,this.newlines=p||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}k.exports.Token=I},function(k,I){var b="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",y="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",c="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",r="(?:\\\\u[0-9a-fA-F]{4}|["+b+p+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+y+p+c+"])*";I.identifier=new RegExp(r+l,"g"),I.identifierStart=new RegExp(r),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+y+p+c+"])+");var u=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(k,I,b){var y=b(6).Options,p=["before-newline","after-newline","preserve-newline"];function c(r){y.call(this,r,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<u.length;a++)u[a]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=u[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new y,k.exports.Options=c},function(k){function I(p,c){this.raw_options=b(p,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(p,c){var r=this.raw_options[p],l=c||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(l=r.concat()):typeof r=="string"&&(l=r.split(/[^a-zA-Z0-9_\/\-]+/)),l},I.prototype._get_boolean=function(p,c){var r=this.raw_options[p],l=r===void 0?!!c:!!r;return l},I.prototype._get_characters=function(p,c){var r=this.raw_options[p],l=c||"";return typeof r=="string"&&(l=r.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},I.prototype._get_number=function(p,c){var r=this.raw_options[p];c=parseInt(c,10),isNaN(c)&&(c=0);var l=parseInt(r,10);return isNaN(l)&&(l=c),l},I.prototype._get_selection=function(p,c,r){var l=this._get_selection_list(p,c,r);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[p]+"'");return l[0]},I.prototype._get_selection_list=function(p,c,r){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[c[0]],!this._is_valid_selection(r,c))throw new Error("Invalid Default Value!");var l=this._get_array(p,r);if(!this._is_valid_selection(l,c))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[p]+"'");return l},I.prototype._is_valid_selection=function(p,c){return p.length&&c.length&&!p.some(function(r){return c.indexOf(r)===-1})};function b(p,c){var r={};p=y(p);var l;for(l in p)l!==c&&(r[l]=p[l]);if(c&&p[c])for(l in p[c])r[l]=p[c][l];return r}function y(p){var c={},r;for(r in p){var l=r.replace(/-/g,"_");c[l]=p[r]}return c}k.exports.Options=I,k.exports.normalizeOpts=y,k.exports.mergeOpts=b},function(k,I,b){var y=b(8).InputScanner,p=b(9).Tokenizer,c=b(9).TOKEN,r=b(13).Directives,l=b(4),u=b(12).Pattern,a=b(14).TemplatablePattern;function s(j,W){return W.indexOf(j)!==-1}var f={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:c.START,RAW:c.RAW,EOF:c.EOF},O=new r(/\/\*/,/\*\//),S=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,E=/[0-9]/,C=/[^\d\.]/,w=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),g="\\?\\.(?!\\d) "+g,g=g.replace(/ /g,"|");var v=new RegExp(g),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),o=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+o.join("|")+")$"),m,T=function(j,W){p.call(this,j,W),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Y=new u(this._input),B=new a(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(l.identifier).matching(l.identifierMatch),number:Y.matching(S),punct:Y.matching(v),comment:Y.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Y.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Y.matching(/<!--/),html_comment_end:Y.matching(/-->/),include:Y.starting_with(/#include/).until_after(l.lineBreak),shebang:Y.starting_with(/#!/).until_after(l.lineBreak),xml:Y.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};T.prototype=new p,T.prototype._is_comment=function(j){return j.type===f.COMMENT||j.type===f.BLOCK_COMMENT||j.type===f.UNKNOWN},T.prototype._is_opening=function(j){return j.type===f.START_BLOCK||j.type===f.START_EXPR},T.prototype._is_closing=function(j,W){return(j.type===f.END_BLOCK||j.type===f.END_EXPR)&&W&&(j.text==="]"&&W.text==="["||j.text===")"&&W.text==="("||j.text==="}"&&W.text==="{")},T.prototype._reset=function(){m=!1},T.prototype._get_next_token=function(j,W){var Y=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(f.EOF,""):(Y=Y||this._read_non_javascript(B),Y=Y||this._read_string(B),Y=Y||this._read_word(j),Y=Y||this._read_singles(B),Y=Y||this._read_comment(B),Y=Y||this._read_regexp(B,j),Y=Y||this._read_xml(B,j),Y=Y||this._read_punctuation(),Y=Y||this._create_token(f.UNKNOWN,this._input.next()),Y)},T.prototype._read_word=function(j){var W;if(W=this.__patterns.identifier.read(),W!=="")return W=W.replace(l.allLineBreaks,`
`),!(j.type===f.DOT||j.type===f.RESERVED&&(j.text==="set"||j.text==="get"))&&_.test(W)?(W==="in"||W==="of")&&(j.type===f.WORD||j.type===f.STRING)?this._create_token(f.OPERATOR,W):this._create_token(f.RESERVED,W):this._create_token(f.WORD,W);if(W=this.__patterns.number.read(),W!=="")return this._create_token(f.WORD,W)},T.prototype._read_singles=function(j){var W=null;return j==="("||j==="["?W=this._create_token(f.START_EXPR,j):j===")"||j==="]"?W=this._create_token(f.END_EXPR,j):j==="{"?W=this._create_token(f.START_BLOCK,j):j==="}"?W=this._create_token(f.END_BLOCK,j):j===";"?W=this._create_token(f.SEMICOLON,j):j==="."&&C.test(this._input.peek(1))?W=this._create_token(f.DOT,j):j===","&&(W=this._create_token(f.COMMA,j)),W&&this._input.next(),W},T.prototype._read_punctuation=function(){var j=this.__patterns.punct.read();if(j!=="")return j==="="?this._create_token(f.EQUALS,j):j==="?."?this._create_token(f.DOT,j):this._create_token(f.OPERATOR,j)},T.prototype._read_non_javascript=function(j){var W="";if(j==="#"){if(this._is_first_token()&&(W=this.__patterns.shebang.read(),W))return this._create_token(f.UNKNOWN,W.trim()+`
`);if(W=this.__patterns.include.read(),W)return this._create_token(f.UNKNOWN,W.trim()+`
`);j=this._input.next();var Y="#";if(this._input.hasNext()&&this._input.testChar(E)){do j=this._input.next(),Y+=j;while(this._input.hasNext()&&j!=="#"&&j!=="=");return j==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Y+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Y+="{}",this._input.next(),this._input.next())),this._create_token(f.WORD,Y)}this._input.back()}else if(j==="<"&&this._is_first_token()){if(W=this.__patterns.html_comment_start.read(),W){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)W+=this._input.next();return m=!0,this._create_token(f.COMMENT,W)}}else if(m&&j==="-"&&(W=this.__patterns.html_comment_end.read(),W))return m=!1,this._create_token(f.COMMENT,W);return null},T.prototype._read_comment=function(j){var W=null;if(j==="/"){var Y="";if(this._input.peek(1)==="*"){Y=this.__patterns.block_comment.read();var B=O.get_directives(Y);B&&B.ignore==="start"&&(Y+=O.readIgnored(this._input)),Y=Y.replace(l.allLineBreaks,`
`),W=this._create_token(f.BLOCK_COMMENT,Y),W.directives=B}else this._input.peek(1)==="/"&&(Y=this.__patterns.comment.read(),W=this._create_token(f.COMMENT,Y))}return W},T.prototype._read_string=function(j){if(j==="`"||j==="'"||j==='"'){var W=this._input.next();return this.has_char_escapes=!1,j==="`"?W+=this._read_string_recursive("`",!0,"${"):W+=this._read_string_recursive(j),this.has_char_escapes&&this._options.unescape_strings&&(W=N(W)),this._input.peek()===j&&(W+=this._input.next()),W=W.replace(l.allLineBreaks,`
`),this._create_token(f.STRING,W)}return null},T.prototype._allow_regexp_or_xml=function(j){return j.type===f.RESERVED&&s(j.text,["return","case","throw","else","do","typeof","yield"])||j.type===f.END_EXPR&&j.text===")"&&j.opened.previous.type===f.RESERVED&&s(j.opened.previous.text,["if","while","for"])||s(j.type,[f.COMMENT,f.START_EXPR,f.START_BLOCK,f.START,f.END_BLOCK,f.OPERATOR,f.EQUALS,f.EOF,f.SEMICOLON,f.COMMA])},T.prototype._read_regexp=function(j,W){if(j==="/"&&this._allow_regexp_or_xml(W)){for(var Y=this._input.next(),B=!1,R=!1;this._input.hasNext()&&(B||R||this._input.peek()!==j)&&!this._input.testChar(l.newline);)Y+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?R=!0:this._input.peek()==="]"&&(R=!1)),this._input.next();return this._input.peek()===j&&(Y+=this._input.next(),Y+=this._input.read(l.identifier)),this._create_token(f.STRING,Y)}return null},T.prototype._read_xml=function(j,W){if(this._options.e4x&&j==="<"&&this._allow_regexp_or_xml(W)){var Y="",B=this.__patterns.xml.read_match();if(B){for(var R=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),$=R.indexOf("{")===0,te=0;B;){var ue=!!B[1],me=B[2],Me=!!B[B.length-1]||me.slice(0,8)==="![CDATA[";if(!Me&&(me===R||$&&me.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ue?--te:++te),Y+=B[0],te<=0)break;B=this.__patterns.xml.read_match()}return B||(Y+=this._input.match(/[\s\S]*/g)[0]),Y=Y.replace(l.allLineBreaks,`
`),this._create_token(f.STRING,Y)}}return null};function N(j){for(var W="",Y=0,B=new y(j),R=null;B.hasNext();)if(R=B.match(/([\s]|[^\\]|\\\\)+/g),R&&(W+=R[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")R=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")R=B.match(/u([0-9A-Fa-f]{4})/g);else{W+="\\",B.hasNext()&&(W+=B.next());continue}if(!R)return j;if(Y=parseInt(R[1],16),Y>126&&Y<=255&&R[0].indexOf("x")===0)return j;if(Y>=0&&Y<32){W+="\\"+R[0];continue}else Y===34||Y===39||Y===92?W+="\\"+String.fromCharCode(Y):W+=String.fromCharCode(Y)}return W}T.prototype._read_string_recursive=function(j,W,Y){var B,R;j==="'"?R=this.__patterns.single_quote:j==='"'?R=this.__patterns.double_quote:j==="`"?R=this.__patterns.template_text:j==="}"&&(R=this.__patterns.template_expression);for(var $=R.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===j||!W&&l.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
`&&this._input.next(),te+=this._input.next()):Y&&(Y==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),Y===te&&(j==="`"?te+=this._read_string_recursive("}",W,"`"):te+=this._read_string_recursive("`",W,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=R.read(),$+=te}return $},k.exports.Tokenizer=T,k.exports.TOKEN=f,k.exports.positionable_operators=w.slice(),k.exports.line_starters=h.slice()},function(k){var I=RegExp.prototype.hasOwnProperty("sticky");function b(y){this.__input=y||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__input.charAt(this.__position),this.__position+=1),y},b.prototype.peek=function(y){var p=null;return y=y||0,y+=this.__position,y>=0&&y<this.__input_length&&(p=this.__input.charAt(y)),p},b.prototype.__match=function(y,p){y.lastIndex=p;var c=y.exec(this.__input);return c&&!(I&&y.sticky)&&(c.index!==p&&(c=null)),c},b.prototype.test=function(y,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(y,p):!1},b.prototype.testChar=function(y,p){var c=this.peek(p);return y.lastIndex=0,c!==null&&y.test(c)},b.prototype.match=function(y){var p=this.__match(y,this.__position);return p?this.__position+=p[0].length:p=null,p},b.prototype.read=function(y,p,c){var r="",l;return y&&(l=this.match(y),l&&(r+=l[0])),p&&(l||!y)&&(r+=this.readUntil(p,c)),r},b.prototype.readUntil=function(y,p){var c="",r=this.__position;y.lastIndex=this.__position;var l=y.exec(this.__input);return l?(r=l.index,p&&(r+=l[0].length)):r=this.__input_length,c=this.__input.substring(this.__position,r),this.__position=r,c},b.prototype.readUntilAfter=function(y){return this.readUntil(y,!0)},b.prototype.get_regexp=function(y,p){var c=null,r="g";return p&&I&&(r="y"),typeof y=="string"&&y!==""?c=new RegExp(y,r):y&&(c=new RegExp(y.source,r)),c},b.prototype.get_literal_regexp=function(y){return RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(y){var p=this.__position,c=this.readUntilAfter(y);return this.__position=p,c},b.prototype.lookBack=function(y){var p=this.__position-1;return p>=y.length&&this.__input.substring(p-y.length,p).toLowerCase()===y},k.exports.InputScanner=b},function(k,I,b){var y=b(8).InputScanner,p=b(3).Token,c=b(10).TokenStream,r=b(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(a,s){this._input=new y(a),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var a,s=new p(l.START,""),f=null,O=[],S=new c;s.type!==l.EOF;){for(a=this._get_next_token(s,f);this._is_comment(a);)S.add(a),a=this._get_next_token(s,f);S.isEmpty()||(a.comments_before=S,S=new c),a.parent=f,this._is_opening(a)?(O.push(f),f=a):f&&this._is_closing(a,f)&&(a.opened=f,f.closed=a,f=O.pop(),a.parent=f),a.previous=s,s.next=a,this.__tokens.add(a),s=a}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(a,s){this._readWhitespace();var f=this._input.read(/.+/g);return f?this._create_token(l.RAW,f):this._create_token(l.EOF,"")},u.prototype._is_comment=function(a){return!1},u.prototype._is_opening=function(a){return!1},u.prototype._is_closing=function(a,s){return!1},u.prototype._create_token=function(a,s){var f=new p(a,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return f},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},k.exports.Tokenizer=u,k.exports.TOKEN=l},function(k){function I(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},I.prototype.peek=function(b){var y=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(y=this.__tokens[b]),y},I.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},k.exports.TokenStream=I},function(k,I,b){var y=b(12).Pattern;function p(c,r){y.call(this,c,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new y,p.prototype.__set_whitespace_patterns=function(c,r){c+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var r=this.__split(this._newline_regexp,c);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return c},p.prototype.matching=function(c,r){var l=this._create();return l.__set_whitespace_patterns(c,r),l._update(),l},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(c,r){c.lastIndex=0;for(var l=0,u=[],a=c.exec(r);a;)u.push(r.substring(l,a.index)),l=a.index+a[0].length,a=c.exec(r);return l<r.length?u.push(r.substring(l,r.length)):u.push(""),u},k.exports.WhitespacePattern=p},function(k){function I(b,y){this._input=b,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,y&&(this._starting_pattern=this._input.get_regexp(y._starting_pattern,!0),this._match_pattern=this._input.get_regexp(y._match_pattern,!0),this._until_pattern=this._input.get_regexp(y._until_pattern),this._until_after=y._until_after)}I.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(b){var y=this._create();return y._until_after=!0,y._until_pattern=this._input.get_regexp(b),y._update(),y},I.prototype.until=function(b){var y=this._create();return y._until_after=!1,y._until_pattern=this._input.get_regexp(b),y._update(),y},I.prototype.starting_with=function(b){var y=this._create();return y._starting_pattern=this._input.get_regexp(b,!0),y._update(),y},I.prototype.matching=function(b){var y=this._create();return y._match_pattern=this._input.get_regexp(b,!0),y._update(),y},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},k.exports.Pattern=I},function(k){function I(b,y){b=typeof b=="string"?b:b.source,y=typeof y=="string"?y:y.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+y,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+y,"g")}I.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var y={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(b);p;)y[p[1]]=p[2],p=this.__directive_pattern.exec(b);return y},I.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=I},function(k,I,b){var y=b(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(r,l){y.call(this,r,l),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var u=new y(r);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new y,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(r){var l=this._create();return l._disabled[r]=!0,l._update(),l},c.prototype.read_options=function(r){var l=this._create();for(var u in p)l._disabled[u]=r.templating.indexOf(u)===-1;return l._update(),l},c.prototype.exclude=function(r){var l=this._create();return l._excluded[r]=!0,l._update(),l},c.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),r+=l,l=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},c.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},c.prototype._read_template=function(){var r="",l=this._input.peek();if(l==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(r=r||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},k.exports.TemplatablePattern=c}],M={};function H(k){var I=M[k];if(I!==void 0)return I.exports;var b=M[k]={exports:{}};return L[k](b,b.exports,H),b.exports}var U=H(0);P=U})();var V=P;!(ae=[],X=function(){return{js_beautify:V}}.apply($e,ae),X!==void 0&&(Rt.exports=X))})()},"6eGT":function(Rt,$e,Q){"use strict";function ae(X){return null}$e.a=ae},"7Cbv":function(Rt,$e,Q){"use strict";var ae=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),X=new Uint8Array(16);function P(){if(!ae)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ae(X)}var V=/^(?:[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 L(p){return typeof p=="string"&&V.test(p)}for(var M=L,H=[],U=0;U<256;++U)H.push((U+256).toString(16).substr(1));function k(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(H[p[c+0]]+H[p[c+1]]+H[p[c+2]]+H[p[c+3]]+"-"+H[p[c+4]]+H[p[c+5]]+"-"+H[p[c+6]]+H[p[c+7]]+"-"+H[p[c+8]]+H[p[c+9]]+"-"+H[p[c+10]]+H[p[c+11]]+H[p[c+12]]+H[p[c+13]]+H[p[c+14]]+H[p[c+15]]).toLowerCase();if(!M(r))throw TypeError("Stringified UUID is invalid");return r}var I=k;function b(p,c,r){p=p||{};var l=p.random||(p.rng||P)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,c){r=r||0;for(var u=0;u<16;++u)c[r+u]=l[u];return c}return I(l)}var y=$e.a=b},"7ahc":function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return O});var ae=Q("k1fw"),X=Q("0Owb"),P=Q("+L6B"),V=Q("2/Rp"),L=Q("y8nQ"),M=Q("Vl3Y"),H=Q("tJVT"),U=Q("OaEy"),k=Q("2fM7"),I=Q("q1tI"),b=Q.n(I),y=Q("VrN/"),p=Q.n(y),c=Q("p77/"),r=Q.n(c),l=Q("c5Ni"),u=Q.n(l),a=k.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},f={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};$e.b=function(S){var E=S.callback,C=S.onCancel,w=Object(I.useState)("python"),g=Object(H.a)(w,2),v=g[0],h=g[1];function o(m){h(f[m][1])}function _(m){E(m)}return b.a.createElement(M.a,Object(X.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),b.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(k.a,{onChange:o},Object.keys(f).map(function(m){return b.a.createElement(a,{key:m,value:m},f[m][0])}))),b.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(O,{mode:v})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(V.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function O(S){var E=S.value,C=S.onChange,w=S.mode,g=S.options,v=g===void 0?{}:g,h=Object(I.useRef)(),o=Object(I.useState)(),_=Object(H.a)(o,2),m=_[0],T=_[1];return Object(I.useEffect)(function(){if(m){function N(j){var W=j.getValue();C&&C(W)}return m.on("change",N),function(){m.off("change",N)}}},[m,C]),Object(I.useEffect)(function(){m&&m.setOption("mode",w)},[m,w]),Object(I.useEffect)(function(){m&&((E!==m.getValue()||E==="")&&setTimeout(function(){m.setValue(E||" ")},300))},[m,E]),Object(I.useEffect)(function(){if(h.current&&!m){var N=p.a.fromTextArea(h.current,Object(ae.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));T(N)}},[h.current,m]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:h}))}},"815F":function(Rt,$e,Q){"use strict";Q.d($e,"e",function(){return H}),Q.d($e,"c",function(){return k}),Q.d($e,"d",function(){return I}),Q.d($e,"a",function(){return y}),Q.d($e,"f",function(){return p}),Q.d($e,"b",function(){return c});var ae=Q("KQm4"),X=Q("VTBJ"),P=Q("Ff2n"),V=Q("Zm9Q"),L=Q("Kwbf"),M=Q("OZM5");function H(r,l){return r!=null?r:l}function U(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function u(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(f){var O=f.key,S=f.children;Object(L.a)(O!=null,"Tree node must have a certain key: [".concat(s).concat(O,"]"));var E=String(O);Object(L.a)(!l.has(E)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(E)),l.set(E,!0),u(S,"".concat(s).concat(E," > "))})}u(r)}function k(r){function l(u){var a=Object(V.a)(u);return a.map(function(s){if(!Object(M.i)(s))return Object(L.a)(!s,"Tree/TreeNode can only accept TreeNode as children."),null;var f=s.key,O=s.props,S=O.children,E=Object(P.a)(O,["children"]),C=Object(X.a)({key:f},E),w=l(S);return w.length&&(C.children=w),C}).filter(function(s){return s})}return l(r)}function I(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],u=new Set(l===!0?[]:l),a=[];function s(f){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return f.map(function(S,E){var C=Object(M.h)(O?O.pos:"0",E),w=H(S.key,C),g=Object(X.a)(Object(X.a)({},S),{},{parent:O,pos:C,children:null,data:S,isStart:[].concat(Object(ae.a)(O?O.isStart:[]),[E===0]),isEnd:[].concat(Object(ae.a)(O?O.isEnd:[]),[E===f.length-1])});return a.push(g),l===!0||u.has(w)?g.children=s(S.children||[],g):g.children=[],g})}return s(r),a}function b(r,l,u){var a;u?typeof u=="string"?a=function(O){return O[u]}:typeof u=="function"&&(a=function(O){return u(O)}):a=function(O,S){return H(O.key,S)};function s(f,O,S){var E=f?f.children:r,C=f?Object(M.h)(S.pos,O):"0";if(f){var w=a(f,C),g={node:f,index:O,pos:C,key:w,parentPos:S.node?S.pos:null,level:S.level+1};l(g)}E&&E.forEach(function(v,h){s(v,h,{node:f,pos:C,level:S?S.level+1:-1})})}s(null)}function y(r){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=l.initWrapper,a=l.processEntity,s=l.onProcessFinished,f=arguments.length>2?arguments[2]:void 0,O={},S={},E={posEntities:O,keyEntities:S};return u&&(E=u(E)||E),b(r,function(C){var w=C.node,g=C.index,v=C.pos,h=C.key,o=C.parentPos,_=C.level,m={node:w,index:g,key:h,pos:v,level:_},T=H(h,v);O[v]=m,S[T]=m,m.parent=O[o],m.parent&&(m.parent.children=m.parent.children||[],m.parent.children.push(m)),a&&a(m,E)},f),s&&s(E),E}function p(r,l){var u=l.expandedKeys,a=l.selectedKeys,s=l.loadedKeys,f=l.loadingKeys,O=l.checkedKeys,S=l.halfCheckedKeys,E=l.dragOverNodeKey,C=l.dropPosition,w=l.keyEntities,g=w[r],v={eventKey:r,expanded:u.indexOf(r)!==-1,selected:a.indexOf(r)!==-1,loaded:s.indexOf(r)!==-1,loading:f.indexOf(r)!==-1,checked:O.indexOf(r)!==-1,halfChecked:S.indexOf(r)!==-1,pos:String(g?g.pos:""),dragOver:E===r&&C===0,dragOverGapTop:E===r&&C===-1,dragOverGapBottom:E===r&&C===1};return v}function c(r){var l=r.data,u=r.expanded,a=r.selected,s=r.checked,f=r.loaded,O=r.loading,S=r.halfChecked,E=r.dragOver,C=r.dragOverGapTop,w=r.dragOverGapBottom,g=r.pos,v=r.active,h=Object(X.a)(Object(X.a)({},l),{},{expanded:u,selected:a,checked:s,loaded:f,loading:O,halfChecked:S,dragOver:E,dragOverGapTop:C,dragOverGapBottom:w,pos:g,active:v});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(L.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),r}}),h}},"8EBN":function(Rt,$e,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";ae.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 X=0;X<ae.modeInfo.length;X++){var P=ae.modeInfo[X];P.mimes&&(P.mime=P.mimes[0])}ae.findModeByMIME=function(V){V=V.toLowerCase();for(var L=0;L<ae.modeInfo.length;L++){var M=ae.modeInfo[L];if(M.mime==V)return M;if(M.mimes){for(var H=0;H<M.mimes.length;H++)if(M.mimes[H]==V)return M}}if(/\+xml$/.test(V))return ae.findModeByMIME("application/xml");if(/\+json$/.test(V))return ae.findModeByMIME("application/json")},ae.findModeByExtension=function(V){V=V.toLowerCase();for(var L=0;L<ae.modeInfo.length;L++){var M=ae.modeInfo[L];if(M.ext){for(var H=0;H<M.ext.length;H++)if(M.ext[H]==V)return M}}},ae.findModeByFileName=function(V){for(var L=0;L<ae.modeInfo.length;L++){var M=ae.modeInfo[L];if(M.file&&M.file.test(V))return M}var H=V.lastIndexOf("."),U=H>-1&&V.substring(H+1,V.length);if(U)return ae.findModeByExtension(U)},ae.findModeByName=function(V){V=V.toLowerCase();for(var L=0;L<ae.modeInfo.length;L++){var M=ae.modeInfo[L];if(M.name.toLowerCase()==V)return M;if(M.alias){for(var H=0;H<M.alias.length;H++)if(M.alias[H].toLowerCase()==V)return M}}}})},"8hTe":function(Rt,$e,Q){Rt.exports={button:"button___1wy9m"}},"9Bee":function(Rt,$e,Q){"use strict";var ae=Q("DYRE"),X=Q("zeV3"),P=Q("+L6B"),V=Q("2/Rp"),L=Q("k1fw"),M=Q("9og8"),H=Q("tJVT"),U=Q("WmNS"),k=Q.n(U),I=Q("q1tI"),b=Q.n(I),y=Q("vg9a"),p=Q("DlQD"),c=Q.n(p),r=Q("rUJ1");function l(G,x){var A=G.match(/^(\s+)(?:```)/);if(A===null)return x;var F=A[1];return x.split(`
`).map(function(q){var z=q.match(/^\s+/);if(z===null)return q;var we=Object(H.a)(z,1),Ze=we[0];return Ze.length>=F.length?q.slice(F.length):q}).join(`
`)}var u=[],a=["<ul>"],s=new c.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){u.length=0,a=["<ul>"]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function E(G,x,A,F){if(x>=G.length||G[x].level<=A)return x;var q=G[x];F.push("<li><a href='#"+q.anchor+"'>"+q.text+"</a>"),x++;var z=[];return x=E(G,x,q.level,z),z.length>0&&(F.push("<ul>"),z.forEach(function(we){F.push(we)}),F.push("</ul>")),F.push("</li>"),x=E(G,x,A,F),x}function C(){return E(u,0,0,a),a.push("</ul>"),a.join("")}var w={heading:function(x){var A=f.exec(x);if(A)return{type:"heading",raw:A[0],depth:A[1].length,text:A[2]}},fences:function(x){var A=this.rules.block.fences.exec(x);if(A){var F=A[0],q=l(F,A[3]||""),z=A[2]?A[2].trim():A[2];if(["latex","katex","math"].indexOf(z)>=0){var we=h(),Ze=q;q=we,o[we]={type:"block",expression:Ze}}return{type:"code",raw:F,lang:z,text:q}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,h=function(){return"__special_katext_id_".concat(v++,"__")},o={};function _(){return o}function m(){v=0,o={}}function T(G){return G=G.replace(g,function(x,A){var F=h();return o[F]={type:"inline",expression:A},F}),G}var N=s.listitem;s.listitem=function(G){return N(T(G))};var j=s.paragraph;s.paragraph=function(G){return j(T(G))};var W=s.tablecell;s.tablecell=function(G,x){return W(T(G),x)},s.code=function(G,x,A){var F=(x||"").match(/\S*/)[0];return F?["latex","katex","math"].indexOf(F)>=0?"<p class='editormd-tex'>".concat(G,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(x,'">').concat(A?G:Object(r.escape)(G,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(A?G:Object(r.escape)(G,!0))+"</code></pre>"},s.heading=function(G,x,A){var F=this.options.headerPrefix+A.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:F,level:x,text:G}),"<h"+x+' id="'+F+'">'+G+"</h"+x+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:w,renderer:s});var Y=c.a,B=Q("SJMd"),R=Q("ulZh"),$=Q.n(R),te=Q("m3rI"),ue=Q("Oy/b"),me=Q("p5ED"),Me=Q("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 Ae=function(G,x){return(Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,F){A.__proto__=F}||function(A,F){for(var q in F)Object.prototype.hasOwnProperty.call(F,q)&&(A[q]=F[q])})(G,x)};function De(G,x){function A(){this.constructor=G}Ae(G,x),G.prototype=x===null?Object.create(x):(A.prototype=x.prototype,new A)}function Fe(G,x,A,F){return new(A||(A=Promise))(function(q,z){function we(Dt){try{xt(F.next(Dt))}catch(ot){z(ot)}}function Ze(Dt){try{xt(F.throw(Dt))}catch(ot){z(ot)}}function xt(Dt){var ot;Dt.done?q(Dt.value):(ot=Dt.value,ot instanceof A?ot:new A(function(Kt){Kt(ot)})).then(we,Ze)}xt((F=F.apply(G,x||[])).next())})}function Ne(G,x){var A,F,q,z,we={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:Ze(0),throw:Ze(1),return:Ze(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function Ze(xt){return function(Dt){return function(ot){if(A)throw new TypeError("Generator is already executing.");for(;we;)try{if(A=1,F&&(q=2&ot[0]?F.return:ot[0]?F.throw||((q=F.return)&&q.call(F),0):F.next)&&!(q=q.call(F,ot[1])).done)return q;switch(F=0,q&&(ot=[2&ot[0],q.value]),ot[0]){case 0:case 1:q=ot;break;case 4:return we.label++,{value:ot[1],done:!1};case 5:we.label++,F=ot[1],ot=[0];continue;case 7:ot=we.ops.pop(),we.trys.pop();continue;default:if(!(q=we.trys,(q=q.length>0&&q[q.length-1])||ot[0]!==6&&ot[0]!==2)){we=0;continue}if(ot[0]===3&&(!q||ot[1]>q[0]&&ot[1]<q[3])){we.label=ot[1];break}if(ot[0]===6&&we.label<q[1]){we.label=q[1],q=ot;break}if(q&&we.label<q[2]){we.label=q[2],we.ops.push(ot);break}q[2]&&we.ops.pop(),we.trys.pop();continue}ot=x.call(G,we)}catch(Kt){ot=[6,Kt],F=0}finally{A=q=0}if(5&ot[0])throw ot[1];return{value:ot[0]?ot[1]:void 0,done:!0}}([xt,Dt])}}}function Ee(){for(var G=0,x=0,A=arguments.length;x<A;x++)G+=arguments[x].length;var F=Array(G),q=0;for(x=0;x<A;x++)for(var z=arguments[x],we=0,Ze=z.length;we<Ze;we++,q++)F[q]=z[we];return F}var se=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(x,A){for(var F=0,q=A;F<q.length;F++){var z=q[F],we=z[0],Ze=z[1];x.setAttribute(we,Ze)}},G.createRect=function(x,A,F){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",x.toString()),q.setAttribute("height",A.toString()),F&&G.setAttributes(q,F),q},G.createLine=function(x,A,F,q,z){var we=document.createElementNS("http://www.w3.org/2000/svg","line");return we.setAttribute("x1",x.toString()),we.setAttribute("y1",A.toString()),we.setAttribute("x2",F.toString()),we.setAttribute("y2",q.toString()),z&&G.setAttributes(we,z),we},G.createPolygon=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","polygon");return F.setAttribute("points",x),A&&G.setAttributes(F,A),F},G.createCircle=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","circle");return F.setAttribute("cx",(x/2).toString()),F.setAttribute("cy",(x/2).toString()),F.setAttribute("r",x.toString()),A&&G.setAttributes(F,A),F},G.createEllipse=function(x,A,F){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(x/2).toString()),q.setAttribute("cy",(A/2).toString()),q.setAttribute("rx",(x/2).toString()),q.setAttribute("ry",(A/2).toString()),F&&G.setAttributes(q,F),q},G.createGroup=function(x){var A=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&G.setAttributes(A,x),A},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(x,A,F,q,z,we,Ze){var xt=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(xt,[["id",x],["orient",A],["markerWidth",F.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",we.toString()]]),xt.appendChild(Ze),xt},G.createText=function(x){var A=document.createElementNS("http://www.w3.org/2000/svg","text");return A.setAttribute("x","0"),A.setAttribute("y","0"),x&&G.setAttributes(A,x),A},G.createTSpan=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","tspan");return F.textContent=x,A&&G.setAttributes(F,A),F},G.createImage=function(x){var A=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&G.setAttributes(A,x),A},G.createPoint=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return F.x=x,F.y=A,F},G.createPath=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","path");return F.setAttribute("d",x),A&&G.setAttributes(F,A),F},G}(),He=function(){function G(){}return G.addKey=function(x){G.key=x},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),ft=function(){function G(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return G.prototype.rasterize=function(x,A,F){var q=this;return new Promise(function(z){var we=F!==void 0?F:document.createElement("canvas");x===null&&(q.markersOnly=!0,q.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",A.width.baseVal.valueAsString),Ze.setAttribute("height",A.height.baseVal.valueAsString),Ze.setAttribute("viewBox","0 0 "+A.viewBox.baseVal.width.toString()+" "+A.viewBox.baseVal.height.toString()),Ze.innerHTML=A.innerHTML,q.naturalSize===!0?(Ze.width.baseVal.value=x.naturalWidth,Ze.height.baseVal.value=x.naturalHeight):q.width!==void 0&&q.height!==void 0&&(Ze.width.baseVal.value=q.width,Ze.height.baseVal.value=q.height),we.width=Ze.width.baseVal.value,we.height=Ze.height.baseVal.value;var xt=Ze.outerHTML,Dt=we.getContext("2d");q.markersOnly!==!0&&Dt.drawImage(x,0,0,we.width,we.height);var ot=window.URL,Kt=new Image(we.width,we.height);Kt.setAttribute("crossOrigin","anonymous");var $t=new Blob([xt],{type:"image/svg+xml"}),Pn=ot.createObjectURL($t);Kt.onload=function(){Dt.drawImage(Kt,0,0),ot.revokeObjectURL(Pn);var yi=we.toDataURL(q.imageType,q.imageQuality);z(yi)},Kt.src=Pn})},G}(),lt=function(){},it=function(){function G(x){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),G.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},G.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},G.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).appendChild(this.styleSheet),this.addRule(new ct("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ct("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ct("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ve("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ve("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},G.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),ct=function(G,x){this.selector=G,this.style=x},Ve=function(G,x){this.localName=G,this.style=x},Je=function(){function G(x,A,F,q,z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=x,this.displayMode=A,this.markerItems=F,this.uiStyleSettings=q,this.styles=z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return G.prototype.show=function(x){var A=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var F=document.createElement("div");F.className=this.toolbarBlockStyleClass.name,F.style.whiteSpace="nowrap",this.uiContainer.appendChild(F),this.addActionButton(F,'<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(F,'<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(F,'<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(F,'<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(F,'<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(F,'<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(F,'<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(F,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(z){var we=document.createElement("div");we.className=""+A.toolbarButtonStyleClass.name,we.setAttribute("data-type-name",z.typeName),we.innerHTML=z.icon,we.addEventListener("click",function(){A.markerToolbarButtonClicked(we,z)}),A.buttons.push(we),A.markerButtons.push(we)}),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 q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'<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(q,'<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()},G.prototype.addButtonClickListener=function(x){this.buttonClickListeners.push(x)},G.prototype.removeButtonClickListener=function(x){this.buttonClickListeners.indexOf(x)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(x),1)},G.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},G.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var x=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var A=0;A<this.markerButtons.length;A++)A<x||A===x&&this.markerButtons.length-1===x?this.markerButtonBlock.appendChild(this.markerButtons[A]):(A===x&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[A]))}},G.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")},G.prototype.resetButtonStyles=function(){var x=this;this.buttons.forEach(function(A){A.className=A.className.replace(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name,"").trim(),A.className=A.className.replace(x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:x.toolbarActiveButtonStyleColorsClass.name,"").trim(),A.className+=" "+(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name)})},G.prototype.addActionButton=function(x,A,F){var q=this,z=document.createElement("div");switch(z.className=""+this.toolbarButtonStyleClass.name,z.innerHTML=A,z.setAttribute("data-action",F),z.addEventListener("click",function(){q.actionToolbarButtonClicked(z,F)}),F){case"select":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":z.style.fill=this.uiStyleSettings.closeButtonColor}x.appendChild(z),this.buttons.push(z)},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ve("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 Ve("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ve("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ve("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 Ve("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var x=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ve("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
padding: `+x+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ve("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ve("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ct("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new ct("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},G.prototype.markerToolbarButtonClicked=function(x,A){this.setActiveButton(x),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(F){return F("marker",A)}),this.markerButtonOverflowBlock.style.display="none"},G.prototype.actionToolbarButtonClicked=function(x,A){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(F){return F("action",A)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},G.prototype.setActiveButton=function(x){this.resetButtonStyles(),x.className=x.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),x.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},G.prototype.setActiveMarkerButton=function(x){var A=this.markerButtons.find(function(F){return F.getAttribute("data-type-name")===x});A&&this.setActiveButton(A)},G.prototype.setCurrentMarker=function(x){var A=this;this.currentMarker=x,this.buttons.filter(function(F){return/delete|notes/.test(F.getAttribute("data-action"))}).forEach(function(F){A.currentMarker===void 0?(F.style.fillOpacity="0.4",F.style.pointerEvents="none"):(F.style.fillOpacity="1",F.style.pointerEvents="all")})},G}(),st=function(){function G(x,A,F,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=x,this.displayMode=A,this.uiStyleSettings=F,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return G.prototype.addStyles=function(){var x;this.toolboxStyleClass=this.styles.addClass(new Ve("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 Ve("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var A=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ve("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ve("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ve("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 Ve("toolbox-panel-row_colors",`
background-color: `+((x=this.uiStyleSettings.toolboxBackgroundColor)!==null&&x!==void 0?x:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ve("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
padding: `+A+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ve("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ve("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ct("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ct("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},G.prototype.show=function(x){var A;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolboxStyleClass.name+" "+((A=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&A!==void 0?A:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},G.prototype.setPanelButtons=function(x){var A,F,q=this;this.panels=x,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((A=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&A!==void 0?A:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((F=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var we;z.uiStyleSettings=q.uiStyleSettings;var Ze=document.createElement("div");Ze.className=q.toolboxButtonStyleClass.name+" "+((we=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&we!==void 0?we:q.toolboxButtonStyleColorsClass.name),Ze.innerHTML=z.icon,Ze.title=z.title,Ze.addEventListener("click",function(){q.panelButtonClick(z)}),q.panelButtons.push(Ze),q.buttonRow.appendChild(Ze)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},G.prototype.panelButtonClick=function(x){var A=this,F=-1;if(x!==this.activePanel){F=this.panels.indexOf(x),this.panelRow.innerHTML="";var q=x.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),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=x}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){A.displayMode==="inline"?A.panelRow.style.display="none":A.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(z,we){var Ze,xt;z.className=A.toolboxButtonStyleClass.name+" "+(we===F?""+((Ze=A.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ze!==void 0?Ze:A.toolboxActiveButtonStyleColorsClass.name):""+((xt=A.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&xt!==void 0?xt:A.toolboxButtonStyleColorsClass.name))})},G}(),gt=function(G,x){this.title=G,this.icon=x},ut=function(G){function x(A,F,q,z){var we=G.call(this,A,z||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return we.colors=[],we.addTransparent=!1,we.colorBoxes=[],we.colors=F,we.currentColor=q,we.setCurrentColor=we.setCurrentColor.bind(we),we.getColorBox=we.getColorBox.bind(we),we}return De(x,G),x.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.whiteSpace="nowrap",this.colors.forEach(function(q){var z=A.getColorBox(q);F.appendChild(z),A.colorBoxes.push(z)}),F},x.prototype.getColorBox=function(A){var F=this,q=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-q,we=document.createElement("div");we.style.display="inline-block",we.style.boxSizing="content-box",we.style.width=z-2+"px",we.style.height=z-2+"px",we.style.padding="1px",we.style.marginRight="2px",we.style.marginBottom="2px",we.style.borderWidth="2px",we.style.borderStyle="solid",we.style.borderRadius=(z+2)/2+"px",we.style.borderColor=A===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",we.addEventListener("click",function(){F.setCurrentColor(A,we)});var Ze=document.createElement("div");return Ze.style.display="inline-block",Ze.style.width=z-2+"px",Ze.style.height=z-2+"px",Ze.style.backgroundColor=A,Ze.style.borderRadius=z/2+"px",A==="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>`),we.appendChild(Ze),we},x.prototype.setCurrentColor=function(A,F){var q=this;this.currentColor=A,this.colorBoxes.forEach(function(z){z.style.borderColor=z===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(A)},x}(gt),et=function(){function G(x,A,F){this._state="new",this._isSelected=!1,this._container=x,this._overlayContainer=A,this.globalSettings=F,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(G.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),G.prototype.ownsTarget=function(x){return!1},Object.defineProperty(G.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),G.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},G.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},G.prototype.pointerDown=function(x,A){},G.prototype.dblClick=function(x,A){},G.prototype.manipulate=function(x){},G.prototype.pointerUp=function(x){this.stateChanged()},G.prototype.dispose=function(){},G.prototype.addMarkerVisualToContainer=function(x){this.container.childNodes.length>0?this.container.insertBefore(x,this.container.childNodes[0]):this.container.appendChild(x)},G.prototype.getState=function(){return{typeName:G.typeName,state:this.state,notes:this.notes}},G.prototype.restoreState=function(x){this._state=x.state,this.notes=x.notes},G.prototype.scale=function(x,A){},G.prototype.colorChanged=function(x){this.onColorChanged&&this.onColorChanged(x),this.stateChanged()},G.prototype.fillColorChanged=function(x){this.onFillColorChanged&&this.onFillColorChanged(x),this.stateChanged()},G.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var x=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),x.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(x)&&this.onStateChanged(this)}},G.typeName="MarkerBase",G}(),qe=function(){function G(){this.findGripByVisual=this.findGripByVisual.bind(this)}return G.prototype.findGripByVisual=function(x){return this.topLeft.ownsTarget(x)?this.topLeft:this.topCenter.ownsTarget(x)?this.topCenter:this.topRight.ownsTarget(x)?this.topRight:this.centerLeft.ownsTarget(x)?this.centerLeft:this.centerRight.ownsTarget(x)?this.centerRight:this.bottomLeft.ownsTarget(x)?this.bottomLeft:this.bottomCenter.ownsTarget(x)?this.bottomCenter:this.bottomRight.ownsTarget(x)?this.bottomRight:void 0},G}(),St=function(){function G(){this.GRIP_SIZE=10,this.visual=se.createGroup(),this.visual.appendChild(se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},G}(),pt=function(){function G(){}return G.toITransformMatrix=function(x){return{a:x.a,b:x.b,c:x.c,d:x.d,e:x.e,f:x.f}},G.toSVGMatrix=function(x,A){return x.a=A.a,x.b=A.b,x.c=A.c,x.d=A.d,x.e=A.e,x.f=A.f,x},G}(),nt=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.left=0,z.top=0,z.width=0,z.height=0,z.defaultSize={x:50,y:20},z.offsetX=0,z.offsetY=0,z.rotationAngle=0,z.CB_DISTANCE=10,z._suppressMarkerCreateEvent=!1,z.container.transform.baseVal.appendItem(se.createTransform()),z.setupControlBox(),z}return De(x,G),Object.defineProperty(x.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"visual",{get:function(){return this._visual},set:function(A){this._visual=A;var F=se.createTransform();this._visual.transform.baseVal.appendItem(F)},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(A){return!!G.prototype.ownsTarget.call(this,A)||!!(this.controlGrips.findGripByVisual(A)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(A))},x.prototype.pointerDown=function(A,F){G.prototype.pointerDown.call(this,A,F),this.state==="new"&&(this.left=A.x,this.top=A.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(A);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(F),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F)){this.activeGrip=this.rotatorGrip;var z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=z.x-this.width/2,this.top=z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var we=this.container.transform.baseVal.getItem(0);we.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(we,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},x.prototype.pointerUp=function(A){var F=this.state;G.prototype.pointerUp.call(this,A),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(A),this._state="select",F==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},x.prototype.moveVisual=function(A){this.visual.style.transform="translate("+A.x+"px, "+A.y+"px)"},x.prototype.manipulate=function(A){var F=this.unrotatePoint(A);this.state==="creating"?this.resize(A):this.state==="move"?(this.left=this.manipulationStartLeft+(F.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(F.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(F):this.state==="rotate"&&this.rotate(A)},x.prototype.resize=function(A){var F=this.manipulationStartLeft,q=this.manipulationStartWidth,z=this.manipulationStartTop,we=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:F=this.manipulationStartLeft+A.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-F;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+A.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:z=this.manipulationStartTop+A.y-this.manipulationStartY,we=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:we=this.manipulationStartHeight+A.y-this.manipulationStartY}q>=0?(this.left=F,this.width=q):(this.left=F+q,this.width=-q),we>=0?(this.top=z,this.height=we):(this.top=z+we,this.height=-we),this.setSize()},x.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},x.prototype.rotate=function(A){if(Math.abs(A.x-this.centerX)>.1){var F=Math.sign(A.x-this.centerX);this.rotationAngle=180*Math.atan((A.y-this.centerY)/(A.x-this.centerX))/Math.PI+90*F,this.applyRotation()}},x.prototype.applyRotation=function(){var A=this.container.transform.baseVal.getItem(0);A.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(A,0)},x.prototype.rotatePoint=function(A){if(this.rotationAngle===0)return A;var F=this.container.getCTM(),q=se.createPoint(A.x,A.y);return{x:(q=q.matrixTransform(F)).x,y:q.y}},x.prototype.unrotatePoint=function(A){if(this.rotationAngle===0)return A;var F=this.container.getCTM();F=F.inverse();var q=se.createPoint(A.x,A.y);return{x:(q=q.matrixTransform(F)).x,y:q.y}},x.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var A=se.createTransform();A.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(A),this.container.appendChild(this.controlBox),this.controlRect=se.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=se.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 qe,this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){var A=this.controlBox.transform.baseVal.getItem(0);A.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(A,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()},x.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()},x.prototype.createGrip=function(){var A=new St;return A.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(A.visual),A},x.prototype.positionGrips=function(){var A=this.controlGrips.topLeft.GRIP_SIZE,F=-A/2,q=F,z=(this.width+this.CB_DISTANCE)/2-A/2,we=(this.height+this.CB_DISTANCE)/2-A/2,Ze=this.height+this.CB_DISTANCE-A/2,xt=this.width+this.CB_DISTANCE-A/2;this.positionGrip(this.controlGrips.topLeft.visual,F,q),this.positionGrip(this.controlGrips.topCenter.visual,z,q),this.positionGrip(this.controlGrips.topRight.visual,xt,q),this.positionGrip(this.controlGrips.centerLeft.visual,F,we),this.positionGrip(this.controlGrips.centerRight.visual,xt,we),this.positionGrip(this.controlGrips.bottomLeft.visual,F,Ze),this.positionGrip(this.controlGrips.bottomCenter.visual,z,Ze),this.positionGrip(this.controlGrips.bottomRight.visual,xt,Ze),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,q-3*this.CB_DISTANCE)},x.prototype.positionGrip=function(A,F,q){var z=A.transform.baseVal.getItem(0);z.setTranslate(F,q),A.transform.baseVal.replaceItem(z,0)},x.prototype.hideControlBox=function(){this.controlBox.style.display="none"},x.prototype.showControlBox=function(){this.controlBox.style.display=""},x.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:pt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},G.prototype.getState.call(this))},x.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var F=A;this.left=F.left,this.top=F.top,this.width=F.width,this.height=F.height,this.rotationAngle=F.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,F.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,F.containerTransformMatrix))},x.prototype.scale=function(A,F){G.prototype.scale.call(this,A,F);var q=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:q.x*A,y:q.y*F});this.left=z.x,this.top=z.y,this.width=this.width*A,this.height=this.height*F,this.adjustControlBox()},x}(et),at=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z}return De(x,G),x.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual)},x.prototype.createVisual=function(){this.visual=se.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)},x.prototype.pointerDown=function(A,F){G.prototype.pointerDown.call(this,A,F),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},x.prototype.manipulate=function(A){G.prototype.manipulate.call(this,A)},x.prototype.resize=function(A){G.prototype.resize.call(this,A),this.setSize()},x.prototype.setSize=function(){G.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(A){G.prototype.pointerUp.call(this,A),this.setSize()},x.prototype.setStrokeColor=function(A){this.strokeColor=A,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(A),this.stateChanged()},x.prototype.setFillColor=function(A){this.fillColor=A,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},x.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this))},x.prototype.restoreState=function(A){var F=A;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),G.prototype.restoreState.call(this,A),this.setSize()},x.prototype.scale=function(A,F){G.prototype.scale.call(this,A,F),this.setSize()},x.title="Rectangle marker",x}(nt),bt=function(G){function x(A,F,q,z){var we=G.call(this,A,z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return we.widths=[],we.widthBoxes=[],we.widths=F,we.currentWidth=q,we.setCurrentWidth=we.setCurrentWidth.bind(we),we}return De(x,G),x.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.widths.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.flexGrow="2",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===A.currentWidth?A.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){A.setCurrentWidth(q,z)}),F.appendChild(z);var we=document.createElement("div");we.innerText=q.toString(),we.style.marginRight="5px",z.appendChild(we);var Ze=document.createElement("div");Ze.style.minHeight="20px",Ze.style.flexGrow="2",Ze.style.display="flex",Ze.style.alignItems="center";var xt=document.createElement("hr");xt.style.minWidth="20px",xt.style.border="0px",xt.style.borderTop=q+"px solid "+A.uiStyleSettings.toolboxColor,xt.style.flexGrow="2",Ze.appendChild(xt),z.appendChild(Ze),A.widthBoxes.push(z)}),F},x.prototype.setCurrentWidth=function(A,F){var q=this;this.currentWidth=A,this.widthBoxes.forEach(function(z){z.style.borderColor=z===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},x}(gt),Et=function(G){function x(A,F,q,z){var we=G.call(this,A,z||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return we.styles=[],we.styleBoxes=[],we.styles=F,we.currentStyle=q,we.setCurrentStyle=we.setCurrentStyle.bind(we),we}return De(x,G),x.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.styles.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/A.styles.length-5+"%",z.style.borderColor=q===A.currentStyle?A.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){A.setCurrentStyle(q,z)}),F.appendChild(z);var we=document.createElement("div");we.style.minHeight="20px",we.style.flexGrow="2",we.style.overflow="hidden";var Ze=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+A.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(q!==""?'stroke-dasharray="'+q+'"':"")+` />
</svg>`;we.innerHTML=Ze,z.appendChild(we),A.styleBoxes.push(z)}),F},x.prototype.setCurrentStyle=function(A,F){var q=this;this.currentStyle=A,this.styleBoxes.forEach(function(z){z.style.borderColor=z===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},x}(gt),Re=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new ut("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new bt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Et("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return De(x,G),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=x.typeName,A},x.typeName="FrameMarker",x.title="Frame marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',x}(at),Te=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},Ke=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.x1=0,z.y1=0,z.x2=0,z.y2=0,z.defaultLength=50,z.manipulationStartX=0,z.manipulationStartY=0,z.manipulationStartX1=0,z.manipulationStartY1=0,z.manipulationStartX2=0,z.manipulationStartY2=0,z.setupControlBox(),z}return De(x,G),x.prototype.ownsTarget=function(A){return!!G.prototype.ownsTarget.call(this,A)||!(!this.grip1.ownsTarget(A)&&!this.grip2.ownsTarget(A))},x.prototype.pointerDown=function(A,F){G.prototype.pointerDown.call(this,A,F),this.manipulationStartX=A.x,this.manipulationStartY=A.y,this.state==="new"&&(this.x1=A.x,this.y1=A.y,this.x2=A.x,this.y2=A.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(F)?this.activeGrip=this.grip1:this.grip2.ownsTarget(F)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},x.prototype.pointerUp=function(A){var F=this.state;G.prototype.pointerUp.call(this,A),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(A),this._state="select",F==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},x.prototype.adjustVisual=function(){},x.prototype.manipulate=function(A){this.state==="creating"?this.resize(A):this.state==="move"?(this.x1=this.manipulationStartX1+A.x-this.manipulationStartX,this.y1=this.manipulationStartY1+A.y-this.manipulationStartY,this.x2=this.manipulationStartX2+A.x-this.manipulationStartX,this.y2=this.manipulationStartY2+A.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(A)},x.prototype.resize=function(A){switch(this.activeGrip){case this.grip1:this.x1=A.x,this.y1=A.y;break;case this.grip2:case void 0:this.x2=A.x,this.y2=A.y}this.adjustVisual(),this.adjustControlBox()},x.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){this.positionGrips()},x.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},x.prototype.createGrip=function(){var A=new St;return A.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(A.visual),A},x.prototype.positionGrips=function(){var A=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-A/2,this.y1-A/2),this.positionGrip(this.grip2.visual,this.x2-A/2,this.y2-A/2)},x.prototype.positionGrip=function(A,F,q){var z=A.transform.baseVal.getItem(0);z.setTranslate(F,q),A.transform.baseVal.replaceItem(z,0)},x.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},G.prototype.getState.call(this))},x.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var F=A;this.x1=F.x1,this.y1=F.y1,this.x2=F.x2,this.y2=F.y2},x.prototype.scale=function(A,F){G.prototype.scale.call(this,A,F),this.x1=this.x1*A,this.y1=this.y1*F,this.x2=this.x2*A,this.y2=this.y2*F,this.adjustVisual(),this.adjustControlBox()},x}(et),ze=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new ut("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new bt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Et("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return De(x,G),x.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.selectorLine&&A!==this.visibleLine)},x.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=se.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)},x.prototype.pointerDown=function(A,F){G.prototype.pointerDown.call(this,A,F),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},x.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()),se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setStrokeColor=function(A){this.strokeColor=A,this.adjustVisual(),this.colorChanged(A)},x.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.adjustVisual()},x.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},G.prototype.getState.call(this));return A.typeName=x.typeName,A},x.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var F=A;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.createVisual(),this.adjustVisual()},x.typeName="LineMarker",x.title="Line marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',x}(Ke),Ce=function(G){function x(A,F,q,z){var we=G.call(this,A,z||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return we.fonts=[],we.fontBoxes=[],we.fonts=F,we.currentFont=q,we.setCurrentFont=we.setCurrentFont.bind(we),we}return De(x,G),x.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.flexGrow="2",this.fonts.forEach(function(q){var z=document.createElement("div");z.style.display="inline-block",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/A.fonts.length-5+"%",z.style.borderColor=q===A.currentFont?A.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){A.setCurrentFont(q,z)}),F.appendChild(z);var we=document.createElement("div");we.style.display="flex",we.style.minHeight="20px",we.style.flexGrow="2",we.style.fontFamily=q,we.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",we.appendChild(Ze),z.appendChild(we),A.fontBoxes.push(z)}),F},x.prototype.setCurrentFont=function(A,F){var q=this;this.currentFont=A,this.fontBoxes.forEach(function(z){z.style.borderColor=z===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},x}(gt),We=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.color="transparent",z.padding=5,z.DEFAULT_TEXT="your text here",z.text=z.DEFAULT_TEXT,z.isMoved=!1,z.color=q.defaultColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setColor=z.setColor.bind(z),z.setFont=z.setFont.bind(z),z.renderText=z.renderText.bind(z),z.sizeText=z.sizeText.bind(z),z.textEditDivClicked=z.textEditDivClicked.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.setSize=z.setSize.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.colorPanel=new ut("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new Ce("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return De(x,G),x.prototype.ownsTarget=function(A){if(G.prototype.ownsTarget.call(this,A)||A===this.visual||A===this.textElement||A===this.bgRectangle)return!0;var F=!1;return this.textElement.childNodes.forEach(function(q){q===A&&(F=!0)}),F},x.prototype.createVisual=function(){this.visual=se.createGroup(),this.bgRectangle=se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},x.prototype.pointerDown=function(A,F){G.prototype.pointerDown.call(this,A,F),this.isMoved=!1,this.pointerDownPoint=A,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},x.prototype.renderText=function(){var A=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(F){A.textElement.appendChild(se.createTSpan(F.trim()===""?" ":F.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},x.prototype.getTextScale=function(){var A=this.textElement.getBBox(),F=1;if(A.width>0&&A.height>0){var q=(1*this.width-this.width*this.padding*2/100)/A.width,z=(1*this.height-this.height*this.padding*2/100)/A.height;F=Math.min(q,z)}return F},x.prototype.getTextPosition=function(A){var F=this.textElement.getBBox(),q=0,z=0;return F.width>0&&F.height>0&&(q=(this.width-F.width*A)/2,z=this.height/2-F.height*A/2),{x:q,y:z}},x.prototype.sizeText=function(){var A=this.textElement.getBBox(),F=this.getTextScale(),q=this.getTextPosition(F);q.y-=A.y*F,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+F+", "+F+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(F,F))},x.prototype.manipulate=function(A){G.prototype.manipulate.call(this,A),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(A.x-this.pointerDownPoint.x)>5||Math.abs(A.y-this.pointerDownPoint.y)>5)},x.prototype.resize=function(A){G.prototype.resize.call(this,A),this.isMoved=!0,this.setSize(),this.sizeText()},x.prototype.setSize=function(){G.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},x.prototype.pointerUp=function(A){var F=this.state;F==="creating"&&(this._suppressMarkerCreateEvent=!0),G.prototype.pointerUp.call(this,A),this.setSize(),(F==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},x.prototype.showTextEditor=function(){var A=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(F){F.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var F=Number.parseFloat(A.textEditor.style.fontSize);A.textEditor.clientWidth>=Number.parseInt(A.textEditor.style.maxWidth)&&F>.9;)F-=.1,A.textEditor.style.fontSize=Math.max(F,.9)+"em"}),this.textEditor.addEventListener("keyup",function(F){F.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(F){if(F.clipboardData){var q=F.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(q)),F.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){A.textEditDivClicked(A.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},x.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var A=this.getTextScale(),F=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),z={x:q.width*A,y:q.height*A};F.x-=z.x/2,F.y-=z.y/2,this.textEditor.style.top=F.y+"px",this.textEditor.style.left=F.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-F.x+"px",this.textEditor.style.fontSize=Math.max(16*A,12)+"px",this.textElement.style.display="none"}},x.prototype.textEditDivClicked=function(A){this.text=A.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},x.prototype.select=function(){G.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},x.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),G.prototype.deselect.call(this)},x.prototype.dblClick=function(A,F){G.prototype.dblClick.call(this,A,F),this.showTextEditor()},x.prototype.setColor=function(A){this.textElement&&se.setAttributes(this.textElement,[["fill",A]]),this.color=A,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(A)},x.prototype.setFont=function(A){this.textElement&&se.setAttributes(this.textElement,[["font-family",A]]),this.fontFamily=A,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},x.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},x.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},G.prototype.getState.call(this));return A.typeName=x.typeName,A},x.prototype.restoreState=function(A){var F=A;this.color=F.color,this.fontFamily=F.fontFamily,this.padding=F.padding,this.text=F.text,this.createVisual(),G.prototype.restoreState.call(this,A),this.setSize()},x.prototype.scale=function(A,F){G.prototype.scale.call(this,A,F),this.setSize(),this.sizeText(),this.positionTextEditor()},x.typeName="TextMarker",x.title="Text marker",x.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>',x}(nt),ve=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.color="transparent",z.lineWidth=3,z.drawing=!1,z.pixelRatio=1,z.color=q.defaultColor,z.lineWidth=q.defaultStrokeWidth,z.pixelRatio=q.freehandPixelRatio,z.setColor=z.setColor.bind(z),z.addCanvas=z.addCanvas.bind(z),z.finishCreation=z.finishCreation.bind(z),z.setLineWidth=z.setLineWidth.bind(z),z.colorPanel=new ut("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new bt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return De(x,G),x.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.drawingImage)},x.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var A=se.createTransform();this.visual.transform.baseVal.appendItem(A),this.addMarkerVisualToContainer(this.visual)},x.prototype.pointerDown=function(A,F){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(A.x,A.y),this.drawing=!0):G.prototype.pointerDown.call(this,A,F)},x.prototype.manipulate=function(A){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(A.x,A.y),this.canvasContext.stroke()):G.prototype.manipulate.call(this,A)},x.prototype.resize=function(A){G.prototype.resize.call(this,A),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(A){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):G.prototype.pointerUp.call(this,A)},x.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)},x.prototype.select=function(){this.state==="creating"&&this.finishCreation(),G.prototype.select.call(this)},x.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),G.prototype.deselect.call(this)},x.prototype.finishCreation=function(){for(var A=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),F=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=F[0],z=F[1],we=F[2],Ze=F[3],xt=!1,Dt=0;Dt<this.canvasElement.height;Dt++)for(var ot=0;ot<this.canvasElement.width;ot++)A.data[Dt*this.canvasElement.width*4+4*ot+3]>0&&(xt=!0,Dt<z&&(z=Dt),ot<q&&(q=ot),Dt>Ze&&(Ze=Dt),ot>we&&(we=ot));if(xt){this.left=q/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(we-q)/this.pixelRatio,this.height=(Ze-z)/this.pixelRatio;var Kt=document.createElement("canvas");Kt.width=we-q,Kt.height=Ze-z,Kt.getContext("2d").putImageData(this.canvasContext.getImageData(q,z,we-q,Ze-z),0,0),this.drawingImgUrl=Kt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},x.prototype.setDrawingImage=function(){se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},x.prototype.setColor=function(A){this.color=A,this.colorChanged(A)},x.prototype.setLineWidth=function(A){this.lineWidth=A},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=Object.assign({drawingImgUrl:this.drawingImgUrl},G.prototype.getState.call(this));return A.typeName=x.typeName,A},x.prototype.restoreState=function(A){this.createVisual(),G.prototype.restoreState.call(this,A),this.drawingImgUrl=A.drawingImgUrl,this.setDrawingImage()},x.prototype.scale=function(A,F){G.prototype.scale.call(this,A,F),this.setDrawingImage()},x.typeName="FreehandMarker",x.title="Freehand marker",x.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>',x}(nt),ce=function(G){function x(A,F,q){var z=G.call(this,A,q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return z.typeBoxes=[],z.currentType=F,z.setCurrentType=z.setCurrentType.bind(z),z}return De(x,G),x.prototype.getUi=function(){var A=this,F=document.createElement("div");F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2";for(var q=function(Ze){var xt="both";switch(Ze){case 0:xt="both";break;case 1:xt="start";break;case 2:xt="end";break;case 3:xt="none"}var Dt=document.createElement("div");if(Dt.style.display="flex",Dt.style.flexGrow="2",Dt.style.alignItems="center",Dt.style.justifyContent="space-between",Dt.style.padding="5px",Dt.style.borderWidth="2px",Dt.style.borderStyle="solid",Dt.style.borderColor=xt===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",Dt.addEventListener("click",function(){A.setCurrentType(xt,Dt)}),F.appendChild(Dt),xt==="both"||xt==="start"){var ot=document.createElement("div");ot.style.display="flex",ot.style.alignItems="center",ot.style.minHeight="20px",ot.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ot.style.marginLeft="5px",Dt.appendChild(ot)}var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.alignItems="center",Kt.style.minHeight="20px",Kt.style.flexGrow="2";var $t=document.createElement("hr");if($t.style.minWidth="20px",$t.style.border="0px",$t.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),$t.style.flexGrow="2",Kt.appendChild($t),Dt.appendChild(Kt),xt==="both"||xt==="end"){var Pn=document.createElement("div");Pn.style.display="flex",Pn.style.alignItems="center",Pn.style.minHeight="20px",Pn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Pn.style.marginRight="5px",Dt.appendChild(Pn)}z.typeBoxes.push(Dt)},z=this,we=0;we<4;we++)q(we);return F},x.prototype.setCurrentType=function(A,F){var q=this;this.currentType=A,this.typeBoxes.forEach(function(z){z.style.borderColor=z===F?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},x}(gt),he=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.arrowType="end",z.arrowBaseHeight=10,z.arrowBaseWidth=10,z.getArrowPoints=z.getArrowPoints.bind(z),z.setArrowType=z.setArrowType.bind(z),z.arrowTypePanel=new ce("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return De(x,G),x.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.arrow1&&A!==this.arrow2)},x.prototype.getArrowPoints=function(A,F){var q=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return A-q/2+","+(F+z/2)+" "+A+","+(F-z/2)+" "+(A+q/2)+","+(F+z/2)},x.prototype.createTips=function(){this.arrow1=se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow2)},x.prototype.pointerDown=function(A,F){G.prototype.pointerDown.call(this,A,F),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(G.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",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var A=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.arrow1.transform.baseVal.getItem(0);F.setRotate(A,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(F,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(A+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},x.prototype.setArrowType=function(A){this.arrowType=A,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=Object.assign({arrowType:this.arrowType},G.prototype.getState.call(this));return A.typeName=x.typeName,A},x.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var F=A;this.arrowType=F.arrowType,this.createTips(),this.adjustVisual()},x.typeName="ArrowMarker",x.title="Arrow marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',x}(ze),ne=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.fillColor=q.defaultFillColor,z.strokeWidth=0,z.fillPanel=new ut("Color",q.defaultColorSet,q.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return De(x,G),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=x.typeName,A},x.typeName="CoverMarker",x.title="Cover marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',x}(at),oe=function(G){function x(A,F,q,z){var we=G.call(this,A,z||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return we.opacities=[],we.opacityBoxes=[],we.opacities=F,we.currentOpacity=q,we.setCurrentOpacity=we.setCurrentOpacity.bind(we),we}return De(x,G),x.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",F.style.justifyContent="space-between",this.opacities.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="center",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===A.currentOpacity?A.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){A.setCurrentOpacity(q,z)}),F.appendChild(z);var we=document.createElement("div");we.innerText=100*q+"%",z.appendChild(we),A.opacityBoxes.push(z)}),F},x.prototype.setCurrentOpacity=function(A,F){var q=this;this.currentOpacity=A,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},x}(gt),le=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=q.defaultHighlightColor,z.strokeWidth=0,z.opacity=q.defaultHighlightOpacity,z.fillPanel=new ut("Color",q.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new oe("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return De(x,G),x.prototype.setOpacity=function(A){this.opacity=A,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=x.typeName,A},x.typeName="HighlightMarker",x.title="Highlight marker",x.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>',x}(ne),pe='<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>',ge=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.bgColor="transparent",z.tipPosition={x:0,y:0},z.tipBase1Position={x:0,y:0},z.tipBase2Position={x:0,y:0},z.tipMoving=!1,z.color=q.defaultStrokeColor,z.bgColor=q.defaultFillColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setBgColor=z.setBgColor.bind(z),z.getTipPoints=z.getTipPoints.bind(z),z.positionTip=z.positionTip.bind(z),z.setTipPoints=z.setTipPoints.bind(z),z.colorPanel=new ut("Text color",q.defaultColorSet,z.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),z.colorPanel.onColorChanged=z.setColor,z.bgColorPanel=new ut("Fill color",q.defaultColorSet,z.bgColor,pe),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new Ce("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new St,z.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return De(x,G),x.prototype.ownsTarget=function(A){return G.prototype.ownsTarget.call(this,A)||this.tipGrip.ownsTarget(A)||this.tip===A},x.prototype.createTip=function(){se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},x.prototype.pointerDown=function(A,F){this.state==="new"&&G.prototype.pointerDown.call(this,A,F),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(F)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):G.prototype.pointerDown.call(this,A,F)},x.prototype.pointerUp=function(A){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,G.prototype.pointerUp.call(this,A);else{var F=this.state==="creating";G.prototype.pointerUp.call(this,A),this.setTipPoints(F),this.positionTip()}},x.prototype.manipulate=function(A){if(this.tipMoving){var F=this.unrotatePoint(A);this.tipPosition={x:F.x-this.manipulationStartLeft,y:F.y-this.manipulationStartTop},this.positionTip()}else G.prototype.manipulate.call(this,A)},x.prototype.setBgColor=function(A){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",A]]),se.setAttributes(this.tip,[["fill",A]])),this.bgColor=A,this.fillColorChanged(A)},x.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},x.prototype.setTipPoints=function(A){A===void 0&&(A=!1);var F=Math.min(this.height/2,15),q=this.height/5;A&&(this.tipPosition={x:F+q/2,y:this.height+20});var z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(q=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:F,y:0},this.tipBase2Position={x:F+q,y:0}):(this.tipBase1Position={x:0,y:F},this.tipBase2Position={x:0,y:F+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(q=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-F-q,y:0},this.tipBase2Position={x:this.width-F,y:0}):(this.tipBase1Position={x:this.width,y:F},this.tipBase2Position={x:this.width,y:F+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(q=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-F-q,y:this.height},this.tipBase2Position={x:this.width-F,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-F-q},this.tipBase2Position={x:this.width,y:this.height-F}):z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:F,y:this.height},this.tipBase2Position={x:F+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-F},this.tipBase2Position={x:0,y:this.height-F-q})},x.prototype.resize=function(A){G.prototype.resize.call(this,A),this.positionTip()},x.prototype.positionTip=function(){se.setAttributes(this.tip,[["points",this.getTipPoints()]]);var A=this.tipGrip.visual.transform.baseVal.getItem(0);A.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(A,0)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.select=function(){this.positionTip(),G.prototype.select.call(this)},x.prototype.getState=function(){var A=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},G.prototype.getState.call(this));return A.typeName=x.typeName,A},x.prototype.restoreState=function(A){var F=A;this.bgColor=F.bgColor,this.tipPosition=F.tipPosition,G.prototype.restoreState.call(this,A),this.createTip(),this.setTipPoints()},x.prototype.scale=function(A,F){G.prototype.scale.call(this,A,F),this.tipPosition={x:this.tipPosition.x*A,y:this.tipPosition.y*F},this.positionTip()},x.typeName="CalloutMarker",x.title="Callout marker",x.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>',x}(We),Pe=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.fillColor=q.defaultFillColor,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.setOpacity=z.setOpacity.bind(z),z.createVisual=z.createVisual.bind(z),z.strokePanel=new ut("Line color",Ee(q.defaultColorSet,["transparent"]),q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new ut("Fill color",Ee(q.defaultColorSet,["transparent"]),z.fillColor,pe),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new bt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Et("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new oe("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return De(x,G),x.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual)},x.prototype.createVisual=function(){this.visual=se.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)},x.prototype.pointerDown=function(A,F){G.prototype.pointerDown.call(this,A,F),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},x.prototype.manipulate=function(A){G.prototype.manipulate.call(this,A)},x.prototype.resize=function(A){G.prototype.resize.call(this,A),this.setSize()},x.prototype.setSize=function(){G.prototype.setSize.call(this),se.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},x.prototype.pointerUp=function(A){G.prototype.pointerUp.call(this,A),this.setSize()},x.prototype.setStrokeColor=function(A){this.strokeColor=A,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(A),this.stateChanged()},x.prototype.setFillColor=function(A){this.fillColor=A,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(A),this.stateChanged()},x.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.setOpacity=function(A){this.opacity=A,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this));return A.typeName=x.typeName,A},x.prototype.restoreState=function(A){var F=A;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),G.prototype.restoreState.call(this,A),this.setSize()},x.prototype.scale=function(A,F){G.prototype.scale.call(this,A,F),this.setSize()},x.typeName="EllipseMarker",x.title="Ellipse marker",x.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>',x}(nt),Ge=function(G){function x(A,F,q){return G.call(this,A,F,q)||this}return De(x,G),Object.defineProperty(x.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.tip1&&A!==this.tip2)},x.prototype.createTips=function(){this.tip1=se.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(se.createTransform()),this.visual.appendChild(this.tip1),this.tip2=se.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(se.createTransform()),this.visual.appendChild(this.tip2)},x.prototype.pointerDown=function(A,F){G.prototype.pointerDown.call(this,A,F),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(G.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(se.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()]]),se.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 A=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.tip1.transform.baseVal.getItem(0);F.setRotate(A,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(F,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(A+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=x.typeName,A},x.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A),this.createTips(),this.adjustVisual()},x.typeName="MeasurementMarker",x.title="Measurement marker",x.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>',x}(ze),rt=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.strokePanel.colors=q.defaultColorSet,z.fillColor="transparent",z}return De(x,G),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=x.typeName,A},x.typeName="EllipseFrameMarker",x.title="Ellipse frame marker",x.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>',x}(Pe),vt=function(){function G(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),G.prototype.addUndoStep=function(x){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(x)||(this.undoStack.push(x),JSON.stringify(this.lastRedoStep)!==JSON.stringify(x)&&this.redoStack.splice(0,this.redoStack.length))},G.prototype.replaceLastUndoStep=function(x){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=x)},G.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},G.prototype.undo=function(){if(this.undoStack.length>1){var x=this.undoStack.pop();return x!==void 0&&this.redoStack.push(x),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},G.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},G}(),tt=function(G){function x(A,F,q){var z=G.call(this,A,F,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.curveX=0,z.curveY=0,z.manipulationStartCurveX=0,z.manipulationStartCurveY=0,z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.positionGrips=z.positionGrips.bind(z),z.addControlGrips=z.addControlGrips.bind(z),z.adjustVisual=z.adjustVisual.bind(z),z.setupControlBox=z.setupControlBox.bind(z),z.resize=z.resize.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new ut("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new bt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Et("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return De(x,G),x.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.selectorCurve&&A!==this.visibleCurve&&!this.curveGrip.ownsTarget(A))},x.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},x.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorCurve=se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=se.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)},x.prototype.pointerDown=function(A,F){G.prototype.pointerDown.call(this,A,F),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=A.x,this.curveY=A.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(F)&&(this.activeGrip=this.curveGrip,this._state="resize")},x.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setupControlBox=function(){G.prototype.setupControlBox.call(this),this.curveControlLine1=se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=se.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)},x.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,G.prototype.addControlGrips.call(this)},x.prototype.positionGrips=function(){G.prototype.positionGrips.call(this);var A=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-A/2,this.curveY-A/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()))},x.prototype.manipulate=function(A){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+A.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+A.y-this.manipulationStartY),G.prototype.manipulate.call(this,A)},x.prototype.resize=function(A){this.activeGrip===this.curveGrip&&(this.curveX=A.x,this.curveY=A.y),G.prototype.resize.call(this,A),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},x.prototype.setStrokeColor=function(A){this.strokeColor=A,this.adjustVisual(),this.colorChanged(A)},x.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.adjustVisual()},x.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.adjustVisual()},x.prototype.scale=function(A,F){this.curveX=this.curveX*A,this.curveY=this.curveY*F,G.prototype.scale.call(this,A,F)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var A=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},G.prototype.getState.call(this));return A.typeName=x.typeName,A},x.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var F=A;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.curveX=F.curveX,this.curveY=F.curveY,this.createVisual(),this.adjustVisual()},x.typeName="CurveMarker",x.title="Curve marker",x.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>',x}(Ke),Wt=function(){function G(x,A){A===void 0&&(A=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=x,this.cancelable=A}return Object.defineProperty(G.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),G.prototype.preventDefault=function(){this._defaultPrevented=!0},G}(),Nt=function(G){function x(A,F,q){var z=G.call(this,A,!1)||this;return z.dataUrl=F,z.state=q,z}return De(x,G),x}(Wt),_t=function(G){function x(A,F,q){q===void 0&&(q=!1);var z=G.call(this,A,q)||this;return z.marker=F,z}return De(x,G),x}(Wt),Qt=function(){function G(){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 G.prototype.addEventListener=function(x,A){this[x].push(A)},G.prototype.removeEventListener=function(x,A){var F=this[x].indexOf(A);F>-1&&this[x].splice(F,1)},G}(),Jt=function(){function G(x){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Te,this._isOpen=!1,this.undoRedoManager=new vt,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 Qt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=G.instanceCounter++,this.styles=new it(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=x,this.targetRoot=document.body,this.width=x.clientWidth,this.height=x.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(G.prototype,"ALL_MARKER_TYPES",{get:function(){return[Re,ve,he,We,rt,Pe,le,ge,Ge,ne,ze,tt]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Re,ve,he,We,Pe,le,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Re,ve,he,We,le]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(x){var A=this;this._availableMarkerTypes.splice(0),x.forEach(function(F){if(typeof F=="string"){var q=A.ALL_MARKER_TYPES.find(function(z){return z.typeName===F});q!==void 0&&A._availableMarkerTypes.push(q)}else A._availableMarkerTypes.push(F)})},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(x){this._zoomLevel=x,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),G.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),He.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},G.prototype.show=function(){var x=this;this.styles.styleSheetRoot===void 0&&lt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=lt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(A){return A(new Wt(x))})},G.prototype.render=function(){return Fe(this,void 0,void 0,function(){var x;return Ne(this,function(A){switch(A.label){case 0:return this.setCurrentMarker(),(x=new ft).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.markersOnly=this.renderMarkersOnly,x.width=this.renderWidth,x.height=this.renderHeight,[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return A.sent(),[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,A.sent()]}})})},G.prototype.close=function(x){var A=this;if(x===void 0&&(x=!1),this.isOpen){var F=!1;x||this.eventListeners.beforeclose.forEach(function(q){var z=new Wt(A,!0);q(z),z.defaultPrevented&&(F=!0)}),F||(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(q){return q(new Wt(A))}),this.detachEvents(),this._isOpen=!1)}},G.prototype.addMarkersToToolbar=function(){for(var x,A=[],F=0;F<arguments.length;F++)A[F]=arguments[F];(x=this._availableMarkerTypes).push.apply(x,A)},G.prototype.addRenderEventListener=function(x){this.addEventListener("render",function(A){x(A.dataUrl,A.state)})},G.prototype.removeRenderEventListener=function(x){},G.prototype.addCloseEventListener=function(x){this.addEventListener("close",function(){x()})},G.prototype.removeCloseEventListener=function(x){},G.prototype.setupResizeObserver=function(){var x=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return x.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},G.prototype.onPopupTargetResize=function(){var x=1*this.target.clientWidth/this.target.clientHeight,A=this.editorCanvas.clientWidth/x>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*x:this.editorCanvas.clientWidth,F=A<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/x;this.resize(A,F)},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.prototype.resize=function(x,A){this._isResizing=!0;var F=x/this.imageWidth,q=A/this.imageHeight;this.imageWidth=Math.round(x),this.imageHeight=Math.round(A),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(F,q),this._isResizing=!1},G.prototype.scaleMarkers=function(x,A){var F,q=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(x,A):(F=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(z){z!==q._currentMarker&&z.scale(x,A)}),F!==void 0&&this.setCurrentMarker(F)},G.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"},G.prototype.setTopLeft=function(){var x=this.editingTarget.getBoundingClientRect(),A=this.editorCanvas.getBoundingClientRect();this.left=x.left-A.left,this.top=x.top-A.top},G.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)},G.prototype.addDefs=function(){for(var x,A=[],F=0;F<arguments.length;F++)A[F]=arguments[F];this.defs=se.createDefs(),this.addDefsToImage(),(x=this.defs).append.apply(x,A)},G.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},G.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)},G.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},G.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},G.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)},G.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},G.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)},G.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 x=document.createElement("a");x.href="https://markerjs.com/",x.target="_blank",x.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>',x.title="Powered by marker.js",x.style.display="grid",x.style.alignItems="center",x.style.justifyItems="center",x.style.padding="3px",x.style.width="20px",x.style.height="20px",this.logoUI.appendChild(x),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},G.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")},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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 x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"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 Je(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 st(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},G.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.removeMarker=function(x){this.markerImage.removeChild(x.container),this.markers.indexOf(x)>-1&&this.markers.splice(this.markers.indexOf(x),1),x.dispose()},G.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())},G.prototype.toolbarButtonClicked=function(x,A){if(x==="marker"&&A!==void 0)this.createNewMarker(A);else if(x==="action")switch(A){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()}},G.prototype.deleteSelectedMarker=function(){var x=this;if(this._currentMarker!==void 0){var A=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var z=new _t(x,x._currentMarker,!0);q(z),z.defaultPrevented&&(A=!0)}),!A){var F=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(q){return q(new _t(x,F))})}}},G.prototype.clear=function(){var x=this,A=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(we){var Ze=new _t(x,void 0,!0);we(Ze),Ze.defaultPrevented&&(A=!0)}),!A)){this.setCurrentMarker();for(var F=function(we){var Ze=q.markers[we];q.setCurrentMarker(q.markers[we]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(xt){return xt(new _t(x,Ze))})},q=this,z=this.markers.length-1;z>=0;z--)F(z);this.addUndoStep()}},Object.defineProperty(G.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),G.prototype.showNotesEditor=function(){var x;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=(x=this._currentMarker.notes)!==null&&x!==void 0?x:"",this.overlayContainer.appendChild(this.notesArea))},G.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)},G.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},G.prototype.addUndoStep=function(){var x=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var A=this.getState(),F=this.undoRedoManager.getLastUndoStep();if(!F||F.width===A.width&&F.height===A.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(A),q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(z){return z(new Wt(x))})}else this.undoRedoManager.replaceLastUndoStep(A),this.eventListeners.statechange.forEach(function(z){return z(new Wt(x))})}},G.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},G.prototype.undoStep=function(){var x=this,A=this.undoRedoManager.undo();A!==void 0&&(this.restoreState(A),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(F){return F(new Wt(x))}))},G.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},G.prototype.redoStep=function(){var x=this,A=this.undoRedoManager.redo();A!==void 0&&(this.restoreState(A),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(F){return F(new Wt(x))}))},G.prototype.stepZoom=function(){var x=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=x<this.zoomSteps.length-1?this.zoomSteps[x+1]:this.zoomSteps[0]},G.prototype.panTo=function(x){this.contentDiv.scrollBy({left:this.prevPanPoint.x-x.x,top:this.prevPanPoint.y-x.y}),this.prevPanPoint=x},G.prototype.startRenderAndClose=function(){return Fe(this,void 0,void 0,function(){var x,A,F=this;return Ne(this,function(q){switch(q.label){case 0:return[4,this.render()];case 1:return x=q.sent(),A=this.getState(),this.eventListeners.render.forEach(function(z){return z(new Nt(F,x,A))}),this.close(!0),[2]}})})},G.prototype.getState=function(x){x===!0&&this.setCurrentMarker();var A={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(F){return A.markers.push(F.getState())}),A},G.prototype.restoreState=function(x){var A=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);x.markers.forEach(function(F){var q=A._availableMarkerTypes.find(function(we){return we.typeName===F.typeName});if(q!==void 0){var z=A.addNewMarker(q);z.restoreState(F),A.markers.push(z)}}),x.width&&x.height&&(x.width!==this.imageWidth||x.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/x.width,this.imageHeight/x.height),this.eventListeners.restorestate.forEach(function(F){return F(new Wt(A))})},G.prototype.addNewMarker=function(x){var A=se.createGroup();return this.markerImage.appendChild(A),new x(A,this.overlayContainer,this.settings)},G.prototype.createNewMarker=function(x){var A,F=this;(A=typeof x=="string"?this._availableMarkerTypes.find(function(q){return q.typeName===x}):x)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(A),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(A.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(q){return q(new _t(F,F._currentMarker))}))},G.prototype.markerCreated=function(x){var A=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(x),this.setCurrentMarker(x),x instanceof ve&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ve):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(F){return F(new _t(A,A._currentMarker))})},G.prototype.colorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=x,this.settings.defaultStrokeColor=x)},G.prototype.fillColorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=x)},G.prototype.markerStateChanged=function(x){var A=this;this.eventListeners.markerchange.forEach(function(F){return F(new _t(A,x))})},G.prototype.setCurrentMarker=function(x){var A=this;this._currentMarker!==x&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(F){return F(new _t(A,A._currentMarker))})),this._currentMarker=x,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(F){return F(new _t(A,A._currentMarker))}))},G.prototype.onPointerDown=function(x){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||x.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var A=this.markers.find(function(F){return F.ownsTarget(x.target)});A!==void 0?(this.setCurrentMarker(A),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:x.clientX,y:x.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY))},G.prototype.onDblClick=function(x){if(this._isFocused||this.focus(),this.mode==="select"){var A=this.markers.find(function(F){return F.ownsTarget(x.target)});A!==void 0&&A!==this._currentMarker&&this.setCurrentMarker(A),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target):this.setCurrentMarker()}},G.prototype.onPointerMove=function(x){this.touchPoints!==1&&x.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||x.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(x.clientX,x.clientY)):this.zoomLevel>1&&this.panTo({x:x.clientX,y:x.clientY}))},G.prototype.onPointerUp=function(x){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(x.clientX,x.clientY)),this.isDragging=!1,this.addUndoStep()},G.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},G.prototype.onKeyUp=function(x){this._currentMarker===void 0||this.notesArea!==void 0||x.key!=="Delete"&&x.key!=="Backspace"||this.deleteSelectedMarker()},G.prototype.clientToLocalCoordinates=function(x,A){var F=this.markerImage.getBoundingClientRect();return{x:(x-F.left)/this.zoomLevel,y:(A-F.top)/this.zoomLevel}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"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()},G.prototype.addLicenseKey=function(x){He.addKey(x)},G.prototype.addEventListener=function(x,A){this.eventListeners.addEventListener(x,A)},G.prototype.removeEventListener=function(x,A){this.eventListeners.removeEventListener(x,A)},G.prototype.renderState=function(x){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(x),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(G.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),G.prototype.focus=function(){var x=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(A){return A(new Wt(x))}))},G.prototype.blur=function(){var x=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(A){return A(new Wt(x))}))},G.instanceCounter=0,G}();/* **********************************
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 Yt=function(G,x){return(Yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,F){A.__proto__=F}||function(A,F){for(var q in F)Object.prototype.hasOwnProperty.call(F,q)&&(A[q]=F[q])})(G,x)};function cn(G,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");function A(){this.constructor=G}Yt(G,x),G.prototype=x===null?Object.create(x):(A.prototype=x.prototype,new A)}function jt(G,x,A,F){return new(A||(A=Promise))(function(q,z){function we(Dt){try{xt(F.next(Dt))}catch(ot){z(ot)}}function Ze(Dt){try{xt(F.throw(Dt))}catch(ot){z(ot)}}function xt(Dt){var ot;Dt.done?q(Dt.value):(ot=Dt.value,ot instanceof A?ot:new A(function(Kt){Kt(ot)})).then(we,Ze)}xt((F=F.apply(G,x||[])).next())})}function rn(G,x){var A,F,q,z,we={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:Ze(0),throw:Ze(1),return:Ze(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function Ze(xt){return function(Dt){return function(ot){if(A)throw new TypeError("Generator is already executing.");for(;we;)try{if(A=1,F&&(q=2&ot[0]?F.return:ot[0]?F.throw||((q=F.return)&&q.call(F),0):F.next)&&!(q=q.call(F,ot[1])).done)return q;switch(F=0,q&&(ot=[2&ot[0],q.value]),ot[0]){case 0:case 1:q=ot;break;case 4:return we.label++,{value:ot[1],done:!1};case 5:we.label++,F=ot[1],ot=[0];continue;case 7:ot=we.ops.pop(),we.trys.pop();continue;default:if(!(q=we.trys,(q=q.length>0&&q[q.length-1])||ot[0]!==6&&ot[0]!==2)){we=0;continue}if(ot[0]===3&&(!q||ot[1]>q[0]&&ot[1]<q[3])){we.label=ot[1];break}if(ot[0]===6&&we.label<q[1]){we.label=q[1],q=ot;break}if(q&&we.label<q[2]){we.label=q[2],we.ops.push(ot);break}q[2]&&we.ops.pop(),we.trys.pop();continue}ot=x.call(G,we)}catch(Kt){ot=[6,Kt],F=0}finally{A=q=0}if(5&ot[0])throw ot[1];return{value:ot[0]?ot[1]:void 0,done:!0}}([xt,Dt])}}}var kt=function(){function G(){}return G.addKey=function(x){G.key=x},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),Xe=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(x,A){for(var F=0,q=A;F<q.length;F++){var z=q[F],we=z[0],Ze=z[1];x.setAttribute(we,Ze)}},G.createRect=function(x,A,F){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",x.toString()),q.setAttribute("height",A.toString()),F&&G.setAttributes(q,F),q},G.createLine=function(x,A,F,q,z){var we=document.createElementNS("http://www.w3.org/2000/svg","line");return we.setAttribute("x1",x.toString()),we.setAttribute("y1",A.toString()),we.setAttribute("x2",F.toString()),we.setAttribute("y2",q.toString()),z&&G.setAttributes(we,z),we},G.createPolygon=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","polygon");return F.setAttribute("points",x),A&&G.setAttributes(F,A),F},G.createCircle=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","circle");return F.setAttribute("cx",(x/2).toString()),F.setAttribute("cy",(x/2).toString()),F.setAttribute("r",x.toString()),A&&G.setAttributes(F,A),F},G.createEllipse=function(x,A,F){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(x/2).toString()),q.setAttribute("cy",(A/2).toString()),q.setAttribute("rx",(x/2).toString()),q.setAttribute("ry",(A/2).toString()),F&&G.setAttributes(q,F),q},G.createGroup=function(x){var A=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&G.setAttributes(A,x),A},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(x,A,F,q,z,we,Ze){var xt=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(xt,[["id",x],["orient",A],["markerWidth",F.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",we.toString()]]),xt.appendChild(Ze),xt},G.createText=function(x){var A=document.createElementNS("http://www.w3.org/2000/svg","text");return A.setAttribute("x","0"),A.setAttribute("y","0"),x&&G.setAttributes(A,x),A},G.createTSpan=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","tspan");return F.textContent=x,A&&G.setAttributes(F,A),F},G.createImage=function(x){var A=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&G.setAttributes(A,x),A},G.createPoint=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return F.x=x,F.y=A,F},G.createPath=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg","path");return F.setAttribute("d",x),A&&G.setAttributes(F,A),F},G.createElement=function(x,A){var F=document.createElementNS("http://www.w3.org/2000/svg",x);return A&&G.setAttributes(F,A),F},G.getHollowRectanglePath=function(x,A,F,q,z,we,Ze,xt){return"M"+x+","+A+"V"+(A+q)+"H"+(x+F)+"V"+A+"H"+z+"V"+we+"H"+(z+Ze)+"V"+(we+xt)+"H"+z+"V"+A+"Z"},G}(),Lt=function(){function G(x){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),G.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},G.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},G.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).appendChild(this.styleSheet),this.addRule(new Ut("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Mt("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Mt("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},G.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),Ut=function(G,x){this.selector=G,this.style=x},Mt=function(G,x){this.localName=G,this.style=x},Zt=function(){function G(){this.blocks=[],this.display=""}return G.prototype.addButtonBlock=function(x){x.className=this.blockClassName,x.buttonClassName=this.buttonClassName,x.buttonColorsClassName=this.buttonColorsClassName,x.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(x)},G.prototype.addElementBlock=function(x){x.className===void 0&&(x.className=this.blockClassName),this.blocks.push(x)},G.prototype.getUI=function(){var x=document.createElement("div");return x.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,x.style.display=this.display,this.blocks.forEach(function(A){return x.appendChild(A.getUI())}),x},G}(),Ln=function(){function G(){}return G.prototype.getUI=function(){var x=document.createElement("div");if(x.className=this.className,this.minWidth!==void 0&&(x.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":x.style.justifyContent="flex-start";break;case"center":x.style.justifyContent="center";break;case"end":x.style.justifyContent="flex-end"}return x.style.whiteSpace="nowrap",x},G}(),Ni=function(G){function x(){var A=G!==null&&G.apply(this,arguments)||this;return A.buttons=[],A}return cn(x,G),x.prototype.addButton=function(A){A.className=this.buttonClassName,A.colorsClassName=this.buttonColorsClassName,A.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(A)},x.prototype.getUI=function(){var A=G.prototype.getUI.call(this);return this.buttons.forEach(function(F){return A.appendChild(F.getUI())}),A},x}(Ln),vn=function(){function G(x,A){this._isActive=!1,this._isHidden=!1,this._icon=x,this.title=A,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(G.prototype,"icon",{get:function(){return this._icon},set:function(x){this._icon=x,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isActive",{get:function(){return this._isActive},set:function(x){this._isActive=x,this.adjustClassName()},enumerable:!1,configurable:!0}),G.prototype.getUI=function(){var x=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 x.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},G.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,"")))},G.prototype.hide=function(){this._isHidden=!0},G}(),At=function(G){function x(){var A=G!==null&&G.apply(this,arguments)||this;return A.elements=[],A}return cn(x,G),x.prototype.addElement=function(A){this.elements.push(A)},x.prototype.getUI=function(){var A=G.prototype.getUI.call(this);return this.elements.forEach(function(F){return A.appendChild(F)}),A},x}(Ln),li=function(){function G(x,A){this.horizontal=x,this.vertical=A}return Object.defineProperty(G.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),G.prototype.getVerticalLength=function(x){return x/this.ratio},G.prototype.getHorizontalLength=function(x){return x*this.ratio},G}(),Li=function(){function G(){}return G.getIcon=function(x,A){if(x>0&&A>0){var F=new li(x,A),q=F.ratio>=1?20:F.getHorizontalLength(20),z=F.ratio<1?20:F.getVerticalLength(20),we=document.createElementNS("http://www.w3.org/2000/svg","svg");we.setAttribute("xmlns","http://www.w3.org/2000/svg"),we.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(we);var Ze=Xe.createDefs();we.appendChild(Ze);var xt=Xe.createElement("clipPath",[["id","text-bg-clip"]]);Ze.appendChild(xt);var Dt=Xe.createPath(Xe.getHollowRectanglePath((24-q)/2,(24-z)/2,q,z,(24-q)/2+2,(24-z)/2+2,q-4,z-4));we.appendChild(Dt);var ot=Xe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ot.appendChild(Xe.createTSpan(x+":"+A)),we.appendChild(ot);var Kt=ot.getBBox();Xe.setAttributes(ot,[["x",((24-Kt.width)/2).toString()],["y",((24-Kt.height)/2-Kt.y).toString()]]);var $t=Xe.createPath(Xe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Kt.width))/2,(24-Math.ceil(Kt.height))/2,Math.ceil(Kt.width),Math.ceil(Kt.height)));return xt.appendChild($t),Xe.setAttributes(Dt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(we),we.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>'},G}(),Zn=function(G){function x(A,F,q){var z=G.call(this,A,F)||this;return z.isDropdownOpen=!1,z.onClick=z.dropdownButtonClicked,z.dropdownButtons=q,z}return cn(x,G),x.prototype.setupDropdown=function(){var A=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(F){F.className=A.className,F.colorsClassName=A.colorsClassName,A.dropdownBlock.appendChild(F.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},x.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},x.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},x.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},x.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},x.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},x}(vn),an=function(){function G(x,A){this.GRIP_SIZE=10,this.color=x,this.fillColor=A,this.visual=Xe.createGroup(),this.visual.appendChild(Xe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Xe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},G.prototype.setCenter=function(x,A){this.visual.childNodes.forEach(function(F){return Xe.setAttributes(F,[["cx",x.toString()],["cy",A.toString()]])})},G}(),Qn=function(){function G(x,A,F,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=x,this.canvasHeight=A,this.margin=F,this.container=q,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(G.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(x){this._aspectRatio=x,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.gridContainer&&Xe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(x){this._zoomFactor=x,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),G.prototype.open=function(){var x=this;this.cropShadeElement=Xe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Xe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var A=0;A<this.numberOfGridLines;A++)this.horizontalGridLines.push(Xe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Xe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(F){return x.gridContainer.appendChild(F)}),this.verticalGridLines.forEach(function(F){return x.gridContainer.appendChild(F)}),this.cropRectElement=Xe.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new an(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new an(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new an(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new an(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},G.prototype.setCropRectangle=function(x){this.cropRect=x;var A=Object.assign({},this.cropRect);this.zoomFactor!==1&&(A.width=this.cropRect.width*this.zoomFactor,A.height=this.cropRect.height*this.zoomFactor,A.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-A.width/2,A.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-A.height/2),Xe.setAttributes(this.cropRectElement,[["x",A.x.toString()],["y",A.y.toString()],["width",A.width.toString()],["height",A.height.toString()]]);var F=A.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(z,we){var Ze=A.y+F*(we+1);Xe.setAttributes(z,[["x1",""+A.x],["y1",""+Ze],["x2",""+(A.x+A.width)],["y2",""+Ze]])});var q=A.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(z,we){var Ze=A.x+q*(we+1);Xe.setAttributes(z,[["x1",""+Ze],["y1",""+A.y],["x2",""+Ze],["y2",""+(A.y+A.height)]])}),Xe.setAttributes(this.cropShadeElement,[["d",Xe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,A.x,A.y,A.width,A.height)]]),this.topLeftGrip.setCenter(A.x,A.y),this.topRightGrip.setCenter(A.x+A.width,A.y),this.bottomLeftGrip.setCenter(A.x,A.y+A.height),this.bottomRightGrip.setCenter(A.x+A.width,A.y+A.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},G.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)},G.prototype.clientToLocalCoordinates=function(x,A){var F=this.container.getBoundingClientRect();return{x:x-F.left+this.margin,y:A-F.top+this.margin}},G.prototype.onPointerDown=function(x){this.container.setPointerCapture(x.pointerId),this.previousPoint=this.clientToLocalCoordinates(x.clientX,x.clientY),this.cropRectElement===x.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(x.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(x.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(x.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(x.target)&&(this.activeGrip=this.bottomRightGrip)},G.prototype.onPointerMove=function(x){if(this.isMoving)this.move(this.clientToLocalCoordinates(x.clientX,x.clientY));else if(this.activeGrip){var A=this.clientToLocalCoordinates(x.clientX,x.clientY);this.resize(A)}x.preventDefault()},G.prototype.onPointerUp=function(x){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(x.pointerId)},G.prototype.move=function(x){var A=x.x-this.previousPoint.x,F=x.y-this.previousPoint.y;this.zoomFactor!==1&&(A=-A/this.zoomFactor,F=-F/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+A),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+F),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=x},G.prototype.resize=function(x){var A=Object.assign({},this.cropRect),F=x.x-this.previousPoint.x,q=x.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:A.x+F<this.margin&&(F=this.margin-A.x),A.x+=F,A.width=this.cropRect.x+this.cropRect.width-A.x;break;case this.bottomRightGrip:case this.topRightGrip:A.width+F>this.canvasWidth*this.zoomFactor&&(F=this.canvasWidth*this.zoomFactor-A.width),A.width+=F}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(A.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(F),A.height=this.aspectRatio.getVerticalLength(A.width)):(A.y+=q,A.height=this.cropRect.y+this.cropRect.height-A.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?A.height=this.aspectRatio.getVerticalLength(A.width):A.height+=q}A.width<10&&(A.x=this.cropRect.x,A.width=10),A.height<10&&(A.y=this.cropRect.y,A.height=10),this.previousPoint=x,A.x>=this.margin&&A.y>=this.margin&&A.x-this.margin+A.width<=this.canvasWidth&&A.y-this.margin+A.height<=this.canvasHeight&&(this.cropRect=A,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},G.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var x=this.cropRect.x+this.cropRect.width/2,A=this.cropRect.y+this.cropRect.height/2,F=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);F/this.canvasWidth<q/this.canvasHeight?this.cropRect.width=F:this.cropRect.height=q,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=x-this.cropRect.width/2,this.cropRect.y=A-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)}},G.prototype.getRescaledRect=function(x,A,F,q,z,we){var Ze=F/x,xt=q/A;return{x:(z.x-we)*Ze+we,y:(z.y-we)*xt+we,width:z.width*Ze,height:z.height*xt}},G.prototype.scaleCanvas=function(x,A){var F=this.getRescaledRect(this.canvasWidth,this.canvasHeight,x,A,this.cropRect,this.margin);this.canvasWidth=x,this.canvasHeight=A,this.onCropChange&&this.onCropChange(F),this.setCropRectangle(F)},G}(),Ii=function(){function G(x){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=x,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(G.prototype,"angle",{get:function(){return this._angle},set:function(x){this._angle=x,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),G.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},G.prototype.onPointerDown=function(x){this.controlContainer.setPointerCapture(x.pointerId),this.isDragging=!0,this.previousPoint={x:x.clientX,y:x.clientY}},G.prototype.onPointerMove=function(x){this.isDragging&&(this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.previousPoint.x=x.clientX)},G.prototype.onPointerUp=function(x){this.isDragging&&this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(x.pointerId)},G.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var x=this.angleLabelText.getBBox();Xe.setAttributes(this.angleLabelElement,[["x",((this.width-x.width)/2).toString()],["y",(this.height/2).toString()]])}},G.prototype.positionScaleShape=function(){if(this.scaleShape){var x=this.scaleShape.transform.baseVal.getItem(0);x.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(x,0)}},G.prototype.getVisual=function(){var x=document.createElementNS("http://www.w3.org/2000/svg","svg");x.setAttribute("xmlns","http://www.w3.org/2000/svg"),x.setAttribute("width",this.width+"px"),x.setAttribute("height",this.height+"px"),x.setAttribute("viewBox","0 0 "+this.width+" "+this.height),x.style.flexShrink="0",document.body.appendChild(x);for(var A="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,F=1;F<=this.width/5+10;F++){var q=F%5==0?this.height/3:this.height/6;A+="h4v"+-q+"h1v"+q}A+="v1H0Z",this.scaleShape=Xe.createPath(A);var z=Xe.createTransform();this.scaleShape.transform.baseVal.appendItem(z),x.appendChild(this.scaleShape),this.angleLabelElement=Xe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Xe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var we=Xe.createTSpan("");return we.innerHTML="&deg;",this.angleLabelElement.appendChild(we),x.appendChild(this.angleLabelElement),document.body.removeChild(x),x},G}(),Ui=function(){function G(){this.naturalSize=!1,this.imageType="image/png"}return G.prototype.rasterize=function(x,A,F,q,z,we,Ze){var xt=this;return new Promise(function(Dt){var ot=document.createElement("canvas");ot.width=x.width.baseVal.value-2*q,ot.height=x.height.baseVal.value-2*q;var Kt=1,$t=1;xt.naturalSize===!0?(Kt=A.naturalWidth/(x.width.baseVal.value-2*q)/we,$t=A.naturalHeight/(x.height.baseVal.value-2*q)/Ze,ot.width=A.naturalWidth/we,ot.height=A.naturalHeight/Ze):xt.width!==void 0&&xt.height!==void 0&&(Kt=xt.width/F.width,$t=xt.height/F.height,ot.width*=Kt,ot.height*=$t);var Pn=ot.getContext("2d");Pn.translate(ot.width/2,ot.height/2),Pn.rotate(z*Math.PI/180),Pn.scale(we,Ze),Pn.translate(-ot.width/2,-ot.height/2),Pn.drawImage(A,0,0,ot.width,ot.height);var yi=document.createElement("canvas");yi.width=F.width*Kt,yi.height=F.height*$t,yi.getContext("2d").putImageData(Pn.getImageData((F.x-q)*Kt,(F.y-q)*$t,F.width*Kt,F.height*$t),0,0),Dt(yi.toDataURL(xt.imageType,xt.imageQuality))})},G}(),ht=function(){function G(x){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=G.instanceCounter++,this.styles=new Lt(this.instanceNo),this.target=x,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(x){this._zoomToCropEnabled=x,x?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"gridLines",{get:function(){return this._gridLines},set:function(x){this._gridLines=x,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(x){this._rotationAngle=x,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"aspectRatio",{get:function(){var x;return(x=this._aspectRatio)!==null&&x!==void 0?x:this.aspectRatios[0]},set:function(x){this._aspectRatio=x},enumerable:!1,configurable:!0}),G.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},G.prototype.show=function(){this.showUI(),this.open()},G.prototype.close=function(x){x===void 0&&(x=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),x||this.closeEventListeners.forEach(function(A){return A()}),this._isOpen=!1)},G.prototype.addRenderEventListener=function(x){this.renderEventListeners.push(x)},G.prototype.removeRenderEventListener=function(x){this.renderEventListeners.indexOf(x)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(x),1)},G.prototype.addCloseEventListener=function(x){this.closeEventListeners.push(x)},G.prototype.removeCloseEventListener=function(x){this.closeEventListeners.indexOf(x)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(x),1)},G.prototype.setupResizeObserver=function(){var x=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.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))},G.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var x=1*this.target.clientWidth/this.target.clientHeight,A=this.contentDiv.clientWidth/x>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*x:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,F=A+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/x;this.resize(A,F)}},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.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",Xe.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},G.prototype.resize=function(x,A){this.imageWidth=Math.round(x),this.imageHeight=Math.round(A),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()},G.prototype.setEditingTarget=function(){var x=document.createElement("canvas");x.width=this.target.naturalWidth,x.height=this.target.naturalHeight,x.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var A=x.toDataURL();Xe.setAttributes(this.editingTarget,[["href",A]]),this.setEditingTargetSize()},G.prototype.setTopLeft=function(){var x=this.target.getBoundingClientRect(),A=this.editorCanvas.getBoundingClientRect();this.left=x.left-A.left-this.CANVAS_MARGIN,this.top=x.top-A.top-this.CANVAS_MARGIN},G.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=Xe.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Xe.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Xe.createGroup(),this.editingTargetRotationScaleContainer=Xe.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var x=Xe.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(x);var A=Xe.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(A),this.editingTargetContainer=Xe.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)},G.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},G.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Xe.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Qn(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()},G.prototype.zoomToCrop=function(){if(this.cropRect){var x=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,A=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=x+"px "+A+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-x+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-A+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},G.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)},G.prototype.cropRectChanged=function(x){this.cropRect=x,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},G.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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 x=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,A=this.target.offsetTop>x+this.CANVAS_MARGIN?this.target.offsetTop-(x+this.CANVAS_MARGIN):0;this.coverDiv.style.top=A+"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},G.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},G.prototype.addTopToolbar=function(){var x=this;this.topToolbar=new Zt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var A=new Ni;A.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(A);var F=[];this.aspectRatios.forEach(function($t){var Pn=new vn(Li.getIcon($t.horizontal,$t.vertical),$t.horizontal===0&&$t.vertical===0?"FREE":$t.horizontal+":"+$t.vertical);Pn.onClick=function(){return x.ratioButtonClicked($t)},F.push(Pn)}),this.aspectRatioButton=new Zn(Li.getIcon(0,0),"Aspect ratio",F),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,A.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new vn('<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");q.isActive=this.isGridVisible,q.onClick=function(){x.isGridVisible=!x.isGridVisible,q.isActive=x.isGridVisible},A.addButton(q);var z=new vn('<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(z.isActive=this.zoomToCropEnabled,z.onClick=function(){x.zoomToCropEnabled=!x.zoomToCropEnabled,z.isActive=x.zoomToCropEnabled},A.addButton(z),!kt.isLicensed){var we=new At;this.topToolbar.addElementBlock(we);var Ze=document.createElement("div");Ze.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var xt=document.createElement("a");xt.style.color="currentColor",xt.href="https://markerjs.com/products/cropro",xt.target="_blank",xt.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(xt),we.addElement(Ze)}var Dt=new Ni;Dt.minWidth=3*this.toolbarHeight+"px",Dt.contentAlign="end",this.topToolbar.addButtonBlock(Dt);var ot=new vn('<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");ot.onClick=this.startRenderAndClose,Dt.addButton(ot),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ot.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Kt=new vn('<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");Kt.onClick=this.close,Dt.addButton(Kt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Kt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},G.prototype.addBottomToolbar=function(){var x=this;this.bottomToolbar=new Zt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var A=new Ni;A.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(A);var F=new vn('<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");F.onClick=this.rotateLeftButtonClicked,A.addButton(F);var q=new vn('<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");q.onClick=this.rotateRightButtonClicked,A.addButton(q);var z=new At;z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(z),this.straightener=new Ii("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(Dt){x.rotateBy(Dt),x.straightener.angle=x.rotationAngle},z.addElement(this.straightener.getUI());var we=new Ni;we.minWidth=2*this.toolbarHeight+"px",we.contentAlign="end",this.bottomToolbar.addButtonBlock(we);var Ze=new vn('<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,we.addButton(Ze);var xt=new vn('<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");xt.onClick=this.flipVerticallyButtonClicked,we.addButton(xt)},G.prototype.ratioButtonClicked=function(x){this.aspectRatio=x,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},G.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Li.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},G.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new li(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},G.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},G.prototype.restoreState=function(x){if(x){var A=this.cropLayer.getRescaledRect(x.width,x.height,this.imageWidth,this.imageHeight,x.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(A),this.cropRectChanged(A),this.flippedHorizontally=x.flippedHorizontally,this.flippedVertically=x.flippedVertically,this.applyFlip(),this.rotationAngle=x.rotationAngle,this.applyRotation()}},G.prototype.clientToLocalCoordinates=function(x,A){var F=this.cropImage.getBoundingClientRect();return{x:x-F.left,y:A-F.top}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var x=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=x+"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()},G.prototype.rotateLeftButtonClicked=function(){var x=this.rotationAngle-90;this.rotationAngle%90!=0&&(x+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(x)},G.prototype.rotateRightButtonClicked=function(){var x=this.rotationAngle+90;this.rotationAngle%90!=0&&(x-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(x)},G.prototype.rotateTo=function(x){x=(x=x>180?x-360:x)<=-180?x+360:x,this.rotationAngle=x,this.applyRotation()},G.prototype.rotateBy=function(x){this.rotateTo((this.rotationAngle+x)%360)},G.prototype.applyRotation=function(){var x=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var A=this.editingTargetRotationContainer.transform.baseVal.getItem(0);A.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(A,0);var F=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/F.width,this.imageHeight/F.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=x},G.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},G.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},G.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},G.prototype.startRenderAndClose=function(){return jt(this,void 0,void 0,function(){var x,A;return rn(this,function(F){switch(F.label){case 0:return[4,this.render()];case 1:return x=F.sent(),A=this.getState(),this.renderEventListeners.forEach(function(q){return q(x,A)}),this.close(!0),[2]}})})},G.prototype.render=function(){return jt(this,void 0,void 0,function(){var x;return rn(this,function(A){switch(A.label){case 0:return(x=new Ui).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.width=this.renderWidth,x.height=this.renderHeight,this.unzoomFromCrop(),Xe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,x.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 A.sent(),[4,x.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,A.sent()]}})})},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Mt("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 Mt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Mt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var x=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Mt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*x)+`px;
height: `+(this.toolbarHeight-2*x)+`px;
padding: `+x+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Mt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Mt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Ut("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ut("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Mt("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 Mt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Mt("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 Mt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*x)+`px;
padding: `+x+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Mt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},G.instanceCounter=0,G}(),zt=Q("8hTe"),Di=Q.n(zt),Hi=/<pre[^>]*>/g;function ir(G){var x=document.createElement("div");return x.innerHTML=G,x.childNodes.length===0?"":x.childNodes[0].nodeValue}var Wi=$e.a=function(G){var x=G.value,A=x===void 0?"":x,F=G.edit,q=F===void 0?!1:F,z=G.className,we=G.showTextOnly,Ze=G.showLines,xt=G.replaces,Dt=G.zoomImg,ot=G.hasMask,Kt=G.style,$t=Kt===void 0?{}:Kt,Pn=G.stylesPrev,yi=Pn===void 0?{}:Pn,fi=String(A),Vn=Object(I.useRef)(),rr=Object(I.useRef)(),wr=Object(I.useState)(""),ii=Object(H.a)(wr,2),Ki=ii[0],yr=ii[1],ar=Object(I.useState)("office"),bi=Object(H.a)(ar,2),Rr=bi[0],Sr=bi[1],Ar=function(){var on=new ht(rr.current);on.displayMode="popup",on.addRenderEventListener(function(){var Wn=Object(M.a)(k.a.mark(function ln(Xn){var Cn;return k.a.wrap(function(di){for(;;)switch(di.prev=di.next){case 0:return Vn.current.style.display="none",di.next=3,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Xn}});case 3:Cn=di.sent,Cn!=null&&Cn.id&&xt(rr.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(Cn==null?void 0:Cn.id,"?type=").concat(Cn.content_type));case 5:case"end":return di.stop()}},ln)}));return function(ln){return Wn.apply(this,arguments)}}()),on.show()},Nr=function(){var on=new Jt(rr.current);on.settings.displayMode="popup",on.addEventListener("render",function(){var Wn=Object(M.a)(k.a.mark(function ln(Xn){var Cn;return k.a.wrap(function(di){for(;;)switch(di.prev=di.next){case 0:if(Vn.current.style.display="none",!rr.current){di.next=6;break}return di.next=4,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Xn.dataUrl}});case 4:Cn=di.sent,Cn!=null&&Cn.id&&xt(rr.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(Cn==null?void 0:Cn.id,"?type=").concat(Cn.content_type));case 6:case"end":return di.stop()}},ln)}));return function(ln){return Wn.apply(this,arguments)}}()),on.show(),window.markerArea=on},or=Object(I.useMemo)(function(){Vn.current&&(Vn.current.style.zIndex=-1);try{var In=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,on=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Wn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;fi=fi.replace(In,"("+te.a.API_SERVER+"/api/attachments/").replace(on,'"'+te.a.API_SERVER+"/api/attachments/").replace(Wn,'"'+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(sr){}var ln=Y(fi),Xn=_();if(fi.match(/\[TOC\]/)&&(ln=ln.replace("<p>[TOC]</p>",C()),O()),ln=ln.replace(/(__special_katext_id_\d+__)/g,function(sr,di){var _i=Xn[di],Cr=_i.type,lr=_i.expression;return Object(ue.renderToString)(ir(lr)||"",{displayMode:Cr==="block",throwOnError:!1,output:"html"})}),ln=ln.replace(/▁/g,"\u2581\u2581\u2581"),m(),we){var Cn=document.createElement("div");return Cn.innerHTML=ln,Cn.innerText}return setTimeout(function(){return Ur()},500),ln},[fi]),ui=Object(I.useRef)();S.WebkitLineClamp=Ze,Ze&&($t=Object(L.a)(Object(L.a)({},$t),S));function pr(In){var on=In.target;if(on.tagName.toUpperCase()==="IMG"){if(Dt){var Wn=on.getAttribute("src");yr(Wn),Sr("image")}}else if(on.tagName.toUpperCase()==="A"){var ln=on.getAttribute("href");if(ln.indexOf("office")>-1)In.preventDefault(),yr(ln),Sr("office");else if(ln.indexOf("application/pdf")>-1)In.preventDefault(),yr(ln),Sr("pdf");else if(ln.indexOf("text/html")>-1)In.preventDefault(),yr(ln),Sr("html");else if(ln.startsWith("#")){In.preventDefault();var Xn=document.getElementById(ln.replace("#",""));Xn&&Xn.scrollIntoView(!0)}}}var Ur=function(){var on,Wn=(on=ui.current)===null||on===void 0?void 0:on.querySelectorAll("video");Wn==null||Wn.forEach(function(ln){if(ln.oncontextmenu=function(){return!1},ln.src.indexOf(".m3u8")>-1&&!ln.canPlayType("application/vnd.apple.mpegurl")){if($.a.isSupported()){var Xn=new $.a;Xn.loadSource(ln.src),Xn.attachMedia(ln)}}})};Object(I.useEffect)(function(){if(ui.current&&or&&(or.match(Hi)&&window.PR.prettyPrint()),ui.current)return ui.current.addEventListener("click",pr),function(){ui.current.removeEventListener("click",pr),m(),O()}},[or,ui.current,pr]);var mr=function(on){if(!q)return;on.target.nodeName==="IMG"?(Vn.current.style.zIndex=1,Vn.current.style.display="flex",Vn.current.style.width=on.target.clientWidth+"px",Vn.current.style.height=on.target.clientHeight+"px",Vn.current.style.top=on.target.offsetTop+"px",Vn.current.style.left=on.target.offsetLeft+"px",rr.current.src=on.target.getAttribute("src")):Vn.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:ui,style:Object(L.a)({},$t),className:"".concat(z||""," markdown-body ").concat(Di.a.mdBody),onMouseOver:mr,dangerouslySetInnerHTML:{__html:or}}),b.a.createElement("div",{ref:Vn,className:Di.a.button},b.a.createElement(X.a,null,b.a.createElement(V.a,{onClick:function(){return Ar()}},"\u88C1\u526A"),b.a.createElement(V.a,{onClick:function(){return Nr()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:rr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(me.a,{close:!0,data:Ki,type:Ki!=null&&Ki.length?Rr:"",style:Object(L.a)({},yi),onClose:function(){return yr("")}}))}},"9VGf":function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return P});var ae=Q("q1tI"),X=Q.n(ae);function P(V,L){var M=Object(ae.useRef)();Object(ae.useEffect)(function(){M.current=V}),Object(ae.useEffect)(function(){function H(){M.current()}if(L!==null){var U=setInterval(H,L);return function(){return clearInterval(U)}}},[L])}},BU3w:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return M});var ae=Q("MNnm"),X="rc-util-key";function P(H){if(H.attachTo)return H.attachTo;var U=document.querySelector("head");return U||document.body}function V(H){var U,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ae.a)())return null;var I=document.createElement("style");if((U=k.csp)===null||U===void 0?void 0:U.nonce){var b;I.nonce=(b=k.csp)===null||b===void 0?void 0:b.nonce}I.innerHTML=H;var y=P(k),p=y.firstChild;return k.prepend&&y.prepend?y.prepend(I):k.prepend&&p?y.insertBefore(I,p):y.appendChild(I),I}var L=new Map;function M(H,U){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=P(k);if(!L.has(I)){var b=V("",k),y=b.parentNode;L.set(I,y),y.removeChild(b)}var p=Array.from(L.get(I).children).find(function(a){return a.tagName==="STYLE"&&a[X]===U});if(p){var c,r;if(((c=k.csp)===null||c===void 0?void 0:c.nonce)&&p.nonce!==((r=k.csp)===null||r===void 0?void 0:r.nonce)){var l;p.nonce=(l=k.csp)===null||l===void 0?void 0:l.nonce}return p.innerHTML!==H&&(p.innerHTML=H),p}var u=V(H,k);return u[X]=U,u}},Bd2K:function(Rt,$e,Q){(function(ae){ae(Q("VrN/"),Q("osHv"))})(function(ae){ae.defineOption("autoCloseTags",!1,function(k,I,b){if(b!=ae.Init&&b&&k.removeKeyMap("autoCloseTags"),!I)return;var y={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(y["'/'"]=function(p){return M(p)}),(typeof I!="object"||I.whenOpening!==!1)&&(y["'>'"]=function(p){return V(p)}),k.addKeyMap(y)});var X=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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 V(k){if(k.getOption("disableInput"))return ae.Pass;for(var I=k.listSelections(),b=[],y=k.getOption("autoCloseTags"),p=0;p<I.length;p++){if(!I[p].empty())return ae.Pass;var c=I[p].head,r=k.getTokenAt(c),l=ae.innerMode(k.getMode(),r.state),u=l.state,a=l.mode.xmlCurrentTag&&l.mode.xmlCurrentTag(u),s=a&&a.name;if(!s)return ae.Pass;var f=l.mode.configuration=="html",O=typeof y=="object"&&y.dontCloseTags||f&&X,S=typeof y=="object"&&y.indentTags||f&&P;r.end>c.ch&&(s=s.slice(0,s.length-r.end+c.ch));var E=s.toLowerCase();if(!s||r.type=="string"&&(r.end!=c.ch||!/[\"\']/.test(r.string.charAt(r.string.length-1))||r.string.length==1)||r.type=="tag"&&a.close||r.string.indexOf("/")==c.ch-r.start-1||O&&H(O,E)>-1||U(k,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(u)||[],s,c,!0))return ae.Pass;var C=typeof y=="object"&&y.emptyTags;if(C&&H(C,s)>-1){b[p]={text:"/>",newPos:ae.Pos(c.line,c.ch+2)};continue}var w=S&&H(S,E)>-1;b[p]={indent:w,text:">"+(w?`
`:"")+"</"+s+">",newPos:w?ae.Pos(c.line+1,0):ae.Pos(c.line,c.ch+1)}}for(var g=typeof y=="object"&&y.dontIndentOnAutoClose,p=I.length-1;p>=0;p--){var v=b[p];k.replaceRange(v.text,I[p].head,I[p].anchor,"+insert");var h=k.listSelections().slice(0);h[p]={head:v.newPos,anchor:v.newPos},k.setSelections(h),!g&&v.indent&&(k.indentLine(v.newPos.line,null,!0),k.indentLine(v.newPos.line+1,null,!0))}}function L(k,I){for(var b=k.listSelections(),y=[],p=I?"/":"</",c=k.getOption("autoCloseTags"),r=typeof c=="object"&&c.dontIndentOnSlash,l=0;l<b.length;l++){if(!b[l].empty())return ae.Pass;var u=b[l].head,a=k.getTokenAt(u),s=ae.innerMode(k.getMode(),a.state),f=s.state;if(I&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=u.ch-1))return ae.Pass;var O,S=s.mode.name!="xml"&&k.getMode().name=="htmlmixed";if(S&&s.mode.name=="javascript")O=p+"script";else if(S&&s.mode.name=="css")O=p+"style";else{var E=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(f);if(!E||E.length&&U(k,E,E[E.length-1],u))return ae.Pass;O=p+E[E.length-1]}k.getLine(u.line).charAt(a.end)!=">"&&(O+=">"),y[l]=O}if(k.replaceSelections(y),b=k.listSelections(),!r)for(var l=0;l<b.length;l++)(l==b.length-1||b[l].head.line<b[l+1].head.line)&&k.indentLine(b[l].head.line)}function M(k){return k.getOption("disableInput")?ae.Pass:L(k,!0)}ae.commands.closeTag=function(k){return L(k)};function H(k,I){if(k.indexOf)return k.indexOf(I);for(var b=0,y=k.length;b<y;++b)if(k[b]==I)return b;return-1}function U(k,I,b,y,p){if(!ae.scanForClosingTag)return!1;var c=Math.min(k.lastLine()+1,y.line+500),r=ae.scanForClosingTag(k,y,null,c);if(!r||r.tag!=b)return!1;for(var l=p?1:0,u=I.length-1;u>=0&&I[u]==b;u--)++l;y=r.to;for(var u=1;u<l;u++){var a=ae.scanForClosingTag(k,y,null,c);if(!a||a.tag!=b)return!1;y=a.to}return!0}})},BjJ7:function(Rt,$e,Q){"use strict";Q.d($e,"d",function(){return X}),Q.d($e,"c",function(){return P}),Q.d($e,"e",function(){return V}),Q.d($e,"b",function(){return L}),Q.d($e,"a",function(){return H});var ae=Q("m3rI");function X(U){var k=!0;if(U.length>0){for(var I=0;I<U.length;I++)if(U[I].compile_success==0||!U[I].compile_success){k=!1;break}}else k=!1;return k}function P(U){for(var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],b=0;b<U.length;b++){var y=U[b],p=k?"".concat(k,"/").concat(y.name):"".concat(y.name);I.push({title:y.name,isLeaf:!(y.type==="tree"),key:p})}return I}function V(U,k,I){for(var b=0;b<U.length;b++){var y=U[b];if(y.key===k){y.children=I;break}y.children&&V(y.children,k,I)}return U}function L(U,k,I){var b;return function(){var y=this,p=arguments,c=function(){b=null,I||U.apply(y,p)},r=I&&!b;clearTimeout(b),b=setTimeout(c,k),r&&U.apply(y,p)}}var M=!0,H=ae.a.API_SERVER},"C+DQ":function(Rt,$e,Q){},DlQD:function(Rt,$e,Q){(function(ae,X){Rt.exports=X()})(this,function(){"use strict";function ae(ve,ce){for(var he=0;he<ce.length;he++){var ne=ce[he];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(ve,ne.key,ne)}}function X(ve,ce,he){return ce&&ae(ve.prototype,ce),he&&ae(ve,he),ve}function P(ve,ce){if(!ve)return;if(typeof ve=="string")return V(ve,ce);var he=Object.prototype.toString.call(ve).slice(8,-1);if(he==="Object"&&ve.constructor&&(he=ve.constructor.name),he==="Map"||he==="Set")return Array.from(ve);if(he==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(he))return V(ve,ce)}function V(ve,ce){(ce==null||ce>ve.length)&&(ce=ve.length);for(var he=0,ne=new Array(ce);he<ce;he++)ne[he]=ve[he];return ne}function L(ve,ce){var he;if(typeof Symbol=="undefined"||ve[Symbol.iterator]==null){if(Array.isArray(ve)||(he=P(ve))||ce&&ve&&typeof ve.length=="number"){he&&(ve=he);var ne=0;return function(){return ne>=ve.length?{done:!0}:{done:!1,value:ve[ne++]}}}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 he=ve[Symbol.iterator](),he.next.bind(he)}function M(ve,ce){return ce={exports:{}},ve(ce,ce.exports),ce.exports}var H=M(function(ve){function ce(){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 he(ne){ve.exports.defaults=ne}ve.exports={defaults:ce(),getDefaults:ce,changeDefaults:he}}),U=H.defaults,k=H.getDefaults,I=H.changeDefaults,b=/[&<>"']/,y=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=function(ce){return r[ce]};function u(ve,ce){if(ce){if(b.test(ve))return ve.replace(y,l)}else if(p.test(ve))return ve.replace(c,l);return ve}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(ve){return ve.replace(a,function(ce,he){return he=he.toLowerCase(),he==="colon"?":":he.charAt(0)==="#"?he.charAt(1)==="x"?String.fromCharCode(parseInt(he.substring(2),16)):String.fromCharCode(+he.substring(1)):""})}var f=/(^|[^\[])\^/g;function O(ve,ce){ve=ve.source||ve,ce=ce||"";var he={replace:function(oe,le){return le=le.source||le,le=le.replace(f,"$1"),ve=ve.replace(oe,le),he},getRegex:function(){return new RegExp(ve,ce)}};return he}var S=/[^\w:]/g,E=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(ve,ce,he){if(ve){var ne;try{ne=decodeURIComponent(s(he)).replace(S,"").toLowerCase()}catch(oe){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}ce&&!E.test(he)&&(he=o(ce,he));try{he=encodeURI(he).replace(/%25/g,"%")}catch(oe){return null}return he}var w={},g=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(ve,ce){w[" "+ve]||(g.test(ve)?w[" "+ve]=ve+"/":w[" "+ve]=N(ve,"/",!0)),ve=w[" "+ve];var he=ve.indexOf(":")===-1;return ce.substring(0,2)==="//"?he?ce:ve.replace(v,"$1")+ce:ce.charAt(0)==="/"?he?ce:ve.replace(h,"$1")+ce:ve+ce}var _={exec:function(){}};function m(ve){for(var ce=1,he,ne;ce<arguments.length;ce++){he=arguments[ce];for(ne in he)Object.prototype.hasOwnProperty.call(he,ne)&&(ve[ne]=he[ne])}return ve}function T(ve,ce){var he=ve.replace(/\|/g,function(le,pe,ge){for(var Pe=!1,Ge=pe;--Ge>=0&&ge[Ge]==="\\";)Pe=!Pe;return Pe?"|":" |"}),ne=he.split(/ \|/),oe=0;if(ne.length>ce)ne.splice(ce);else for(;ne.length<ce;)ne.push("");for(;oe<ne.length;oe++)ne[oe]=ne[oe].trim().replace(/\\\|/g,"|");return ne}function N(ve,ce,he){var ne=ve.length;if(ne===0)return"";for(var oe=0;oe<ne;){var le=ve.charAt(ne-oe-1);if(le===ce&&!he)oe++;else if(le!==ce&&he)oe++;else break}return ve.substr(0,ne-oe)}function j(ve,ce){if(ve.indexOf(ce[1])===-1)return-1;for(var he=ve.length,ne=0,oe=0;oe<he;oe++)if(ve[oe]==="\\")oe++;else if(ve[oe]===ce[0])ne++;else if(ve[oe]===ce[1]&&(ne--,ne<0))return oe;return-1}function W(ve){ve&&ve.sanitize&&!ve.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 Y={escape:u,unescape:s,edit:O,cleanUrl:C,resolveUrl:o,noopTest:_,merge:m,splitCells:T,rtrim:N,findClosingBracket:j,checkSanitizeDeprecation:W},B=H.defaults,R=Y.rtrim,$=Y.splitCells,te=Y.escape,ue=Y.findClosingBracket;function me(ve,ce,he){var ne=ce.href,oe=ce.title?te(ce.title):null,le=ve[1].replace(/\\([\[\]])/g,"$1");return ve[0].charAt(0)!=="!"?{type:"link",raw:he,href:ne,title:oe,text:le}:{type:"image",raw:he,href:ne,title:oe,text:te(le)}}function Me(ve,ce){var he=ve.match(/^(\s+)(?:```)/);if(he===null)return ce;var ne=he[1];return ce.split(`
`).map(function(oe){var le=oe.match(/^\s+/);if(le===null)return oe;var pe=le[0];return pe.length>=ne.length?oe.slice(ne.length):oe}).join(`
`)}var Ae=function(){function ve(he){this.options=he||B}var ce=ve.prototype;return ce.space=function(ne){var oe=this.rules.block.newline.exec(ne);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
`}},ce.code=function(ne,oe){var le=this.rules.block.code.exec(ne);if(le){var pe=oe[oe.length-1];if(pe&&pe.type==="paragraph")return{raw:le[0],text:le[0].trimRight()};var ge=le[0].replace(/^ {4}/gm,"");return{type:"code",raw:le[0],codeBlockStyle:"indented",text:this.options.pedantic?ge:R(ge,`
`)}}},ce.fences=function(ne){var oe=this.rules.block.fences.exec(ne);if(oe){var le=oe[0],pe=Me(le,oe[3]||"");return{type:"code",raw:le,lang:oe[2]?oe[2].trim():oe[2],text:pe}}},ce.heading=function(ne){var oe=this.rules.block.heading.exec(ne);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},ce.nptable=function(ne){var oe=this.rules.block.nptable.exec(ne);if(oe){var le={type:"table",header:$(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[],raw:oe[0]};if(le.header.length===le.align.length){var pe=le.align.length,ge;for(ge=0;ge<pe;ge++)/^ *-+: *$/.test(le.align[ge])?le.align[ge]="right":/^ *:-+: *$/.test(le.align[ge])?le.align[ge]="center":/^ *:-+ *$/.test(le.align[ge])?le.align[ge]="left":le.align[ge]=null;for(pe=le.cells.length,ge=0;ge<pe;ge++)le.cells[ge]=$(le.cells[ge],le.header.length);return le}}},ce.hr=function(ne){var oe=this.rules.block.hr.exec(ne);if(oe)return{type:"hr",raw:oe[0]}},ce.blockquote=function(ne){var oe=this.rules.block.blockquote.exec(ne);if(oe){var le=oe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:oe[0],text:le}}},ce.list=function(ne){var oe=this.rules.block.list.exec(ne);if(oe){for(var le=oe[0],pe=oe[2],ge=pe.length>1,Pe=pe[pe.length-1]===")",Ge={type:"list",raw:le,ordered:ge,start:ge?+pe.slice(0,-1):"",loose:!1,items:[]},rt=oe[0].match(this.rules.block.item),vt=!1,tt,Wt,Nt,_t,Qt,Jt,Yt,cn=rt.length,jt=0;jt<cn;jt++)tt=rt[jt],le=tt,Wt=tt.length,tt=tt.replace(/^ *([*+-]|\d+[.)]) */,""),~tt.indexOf(`
`)&&(Wt-=tt.length,tt=this.options.pedantic?tt.replace(/^ {1,4}/gm,""):tt.replace(new RegExp("^ {1,"+Wt+"}","gm"),"")),jt!==cn-1&&(Nt=this.rules.block.bullet.exec(rt[jt+1])[0],(ge?Nt.length===1||!Pe&&Nt[Nt.length-1]===")":Nt.length>1||this.options.smartLists&&Nt!==pe)&&(_t=rt.slice(jt+1).join(`
`),Ge.raw=Ge.raw.substring(0,Ge.raw.length-_t.length),jt=cn-1)),Qt=vt||/\n\n(?!\s*$)/.test(tt),jt!==cn-1&&(vt=tt.charAt(tt.length-1)===`
`,Qt||(Qt=vt)),Qt&&(Ge.loose=!0),Jt=/^\[[ xX]\] /.test(tt),Yt=void 0,Jt&&(Yt=tt[1]!==" ",tt=tt.replace(/^\[[ xX]\] +/,"")),Ge.items.push({type:"list_item",raw:le,task:Jt,checked:Yt,loose:Qt,text:tt});return Ge}},ce.html=function(ne){var oe=this.rules.block.html.exec(ne);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):te(oe[0]):oe[0]}},ce.def=function(ne){var oe=this.rules.block.def.exec(ne);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var le=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:le,raw:oe[0],href:oe[2],title:oe[3]}}},ce.table=function(ne){var oe=this.rules.block.table.exec(ne);if(oe){var le={type:"table",header:$(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[]};if(le.header.length===le.align.length){le.raw=oe[0];var pe=le.align.length,ge;for(ge=0;ge<pe;ge++)/^ *-+: *$/.test(le.align[ge])?le.align[ge]="right":/^ *:-+: *$/.test(le.align[ge])?le.align[ge]="center":/^ *:-+ *$/.test(le.align[ge])?le.align[ge]="left":le.align[ge]=null;for(pe=le.cells.length,ge=0;ge<pe;ge++)le.cells[ge]=$(le.cells[ge].replace(/^ *\| *| *\| *$/g,""),le.header.length);return le}}},ce.lheading=function(ne){var oe=this.rules.block.lheading.exec(ne);if(oe)return{type:"heading",raw:oe[0],depth:oe[2].charAt(0)==="="?1:2,text:oe[1]}},ce.paragraph=function(ne){var oe=this.rules.block.paragraph.exec(ne);if(oe)return{type:"paragraph",raw:oe[0],text:oe[1].charAt(oe[1].length-1)===`
`?oe[1].slice(0,-1):oe[1]}},ce.text=function(ne,oe){var le=this.rules.block.text.exec(ne);if(le){var pe=oe[oe.length-1];return pe&&pe.type==="text"?{raw:le[0],text:le[0]}:{type:"text",raw:le[0],text:le[0]}}},ce.escape=function(ne){var oe=this.rules.inline.escape.exec(ne);if(oe)return{type:"escape",raw:oe[0],text:te(oe[1])}},ce.tag=function(ne,oe,le){var pe=this.rules.inline.tag.exec(ne);if(pe)return!oe&&/^<a /i.test(pe[0])?oe=!0:oe&&/^<\/a>/i.test(pe[0])&&(oe=!1),!le&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?le=!0:le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(le=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:oe,inRawBlock:le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):te(pe[0]):pe[0]}},ce.link=function(ne){var oe=this.rules.inline.link.exec(ne);if(oe){var le=ue(oe[2],"()");if(le>-1){var pe=oe[0].indexOf("!")===0?5:4,ge=pe+oe[1].length+le;oe[2]=oe[2].substring(0,le),oe[0]=oe[0].substring(0,ge).trim(),oe[3]=""}var Pe=oe[2],Ge="";if(this.options.pedantic){var rt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Pe);rt?(Pe=rt[1],Ge=rt[3]):Ge=""}else Ge=oe[3]?oe[3].slice(1,-1):"";Pe=Pe.trim().replace(/^<([\s\S]*)>$/,"$1");var vt=me(oe,{href:Pe&&Pe.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},oe[0]);return vt}},ce.reflink=function(ne,oe){var le;if((le=this.rules.inline.reflink.exec(ne))||(le=this.rules.inline.nolink.exec(ne))){var pe=(le[2]||le[1]).replace(/\s+/g," ");if(pe=oe[pe.toLowerCase()],!pe||!pe.href){var ge=le[0].charAt(0);return{type:"text",raw:ge,text:ge}}var Pe=me(le,pe,le[0]);return Pe}},ce.strong=function(ne,oe,le){le===void 0&&(le="");var pe=this.rules.inline.strong.start.exec(ne);if(pe&&(!pe[1]||pe[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){oe=oe.slice(-1*ne.length);var ge=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ge.lastIndex=0;for(var Pe;(pe=ge.exec(oe))!=null;)if(Pe=this.rules.inline.strong.middle.exec(oe.slice(0,pe.index+3)),Pe)return{type:"strong",raw:ne.slice(0,Pe[0].length),text:ne.slice(2,Pe[0].length-2)}}},ce.em=function(ne,oe,le){le===void 0&&(le="");var pe=this.rules.inline.em.start.exec(ne);if(pe&&(!pe[1]||pe[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){oe=oe.slice(-1*ne.length);var ge=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ge.lastIndex=0;for(var Pe;(pe=ge.exec(oe))!=null;)if(Pe=this.rules.inline.em.middle.exec(oe.slice(0,pe.index+2)),Pe)return{type:"em",raw:ne.slice(0,Pe[0].length),text:ne.slice(1,Pe[0].length-1)}}},ce.codespan=function(ne){var oe=this.rules.inline.code.exec(ne);if(oe){var le=oe[2].replace(/\n/g," "),pe=/[^ ]/.test(le),ge=le.startsWith(" ")&&le.endsWith(" ");return pe&&ge&&(le=le.substring(1,le.length-1)),le=te(le,!0),{type:"codespan",raw:oe[0],text:le}}},ce.br=function(ne){var oe=this.rules.inline.br.exec(ne);if(oe)return{type:"br",raw:oe[0]}},ce.del=function(ne){var oe=this.rules.inline.del.exec(ne);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},ce.autolink=function(ne,oe){var le=this.rules.inline.autolink.exec(ne);if(le){var pe,ge;return le[2]==="@"?(pe=te(this.options.mangle?oe(le[1]):le[1]),ge="mailto:"+pe):(pe=te(le[1]),ge=pe),{type:"link",raw:le[0],text:pe,href:ge,tokens:[{type:"text",raw:pe,text:pe}]}}},ce.url=function(ne,oe){var le;if(le=this.rules.inline.url.exec(ne)){var pe,ge;if(le[2]==="@")pe=te(this.options.mangle?oe(le[0]):le[0]),ge="mailto:"+pe;else{var Pe;do Pe=le[0],le[0]=this.rules.inline._backpedal.exec(le[0])[0];while(Pe!==le[0]);pe=te(le[0]),le[1]==="www."?ge="http://"+pe:ge=pe}return{type:"link",raw:le[0],text:pe,href:ge,tokens:[{type:"text",raw:pe,text:pe}]}}},ce.inlineText=function(ne,oe,le){var pe=this.rules.inline.text.exec(ne);if(pe){var ge;return oe?ge=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):te(pe[0]):pe[0]:ge=te(this.options.smartypants?le(pe[0]):pe[0]),{type:"text",raw:pe[0],text:ge}}},ve}(),De=Y.noopTest,Fe=Y.edit,Ne=Y.merge,Ee={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:De,table:De,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ee.def=Fe(Ee.def).replace("label",Ee._label).replace("title",Ee._title).getRegex(),Ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ee.item=Fe(Ee.item,"gm").replace(/bull/g,Ee.bullet).getRegex(),Ee.list=Fe(Ee.list).replace(/bull/g,Ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ee.def.source+")").getRegex(),Ee._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",Ee._comment=/<!--(?!-?>)[\s\S]*?-->/,Ee.html=Fe(Ee.html,"i").replace("comment",Ee._comment).replace("tag",Ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ee.paragraph=Fe(Ee._paragraph).replace("hr",Ee.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",Ee._tag).getRegex(),Ee.blockquote=Fe(Ee.blockquote).replace("paragraph",Ee.paragraph).getRegex(),Ee.normal=Ne({},Ee),Ee.gfm=Ne({},Ee.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*|$)"}),Ee.gfm.nptable=Fe(Ee.gfm.nptable).replace("hr",Ee.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",Ee._tag).getRegex(),Ee.gfm.table=Fe(Ee.gfm.table).replace("hr",Ee.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",Ee._tag).getRegex(),Ee.pedantic=Ne({},Ee.normal,{html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ee._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:De,paragraph:Fe(Ee.normal._paragraph).replace("hr",Ee.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:De,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:De,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",se.punctuation=Fe(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=Fe(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=Fe(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=Fe(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=Fe(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=Fe(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=Fe(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=Fe(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=Fe(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=Fe(se._blockSkip,"g").getRegex(),se.overlapSkip=Fe(se._overlapSkip,"g").getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=Fe(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=Fe(se.tag).replace("comment",Ee._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=Fe(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=Fe(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=Fe(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=Ne({},se),se.pedantic=Ne({},se.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:Fe(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=Ne({},se.normal,{escape:Fe(se.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),se.gfm.url=Fe(se.gfm.url,"i").replace("email",se.gfm._extended_email).getRegex(),se.breaks=Ne({},se.gfm,{br:Fe(se.br).replace("{2,}","*").getRegex(),text:Fe(se.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var He={block:Ee,inline:se},ft=H.defaults,lt=He.block,it=He.inline;function ct(ve){return ve.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 Ve(ve){var ce="",he,ne,oe=ve.length;for(he=0;he<oe;he++)ne=ve.charCodeAt(he),Math.random()>.5&&(ne="x"+ne.toString(16)),ce+="&#"+ne+";";return ce}var Je=function(){function ve(he){this.tokens=[],this.tokens.links=Object.create(null),this.options=he||ft,this.options.tokenizer=this.options.tokenizer||new Ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:lt.normal,inline:it.normal};this.options.pedantic?(ne.block=lt.pedantic,ne.inline=it.pedantic):this.options.gfm&&(ne.block=lt.gfm,this.options.breaks?ne.inline=it.breaks:ne.inline=it.gfm),this.tokenizer.rules=ne}ve.lex=function(ne,oe){var le=new ve(oe);return le.lex(ne)};var ce=ve.prototype;return ce.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(ne,oe,le){oe===void 0&&(oe=[]),le===void 0&&(le=!0),ne=ne.replace(/^ +$/gm,"");for(var pe,ge,Pe,Ge;ne;){if(pe=this.tokenizer.space(ne)){ne=ne.substring(pe.raw.length),pe.type&&oe.push(pe);continue}if(pe=this.tokenizer.code(ne,oe)){ne=ne.substring(pe.raw.length),pe.type?oe.push(pe):(Ge=oe[oe.length-1],Ge.raw+=`
`+pe.raw,Ge.text+=`
`+pe.text);continue}if(pe=this.tokenizer.fences(ne)){ne=ne.substring(pe.raw.length),oe.push(pe);continue}if(pe=this.tokenizer.heading(ne)){ne=ne.substring(pe.raw.length),oe.push(pe);continue}if(pe=this.tokenizer.nptable(ne)){ne=ne.substring(pe.raw.length),oe.push(pe);continue}if(pe=this.tokenizer.hr(ne)){ne=ne.substring(pe.raw.length),oe.push(pe);continue}if(pe=this.tokenizer.blockquote(ne)){ne=ne.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],le),oe.push(pe);continue}if(pe=this.tokenizer.list(ne)){for(ne=ne.substring(pe.raw.length),Pe=pe.items.length,ge=0;ge<Pe;ge++)pe.items[ge].tokens=this.blockTokens(pe.items[ge].text,[],!1);oe.push(pe);continue}if(pe=this.tokenizer.html(ne)){ne=ne.substring(pe.raw.length),oe.push(pe);continue}if(le&&(pe=this.tokenizer.def(ne))){ne=ne.substring(pe.raw.length),this.tokens.links[pe.tag]||(this.tokens.links[pe.tag]={href:pe.href,title:pe.title});continue}if(pe=this.tokenizer.table(ne)){ne=ne.substring(pe.raw.length),oe.push(pe);continue}if(pe=this.tokenizer.lheading(ne)){ne=ne.substring(pe.raw.length),oe.push(pe);continue}if(le&&(pe=this.tokenizer.paragraph(ne))){ne=ne.substring(pe.raw.length),oe.push(pe);continue}if(pe=this.tokenizer.text(ne,oe)){ne=ne.substring(pe.raw.length),pe.type?oe.push(pe):(Ge=oe[oe.length-1],Ge.raw+=`
`+pe.raw,Ge.text+=`
`+pe.text);continue}if(ne){var rt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(rt);break}else throw new Error(rt)}}return oe},ce.inline=function(ne){var oe,le,pe,ge,Pe,Ge,rt=ne.length;for(oe=0;oe<rt;oe++){Ge=ne[oe];switch(Ge.type){case"paragraph":case"text":case"heading":{Ge.tokens=[],this.inlineTokens(Ge.text,Ge.tokens);break}case"table":{for(Ge.tokens={header:[],cells:[]},ge=Ge.header.length,le=0;le<ge;le++)Ge.tokens.header[le]=[],this.inlineTokens(Ge.header[le],Ge.tokens.header[le]);for(ge=Ge.cells.length,le=0;le<ge;le++)for(Pe=Ge.cells[le],Ge.tokens.cells[le]=[],pe=0;pe<Pe.length;pe++)Ge.tokens.cells[le][pe]=[],this.inlineTokens(Pe[pe],Ge.tokens.cells[le][pe]);break}case"blockquote":{this.inline(Ge.tokens);break}case"list":{for(ge=Ge.items.length,le=0;le<ge;le++)this.inline(Ge.items[le].tokens);break}}}return ne},ce.inlineTokens=function(ne,oe,le,pe,ge){oe===void 0&&(oe=[]),le===void 0&&(le=!1),pe===void 0&&(pe=!1),ge===void 0&&(ge="");var Pe,Ge=ne,rt;if(this.tokens.links){var vt=Object.keys(this.tokens.links);if(vt.length>0)for(;(rt=this.tokenizer.rules.inline.reflinkSearch.exec(Ge))!=null;)vt.includes(rt[0].slice(rt[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(rt=this.tokenizer.rules.inline.blockSkip.exec(Ge))!=null;)Ge=Ge.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Pe=this.tokenizer.escape(ne)){ne=ne.substring(Pe.raw.length),oe.push(Pe);continue}if(Pe=this.tokenizer.tag(ne,le,pe)){ne=ne.substring(Pe.raw.length),le=Pe.inLink,pe=Pe.inRawBlock,oe.push(Pe);continue}if(Pe=this.tokenizer.link(ne)){ne=ne.substring(Pe.raw.length),Pe.type==="link"&&(Pe.tokens=this.inlineTokens(Pe.text,[],!0,pe)),oe.push(Pe);continue}if(Pe=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Pe.raw.length),Pe.type==="link"&&(Pe.tokens=this.inlineTokens(Pe.text,[],!0,pe)),oe.push(Pe);continue}if(Pe=this.tokenizer.strong(ne,Ge,ge)){ne=ne.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],le,pe),oe.push(Pe);continue}if(Pe=this.tokenizer.em(ne,Ge,ge)){ne=ne.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],le,pe),oe.push(Pe);continue}if(Pe=this.tokenizer.codespan(ne)){ne=ne.substring(Pe.raw.length),oe.push(Pe);continue}if(Pe=this.tokenizer.br(ne)){ne=ne.substring(Pe.raw.length),oe.push(Pe);continue}if(Pe=this.tokenizer.del(ne)){ne=ne.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],le,pe),oe.push(Pe);continue}if(Pe=this.tokenizer.autolink(ne,Ve)){ne=ne.substring(Pe.raw.length),oe.push(Pe);continue}if(!le&&(Pe=this.tokenizer.url(ne,Ve))){ne=ne.substring(Pe.raw.length),oe.push(Pe);continue}if(Pe=this.tokenizer.inlineText(ne,pe,ct)){ne=ne.substring(Pe.raw.length),ge=Pe.raw.slice(-1),oe.push(Pe);continue}if(ne){var tt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(tt);break}else throw new Error(tt)}}return oe},X(ve,null,[{key:"rules",get:function(){return{block:lt,inline:it}}}]),ve}(),st=H.defaults,gt=Y.cleanUrl,ut=Y.escape,et=function(){function ve(he){this.options=he||st}var ce=ve.prototype;return ce.code=function(ne,oe,le){var pe=(oe||"").match(/\S*/)[0];if(this.options.highlight){var ge=this.options.highlight(ne,pe);ge!=null&&ge!==ne&&(le=!0,ne=ge)}return pe?'<pre><code class="'+this.options.langPrefix+ut(pe,!0)+'">'+(le?ne:ut(ne,!0))+`</code></pre>
`:"<pre><code>"+(le?ne:ut(ne,!0))+`</code></pre>
`},ce.blockquote=function(ne){return`<blockquote>
`+ne+`</blockquote>
`},ce.html=function(ne){return ne},ce.heading=function(ne,oe,le,pe){return this.options.headerIds?"<h"+oe+' id="'+this.options.headerPrefix+pe.slug(le)+'">'+ne+"</h"+oe+`>
`:"<h"+oe+">"+ne+"</h"+oe+`>
`},ce.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ce.list=function(ne,oe,le){var pe=oe?"ol":"ul",ge=oe&&le!==1?' start="'+le+'"':"";return"<"+pe+ge+`>
`+ne+"</"+pe+`>
`},ce.listitem=function(ne){return"<li>"+ne+`</li>
`},ce.checkbox=function(ne){return"<input "+(ne?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(ne){return"<p>"+ne+`</p>
`},ce.table=function(ne,oe){return oe&&(oe="<tbody>"+oe+"</tbody>"),`<table>
<thead>
`+ne+`</thead>
`+oe+`</table>
`},ce.tablerow=function(ne){return`<tr>
`+ne+`</tr>
`},ce.tablecell=function(ne,oe){var le=oe.header?"th":"td",pe=oe.align?"<"+le+' align="'+oe.align+'">':"<"+le+">";return pe+ne+"</"+le+`>
`},ce.strong=function(ne){return"<strong>"+ne+"</strong>"},ce.em=function(ne){return"<em>"+ne+"</em>"},ce.codespan=function(ne){return"<code>"+ne+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(ne){return"<del>"+ne+"</del>"},ce.link=function(ne,oe,le){if(ne=gt(this.options.sanitize,this.options.baseUrl,ne),ne===null)return le;var pe='<a href="'+ut(ne)+'"';return oe&&(pe+=' title="'+oe+'"'),pe+=">"+le+"</a>",pe},ce.image=function(ne,oe,le){if(ne=gt(this.options.sanitize,this.options.baseUrl,ne),ne===null)return le;var pe='<img src="'+ne+'" alt="'+le+'"';return oe&&(pe+=' title="'+oe+'"'),pe+=this.options.xhtml?"/>":">",pe},ce.text=function(ne){return ne},ve}(),qe=function(){function ve(){}var ce=ve.prototype;return ce.strong=function(ne){return ne},ce.em=function(ne){return ne},ce.codespan=function(ne){return ne},ce.del=function(ne){return ne},ce.html=function(ne){return ne},ce.text=function(ne){return ne},ce.link=function(ne,oe,le){return""+le},ce.image=function(ne,oe,le){return""+le},ce.br=function(){return""},ve}(),St=function(){function ve(){this.seen={}}var ce=ve.prototype;return ce.slug=function(ne){var oe=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var le=oe;do this.seen[le]++,oe=le+"-"+this.seen[le];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},ve}(),pt=H.defaults,nt=Y.unescape,at=function(){function ve(he){this.options=he||pt,this.options.renderer=this.options.renderer||new et,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qe,this.slugger=new St}ve.parse=function(ne,oe){var le=new ve(oe);return le.parse(ne)};var ce=ve.prototype;return ce.parse=function(ne,oe){oe===void 0&&(oe=!0);var le="",pe,ge,Pe,Ge,rt,vt,tt,Wt,Nt,_t,Qt,Jt,Yt,cn,jt,rn,kt,Xe,Lt=ne.length;for(pe=0;pe<Lt;pe++){_t=ne[pe];switch(_t.type){case"space":continue;case"hr":{le+=this.renderer.hr();continue}case"heading":{le+=this.renderer.heading(this.parseInline(_t.tokens),_t.depth,nt(this.parseInline(_t.tokens,this.textRenderer)),this.slugger);continue}case"code":{le+=this.renderer.code(_t.text,_t.lang,_t.escaped);continue}case"table":{for(Wt="",tt="",Ge=_t.header.length,ge=0;ge<Ge;ge++)tt+=this.renderer.tablecell(this.parseInline(_t.tokens.header[ge]),{header:!0,align:_t.align[ge]});for(Wt+=this.renderer.tablerow(tt),Nt="",Ge=_t.cells.length,ge=0;ge<Ge;ge++){for(vt=_t.tokens.cells[ge],tt="",rt=vt.length,Pe=0;Pe<rt;Pe++)tt+=this.renderer.tablecell(this.parseInline(vt[Pe]),{header:!1,align:_t.align[Pe]});Nt+=this.renderer.tablerow(tt)}le+=this.renderer.table(Wt,Nt);continue}case"blockquote":{Nt=this.parse(_t.tokens),le+=this.renderer.blockquote(Nt);continue}case"list":{for(Qt=_t.ordered,Jt=_t.start,Yt=_t.loose,Ge=_t.items.length,Nt="",ge=0;ge<Ge;ge++)jt=_t.items[ge],rn=jt.checked,kt=jt.task,cn="",jt.task&&(Xe=this.renderer.checkbox(rn),Yt?jt.tokens.length>0&&jt.tokens[0].type==="text"?(jt.tokens[0].text=Xe+" "+jt.tokens[0].text,jt.tokens[0].tokens&&jt.tokens[0].tokens.length>0&&jt.tokens[0].tokens[0].type==="text"&&(jt.tokens[0].tokens[0].text=Xe+" "+jt.tokens[0].tokens[0].text)):jt.tokens.unshift({type:"text",text:Xe}):cn+=Xe),cn+=this.parse(jt.tokens,Yt),Nt+=this.renderer.listitem(cn,kt,rn);le+=this.renderer.list(Nt,Qt,Jt);continue}case"html":{le+=this.renderer.html(_t.text);continue}case"paragraph":{le+=this.renderer.paragraph(this.parseInline(_t.tokens));continue}case"text":{for(Nt=_t.tokens?this.parseInline(_t.tokens):_t.text;pe+1<Lt&&ne[pe+1].type==="text";)_t=ne[++pe],Nt+=`
`+(_t.tokens?this.parseInline(_t.tokens):_t.text);le+=oe?this.renderer.paragraph(Nt):Nt;continue}default:{var Ut='Token with "'+_t.type+'" type was not found.';if(this.options.silent){console.error(Ut);return}else throw new Error(Ut)}}}return le},ce.parseInline=function(ne,oe){oe=oe||this.renderer;var le="",pe,ge,Pe=ne.length;for(pe=0;pe<Pe;pe++){ge=ne[pe];switch(ge.type){case"escape":{le+=oe.text(ge.text);break}case"html":{le+=oe.html(ge.text);break}case"link":{le+=oe.link(ge.href,ge.title,this.parseInline(ge.tokens,oe));break}case"image":{le+=oe.image(ge.href,ge.title,ge.text);break}case"strong":{le+=oe.strong(this.parseInline(ge.tokens,oe));break}case"em":{le+=oe.em(this.parseInline(ge.tokens,oe));break}case"codespan":{le+=oe.codespan(ge.text);break}case"br":{le+=oe.br();break}case"del":{le+=oe.del(this.parseInline(ge.tokens,oe));break}case"text":{le+=oe.text(ge.text);break}default:{var Ge='Token with "'+ge.type+'" type was not found.';if(this.options.silent){console.error(Ge);return}else throw new Error(Ge)}}}return le},ve}(),bt=Y.merge,Et=Y.checkSanitizeDeprecation,Re=Y.escape,Te=H.getDefaults,Ke=H.changeDefaults,ze=H.defaults;function Ce(ve,ce,he){if(typeof ve=="undefined"||ve===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ve!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ve)+", string expected");if(typeof ce=="function"&&(he=ce,ce=null),ce=bt({},Ce.defaults,ce||{}),Et(ce),he){var ne=ce.highlight,oe;try{oe=Je.lex(ve,ce)}catch(Pe){return he(Pe)}var le=function(Ge){var rt;if(!Ge)try{rt=at.parse(oe,ce)}catch(vt){Ge=vt}return ce.highlight=ne,Ge?he(Ge):he(null,rt)};if(!ne||ne.length<3)return le();if(delete ce.highlight,!oe.length)return le();var pe=0;Ce.walkTokens(oe,function(Pe){Pe.type==="code"&&(pe++,setTimeout(function(){ne(Pe.text,Pe.lang,function(Ge,rt){if(Ge)return le(Ge);rt!=null&&rt!==Pe.text&&(Pe.text=rt,Pe.escaped=!0),pe--,pe===0&&le()})},0))}),pe===0&&le();return}try{var ge=Je.lex(ve,ce);return ce.walkTokens&&Ce.walkTokens(ge,ce.walkTokens),at.parse(ge,ce)}catch(Pe){if(Pe.message+=`
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+Re(Pe.message+"",!0)+"</pre>";throw Pe}}Ce.options=Ce.setOptions=function(ve){return bt(Ce.defaults,ve),Ke(Ce.defaults),Ce},Ce.getDefaults=Te,Ce.defaults=ze,Ce.use=function(ve){var ce=bt({},ve);if(ve.renderer&&function(){var ne=Ce.defaults.renderer||new et,oe=function(ge){var Pe=ne[ge];ne[ge]=function(){for(var Ge=arguments.length,rt=new Array(Ge),vt=0;vt<Ge;vt++)rt[vt]=arguments[vt];var tt=ve.renderer[ge].apply(ne,rt);return tt===!1&&(tt=Pe.apply(ne,rt)),tt}};for(var le in ve.renderer)oe(le);ce.renderer=ne}(),ve.tokenizer&&function(){var ne=Ce.defaults.tokenizer||new Ae,oe=function(ge){var Pe=ne[ge];ne[ge]=function(){for(var Ge=arguments.length,rt=new Array(Ge),vt=0;vt<Ge;vt++)rt[vt]=arguments[vt];var tt=ve.tokenizer[ge].apply(ne,rt);return tt===!1&&(tt=Pe.apply(ne,rt)),tt}};for(var le in ve.tokenizer)oe(le);ce.tokenizer=ne}(),ve.walkTokens){var he=Ce.defaults.walkTokens;ce.walkTokens=function(ne){ve.walkTokens(ne),he&&he(ne)}}Ce.setOptions(ce)},Ce.walkTokens=function(ve,ce){for(var he=L(ve),ne;!(ne=he()).done;){var oe=ne.value;ce(oe);switch(oe.type){case"table":{for(var le=L(oe.tokens.header),pe;!(pe=le()).done;){var ge=pe.value;Ce.walkTokens(ge,ce)}for(var Pe=L(oe.tokens.cells),Ge;!(Ge=Pe()).done;)for(var rt=Ge.value,vt=L(rt),tt;!(tt=vt()).done;){var Wt=tt.value;Ce.walkTokens(Wt,ce)}break}case"list":{Ce.walkTokens(oe.items,ce);break}default:oe.tokens&&Ce.walkTokens(oe.tokens,ce)}}},Ce.Parser=at,Ce.parser=at.parse,Ce.Renderer=et,Ce.TextRenderer=qe,Ce.Lexer=Je,Ce.lexer=Je.lex,Ce.Tokenizer=Ae,Ce.Slugger=St,Ce.parse=Ce;var We=Ce;return We})},ELLl:function(Rt,$e,Q){(function(ae){ae(Q("VrN/"))})(function(ae){var X={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=ae.Pos;ae.defineOption("autoCloseBrackets",!1,function(r,l,u){u&&u!=ae.Init&&(r.removeKeyMap(L),r.state.closeBrackets=null),l&&(M(V(l,"pairs")),r.state.closeBrackets=l,r.addKeyMap(L))});function V(r,l){return l=="pairs"&&typeof r=="string"?r:typeof r=="object"&&r[l]!=null?r[l]:X[l]}var L={Backspace:k,Enter:I};function M(r){for(var l=0;l<r.length;l++){var u=r.charAt(l),a="'"+u+"'";L[a]||(L[a]=H(u))}}M(X.pairs+"`");function H(r){return function(l){return y(l,r)}}function U(r){var l=r.state.closeBrackets;if(!l||l.override)return l;var u=r.getModeAt(r.getCursor());return u.closeBrackets||l}function k(r){var l=U(r);if(!l||r.getOption("disableInput"))return ae.Pass;for(var u=V(l,"pairs"),a=r.listSelections(),s=0;s<a.length;s++){if(!a[s].empty())return ae.Pass;var f=p(r,a[s].head);if(!f||u.indexOf(f)%2!=0)return ae.Pass}for(var s=a.length-1;s>=0;s--){var O=a[s].head;r.replaceRange("",P(O.line,O.ch-1),P(O.line,O.ch+1),"+delete")}}function I(r){var l=U(r),u=l&&V(l,"explode");if(!u||r.getOption("disableInput"))return ae.Pass;for(var a=r.listSelections(),s=0;s<a.length;s++){if(!a[s].empty())return ae.Pass;var f=p(r,a[s].head);if(!f||u.indexOf(f)%2!=0)return ae.Pass}r.operation(function(){var O=r.lineSeparator()||`
`;r.replaceSelection(O+O,null),r.execCommand("goCharLeft"),a=r.listSelections();for(var S=0;S<a.length;S++){var E=a[S].head.line;r.indentLine(E,null,!0),r.indentLine(E+1,null,!0)}})}function b(r){var l=ae.cmpPos(r.anchor,r.head)>0;return{anchor:new P(r.anchor.line,r.anchor.ch+(l?-1:1)),head:new P(r.head.line,r.head.ch+(l?1:-1))}}function y(r,l){var u=U(r);if(!u||r.getOption("disableInput"))return ae.Pass;var a=V(u,"pairs"),s=a.indexOf(l);if(s==-1)return ae.Pass;for(var f=V(u,"closeBefore"),O=V(u,"triples"),S=a.charAt(s+1)==l,E=r.listSelections(),C=s%2==0,w,g=0;g<E.length;g++){var v=E[g],h=v.head,o,_=r.getRange(h,P(h.line,h.ch+1));if(C&&!v.empty())o="surround";else if((S||!C)&&_==l)S&&c(r,h)?o="both":O.indexOf(l)>=0&&r.getRange(h,P(h.line,h.ch+3))==l+l+l?o="skipThree":o="skip";else if(S&&h.ch>1&&O.indexOf(l)>=0&&r.getRange(P(h.line,h.ch-2),h)==l+l){if(h.ch>2&&/\bstring/.test(r.getTokenTypeAt(P(h.line,h.ch-2))))return ae.Pass;o="addFour"}else if(S){var m=h.ch==0?" ":r.getRange(P(h.line,h.ch-1),h);if(!ae.isWordChar(_)&&m!=l&&!ae.isWordChar(m))o="both";else return ae.Pass}else if(C&&(_.length===0||/\s/.test(_)||f.indexOf(_)>-1))o="both";else return ae.Pass;if(!w)w=o;else if(w!=o)return ae.Pass}var T=s%2?a.charAt(s-1):l,N=s%2?l:a.charAt(s+1);r.operation(function(){if(w=="skip")r.execCommand("goCharRight");else if(w=="skipThree")for(var j=0;j<3;j++)r.execCommand("goCharRight");else if(w=="surround"){for(var W=r.getSelections(),j=0;j<W.length;j++)W[j]=T+W[j]+N;r.replaceSelections(W,"around"),W=r.listSelections().slice();for(var j=0;j<W.length;j++)W[j]=b(W[j]);r.setSelections(W)}else w=="both"?(r.replaceSelection(T+N,null),r.triggerElectric(T+N),r.execCommand("goCharLeft")):w=="addFour"&&(r.replaceSelection(T+T+T+T,"before"),r.execCommand("goCharRight"))})}function p(r,l){var u=r.getRange(P(l.line,l.ch-1),P(l.line,l.ch+1));return u.length==2?u:null}function c(r,l){var u=r.getTokenAt(P(l.line,l.ch+1));return/\bstring/.test(u.type)&&u.start==l.ch&&(l.ch==0||!/\bstring/.test(r.getTokenTypeAt(l)))}})},HmJG:function(Rt,$e,Q){},IBYe:function(Rt,$e,Q){"use strict";function ae(X){return null}$e.a=ae},LdHM:function(Rt,$e,Q){"use strict";Q.d($e,"b",function(){return f}),Q.d($e,"a",function(){return S});var ae=Q("1OyB"),X=Q("vuIU"),P=Q("Ji7U"),V=Q("LK+K"),L=Q("q1tI"),M=Q("rePB"),H=Q("Ff2n"),U=Q("ODXe"),k=Q("4IlW"),I=Q("bX4T"),b=Q("YrtM"),y=Q("TSYQ"),p=Q.n(y),c=Q("+nKL"),r=Q("8OUc"),l=function($,te){var ue=$.prefixCls,me=$.id,Me=$.flattenOptions,Ae=$.childrenAsData,De=$.values,Fe=$.searchValue,Ne=$.multiple,Ee=$.defaultActiveFirstOption,se=$.height,He=$.itemHeight,ft=$.notFoundContent,lt=$.open,it=$.menuItemSelectedIcon,ct=$.virtual,Ve=$.onSelect,Je=$.onToggleOpen,st=$.onActiveValue,gt=$.onScroll,ut=$.onMouseEnter,et="".concat(ue,"-item"),qe=Object(b.a)(function(){return Me},[lt,Me],function(We,ve){return ve[0]&&We[1]!==ve[1]}),St=L.useRef(null),pt=function(ve){ve.preventDefault()},nt=function(ve){St.current&&St.current.scrollTo({index:ve})},at=function(ve){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,he=qe.length,ne=0;ne<he;ne+=1){var oe=(ve+ne*ce+he)%he,le=qe[oe],pe=le.group,ge=le.data;if(!pe&&!ge.disabled)return oe}return-1},bt=L.useState(function(){return at(0)}),Et=Object(U.a)(bt,2),Re=Et[0],Te=Et[1],Ke=function(ve){Te(ve);var ce=qe[ve];if(!ce){st(null,-1);return}st(ce.data.value,ve)};L.useEffect(function(){Ke(Ee!==!1?at(0):-1)},[qe.length,Fe]),L.useEffect(function(){var We=setTimeout(function(){if(!Ne&&lt&&De.size===1){var ve=Array.from(De)[0],ce=qe.findIndex(function(he){var ne=he.data;return ne.value===ve});Ke(ce),nt(ce)}});return function(){return clearTimeout(We)}},[lt]);var ze=function(ve){ve!==void 0&&Ve(ve,{selected:!De.has(ve)}),Ne||Je(!1)};if(L.useImperativeHandle(te,function(){return{onKeyDown:function(ve){var ce=ve.which;switch(ce){case k.a.UP:case k.a.DOWN:{var he=0;if(ce===k.a.UP?he=-1:ce===k.a.DOWN&&(he=1),he!==0){var ne=at(Re+he,he);nt(ne),Ke(ne)}break}case k.a.ENTER:{var oe=qe[Re];oe&&!oe.data.disabled?ze(oe.data.value):ze(void 0),lt&&ve.preventDefault();break}case k.a.ESC:Je(!1)}},onKeyUp:function(){},scrollTo:function(ve){nt(ve)}}}),qe.length===0)return L.createElement("div",{role:"listbox",id:"".concat(me,"_list"),className:"".concat(et,"-empty"),onMouseDown:pt},ft);function Ce(We){var ve=qe[We];if(!ve)return null;var ce=ve.data||{},he=ce.value,ne=ce.label,oe=ce.children,le=Object(I.a)(ce,!0),pe=Ae?oe:ne;return ve?L.createElement("div",Object.assign({"aria-label":typeof pe=="string"?pe:null},le,{key:We,role:"option",id:"".concat(me,"_list_").concat(We),"aria-selected":De.has(he)}),he):null}return L.createElement(L.Fragment,null,L.createElement("div",{role:"listbox",id:"".concat(me,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ce(Re-1),Ce(Re),Ce(Re+1)),L.createElement(c.a,{itemKey:"key",ref:St,data:qe,height:se,itemHeight:He,fullHeight:!1,onMouseDown:pt,onScroll:gt,virtual:ct,onMouseEnter:ut},function(We,ve){var ce,he=We.group,ne=We.groupOption,oe=We.data,le=oe.label,pe=oe.key;if(he)return L.createElement("div",{className:p()(et,"".concat(et,"-group"))},le!==void 0?le:pe);var ge=oe.disabled,Pe=oe.value,Ge=oe.title,rt=oe.children,vt=oe.style,tt=oe.className,Wt=Object(H.a)(oe,["disabled","value","title","children","style","className"]),Nt=De.has(Pe),_t="".concat(et,"-option"),Qt=p()(et,_t,tt,(ce={},Object(M.a)(ce,"".concat(_t,"-grouped"),ne),Object(M.a)(ce,"".concat(_t,"-active"),Re===ve&&!ge),Object(M.a)(ce,"".concat(_t,"-disabled"),ge),Object(M.a)(ce,"".concat(_t,"-selected"),Nt),ce)),Jt=Ae?rt:le,Yt=!it||typeof it=="function"||Nt;return L.createElement("div",Object.assign({},Wt,{"aria-selected":Nt,className:Qt,title:Ge,onMouseMove:function(){if(Re===ve||ge)return;Ke(ve)},onClick:function(){ge||ze(Pe)},style:vt}),L.createElement("div",{className:"".concat(_t,"-content")},Jt||Pe),L.isValidElement(it)||Nt,Yt&&L.createElement(r.a,{className:"".concat(et,"-option-state"),customizeIcon:it,customizeIconProps:{isSelected:Nt}},Nt?"\u2713":null))}))},u=L.forwardRef(l);u.displayName="OptionList";var a=u,s=function(){return null};s.isSelectOption=!0;var f=s,O=function(){return null};O.isSelectOptGroup=!0;var S=O,E=Q("VTBJ"),C=Q("Zm9Q");function w(R){var $=R.key,te=R.props,ue=te.children,me=te.value,Me=Object(H.a)(te,["children","value"]);return Object(E.a)({key:$,value:me!==void 0?me:$,children:ue},Me)}function g(R){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(C.a)(R).map(function(te,ue){if(!L.isValidElement(te)||!te.type)return null;var me=te.type.isSelectOptGroup,Me=te.key,Ae=te.props,De=Ae.children,Fe=Object(H.a)(Ae,["children"]);return $||!me?w(te):Object(E.a)(Object(E.a)({key:"__RC_SELECT_GRP__".concat(Me===null?ue:Me,"__"),label:Me},Fe),{},{options:g(De)})}).filter(function(te){return te})}var v=Q("2Qr1"),h=Q("qNPg"),o=Q("U8pU"),_=Q("Kwbf"),m=Q("WKfj");function T(R){var $=R.mode,te=R.options,ue=R.children,me=R.backfill,Me=R.allowClear,Ae=R.placeholder,De=R.getInputElement,Fe=R.showSearch,Ne=R.onSearch,Ee=R.defaultOpen,se=R.autoFocus,He=R.labelInValue,ft=R.value,lt=R.inputValue,it=R.optionLabelProp,ct=$==="multiple"||$==="tags",Ve=Fe!==void 0?Fe:ct||$==="combobox",Je=te||g(ue);if(Object(_.a)($!=="tags"||Je.every(function(et){return!et.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),$==="tags"||$==="combobox"){var st=Je.some(function(et){return et.options?et.options.some(function(qe){return typeof("value"in qe?qe.value:qe.key)=="number"}):typeof("value"in et?et.value:et.key)=="number"});Object(_.a)(!st,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)($!=="combobox"||!it,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)($==="combobox"||!me,"`backfill` only works with `combobox` mode."),Object(_.a)($==="combobox"||!De,"`getInputElement` only work with `combobox` mode."),Object(_.b)($!=="combobox"||!De||!Me||!Ae,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ne&&!Ve&&$!=="combobox"&&$!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!Ee||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ft!=null){var gt=Object(m.d)(ft);Object(_.a)(!He||gt.every(function(et){return Object(o.a)(et)==="object"&&("key"in et||"value"in et)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!ct||Array.isArray(ft),"`value` should be array when `mode` is `multiple` or `tags`")}if(ue){var ut=null;Object(C.a)(ue).some(function(et){if(!L.isValidElement(et)||!et.type)return!1;var qe=et.type;if(qe.isSelectOption)return!1;if(qe.isSelectOptGroup){var St=Object(C.a)(et.props.children).every(function(pt){return!L.isValidElement(pt)||!et.type||pt.type.isSelectOption?!0:(ut=pt.type,!1)});return!St}return ut=qe,!0}),ut&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ut.displayName||ut.name||ut,"`.")),Object(_.a)(lt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=T,j=Object(h.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:g,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:N,fillOptionsWithMissingValue:v.a}),W=function(R){Object(P.a)(te,R);var $=Object(V.a)(te);function te(){var ue;return Object(ae.a)(this,te),ue=$.apply(this,arguments),ue.selectRef=L.createRef(),ue.focus=function(){ue.selectRef.current.focus()},ue.blur=function(){ue.selectRef.current.blur()},ue}return Object(X.a)(te,[{key:"render",value:function(){return L.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),te}(L.Component);W.Option=f,W.OptGroup=S;var Y=W,B=$e.c=Y},M8RZ:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return k});var ae=Q("fWQN"),X=Q("mtLc"),P=Q("yKVA"),V=Q("879j"),L=Q("q1tI"),M=Q.n(L),H=Q("i8i4"),U=Q.n(H),k=function(I){Object(P.a)(y,I);var b=Object(V.a)(y);function y(p){var c;Object(ae.a)(this,y),c=b.call(this,p);var r=window.document;return c.node=r.createElement("div"),r.body.appendChild(c.node),c}return Object(X.a)(y,[{key:"render",value:function(){var c=this.props.children;return Object(H.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),y}(M.a.Component)},NvD2:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return M});var ae=Q("Kwbf");function X(H,U){var k=new Set;return H.forEach(function(I){U.has(I)||k.add(I)}),k}function P(H){var U=H||{},k=U.disabled,I=U.disableCheckbox,b=U.checkable;return!!(k||I)||b===!1}function V(H,U,k,I){for(var b=new Set(H),y=new Set,p=0;p<=k;p+=1){var c=U.get(p)||new Set;c.forEach(function(a){var s=a.key,f=a.node,O=a.children,S=O===void 0?[]:O;b.has(s)&&!I(f)&&S.filter(function(E){return!I(E.node)}).forEach(function(E){b.add(E.key)})})}for(var r=new Set,l=k;l>=0;l-=1){var u=U.get(l)||new Set;u.forEach(function(a){var s=a.parent,f=a.node;if(I(f)||!a.parent||r.has(a.parent.key))return;if(I(a.parent.node)){r.add(s.key);return}var O=!0,S=!1;(s.children||[]).filter(function(E){return!I(E.node)}).forEach(function(E){var C=E.key,w=b.has(C);O&&!w&&(O=!1),!S&&(w||y.has(C))&&(S=!0)}),O&&b.add(s.key),S&&y.add(s.key),r.add(s.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(X(y,b))}}function L(H,U,k,I,b){for(var y=new Set(H),p=new Set(U),c=0;c<=I;c+=1){var r=k.get(c)||new Set;r.forEach(function(s){var f=s.key,O=s.node,S=s.children,E=S===void 0?[]:S;!y.has(f)&&!p.has(f)&&!b(O)&&E.filter(function(C){return!b(C.node)}).forEach(function(C){y.delete(C.key)})})}p=new Set;for(var l=new Set,u=I;u>=0;u-=1){var a=k.get(u)||new Set;a.forEach(function(s){var f=s.parent,O=s.node;if(b(O)||!s.parent||l.has(s.parent.key))return;if(b(s.parent.node)){l.add(f.key);return}var S=!0,E=!1;(f.children||[]).filter(function(C){return!b(C.node)}).forEach(function(C){var w=C.key,g=y.has(w);S&&!g&&(S=!1),!E&&(g||p.has(w))&&(E=!0)}),S||y.delete(f.key),E&&p.add(f.key),l.add(f.key)})}return{checkedKeys:Array.from(y),halfCheckedKeys:Array.from(X(p,y))}}function M(H,U,k,I){var b=[],y;I?y=I:y=P;var p=new Set(H.filter(function(u){var a=!!k[u];return a||b.push(u),a})),c=new Map,r=0;Object.keys(k).forEach(function(u){var a=k[u],s=a.level,f=c.get(s);f||(f=new Set,c.set(s,f)),f.add(a),r=Math.max(r,s)}),Object(ae.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var l;return U===!0?l=V(p,c,r,y):l=L(p,U.halfCheckedKeys,c,r,y),l}},OZM5:function(Rt,$e,Q){"use strict";Q.d($e,"b",function(){return I}),Q.d($e,"a",function(){return b}),Q.d($e,"k",function(){return y}),Q.d($e,"h",function(){return p}),Q.d($e,"i",function(){return c}),Q.d($e,"g",function(){return r}),Q.d($e,"c",function(){return l}),Q.d($e,"d",function(){return u}),Q.d($e,"j",function(){return f}),Q.d($e,"e",function(){return O}),Q.d($e,"f",function(){return S});var ae=Q("KQm4"),X=Q("U8pU"),P=Q("Ff2n"),V=Q("q1tI"),L=Q.n(V),M=Q("Kwbf"),H=Q("WaYH"),U=.25,k=2;function I(E,C){var w=E.slice(),g=w.indexOf(C);return g>=0&&w.splice(g,1),w}function b(E,C){var w=E.slice();return w.indexOf(C)===-1&&w.push(C),w}function y(E){return E.split("-")}function p(E,C){return"".concat(E,"-").concat(C)}function c(E){return E&&E.type&&E.type.isTreeNode}function r(E,C){var w=[E],g=C[E];function v(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(o){var _=o.key,m=o.children;w.push(_),v(m)})}return v(g.children),w}function l(E,C){var w=E.clientY,g=C.selectHandle.getBoundingClientRect(),v=g.top,h=g.bottom,o=g.height,_=Math.max(o*U,k);return w<=v+_?-1:w>=h-_?1:0}function u(E,C){if(!E)return;var w=C.multiple;return w?E.slice():E.length?[E[0]]:E}var a=function(C){return C};function s(E,C){if(!E)return[];var w=C||{},g=w.processProps,v=g===void 0?a:g,h=Array.isArray(E)?E:[E];return h.map(function(o){var _=o.children,m=Object(P.a)(o,["children"]),T=s(_,C);return L.a.createElement(H.a,Object.assign({},v(m)),T)})}function f(E){if(!E)return null;var C;if(Array.isArray(E))C={checkedKeys:E,halfCheckedKeys:void 0};else if(Object(X.a)(E)==="object")C={checkedKeys:E.checked||void 0,halfCheckedKeys:E.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return C}function O(E,C){var w=new Set;function g(v){if(w.has(v))return;var h=C[v];if(!h)return;w.add(v);var o=h.parent,_=h.node;if(_.disabled)return;o&&g(o.key)}return(E||[]).forEach(function(v){g(v)}),Object(ae.a)(w)}function S(E){var C={};return Object.keys(E).forEach(function(w){(w.startsWith("data-")||w.startsWith("aria-"))&&(C[w]=E[w])}),C}},Ot1p:function(Rt,$e,Q){"use strict";var ae=Q("2qtc"),X=Q("kLXV"),P=Q("rAM+"),V=Q("miYZ"),L=Q("tsqr"),M=Q("9og8"),H=Q("tJVT"),U=Q("jrin"),k=Q("WmNS"),I=Q.n(k),b=Q("q1tI"),y=Q.n(b),p=Q("VrN/"),c=Q.n(p),r=Q("bdgK"),l=Q("p77/"),u=Q("Bd2K"),a=Q("ELLl"),s=Q("19Vz"),f=Q("lZu9"),O=Q("+NIl"),S=Q("kSUc"),E=Q("9Bee"),C=function(ge){var Pe=ge.value,Ge=Pe===void 0?"":Pe,rt=ge.className,vt=ge.showTextOnly,tt=ge.showLines,Wt=ge.style,Nt=Wt===void 0?{}:Wt,_t=Object(b.useMemo)(function(){return""},[Ge]);return y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{dangerouslySetInnerHTML:{__html:_t}}))},w=Q("0Owb"),g=Q("dejd"),v=Q("C+DQ"),h=Q("1vsH"),o=Q("m3rI"),_=[{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 m(ge){var Pe=ge.onActionCallback,Ge=ge.title,rt=ge.icon,vt=ge.actionName,tt=ge.className,Wt=tt===void 0?"":tt,Nt=ge.children;function _t(){Pe(vt)}return y.a.createElement("a",{title:Ge,className:Wt,onClick:_t},y.a.createElement("i",{className:"md-iconfont ".concat(rt)}),Nt)}var T=function(ge){var Pe=ge.watch,Ge=ge.showNullButton,rt=ge.onActionCallback,vt=ge.fullScreen,tt=ge.insertTemp,Wt=ge.hidetoolBar,Nt=ge.uuid,_t=ge.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(Nt,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var Qt=[].concat(_,[{title:"".concat(Pe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Pe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return y.a.createElement("ul",{className:"markdown-toolbar-container"},!Wt&&Qt.map(function(Jt,Yt){return y.a.createElement("li",{key:Yt},Jt.actionName?y.a.createElement(m,Object(w.a)({},Jt,{onActionCallback:rt})):y.a.createElement("span",{className:"v-line"}))}),Ge?y.a.createElement("li",null,y.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:rt},y.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,tt&&y.a.createElement("li",null,y.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(tt),onActionCallback:rt},y.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),y.a.createElement("li",{className:"btn-full-screen"},y.a.createElement(m,{icon:"".concat(vt?"icon-shrink":"icon-enlarge"),title:vt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:rt})))},N=Q("M8RZ"),j=Q("+L6B"),W=Q("2/Rp"),Y=Q("y8nQ"),B=Q("Vl3Y"),R=Q("5NDa"),$=Q("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},ue=function(ge){var Pe=ge.callback,Ge=ge.onCancel;function rt(vt){Pe(vt)}return y.a.createElement(B.a,Object(w.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:rt}),y.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},y.a.createElement($.a,null)),y.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},y.a.createElement($.a,null)),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(W.a,{type:"ghost",onClick:Ge},"\u53D6\u6D88")))},me=Q("7ahc"),Me=Q("HmJG"),Ae=Q("BjJ7"),De=B.a.useForm,Fe={width:280,marginRight:10},Ne={labelCol:{span:5},wrapperCol:{span:19}},Ee=function(ge){var Pe=ge.callback,Ge=ge.onCancel,rt=De(),vt=Object(H.a)(rt,1),tt=vt[0];function Wt(Qt){Pe(Qt)}function Nt(Qt,Jt){if(Qt.status===-1){L.b.error(Qt.message);return}tt.setFieldsValue({src:"/api/attachments/".concat(Qt.id),type:Jt.type})}function _t(Qt){var Jt=Qt.target.files[0];He(Jt,Nt)}return y.a.createElement(B.a,Object(w.a)({form:tt},Ne,{className:"upload-image-panel",onFinish:Wt}),y.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},y.a.createElement("div",{className:"flex-container"},y.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},y.a.createElement($.a,{style:Fe})),y.a.createElement(se,{onFileChange:_t}))),y.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},y.a.createElement($.a,{style:{width:264}})),y.a.createElement(B.a.Item,{style:{textAlign:"right"}},y.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(W.a,{type:"ghost",onClick:Ge},"\u53D6\u6D88")))};function se(ge){var Pe=ge.onFileChange;return y.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",y.a.createElement("input",{type:"file",onChange:Pe}))}function He(ge,Pe){if(!ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ge=new FormData;Ge.append("editormd-image-file",ge),Ge.append("file_param_name","editormd-image-file"),Ge.append("byxhr","true");var rt=new window.XMLHttpRequest;rt.withCredentials=!0,rt.addEventListener("load",function(vt){Pe(JSON.parse(vt.target.responseText),ge)},!1),rt.addEventListener("error",function(vt){console.error(vt)},!1),rt.open("POST","".concat(Ae.a,"/api/attachments.json")),rt.send(Ge)}var ft=Q("giR+"),lt=Q("fyUT"),it=Q("7Kak"),ct=Q("9yH6"),Ve=ct.a.Group,Je={margin:"0 8px"},st=function(ge){var Pe=ge.callback,Ge=ge.onCancel;function rt(vt){Pe(vt)}return y.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:rt},y.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},y.a.createElement("span",{style:Je},"\u5355\u5143\u683C\u6570\uFF1A"),y.a.createElement("span",{style:Je},"\u884C\u6570"),y.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},y.a.createElement(lt.a,null)),y.a.createElement("span",{style:Je},"\u5217\u6570"),y.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},y.a.createElement(lt.a,null))),y.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},y.a.createElement("span",{style:Je},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),y.a.createElement(B.a.Item,{name:"align"},y.a.createElement(Ve,null,y.a.createElement(ct.a,{value:"default"},y.a.createElement("i",{className:"fa fa-align-justify"})),y.a.createElement(ct.a,{value:"left"},y.a.createElement("i",{className:"fa fa-align-left"})),y.a.createElement(ct.a,{value:"center"},y.a.createElement("i",{className:"fa fa-align-center"})),y.a.createElement(ct.a,{value:"right"},y.a.createElement("i",{className:"fa fa-align-right"}))))),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(W.a,{type:"ghost",onClick:Ge},"\u53D6\u6D88")))},gt=Q("ErOA"),ut=Q("7Cbv"),et="link",qe="upload-image",St="code-block",pt="add-table",nt="------------",at={default:nt,left:":".concat(nt),center:":".concat(nt,":"),right:"".concat(nt,":")},bt=Q("9VGf"),Et,Re;function Te(){}var Ke=0,ze=1e4,Ce="\u2581",We=`
**\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 ve(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,he=ce?"Cmd":"Ctrl",ne=["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"],oe=(Et={},Object(U.a)(Et,he+"-B","bold"),Object(U.a)(Et,he+"-I","italic"),Et),le=(Re={},Object(U.a)(Re,et,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(Re,St,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(Re,qe,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(Re,pt,"\u6DFB\u52A0\u8868\u683C"),Re),pe=$e.a=function(ge){var Pe=ge.defaultValue,Ge=Pe===void 0?"":Pe,rt=ge.onChange,vt=ge.width,tt=vt===void 0?"100%":vt,Wt=ge.height,Nt=Wt===void 0?400:Wt,_t=ge.miniToolbar,Qt=_t===void 0?!1:_t,Jt=ge.isFocus,Yt=Jt===void 0?!1:Jt,cn=ge.watch,jt=ge.insertTemp,rn=ge.mode,kt=rn===void 0?"markdown":rn,Xe=ge.id,Lt=Xe===void 0?"markdown-editor-id":Xe,Ut=ge.showResizeBar,Mt=Ut===void 0?!1:Ut,Zt=ge.noStorage,Ln=Zt===void 0?!1:Zt,Ni=ge.showNullButton,vn=Ni===void 0?!1:Ni,At=ge.hidetoolBar,li=At===void 0?!1:At,Li=ge.fullScreen,Zn=Li===void 0?!1:Li,an=ge.onBlur,Qn=ge.onCMBeforeChange,Ii=ge.onFullScreen,Ui=ge.className,ht=Ui===void 0?"":Ui,zt=ge.disablePaste,Di=zt===void 0?!1:zt,Hi=ge.placeholder,ir=Hi===void 0?"":Hi,Wi=ge.values,G=Wi===void 0?"":Wi,x=Object(b.useState)(null),A=Object(H.a)(x,2),F=A[0],q=A[1],z=Object(b.useState)(Ge),we=Object(H.a)(z,2),Ze=we[0],xt=we[1],Dt=Object(b.useState)(cn),ot=Object(H.a)(Dt,2),Kt=ot[0],$t=ot[1],Pn=Object(b.useState)(Zn),yi=Object(H.a)(Pn,2),fi=yi[0],Vn=yi[1],rr=Object(b.useState)(""),wr=Object(H.a)(rr,2),ii=wr[0],Ki=wr[1],yr=Object(b.useState)(0),ar=Object(H.a)(yr,2),bi=ar[0],Rr=ar[1],Sr=Object(b.useState)(Nt),Ar=Object(H.a)(Sr,2),Nr=Ar[0],or=Ar[1],ui=Object(b.useState)(!1),pr=Object(H.a)(ui,2),Ur=pr[0],mr=pr[1],In=Object(b.useRef)(Object(ut.a)()),on=Object(b.useRef)(!1),Wn=Object(b.useRef)(),ln=Object(b.useRef)(),Xn=Object(b.useRef)(),Cn=Object(b.useRef)(),sr=Object(b.useRef)(),di=function(){var Ft=Object(M.a)(I.a.mark(function qt(){var Ht,sn;return I.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(gt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:In.current}});case 2:sn=Nn.sent,sn!=null&&(Ht=sn.attachments)!==null&&Ht!==void 0&&Ht.length&&(console.log("cm:",F,ln),sn.attachments.map(function(bn){bn.content_type.indexOf("image")>-1?F.replaceSelection("![,](/api/attachments/".concat(bn.id,"?type=").concat(bn.content_type,")")):bn.content_type.indexOf("video")>-1?F.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):bn.content_type.indexOf("pdf")>-1?F.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(bn.id,"?type=").concat(bn.content_type,'&disposition=inline" target="_blank">').concat(bn.name,"</a>")):F.replaceSelection("[".concat(bn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(bn.id,"?type=").concat(bn.content_type,")"))}));case 4:case"end":return Nn.stop()}},qt)}));return function(){return Ft.apply(this,arguments)}}();Object(b.useEffect)(function(){xt(G),F==null||F.setValue(G)},[G]),Object(b.useEffect)(function(){Ii==null||Ii(fi)},[fi]),Object(b.useEffect)(function(){if(ln.current){var Ft=c.a.fromTextArea(ln.current,{mode:kt,lineNumbers:!Qt,lineWrapping:!0,value:Ge,autoCloseTags:!0,autoCloseBrackets:!0});Yt&&Ft.focus();function qt(Ht,sn){if(Di){sn.preventDefault();return}var yn=sn.clipboardData;if(yn){var Nn=yn.types.toString(),bn=yn.items;if(Nn==="Files"||yn.types.indexOf("Files")>-1){if(sn.preventDefault(),kt=="stex")return;try{var qn,ki=bn[1];((qn=bn[0])===null||qn===void 0?void 0:qn.kind)==="file"&&(ki=bn[0]);var hn=ki.getAsFile(),ur=hn.name.split(".").pop();He(hn,function(Dn){if(Dn.id){var pi,Ei,Qi;(hn==null||((pi=hn.type)===null||pi===void 0)?void 0:pi.indexOf("image"))>-1?Ft.replaceSelection("![,](/api/attachments/".concat(Dn.id,"?type=").concat(Dn.content_type,")")):(hn==null||((Ei=hn.type)===null||Ei===void 0)?void 0:Ei.indexOf("video"))>-1?Ft.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Dn.id,'"></video>')):(hn==null||((Qi=hn.type)===null||Qi===void 0)?void 0:Qi.indexOf("pdf"))>-1?Ft.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Dn.id,"?type=").concat(hn.type,'&disposition=inline" target="_blank">').concat(hn.name,"</a>")):ne.includes(ur)?Ft.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Dn.id,'?type=office&disposition=inline" target="_blank">').concat(hn.name,"</a>")):Ft.replaceSelection("[".concat(hn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Dn.id,"?type=").concat(Dn.content_type,")"))}else(Dn==null?void 0:Dn.status)===401&&(document.location.href="/user/login")})}catch(Dn){L.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ft.on("paste",qt),Ft.on("dragleave",function(Ht,sn){Xn.current.classList.remove("mouse-hover-md")}),Ft.on("dragover",function(Ht,sn){Xn.current.classList.add("mouse-hover-md")}),Ft.on("drop",function(Ht,sn){Xn.current.classList.add("mouse-hover-md");var yn;if(yn=sn.dataTransfer.files,yn.length>0){sn.preventDefault(),sn.stopPropagation();for(var Nn=function(ki){var hn=yn[ki],ur=hn.name.split(".").pop();He(hn,function(Dn){if(Dn.id){var pi,Ei,Qi;(hn==null||((pi=hn.type)===null||pi===void 0)?void 0:pi.indexOf("image"))>-1?Ft.replaceSelection("![,](/api/attachments/".concat(Dn.id,"?type=").concat(Dn.content_type,")")):(hn==null||((Ei=hn.type)===null||Ei===void 0)?void 0:Ei.indexOf("video"))>-1?Ft.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Dn.id,'"></video>')):(hn==null||((Qi=hn.type)===null||Qi===void 0)?void 0:Qi.indexOf("pdf"))>-1?Ft.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Dn.id,"?type=").concat(hn.type,'&disposition=inline" target="_blank">').concat(hn.name,"</a>")):ne.includes(ur)?Ft.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Dn.id,'?type=office&disposition=inline" target="_blank">').concat(hn.name,"</a>")):Ft.replaceSelection("[".concat(hn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Dn.id,"?type=").concat(Dn.content_type,")"))}else(Dn==null?void 0:Dn.status)===401&&(document.location.href="/user/login")})},bn=0;bn<yn.length;bn++)Nn(bn)}}),q(Ft),function(){Ft.off("paste",qt)}}},[]);var _i=Object(b.useCallback)(function(){if(Xn.current)try{}catch(Ft){console.log(Ft,"---- to set md editor body height")}},[Nr,Xn,fi]);Object(b.useEffect)(function(){function Ft(){var Ht=new r.default(function(sn){var yn=Object(P.a)(sn),Nn;try{for(yn.s();!(Nn=yn.n()).done;){var bn=Nn.value;(bn.target.offsetHeight>0||bn.target.offsetWidth>0)&&(_i(),F.setSize("100%","100%"),F.refresh())}}catch(qn){yn.e(qn)}finally{yn.f()}});return Ht.observe(ln.current.parentElement),Ht}if(F){var qt=Ft();return function(){qt.unobserve(ln.current.parentElement)}}},[F,_i]),Object(b.useEffect)(function(){if(F){for(var Ft=[],qt=function(){var bn=sn[Ht];yn=Object(H.a)(bn,2);var qn=yn[0],ki=yn[1],hn=Object(U.a)({},qn,function(){Cr(ki)});Ft.push(hn),F.addKeyMap(hn)},Ht=0,sn=Object.entries(oe);Ht<sn.length;Ht++){var yn;qt()}return Wn.current=setInterval(function(){on.current&&di()},4e3),function(){clearInterval(Wn.current);var Nn=Object(P.a)(Ft),bn;try{for(Nn.s();!(bn=Nn.n()).done;){var qn=bn.value;F.removeKeyMap(qn)}}catch(ki){Nn.e(ki)}finally{Nn.f()}}}},[F]),Object(b.useEffect)(function(){Zn!==fi&&Vn(Zn)},[Zn]),Object(bt.a)(function(){if(!Ln&&bi>0){var Ft=new Date().getTime(),qt=window.sessionStorage.getItem(Lt);Ft>=bi+ze&&(!qt||qt!==Ze)&&(window.sessionStorage.setItem(Lt,Ze),mr(!0))}},ze),Object(b.useEffect)(function(){$t(cn)},[F,cn]),Object(b.useEffect)(function(){F&&(Yt&&F.focus())},[F,Yt]),Object(b.useEffect)(function(){if(Kt&&F){var Ft=F.getScrollerElement();function qt(Ht){var sn=Ht.target;if(sr.current){var yn=sn.scrollTop/sn.scrollHeight;sr.current.scrollTop=sr.current.scrollHeight*yn}}return Ft.addEventListener("scroll",qt),function(){Ft.removeEventListener("scroll",qt)}}},[F,Kt]),Object(b.useEffect)(function(){if(F&&Qn){function Ft(qt,Ht){Qn(qt,Ht)}return F.on("beforeChange",Ft),function(){F.off("beforeChange",Ft)}}},[F,Qn]),Object(b.useEffect)(function(){if(F&&an){function Ft(){an(F.getValue())}return F.on("blur",Ft),function(){F.off("blur",Ft)}}},[F,an]),Object(b.useEffect)(function(){if(F){function Ft(qt){var Ht=qt.getValue();xt(Ht),Rr(new Date().getTime()),qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),rt&&rt(Ht)}return F.on("change",Ft),function(){F.off("change",Ft)}}},[F,rt]),Object(b.useEffect)(function(){F&&(Ge==null?(F.setValue(""),xt("")):Ge!==F.getValue()&&(F.setValue(Ge),xt(Ge),F.setCursor(F.lineCount(),0)))},[F,Ge]);var Cr=Object(b.useCallback)(function(Ft){var qt=F.getCursor(),Ht=F.getSelection(),sn=Ht.split(`
`);switch(Ft){case"bold":return F.replaceSelection("**"+Ht+"**"),Ht===""&&F.setCursor(qt.line,qt.ch+2),F.focus();case"italic":return F.replaceSelection("*"+Ht+"*"),Ht===""&&F.setCursor(qt.line,qt.ch+1),F.focus();case"code":return F.replaceSelection("`"+Ht+"`"),Ht===""&&F.setCursor(qt.line,qt.ch+1),F.focus();case"inline-latex":return F.replaceSelection("`$$"+Ht+"$$`"),Ht===""&&F.setCursor(qt.line,qt.ch+3),F.focus();case"latex":return F.replaceSelection("```latex\n"+Ht+"\n```"),F.setCursor(qt.line+1,Ht.length+1),F.focus();case"line-break":return F.replaceSelection(`<br/>
`),F.focus();case"list-ul":return Ht===""?F.replaceSelection("- "+Ht):F.replaceSelection(sn.map(function(yn){return yn===""?"":"- ".concat(yn)}).join(`
`)),F.focus();case"list-ol":return Ht===""?F.replaceSelection("1. "+Ht):F.replaceSelection(sn.map(function(yn,Nn){return yn===""?"":"".concat(Nn+1,". ").concat(yn)}).join(`
`)),F.focus();case"add-null-ch":return Ht===""&&F.setCursor(qt.line,qt.ch+1),F.replaceSelection(Ce),F.focus();case"inster-template-1":return Ht===""&&F.setCursor(qt.line,qt.ch),F.replaceSelection(We),F.focus();case"eraser":return F.setValue(""),F.focus();case"trigger-watch":return $t(!Kt),F.focus();case"trigger-full-screen":return Vn(!fi),F.focus();case et:Ki(et);return;case St:Ki(St);return;case qe:Ki(qe);return;case pt:Ki(pt);return;default:throw new Error}},[F,Kt,fi]),lr=Object(b.useCallback)(function(Ft){Ki("");switch(ii){case et:var qt=Ft.title,Ht=Ft.link;return F.replaceSelection("[".concat(qt,"](").concat(Ht,")")),F.focus();case St:var sn=Ft.language,yn=Ft.content;return F.replaceSelection(["```"+sn,yn,"```"].join(`
`)),F.focus();case qe:var Nn=Ft.src,bn=Ft.alt;return bn?F.replaceSelection("![ ".concat(bn," ]( ").concat(Nn,' "').concat(bn,'" )')):F.replaceSelection("![,](".concat(Nn,")")),F.focus();case pt:for(var qn=Ft.row,ki=Ft.col,hn=Ft.align,ur=`
`,Dn=0;Dn<qn;Dn++){for(var pi=[],Ei=[],Qi=0;Qi<ki;Qi++)Dn===1&&Ei.push(at[hn]),pi.push(" ");Dn===1&&(ur+="| ".concat(Ei.join(" | "),` |
`)),ur+="| ".concat(pi.join(ki===1?"":" | "),` |
`)}return F.replaceSelection(ur+`
`),F.focus();default:throw new Error}},[F,ii]),gr=Object(b.useMemo)(function(){switch(ii){case et:return y.a.createElement(ue,{callback:lr,onCancel:ji});case St:return y.a.createElement(me.b,{callback:lr,onCancel:ji});case qe:return y.a.createElement(Ee,{callback:lr,onCancel:ji});case pt:return y.a.createElement(st,{callback:lr,onCancel:ji});default:return null}},[ii]);function ji(){Ki("")}Object(b.useEffect)(function(){if(Cn.current){var Ft=Cn.current,qt=!1,Ht=0;function sn(bn){qt=!0,Ht=bn.pageY}function yn(){qt=!1}function Nn(bn){if(qt){var qn=bn.pageY-Ht;qn<0&&(qn=0),qn>300&&(qn=300);var ki=Nt+qn+"px";or(ki)}}return Ft.addEventListener("mousedown",sn),document.addEventListener("mousemove",Nn),document.addEventListener("mouseup",yn),function(){Ft.removeEventListener("mousedown",sn),document.removeEventListener("mousemove",Nn),document.removeEventListener("mouseup",yn)}}},[F,Cn]),Object(b.useEffect)(function(){or(Nt)},[Nt]);var zi=ve(tt),jr=ve(Nr),$i={width:zi,height:jr},Fr=Object(b.useMemo)(function(){if(bi){var Ft=new Date(bi),qt=Ft.getHours(),Ht=Ft.getMinutes(),sn=Ft.getSeconds();return qt=qt<10?"0"+qt:qt,Ht=Ht<10?"0"+Ht:Ht,sn=sn<10?"0"+sn:sn,"".concat(qt,":").concat(Ht,":").concat(sn)}return 0},[bi]);function Lr(){window.sessionStorage.removeItem(Lt),mr(!1),Rr(0)}function Ji(){mr(!1),Rr(0),F.setValue(window.sessionStorage.getItem(Lt))}function Jr(Ft,qt){var Ht=F.getValue();Ht=Ht.replace(Ft,qt),xt(Ht),F==null||F.setValue(Ht)}return y.a.createElement(b.Fragment,null,y.a.createElement("div",{className:"markdown-editor-wrapper",ref:Xn},y.a.createElement("div",{className:"markdown-editor-container ".concat(ht," ").concat(Kt?"on-preview":""," ").concat(Qt?"mini":""," ").concat(fi?"full-screen":""),style:$i},y.a.createElement(T,{insertTemp:jt,watch:Kt,fullScreen:fi,showNullButton:vn,onActionCallback:Cr,hidetoolBar:li,uuid:In.current,setOpenPhones:function(){on.current=!0}}),y.a.createElement("div",{className:"markdown-editor-body"},y.a.createElement("div",{className:"codemirror-container"},y.a.createElement("textarea",{ref:ln,placeholder:ir})),Kt?y.a.createElement("div",{ref:sr,className:"preview-container"},kt==="stex"&&y.a.createElement(C,{value:Ze}),kt!=="stex"&&y.a.createElement(E.a,{edit:!0,value:Ze,replaces:Jr})):null))),Mt?y.a.createElement("a",{ref:Cn,className:"editor-resize"}):null,y.a.createElement(N.a,null,le[ii]?y.a.createElement(X.a,{centered:!0,title:le[ii],visible:!0,onCancel:ji,footer:null,className:"markdown-popup-form"},gr):null))}},"SA+Z":function(Rt,$e,Q){var ae=Q("wTVA"),X=Q("EbDI"),P=Q("ZhPi"),V=Q("wkBT");function L(M){return ae(M)||X(M)||P(M)||V()}Rt.exports=L,Rt.exports.__esModule=!0,Rt.exports.default=Rt.exports},SJMd:function(Rt,$e){/**
* @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 Q,ae,X,P=!1,V,L;window.PR_SHOULD_USE_CONTINUATION=!0;var M,H;(function(){var U=window,k=["break,continue,do,else,for,if,return,while"],I=[k,"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"],b=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],y=[b,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[b,"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"],r="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",l=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",a=[k,"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"],s=[k,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],f=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[y,c,p,l,u,a,s,f],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,E="str",C="kwd",w="com",g="typ",v="lit",h="pun",o="pln",_="tag",m="dec",T="src",N="atn",j="atv",W="nocode",Y="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(Ve){for(var Je=0,st=!1,gt=!1,ut=0,et=Ve.length;ut<et;++ut){var qe=Ve[ut];if(qe.ignoreCase)gt=!0;else if(/[a-z]/i.test(qe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){st=!0,gt=!1;break}}var St={b:8,t:9,n:10,v:11,f:12,r:13};function pt(Re){var Te=Re.charCodeAt(0);if(Te!==92)return Te;var Ke=Re.charAt(1);return Te=St[Ke],Te||("0"<=Ke&&Ke<="7"?parseInt(Re.substring(1),8):Ke==="u"||Ke==="x"?parseInt(Re.substring(2),16):Re.charCodeAt(1))}function nt(Re){if(Re<32)return(Re<16?"\\x0":"\\x")+Re.toString(16);var Te=String.fromCharCode(Re);return Te==="\\"||Te==="-"||Te==="]"||Te==="^"?"\\"+Te:Te}function at(Re){var Te=Re.substring(1,Re.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")),Ke=[],ze=Te[0]==="^",Ce=["["];ze&&Ce.push("^");for(var We=ze?1:0,ve=Te.length;We<ve;++We){var ce=Te[We];if(/\\[bdsw]/i.test(ce))Ce.push(ce);else{var he=pt(ce),ne;We+2<ve&&Te[We+1]==="-"?(ne=pt(Te[We+2]),We+=2):ne=he,Ke.push([he,ne]),ne<65||he>122||(ne<65||he>90||Ke.push([Math.max(65,he)|32,Math.min(ne,90)|32]),ne<97||he>122||Ke.push([Math.max(97,he)&~32,Math.min(ne,122)&~32]))}}Ke.sort(function(ge,Pe){return ge[0]-Pe[0]||Pe[1]-ge[1]});for(var oe=[],le=[],We=0;We<Ke.length;++We){var pe=Ke[We];pe[0]<=le[1]+1?le[1]=Math.max(le[1],pe[1]):oe.push(le=pe)}for(var We=0;We<oe.length;++We){var pe=oe[We];Ce.push(nt(pe[0])),pe[1]>pe[0]&&(pe[1]+1>pe[0]&&Ce.push("-"),Ce.push(nt(pe[1])))}return Ce.push("]"),Ce.join("")}function bt(Re){for(var Te=Re.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")),Ke=Te.length,ze=[],Ce=0,We=0;Ce<Ke;++Ce){var ve=Te[Ce];if(ve==="(")++We;else if(ve.charAt(0)==="\\"){var ce=+ve.substring(1);ce&&(ce<=We?ze[ce]=-1:Te[Ce]=nt(ce))}}for(var Ce=1;Ce<ze.length;++Ce)ze[Ce]===-1&&(ze[Ce]=++Je);for(var Ce=0,We=0;Ce<Ke;++Ce){var ve=Te[Ce];if(ve==="(")++We,ze[We]||(Te[Ce]="(?:");else if(ve.charAt(0)==="\\"){var ce=+ve.substring(1);ce&&ce<=We&&(Te[Ce]="\\"+ze[ce])}}for(var Ce=0;Ce<Ke;++Ce)Te[Ce]==="^"&&Te[Ce+1]!=="^"&&(Te[Ce]="");if(Re.ignoreCase&&st)for(var Ce=0;Ce<Ke;++Ce){var ve=Te[Ce],he=ve.charAt(0);ve.length>=2&&he==="["?Te[Ce]=at(ve):he!=="\\"&&(Te[Ce]=ve.replace(/[a-zA-Z]/g,function(le){var pe=le.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return Te.join("")}for(var Et=[],ut=0,et=Ve.length;ut<et;++ut){var qe=Ve[ut];if(qe.global||qe.multiline)throw new Error(""+qe);Et.push("(?:"+bt(qe)+")")}return new RegExp(Et.join("|"),gt?"gi":"g")}function R(Ve,Je){var st=/(?:^|\s)nocode(?:\s|$)/,gt=[],ut=0,et=[],qe=0;function St(pt){var nt=pt.nodeType;if(nt==1){if(st.test(pt.className))return;for(var at=pt.firstChild;at;at=at.nextSibling)St(at);var bt=pt.nodeName.toLowerCase();(bt==="br"||bt==="li")&&(gt[qe]=`
`,et[qe<<1]=ut++,et[qe++<<1|1]=pt)}else if(nt==3||nt==4){var Et=pt.nodeValue;Et.length&&(Je?Et=Et.replace(/\r\n?/g,`
`):Et=Et.replace(/[ \t\r\n]+/g," "),gt[qe]=Et,et[qe<<1]=ut,ut+=Et.length,et[qe++<<1|1]=pt)}}return St(Ve),{sourceCode:gt.join("").replace(/\n$/,""),spans:et}}function $(Ve,Je,st,gt,ut){if(!st)return;var et={sourceNode:Ve,pre:1,langExtension:null,numberLines:null,sourceCode:st,spans:null,basePos:Je,decorations:null};gt(et),ut.push.apply(ut,et.decorations)}var te=/\S/;function ue(Ve){for(var Je=void 0,st=Ve.firstChild;st;st=st.nextSibling){var gt=st.nodeType;Je=gt===1?Je?Ve:st:gt===3&&te.test(st.nodeValue)?Ve:Je}return Je===Ve?void 0:Je}function me(Ve,Je){var st={},gt;(function(){for(var qe=Ve.concat(Je),St=[],pt={},nt=0,at=qe.length;nt<at;++nt){var bt=qe[nt],Et=bt[3];if(Et)for(var Re=Et.length;--Re>=0;)st[Et.charAt(Re)]=bt;var Te=bt[1],Ke=""+Te;pt.hasOwnProperty(Ke)||(St.push(Te),pt[Ke]=null)}St.push(/[\0-\uffff]/),gt=B(St)})();var ut=Je.length,et=function(qe){for(var St=qe.sourceCode,pt=qe.basePos,nt=qe.sourceNode,at=[pt,o],bt=0,Et=St.match(gt)||[],Re={},Te=0,Ke=Et.length;Te<Ke;++Te){var ze=Et[Te],Ce=Re[ze],We=void 0,ve;if(typeof Ce=="string")ve=!1;else{var ce=st[ze.charAt(0)];if(ce)We=ze.match(ce[1]),Ce=ce[0];else{for(var he=0;he<ut;++he)if(ce=Je[he],We=ze.match(ce[1]),We){Ce=ce[0];break}We||(Ce=o)}ve=Ce.length>=5&&Ce.substring(0,5)==="lang-",ve&&!(We&&typeof We[1]=="string")&&(ve=!1,Ce=T),ve||(Re[ze]=Ce)}var ne=bt;if(bt+=ze.length,!ve)at.push(pt+ne,Ce);else{var oe=We[1],le=ze.indexOf(oe),pe=le+oe.length;We[2]&&(pe=ze.length-We[2].length,le=pe-oe.length);var ge=Ce.substring(5);$(nt,pt+ne,ze.substring(0,le),et,at),$(nt,pt+ne+le,oe,se(ge,oe),at),$(nt,pt+ne+pe,ze.substring(pe),et,at)}}qe.decorations=at};return et}function Me(Ve){var Je=[],st=[];Ve.tripleQuotedStrings?Je.push([E,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ve.multiLineStrings?Je.push([E,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Je.push([E,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ve.verbatimStrings&&st.push([E,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var gt=Ve.hashComments;gt&&(Ve.cStyleComments?(gt>1?Je.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Je.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),st.push([E,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Je.push([w,/^#[^\r\n]*/,null,"#"])),Ve.cStyleComments&&(st.push([w,/^\/\/[^\r\n]*/,null]),st.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ut=Ve.regexLiterals;if(ut){var et=ut>1?"":`
\r`,qe=et?".":"[\\S\\s]",St="/(?=[^/*"+et+"])(?:[^/\\x5B\\x5C"+et+"]|\\x5C"+qe+"|\\x5B(?:[^\\x5C\\x5D"+et+"]|\\x5C"+qe+")*(?:\\x5D|$))+/";st.push(["lang-regex",RegExp("^"+Y+"("+St+")")])}var pt=Ve.types;pt&&st.push([g,pt]);var nt=(""+Ve.keywords).replace(/^ | $/g,"");nt.length&&st.push([C,new RegExp("^(?:"+nt.replace(/[\s,]+/g,"|")+")\\b"),null]),Je.push([o,/^\s+/,null,` \r
\xA0`]);var at="^.[^\\s\\w.$@'\"`/\\\\]*";return Ve.regexLiterals&&(at+="(?!s*/)"),st.push([v,/^@[a-z_$][a-z_$@0-9]*/i,null],[g,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[v,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[h,new RegExp(at),null]),me(Je,st)}var Ae=Me({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function De(Ve,Je,st){for(var gt=/(?:^|\s)nocode(?:\s|$)/,ut=/\r\n?|\n/,et=Ve.ownerDocument,qe=et.createElement("li");Ve.firstChild;)qe.appendChild(Ve.firstChild);var St=[qe];function pt(Te){var Ke=Te.nodeType;if(Ke==1&&!gt.test(Te.className))if(Te.nodeName==="br")nt(Te),Te.parentNode&&Te.parentNode.removeChild(Te);else for(var ze=Te.firstChild;ze;ze=ze.nextSibling)pt(ze);else if((Ke==3||Ke==4)&&st){var Ce=Te.nodeValue,We=Ce.match(ut);if(We){var ve=Ce.substring(0,We.index);Te.nodeValue=ve;var ce=Ce.substring(We.index+We[0].length);if(ce){var he=Te.parentNode;he.insertBefore(et.createTextNode(ce),Te.nextSibling)}nt(Te),ve||Te.parentNode.removeChild(Te)}}}function nt(Te){for(;!Te.nextSibling;)if(Te=Te.parentNode,!Te)return;function Ke(We,ve){var ce=ve?We.cloneNode(!1):We,he=We.parentNode;if(he){var ne=Ke(he,1),oe=We.nextSibling;ne.appendChild(ce);for(var le=oe;le;le=oe)oe=le.nextSibling,ne.appendChild(le)}return ce}for(var ze=Ke(Te.nextSibling,0),Ce;(Ce=ze.parentNode)&&Ce.nodeType===1;)ze=Ce;St.push(ze)}for(var at=0;at<St.length;++at)pt(St[at]);Je===(Je|0)&&St[0].setAttribute("value",Je);var bt=et.createElement("ol");bt.className="linenums";for(var Et=Math.max(0,Je-1|0)||0,at=0,Re=St.length;at<Re;++at)qe=St[at],qe.className="L"+(at+Et)%10,qe.firstChild||qe.appendChild(et.createTextNode("\xA0")),bt.appendChild(qe);Ve.appendChild(bt)}function Fe(Ve){var Je=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Je=Je&&+Je[1]<=8;var st=/\n/g,gt=Ve.sourceCode,ut=gt.length,et=0,qe=Ve.spans,St=qe.length,pt=0,nt=Ve.decorations,at=nt.length,bt=0;nt[at]=ut;var Et,Re;for(Re=Et=0;Re<at;)nt[Re]!==nt[Re+2]?(nt[Et++]=nt[Re++],nt[Et++]=nt[Re++]):Re+=2;for(at=Et,Re=Et=0;Re<at;){for(var Te=nt[Re],Ke=nt[Re+1],ze=Re+2;ze+2<=at&&nt[ze+1]===Ke;)ze+=2;nt[Et++]=Te,nt[Et++]=Ke,Re=ze}at=nt.length=Et;var Ce=Ve.sourceNode,We="";Ce&&(We=Ce.style.display,Ce.style.display="none");try{for(var ve=null;pt<St;){var ce=qe[pt],he=qe[pt+2]||ut,ne=nt[bt+2]||ut,ze=Math.min(he,ne),oe=qe[pt+1],le;if(oe.nodeType!==1&&(le=gt.substring(et,ze))){Je&&(le=le.replace(st,"\r")),oe.nodeValue=le;var pe=oe.ownerDocument,ge=pe.createElement("span");ge.className=nt[bt+1];var Pe=oe.parentNode;Pe.replaceChild(ge,oe),ge.appendChild(oe),et<he&&(qe[pt+1]=oe=pe.createTextNode(gt.substring(ze,he)),Pe.insertBefore(oe,ge.nextSibling))}et=ze,et>=he&&(pt+=2),et>=ne&&(bt+=2)}}finally{Ce&&(Ce.style.display=We)}}var Ne={};function Ee(Ve,Je){for(var st=Je.length;--st>=0;){var gt=Je[st];Ne.hasOwnProperty(gt)?U.console&&console.warn("cannot override language handler %s",gt):Ne[gt]=Ve}}function se(Ve,Je){return Ve&&Ne.hasOwnProperty(Ve)||(Ve=/^\s*</.test(Je)?"default-markup":"default-code"),Ne[Ve]}Ee(Ae,["default-code"]),Ee(me([],[[o,/^[^<?]+/],[m,/^<!\w[^>]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["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"]),Ee(me([[o,/^[\s]+/,null,` \r
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["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"]),Ee(me([],[[j,/^[\s\S]+/]]),["uq.val"]),Ee(Me({keywords:y,hashComments:!0,cStyleComments:!0,types:S}),["c","cc","cpp","cxx","cyc","m"]),Ee(Me({keywords:"null,true,false"}),["json"]),Ee(Me({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]),Ee(Me({keywords:p,cStyleComments:!0}),["java"]),Ee(Me({keywords:f,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ee(Me({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ee(Me({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ee(Me({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ee(Me({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ee(Me({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ee(me([],[[E,/^[\s\S]+/]]),["regex"]);function He(Ve){var Je=Ve.langExtension;try{var st=R(Ve.sourceNode,Ve.pre),gt=st.sourceCode;Ve.sourceCode=gt,Ve.spans=st.spans,Ve.basePos=0,se(Je,gt)(Ve),Fe(Ve)}catch(ut){U.console&&console.log(ut&&ut.stack||ut)}}function ft(Ve,Je,st){var gt=st||!1,ut=Je||null,et=document.createElement("div");et.innerHTML="<pre>"+Ve+"</pre>",et=et.firstChild,gt&&De(et,gt,!0);var qe={langExtension:ut,numberLines:gt,sourceNode:et,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return He(qe),et.innerHTML}function lt(Ve,Je){var st=Je||document.body,gt=st.ownerDocument||document;function ut(ce){return st.getElementsByTagName(ce)}for(var et=[ut("pre"),ut("code"),ut("xmp")],qe=[],St=0;St<et.length;++St)for(var pt=0,nt=et[St].length;pt<nt;++pt)qe.push(et[St][pt]);et=null;var at=Date;at.now||(at={now:function(){return+new Date}});var bt=0,Et=/\blang(?:uage)?-([\w.]+)(?!\S)/,Re=/\bprettyprint\b/,Te=/\bprettyprinted\b/,Ke=/pre|xmp/i,ze=/^code$/i,Ce=/^(?:pre|code|xmp)$/i,We={};function ve(){for(var ce=U.PR_SHOULD_USE_CONTINUATION?at.now()+250:Infinity;bt<qe.length&&at.now()<ce;bt++){for(var he=qe[bt],ne=We,oe=he;oe=oe.previousSibling;){var le=oe.nodeType,pe=(le===7||le===8)&&oe.nodeValue;if(pe?!/^\??prettify\b/.test(pe):le!==3||/\S/.test(oe.nodeValue))break;if(pe){ne={},pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(cn,jt,rn){ne[jt]=rn});break}}var ge=he.className;if((ne!==We||Re.test(ge))&&!Te.test(ge)){for(var Pe=!1,Ge=he.parentNode;Ge;Ge=Ge.parentNode){var rt=Ge.tagName;if(Ce.test(rt)&&Ge.className&&Re.test(Ge.className)){Pe=!0;break}}if(!Pe){he.className+=" prettyprinted";var vt=ne.lang;if(!vt){vt=ge.match(Et);var tt;!vt&&(tt=ue(he))&&ze.test(tt.tagName)&&(vt=tt.className.match(Et)),vt&&(vt=vt[1])}var Wt;if(Ke.test(he.tagName))Wt=1;else{var Nt=he.currentStyle,_t=gt.defaultView,Qt=Nt?Nt.whiteSpace:_t&&_t.getComputedStyle?_t.getComputedStyle(he,null).getPropertyValue("white-space"):0;Wt=Qt&&Qt.substring(0,3)==="pre"}var Jt=ne.linenums;(Jt=Jt==="true"||+Jt)||(Jt=ge.match(/\blinenums\b(?::(\d+))?/),Jt=Jt?Jt[1]&&Jt[1].length?+Jt[1]:!0:!1),Jt&&De(he,Jt,Wt);var Yt={langExtension:vt,sourceNode:he,numberLines:Jt,pre:Wt,sourceCode:null,basePos:null,spans:null,decorations:null};He(Yt)}}}bt<qe.length?U.setTimeout(ve,250):typeof Ve=="function"&&Ve()}ve()}var it=U.PR={createSimpleLexer:me,registerLangHandler:Ee,sourceDecorator:Me,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:j,PR_COMMENT:w,PR_DECLARATION:m,PR_KEYWORD:C,PR_LITERAL:v,PR_NOCODE:W,PR_PLAIN:o,PR_PUNCTUATION:h,PR_SOURCE:T,PR_STRING:E,PR_TAG:_,PR_TYPE:g,prettyPrintOne:P?U.prettyPrintOne=ft:M=ft,prettyPrint:H=P?U.prettyPrint=lt:H=lt},ct=U.define;typeof ct=="function"&&ct.amd&&ct("google-code-prettify",[],function(){return it})})()},TXwP:function(Rt,$e,Q){var ae,X;(function(){var P;(function(){"use strict";var L=[,,function(k){function I(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}I.prototype.clone_empty=function(){var p=new I(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},I.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},I.prototype.has_match=function(p){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(p))return!0;return!1},I.prototype.set_indent=function(p,c){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(p){this.__items.push(p);var c=p.lastIndexOf(`
`);c!==-1?this.__character_count=p.length-c:this.__character_count+=p.length},I.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function b(p,c){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),c=c||"",p.indent_level>0&&(c=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}b.prototype.get_indent_size=function(p,c){var r=this.__base_string_length;return c=c||0,p<0&&(r=0),r+=p*this.__indent_size,r+=c,r},b.prototype.get_indent_string=function(p,c){var r=this.__base_string;return c=c||0,p<0&&(p=0,r=""),c+=p*this.__indent_size,this.__ensure_cache(c),r+=this.__cache[c],r},b.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var p=this.__cache.length,c=0,r="";this.__indent_size&&p>=this.__indent_size&&(c=Math.floor(p/this.__indent_size),p-=c*this.__indent_size,r=new Array(c+1).join(this.__indent_string)),p&&(r+=new Array(p+1).join(" ")),this.__cache.push(r)};function y(p,c){this.__indent_cache=new b(p,c),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}y.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},y.prototype.get_line_number=function(){return this.__lines.length},y.prototype.get_indent_string=function(p,c){return this.__indent_cache.get_indent_string(p,c)},y.prototype.get_indent_size=function(p,c){return this.__indent_cache.get_indent_size(p,c)},y.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},y.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},y.prototype.get_code=function(p){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return p!==`
`&&(r=r.replace(/[\n]/g,p)),r},y.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},y.prototype.set_indent=function(p,c){return p=p||0,c=c||0,this.next_line.set_indent(p,c),this.__lines.length>1?(this.current_line.set_indent(p,c),!0):(this.current_line.set_indent(),!1)},y.prototype.add_raw_token=function(p){for(var c=0;c<p.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},y.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},y.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},y.prototype.remove_indent=function(p){for(var c=this.__lines.length;p<c;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},y.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},y.prototype.just_added_newline=function(){return this.current_line.is_empty()},y.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},y.prototype.ensure_empty_line_above=function(p,c){for(var r=this.__lines.length-2;r>=0;){var l=this.__lines[r];if(l.is_empty())break;if(l.item(0).indexOf(p)!==0&&l.item(-1)!==c){this.__lines.splice(r+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},k.exports.Output=y},,,,function(k){function I(p,c){this.raw_options=b(p,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(p,c){var r=this.raw_options[p],l=c||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(l=r.concat()):typeof r=="string"&&(l=r.split(/[^a-zA-Z0-9_\/\-]+/)),l},I.prototype._get_boolean=function(p,c){var r=this.raw_options[p],l=r===void 0?!!c:!!r;return l},I.prototype._get_characters=function(p,c){var r=this.raw_options[p],l=c||"";return typeof r=="string"&&(l=r.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},I.prototype._get_number=function(p,c){var r=this.raw_options[p];c=parseInt(c,10),isNaN(c)&&(c=0);var l=parseInt(r,10);return isNaN(l)&&(l=c),l},I.prototype._get_selection=function(p,c,r){var l=this._get_selection_list(p,c,r);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[p]+"'");return l[0]},I.prototype._get_selection_list=function(p,c,r){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[c[0]],!this._is_valid_selection(r,c))throw new Error("Invalid Default Value!");var l=this._get_array(p,r);if(!this._is_valid_selection(l,c))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[p]+"'");return l},I.prototype._is_valid_selection=function(p,c){return p.length&&c.length&&!p.some(function(r){return c.indexOf(r)===-1})};function b(p,c){var r={};p=y(p);var l;for(l in p)l!==c&&(r[l]=p[l]);if(c&&p[c])for(l in p[c])r[l]=p[c][l];return r}function y(p){var c={},r;for(r in p){var l=r.replace(/-/g,"_");c[l]=p[r]}return c}k.exports.Options=I,k.exports.normalizeOpts=y,k.exports.mergeOpts=b},,function(k){var I=RegExp.prototype.hasOwnProperty("sticky");function b(y){this.__input=y||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__input.charAt(this.__position),this.__position+=1),y},b.prototype.peek=function(y){var p=null;return y=y||0,y+=this.__position,y>=0&&y<this.__input_length&&(p=this.__input.charAt(y)),p},b.prototype.__match=function(y,p){y.lastIndex=p;var c=y.exec(this.__input);return c&&!(I&&y.sticky)&&(c.index!==p&&(c=null)),c},b.prototype.test=function(y,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(y,p):!1},b.prototype.testChar=function(y,p){var c=this.peek(p);return y.lastIndex=0,c!==null&&y.test(c)},b.prototype.match=function(y){var p=this.__match(y,this.__position);return p?this.__position+=p[0].length:p=null,p},b.prototype.read=function(y,p,c){var r="",l;return y&&(l=this.match(y),l&&(r+=l[0])),p&&(l||!y)&&(r+=this.readUntil(p,c)),r},b.prototype.readUntil=function(y,p){var c="",r=this.__position;y.lastIndex=this.__position;var l=y.exec(this.__input);return l?(r=l.index,p&&(r+=l[0].length)):r=this.__input_length,c=this.__input.substring(this.__position,r),this.__position=r,c},b.prototype.readUntilAfter=function(y){return this.readUntil(y,!0)},b.prototype.get_regexp=function(y,p){var c=null,r="g";return p&&I&&(r="y"),typeof y=="string"&&y!==""?c=new RegExp(y,r):y&&(c=new RegExp(y.source,r)),c},b.prototype.get_literal_regexp=function(y){return RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(y){var p=this.__position,c=this.readUntilAfter(y);return this.__position=p,c},b.prototype.lookBack=function(y){var p=this.__position-1;return p>=y.length&&this.__input.substring(p-y.length,p).toLowerCase()===y},k.exports.InputScanner=b},,,,,function(k){function I(b,y){b=typeof b=="string"?b:b.source,y=typeof y=="string"?y:y.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+y,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+y,"g")}I.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var y={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(b);p;)y[p[1]]=p[2],p=this.__directive_pattern.exec(b);return y},I.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=I},,function(k,I,b){var y=b(16).Beautifier,p=b(17).Options;function c(r,l){var u=new y(r,l);return u.beautify()}k.exports=c,k.exports.defaultOptions=function(){return new p}},function(k,I,b){var y=b(17).Options,p=b(2).Output,c=b(8).InputScanner,r=b(13).Directives,l=new r(/\/\*/,/\*\//),u=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,s=/\s/,f=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,S=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function E(C,w){this._source_text=C||"",this._options=new y(w),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}E.prototype.eatString=function(C){var w="";for(this._ch=this._input.next();this._ch;){if(w+=this._ch,this._ch==="\\")w+=this._input.next();else if(C.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return w},E.prototype.eatWhitespace=function(C){for(var w=s.test(this._input.peek()),g=0;s.test(this._input.peek());)this._ch=this._input.next(),C&&this._ch===`
`&&((g===0||g<this._options.max_preserve_newlines)&&(g++,this._output.add_new_line(!0)));return w},E.prototype.foundNestedPseudoClass=function(){for(var C=0,w=1,g=this._input.peek(w);g;){if(g==="{")return!0;if(g==="(")C+=1;else if(g===")"){if(C===0)return!1;C-=1}else if(g===";"||g==="}")return!1;w++,g=this._input.peek(w)}return!1},E.prototype.print_string=function(C){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(C)},E.prototype.preserveSingleSpace=function(C){C&&(this._output.space_before_token=!0)},E.prototype.indent=function(){this._indentLevel++},E.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},E.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,w=this._options.eol;w==="auto"&&(w=`
`,C&&u.test(C||"")&&(w=C.match(u)[0])),C=C.replace(a,`
`);var g=C.match(/^[\t ]*/)[0];this._output=new p(this._options,g),this._input=new c(C),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var v=0,h=!1,o=!1,_=!1,m=!1,T=!1,N=!1,j=this._ch,W=!1,Y,B,R;Y=this._input.read(f),B=Y!=="",R=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var $=this._input.read(O),te=l.get_directives($);te&&te.ignore==="start"&&($+=l.readIgnored(this._input)),this.print_string($),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(S)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ue=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ue.match(/[ :]$/)&&(ue=this.eatString(": ").replace(/\s$/,""),this.print_string(ue),this._output.space_before_token=!0),ue=ue.replace(/\s$/,""),ue==="extend"?m=!0:ue==="import"&&(T=!0),ue in this.NESTED_AT_RULE?(this._nestedLevel+=1,ue in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!h&&v===0&&ue.indexOf(":")!==-1&&(o=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")o&&(o=!1,this.outdent()),_?(_=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(R==="("?this._output.space_before_token=!1:R!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),R==="{"&&this._output.trim(!0),T=!1,m=!1,o&&(this.outdent(),o=!1),this.print_string(this._ch),h=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var me=0;me<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;me++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[me])){W=!0;break}(h||_)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!m&&v===0?(this.print_string(":"),o||(o=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Me=R==='"'||R==="'";this.preserveSingleSpace(Me||B),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")W=!1,v===0?(o&&(this.outdent(),o=!1),m=!1,T=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),v++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),v&&(v--,this.outdent()));else{var Ae=!1;this._input.lookBack("with")&&(Ae=!0),this.preserveSingleSpace(B||Ae),this.print_string(this._ch),o&&R==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),v++,this.indent())}else if(this._ch===")")v&&(v--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!o||N)&&v===0&&!T&&!m?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!o&&v===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&s.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),s.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var De=R==='"'||R==="'";this.preserveSingleSpace(De||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&W&&this._output.add_new_line()}var Fe=this._output.get_code(w);return Fe},k.exports.Beautifier=E},function(k,I,b){var y=b(6).Options;function p(c){y.call(this,c,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var r=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||r;var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var u=0;u<l.length;u++)l[u]!=="expand"?this.brace_style="collapse":this.brace_style=l[u]}p.prototype=new y,k.exports.Options=p}],M={};function H(k){var I=M[k];if(I!==void 0)return I.exports;var b=M[k]={exports:{}};return L[k](b,b.exports,H),b.exports}var U=H(15);P=U})();var V=P;!(ae=[],X=function(){return{css_beautify:V}}.apply($e,ae),X!==void 0&&(Rt.exports=X))})()},"VrN/":function(Rt,$e,Q){(function(ae,X){Rt.exports=X()})(this,function(){"use strict";var ae=navigator.userAgent,X=navigator.platform,P=/gecko\/\d/i.test(ae),V=/MSIE \d/.test(ae),L=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ae),M=/Edge\/(\d+)/.exec(ae),H=V||L||M,U=H&&(V?document.documentMode||6:+(M||L)[1]),k=!M&&/WebKit\//.test(ae),I=k&&/Qt\/\d+\.\d+/.test(ae),b=!M&&/Chrome\//.test(ae),y=/Opera\//.test(ae),p=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ae),r=/PhantomJS/.test(ae),l=!M&&/AppleWebKit/.test(ae)&&/Mobile\/\w+/.test(ae),u=/Android/.test(ae),a=l||u||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ae),s=l||/Mac/.test(X),f=/\bCrOS\b/.test(ae),O=/win/i.test(X),S=y&&ae.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(y=!1,k=!0);var E=s&&(I||y&&(S==null||S<12.11)),C=P||H&&U>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var g=function(e,t){var i=e.className,n=w(t).exec(i);if(n){var d=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(d?n[1]+d:"")}};function v(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function h(e,t){return v(e).appendChild(t)}function o(e,t,i,n){var d=document.createElement(e);if(i&&(d.className=i),n&&(d.style.cssText=n),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var D=0;D<t.length;++D)d.appendChild(t[D]);return d}function _(e,t,i,n){var d=o(e,t,i,n);return d.setAttribute("role","presentation"),d}var m;document.createRange?m=function(e,t,i,n){var d=document.createRange();return d.setEnd(n||e,i),d.setStart(e,t),d}:m=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(d){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function T(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 N(){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 j(e,t){var i=e.className;w(t).test(i)||(e.className+=(i?" ":"")+t)}function W(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!w(i[n]).test(t)&&(t+=" "+i[n]);return t}var Y=function(e){e.select()};l?Y=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&(Y=function(e){try{e.select()}catch(t){}});function B(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function $(e,t,i,n,d){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var D=n||0,K=d||0;;){var J=e.indexOf(" ",D);if(J<0||J>=t)return K+(t-D);K+=J-D,K+=i-K%i,D=J+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=B(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 i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function ue(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var me=50,Me={toString:function(){return"CodeMirror.Pass"}},Ae={scroll:!1},De={origin:"*mouse"},Fe={origin:"+move"};function Ne(e,t,i){for(var n=0,d=0;;){var D=e.indexOf(" ",n);D==-1&&(D=e.length);var K=D-n;if(D==e.length||d+K>=t)return n+Math.min(K,t-d);if(d+=D-n,d+=i-d%i,n=D+1,d>=t)return n}}var Ee=[""];function se(e){for(;Ee.length<=e;)Ee.push(He(Ee)+" ");return Ee[e]}function He(e){return e[e.length-1]}function ft(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function lt(e,t,i){for(var n=0,d=i(t);n<e.length&&i(e[n])<=d;)n++;e.splice(n,0,t)}function it(){}function ct(e,t){var i;return Object.create?i=Object.create(e):(it.prototype=e,i=new it),t&&R(t,i),i}var Ve=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Je(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ve.test(e))}function st(e,t){return t?t.source.indexOf("\\w")>-1&&Je(e)?!0:t.test(e):Je(e)}function gt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ut=/[\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 et(e){return e.charCodeAt(0)>=768&&ut.test(e)}function qe(e,t,i){for(;(i<0?t>0:t<e.length)&&et(e.charAt(t));)t+=i;return t}function St(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var d=(t+i)/2,D=n<0?Math.ceil(d):Math.floor(d);if(D==t)return e(D)?t:i;e(D)?i=D:t=D+n}}function pt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var d=!1,D=0;D<e.length;++D){var K=e[D];(K.from<i&&K.to>t||t==i&&K.to==t)&&(n(Math.max(K.from,t),Math.min(K.to,i),K.level==1?"rtl":"ltr",D),d=!0)}d||n(t,i,"ltr")}var nt=null;function at(e,t,i){var n;nt=null;for(var d=0;d<e.length;++d){var D=e[d];if(D.from<t&&D.to>t)return d;D.to==t&&(D.from!=D.to&&i=="before"?n=d:nt=d),D.from==t&&(D.from!=D.to&&i!="before"?n=d:nt=d)}return n!=null?n:nt}var bt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ie){return ie<=247?e.charAt(ie):1424<=ie&&ie<=1524?"R":1536<=ie&&ie<=1785?t.charAt(ie-1536):1774<=ie&&ie<=2220?"r":8192<=ie&&ie<=8203?"w":ie==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,D=/[LRr]/,K=/[Lb1n]/,J=/[1n]/;function Z(ie,be,Se){this.level=ie,this.from=be,this.to=Se}return function(ie,be){var Se=be=="ltr"?"L":"R";if(ie.length==0||be=="ltr"&&!n.test(ie))return!1;for(var Be=ie.length,Ue=[],Qe=0;Qe<Be;++Qe)Ue.push(i(ie.charCodeAt(Qe)));for(var dt=0,Tt=Se;dt<Be;++dt){var Ct=Ue[dt];Ct=="m"?Ue[dt]=Tt:Tt=Ct}for(var It=0,Ot=Se;It<Be;++It){var Pt=Ue[It];Pt=="1"&&Ot=="r"?Ue[It]="n":D.test(Pt)&&(Ot=Pt,Pt=="r"&&(Ue[It]="R"))}for(var tn=1,Vt=Ue[0];tn<Be-1;++tn){var gn=Ue[tn];gn=="+"&&Vt=="1"&&Ue[tn+1]=="1"?Ue[tn]="1":gn==","&&Vt==Ue[tn+1]&&(Vt=="1"||Vt=="n")&&(Ue[tn]=Vt),Vt=gn}for(var Jn=0;Jn<Be;++Jn){var Mi=Ue[Jn];if(Mi==",")Ue[Jn]="N";else if(Mi=="%"){var si=void 0;for(si=Jn+1;si<Be&&Ue[si]=="%";++si);for(var vr=Jn&&Ue[Jn-1]=="!"||si<Be&&Ue[si]=="1"?"1":"N",cr=Jn;cr<si;++cr)Ue[cr]=vr;Jn=si-1}}for(var xi=0,hr=Se;xi<Be;++xi){var Bi=Ue[xi];hr=="L"&&Bi=="1"?Ue[xi]="L":D.test(Bi)&&(hr=Bi)}for(var Ai=0;Ai<Be;++Ai)if(d.test(Ue[Ai])){var Ti=void 0;for(Ti=Ai+1;Ti<Be&&d.test(Ue[Ti]);++Ti);for(var hi=(Ai?Ue[Ai-1]:Se)=="L",fr=(Ti<Be?Ue[Ti]:Se)=="L",za=hi==fr?hi?"L":"R":Se,pa=Ai;pa<Ti;++pa)Ue[pa]=za;Ai=Ti-1}for(var Yi=[],$r,Pi=0;Pi<Be;)if(K.test(Ue[Pi])){var ps=Pi;for(++Pi;Pi<Be&&K.test(Ue[Pi]);++Pi);Yi.push(new Z(0,ps,Pi))}else{var ia=Pi,Ta=Yi.length,wa=be=="rtl"?1:0;for(++Pi;Pi<Be&&Ue[Pi]!="L";++Pi);for(var nr=ia;nr<Pi;)if(J.test(Ue[nr])){ia<nr&&(Yi.splice(Ta,0,new Z(1,ia,nr)),Ta+=wa);var Ga=nr;for(++nr;nr<Pi&&J.test(Ue[nr]);++nr);Yi.splice(Ta,0,new Z(2,Ga,nr)),Ta+=wa,ia=nr}else++nr;ia<Pi&&Yi.splice(Ta,0,new Z(1,ia,Pi))}return be=="ltr"&&(Yi[0].level==1&&($r=ie.match(/^\s+/))&&(Yi[0].from=$r[0].length,Yi.unshift(new Z(0,0,$r[0].length))),He(Yi).level==1&&($r=ie.match(/\s+$/))&&(He(Yi).to-=$r[0].length,Yi.push(new Z(0,Be-$r[0].length,Be)))),be=="rtl"?Yi.reverse():Yi}}();function Et(e,t){var i=e.order;return i==null&&(i=e.order=bt(e.text,t)),i}var Re=[],Te=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Re).concat(i)}};function Ke(e,t){return e._handlers&&e._handlers[t]||Re}function ze(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,d=n&&n[t];if(d){var D=ue(d,i);D>-1&&(n[t]=d.slice(0,D).concat(d.slice(D+1)))}}}function Ce(e,t){var i=Ke(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),d=0;d<i.length;++d)i[d].apply(null,n)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ce(e,i||t.type,e,t),le(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)ue(i,t[n])==-1&&i.push(t[n])}function ce(e,t){return Ke(e,t).length>0}function he(e){e.prototype.on=function(t,i){Te(this,t,i)},e.prototype.off=function(t,i){ze(this,t,i)}}function ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function le(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function pe(e){ne(e),oe(e)}function ge(e){return e.target||e.srcElement}function Pe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var Ge=function(){if(H&&U<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),rt;function vt(e){if(rt==null){var t=o("span","\u200B");h(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(rt=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&U<8))}var i=rt?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var tt;function Wt(e){if(tt!=null)return tt;var t=h(e,document.createTextNode("A\u062EA")),i=m(t,0,1).getBoundingClientRect(),n=m(t,1,2).getBoundingClientRect();return v(e),!i||i.left==i.right?!1:tt=n.right-i.right<3}var Nt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var d=e.indexOf(`
`,t);d==-1&&(d=e.length);var D=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),K=D.indexOf("\r");K!=-1?(i.push(D.slice(0,K)),t+=K+1):(i.push(D),t=d+1)}return i}:function(e){return e.split(/\r\n?|\n/)},_t=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(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Qt=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Jt=null;function Yt(e){if(Jt!=null)return Jt;var t=h(e,o("span","x")),i=t.getBoundingClientRect(),n=m(t,0,1).getBoundingClientRect();return Jt=Math.abs(i.left-n.left)>1}var cn={},jt={};function rn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),cn[e]=t}function kt(e,t){jt[e]=t}function Xe(e){if(typeof e=="string"&&jt.hasOwnProperty(e))e=jt[e];else if(e&&typeof e.name=="string"&&jt.hasOwnProperty(e.name)){var t=jt[e.name];typeof t=="string"&&(t={name:t}),e=ct(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Xe("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Xe("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Lt(e,t){t=Xe(t);var i=cn[t.name];if(!i)return Lt(e,"text/plain");var n=i(e,t);if(Ut.hasOwnProperty(t.name)){var d=Ut[t.name];for(var D in d){if(!d.hasOwnProperty(D))continue;n.hasOwnProperty(D)&&(n["_"+D]=n[D]),n[D]=d[D]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)n[K]=t.modeProps[K];return n}var Ut={};function Mt(e,t){var i=Ut.hasOwnProperty(e)?Ut[e]:Ut[e]={};R(t,i)}function Zt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var d=t[n];d instanceof Array&&(d=d.concat([])),i[n]=d}return i}function Ln(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Ni(e,t,i){return e.startState?e.startState(t,i):!0}var vn=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};vn.prototype.eol=function(){return this.pos>=this.string.length},vn.prototype.sol=function(){return this.pos==this.lineStart},vn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},vn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},vn.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},vn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},vn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},vn.prototype.skipToEnd=function(){this.pos=this.string.length},vn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},vn.prototype.backUp=function(e){this.pos-=e},vn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=$(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?$(this.string,this.lineStart,this.tabSize):0)},vn.prototype.indentation=function(){return $(this.string,null,this.tabSize)-(this.lineStart?$(this.string,this.lineStart,this.tabSize):0)},vn.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(K){return i?K.toLowerCase():K},d=this.string.substr(this.pos,e.length);if(n(d)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var D=this.string.slice(this.pos).match(e);return D&&D.index>0?null:(D&&t!==!1&&(this.pos+=D[0].length),D)}},vn.prototype.current=function(){return this.string.slice(this.start,this.pos)},vn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},vn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},vn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function At(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var d=i.children[n],D=d.chunkSize();if(t<D){i=d;break}t-=D}return i.lines[t]}function li(e,t,i){var n=[],d=t.line;return e.iter(t.line,i.line+1,function(D){var K=D.text;d==i.line&&(K=K.slice(0,i.ch)),d==t.line&&(K=K.slice(t.ch)),n.push(K),++d}),n}function Li(e,t,i){var n=[];return e.iter(t,i,function(d){n.push(d.text)}),n}function Zn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function an(e){if(e.parent==null)return null;for(var t=e.parent,i=ue(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var d=0;!(n.children[d]==t);++d)i+=n.children[d].chunkSize();return i+t.first}function Qn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var d=e.children[n],D=d.height;if(t<D){e=d;continue e}t-=D,i+=d.chunkSize()}return i}while(!e.lines);for(var K=0;K<e.lines.length;++K){var J=e.lines[K],Z=J.height;if(t<Z)break;t-=Z}return i+K}function Ii(e,t){return t>=e.first&&t<e.first+e.size}function Ui(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ht(e,t,i){if(i===void 0&&(i=null),!(this instanceof ht))return new ht(e,t,i);this.line=e,this.ch=t,this.sticky=i}function zt(e,t){return e.line-t.line||e.ch-t.ch}function Di(e,t){return e.sticky==t.sticky&&zt(e,t)==0}function Hi(e){return ht(e.line,e.ch)}function ir(e,t){return zt(e,t)<0?t:e}function Wi(e,t){return zt(e,t)<0?e:t}function G(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function x(e,t){if(t.line<e.first)return ht(e.first,0);var i=e.first+e.size-1;return t.line>i?ht(i,At(e,i).text.length):A(t,At(e,t.line).text.length)}function A(e,t){var i=e.ch;return i==null||i>t?ht(e.line,t):i<0?ht(e.line,0):e}function F(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=x(e,t[n]);return i}var q=function(e,t){this.state=e,this.lookAhead=t},z=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};z.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},z.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}},z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},z.fromSaved=function(e,t,i){return t instanceof q?new z(e,Zt(e.mode,t.state),i,t.lookAhead):new z(e,Zt(e.mode,t),i)},z.prototype.save=function(e){var t=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new q(t,this.maxLookAhead):t};function we(e,t,i,n){var d=[e.state.modeGen],D={};fi(e,t.text,e.doc.mode,i,function(ie,be){return d.push(ie,be)},D,n);for(var K=i.state,J=function(ie){i.baseTokens=d;var be=e.state.overlays[ie],Se=1,Be=0;i.state=!0,fi(e,t.text,be.mode,i,function(Ue,Qe){for(var dt=Se;Be<Ue;){var Tt=d[Se];Tt>Ue&&d.splice(Se,1,Ue,d[Se+1],Tt),Se+=2,Be=Math.min(Ue,Tt)}if(!Qe)return;if(be.opaque)d.splice(dt,Se-dt,Ue,"overlay "+Qe),Se=dt+2;else for(;dt<Se;dt+=2){var Ct=d[dt+1];d[dt+1]=(Ct?Ct+" ":"")+"overlay "+Qe}},D),i.state=K,i.baseTokens=null,i.baseTokenPos=1},Z=0;Z<e.state.overlays.length;++Z)J(Z);return{styles:d,classes:D.bgClass||D.textClass?D:null}}function Ze(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=xt(e,an(t)),d=t.text.length>e.options.maxHighlightLength&&Zt(e.doc.mode,n.state),D=we(e,t,n);d&&(n.state=d),t.stateAfter=n.save(!d),t.styles=D.styles,D.classes?t.styleClasses=D.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function xt(e,t,i){var n=e.doc,d=e.display;if(!n.mode.startState)return new z(n,!0,t);var D=Vn(e,t,i),K=D>n.first&&At(n,D-1).stateAfter,J=K?z.fromSaved(n,K,D):new z(n,Ni(n.mode),D);return n.iter(D,t,function(Z){Dt(e,Z.text,J);var ie=J.line;Z.stateAfter=ie==t-1||ie%5==0||ie>=d.viewFrom&&ie<d.viewTo?J.save():null,J.nextLine()}),i&&(n.modeFrontier=J.line),J}function Dt(e,t,i,n){var d=e.doc.mode,D=new vn(t,e.options.tabSize,i);for(D.start=D.pos=n||0,t==""&&ot(d,i.state);!D.eol();)Kt(d,D,i.state),D.start=D.pos}function ot(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Ln(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Kt(e,t,i,n){for(var d=0;d<10;d++){n&&(n[0]=Ln(e,i).mode);var D=e.token(t,i);if(t.pos>t.start)return D}throw new Error("Mode "+e.name+" failed to advance stream.")}var $t=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Pn(e,t,i,n){var d=e.doc,D=d.mode,K;t=x(d,t);var J=At(d,t.line),Z=xt(e,t.line,i),ie=new vn(J.text,e.options.tabSize,Z),be;for(n&&(be=[]);(n||ie.pos<t.ch)&&!ie.eol();)ie.start=ie.pos,K=Kt(D,ie,Z.state),n&&be.push(new $t(ie,K,Zt(d.mode,Z.state)));return n?be:new $t(ie,K,Z.state)}function yi(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function fi(e,t,i,n,d,D,K){var J=i.flattenSpans;J==null&&(J=e.options.flattenSpans);var Z=0,ie=null,be=new vn(t,e.options.tabSize,n),Se,Be=e.options.addModeClass&&[null];for(t==""&&yi(ot(i,n.state),D);!be.eol();){if(be.pos>e.options.maxHighlightLength?(J=!1,K&&Dt(e,t,n,be.pos),be.pos=t.length,Se=null):Se=yi(Kt(i,be,n.state,Be),D),Be){var Ue=Be[0].name;Ue&&(Se="m-"+(Se?Ue+" "+Se:Ue))}if(!J||ie!=Se){for(;Z<be.start;)Z=Math.min(be.start,Z+5e3),d(Z,ie);ie=Se}be.start=be.pos}for(;Z<be.pos;){var Qe=Math.min(be.pos,Z+5e3);d(Qe,ie),Z=Qe}}function Vn(e,t,i){for(var n,d,D=e.doc,K=i?-1:t-(e.doc.mode.innerMode?1e3:100),J=t;J>K;--J){if(J<=D.first)return D.first;var Z=At(D,J-1),ie=Z.stateAfter;if(ie&&(!i||J+(ie instanceof q?ie.lookAhead:0)<=D.modeFrontier))return J;var be=$(Z.text,null,e.options.tabSize);(d==null||n>be)&&(d=J-1,n=be)}return d}function rr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var d=At(e,n).stateAfter;if(d&&(!(d instanceof q)||n+d.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var wr=!1,ii=!1;function Ki(){wr=!0}function yr(){ii=!0}function ar(e,t,i){this.marker=e,this.from=t,this.to=i}function bi(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function Rr(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Sr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ar(e,t,i){var n;if(e)for(var d=0;d<e.length;++d){var D=e[d],K=D.marker,J=D.from==null||(K.inclusiveLeft?D.from<=t:D.from<t);if(J||D.from==t&&K.type=="bookmark"&&(!i||!D.marker.insertLeft)){var Z=D.to==null||(K.inclusiveRight?D.to>=t:D.to>t);(n||(n=[])).push(new ar(K,D.from,Z?null:D.to))}}return n}function Nr(e,t,i){var n;if(e)for(var d=0;d<e.length;++d){var D=e[d],K=D.marker,J=D.to==null||(K.inclusiveRight?D.to>=t:D.to>t);if(J||D.from==t&&K.type=="bookmark"&&(!i||D.marker.insertLeft)){var Z=D.from==null||(K.inclusiveLeft?D.from<=t:D.from<t);(n||(n=[])).push(new ar(K,Z?null:D.from-t,D.to==null?null:D.to-t))}}return n}function or(e,t){if(t.full)return null;var i=Ii(e,t.from.line)&&At(e,t.from.line).markedSpans,n=Ii(e,t.to.line)&&At(e,t.to.line).markedSpans;if(!i&&!n)return null;var d=t.from.ch,D=t.to.ch,K=zt(t.from,t.to)==0,J=Ar(i,d,K),Z=Nr(n,D,K),ie=t.text.length==1,be=He(t.text).length+(ie?d:0);if(J)for(var Se=0;Se<J.length;++Se){var Be=J[Se];if(Be.to==null){var Ue=bi(Z,Be.marker);Ue?ie&&(Be.to=Ue.to==null?null:Ue.to+be):Be.to=d}}if(Z)for(var Qe=0;Qe<Z.length;++Qe){var dt=Z[Qe];if(dt.to!=null&&(dt.to+=be),dt.from==null){var Tt=bi(J,dt.marker);Tt||(dt.from=be,ie&&(J||(J=[])).push(dt))}else dt.from+=be,ie&&(J||(J=[])).push(dt)}J&&(J=ui(J)),Z&&Z!=J&&(Z=ui(Z));var Ct=[J];if(!ie){var It=t.text.length-2,Ot;if(It>0&&J)for(var Pt=0;Pt<J.length;++Pt)J[Pt].to==null&&(Ot||(Ot=[])).push(new ar(J[Pt].marker,null,null));for(var tn=0;tn<It;++tn)Ct.push(Ot);Ct.push(Z)}return Ct}function ui(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function pr(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(Ue){if(Ue.markedSpans)for(var Qe=0;Qe<Ue.markedSpans.length;++Qe){var dt=Ue.markedSpans[Qe].marker;dt.readOnly&&(!n||ue(n,dt)==-1)&&(n||(n=[])).push(dt)}}),!n)return null;for(var d=[{from:t,to:i}],D=0;D<n.length;++D)for(var K=n[D],J=K.find(0),Z=0;Z<d.length;++Z){var ie=d[Z];if(zt(ie.to,J.from)<0||zt(ie.from,J.to)>0)continue;var be=[Z,1],Se=zt(ie.from,J.from),Be=zt(ie.to,J.to);(Se<0||!K.inclusiveLeft&&!Se)&&be.push({from:ie.from,to:J.from}),(Be>0||!K.inclusiveRight&&!Be)&&be.push({from:J.to,to:ie.to}),d.splice.apply(d,be),Z+=be.length-3}return d}function Ur(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function mr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function In(e){return e.inclusiveLeft?-1:0}function on(e){return e.inclusiveRight?1:0}function Wn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),d=t.find(),D=zt(n.from,d.from)||In(e)-In(t);if(D)return-D;var K=zt(n.to,d.to)||on(e)-on(t);return K||t.id-e.id}function ln(e,t){var i=ii&&e.markedSpans,n;if(i)for(var d=void 0,D=0;D<i.length;++D)d=i[D],d.marker.collapsed&&(t?d.from:d.to)==null&&(!n||Wn(n,d.marker)<0)&&(n=d.marker);return n}function Xn(e){return ln(e,!0)}function Cn(e){return ln(e,!1)}function sr(e,t){var i=ii&&e.markedSpans,n;if(i)for(var d=0;d<i.length;++d){var D=i[d];D.marker.collapsed&&(D.from==null||D.from<t)&&(D.to==null||D.to>t)&&(!n||Wn(n,D.marker)<0)&&(n=D.marker)}return n}function di(e,t,i,n,d){var D=At(e,t),K=ii&&D.markedSpans;if(K)for(var J=0;J<K.length;++J){var Z=K[J];if(!Z.marker.collapsed)continue;var ie=Z.marker.find(0),be=zt(ie.from,i)||In(Z.marker)-In(d),Se=zt(ie.to,n)||on(Z.marker)-on(d);if(be>=0&&Se<=0||be<=0&&Se>=0)continue;if(be<=0&&(Z.marker.inclusiveRight&&d.inclusiveLeft?zt(ie.to,i)>=0:zt(ie.to,i)>0)||be>=0&&(Z.marker.inclusiveRight&&d.inclusiveLeft?zt(ie.from,n)<=0:zt(ie.from,n)<0))return!0}}function _i(e){for(var t;t=Xn(e);)e=t.find(-1,!0).line;return e}function Cr(e){for(var t;t=Cn(e);)e=t.find(1,!0).line;return e}function lr(e){for(var t,i;t=Cn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function gr(e,t){var i=At(e,t),n=_i(i);return i==n?t:an(n)}function ji(e,t){if(t>e.lastLine())return t;var i=At(e,t),n;if(!zi(e,i))return t;for(;n=Cn(i);)i=n.find(1,!0).line;return an(i)+1}function zi(e,t){var i=ii&&t.markedSpans;if(i)for(var n=void 0,d=0;d<i.length;++d){if(n=i[d],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&jr(e,t,n))return!0}}function jr(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return jr(e,n.line,bi(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var d=void 0,D=0;D<t.markedSpans.length;++D)if(d=t.markedSpans[D],d.marker.collapsed&&!d.marker.widgetNode&&d.from==i.to&&(d.to==null||d.to!=i.from)&&(d.marker.inclusiveLeft||i.marker.inclusiveRight)&&jr(e,t,d))return!0}function $i(e){e=_i(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var d=i.lines[n];if(d==e)break;t+=d.height}for(var D=i.parent;D;i=D,D=i.parent)for(var K=0;K<D.children.length;++K){var J=D.children[K];if(J==i)break;t+=J.height}return t}function Fr(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=Xn(n);){var d=i.find(0,!0);n=d.from.line,t+=d.from.ch-d.to.ch}for(n=e;i=Cn(n);){var D=i.find(0,!0);t-=n.text.length-D.from.ch,n=D.to.line,t+=n.text.length-D.to.ch}return t}function Lr(e){var t=e.display,i=e.doc;t.maxLine=At(i,i.first),t.maxLineLength=Fr(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var d=Fr(n);d>t.maxLineLength&&(t.maxLineLength=d,t.maxLine=n)})}var Ji=function(e,t,i){this.text=e,mr(this,t),this.height=i?i(this):1};Ji.prototype.lineNo=function(){return an(this)},he(Ji);function Jr(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ur(e),mr(e,i);var d=n?n(e):1;d!=e.height&&Zn(e,d)}function Ft(e){e.parent=null,Ur(e)}var qt={},Ht={};function sn(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Ht:qt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function yn(e,t){var i=_("span",null,null,k?"padding-right: .1px":null),n={pre:_("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var d=0;d<=(t.rest?t.rest.length:0);d++){var D=d?t.rest[d-1]:t.line,K=void 0;n.pos=0,n.addToken=bn,Wt(e.display.measure)&&(K=Et(D,e.doc.direction))&&(n.addToken=ki(n.addToken,K)),n.map=[];var J=t!=e.display.externalMeasured&&an(D);ur(D,n,Ze(e,D,J)),D.styleClasses&&(D.styleClasses.bgClass&&(n.bgClass=W(D.styleClasses.bgClass,n.bgClass||"")),D.styleClasses.textClass&&(n.textClass=W(D.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(vt(e.display.measure))),d==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(k){var Z=n.content.lastChild;(/\bcm-tab\b/.test(Z.className)||Z.querySelector&&Z.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ce(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=W(n.pre.className,n.textClass||"")),n}function Nn(e){var t=o("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function bn(e,t,i,n,d,D,K){if(!t)return;var J=e.splitSpaces?qn(t,e.trailingSpace):t,Z=e.cm.state.specialChars,ie=!1,be;if(!Z.test(t))e.col+=t.length,be=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,be),H&&U<9&&(ie=!0),e.pos+=t.length;else{be=document.createDocumentFragment();for(var Se=0;;){Z.lastIndex=Se;var Be=Z.exec(t),Ue=Be?Be.index-Se:t.length-Se;if(Ue){var Qe=document.createTextNode(J.slice(Se,Se+Ue));H&&U<9?be.appendChild(o("span",[Qe])):be.appendChild(Qe),e.map.push(e.pos,e.pos+Ue,Qe),e.col+=Ue,e.pos+=Ue}if(!Be)break;Se+=Ue+1;var dt=void 0;if(Be[0]==" "){var Tt=e.cm.options.tabSize,Ct=Tt-e.col%Tt;dt=be.appendChild(o("span",se(Ct),"cm-tab")),dt.setAttribute("role","presentation"),dt.setAttribute("cm-text"," "),e.col+=Ct}else Be[0]=="\r"||Be[0]==`
`?(dt=be.appendChild(o("span",Be[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),dt.setAttribute("cm-text",Be[0]),e.col+=1):(dt=e.cm.options.specialCharPlaceholder(Be[0]),dt.setAttribute("cm-text",Be[0]),H&&U<9?be.appendChild(o("span",[dt])):be.appendChild(dt),e.col+=1);e.map.push(e.pos,e.pos+1,dt),e.pos++}}if(e.trailingSpace=J.charCodeAt(t.length-1)==32,i||n||d||ie||D||K){var It=i||"";n&&(It+=n),d&&(It+=d);var Ot=o("span",[be],It,D);if(K)for(var Pt in K)K.hasOwnProperty(Pt)&&Pt!="style"&&Pt!="class"&&Ot.setAttribute(Pt,K[Pt]);return e.content.appendChild(Ot)}e.content.appendChild(be)}function qn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",d=0;d<e.length;d++){var D=e.charAt(d);D==" "&&i&&(d==e.length-1||e.charCodeAt(d+1)==32)&&(D="\xA0"),n+=D,i=D==" "}return n}function ki(e,t){return function(i,n,d,D,K,J,Z){d=d?d+" cm-force-border":"cm-force-border";for(var ie=i.pos,be=ie+n.length;;){for(var Se=void 0,Be=0;Be<t.length&&!(Se=t[Be],Se.to>ie&&Se.from<=ie);Be++);if(Se.to>=be)return e(i,n,d,D,K,J,Z);e(i,n.slice(0,Se.to-ie),d,D,null,J,Z),D=null,n=n.slice(Se.to-ie),ie=Se.to}}}function hn(e,t,i,n){var d=!n&&i.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!n&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",i.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function ur(e,t,i){var n=e.markedSpans,d=e.text,D=0;if(!n){for(var K=1;K<i.length;K+=2)t.addToken(t,d.slice(D,D=i[K]),sn(i[K+1],t.cm.options));return}for(var J=d.length,Z=0,ie=1,be="",Se,Be,Ue=0,Qe,dt,Tt,Ct,It;;){if(Ue==Z){Qe=dt=Tt=Be="",It=null,Ct=null,Ue=Infinity;for(var Ot=[],Pt=void 0,tn=0;tn<n.length;++tn){var Vt=n[tn],gn=Vt.marker;if(gn.type=="bookmark"&&Vt.from==Z&&gn.widgetNode)Ot.push(gn);else if(Vt.from<=Z&&(Vt.to==null||Vt.to>Z||gn.collapsed&&Vt.to==Z&&Vt.from==Z)){if(Vt.to!=null&&Vt.to!=Z&&Ue>Vt.to&&(Ue=Vt.to,dt=""),gn.className&&(Qe+=" "+gn.className),gn.css&&(Be=(Be?Be+";":"")+gn.css),gn.startStyle&&Vt.from==Z&&(Tt+=" "+gn.startStyle),gn.endStyle&&Vt.to==Ue&&(Pt||(Pt=[])).push(gn.endStyle,Vt.to),gn.title&&((It||(It={})).title=gn.title),gn.attributes)for(var Jn in gn.attributes)(It||(It={}))[Jn]=gn.attributes[Jn];gn.collapsed&&(!Ct||Wn(Ct.marker,gn)<0)&&(Ct=Vt)}else Vt.from>Z&&Ue>Vt.from&&(Ue=Vt.from)}if(Pt)for(var Mi=0;Mi<Pt.length;Mi+=2)Pt[Mi+1]==Ue&&(dt+=" "+Pt[Mi]);if(!Ct||Ct.from==Z)for(var si=0;si<Ot.length;++si)hn(t,0,Ot[si]);if(Ct&&(Ct.from||0)==Z){if(hn(t,(Ct.to==null?J+1:Ct.to)-Z,Ct.marker,Ct.from==null),Ct.to==null)return;Ct.to==Z&&(Ct=!1)}}if(Z>=J)break;for(var vr=Math.min(J,Ue);;){if(be){var cr=Z+be.length;if(!Ct){var xi=cr>vr?be.slice(0,vr-Z):be;t.addToken(t,xi,Se?Se+Qe:Qe,Tt,Z+xi.length==Ue?dt:"",Be,It)}if(cr>=vr){be=be.slice(vr-Z),Z=vr;break}Z=cr,Tt=""}be=d.slice(D,D=i[ie++]),Se=sn(i[ie++],t.cm.options)}}}function Dn(e,t,i){this.line=t,this.rest=lr(t),this.size=this.rest?an(He(this.rest))-i+1:1,this.node=this.text=null,this.hidden=zi(e,t)}function pi(e,t,i){for(var n=[],d,D=t;D<i;D=d){var K=new Dn(e.doc,At(e.doc,D),D);d=D+K.size,n.push(K)}return n}var Ei=null;function Qi(e){Ei?Ei.ops.push(e):e.ownsGroup=Ei={ops:[e],delayedCallbacks:[]}}function ma(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var d=e.ops[n];if(d.cursorActivityHandlers)for(;d.cursorActivityCalled<d.cursorActivityHandlers.length;)d.cursorActivityHandlers[d.cursorActivityCalled++].call(null,d.cm)}}while(i<t.length)}function kn(e,t){var i=e.ownsGroup;if(!i)return;try{ma(i)}finally{Ei=null,t(i)}}var Tn=null;function _n(e,t){var i=Ke(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),d;Ei?d=Ei.delayedCallbacks:Tn?d=Tn:(d=Tn=[],setTimeout(Gi,0));for(var D=function(J){d.push(function(){return i[J].apply(null,n)})},K=0;K<i.length;++K)D(K)}function Gi(){var e=Tn;Tn=null;for(var t=0;t<e.length;++t)e[t]()}function Br(e,t,i,n){for(var d=0;d<t.changes.length;d++){var D=t.changes[d];D=="text"?Sa(e,t):D=="gutter"?Xa(e,t,i,n):D=="class"?Va(e,t):D=="widget"&&Go(e,t,n)}t.changes=null}function Hr(e){return e.node==e.text&&(e.node=o("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),H&&U<8&&(e.node.style.zIndex=2)),e.node}function ga(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=Hr(t);t.background=n.insertBefore(o("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function va(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):yn(e,t)}function Sa(e,t){var i=t.text.className,n=va(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Va(e,t)):i&&(t.text.className=i)}function Va(e,t){ga(e,t),t.line.wrapClass?Hr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Xa(e,t,i,n){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 d=Hr(t);t.gutterBackground=o("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),d.insertBefore(t.gutterBackground,t.text)}var D=t.line.gutterMarkers;if(e.options.lineNumbers||D){var K=Hr(t),J=t.gutter=o("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(J),K.insertBefore(J,t.text),t.line.gutterClass&&(J.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!D||!D["CodeMirror-linenumbers"])&&(t.lineNumber=J.appendChild(o("div",Ui(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),D)for(var Z=0;Z<e.display.gutterSpecs.length;++Z){var ie=e.display.gutterSpecs[Z].className,be=D.hasOwnProperty(ie)&&D[ie];be&&J.appendChild(o("div",[be],"CodeMirror-gutter-elt","left: "+n.gutterLeft[ie]+"px; width: "+n.gutterWidth[ie]+"px"))}}}function Go(e,t,i){t.alignable&&(t.alignable=null);for(var n=w("CodeMirror-linewidget"),d=t.node.firstChild,D=void 0;d;d=D)D=d.nextSibling,n.test(d.className)&&t.node.removeChild(d);Ya(e,t,i)}function Eo(e,t,i,n){var d=va(e,t);return t.text=t.node=d.pre,d.bgClass&&(t.bgClass=d.bgClass),d.textClass&&(t.textClass=d.textClass),Va(e,t),Xa(e,t,i,n),Ya(e,t,n),t.node}function Ya(e,t,i){if(xo(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)xo(e,t.rest[n],t,i,!1)}function xo(e,t,i,n,d){if(!t.widgets)return;for(var D=Hr(i),K=0,J=t.widgets;K<J.length;++K){var Z=J[K],ie=o("div",[Z.node],"CodeMirror-linewidget"+(Z.className?" "+Z.className:""));Z.handleMouseEvents||ie.setAttribute("cm-ignore-events","true"),Vo(Z,ie,i,n),e.display.input.setUneditable(ie),d&&Z.above?D.insertBefore(ie,i.gutter||i.text):D.appendChild(ie),_n(Z,"redraw")}}function Vo(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var d=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(d-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=d+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function ra(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!T(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),h(t.display.measure,o("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Ir(e,t){for(var i=ge(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function $a(e){return e.lineSpace.offsetTop}function fe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Oe(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=h(e.measure,o("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Ie(e){return me-e.display.nativeBarWidth}function ye(e){return e.display.scroller.clientWidth-Ie(e)-e.display.barWidth}function ee(e){return e.display.scroller.clientHeight-Ie(e)-e.display.barHeight}function de(e,t,i){var n=e.options.lineWrapping,d=n&&ye(e);if(!t.measure.heights||n&&t.measure.width!=d){var D=t.measure.heights=[];if(n){t.measure.width=d;for(var K=t.text.firstChild.getClientRects(),J=0;J<K.length-1;J++){var Z=K[J],ie=K[J+1];Math.abs(Z.bottom-ie.bottom)>2&&D.push((Z.bottom+ie.top)/2-i.top)}}D.push(i.bottom-i.top)}}function re(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var d=0;d<e.rest.length;d++)if(an(e.rest[d])>i)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function _e(e,t){t=_i(t);var i=an(t),n=e.display.externalMeasured=new Dn(e.doc,t,i);n.lineN=i;var d=n.built=yn(e,n);return n.text=d.pre,h(e.display.lineMeasure,d.pre),n}function xe(e,t,i,n){return je(e,Le(e,t),i,n)}function ke(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[$n(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Le(e,t){var i=an(t),n=ke(e,i);n&&!n.text?n=null:n&&n.changes&&(Br(e,n,i,ri(e)),e.curOp.forceUpdate=!0),n||(n=_e(e,t));var d=re(n,t,i);return{line:t,view:n,rect:null,map:d.map,cache:d.cache,before:d.before,hasHeights:!1}}function je(e,t,i,n,d){t.before&&(i=-1);var D=i+(n||""),K;return t.cache.hasOwnProperty(D)?K=t.cache[D]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(de(e,t.view,t.rect),t.hasHeights=!0),K=wt(e,t,i,n),K.bogus||(t.cache[D]=K)),{left:K.left,right:K.right,top:d?K.rtop:K.top,bottom:d?K.rbottom:K.bottom}}var Ye={left:0,right:0,top:0,bottom:0};function yt(e,t,i){for(var n,d,D,K,J,Z,ie=0;ie<e.length;ie+=3)if(J=e[ie],Z=e[ie+1],t<J?(d=0,D=1,K="left"):t<Z?(d=t-J,D=d+1):(ie==e.length-3||t==Z&&e[ie+3]>t)&&(D=Z-J,d=D-1,t>=Z&&(K="right")),d!=null){if(n=e[ie+2],J==Z&&i==(n.insertLeft?"left":"right")&&(K=i),i=="left"&&d==0)for(;ie&&e[ie-2]==e[ie-3]&&e[ie-1].insertLeft;)n=e[(ie-=3)+2],K="left";if(i=="right"&&d==Z-J)for(;ie<e.length-3&&e[ie+3]==e[ie+4]&&!e[ie+5].insertLeft;)n=e[(ie+=3)+2],K="right";break}return{node:n,start:d,end:D,collapse:K,coverStart:J,coverEnd:Z}}function mt(e,t){var i=Ye;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var d=e.length-1;d>=0&&!((i=e[d]).left!=i.right);d--);return i}function wt(e,t,i,n){var d=yt(t.map,i,n),D=d.node,K=d.start,J=d.end,Z=d.collapse,ie;if(D.nodeType==3){for(var be=0;be<4;be++){for(;K&&et(t.line.text.charAt(d.coverStart+K));)--K;for(;d.coverStart+J<d.coverEnd&&et(t.line.text.charAt(d.coverStart+J));)++J;if(H&&U<9&&K==0&&J==d.coverEnd-d.coverStart?ie=D.parentNode.getBoundingClientRect():ie=mt(m(D,K,J).getClientRects(),n),ie.left||ie.right||K==0)break;J=K,K=K-1,Z="right"}H&&U<11&&(ie=en(e.display.measure,ie))}else{K>0&&(Z=n="right");var Se;e.options.lineWrapping&&(Se=D.getClientRects()).length>1?ie=Se[n=="right"?Se.length-1:0]:ie=D.getBoundingClientRect()}if(H&&U<9&&!K&&(!ie||!ie.left&&!ie.right)){var Be=D.parentNode.getClientRects()[0];Be?ie={left:Be.left,right:Be.left+wi(e.display),top:Be.top,bottom:Be.bottom}:ie=Ye}for(var Ue=ie.top-t.rect.top,Qe=ie.bottom-t.rect.top,dt=(Ue+Qe)/2,Tt=t.view.measure.heights,Ct=0;Ct<Tt.length-1&&!(dt<Tt[Ct]);Ct++);var It=Ct?Tt[Ct-1]:0,Ot=Tt[Ct],Pt={left:(Z=="right"?ie.right:ie.left)-t.rect.left,right:(Z=="left"?ie.left:ie.right)-t.rect.left,top:It,bottom:Ot};return!ie.left&&!ie.right&&(Pt.bogus=!0),e.options.singleCursorHeightPerLine||(Pt.rtop=Ue,Pt.rbottom=Qe),Pt}function en(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Yt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function pn(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 nn(e){e.display.externalMeasure=null,v(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)pn(e.display.view[t])}function un(e){nn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function mn(){return b&&u?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function fn(){return b&&u?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function dn(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=ra(e.widgets[i]));return t}function On(e,t,i,n,d){if(!d){var D=dn(t);i.top+=D,i.bottom+=D}if(n=="line")return i;n||(n="local");var K=$i(t);if(n=="local"?K+=$a(e.display):K-=e.display.viewOffset,n=="page"||n=="window"){var J=e.display.lineSpace.getBoundingClientRect();K+=J.top+(n=="window"?0:fn());var Z=J.left+(n=="window"?0:mn());i.left+=Z,i.right+=Z}return i.top+=K,i.bottom+=K,i}function En(e,t,i){if(i=="div")return t;var n=t.left,d=t.top;if(i=="page")n-=mn(),d-=fn();else if(i=="local"||!i){var D=e.display.sizer.getBoundingClientRect();n+=D.left,d+=D.top}var K=e.display.lineSpace.getBoundingClientRect();return{left:n-K.left,top:d-K.top}}function ei(e,t,i,n,d){return n||(n=At(e.doc,t.line)),On(e,n,xe(e,n,t.ch,d),i)}function xn(e,t,i,n,d,D){n=n||At(e.doc,t.line),d||(d=Le(e,n));function K(Qe,dt){var Tt=je(e,d,Qe,dt?"right":"left",D);return dt?Tt.left=Tt.right:Tt.right=Tt.left,On(e,n,Tt,i)}var J=Et(n,e.doc.direction),Z=t.ch,ie=t.sticky;if(Z>=n.text.length?(Z=n.text.length,ie="before"):Z<=0&&(Z=0,ie="after"),!J)return K(ie=="before"?Z-1:Z,ie=="before");function be(Qe,dt,Tt){var Ct=J[dt],It=Ct.level==1;return K(Tt?Qe-1:Qe,It!=Tt)}var Se=at(J,Z,ie),Be=nt,Ue=be(Z,Se,ie=="before");return Be!=null&&(Ue.other=be(Z,Be,ie!="before")),Ue}function Xt(e,t){var i=0;t=x(e.doc,t),e.options.lineWrapping||(i=wi(e.display)*t.ch);var n=At(e.doc,t.line),d=$i(n)+$a(e.display);return{left:i,right:i,top:d,bottom:d+n.height}}function Gt(e,t,i,n,d){var D=ht(e,t,i);return D.xRel=d,n&&(D.outside=n),D}function wn(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return Gt(n.first,0,null,-1,-1);var d=Qn(n,i),D=n.first+n.size-1;if(d>D)return Gt(n.first+n.size-1,At(n,D).text.length,null,1,1);t<0&&(t=0);for(var K=At(n,d);;){var J=ti(e,K,d,t,i),Z=sr(K,J.ch+(J.xRel>0||J.outside>0?1:0));if(!Z)return J;var ie=Z.find(1);if(ie.line==d)return ie;K=At(n,d=ie.line)}}function Rn(e,t,i,n){n-=dn(t);var d=t.text.length,D=St(function(K){return je(e,i,K-1).bottom<=n},d,0);return d=St(function(K){return je(e,i,K).top>n},D,d),{begin:D,end:d}}function Bt(e,t,i,n){i||(i=Le(e,t));var d=On(e,t,je(e,i,n),"line").top;return Rn(e,t,i,d)}function An(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function ti(e,t,i,n,d){d-=$i(t);var D=Le(e,t),K=dn(t),J=0,Z=t.text.length,ie=!0,be=Et(t,e.doc.direction);if(be){var Se=(e.options.lineWrapping?Kn:Mn)(e,t,i,D,be,n,d);ie=Se.level!=1,J=ie?Se.from:Se.to-1,Z=ie?Se.to:Se.from-1}var Be=null,Ue=null,Qe=St(function(tn){var Vt=je(e,D,tn);return Vt.top+=K,Vt.bottom+=K,An(Vt,n,d,!1)?(Vt.top<=d&&Vt.left<=n&&(Be=tn,Ue=Vt),!0):!1},J,Z),dt,Tt,Ct=!1;if(Ue){var It=n-Ue.left<Ue.right-n,Ot=It==ie;Qe=Be+(Ot?0:1),Tt=Ot?"after":"before",dt=It?Ue.left:Ue.right}else{!ie&&(Qe==Z||Qe==J)&&Qe++,Tt=Qe==0?"after":Qe==t.text.length?"before":je(e,D,Qe-(ie?1:0)).bottom+K<=d==ie?"after":"before";var Pt=xn(e,ht(i,Qe,Tt),"line",t,D);dt=Pt.left,Ct=d<Pt.top?-1:d>=Pt.bottom?1:0}return Qe=qe(t.text,Qe,1),Gt(i,Qe,Tt,Ct,n-dt)}function Mn(e,t,i,n,d,D,K){var J=St(function(Se){var Be=d[Se],Ue=Be.level!=1;return An(xn(e,ht(i,Ue?Be.to:Be.from,Ue?"before":"after"),"line",t,n),D,K,!0)},0,d.length-1),Z=d[J];if(J>0){var ie=Z.level!=1,be=xn(e,ht(i,ie?Z.from:Z.to,ie?"after":"before"),"line",t,n);An(be,D,K,!0)&&be.top>K&&(Z=d[J-1])}return Z}function Kn(e,t,i,n,d,D,K){var J=Rn(e,t,n,K),Z=J.begin,ie=J.end;/\s/.test(t.text.charAt(ie-1))&&ie--;for(var be=null,Se=null,Be=0;Be<d.length;Be++){var Ue=d[Be];if(Ue.from>=ie||Ue.to<=Z)continue;var Qe=Ue.level!=1,dt=je(e,n,Qe?Math.min(ie,Ue.to)-1:Math.max(Z,Ue.from)).right,Tt=dt<D?D-dt+1e9:dt-D;(!be||Se>Tt)&&(be=Ue,Se=Tt)}return be||(be=d[d.length-1]),be.from<Z&&(be={from:Z,to:be.to,level:be.level}),be.to>ie&&(be={from:be.from,to:ie,level:be.level}),be}var Bn;function ci(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Bn==null){Bn=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Bn.appendChild(document.createTextNode("x")),Bn.appendChild(o("br"));Bn.appendChild(document.createTextNode("x"))}h(e.measure,Bn);var i=Bn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),v(e.measure),i||1}function wi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),i=o("pre",[t],"CodeMirror-line-like");h(e.measure,i);var n=t.getBoundingClientRect(),d=(n.right-n.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function ri(e){for(var t=e.display,i={},n={},d=t.gutters.clientLeft,D=t.gutters.firstChild,K=0;D;D=D.nextSibling,++K){var J=e.display.gutterSpecs[K].className;i[J]=D.offsetLeft+D.clientLeft+d,n[J]=D.clientWidth}return{fixedPos:Vi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Vi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function br(e){var t=ci(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/wi(e.display)-3);return function(d){if(zi(e.doc,d))return 0;var D=0;if(d.widgets)for(var K=0;K<d.widgets.length;K++)d.widgets[K].height&&(D+=d.widgets[K].height);return i?D+(Math.ceil(d.text.length/n)||1)*t:D+t}}function Zi(e){var t=e.doc,i=br(e);t.iter(function(n){var d=i(n);d!=n.height&&Zn(n,d)})}function Si(e,t,i,n){var d=e.display;if(!i&&ge(t).getAttribute("cm-not-content")=="true")return null;var D,K,J=d.lineSpace.getBoundingClientRect();try{D=t.clientX-J.left,K=t.clientY-J.top}catch(Se){return null}var Z=wn(e,D,K),ie;if(n&&Z.xRel>0&&(ie=At(e.doc,Z.line).text).length==Z.ch){var be=$(ie,ie.length,e.options.tabSize)-ie.length;Z=ht(Z.line,Math.max(0,Math.round((D-Oe(e.display).left)/wi(e.display))-be))}return Z}function $n(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function zn(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var d=e.display;if(n&&i<d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>t)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)ii&&gr(e.doc,t)<d.viewTo&&ni(e);else if(i<=d.viewFrom)ii&&ji(e.doc,i+n)>d.viewFrom?ni(e):(d.viewFrom+=n,d.viewTo+=n);else if(t<=d.viewFrom&&i>=d.viewTo)ni(e);else if(t<=d.viewFrom){var D=_r(e,i,i+n,1);D?(d.view=d.view.slice(D.index),d.viewFrom=D.lineN,d.viewTo+=n):ni(e)}else if(i>=d.viewTo){var K=_r(e,t,t,-1);K?(d.view=d.view.slice(0,K.index),d.viewTo=K.lineN):ni(e)}else{var J=_r(e,t,t,-1),Z=_r(e,i,i+n,1);J&&Z?(d.view=d.view.slice(0,J.index).concat(pi(e,J.lineN,Z.lineN)).concat(d.view.slice(Z.index)),d.viewTo+=n):ni(e)}var ie=d.externalMeasured;ie&&(i<ie.lineN?ie.lineN+=n:t<ie.lineN+ie.size&&(d.externalMeasured=null))}function ai(e,t,i){e.curOp.viewChanged=!0;var n=e.display,d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var D=n.view[$n(e,t)];if(D.node==null)return;var K=D.changes||(D.changes=[]);ue(K,i)==-1&&K.push(i)}function ni(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function _r(e,t,i,n){var d=$n(e,t),D,K=e.display.view;if(!ii||i==e.doc.first+e.doc.size)return{index:d,lineN:i};for(var J=e.display.viewFrom,Z=0;Z<d;Z++)J+=K[Z].size;if(J!=t){if(n>0){if(d==K.length-1)return null;D=J+K[d].size-t,d++}else D=J-t;t+=D,i+=D}for(;gr(e.doc,i)!=i;){if(d==(n<0?0:K.length-1))return null;i+=n*K[d-(n<0?1:0)].size,d+=n}return{index:d,lineN:i}}function Wr(e,t,i){var n=e.display,d=n.view;d.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=pi(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=pi(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice($n(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(pi(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,$n(e,i)))),n.viewTo=i}function Kr(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var d=t[n];!d.hidden&&(!d.node||d.changes)&&++i}return i}function Hn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Or(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},d=n.cursors=document.createDocumentFragment(),D=n.selection=document.createDocumentFragment(),K=0;K<i.sel.ranges.length;K++){if(!t&&K==i.sel.primIndex)continue;var J=i.sel.ranges[K];if(J.from().line>=e.display.viewTo||J.to().line<e.display.viewFrom)continue;var Z=J.empty();(Z||e.options.showCursorWhenSelecting)&&zr(e,J.head,d),Z||Fn(e,J,D)}return n}function zr(e,t,i){var n=xn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),d=i.appendChild(o("div","\xA0","CodeMirror-cursor"));if(d.style.left=n.left+"px",d.style.top=n.top+"px",d.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var D=i.appendChild(o("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));D.style.display="",D.style.left=n.other.left+"px",D.style.top=n.other.top+"px",D.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Yn(e,t){return e.top-t.top||e.left-t.left}function Fn(e,t,i){var n=e.display,d=e.doc,D=document.createDocumentFragment(),K=Oe(e.display),J=K.left,Z=Math.max(n.sizerWidth,ye(e)-n.sizer.offsetLeft)-K.right,ie=d.direction=="ltr";function be(Ot,Pt,tn,Vt){Pt<0&&(Pt=0),Pt=Math.round(Pt),Vt=Math.round(Vt),D.appendChild(o("div",null,"CodeMirror-selected","position: absolute; left: "+Ot+`px;
top: `+Pt+"px; width: "+(tn==null?Z-Ot:tn)+`px;
height: `+(Vt-Pt)+"px"))}function Se(Ot,Pt,tn){var Vt=At(d,Ot),gn=Vt.text.length,Jn,Mi;function si(xi,hr){return ei(e,ht(Ot,xi),"div",Vt,hr)}function vr(xi,hr,Bi){var Ai=Bt(e,Vt,null,xi),Ti=hr=="ltr"==(Bi=="after")?"left":"right",hi=Bi=="after"?Ai.begin:Ai.end-(/\s/.test(Vt.text.charAt(Ai.end-1))?2:1);return si(hi,Ti)[Ti]}var cr=Et(Vt,d.direction);return pt(cr,Pt||0,tn==null?gn:tn,function(xi,hr,Bi,Ai){var Ti=Bi=="ltr",hi=si(xi,Ti?"left":"right"),fr=si(hr-1,Ti?"right":"left"),za=Pt==null&&xi==0,pa=tn==null&&hr==gn,Yi=Ai==0,$r=!cr||Ai==cr.length-1;if(fr.top-hi.top<=3){var Pi=(ie?za:pa)&&Yi,ps=(ie?pa:za)&&$r,ia=Pi?J:(Ti?hi:fr).left,Ta=ps?Z:(Ti?fr:hi).right;be(ia,hi.top,Ta-ia,hi.bottom)}else{var wa,nr,Ga,ms;Ti?(wa=ie&&za&&Yi?J:hi.left,nr=ie?Z:vr(xi,Bi,"before"),Ga=ie?J:vr(hr,Bi,"after"),ms=ie&&pa&&$r?Z:fr.right):(wa=ie?vr(xi,Bi,"before"):J,nr=!ie&&za&&Yi?Z:hi.right,Ga=!ie&&pa&&$r?J:fr.left,ms=ie?vr(hr,Bi,"after"):Z),be(wa,hi.top,nr-wa,hi.bottom),hi.bottom<fr.top&&be(J,hi.bottom,null,fr.top),be(Ga,fr.top,ms-Ga,fr.bottom)}(!Jn||Yn(hi,Jn)<0)&&(Jn=hi),Yn(fr,Jn)<0&&(Jn=fr),(!Mi||Yn(hi,Mi)<0)&&(Mi=hi),Yn(fr,Mi)<0&&(Mi=fr)}),{start:Jn,end:Mi}}var Be=t.from(),Ue=t.to();if(Be.line==Ue.line)Se(Be.line,Be.ch,Ue.ch);else{var Qe=At(d,Be.line),dt=At(d,Ue.line),Tt=_i(Qe)==_i(dt),Ct=Se(Be.line,Be.ch,Tt?Qe.text.length+1:null).end,It=Se(Ue.line,Tt?0:null,Ue.ch).start;Tt&&(Ct.top<It.top-2?(be(Ct.right,Ct.top,null,Ct.bottom),be(J,It.top,It.left,It.bottom)):be(Ct.right,Ct.top,It.left-Ct.right,Ct.bottom)),Ct.bottom<It.top&&be(J,Ct.bottom,null,It.top)}i.appendChild(D)}function Ci(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||aa(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function To(e){e.state.focused||(e.display.input.focus(),Gr(e))}function Ja(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,aa(e))},100)}function Gr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ce(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ci(e)}function aa(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ce(e,"blur",e,t),e.state.focused=!1,g(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ca(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var d=t.view[n],D=e.options.lineWrapping,K=void 0,J=0;if(d.hidden)continue;if(H&&U<8){var Z=d.node.offsetTop+d.node.offsetHeight;K=Z-i,i=Z}else{var ie=d.node.getBoundingClientRect();K=ie.bottom-ie.top,!D&&d.text.firstChild&&(J=d.text.firstChild.getBoundingClientRect().right-ie.left-1)}var be=d.line.height-K;if((be>.005||be<-.005)&&(Zn(d.line,K),Qa(d.line),d.rest))for(var Se=0;Se<d.rest.length;Se++)Qa(d.rest[Se]);if(J>e.display.sizerWidth){var Be=Math.ceil(J/wi(e.display));Be>e.display.maxLineLength&&(e.display.maxLineLength=Be,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}function Qa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Oa(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-$a(e));var d=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,D=Qn(t,n),K=Qn(t,d);if(i&&i.ensure){var J=i.ensure.from.line,Z=i.ensure.to.line;J<D?(D=J,K=Qn(t,$i(At(t,J))+e.wrapper.clientHeight)):Math.min(Z,t.lastLine())>=K&&(D=Qn(t,$i(At(t,Z))-e.wrapper.clientHeight),K=Z)}return{from:D,to:Math.max(K,D+1)}}function Xo(e,t){if(We(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),d=null;if(t.top+n.top<0?d=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!r){var D=o("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-$a(e.display))+`px;
height: `+(t.bottom-t.top+Ie(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(D),D.scrollIntoView(d),e.display.lineSpace.removeChild(D)}}function Yo(e,t,i,n){n==null&&(n=0);var d;!e.options.lineWrapping&&t==i&&(t=t.ch?ht(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?ht(t.line,t.ch+1,"before"):t);for(var D=0;D<5;D++){var K=!1,J=xn(e,t),Z=!i||i==t?J:xn(e,i);d={left:Math.min(J.left,Z.left),top:Math.min(J.top,Z.top)-n,right:Math.max(J.left,Z.left),bottom:Math.max(J.bottom,Z.bottom)+n};var ie=Za(e,d),be=e.doc.scrollTop,Se=e.doc.scrollLeft;if(ie.scrollTop!=null&&(la(e,ie.scrollTop),Math.abs(e.doc.scrollTop-be)>1&&(K=!0)),ie.scrollLeft!=null&&(Er(e,ie.scrollLeft),Math.abs(e.doc.scrollLeft-Se)>1&&(K=!0)),!K)break}return d}function wo(e,t){var i=Za(e,t);i.scrollTop!=null&&la(e,i.scrollTop),i.scrollLeft!=null&&Er(e,i.scrollLeft)}function Za(e,t){var i=e.display,n=ci(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,D=ee(e),K={};t.bottom-t.top>D&&(t.bottom=t.top+D);var J=e.doc.height+fe(i),Z=t.top<n,ie=t.bottom>J-n;if(t.top<d)K.scrollTop=Z?0:t.top;else if(t.bottom>d+D){var be=Math.min(t.top,(ie?J:t.bottom)-D);be!=d&&(K.scrollTop=be)}var Se=e.options.fixedGutter?0:i.gutters.offsetWidth,Be=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Se,Ue=ye(e)-i.gutters.offsetWidth,Qe=t.right-t.left>Ue;return Qe&&(t.right=t.left+Ue),t.left<10?K.scrollLeft=0:t.left<Be?K.scrollLeft=Math.max(0,t.left+Se-(Qe?0:10)):t.right>Ue+Be-3&&(K.scrollLeft=t.right+(Qe?0:10)-Ue),K}function qa(e,t){if(t==null)return;Ra(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function oa(e){Ra(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sa(e,t,i){(t!=null||i!=null)&&Ra(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function $o(e,t){Ra(e),e.curOp.scrollToPos=t}function Ra(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Xt(e,t.from),n=Xt(e,t.to);ya(e,i,n,t.margin)}}function ya(e,t,i,n){var d=Za(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});sa(e,d.scrollLeft,d.scrollTop)}function la(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Ea(e,{top:t}),ua(e,t,!0),P&&Ea(e),_a(e,100)}function ua(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Er(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Sn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Qr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+fe(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?i:0,docHeight:n,scrollHeight:n+Ie(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Vr=function(e,t,i){this.cm=i;var n=this.vert=o("div",[o("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=o("div",[o("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=d.tabIndex=-1,e(n),e(d),Te(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Te(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&U<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Vr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var d=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+d)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var D=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+D)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Vr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Vr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Vr.prototype.zeroWidthHack=function(){var e=s&&!c?"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},Vr.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var d=e.getBoundingClientRect(),D=i=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);D!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Vr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ba=function(){};ba.prototype.update=function(){return{bottom:0,right:0}},ba.prototype.setScrollLeft=function(){},ba.prototype.setScrollTop=function(){},ba.prototype.clear=function(){};function Zr(e,t){t||(t=Qr(e));var i=e.display.barWidth,n=e.display.barHeight;Aa(e,t);for(var d=0;d<4&&i!=e.display.barWidth||n!=e.display.barHeight;d++)i!=e.display.barWidth&&e.options.lineWrapping&&Ca(e),Aa(e,Qr(e)),i=e.display.barWidth,n=e.display.barHeight}function Aa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var eo={native:Vr,null:ba};function La(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&g(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new eo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Te(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Er(e,t):la(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var to=0;function Xr(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:++to},Qi(e.curOp)}function qr(e){var t=e.curOp;t&&kn(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;So(i)})}function So(e){for(var t=e.ops,i=0;i<t.length;i++)Jo(t[i]);for(var n=0;n<t.length;n++)Qo(t[n]);for(var d=0;d<t.length;d++)Zo(t[d]);for(var D=0;D<t.length;D++)no(t[D]);for(var K=0;K<t.length;K++)qo(t[K])}function Jo(e){var t=e.cm,i=t.display;Co(t),e.updateMaxLine&&Lr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new xr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qo(e){e.updatedDisplay=e.mustUpdate&&ea(e.cm,e.update)}function Zo(e){var t=e.cm,i=t.display;e.updatedDisplay&&Ca(t),e.barMeasure=Qr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=xe(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Ie(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-ye(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function no(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Er(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Zr(t,e.barMeasure),e.updatedDisplay&&jn(t,e.barMeasure),e.selectionChanged&&Ci(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&To(e.cm)}function qo(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Ia(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&ua(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Er(t,e.scrollLeft,!0,!0),e.scrollToPos){var d=Yo(t,x(n,e.scrollToPos.from),x(n,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,d)}var D=e.maybeHiddenMarkers,K=e.maybeUnhiddenMarkers;if(D)for(var J=0;J<D.length;++J)D[J].lines.length||Ce(D[J],"hide");if(K)for(var Z=0;Z<K.length;++Z)K[Z].lines.length&&Ce(K[Z],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function qi(e,t){if(e.curOp)return t();Xr(e);try{return t()}finally{qr(e)}}function mi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xr(e);try{return t.apply(e,arguments)}finally{qr(e)}}}function Fi(e){return function(){if(this.curOp)return e.apply(this,arguments);Xr(this);try{return e.apply(this,arguments)}finally{qr(this)}}}function gi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Xr(t);try{return e.apply(this,arguments)}finally{qr(t)}}}function _a(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,B(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=xt(e,t.highlightFrontier),d=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(D){if(n.line>=e.display.viewFrom){var K=D.styles,J=D.text.length>e.options.maxHighlightLength?Zt(t.mode,n.state):null,Z=we(e,D,n,!0);J&&(n.state=J),D.styles=Z.styles;var ie=D.styleClasses,be=Z.classes;be?D.styleClasses=be:ie&&(D.styleClasses=null);for(var Se=!K||K.length!=D.styles.length||ie!=be&&(!ie||!be||ie.bgClass!=be.bgClass||ie.textClass!=be.textClass),Be=0;!Se&&Be<K.length;++Be)Se=K[Be]!=D.styles[Be];Se&&d.push(n.line),D.stateAfter=n.save(),n.nextLine()}else D.text.length<=e.options.maxHighlightLength&&Dt(e,D.text,n),D.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return _a(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),d.length&&qi(e,function(){for(var D=0;D<d.length;D++)ai(e,d[D],"text")})}var xr=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Oa(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=ye(e),this.force=i,this.dims=ri(e),this.events=[]};xr.prototype.signal=function(e,t){ce(e,t)&&this.events.push(arguments)},xr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ce.apply(null,this.events[e])};function Co(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ie(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ie(e)+"px",t.scrollbarsClipped=!0)}function Oo(e){if(e.hasFocus())return null;var t=N();if(!t||!T(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&T(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function Ro(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&T(document.body,e.anchorNode)&&T(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function ea(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return ni(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Kr(e)==0)return!1;Oi(e)&&(ni(e),t.dims=ri(e));var d=n.first+n.size,D=Math.max(t.visible.from-e.options.viewportMargin,n.first),K=Math.min(d,t.visible.to+e.options.viewportMargin);i.viewFrom<D&&D-i.viewFrom<20&&(D=Math.max(n.first,i.viewFrom)),i.viewTo>K&&i.viewTo-K<20&&(K=Math.min(d,i.viewTo)),ii&&(D=gr(e.doc,D),K=ji(e.doc,K));var J=D!=i.viewFrom||K!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Wr(e,D,K),i.viewOffset=$i(At(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var Z=Kr(e);if(!J&&Z==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ie=Oo(e);return Z>4&&(i.lineDiv.style.display="none"),Ao(e,i.updateLineNumbers,t.dims),Z>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Ro(ie),v(i.cursorDiv),v(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,J&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,_a(e,400)),i.updateLineNumbers=null,!0}function Ia(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==ye(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+fe(e.display)-ee(e),i.top)}),t.visible=Oa(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Oa(e.display,e.doc,i));if(!ea(e,t))break;Ca(e);var d=Qr(e);Hn(e),Zr(e,d),jn(e,d),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 Ea(e,t){var i=new xr(e,t);if(ea(e,i)){Ca(e),Ia(e,i);var n=Qr(e);Hn(e),Zr(e,n),jn(e,n),i.finish()}}function Ao(e,t,i){var n=e.display,d=e.options.lineNumbers,D=n.lineDiv,K=D.firstChild;function J(Qe){var dt=Qe.nextSibling;return k&&s&&e.display.currentWheelTarget==Qe?Qe.style.display="none":Qe.parentNode.removeChild(Qe),dt}for(var Z=n.view,ie=n.viewFrom,be=0;be<Z.length;be++){var Se=Z[be];if(!Se.hidden)if(!Se.node||Se.node.parentNode!=D){var Be=Eo(e,Se,ie,i);D.insertBefore(Be,K)}else{for(;K!=Se.node;)K=J(K);var Ue=d&&t!=null&&t<=ie&&Se.lineNumber;Se.changes&&(ue(Se.changes,"gutter")>-1&&(Ue=!1),Br(e,Se,ie,i)),Ue&&(v(Se.lineNumber),Se.lineNumber.appendChild(document.createTextNode(Ui(e.options,ie)))),K=Se.node.nextSibling}ie+=Se.size}for(;K;)K=J(K)}function Da(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function jn(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+Ie(e)+"px"}function Sn(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Vi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,D=n+"px",K=0;K<i.length;K++)if(!i[K].hidden){e.options.fixedGutter&&(i[K].gutter&&(i[K].gutter.style.left=D),i[K].gutterBackground&&(i[K].gutterBackground.style.left=D));var J=i[K].alignable;if(J)for(var Z=0;Z<J.length;Z++)J[Z].style.left=D}e.options.fixedGutter&&(t.gutters.style.left=n+d+"px")}function Oi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Ui(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var d=n.measure.appendChild(o("div",[o("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),D=d.firstChild.offsetWidth,K=d.offsetWidth-D;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(D,n.lineGutter.offsetWidth-K)+1,n.lineNumWidth=n.lineNumInnerWidth+K,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Da(e.display),!0}return!1}function er(e,t){for(var i=[],n=!1,d=0;d<e.length;d++){var D=e[d],K=null;if(typeof D!="string"&&(K=D.style,D=D.className),D=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:D,style:K})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function da(e){var t=e.gutters,i=e.gutterSpecs;v(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var d=i[n],D=d.className,K=d.style,J=t.appendChild(o("div",null,"CodeMirror-gutter "+D));K&&(J.style.cssText=K),D=="CodeMirror-linenumbers"&&(e.lineGutter=J,J.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Da(e)}function Dr(e){da(e.display),zn(e),Sn(e)}function xa(e,t,i,n){var d=this;this.input=i,d.scrollbarFiller=o("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=o("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=_("div",null,"CodeMirror-code"),d.selectionDiv=o("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=o("div",null,"CodeMirror-cursors"),d.measure=o("div",null,"CodeMirror-measure"),d.lineMeasure=o("div",null,"CodeMirror-measure"),d.lineSpace=_("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var D=_("div",[d.lineSpace],"CodeMirror-lines");d.mover=o("div",[D],null,"position: relative"),d.sizer=o("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=o("div",null,null,"position: absolute; height: "+me+"px; width: 1px;"),d.gutters=o("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=o("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=o("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),H&&U<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!k&&!(P&&a)&&(d.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(d.wrapper):e(d.wrapper)),d.viewFrom=d.viewTo=t.first,d.reportedViewFrom=d.reportedViewTo=t.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,d.gutterSpecs=er(n.gutters,n.lineNumbers),da(d),i.init(d)}var Yr=0,Ri=null;H?Ri=-.53:P?Ri=15:b?Ri=-.7:p&&(Ri=-1/3);function ka(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function io(e){var t=ka(e);return t.x*=Ri,t.y*=Ri,t}function ro(e,t){var i=ka(t),n=i.x,d=i.y,D=e.display,K=D.scroller,J=K.scrollWidth>K.clientWidth,Z=K.scrollHeight>K.clientHeight;if(!(n&&J||d&&Z))return;if(d&&s&&k){e:for(var ie=t.target,be=D.view;ie!=K;ie=ie.parentNode)for(var Se=0;Se<be.length;Se++)if(be[Se].node==ie){e.display.currentWheelTarget=ie;break e}}if(n&&!P&&!y&&Ri!=null){d&&Z&&la(e,Math.max(0,K.scrollTop+d*Ri)),Er(e,Math.max(0,K.scrollLeft+n*Ri)),(!d||d&&Z)&&ne(t),D.wheelStartX=null;return}if(d&&Ri!=null){var Be=d*Ri,Ue=e.doc.scrollTop,Qe=Ue+D.wrapper.clientHeight;Be<0?Ue=Math.max(0,Ue+Be-50):Qe=Math.min(e.doc.height,Qe+Be+50),Ea(e,{top:Ue,bottom:Qe})}Yr<20&&(D.wheelStartX==null?(D.wheelStartX=K.scrollLeft,D.wheelStartY=K.scrollTop,D.wheelDX=n,D.wheelDY=d,setTimeout(function(){if(D.wheelStartX==null)return;var dt=K.scrollLeft-D.wheelStartX,Tt=K.scrollTop-D.wheelStartY,Ct=Tt&&D.wheelDY&&Tt/D.wheelDY||dt&&D.wheelDX&&dt/D.wheelDX;if(D.wheelStartX=D.wheelStartY=null,!Ct)return;Ri=(Ri*Yr+Ct)/(Yr+1),++Yr},200)):(D.wheelDX+=n,D.wheelDY+=d))}var tr=function(e,t){this.ranges=e,this.primIndex=t};tr.prototype.primary=function(){return this.ranges[this.primIndex]},tr.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 i=this.ranges[t],n=e.ranges[t];if(!Di(i.anchor,n.anchor)||!Di(i.head,n.head))return!1}return!0},tr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Un(Hi(this.ranges[t].anchor),Hi(this.ranges[t].head));return new tr(e,this.primIndex)},tr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},tr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(zt(t,n.from())>=0&&zt(e,n.to())<=0)return i}return-1};var Un=function(e,t){this.anchor=e,this.head=t};Un.prototype.from=function(){return Wi(this.anchor,this.head)},Un.prototype.to=function(){return ir(this.anchor,this.head)},Un.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Tr(e,t,i){var n=e&&e.options.selectionsMayTouch,d=t[i];t.sort(function(Be,Ue){return zt(Be.from(),Ue.from())}),i=ue(t,d);for(var D=1;D<t.length;D++){var K=t[D],J=t[D-1],Z=zt(J.to(),K.from());if(n&&!K.empty()?Z>0:Z>=0){var ie=Wi(J.from(),K.from()),be=ir(J.to(),K.to()),Se=J.empty()?K.from()==K.head:J.from()==J.head;D<=i&&--i,t.splice(--D,2,new Un(Se?be:ie,Se?ie:be))}}return new tr(t,i)}function kr(e,t){return new tr([new Un(e,t||e)],0)}function Mr(e){return e.text?ht(e.from.line+e.text.length-1,He(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ao(e,t){if(zt(e,t.from)<0)return e;if(zt(e,t.to)<=0)return Mr(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Mr(t).ch-t.to.ch),ht(i,n)}function Ma(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var d=e.sel.ranges[n];i.push(new Un(ao(d.anchor,t),ao(d.head,t)))}return Tr(e.cm,i,e.sel.primIndex)}function Lo(e,t,i){return e.line==t.line?ht(i.line,e.ch-t.ch+i.ch):ht(i.line+(e.line-t.line),e.ch)}function Io(e,t,i){for(var n=[],d=ht(e.first,0),D=d,K=0;K<t.length;K++){var J=t[K],Z=Lo(J.from,d,D),ie=Lo(Mr(J),d,D);if(d=J.to,D=ie,i=="around"){var be=e.sel.ranges[K],Se=zt(be.head,be.anchor)<0;n[K]=new Un(Se?ie:Z,Se?Z:ie)}else n[K]=new Un(Z,Z)}return new tr(n,e.sel.primIndex)}function ta(e){e.doc.mode=Lt(e.options,e.doc.modeOption),oo(e)}function oo(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,_a(e,100),e.state.modeGen++,e.curOp&&zn(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&He(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,i,n){function d(It){return i?i[It]:null}function D(It,Ot,Pt){Jr(It,Ot,Pt,n),_n(It,"change",It,t)}function K(It,Ot){for(var Pt=[],tn=It;tn<Ot;++tn)Pt.push(new Ji(ie[tn],d(tn),n));return Pt}var J=t.from,Z=t.to,ie=t.text,be=At(e,J.line),Se=At(e,Z.line),Be=He(ie),Ue=d(ie.length-1),Qe=Z.line-J.line;if(t.full)e.insert(0,K(0,ie.length)),e.remove(ie.length,e.size-ie.length);else if(gs(e,t)){var dt=K(0,ie.length-1);D(Se,Se.text,Ue),Qe&&e.remove(J.line,Qe),dt.length&&e.insert(J.line,dt)}else if(be==Se)if(ie.length==1)D(be,be.text.slice(0,J.ch)+Be+be.text.slice(Z.ch),Ue);else{var Tt=K(1,ie.length-1);Tt.push(new Ji(Be+be.text.slice(Z.ch),Ue,n)),D(be,be.text.slice(0,J.ch)+ie[0],d(0)),e.insert(J.line+1,Tt)}else if(ie.length==1)D(be,be.text.slice(0,J.ch)+ie[0]+Se.text.slice(Z.ch),d(0)),e.remove(J.line+1,Qe);else{D(be,be.text.slice(0,J.ch)+ie[0],d(0)),D(Se,Be+Se.text.slice(Z.ch),Ue);var Ct=K(1,ie.length-1);Qe>1&&e.remove(J.line+1,Qe-1),e.insert(J.line+1,Ct)}_n(e,"change",e,t)}function ca(e,t,i){function n(d,D,K){if(d.linked)for(var J=0;J<d.linked.length;++J){var Z=d.linked[J];if(Z.doc==D)continue;var ie=K&&Z.sharedHist;if(i&&!ie)continue;t(Z.doc,ie),n(Z.doc,d,ie)}}n(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Zi(e),ta(e),ys(e),e.options.lineWrapping||Lr(e),e.options.mode=t.modeOption,zn(e)}function ys(e){(e.doc.direction=="rtl"?j:g)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){qi(e,function(){ys(e),zn(e)})}function Do(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 ns(e,t){var i={from:Hi(t.from),to:Mr(t),text:li(e,t.from,t.to)};return Es(e,i,t.from.line,t.to.line+1),ca(e,function(n){return Es(n,i,t.from.line,t.to.line+1)},!0),i}function bs(e){for(;e.length;){var t=He(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return bs(e.done),He(e.done);if(e.done.length&&!He(e.done).ranges)return He(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),He(e.done)}function _s(e,t,i,n){var d=e.history;d.undone.length=0;var D=+new Date,K,J;if((d.lastOp==n||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>D-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(d,d.lastOp==n)))J=He(K.changes),zt(t.from,t.to)==0&&zt(t.from,J.to)==0?J.to=Mr(t):K.changes.push(ns(e,t));else{var Z=He(d.done);for((!Z||!Z.ranges)&&ko(e.sel,d.done),K={changes:[ns(e,t)],generation:d.generation},d.done.push(K);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(i),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=D,d.lastOp=d.lastSelOp=n,d.lastOrigin=d.lastSelOrigin=t.origin,J||Ce(e,"historyAdded")}function ml(e,t,i,n){var d=t.charAt(0);return d=="*"||d=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var d=e.history,D=n&&n.origin;i==d.lastSelOp||D&&d.lastSelOrigin==D&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==D||ml(e,D,He(d.done),t))?d.done[d.done.length-1]=t:ko(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=D,d.lastSelOp=i,n&&n.clearRedo!==!1&&bs(d.undone)}function ko(e,t){var i=He(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Es(e,t,i,n){var d=t["spans_"+e.id],D=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(K){K.markedSpans&&((d||(d=t["spans_"+e.id]={}))[D]=K.markedSpans),++D})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],d=0;d<t.text.length;++d)n.push(vl(i[d]));return n}function xs(e,t){var i=yl(e,t),n=or(e,t);if(!i)return n;if(!n)return i;for(var d=0;d<i.length;++d){var D=i[d],K=n[d];if(D&&K){e:for(var J=0;J<K.length;++J){for(var Z=K[J],ie=0;ie<D.length;++ie)if(D[ie].marker==Z.marker)continue e;D.push(Z)}}else K&&(i[d]=K)}return i}function Pa(e,t,i){for(var n=[],d=0;d<e.length;++d){var D=e[d];if(D.ranges){n.push(i?tr.prototype.deepCopy.call(D):D);continue}var K=D.changes,J=[];n.push({changes:J});for(var Z=0;Z<K.length;++Z){var ie=K[Z],be=void 0;if(J.push({from:ie.from,to:ie.to,text:ie.text}),t)for(var Se in ie)(be=Se.match(/^spans_(\d+)$/))&&(ue(t,Number(be[1]))>-1&&(He(J)[Se]=ie[Se],delete ie[Se]))}}return n}function is(e,t,i,n){if(n){var d=e.anchor;if(i){var D=zt(t,d)<0;D!=zt(i,d)<0?(d=t,t=i):D!=zt(t,i)<0&&(t=i)}return new Un(d,t)}else return new Un(i||t,t)}function Mo(e,t,i,n,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),Xi(e,new tr([is(e.sel.primary(),t,i,d)],0),n)}function Ts(e,t,i){for(var n=[],d=e.cm&&(e.cm.display.shift||e.extend),D=0;D<e.sel.ranges.length;D++)n[D]=is(e.sel.ranges[D],t[D],null,d);var K=Tr(e.cm,n,e.sel.primIndex);Xi(e,K,i)}function rs(e,t,i,n){var d=e.sel.ranges.slice(0);d[t]=i,Xi(e,Tr(e.cm,d,e.sel.primIndex),n)}function ws(e,t,i,n){Xi(e,kr(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(d){this.ranges=[];for(var D=0;D<d.length;D++)this.ranges[D]=new Un(x(e,d[D].anchor),x(e,d[D].head))},origin:i&&i.origin};return Ce(e,"beforeSelectionChange",e,n),e.cm&&Ce(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Tr(e.cm,n.ranges,n.ranges.length-1):t}function Ss(e,t,i){var n=e.history.done,d=He(n);d&&d.ranges?(n[n.length-1]=t,Po(e,t,i)):Xi(e,t,i)}function Xi(e,t,i){Po(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Po(e,t,i){(ce(e,"beforeSelectionChange")||e.cm&&ce(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(zt(t.primary().head,e.sel.primary().head)<0?-1:1);Cs(e,Rs(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&oa(e.cm)}function Cs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),_n(e,"cursorActivity",e)}function Os(e){Cs(e,Rs(e,e.sel,null,!1))}function Rs(e,t,i,n){for(var d,D=0;D<t.ranges.length;D++){var K=t.ranges[D],J=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[D],Z=No(e,K.anchor,J&&J.anchor,i,n),ie=No(e,K.head,J&&J.head,i,n);(d||Z!=K.anchor||ie!=K.head)&&(d||(d=t.ranges.slice(0,D)),d[D]=new Un(Z,ie))}return d?Tr(e.cm,d,t.primIndex):t}function Na(e,t,i,n,d){var D=At(e,t.line);if(D.markedSpans)for(var K=0;K<D.markedSpans.length;++K){var J=D.markedSpans[K],Z=J.marker,ie="selectLeft"in Z?!Z.selectLeft:Z.inclusiveLeft,be="selectRight"in Z?!Z.selectRight:Z.inclusiveRight;if((J.from==null||(ie?J.from<=t.ch:J.from<t.ch))&&(J.to==null||(be?J.to>=t.ch:J.to>t.ch))){if(d&&(Ce(Z,"beforeCursorEnter"),Z.explicitlyCleared))if(D.markedSpans){--K;continue}else break;if(!Z.atomic)continue;if(i){var Se=Z.find(n<0?1:-1),Be=void 0;if((n<0?be:ie)&&(Se=As(e,Se,-n,Se&&Se.line==t.line?D:null)),Se&&Se.line==t.line&&(Be=zt(Se,i))&&(n<0?Be<0:Be>0))return Na(e,Se,t,n,d)}var Ue=Z.find(n<0?-1:1);return(n<0?ie:be)&&(Ue=As(e,Ue,n,Ue.line==t.line?D:null)),Ue?Na(e,Ue,t,n,d):null}}return t}function No(e,t,i,n,d){var D=n||1,K=Na(e,t,i,D,d)||!d&&Na(e,t,i,D,!0)||Na(e,t,i,-D,d)||!d&&Na(e,t,i,-D,!0);return K||(e.cantEdit=!0,ht(e.first,0))}function As(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?x(e,ht(t.line-1)):null:i>0&&t.ch==(n||At(e,t.line)).text.length?t.line<e.first+e.size-1?ht(t.line+1,0):null:new ht(t.line,t.ch+i)}function Ls(e){e.setSelection(ht(e.firstLine(),0),ht(e.lastLine()),Ae)}function Is(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(d,D,K,J){d&&(n.from=x(e,d)),D&&(n.to=x(e,D)),K&&(n.text=K),J!==void 0&&(n.origin=J)}),Ce(e,"beforeChange",e,n),e.cm&&Ce(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Ua(e,t,i){if(e.cm){if(!e.cm.curOp)return mi(e.cm,Ua)(e,t,i);if(e.cm.state.suppressEdits)return}if((ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"))&&(t=Is(e,t,!0),!t))return;var n=wr&&!i&&pr(e,t.from,t.to);if(n)for(var d=n.length-1;d>=0;--d)Ds(e,{from:n[d].from,to:n[d].to,text:d?[""]:t.text,origin:t.origin});else Ds(e,t)}function Ds(e,t){if(t.text.length==1&&t.text[0]==""&&zt(t.from,t.to)==0)return;var i=Ma(e,t);_s(e,t,i,e.cm?e.cm.curOp.id:NaN),so(e,t,i,or(e,t));var n=[];ca(e,function(d,D){!D&&ue(n,d.history)==-1&&(Ns(d.history,t),n.push(d.history)),so(d,t,null,or(d,t))})}function Uo(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var d=e.history,D,K=e.sel,J=t=="undo"?d.done:d.undone,Z=t=="undo"?d.undone:d.done,ie=0;ie<J.length&&!(D=J[ie],i?D.ranges&&!D.equals(e.sel):!D.ranges);ie++);if(ie==J.length)return;for(d.lastOrigin=d.lastSelOrigin=null;;)if(D=J.pop(),D.ranges){if(ko(D,Z),i&&!D.equals(e.sel)){Xi(e,D,{clearRedo:!1});return}K=D}else if(n){J.push(D);return}else break;var be=[];ko(K,Z),Z.push({changes:be,generation:d.generation}),d.generation=D.generation||++d.maxGeneration;for(var Se=ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"),Be=function(dt){var Tt=D.changes[dt];if(Tt.origin=t,Se&&!Is(e,Tt,!1))return J.length=0,{};be.push(ns(e,Tt));var Ct=dt?Ma(e,Tt):He(J);so(e,Tt,Ct,xs(e,Tt)),!dt&&e.cm&&e.cm.scrollIntoView({from:Tt.from,to:Mr(Tt)});var It=[];ca(e,function(Ot,Pt){!Pt&&ue(It,Ot.history)==-1&&(Ns(Ot.history,Tt),It.push(Ot.history)),so(Ot,Tt,null,xs(Ot,Tt))})},Ue=D.changes.length-1;Ue>=0;--Ue){var Qe=Be(Ue);if(Qe)return Qe.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new tr(ft(e.sel.ranges,function(d){return new Un(ht(d.anchor.line+t,d.anchor.ch),ht(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){zn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)ai(e.cm,n,"gutter")}}function so(e,t,i,n){if(e.cm&&!e.cm.curOp)return mi(e.cm,so)(e,t,i,n);if(t.to.line<e.first){ks(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 d=t.text.length-1-(e.first-t.from.line);ks(e,d),t={from:ht(e.first,0),to:ht(t.to.line+d,t.to.ch),text:[He(t.text)],origin:t.origin}}var D=e.lastLine();t.to.line>D&&(t={from:t.from,to:ht(D,At(e,D).text.length),text:[t.text[0]],origin:t.origin}),t.removed=li(e,t.from,t.to),i||(i=Ma(e,t)),e.cm?_l(e.cm,t,n):ts(e,t,n),Po(e,i,Ae),e.cantEdit&&No(e,ht(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,d=e.display,D=t.from,K=t.to,J=!1,Z=D.line;e.options.lineWrapping||(Z=an(_i(At(n,D.line))),n.iter(Z,K.line+1,function(Ue){if(Ue==d.maxLine)return J=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ve(e),ts(n,t,i,br(e)),e.options.lineWrapping||(n.iter(Z,D.line+t.text.length,function(Ue){var Qe=Fr(Ue);Qe>d.maxLineLength&&(d.maxLine=Ue,d.maxLineLength=Qe,d.maxLineChanged=!0,J=!1)}),J&&(e.curOp.updateMaxLine=!0)),rr(n,D.line),_a(e,400);var ie=t.text.length-(K.line-D.line)-1;t.full?zn(e):D.line==K.line&&t.text.length==1&&!gs(e.doc,t)?ai(e,D.line,"text"):zn(e,D.line,K.line+1,ie);var be=ce(e,"changes"),Se=ce(e,"change");if(Se||be){var Be={from:D,to:K,text:t.text,removed:t.removed,origin:t.origin};Se&&_n(e,"change",e,Be),be&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Be)}e.display.selForContextMenu=null}function ja(e,t,i,n,d){var D;n||(n=i),zt(n,i)<0&&(D=[n,i],i=D[0],n=D[1]),typeof t=="string"&&(t=e.splitLines(t)),Ua(e,{from:i,to:n,text:t,origin:d})}function Ms(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ps(e,t,i,n){for(var d=0;d<e.length;++d){var D=e[d],K=!0;if(D.ranges){D.copied||(D=e[d]=D.deepCopy(),D.copied=!0);for(var J=0;J<D.ranges.length;J++)Ms(D.ranges[J].anchor,t,i,n),Ms(D.ranges[J].head,t,i,n);continue}for(var Z=0;Z<D.changes.length;++Z){var ie=D.changes[Z];if(i<ie.from.line)ie.from=ht(ie.from.line+n,ie.from.ch),ie.to=ht(ie.to.line+n,ie.to.ch);else if(t<=ie.to.line){K=!1;break}}K||(e.splice(0,d+1),d=0)}}function Ns(e,t){var i=t.from.line,n=t.to.line,d=t.text.length-(n-i)-1;Ps(e.done,i,n,d),Ps(e.undone,i,n,d)}function lo(e,t,i,n){var d=t,D=t;return typeof t=="number"?D=At(e,G(e,t)):d=an(t),d==null?null:(n(D,d)&&e.cm&&ai(e.cm,d,i),D)}function uo(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}uo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var d=this.lines[i];this.height-=d.height,Ft(d),_n(d,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function co(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var d=e[n];t+=d.chunkSize(),i+=d.height,d.parent=this}this.size=t,this.height=i,this.parent=null}co.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],d=n.chunkSize();if(e<d){var D=Math.min(t,d-e),K=n.height;if(n.removeInner(e,D),this.height-=K-n.height,d==D&&(this.children.splice(i--,1),n.parent=null),(t-=D)==0)break;e=0}else e-=d}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof uo))){var J=[];this.collapse(J),this.children=[new uo(J)],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,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var d=this.children[n],D=d.chunkSize();if(e<=D){if(d.insertInner(e,t,i),d.lines&&d.lines.length>50){for(var K=d.lines.length%25+25,J=K;J<d.lines.length;){var Z=new uo(d.lines.slice(J,J+=25));d.height-=Z.height,this.children.splice(++n,0,Z),Z.parent=this}d.lines=d.lines.slice(0,K),this.maybeSpill()}break}e-=D}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new co(t);if(e.parent){e.size-=i.size,e.height-=i.height;var d=ue(e.parent.children,e);e.parent.children.splice(d+1,0,i)}else{var n=new co(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var d=this.children[n],D=d.chunkSize();if(e<D){var K=Math.min(t,D-e);if(d.iterN(e,K,i))return!0;if((t-=K)==0)break;e=0}else e-=D}}};var ho=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};ho.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=an(i);if(n==null||!t)return;for(var d=0;d<t.length;++d)t[d]==this&&t.splice(d--,1);t.length||(i.widgets=null);var D=ra(this);Zn(i,Math.max(0,i.height-D)),e&&(qi(e,function(){Us(e,i,-D),ai(e,n,"widget")}),_n(e,"lineWidgetCleared",e,this,n))},ho.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var d=ra(this)-t;if(!d)return;zi(this.doc,n)||Zn(n,n.height+d),i&&qi(i,function(){i.curOp.forceUpdate=!0,Us(i,n,d),_n(i,"lineWidgetChanged",i,e,an(n))})},he(ho);function Us(e,t,i){$i(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qa(e,i)}function El(e,t,i,n){var d=new ho(e,i,n),D=e.cm;return D&&d.noHScroll&&(D.display.alignWidgets=!0),lo(e,t,"widget",function(K){var J=K.widgets||(K.widgets=[]);if(d.insertAt==null?J.push(d):J.splice(Math.min(J.length-1,Math.max(0,d.insertAt)),0,d),d.line=K,D&&!zi(e,K)){var Z=$i(K)<e.scrollTop;Zn(K,K.height+ra(d)),Z&&qa(D,d.height),D.curOp.forceUpdate=!0}return!0}),D&&_n(D,"lineWidgetAdded",D,d,typeof t=="number"?t:an(t)),d}var js=0,ha=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++js};ha.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Xr(e),ce(this,"clear")){var i=this.find();i&&_n(this,"clear",i.from,i.to)}for(var n=null,d=null,D=0;D<this.lines.length;++D){var K=this.lines[D],J=bi(K.markedSpans,this);e&&!this.collapsed?ai(e,an(K),"text"):e&&(J.to!=null&&(d=an(K)),J.from!=null&&(n=an(K))),K.markedSpans=Rr(K.markedSpans,J),J.from==null&&this.collapsed&&!zi(this.doc,K)&&e&&Zn(K,ci(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Z=0;Z<this.lines.length;++Z){var ie=_i(this.lines[Z]),be=Fr(ie);be>e.display.maxLineLength&&(e.display.maxLine=ie,e.display.maxLineLength=be,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&zn(e,n,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&_n(e,"markerCleared",e,this,n,d),t&&qr(e),this.parent&&this.parent.clear()},ha.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,d=0;d<this.lines.length;++d){var D=this.lines[d],K=bi(D.markedSpans,this);if(K.from!=null&&(i=ht(t?D:an(D),K.from),e==-1))return i;if(K.to!=null&&(n=ht(t?D:an(D),K.to),e==1))return n}return i&&{from:i,to:n}},ha.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;qi(n,function(){var d=t.line,D=an(t.line),K=ke(n,D);if(K&&(pn(K),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!zi(i.doc,d)&&i.height!=null){var J=i.height;i.height=null;var Z=ra(i)-J;Z&&Zn(d,d.height+Z)}_n(n,"markerChanged",n,e)})},ha.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ue(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ha.prototype.detachLine=function(e){if(this.lines.splice(ue(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},he(ha);function Fa(e,t,i,n,d){if(n&&n.shared)return xl(e,t,i,n,d);if(e.cm&&!e.cm.curOp)return mi(e.cm,Fa)(e,t,i,n,d);var D=new ha(e,d),K=zt(t,i);if(n&&R(n,D,!1),K>0||K==0&&D.clearWhenEmpty!==!1)return D;if(D.replacedWith&&(D.collapsed=!0,D.widgetNode=_("span",[D.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||D.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(D.widgetNode.insertLeft=!0)),D.collapsed){if(di(e,t.line,t,i,D)||t.line!=i.line&&di(e,i.line,t,i,D))throw new Error("Inserting collapsed marker partially overlapping an existing one");yr()}D.addToHistory&&_s(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var J=t.line,Z=e.cm,ie;if(e.iter(J,i.line+1,function(Se){Z&&D.collapsed&&!Z.options.lineWrapping&&_i(Se)==Z.display.maxLine&&(ie=!0),D.collapsed&&J!=t.line&&Zn(Se,0),Sr(Se,new ar(D,J==t.line?t.ch:null,J==i.line?i.ch:null)),++J}),D.collapsed&&e.iter(t.line,i.line+1,function(Se){zi(e,Se)&&Zn(Se,0)}),D.clearOnEnter&&Te(D,"beforeCursorEnter",function(){return D.clear()}),D.readOnly&&(Ki(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),D.collapsed&&(D.id=++js,D.atomic=!0),Z){if(ie&&(Z.curOp.updateMaxLine=!0),D.collapsed)zn(Z,t.line,i.line+1);else if(D.className||D.startStyle||D.endStyle||D.css||D.attributes||D.title)for(var be=t.line;be<=i.line;be++)ai(Z,be,"text");D.atomic&&Os(Z.doc),_n(Z,"markerAdded",Z,D)}return D}var fo=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};fo.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();_n(this,"clear")},fo.prototype.find=function(e,t){return this.primary.find(e,t)},he(fo);function xl(e,t,i,n,d){n=R(n),n.shared=!1;var D=[Fa(e,t,i,n,d)],K=D[0],J=n.widgetNode;return ca(e,function(Z){J&&(n.widgetNode=J.cloneNode(!0)),D.push(Fa(Z,x(Z,t),x(Z,i),n,d));for(var ie=0;ie<Z.linked.length;++ie)if(Z.linked[ie].isParent)return;K=He(D)}),new fo(D,K)}function Fs(e){return e.findMarks(ht(e.first,0),e.clipPos(ht(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var n=t[i],d=n.find(),D=e.clipPos(d.from),K=e.clipPos(d.to);if(zt(D,K)){var J=Fa(e,D,K,n.primary,n.primary.type);n.markers.push(J),J.parent=n}}}function wl(e){for(var t=function(n){var d=e[n],D=[d.primary.doc];ca(d.primary.doc,function(Z){return D.push(Z)});for(var K=0;K<d.markers.length;K++){var J=d.markers[K];ue(D,J.doc)==-1&&(J.parent=null,d.markers.splice(K--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,dr=function(e,t,i,n,d){if(!(this instanceof dr))return new dr(e,t,i,n,d);i==null&&(i=0),co.call(this,[new uo([new Ji("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var D=ht(i,0);this.sel=kr(D),this.history=new Do(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=d=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:D,to:D,text:e}),Xi(this,kr(D),Ae)};dr.prototype=ct(co.prototype,{constructor:dr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Li(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:gi(function(e){var t=ht(this.first,0),i=this.first+this.size-1;Ua(this,{from:t,to:ht(i,At(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&sa(this.cm,0,0),Xi(this,kr(t),Ae)}),replaceRange:function(e,t,i,n){t=x(this,t),i=i?x(this,i):t,ja(this,e,t,i,n)},getRange:function(e,t,i){var n=li(this,x(this,e),x(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ii(this,e))return At(this,e)},getLineNumber:function(e){return an(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=At(this,e)),_i(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return x(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:gi(function(e,t,i){ws(this,x(this,typeof e=="number"?ht(e,t||0):e),null,i)}),setSelection:gi(function(e,t,i){ws(this,x(this,e),x(this,t||e),i)}),extendSelection:gi(function(e,t,i){Mo(this,x(this,e),t&&x(this,t),i)}),extendSelections:gi(function(e,t){Ts(this,F(this,e),t)}),extendSelectionsBy:gi(function(e,t){var i=ft(this.sel.ranges,e);Ts(this,F(this,i),t)}),setSelections:gi(function(e,t,i){if(!e.length)return;for(var n=[],d=0;d<e.length;d++)n[d]=new Un(x(this,e[d].anchor),x(this,e[d].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Xi(this,Tr(this.cm,n,t),i)}),addSelection:gi(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Un(x(this,e),x(this,t||e))),Xi(this,Tr(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var d=li(this,t[n].from(),t[n].to());i=i?i.concat(d):d}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var d=li(this,i[n].from(),i[n].to());e!==!1&&(d=d.join(e||this.lineSeparator())),t[n]=d}return t},replaceSelection:function(e,t,i){for(var n=[],d=0;d<this.sel.ranges.length;d++)n[d]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:gi(function(e,t,i){for(var n=[],d=this.sel,D=0;D<d.ranges.length;D++){var K=d.ranges[D];n[D]={from:K.from(),to:K.to(),text:this.splitLines(e[D]),origin:i}}for(var J=t&&t!="end"&&Io(this,n,t),Z=n.length-1;Z>=0;Z--)Ua(this,n[Z]);J?Ss(this,J):this.cm&&oa(this.cm)}),undo:gi(function(){Uo(this,"undo")}),redo:gi(function(){Uo(this,"redo")}),undoSelection:gi(function(){Uo(this,"undo",!0)}),redoSelection:gi(function(){Uo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var d=0;d<e.undone.length;d++)e.undone[d].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Do(this.history.maxGeneration),ca(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:Pa(this.history.done),undone:Pa(this.history.undone)}},setHistory:function(e){var t=this.history=new Do(this.history.maxGeneration);t.done=Pa(e.done.slice(0),null,!0),t.undone=Pa(e.undone.slice(0),null,!0)},setGutterMarker:gi(function(e,t,i){return lo(this,e,"gutter",function(n){var d=n.gutterMarkers||(n.gutterMarkers={});return d[t]=i,!i&&gt(d)&&(n.gutterMarkers=null),!0})}),clearGutter:gi(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&lo(t,i,"gutter",function(){return i.gutterMarkers[e]=null,gt(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ii(this,e))return null;if(t=e,e=At(this,e),!e)return null}else if(t=an(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:gi(function(e,t,i){return lo(this,e,t=="gutter"?"gutter":"class",function(n){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[d])n[d]=i;else{if(w(i).test(n[d]))return!1;n[d]+=" "+i}return!0})}),removeLineClass:gi(function(e,t,i){return lo(this,e,t=="gutter"?"gutter":"class",function(n){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",D=n[d];if(D)if(i==null)n[d]=null;else{var K=D.match(w(i));if(!K)return!1;var J=K.index+K[0].length;n[d]=D.slice(0,K.index)+(!K.index||J==D.length?"":" ")+D.slice(J)||null}else return!1;return!0})}),addLineWidget:gi(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Fa(this,x(this,e),x(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=x(this,e),Fa(this,e,e,i,"bookmark")},findMarksAt:function(e){e=x(this,e);var t=[],i=At(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var d=i[n];(d.from==null||d.from<=e.ch)&&(d.to==null||d.to>=e.ch)&&t.push(d.marker.parent||d.marker)}return t},findMarks:function(e,t,i){e=x(this,e),t=x(this,t);var n=[],d=e.line;return this.iter(e.line,t.line+1,function(D){var K=D.markedSpans;if(K)for(var J=0;J<K.length;J++){var Z=K[J];!(Z.to!=null&&d==e.line&&e.ch>=Z.to||Z.from==null&&d!=e.line||Z.from!=null&&d==t.line&&Z.from>=t.ch)&&(!i||i(Z.marker))&&n.push(Z.marker.parent||Z.marker)}++d}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(d){var D=d.text.length+n;if(D>e)return t=e,!0;e-=D,++i}),x(this,ht(i,t))},indexFromPos:function(e){e=x(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new dr(Li(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new dr(Li(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,Fs(this)),n},unlinkDoc:function(e){if(e instanceof oi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(Fs(this));break}if(e.history==this.history){var n=[e.id];ca(e,function(d){return n.push(d.id)},!0),e.history=new Do(null),e.history.done=Pa(this.history.done,n),e.history.undone=Pa(this.history.undone,n)}},iterLinkedDocs:function(e){ca(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Nt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:gi(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),dr.prototype.eachLine=dr.prototype.iter;var Bs=0;function Cl(e){var t=this;if(Hs(t),We(t,e)||Ir(t.display,e))return;ne(e),H&&(Bs=+new Date);var i=Si(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var d=n.length,D=Array(d),K=0,J=function(){++K==d&&mi(t,function(){i=x(t.doc,i);var Ue={from:i,to:i,text:t.doc.splitLines(D.filter(function(Qe){return Qe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ua(t.doc,Ue),Ss(t.doc,kr(x(t.doc,i),x(t.doc,Mr(Ue))))})()},Z=function(Ue,Qe){if(t.options.allowDropFileTypes&&ue(t.options.allowDropFileTypes,Ue.type)==-1){J();return}var dt=new FileReader;dt.onerror=function(){return J()},dt.onload=function(){var Tt=dt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Tt)){J();return}D[Qe]=Tt,J()},dt.readAsText(Ue)},ie=0;ie<n.length;ie++)Z(n[ie],ie);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var be=e.dataTransfer.getData("Text");if(be){var Se;if(t.state.draggingText&&!t.state.draggingText.copy&&(Se=t.listSelections()),Po(t.doc,kr(i,i)),Se)for(var Be=0;Be<Se.length;++Be)ja(t.doc,"",Se[Be].anchor,Se[Be].head,"drag");t.replaceSelection(be,"around","paste"),t.display.input.focus()}}catch(Ue){}}}function Ol(e,t){if(H&&(!e.state.draggingText||+new Date-Bs<100)){pe(t);return}if(We(e,t)||Ir(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var i=o("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",y&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),y&&i.parentNode.removeChild(i)}}function Rl(e,t){var i=Si(e,t);if(!i)return;var n=document.createDocumentFragment();zr(e,i,n),e.display.dragCursor||(e.display.dragCursor=o("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),h(e.display.dragCursor,n)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var d=t[n].CodeMirror;d&&i.push(d)}i.length&&i[0].operation(function(){for(var D=0;D<i.length;D++)e(i[D])})}var Ks=!1;function Al(){if(Ks)return;Ll(),Ks=!0}function Ll(){var e;Te(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Il)},100))}),Te(window,"blur",function(){return Ws(aa)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var fa={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"},po=0;po<10;po++)fa[po+48]=fa[po+96]=String(po);for(var jo=65;jo<=90;jo++)fa[jo]=String.fromCharCode(jo);for(var mo=1;mo<=12;mo++)fa[mo+111]=fa[mo+63235]="F"+mo;var na={};na.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"},na.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"},na.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"},na.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"]},na.default=s?na.macDefault:na.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,d,D,K=0;K<t.length-1;K++){var J=t[K];if(/^(cmd|meta|m)$/i.test(J))D=!0;else if(/^a(lt)?$/i.test(J))i=!0;else if(/^(c|ctrl|control)$/i.test(J))n=!0;else if(/^s(hift)?$/i.test(J))d=!0;else throw new Error("Unrecognized modifier name: "+J)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),D&&(e="Cmd-"+e),d&&(e="Shift-"+e),e}function kl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var d=ft(i.split(" "),Dl),D=0;D<d.length;D++){var K=void 0,J=void 0;D==d.length-1?(J=d.join(" "),K=n):(J=d.slice(0,D+1).join(" "),K="...");var Z=t[J];if(!Z)t[J]=K;else if(Z!=K)throw new Error("Inconsistent bindings for "+J)}delete e[i]}for(var ie in t)e[ie]=t[ie];return e}function Ba(e,t,i,n){t=Fo(t);var d=t.call?t.call(e,n):t[e];if(d===!1)return"nothing";if(d==="...")return"multi";if(d!=null&&i(d))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ba(e,t.fallthrough,i,n);for(var D=0;D<t.fallthrough.length;D++){var K=Ba(e,t.fallthrough[D],i,n);if(K)return K}}}function zs(e){var t=typeof e=="string"?e:fa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(E?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(E?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(y&&e.keyCode==34&&e.char)return!1;var i=fa[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Gs(i,e,t))}function Fo(e){return typeof e=="string"?na[e]:e}function Ha(e,t){for(var i=e.doc.sel.ranges,n=[],d=0;d<i.length;d++){for(var D=t(i[d]);n.length&&zt(D.from,He(n).to)<=0;){var K=n.pop();if(zt(K.from,D.from)<0){D.from=K.from;break}}n.push(D)}qi(e,function(){for(var J=n.length-1;J>=0;J--)ja(e.doc,"",n[J].from,n[J].to,"+delete");oa(e)})}function as(e,t,i){var n=qe(e.text,t+i,i);return n<0||n>e.text.length?null:n}function os(e,t,i){var n=as(e,t.ch,i);return n==null?null:new ht(t.line,n,i<0?"after":"before")}function ss(e,t,i,n,d){if(e){t.doc.direction=="rtl"&&(d=-d);var D=Et(i,t.doc.direction);if(D){var K=d<0?He(D):D[0],J=d<0==(K.level==1),Z=J?"after":"before",ie;if(K.level>0||t.doc.direction=="rtl"){var be=Le(t,i);ie=d<0?i.text.length-1:0;var Se=je(t,be,ie).top;ie=St(function(Be){return je(t,be,Be).top==Se},d<0==(K.level==1)?K.from:K.to-1,ie),Z=="before"&&(ie=as(i,ie,1))}else ie=d<0?K.to:K.from;return new ht(n,ie,Z)}}return new ht(n,d<0?i.text.length:0,d<0?"before":"after")}function Ml(e,t,i,n){var d=Et(t,e.doc.direction);if(!d)return os(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var D=at(d,i.ch,i.sticky),K=d[D];if(e.doc.direction=="ltr"&&K.level%2==0&&(n>0?K.to>i.ch:K.from<i.ch))return os(t,i,n);var J=function(Ct,It){return as(t,Ct instanceof ht?Ct.ch:Ct,It)},Z,ie=function(Ct){return e.options.lineWrapping?(Z=Z||Le(e,t),Bt(e,t,Z,Ct)):{begin:0,end:t.text.length}},be=ie(i.sticky=="before"?J(i,-1):i.ch);if(e.doc.direction=="rtl"||K.level==1){var Se=K.level==1==n<0,Be=J(i,Se?1:-1);if(Be!=null&&(Se?Be<=K.to&&Be<=be.end:Be>=K.from&&Be>=be.begin)){var Ue=Se?"before":"after";return new ht(i.line,Be,Ue)}}var Qe=function(Ct,It,Ot){for(var Pt=function(Jn,Mi){return Mi?new ht(i.line,J(Jn,1),"before"):new ht(i.line,Jn,"after")};Ct>=0&&Ct<d.length;Ct+=It){var tn=d[Ct],Vt=It>0==(tn.level!=1),gn=Vt?Ot.begin:J(Ot.end,-1);if(tn.from<=gn&&gn<tn.to)return Pt(gn,Vt);if(gn=Vt?tn.from:J(tn.to,-1),Ot.begin<=gn&&gn<Ot.end)return Pt(gn,Vt)}},dt=Qe(D+n,n,be);if(dt)return dt;var Tt=n>0?be.end:J(be.begin,-1);return Tt!=null&&!(n>0&&Tt==t.text.length)&&(dt=Qe(n>0?0:d.length-1,n,ie(Tt)),dt)?dt:null}var go={selectAll:Ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ae)},killLine:function(e){return Ha(e,function(t){if(t.empty()){var i=At(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:ht(t.head.line+1,0)}:{from:t.head,to:ht(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ha(e,function(t){return{from:ht(t.from().line,0),to:x(e.doc,ht(t.to().line+1,0))}})},delLineLeft:function(e){return Ha(e,function(t){return{from:ht(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ha(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Ha(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ht(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ht(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Fe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?Ys(e,t.head):n},Fe)},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=[],i=e.listSelections(),n=e.options.tabSize,d=0;d<i.length;d++){var D=i[d].from(),K=$(e.getLine(D.line),D.ch,n);t.push(se(n-K%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return qi(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var d=t[n].head,D=At(e.doc,d.line).text;if(D){if(d.ch==D.length&&(d=new ht(d.line,d.ch-1)),d.ch>0)d=new ht(d.line,d.ch+1),e.replaceRange(D.charAt(d.ch-1)+D.charAt(d.ch-2),ht(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var K=At(e.doc,d.line-1).text;K&&(d=new ht(d.line,1),e.replaceRange(D.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),ht(d.line-1,K.length-1),d,"+transpose"))}}i.push(new Un(d,d))}e.setSelections(i)})},newlineAndIndent:function(e){return qi(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);oa(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,t){var i=At(e.doc,t),n=_i(i);return n!=i&&(t=an(n)),ss(!0,e,n,t,1)}function Pl(e,t){var i=At(e.doc,t),n=Cr(i);return n!=i&&(t=an(n)),ss(!0,e,i,t,-1)}function Ys(e,t){var i=Xs(e,t.line),n=At(e.doc,i.line),d=Et(n,e.doc.direction);if(!d||d[0].level==0){var D=Math.max(i.ch,n.text.search(/\S/)),K=t.line==i.line&&t.ch<=D&&t.ch;return ht(i.line,K?0:D,i.sticky)}return i}function Bo(e,t,i){if(typeof t=="string"&&(t=go[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),d=t(e)!=Me}finally{e.display.shift=n,e.state.suppressEdits=!1}return d}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var d=Ba(t,e.state.keyMaps[n],i,e);if(d)return d}return e.options.extraKeys&&Ba(t,e.options.extraKeys,i,e)||Ba(t,e.options.keyMap,i,e)}var Ul=new te;function vo(e,t,i,n){var d=e.state.keySeq;if(d){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==d&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,d+" "+t,i,n))return!0}return $s(e,t,i,n)}function $s(e,t,i,n){var d=Nl(e,t,n);return d=="multi"&&(e.state.keySeq=t),d=="handled"&&_n(e,"keyHandled",e,t,i),(d=="handled"||d=="multi")&&(ne(i),Ci(e)),!!d}function Js(e,t){var i=Vs(t,!0);return i?t.shiftKey&&!e.state.keySeq?vo(e,"Shift-"+i,t,function(n){return Bo(e,n,!0)})||vo(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Bo(e,n)}):vo(e,i,t,function(n){return Bo(e,n)}):!1}function jl(e,t,i){return vo(e,"'"+i+"'",t,function(n){return Bo(e,n,!0)})}var ls=null;function Qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),We(t,e))return;H&&U<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Js(t,e);y&&(ls=n?i:null,!n&&i==88&&!Qt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!s&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;j(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(g(t,"CodeMirror-crosshair"),ze(document,"keyup",i),ze(document,"mouseover",i))}Te(document,"keyup",i),Te(document,"mouseover",i)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ir(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(y&&i==ls){ls=null,ne(e);return}if(y&&(!e.which||e.which<10)&&Js(t,e))return;var d=String.fromCharCode(n==null?i:n);if(d=="\b")return;if(jl(t,e,d))return;t.display.input.onKeyPress(e)}var Bl=400,us=function(e,t,i){this.time=e,this.pos=t,this.button=i};us.prototype.compare=function(e,t,i){return this.time+Bl>e&&zt(t,this.pos)==0&&i==this.button};var yo,bo;function Hl(e,t){var i=+new Date;return bo&&bo.compare(i,e,t)?(yo=bo=null,"triple"):yo&&yo.compare(i,e,t)?(bo=new us(i,e,t),yo=null,"double"):(yo=new us(i,e,t),bo=null,"single")}function el(e){var t=this,i=t.display;if(We(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Ir(i,e)){k||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(ds(t,e))return;var n=Si(t,e),d=Pe(e),D=n?Hl(n,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,d,n,D,e))return;d==1?n?zl(t,n,D,e):ge(e)==i.scroller&&ne(e):d==2?(n&&Mo(t.doc,n),setTimeout(function(){return i.input.focus()},20)):d==3&&(C?t.display.input.onContextMenu(e):Ja(t))}function Wl(e,t,i,n,d){var D="Click";return n=="double"?D="Double"+D:n=="triple"&&(D="Triple"+D),D=(t==1?"Left":t==2?"Middle":"Right")+D,vo(e,Gs(D,d),d,function(K){if(typeof K=="string"&&(K=go[K]),!K)return!1;var J=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),J=K(e,i)!=Me}finally{e.state.suppressEdits=!1}return J})}function Kl(e,t,i){var n=e.getOption("configureMouse"),d=n?n(e,t,i):{};if(d.unit==null){var D=f?i.shiftKey&&i.metaKey:i.altKey;d.unit=D?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||i.shiftKey),d.addNew==null&&(d.addNew=s?i.metaKey:i.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(s?i.altKey:i.ctrlKey)),d}function zl(e,t,i,n){H?setTimeout(B(To,e),0):e.curOp.focus=N();var d=Kl(e,i,n),D=e.doc.sel,K;e.options.dragDrop&&Ge&&!e.isReadOnly()&&i=="single"&&(K=D.contains(t))>-1&&(zt((K=D.ranges[K]).from(),t)<0||t.xRel>0)&&(zt(K.to(),t)>0||t.xRel<0)?Gl(e,n,t,d):Vl(e,n,t,d)}function Gl(e,t,i,n){var d=e.display,D=!1,K=mi(e,function(ie){k&&(d.scroller.draggable=!1),e.state.draggingText=!1,ze(d.wrapper.ownerDocument,"mouseup",K),ze(d.wrapper.ownerDocument,"mousemove",J),ze(d.scroller,"dragstart",Z),ze(d.scroller,"drop",K),D||(ne(ie),n.addNew||Mo(e.doc,i,null,null,n.extend),k&&!p||H&&U==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),J=function(ie){D=D||Math.abs(t.clientX-ie.clientX)+Math.abs(t.clientY-ie.clientY)>=10},Z=function(){return D=!0};k&&(d.scroller.draggable=!0),e.state.draggingText=K,K.copy=!n.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),Te(d.wrapper.ownerDocument,"mouseup",K),Te(d.wrapper.ownerDocument,"mousemove",J),Te(d.scroller,"dragstart",Z),Te(d.scroller,"drop",K),Ja(e),setTimeout(function(){return d.input.focus()},20)}function tl(e,t,i){if(i=="char")return new Un(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Un(ht(t.line,0),x(e.doc,ht(t.line+1,0)));var n=i(e,t);return new Un(n.from,n.to)}function Vl(e,t,i,n){var d=e.display,D=e.doc;ne(t);var K,J,Z=D.sel,ie=Z.ranges;if(n.addNew&&!n.extend?(J=D.sel.contains(i),J>-1?K=ie[J]:K=new Un(i,i)):(K=D.sel.primary(),J=D.sel.primIndex),n.unit=="rectangle")n.addNew||(K=new Un(i,i)),i=Si(e,t,!0,!0),J=-1;else{var be=tl(e,i,n.unit);n.extend?K=is(K,be.anchor,be.head,n.extend):K=be}n.addNew?J==-1?(J=ie.length,Xi(D,Tr(e,ie.concat([K]),J),{scroll:!1,origin:"*mouse"})):ie.length>1&&ie[J].empty()&&n.unit=="char"&&!n.extend?(Xi(D,Tr(e,ie.slice(0,J).concat(ie.slice(J+1)),0),{scroll:!1,origin:"*mouse"}),Z=D.sel):rs(D,J,K,De):(J=0,Xi(D,new tr([K],0),De),Z=D.sel);var Se=i;function Be(Ot){if(zt(Se,Ot)==0)return;if(Se=Ot,n.unit=="rectangle"){for(var Pt=[],tn=e.options.tabSize,Vt=$(At(D,i.line).text,i.ch,tn),gn=$(At(D,Ot.line).text,Ot.ch,tn),Jn=Math.min(Vt,gn),Mi=Math.max(Vt,gn),si=Math.min(i.line,Ot.line),vr=Math.min(e.lastLine(),Math.max(i.line,Ot.line));si<=vr;si++){var cr=At(D,si).text,xi=Ne(cr,Jn,tn);Jn==Mi?Pt.push(new Un(ht(si,xi),ht(si,xi))):cr.length>xi&&Pt.push(new Un(ht(si,xi),ht(si,Ne(cr,Mi,tn))))}Pt.length||Pt.push(new Un(i,i)),Xi(D,Tr(e,Z.ranges.slice(0,J).concat(Pt),J),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ot)}else{var hr=K,Bi=tl(e,Ot,n.unit),Ai=hr.anchor,Ti;zt(Bi.anchor,Ai)>0?(Ti=Bi.head,Ai=Wi(hr.from(),Bi.anchor)):(Ti=Bi.anchor,Ai=ir(hr.to(),Bi.head));var hi=Z.ranges.slice(0);hi[J]=Xl(e,new Un(x(D,Ai),Ti)),Xi(D,Tr(e,hi,J),De)}}var Ue=d.wrapper.getBoundingClientRect(),Qe=0;function dt(Ot){var Pt=++Qe,tn=Si(e,Ot,!0,n.unit=="rectangle");if(!tn)return;if(zt(tn,Se)!=0){e.curOp.focus=N(),Be(tn);var Vt=Oa(d,D);(tn.line>=Vt.to||tn.line<Vt.from)&&setTimeout(mi(e,function(){Qe==Pt&&dt(Ot)}),150)}else{var gn=Ot.clientY<Ue.top?-20:Ot.clientY>Ue.bottom?20:0;gn&&setTimeout(mi(e,function(){if(Qe!=Pt)return;d.scroller.scrollTop+=gn,dt(Ot)}),50)}}function Tt(Ot){e.state.selectingText=!1,Qe=Infinity,Ot&&(ne(Ot),d.input.focus()),ze(d.wrapper.ownerDocument,"mousemove",Ct),ze(d.wrapper.ownerDocument,"mouseup",It),D.history.lastSelOrigin=null}var Ct=mi(e,function(Ot){Ot.buttons===0||!Pe(Ot)?Tt(Ot):dt(Ot)}),It=mi(e,Tt);e.state.selectingText=It,Te(d.wrapper.ownerDocument,"mousemove",Ct),Te(d.wrapper.ownerDocument,"mouseup",It)}function Xl(e,t){var i=t.anchor,n=t.head,d=At(e.doc,i.line);if(zt(i,n)==0&&i.sticky==n.sticky)return t;var D=Et(d);if(!D)return t;var K=at(D,i.ch,i.sticky),J=D[K];if(J.from!=i.ch&&J.to!=i.ch)return t;var Z=K+(J.from==i.ch==(J.level!=1)?0:1);if(Z==0||Z==D.length)return t;var ie;if(n.line!=i.line)ie=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var be=at(D,n.ch,n.sticky),Se=be-K||(n.ch-i.ch)*(J.level==1?-1:1);be==Z-1||be==Z?ie=Se<0:ie=Se>0}var Be=D[Z+(ie?-1:0)],Ue=ie==(Be.level==1),Qe=Ue?Be.from:Be.to,dt=Ue?"after":"before";return i.ch==Qe&&i.sticky==dt?t:new Un(new ht(i.line,Qe,dt),n)}function nl(e,t,i,n){var d,D;if(t.touches)d=t.touches[0].clientX,D=t.touches[0].clientY;else try{d=t.clientX,D=t.clientY}catch(Be){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ne(t);var K=e.display,J=K.lineDiv.getBoundingClientRect();if(D>J.bottom||!ce(e,i))return le(t);D-=J.top-K.viewOffset;for(var Z=0;Z<e.display.gutterSpecs.length;++Z){var ie=K.gutters.childNodes[Z];if(ie&&ie.getBoundingClientRect().right>=d){var be=Qn(e.doc,D),Se=e.display.gutterSpecs[Z];return Ce(e,i,e,be,Se.className,t),le(t)}}}function ds(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if(Ir(e.display,t)||Yl(e,t))return;if(We(e,t,"contextmenu"))return;C||e.display.input.onContextMenu(t)}function Yl(e,t){return ce(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),un(e)}var Wa={toString:function(){return"CodeMirror.Init"}},al={},Ho={};function $l(e){var t=e.optionHandlers;function i(n,d,D,K){e.defaults[n]=d,D&&(t[n]=K?function(J,Z,ie){ie!=Wa&&D(J,Z,ie)}:D)}e.defineOption=i,e.Init=Wa,i("value","",function(n,d){return n.setValue(d)},!0),i("mode",null,function(n,d){n.doc.modeOption=d,ta(n)},!0),i("indentUnit",2,ta,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){oo(n),un(n),zn(n)},!0),i("lineSeparator",null,function(n,d){if(n.doc.lineSep=d,!d)return;var D=[],K=n.doc.first;n.doc.iter(function(Z){for(var ie=0;;){var be=Z.text.indexOf(d,ie);if(be==-1)break;ie=be+d.length,D.push(ht(K,be))}K++});for(var J=D.length-1;J>=0;J--)ja(n.doc,d,D[J],ht(D[J].line,D[J].ch+d.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,d,D){n.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),D!=Wa&&n.refresh()}),i("specialCharPlaceholder",Nn,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,d){return n.getInputField().spellcheck=d},!0),i("autocorrect",!1,function(n,d){return n.getInputField().autocorrect=d},!0),i("autocapitalize",!1,function(n,d){return n.getInputField().autocapitalize=d},!0),i("rtlMoveVisually",!O),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){rl(n),Dr(n)},!0),i("keyMap","default",function(n,d,D){var K=Fo(d),J=D!=Wa&&Fo(D);J&&J.detach&&J.detach(n,K),K.attach&&K.attach(n,J||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Ql,!0),i("gutters",[],function(n,d){n.display.gutterSpecs=er(d,n.options.lineNumbers),Dr(n)},!0),i("fixedGutter",!0,function(n,d){n.display.gutters.style.left=d?Vi(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Zr(n)},!0),i("scrollbarStyle","native",function(n){La(n),Zr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,d){n.display.gutterSpecs=er(n.options.gutters,d),Dr(n)},!0),i("firstLineNumber",1,Dr,!0),i("lineNumberFormatter",function(n){return n},Dr,!0),i("showCursorWhenSelecting",!1,Hn,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,d){d=="nocursor"&&(aa(n),n.display.input.blur()),n.display.input.readOnlyChanged(d)}),i("screenReaderLabel",null,function(n,d){d=d===""?null:d,n.display.input.screenReaderLabelChanged(d)}),i("disableInput",!1,function(n,d){d||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Hn,!0),i("singleCursorHeightPerLine",!0,Hn,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,oo,!0),i("addModeClass",!1,oo,!0),i("pollInterval",100),i("undoDepth",200,function(n,d){return n.doc.history.undoDepth=d}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,oo,!0),i("moveInputWithCursor",!0,function(n,d){d||n.display.input.resetPosition()}),i("tabindex",null,function(n,d){return n.display.input.getField().tabIndex=d||""}),i("autofocus",null),i("direction","ltr",function(n,d){return n.doc.setDirection(d)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=Wa;if(!t!=!n){var d=e.display.dragFunctions,D=t?Te:ze;D(e.display.scroller,"dragstart",d.start),D(e.display.scroller,"dragenter",d.enter),D(e.display.scroller,"dragover",d.over),D(e.display.scroller,"dragleave",d.leave),D(e.display.scroller,"drop",d.drop)}}function Ql(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(g(e.display.wrapper,"CodeMirror-wrap"),Lr(e)),Zi(e),zn(e),un(e),setTimeout(function(){return Zr(e)},100)}function oi(e,t){var i=this;if(!(this instanceof oi))return new oi(e,t);this.options=t=t?R(t):{},R(al,t,!1);var n=t.value;typeof n=="string"?n=new dr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var d=new oi.inputStyles[t.inputStyle](this),D=this.display=new xa(e,n,d,t);D.wrapper.CodeMirror=this,rl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),La(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&&!a&&D.input.focus(),H&&U<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Al(),Xr(this),this.curOp.forceUpdate=!0,vs(this,n),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Gr(i)},20):aa(this);for(var K in Ho)Ho.hasOwnProperty(K)&&Ho[K](this,t[K],Wa);Oi(this),t.finishInit&&t.finishInit(this);for(var J=0;J<cs.length;++J)cs[J](this);qr(this),k&&t.lineWrapping&&getComputedStyle(D.lineDiv).textRendering=="optimizelegibility"&&(D.lineDiv.style.textRendering="auto")}oi.defaults=al,oi.optionHandlers=Ho;function Zl(e){var t=e.display;Te(t.scroller,"mousedown",mi(e,el)),H&&U<11?Te(t.scroller,"dblclick",mi(e,function(Z){if(We(e,Z))return;var ie=Si(e,Z);if(!ie||ds(e,Z)||Ir(e.display,Z))return;ne(Z);var be=e.findWordAt(ie);Mo(e.doc,be.anchor,be.head)})):Te(t.scroller,"dblclick",function(Z){return We(e,Z)||ne(Z)}),Te(t.scroller,"contextmenu",function(Z){return il(e,Z)}),Te(t.input.getField(),"contextmenu",function(Z){t.scroller.contains(Z.target)||il(e,Z)});var i,n={end:0};function d(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function D(Z){if(Z.touches.length!=1)return!1;var ie=Z.touches[0];return ie.radiusX<=1&&ie.radiusY<=1}function K(Z,ie){if(ie.left==null)return!0;var be=ie.left-Z.left,Se=ie.top-Z.top;return be*be+Se*Se>20*20}Te(t.scroller,"touchstart",function(Z){if(!We(e,Z)&&!D(Z)&&!ds(e,Z)){t.input.ensurePolled(),clearTimeout(i);var ie=+new Date;t.activeTouch={start:ie,moved:!1,prev:ie-n.end<=300?n:null},Z.touches.length==1&&(t.activeTouch.left=Z.touches[0].pageX,t.activeTouch.top=Z.touches[0].pageY)}}),Te(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Te(t.scroller,"touchend",function(Z){var ie=t.activeTouch;if(ie&&!Ir(t,Z)&&ie.left!=null&&!ie.moved&&new Date-ie.start<300){var be=e.coordsChar(t.activeTouch,"page"),Se;!ie.prev||K(ie,ie.prev)?Se=new Un(be,be):!ie.prev.prev||K(ie,ie.prev.prev)?Se=e.findWordAt(be):Se=new Un(ht(be.line,0),x(e.doc,ht(be.line+1,0))),e.setSelection(Se.anchor,Se.head),e.focus(),ne(Z)}d()}),Te(t.scroller,"touchcancel",d),Te(t.scroller,"scroll",function(){t.scroller.clientHeight&&(la(e,t.scroller.scrollTop),Er(e,t.scroller.scrollLeft,!0),Ce(e,"scroll",e))}),Te(t.scroller,"mousewheel",function(Z){return ro(e,Z)}),Te(t.scroller,"DOMMouseScroll",function(Z){return ro(e,Z)}),Te(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Z){We(e,Z)||pe(Z)},over:function(Z){We(e,Z)||(Rl(e,Z),pe(Z))},start:function(Z){return Ol(e,Z)},drop:mi(e,Cl),leave:function(Z){We(e,Z)||Hs(e)}};var J=t.input.getField();Te(J,"keyup",function(Z){return Zs.call(e,Z)}),Te(J,"keydown",mi(e,Qs)),Te(J,"keypress",mi(e,qs)),Te(J,"focus",function(Z){return Gr(e,Z)}),Te(J,"blur",function(Z){return aa(e,Z)})}var cs=[];oi.defineInitHook=function(e){return cs.push(e)};function _o(e,t,i,n){var d=e.doc,D;i==null&&(i="add"),i=="smart"&&(d.mode.indent?D=xt(e,t).state:i="prev");var K=e.options.tabSize,J=At(d,t),Z=$(J.text,null,K);J.stateAfter&&(J.stateAfter=null);var ie=J.text.match(/^\s*/)[0],be;if(!n&&!/\S/.test(J.text))be=0,i="not";else if(i=="smart"&&(be=d.mode.indent(D,J.text.slice(ie.length),J.text),be==Me||be>150)){if(!n)return;i="prev"}i=="prev"?t>d.first?be=$(At(d,t-1).text,null,K):be=0:i=="add"?be=Z+e.options.indentUnit:i=="subtract"?be=Z-e.options.indentUnit:typeof i=="number"&&(be=Z+i),be=Math.max(0,be);var Se="",Be=0;if(e.options.indentWithTabs)for(var Ue=Math.floor(be/K);Ue;--Ue)Be+=K,Se+=" ";if(Be<be&&(Se+=se(be-Be)),Se!=ie)return ja(d,Se,ht(t,0),ht(t,ie.length),"+input"),J.stateAfter=null,!0;for(var Qe=0;Qe<d.sel.ranges.length;Qe++){var dt=d.sel.ranges[Qe];if(dt.head.line==t&&dt.head.ch<ie.length){var Tt=ht(t,ie.length);rs(d,Qe,new Un(Tt,Tt));break}}}var Pr=null;function Wo(e){Pr=e}function hs(e,t,i,n,d){var D=e.doc;e.display.shift=!1,n||(n=D.sel);var K=+new Date-200,J=d=="paste"||e.state.pasteIncoming>K,Z=Nt(t),ie=null;if(J&&n.ranges.length>1)if(Pr&&Pr.text.join(`
`)==t){if(n.ranges.length%Pr.text.length==0){ie=[];for(var be=0;be<Pr.text.length;be++)ie.push(D.splitLines(Pr.text[be]))}}else Z.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(ie=ft(Z,function(Ct){return[Ct]}));for(var Se=e.curOp.updateInput,Be=n.ranges.length-1;Be>=0;Be--){var Ue=n.ranges[Be],Qe=Ue.from(),dt=Ue.to();Ue.empty()&&(i&&i>0?Qe=ht(Qe.line,Qe.ch-i):e.state.overwrite&&!J?dt=ht(dt.line,Math.min(At(D,dt.line).text.length,dt.ch+He(Z).length)):J&&Pr&&Pr.lineWise&&Pr.text.join(`
`)==Z.join(`
`)&&(Qe=dt=ht(Qe.line,0)));var Tt={from:Qe,to:dt,text:ie?ie[Be%ie.length]:Z,origin:d||(J?"paste":e.state.cutIncoming>K?"cut":"+input")};Ua(e.doc,Tt),_n(e,"inputRead",e,Tt)}t&&!J&&sl(e,t),oa(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Se),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&qi(t,function(){return hs(t,i,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var d=i.ranges[n];if(d.head.ch>100||n&&i.ranges[n-1].head.line==d.head.line)continue;var D=e.getModeAt(d.head),K=!1;if(D.electricChars){for(var J=0;J<D.electricChars.length;J++)if(t.indexOf(D.electricChars.charAt(J))>-1){K=_o(e,d.head.line,"smart");break}}else D.electricInput&&(D.electricInput.test(At(e.doc,d.head.line).text.slice(0,d.head.ch))&&(K=_o(e,d.head.line,"smart")));K&&_n(e,"electricInput",e,d.head.line)}}function ll(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var d=e.doc.sel.ranges[n].head.line,D={anchor:ht(d,0),head:ht(d+1,0)};i.push(D),t.push(e.getRange(D.anchor,D.head))}return{text:t,ranges:i}}function ul(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=o("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=o("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return k?e.style.width="1000px":e.setAttribute("wrap","off"),l&&(e.style.border="1px solid black"),ul(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,d){var D=this.options,K=D[n];if(D[n]==d&&n!="mode")return;D[n]=d,t.hasOwnProperty(n)&&mi(this,t[n])(this,d,K),Ce(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,d){this.state.keyMaps[d?"push":"unshift"](Fo(n))},removeKeyMap:function(n){for(var d=this.state.keyMaps,D=0;D<d.length;++D)if(d[D]==n||d[D].name==n)return d.splice(D,1),!0},addOverlay:Fi(function(n,d){var D=n.token?n:e.getMode(this.options,n);if(D.startState)throw new Error("Overlays may not be stateful.");lt(this.state.overlays,{mode:D,modeSpec:n,opaque:d&&d.opaque,priority:d&&d.priority||0},function(K){return K.priority}),this.state.modeGen++,zn(this)}),removeOverlay:Fi(function(n){for(var d=this.state.overlays,D=0;D<d.length;++D){var K=d[D].modeSpec;if(K==n||typeof n=="string"&&K.name==n){d.splice(D,1),this.state.modeGen++,zn(this);return}}}),indentLine:Fi(function(n,d,D){typeof d!="string"&&typeof d!="number"&&(d==null?d=this.options.smartIndent?"smart":"prev":d=d?"add":"subtract"),Ii(this.doc,n)&&_o(this,n,d,D)}),indentSelection:Fi(function(n){for(var d=this.doc.sel.ranges,D=-1,K=0;K<d.length;K++){var J=d[K];if(J.empty())J.head.line>D&&(_o(this,J.head.line,n,!0),D=J.head.line,K==this.doc.sel.primIndex&&oa(this));else{var Z=J.from(),ie=J.to(),be=Math.max(D,Z.line);D=Math.min(this.lastLine(),ie.line-(ie.ch?0:1))+1;for(var Se=be;Se<D;++Se)_o(this,Se,n);var Be=this.doc.sel.ranges;Z.ch==0&&d.length==Be.length&&Be[K].from().ch>0&&rs(this.doc,K,new Un(Z,Be[K].to()),Ae)}}}),getTokenAt:function(n,d){return Pn(this,n,d)},getLineTokens:function(n,d){return Pn(this,ht(n),d,!0)},getTokenTypeAt:function(n){n=x(this.doc,n);var d=Ze(this,At(this.doc,n.line)),D=0,K=(d.length-1)/2,J=n.ch,Z;if(J==0)Z=d[2];else for(;;){var ie=D+K>>1;if((ie?d[ie*2-1]:0)>=J)K=ie;else if(d[ie*2+1]<J)D=ie+1;else{Z=d[ie*2+2];break}}var be=Z?Z.indexOf("overlay "):-1;return be<0?Z:be==0?null:Z.slice(0,be-1)},getModeAt:function(n){var d=this.doc.mode;return d.innerMode?e.innerMode(d,this.getTokenAt(n).state).mode:d},getHelper:function(n,d){return this.getHelpers(n,d)[0]},getHelpers:function(n,d){var D=[];if(!i.hasOwnProperty(d))return D;var K=i[d],J=this.getModeAt(n);if(typeof J[d]=="string")K[J[d]]&&D.push(K[J[d]]);else if(J[d])for(var Z=0;Z<J[d].length;Z++){var ie=K[J[d][Z]];ie&&D.push(ie)}else J.helperType&&K[J.helperType]?D.push(K[J.helperType]):K[J.name]&&D.push(K[J.name]);for(var be=0;be<K._global.length;be++){var Se=K._global[be];Se.pred(J,this)&&ue(D,Se.val)==-1&&D.push(Se.val)}return D},getStateAfter:function(n,d){var D=this.doc;return n=G(D,n==null?D.first+D.size-1:n),xt(this,n+1,d).state},cursorCoords:function(n,d){var D,K=this.doc.sel.primary();return n==null?D=K.head:typeof n=="object"?D=x(this.doc,n):D=n?K.from():K.to(),xn(this,D,d||"page")},charCoords:function(n,d){return ei(this,x(this.doc,n),d||"page")},coordsChar:function(n,d){return n=En(this,n,d||"page"),wn(this,n.left,n.top)},lineAtHeight:function(n,d){return n=En(this,{top:n,left:0},d||"page").top,Qn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,d,D){var K=!1,J;if(typeof n=="number"){var Z=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>Z&&(n=Z,K=!0),J=At(this.doc,n)}else J=n;return On(this,J,{top:0,left:0},d||"page",D||K).top+(K?this.doc.height-$i(J):0)},defaultTextHeight:function(){return ci(this.display)},defaultCharWidth:function(){return wi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,d,D,K,J){var Z=this.display;n=xn(this,x(this.doc,n));var ie=n.bottom,be=n.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),Z.sizer.appendChild(d),K=="over")ie=n.top;else if(K=="above"||K=="near"){var Se=Math.max(Z.wrapper.clientHeight,this.doc.height),Be=Math.max(Z.sizer.clientWidth,Z.lineSpace.clientWidth);(K=="above"||n.bottom+d.offsetHeight>Se)&&n.top>d.offsetHeight?ie=n.top-d.offsetHeight:n.bottom+d.offsetHeight<=Se&&(ie=n.bottom),be+d.offsetWidth>Be&&(be=Be-d.offsetWidth)}d.style.top=ie+"px",d.style.left=d.style.right="",J=="right"?(be=Z.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(J=="left"?be=0:J=="middle"&&(be=(Z.sizer.clientWidth-d.offsetWidth)/2),d.style.left=be+"px"),D&&wo(this,{left:be,top:ie,right:be+d.offsetWidth,bottom:ie+d.offsetHeight})},triggerOnKeyDown:Fi(Qs),triggerOnKeyPress:Fi(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Fi(el),execCommand:function(n){if(go.hasOwnProperty(n))return go[n].call(null,this)},triggerElectric:Fi(function(n){sl(this,n)}),findPosH:function(n,d,D,K){var J=1;d<0&&(J=-1,d=-d);for(var Z=x(this.doc,n),ie=0;ie<d&&!(Z=fs(this.doc,Z,J,D,K),Z.hitSide);++ie);return Z},moveH:Fi(function(n,d){var D=this;this.extendSelectionsBy(function(K){return D.display.shift||D.doc.extend||K.empty()?fs(D.doc,K.head,n,d,D.options.rtlMoveVisually):n<0?K.from():K.to()},Fe)}),deleteH:Fi(function(n,d){var D=this.doc.sel,K=this.doc;D.somethingSelected()?K.replaceSelection("",null,"+delete"):Ha(this,function(J){var Z=fs(K,J.head,n,d,!1);return n<0?{from:Z,to:J.head}:{from:J.head,to:Z}})}),findPosV:function(n,d,D,K){var J=1,Z=K;d<0&&(J=-1,d=-d);for(var ie=x(this.doc,n),be=0;be<d;++be){var Se=xn(this,ie,"div");if(Z==null?Z=Se.left:Se.left=Z,ie=cl(this,Se,J,D),ie.hitSide)break}return ie},moveV:Fi(function(n,d){var D=this,K=this.doc,J=[],Z=!this.display.shift&&!K.extend&&K.sel.somethingSelected();if(K.extendSelectionsBy(function(be){if(Z)return n<0?be.from():be.to();var Se=xn(D,be.head,"div");be.goalColumn!=null&&(Se.left=be.goalColumn),J.push(Se.left);var Be=cl(D,Se,n,d);return d=="page"&&be==K.sel.primary()&&qa(D,ei(D,Be,"div").top-Se.top),Be},Fe),J.length)for(var ie=0;ie<K.sel.ranges.length;ie++)K.sel.ranges[ie].goalColumn=J[ie]}),findWordAt:function(n){var d=this.doc,D=At(d,n.line).text,K=n.ch,J=n.ch;if(D){var Z=this.getHelper(n,"wordChars");(n.sticky=="before"||J==D.length)&&K?--K:++J;for(var ie=D.charAt(K),be=st(ie,Z)?function(Se){return st(Se,Z)}:/\s/.test(ie)?function(Se){return/\s/.test(Se)}:function(Se){return!/\s/.test(Se)&&!st(Se)};K>0&&be(D.charAt(K-1));)--K;for(;J<D.length&&be(D.charAt(J));)++J}return new Un(ht(n.line,K),ht(n.line,J))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):g(this.display.cursorDiv,"CodeMirror-overwrite"),Ce(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Fi(function(n,d){sa(this,n,d)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Ie(this)-this.display.barHeight,width:n.scrollWidth-Ie(this)-this.display.barWidth,clientHeight:ee(this),clientWidth:ye(this)}},scrollIntoView:Fi(function(n,d){n==null?(n={from:this.doc.sel.primary().head,to:null},d==null&&(d=this.options.cursorScrollMargin)):typeof n=="number"?n={from:ht(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=d||0,n.from.line!=null?$o(this,n):ya(this,n.from,n.to,n.margin)}),setSize:Fi(function(n,d){var D=this,K=function(Z){return typeof Z=="number"||/^\d+$/.test(String(Z))?Z+"px":Z};n!=null&&(this.display.wrapper.style.width=K(n)),d!=null&&(this.display.wrapper.style.height=K(d)),this.options.lineWrapping&&nn(this);var J=this.display.viewFrom;this.doc.iter(J,this.display.viewTo,function(Z){if(Z.widgets){for(var ie=0;ie<Z.widgets.length;ie++)if(Z.widgets[ie].noHScroll){ai(D,J,"widget");break}}++J}),this.curOp.forceUpdate=!0,Ce(this,"refresh",this)}),operation:function(n){return qi(this,n)},startOperation:function(){return Xr(this)},endOperation:function(){return qr(this)},refresh:Fi(function(){var n=this.display.cachedTextHeight;zn(this),this.curOp.forceUpdate=!0,un(this),sa(this,this.doc.scrollLeft,this.doc.scrollTop),Da(this.display),(n==null||Math.abs(n-ci(this.display))>.5||this.options.lineWrapping)&&Zi(this),Ce(this,"refresh",this)}),swapDoc:Fi(function(n){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,n),un(this),this.display.input.reset(),sa(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,_n(this,"swapDoc",this,d),d}),phrase:function(n){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,n)?d[n]:n},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}},he(e),e.registerHelper=function(n,d,D){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][d]=D},e.registerGlobalHelper=function(n,d,D,K){e.registerHelper(n,d,K),i[n]._global.push({pred:D,val:K})}}function fs(e,t,i,n,d){var D=t,K=i,J=At(e,t.line),Z=d&&e.direction=="rtl"?-i:i;function ie(){var It=t.line+Z;return It<e.first||It>=e.first+e.size?!1:(t=new ht(It,t.ch,t.sticky),J=At(e,It))}function be(It){var Ot;if(n=="codepoint"){var Pt=J.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Pt)?Ot=null:Ot=new ht(t.line,Math.max(0,Math.min(J.text.length,t.ch+i*(Pt>=55296&&Pt<56320?2:1))),-i)}else d?Ot=Ml(e.cm,J,t,i):Ot=os(J,t,i);if(Ot==null)if(!It&&ie())t=ss(d,e.cm,J,t.line,Z);else return!1;else t=Ot;return!0}if(n=="char"||n=="codepoint")be();else if(n=="column")be(!0);else if(n=="word"||n=="group")for(var Se=null,Be=n=="group",Ue=e.cm&&e.cm.getHelper(t,"wordChars"),Qe=!0;!(i<0&&!be(!Qe));Qe=!1){var dt=J.text.charAt(t.ch)||`
`,Tt=st(dt,Ue)?"w":Be&&dt==`
`?"n":!Be||/\s/.test(dt)?null:"p";if(Be&&!Qe&&!Tt&&(Tt="s"),Se&&Se!=Tt){i<0&&(i=1,be(),t.sticky="after");break}if(Tt&&(Se=Tt),i>0&&!be(!Qe))break}var Ct=No(e,t,D,K,!0);return Di(D,Ct)&&(Ct.hitSide=!0),Ct}function cl(e,t,i,n){var d=e.doc,D=t.left,K;if(n=="page"){var J=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Z=Math.max(J-.5*ci(e.display),3);K=(i>0?t.bottom:t.top)+i*Z}else n=="line"&&(K=i>0?t.bottom+3:t.top-3);for(var ie;!(ie=wn(e,D,K),!ie.outside);){if(i<0?K<=0:K>=d.height){ie.hitSide=!0;break}K+=i*5}return ie}var Gn=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};Gn.prototype.init=function(e){var t=this,i=this,n=i.cm,d=i.div=e.lineDiv;ul(d,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function D(J){for(var Z=J.target;Z;Z=Z.parentNode){if(Z==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Z.className))break}return!1}Te(d,"paste",function(J){if(!D(J)||We(n,J)||ol(J,n))return;U<=11&&setTimeout(mi(n,function(){return t.updateFromDOM()}),20)}),Te(d,"compositionstart",function(J){t.composing={data:J.data,done:!1}}),Te(d,"compositionupdate",function(J){t.composing||(t.composing={data:J.data,done:!1})}),Te(d,"compositionend",function(J){t.composing&&(J.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Te(d,"touchstart",function(){return i.forceCompositionEnd()}),Te(d,"input",function(){t.composing||t.readFromDOMSoon()});function K(J){if(!D(J)||We(n,J))return;if(n.somethingSelected())Wo({lineWise:!1,text:n.getSelections()}),J.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var Z=ll(n);Wo({lineWise:!0,text:Z.text}),J.type=="cut"&&n.operation(function(){n.setSelections(Z.ranges,0,Ae),n.replaceSelection("",null,"cut")})}else return;if(J.clipboardData){J.clipboardData.clearData();var ie=Pr.text.join(`
`);if(J.clipboardData.setData("Text",ie),J.clipboardData.getData("Text")==ie){J.preventDefault();return}}var be=dl(),Se=be.firstChild;n.display.lineSpace.insertBefore(be,n.display.lineSpace.firstChild),Se.value=Pr.text.join(`
`);var Be=document.activeElement;Y(Se),setTimeout(function(){n.display.lineSpace.removeChild(be),Be.focus(),Be==d&&i.showPrimarySelection()},50)}Te(d,"copy",K),Te(d,"cut",K)},Gn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Gn.prototype.prepareSelection=function(){var e=Or(this.cm,!1);return e.focus=document.activeElement==this.div,e},Gn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Gn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Gn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),d=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||d.line<t.display.viewFrom){e.removeAllRanges();return}var D=Ko(t,e.anchorNode,e.anchorOffset),K=Ko(t,e.focusNode,e.focusOffset);if(D&&!D.bad&&K&&!K.bad&&zt(Wi(D,K),n)==0&&zt(ir(D,K),d)==0)return;var J=t.display.view,Z=n.line>=t.display.viewFrom&&hl(t,n)||{node:J[0].measure.map[2],offset:0},ie=d.line<t.display.viewTo&&hl(t,d);if(!ie){var be=J[J.length-1].measure,Se=be.maps?be.maps[be.maps.length-1]:be.map;ie={node:Se[Se.length-1],offset:Se[Se.length-2]-Se[Se.length-3]}}if(!Z||!ie){e.removeAllRanges();return}var Be=e.rangeCount&&e.getRangeAt(0),Ue;try{Ue=m(Z.node,Z.offset,ie.offset,ie.node)}catch(Qe){}Ue&&(!P&&t.state.focused?(e.collapse(Z.node,Z.offset),Ue.collapsed||(e.removeAllRanges(),e.addRange(Ue))):(e.removeAllRanges(),e.addRange(Ue)),Be&&e.anchorNode==null?e.addRange(Be):P&&this.startGracePeriod()),this.rememberSelection()},Gn.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)},Gn.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},Gn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Gn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return T(this.div,t)},Gn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Gn.prototype.blur=function(){this.div.blur()},Gn.prototype.getField=function(){return this.div},Gn.prototype.supportsTouch=function(){return!0},Gn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():qi(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)},Gn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Gn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(u&&b&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=Ko(t,e.anchorNode,e.anchorOffset),n=Ko(t,e.focusNode,e.focusOffset);i&&n&&qi(t,function(){Xi(t.doc,kr(i,n),Ae),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Gn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),d=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=ht(n.line-1,At(e.doc,n.line-1).length)),d.ch==At(e.doc,d.line).text.length&&d.line<e.lastLine()&&(d=ht(d.line+1,0)),n.line<t.viewFrom||d.line>t.viewTo-1)return!1;var D,K,J;n.line==t.viewFrom||(D=$n(e,n.line))==0?(K=an(t.view[0].line),J=t.view[0].node):(K=an(t.view[D].line),J=t.view[D-1].node.nextSibling);var Z=$n(e,d.line),ie,be;if(Z==t.view.length-1?(ie=t.viewTo-1,be=t.lineDiv.lastChild):(ie=an(t.view[Z+1].line)-1,be=t.view[Z+1].node.previousSibling),!J)return!1;for(var Se=e.doc.splitLines(tu(e,J,be,K,ie)),Be=li(e.doc,ht(K,0),ht(ie,At(e.doc,ie).text.length));Se.length>1&&Be.length>1;)if(He(Se)==He(Be))Se.pop(),Be.pop(),ie--;else if(Se[0]==Be[0])Se.shift(),Be.shift(),K++;else break;for(var Ue=0,Qe=0,dt=Se[0],Tt=Be[0],Ct=Math.min(dt.length,Tt.length);Ue<Ct&&dt.charCodeAt(Ue)==Tt.charCodeAt(Ue);)++Ue;for(var It=He(Se),Ot=He(Be),Pt=Math.min(It.length-(Se.length==1?Ue:0),Ot.length-(Be.length==1?Ue:0));Qe<Pt&&It.charCodeAt(It.length-Qe-1)==Ot.charCodeAt(Ot.length-Qe-1);)++Qe;if(Se.length==1&&Be.length==1&&K==n.line)for(;Ue&&Ue>n.ch&&It.charCodeAt(It.length-Qe-1)==Ot.charCodeAt(Ot.length-Qe-1);)Ue--,Qe++;Se[Se.length-1]=It.slice(0,It.length-Qe).replace(/^\u200b+/,""),Se[0]=Se[0].slice(Ue).replace(/\u200b+$/,"");var tn=ht(K,Ue),Vt=ht(ie,Be.length?He(Be).length-Qe:0);if(Se.length>1||Se[0]||zt(tn,Vt))return ja(e.doc,Se,tn,Vt,"+input"),!0},Gn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Gn.prototype.reset=function(){this.forceCompositionEnd()},Gn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Gn.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)},Gn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&qi(this.cm,function(){return zn(e.cm)})},Gn.prototype.setUneditable=function(e){e.contentEditable="false"},Gn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||mi(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Gn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Gn.prototype.onContextMenu=function(){},Gn.prototype.resetPosition=function(){},Gn.prototype.needsContentAttribute=!0;function hl(e,t){var i=ke(e,t.line);if(!i||i.hidden)return null;var n=At(e.doc,t.line),d=re(i,n,t.line),D=Et(n,e.doc.direction),K="left";if(D){var J=at(D,t.ch);K=J%2?"right":"left"}var Z=yt(d.map,t.ch,K);return Z.offset=Z.collapse=="right"?Z.end:Z.start,Z}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ka(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,d){var D="",K=!1,J=e.doc.lineSeparator(),Z=!1;function ie(Ue){return function(Qe){return Qe.id==Ue}}function be(){K&&(D+=J,Z&&(D+=J),K=Z=!1)}function Se(Ue){Ue&&(be(),D+=Ue)}function Be(Ue){if(Ue.nodeType==1){var Qe=Ue.getAttribute("cm-text");if(Qe){Se(Qe);return}var dt=Ue.getAttribute("cm-marker"),Tt;if(dt){var Ct=e.findMarks(ht(n,0),ht(d+1,0),ie(+dt));Ct.length&&(Tt=Ct[0].find(0))&&Se(li(e.doc,Tt.from,Tt.to).join(J));return}if(Ue.getAttribute("contenteditable")=="false")return;var It=/^(pre|div|p|li|table|br)$/i.test(Ue.nodeName);if(!/^br$/i.test(Ue.nodeName)&&Ue.textContent.length==0)return;It&&be();for(var Ot=0;Ot<Ue.childNodes.length;Ot++)Be(Ue.childNodes[Ot]);/^(pre|p)$/i.test(Ue.nodeName)&&(Z=!0),It&&(K=!0)}else Ue.nodeType==3&&Se(Ue.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Be(t),t==i);)t=t.nextSibling,Z=!1;return D}function Ko(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return Ka(e.clipPos(ht(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var d=0;d<e.display.view.length;d++){var D=e.display.view[d];if(D.node==n)return nu(D,t,i)}}function nu(e,t,i){var n=e.text.firstChild,d=!1;if(!t||!T(n,t))return Ka(ht(an(e.line),0),!0);if(t==n&&(d=!0,t=n.childNodes[i],i=0,!t)){var D=e.rest?He(e.rest):e.line;return Ka(ht(an(D),D.text.length),d)}var K=t.nodeType==3?t:null,J=t;for(!K&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(K=t.firstChild,i&&(i=K.nodeValue.length));J.parentNode!=n;)J=J.parentNode;var Z=e.measure,ie=Z.maps;function be(Tt,Ct,It){for(var Ot=-1;Ot<(ie?ie.length:0);Ot++)for(var Pt=Ot<0?Z.map:ie[Ot],tn=0;tn<Pt.length;tn+=3){var Vt=Pt[tn+2];if(Vt==Tt||Vt==Ct){var gn=an(Ot<0?e.line:e.rest[Ot]),Jn=Pt[tn]+It;return(It<0||Vt!=Tt)&&(Jn=Pt[tn+(It?1:0)]),ht(gn,Jn)}}}var Se=be(K,J,i);if(Se)return Ka(Se,d);for(var Be=J.nextSibling,Ue=K?K.nodeValue.length-i:0;Be;Be=Be.nextSibling){if(Se=be(Be,Be.firstChild,0),Se)return Ka(ht(Se.line,Se.ch-Ue),d);Ue+=Be.textContent.length}for(var Qe=J.previousSibling,dt=i;Qe;Qe=Qe.previousSibling){if(Se=be(Qe,Qe.firstChild,-1),Se)return Ka(ht(Se.line,Se.ch+dt),d);dt+=Qe.textContent.length}}var vi=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new te,this.hasSelection=!1,this.composing=null};vi.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var d=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),l&&(d.style.width="0px"),Te(d,"input",function(){H&&U>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Te(d,"paste",function(K){if(We(n,K)||ol(K,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function D(K){if(We(n,K))return;if(n.somethingSelected())Wo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var J=ll(n);Wo({lineWise:!0,text:J.text}),K.type=="cut"?n.setSelections(J.ranges,null,Ae):(i.prevInput="",d.value=J.text.join(`
`),Y(d))}else return;K.type=="cut"&&(n.state.cutIncoming=+new Date)}Te(d,"cut",D),Te(d,"copy",D),Te(e.scroller,"paste",function(K){if(Ir(e,K)||We(n,K))return;if(!d.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var J=new Event("paste");J.clipboardData=K.clipboardData,d.dispatchEvent(J)}),Te(e.lineSpace,"selectstart",function(K){Ir(e,K)||ne(K)}),Te(d,"compositionstart",function(){var K=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:K,range:n.markText(K,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Te(d,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},vi.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},vi.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},vi.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Or(e);if(e.options.moveInputWithCursor){var d=xn(e,i.sel.primary().head,"div"),D=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+K.top-D.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+K.left-D.left))}return n},vi.prototype.showSelection=function(e){var t=this.cm,i=t.display;h(i.cursorDiv,e.cursors),h(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},vi.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Y(this.textarea),H&&U>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",H&&U>=9&&(this.hasSelection=null))},vi.prototype.getField=function(){return this.textarea},vi.prototype.supportsTouch=function(){return!1},vi.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},vi.prototype.blur=function(){this.textarea.blur()},vi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},vi.prototype.receivedFocus=function(){this.slowPoll()},vi.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()})},vi.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},vi.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||_t(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=i.value;if(d==n&&!t.somethingSelected())return!1;if(H&&U>=9&&this.hasSelection===d||s&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var D=d.charCodeAt(0);if(D==8203&&!n&&(n="\u200B"),D==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,J=Math.min(n.length,d.length);K<J&&n.charCodeAt(K)==d.charCodeAt(K);)++K;return qi(t,function(){hs(t,d.slice(K),n.length-K,null,e.composing?"*compose":null),d.length>1e3||d.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=d,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},vi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},vi.prototype.onKeyPress=function(){H&&U>=9&&(this.hasSelection=null),this.fastPoll()},vi.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var D=Si(i,e),K=n.scroller.scrollTop;if(!D||y)return;var J=i.options.resetSelectionOnContextMenu;J&&i.doc.sel.contains(D)==-1&&mi(i,Xi)(i.doc,kr(D),Ae);var Z=d.style.cssText,ie=t.wrapper.style.cssText,be=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-be.top-5)+"px; left: "+(e.clientX-be.left-5)+`px;
z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Se;k&&(Se=window.scrollY),n.input.focus(),k&&window.scrollTo(null,Se),n.input.reset(),i.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=Ue,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Be(){if(d.selectionStart!=null){var dt=i.somethingSelected(),Tt="\u200B"+(dt?d.value:"");d.value="\u21DA",d.value=Tt,t.prevInput=dt?"":"\u200B",d.selectionStart=1,d.selectionEnd=Tt.length,n.selForContextMenu=i.doc.sel}}function Ue(){if(t.contextMenuPending!=Ue)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ie,d.style.cssText=Z,H&&U<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=K),d.selectionStart!=null){(!H||H&&U<9)&&Be();var dt=0,Tt=function(){n.selForContextMenu==i.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?mi(i,Ls)(i):dt++<10?n.detectingSelectAll=setTimeout(Tt,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Tt,200)}}if(H&&U>=9&&Be(),C){pe(e);var Qe=function(){ze(window,"mouseup",Qe),setTimeout(Ue,20)};Te(window,"mouseup",Qe)}else setTimeout(Ue,50)},vi.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},vi.prototype.setUneditable=function(){},vi.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?R(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 i=N();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=J.getValue()}var d;if(e.form&&(Te(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var D=e.form;d=D.submit;try{var K=D.submit=function(){n(),D.submit=d,D.submit(),D.submit=K}}catch(Z){}}t.finishInit=function(Z){Z.save=n,Z.getTextArea=function(){return e},Z.toTextArea=function(){Z.toTextArea=isNaN,n(),e.parentNode.removeChild(Z.getWrapperElement()),e.style.display="",e.form&&(ze(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var J=oi(function(Z){return e.parentNode.insertBefore(Z,e.nextSibling)},t);return J}function ru(e){e.off=ze,e.on=Te,e.wheelEventPixels=io,e.Doc=dr,e.splitLines=Nt,e.countColumn=$,e.findColumn=Ne,e.isWordChar=Je,e.Pass=Me,e.signal=Ce,e.Line=Ji,e.changeEnd=Mr,e.scrollbarModel=eo,e.Pos=ht,e.cmpPos=zt,e.modes=cn,e.mimeModes=jt,e.resolveMode=Xe,e.getMode=Lt,e.modeExtensions=Ut,e.extendMode=Mt,e.copyState=Zt,e.startState=Ni,e.innerMode=Ln,e.commands=go,e.keyMap=na,e.keyName=Vs,e.isModifierKey=zs,e.lookupKey=Ba,e.normalizeKeyMap=kl,e.StringStream=vn,e.SharedTextMarker=fo,e.TextMarker=ha,e.LineWidget=ho,e.e_preventDefault=ne,e.e_stopPropagation=oe,e.e_stop=pe,e.addClass=j,e.contains=T,e.rmClass=g,e.keyNames=fa}$l(oi),ql(oi);var au="iter insert remove copy getEditor constructor".split(" ");for(var zo in dr.prototype)dr.prototype.hasOwnProperty(zo)&&ue(au,zo)<0&&(oi.prototype[zo]=function(e){return function(){return e.apply(this.doc,arguments)}}(dr.prototype[zo]));return he(dr),oi.inputStyles={textarea:vi,contenteditable:Gn},oi.defineMode=function(e){!oi.defaults.mode&&e!="null"&&(oi.defaults.mode=e),rn.apply(this,arguments)},oi.defineMIME=kt,oi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),oi.defineMIME("text/plain","null"),oi.defineExtension=function(e,t){oi.prototype[e]=t},oi.defineDocExtension=function(e,t){dr.prototype[e]=t},oi.fromTextArea=iu,ru(oi),oi.version="5.58.2",oi})},WaYH:function(Rt,$e,Q){"use strict";var ae=Q("rePB"),X=Q("Ff2n"),P=Q("VTBJ"),V=Q("1OyB"),L=Q("vuIU"),M=Q("JX7q"),H=Q("Ji7U"),U=Q("LK+K"),k=Q("q1tI"),I=Q("TSYQ"),b=Q.n(I),y=Q("sboe"),p=Q("OZM5"),c=function(C){var w=C.prefixCls,g=C.level,v=C.isStart,h=C.isEnd;if(!g)return null;for(var o="".concat(w,"-indent-unit"),_=[],m=0;m<g;m+=1){var T;_.push(k.createElement("span",{key:m,className:b()(o,(T={},Object(ae.a)(T,"".concat(o,"-start"),v[m+1]),Object(ae.a)(T,"".concat(o,"-end"),h[m+1]),Object(ae.a)(T,"".concat(o,"-end-first-level"),!m&&h[0]),T))}))}return k.createElement("span",{"aria-hidden":"true",className:"".concat(w,"-indent")},_)},r=c,l=Q("815F"),u="open",a="close",s="---",f=function(E){Object(H.a)(w,E);var C=Object(U.a)(w);function w(){var g;return Object(V.a)(this,w),g=C.apply(this,arguments),g.state={dragNodeHighlight:!1},g.onSelectorClick=function(v){var h=g.props.context.onNodeClick;h(v,Object(l.b)(g.props)),g.isSelectable()?g.onSelect(v):g.onCheck(v)},g.onSelectorDoubleClick=function(v){var h=g.props.context.onNodeDoubleClick;h(v,Object(l.b)(g.props))},g.onSelect=function(v){if(g.isDisabled())return;var h=g.props.context.onNodeSelect;v.preventDefault(),h(v,Object(l.b)(g.props))},g.onCheck=function(v){if(g.isDisabled())return;var h=g.props,o=h.disableCheckbox,_=h.checked,m=g.props.context.onNodeCheck;if(!g.isCheckable()||o)return;v.preventDefault();var T=!_;m(v,Object(l.b)(g.props),T)},g.onMouseEnter=function(v){var h=g.props.context.onNodeMouseEnter;h(v,Object(l.b)(g.props))},g.onMouseLeave=function(v){var h=g.props.context.onNodeMouseLeave;h(v,Object(l.b)(g.props))},g.onContextMenu=function(v){var h=g.props.context.onNodeContextMenu;h(v,Object(l.b)(g.props))},g.onDragStart=function(v){var h=g.props.context.onNodeDragStart;v.stopPropagation(),g.setState({dragNodeHighlight:!0}),h(v,Object(M.a)(g));try{v.dataTransfer.setData("text/plain","")}catch(o){}},g.onDragEnter=function(v){var h=g.props.context.onNodeDragEnter;v.preventDefault(),v.stopPropagation(),h(v,Object(M.a)(g))},g.onDragOver=function(v){var h=g.props.context.onNodeDragOver;v.preventDefault(),v.stopPropagation(),h(v,Object(M.a)(g))},g.onDragLeave=function(v){var h=g.props.context.onNodeDragLeave;v.stopPropagation(),h(v,Object(M.a)(g))},g.onDragEnd=function(v){var h=g.props.context.onNodeDragEnd;v.stopPropagation(),g.setState({dragNodeHighlight:!1}),h(v,Object(M.a)(g))},g.onDrop=function(v){var h=g.props.context.onNodeDrop;v.preventDefault(),v.stopPropagation(),g.setState({dragNodeHighlight:!1}),h(v,Object(M.a)(g))},g.onExpand=function(v){var h=g.props.context.onNodeExpand;h(v,Object(l.b)(g.props))},g.setSelectHandle=function(v){g.selectHandle=v},g.getNodeState=function(){var v=g.props.expanded;return g.isLeaf()?null:v?u:a},g.hasChildren=function(){var v=g.props.eventKey,h=g.props.context.keyEntities,o=h[v]||{},_=o.children;return!!(_||[]).length},g.isLeaf=function(){var v=g.props,h=v.isLeaf,o=v.loaded,_=g.props.context.loadData,m=g.hasChildren();return h===!1?!1:h||!_&&!m||_&&o&&!m},g.isDisabled=function(){var v=g.props.disabled,h=g.props.context.disabled;return!!(h||v)},g.isCheckable=function(){var v=g.props.checkable,h=g.props.context.checkable;return!h||v===!1?!1:h},g.syncLoadData=function(v){var h=v.expanded,o=v.loading,_=v.loaded,m=g.props.context,T=m.loadData,N=m.onNodeLoad;if(o)return;T&&h&&!g.isLeaf()&&(!g.hasChildren()&&!_&&N(Object(l.b)(g.props)))},g.renderSwitcher=function(){var v=g.props,h=v.expanded,o=v.switcherIcon,_=g.props.context,m=_.prefixCls,T=_.switcherIcon,N=o||T;if(g.isLeaf())return k.createElement("span",{className:b()("".concat(m,"-switcher"),"".concat(m,"-switcher-noop"))},typeof N=="function"?N(Object(P.a)(Object(P.a)({},g.props),{},{isLeaf:!0})):N);var j=b()("".concat(m,"-switcher"),"".concat(m,"-switcher_").concat(h?u:a));return k.createElement("span",{onClick:g.onExpand,className:j},typeof N=="function"?N(Object(P.a)(Object(P.a)({},g.props),{},{isLeaf:!1})):N)},g.renderCheckbox=function(){var v=g.props,h=v.checked,o=v.halfChecked,_=v.disableCheckbox,m=g.props.context.prefixCls,T=g.isDisabled(),N=g.isCheckable();if(!N)return null;var j=typeof N!="boolean"?N:null;return k.createElement("span",{className:b()("".concat(m,"-checkbox"),h&&"".concat(m,"-checkbox-checked"),!h&&o&&"".concat(m,"-checkbox-indeterminate"),(T||_)&&"".concat(m,"-checkbox-disabled")),onClick:g.onCheck},j)},g.renderIcon=function(){var v=g.props.loading,h=g.props.context.prefixCls;return k.createElement("span",{className:b()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(g.getNodeState()||"docu"),v&&"".concat(h,"-icon_loading"))})},g.renderSelector=function(){var v=g.state.dragNodeHighlight,h=g.props,o=h.title,_=h.selected,m=h.icon,T=h.loading,N=h.data,j=g.props.context,W=j.prefixCls,Y=j.showIcon,B=j.icon,R=j.draggable,$=j.loadData,te=j.titleRender,ue=g.isDisabled(),me="".concat(W,"-node-content-wrapper"),Me;if(Y){var Ae=m||B;Me=Ae?k.createElement("span",{className:b()("".concat(W,"-iconEle"),"".concat(W,"-icon__customize"))},typeof Ae=="function"?Ae(g.props):Ae):g.renderIcon()}else $&&T&&(Me=g.renderIcon());var De;typeof o=="function"?De=o(N):te?De=te(N):De=o;var Fe=k.createElement("span",{className:"".concat(W,"-title")},De);return k.createElement("span",{ref:g.setSelectHandle,title:typeof o=="string"?o:"",className:b()("".concat(me),"".concat(me,"-").concat(g.getNodeState()||"normal"),!ue&&(_||v)&&"".concat(W,"-node-selected"),!ue&&R&&"draggable"),draggable:!ue&&R||void 0,"aria-grabbed":!ue&&R||void 0,onMouseEnter:g.onMouseEnter,onMouseLeave:g.onMouseLeave,onContextMenu:g.onContextMenu,onClick:g.onSelectorClick,onDoubleClick:g.onSelectorDoubleClick,onDragStart:R?g.onDragStart:void 0},Me,Fe)},g}return Object(L.a)(w,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var v=this.props.selectable,h=this.props.context.selectable;return typeof v=="boolean"?v:h}},{key:"render",value:function(){var v,h=this.props,o=h.eventKey,_=h.className,m=h.style,T=h.dragOver,N=h.dragOverGapTop,j=h.dragOverGapBottom,W=h.isLeaf,Y=h.isStart,B=h.isEnd,R=h.expanded,$=h.selected,te=h.checked,ue=h.halfChecked,me=h.loading,Me=h.domRef,Ae=h.active,De=h.onMouseMove,Fe=Object(X.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ne=this.props.context,Ee=Ne.prefixCls,se=Ne.filterTreeNode,He=Ne.draggable,ft=Ne.keyEntities,lt=this.isDisabled(),it=Object(p.f)(Fe),ct=ft[o]||{},Ve=ct.level,Je=B[B.length-1];return k.createElement("div",Object.assign({ref:Me,className:b()(_,"".concat(Ee,"-treenode"),(v={},Object(ae.a)(v,"".concat(Ee,"-treenode-disabled"),lt),Object(ae.a)(v,"".concat(Ee,"-treenode-switcher-").concat(R?"open":"close"),!W),Object(ae.a)(v,"".concat(Ee,"-treenode-checkbox-checked"),te),Object(ae.a)(v,"".concat(Ee,"-treenode-checkbox-indeterminate"),ue),Object(ae.a)(v,"".concat(Ee,"-treenode-selected"),$),Object(ae.a)(v,"".concat(Ee,"-treenode-loading"),me),Object(ae.a)(v,"".concat(Ee,"-treenode-active"),Ae),Object(ae.a)(v,"".concat(Ee,"-treenode-leaf-last"),Je),Object(ae.a)(v,"drag-over",!lt&&T),Object(ae.a)(v,"drag-over-gap-top",!lt&&N),Object(ae.a)(v,"drag-over-gap-bottom",!lt&&j),Object(ae.a)(v,"filter-node",se&&se(Object(l.b)(this.props))),v)),style:m,onDragEnter:He?this.onDragEnter:void 0,onDragOver:He?this.onDragOver:void 0,onDragLeave:He?this.onDragLeave:void 0,onDrop:He?this.onDrop:void 0,onDragEnd:He?this.onDragEnd:void 0,onMouseMove:De},it),k.createElement(r,{prefixCls:Ee,level:Ve,isStart:Y,isEnd:B}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),w}(k.Component),O=function(C){return k.createElement(y.a.Consumer,null,function(w){return k.createElement(f,Object.assign({},C,{context:w}))})};O.displayName="TreeNode",O.defaultProps={title:s},O.isTreeNode=1;var S=$e.a=O},Y1PL:function(Rt,$e,Q){"use strict";Q.r($e),Q.d($e,"ResizableTextArea",function(){return ue});var ae=Q("wx14"),X=Q("1OyB"),P=Q("vuIU"),V=Q("Ji7U"),L=Q("LK+K"),M=Q("q1tI"),H=Q("VTBJ"),U=Q("rePB"),k=Q("Zm9Q"),I=Q("Kwbf"),b=Q("c+Xe"),y=Q("m+aA"),p=Q("bdgK"),c=new Map;function r(Ae){Ae.forEach(function(De){var Fe,Ne=De.target;(Fe=c.get(Ne))===null||Fe===void 0||Fe.forEach(function(Ee){return Ee(Ne)})})}var l=new p.default(r),u=null,a=null;function s(Ae,De){c.has(Ae)||(c.set(Ae,new Set),l.observe(Ae)),c.get(Ae).add(De)}function f(Ae,De){c.has(Ae)&&(c.get(Ae).delete(De),c.get(Ae).size||(l.unobserve(Ae),c.delete(Ae)))}var O=function(Ae){Object(V.a)(Fe,Ae);var De=Object(L.a)(Fe);function Fe(){return Object(X.a)(this,Fe),De.apply(this,arguments)}return Object(P.a)(Fe,[{key:"render",value:function(){return this.props.children}}]),Fe}(M.Component),S=M.createContext(null);function E(Ae){var De=Ae.children,Fe=Ae.onBatchResize,Ne=M.useRef(0),Ee=M.useRef([]),se=M.useContext(S),He=M.useCallback(function(ft,lt,it){Ne.current+=1;var ct=Ne.current;Ee.current.push({size:ft,element:lt,data:it}),Promise.resolve().then(function(){ct===Ne.current&&(Fe==null||Fe(Ee.current),Ee.current=[])}),se==null||se(ft,lt,it)},[Fe,se]);return M.createElement(S.Provider,{value:He},De)}function C(Ae){var De=Ae.children,Fe=Ae.disabled,Ne=M.useRef(null),Ee=M.useRef(null),se=M.useContext(S),He=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ft=M.isValidElement(De)&&Object(b.c)(De),lt=ft?De.ref:null,it=M.useMemo(function(){return Object(b.a)(lt,Ne)},[lt,Ne]),ct=M.useRef(Ae);ct.current=Ae;var Ve=M.useCallback(function(Je){var st=ct.current,gt=st.onResize,ut=st.data,et=Je.getBoundingClientRect(),qe=et.width,St=et.height,pt=Je.offsetWidth,nt=Je.offsetHeight,at=Math.floor(qe),bt=Math.floor(St);if(He.current.width!==at||He.current.height!==bt||He.current.offsetWidth!==pt||He.current.offsetHeight!==nt){var Et={width:at,height:bt,offsetWidth:pt,offsetHeight:nt};He.current=Et;var Re=pt===Math.round(qe)?qe:pt,Te=nt===Math.round(St)?St:nt,Ke=Object(H.a)(Object(H.a)({},Et),{},{offsetWidth:Re,offsetHeight:Te});se==null||se(Ke,Je,ut),gt&&Promise.resolve().then(function(){gt(Ke,Je)})}},[]);return M.useEffect(function(){var Je=Object(y.a)(Ne.current)||Object(y.a)(Ee.current);return Je&&!Fe&&s(Je,Ve),function(){return f(Je,Ve)}},[Ne.current,Fe]),M.createElement(O,{ref:Ee},ft?M.cloneElement(De,{ref:it}):De)}var w="rc-observer-key";function g(Ae){var De=Ae.children,Fe=Object(k.a)(De);return Fe.map(function(Ne,Ee){var se=(Ne==null?void 0:Ne.key)||"".concat(w,"-").concat(Ee);return M.createElement(C,Object(ae.a)({},Ae,{key:se}),Ne)})}g.Collection=E;var v=g,h=Q("bT9E"),o=Q("TSYQ"),_=Q.n(o),m=`
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
`,T=["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"],N={},j;function W(Ae){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=Ae.getAttribute("id")||Ae.getAttribute("data-reactid")||Ae.getAttribute("name");if(De&&N[Fe])return N[Fe];var Ne=window.getComputedStyle(Ae),Ee=Ne.getPropertyValue("box-sizing")||Ne.getPropertyValue("-moz-box-sizing")||Ne.getPropertyValue("-webkit-box-sizing"),se=parseFloat(Ne.getPropertyValue("padding-bottom"))+parseFloat(Ne.getPropertyValue("padding-top")),He=parseFloat(Ne.getPropertyValue("border-bottom-width"))+parseFloat(Ne.getPropertyValue("border-top-width")),ft=T.map(function(it){return"".concat(it,":").concat(Ne.getPropertyValue(it))}).join(";"),lt={sizingStyle:ft,paddingSize:se,borderSize:He,boxSizing:Ee};return De&&Fe&&(N[Fe]=lt),lt}function Y(Ae){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ne=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),Ae.getAttribute("wrap")?j.setAttribute("wrap",Ae.getAttribute("wrap")):j.removeAttribute("wrap");var Ee=W(Ae,De),se=Ee.paddingSize,He=Ee.borderSize,ft=Ee.boxSizing,lt=Ee.sizingStyle;j.setAttribute("style","".concat(lt,";").concat(m)),j.value=Ae.value||Ae.placeholder||"";var it=Number.MIN_SAFE_INTEGER,ct=Number.MAX_SAFE_INTEGER,Ve=j.scrollHeight,Je;if(ft==="border-box"?Ve+=He:ft==="content-box"&&(Ve-=se),Fe!==null||Ne!==null){j.value=" ";var st=j.scrollHeight-se;Fe!==null&&(it=st*Fe,ft==="border-box"&&(it=it+se+He),Ve=Math.max(it,Ve)),Ne!==null&&(ct=st*Ne,ft==="border-box"&&(ct=ct+se+He),Je=Ve>ct?"":"hidden",Ve=Math.min(ct,Ve))}return{height:Ve,minHeight:it,maxHeight:ct,overflowY:Je,resize:"none"}}var B=Q("Gytx"),R=Q.n(B),$;(function(Ae){Ae[Ae.NONE=0]="NONE",Ae[Ae.RESIZING=1]="RESIZING",Ae[Ae.RESIZED=2]="RESIZED"})($||($={}));var te=function(Ae){Object(V.a)(Fe,Ae);var De=Object(L.a)(Fe);function Fe(Ne){var Ee;return Object(X.a)(this,Fe),Ee=De.call(this,Ne),Ee.nextFrameActionId=void 0,Ee.resizeFrameId=void 0,Ee.textArea=void 0,Ee.saveTextArea=function(se){Ee.textArea=se},Ee.handleResize=function(se){var He=Ee.state.resizeStatus,ft=Ee.props,lt=ft.autoSize,it=ft.onResize;if(He!==$.NONE)return;typeof it=="function"&&it(se),lt&&Ee.resizeOnNextFrame()},Ee.resizeOnNextFrame=function(){cancelAnimationFrame(Ee.nextFrameActionId),Ee.nextFrameActionId=requestAnimationFrame(Ee.resizeTextarea)},Ee.resizeTextarea=function(){var se=Ee.props.autoSize;if(!se||!Ee.textArea)return;var He=se.minRows,ft=se.maxRows,lt=Y(Ee.textArea,!1,He,ft);Ee.setState({textareaStyles:lt,resizeStatus:$.RESIZING},function(){cancelAnimationFrame(Ee.resizeFrameId),Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:$.RESIZED},function(){Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:$.NONE}),Ee.fixFirefoxAutoScroll()})})})})},Ee.renderTextArea=function(){var se=Ee.props,He=se.prefixCls,ft=He===void 0?"rc-textarea":He,lt=se.autoSize,it=se.onResize,ct=se.className,Ve=se.disabled,Je=Ee.state,st=Je.textareaStyles,gt=Je.resizeStatus,ut=Object(h.a)(Ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),et=_()(ft,ct,Object(U.a)({},"".concat(ft,"-disabled"),Ve));"value"in ut&&(ut.value=ut.value||"");var qe=Object(H.a)(Object(H.a)(Object(H.a)({},Ee.props.style),st),gt===$.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(v,{onResize:Ee.handleResize,disabled:!(lt||it)},M.createElement("textarea",Object(ae.a)({},ut,{className:et,style:qe,ref:Ee.saveTextArea})))},Ee.state={textareaStyles:{},resizeStatus:$.NONE},Ee}return Object(P.a)(Fe,[{key:"componentDidUpdate",value:function(Ee){(Ee.value!==this.props.value||!R()(Ee.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 Ee=this.textArea.selectionStart,se=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ee,se)}}catch(He){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Fe}(M.Component),ue=te,me=function(Ae){Object(V.a)(Fe,Ae);var De=Object(L.a)(Fe);function Fe(Ne){var Ee;Object(X.a)(this,Fe),Ee=De.call(this,Ne),Ee.resizableTextArea=void 0,Ee.focus=function(){Ee.resizableTextArea.textArea.focus()},Ee.saveTextArea=function(He){Ee.resizableTextArea=He},Ee.handleChange=function(He){var ft=Ee.props.onChange;Ee.setValue(He.target.value,function(){Ee.resizableTextArea.resizeTextarea()}),ft&&ft(He)},Ee.handleKeyDown=function(He){var ft=Ee.props,lt=ft.onPressEnter,it=ft.onKeyDown;He.keyCode===13&&lt&&lt(He),it&&it(He)};var se=typeof Ne.value=="undefined"||Ne.value===null?Ne.defaultValue:Ne.value;return Ee.state={value:se},Ee}return Object(P.a)(Fe,[{key:"setValue",value:function(Ee,se){"value"in this.props||this.setState({value:Ee},se)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(ue,Object(ae.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ee){return"value"in Ee?{value:Ee.value}:null}}]),Fe}(M.Component),Me=$e.default=me},ZW9T:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return Y});var ae=Q("k1fw"),X=Q("miYZ"),P=Q("tsqr"),V=Q("rAM+"),L=Q("tJVT"),M=Q("PpiC"),H=Q("q1tI"),U=Q.n(H),k=Q("bdgK"),I=Q("oBTY"),b=Q("9og8"),y=Q("WmNS"),p=Q.n(y),c={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},r={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},l={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},u={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},a=Q("5VLF"),s=Q.n(a),f={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},O=function(R,$){return $.map(function(te){return{label:te,kind:R.languages.CompletionItemKind.Keyword,insertText:te}})},S=function(R){return Object.keys(f.tables).map(function($){return{label:$,kind:R.languages.CompletionItemKind.Variable,insertText:$}})},E=function(R,$){var te=f.tables[R];return te?te.map(function(ue){return{label:ue,kind:$.languages.CompletionItemKind.Field,insertText:ue}}):[]};function C(B,R,$,te,ue){var me=R.getWordUntilPosition($),Me={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:me.startColumn,endColumn:me.endColumn},Ae=te.map(function(De){return{label:De,kind:B.languages.CompletionItemKind.Keyword,insertText:De,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Me}});return ue.map(function(De){Ae.push(Object(ae.a)(Object(ae.a)({},De),{},{range:Me}))}),Ae}var w=function(B){f.languages.map(function(ue){return B.languages.registerDocumentFormattingEditProvider(ue,{provideDocumentFormattingEdits:function(Me,Ae,De){return Object(b.a)(p.a.mark(function Fe(){var Ne;return p.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return Ne=s()(Me.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),se.abrupt("return",[{range:Me.getFullModelRange(),text:Ne}]);case 2:case"end":return se.stop()}},Fe)}))()}}),ue});var R=l.quickKey.map(function(ue){return{label:ue.label,kind:B.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=u.quickKey.map(function(ue){return{label:ue.label,kind:B.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=r.quickKey.map(function(ue){return{label:ue.label,kind:B.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}});B.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(I.a)(l.keywords),Object(I.a)(l.quickKey.map(function(ue){return ue.label}))),provideCompletionItems:function(me,Me){var Ae=me.getValueInRange({startLineNumber:Me.lineNumber,startColumn:1,endLineNumber:Me.lineNumber,endColumn:Me.column}),De=Ae.match(/cu/gim);console.log("match:",De,Me,Ae,me);var Fe=[],Ne=Me.lineNumber,Ee=Me.column,se=me.getValueInRange({startLineNumber:Ne,startColumn:0,endLineNumber:Ne,endColumn:Ee}),He=se.trim().split(/\s+/),ft=He[He.length-1];if(ft.endsWith(".")){var lt=ft.slice(0,ft.length-1);Object.keys(f.tables).includes(lt)&&(Fe=Object(I.a)(E(lt,B)))}else ft==="."?Fe=[]:Fe=[].concat(Object(I.a)(S(B)),Object(I.a)(O(B,l.keywords)),Object(I.a)(R));return{suggestions:Fe}}}),B.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(I.a)(c.keywords)),provideCompletionItems:function(me,Me){var Ae=me.getValueInRange({startLineNumber:Me.lineNumber,startColumn:1,endLineNumber:Me.lineNumber,endColumn:Me.column}),De=Ae.match(/cu/gim);console.log("match:",De,Me,Ae,me);var Fe=[],Ne=Me.lineNumber,Ee=Me.column,se=me.getValueInRange({startLineNumber:Ne,startColumn:0,endLineNumber:Ne,endColumn:Ee}),He=se.trim().split(/\s+/),ft=He[He.length-1];if(ft.endsWith(".")){var lt=ft.slice(0,ft.length-1);Object.keys(f.tables).includes(lt)&&(Fe=Object(I.a)(E(lt,B)))}else ft==="."?Fe=[]:Fe=[].concat(Object(I.a)(S(B)),Object(I.a)(O(B,c.keywords)));return{suggestions:Fe}}}),B.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(I.a)(r.keywords)),provideCompletionItems:function(me,Me){var Ae=[],De=Me.lineNumber,Fe=Me.column,Ne=me.getValueInRange({startLineNumber:De,startColumn:0,endLineNumber:De,endColumn:Fe}),Ee=Ne.trim().split(/\s+/),se=Ee[Ee.length-1];if(se.endsWith(".")){var He=se.slice(0,se.length-1);Object.keys(f.tables).includes(He)&&(Ae=Object(I.a)(E(He,B)))}else se==="."?Ae=[]:Ae=[].concat(Object(I.a)(S(B)),Object(I.a)(O(B,r.keywords)),Object(I.a)(te));return{suggestions:Ae}}}),B.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(I.a)(u.keywords)),provideCompletionItems:function(me,Me){var Ae=[],De=Me.lineNumber,Fe=Me.column,Ne=me.getValueInRange({startLineNumber:De,startColumn:0,endLineNumber:De,endColumn:Fe}),Ee=Ne.trim().split(/\s+/),se=Ee[Ee.length-1];if(se.endsWith(".")){var He=se.slice(0,se.length-1);Object.keys(f.tables).includes(He)&&(Ae=Object(I.a)(E(He,B)))}else se==="."?Ae=[]:Ae=[].concat(Object(I.a)(S(B)),Object(I.a)(O(B,u.keywords)),Object(I.a)($));return{suggestions:Ae}}})},g="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",v=Q("LvDl"),h=Q("+ua5");function o(B){return/^\d+$/.test(B)?"".concat(B,"px"):B}function _(){}var m=!1,T={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function N(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],R=B;if(Array.isArray(B)){for(var $=0;$<B.length;$++){var te=T[B[$]];if(te)return te}return R[0]}return T[R]||R}var j=null,W=$e.b=function(B){var R=B.width,$=R===void 0?"100%":R,te=B.height,ue=te===void 0?"100%":te,me=B.value,Me=B.language,Ae=Me===void 0?"javascript":Me,De=B.style,Fe=De===void 0?{}:De,Ne=B.options,Ee=Ne===void 0?{}:Ne,se=B.overrideServices,He=se===void 0?{}:se,ft=B.theme,lt=ft===void 0?"vs-dark":ft,it=B.onEditBlur,ct=B.onSave,Ve=B.autoHeight,Je=Ve===void 0?!1:Ve,st=B.forbidCopy,gt=st===void 0?!1:st,ut=B.onChange,et=ut===void 0?_:ut,qe=B.editorDidMount,St=qe===void 0?_:qe,pt=B.onFocus,nt=pt===void 0?_:pt,at=B.filename,bt=at===void 0?"educoder.txt":at,Et=B.errorLine,Re=B.errorContent,Te=Re===void 0?"":Re,Ke=Object(M.a)(B,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ze=Object(H.useRef)(),Ce=Object(H.useRef)({}),We=Object(H.useRef)(),ve=Object(H.useRef)(!1),ce=Object(H.useRef)(),he=Object(H.useState)(!1),ne=Object(L.a)(he,2),oe=ne[0],le=ne[1];function pe(){var Xe;return ze.current&&(Xe=new k.default(function(Lt){var Ut=Object(V.a)(Lt),Mt;try{for(Ut.s();!(Mt=Ut.n()).done;){var Zt=Mt.value;(Zt.target.offsetHeight>0||Zt.target.offsetWidth>0)&&Ce.current.instance.layout()}}catch(Ln){Ut.e(Ln)}finally{Ut.f()}}),Xe.observe(ze.current)),Xe}function ge(){P.b.warn(decodeURIComponent(g))}var Pe=function(){var Lt=Ce.current.instance;if(me!=null&&Lt&&oe){var Ut=Lt.getModel();Ut&&me!==Ut.getValue()&&(m=!0,Ut.setValue(me),Lt.layout(),m=!1)}};Object(H.useEffect)(function(){We.current&&clearTimeout(We.current),We.current=setTimeout(function(){Pe()},500)},[me,oe,Ce.current]),Object(H.useEffect)(function(){if(Et&&Ce.current&&Ce.current.instance){var Xe=Ce.current.instance;Xe.changeViewZones(function(Ut){var Mt=document.createElement("div");Mt.style.padding="10px 20px",Mt.style.width="calc(100% - 20px)",Mt.className="my-error-line-wrp",Mt.innerHTML=Te,Ut.addZone({afterLineNumber:Et||11,heightInLines:3,domNode:Mt})});var Lt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Xe.addOverlayWidget(Lt),Xe.revealPositionInCenter({lineNumber:20,column:1})}},[Et,Ce.current,oe]);function Ge(){var Xe=Ce.current.instance;if(Xe){var Lt=Xe.getSelection(),Ut=Ce.current.pastePos||{},Mt=new j.Range(Ut.startLineNumber||Lt.endLineNumber,Ut.startColumn||Lt.endColumn,Ut.endLineNumber||Lt.endLineNumber,Ut.endColumn||Lt.endColumn);setTimeout(function(){Xe.executeEdits("",[{range:Mt,text:""}])},300)}}function rt(Xe){(window.navigator.platform.match("Mac")?Xe.metaKey:Xe.ctrlKey)&&Xe.keyCode==83&&(Xe.preventDefault(),ct())}var vt=function(){if(Je&&Ce.current.instance){var Lt=Ce.current.instance.getContentHeight();rn(Lt<ue?ue:Lt)}else rn(ue)};function tt(Xe){var Lt=document.createEvent("MouseEvents");Lt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Xe.dispatchEvent(Lt)}function Wt(Xe,Lt){var Ut=window.URL||window.webkitURL||window,Mt=new Blob([Lt]),Zt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Zt.href=Ut.createObjectURL(Mt),Zt.download=Xe,tt(Zt)}Object(H.useEffect)(function(){vt()},[vt]),Object(H.useEffect)(function(){ze.current&&!oe&&Q.e(27).then(Q.t.bind(null,"M/lh",7)).then(function(Xe){try{j=Xe,Ce.current.instance=j.editor.create(ze.current,{value:me,language:N(Ae),theme:lt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},He);var Lt=Ce.current.instance;if(St(Lt,j),setTimeout(function(){vt(),Ce.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Wt(bt||"educoder.txt",Lt.getValue())}})},500),Ce.current.subscription=Lt.onDidChangeModelContent(function(Mt){ve.current?clearTimeout(ce.current):(vt(),et(Lt.getValue(),Mt)),ce.current=setTimeout(function(){ve.current=!1},500)}),window.Monaco||w(j),gt&&(Lt.addCommand(j.KeyMod.CtrlCmd|j.KeyMod.Shift|j.KeyCode.KEY_V,function(){return ge(),null}),Lt.addCommand(j.KeyMod.CtrlCmd|j.KeyCode.KEY_C,function(){return ge(),null})),window.Monaco=j,it&&Lt.onDidBlurEditorWidget(function(){it(Lt.getValue())}),nt&&Lt.onDidFocusEditorText(function(){nt(Lt.getValue())}),gt){Lt.addCommand(j.KeyMod.CtrlCmd|j.KeyCode.KEY_V,function(){return ge(),null}),Lt.onDidPaste(function(Mt){Ce.current.pastePos=Mt});try{window.addEventListener("paste",Ge)}catch(Mt){}}var Ut=pe();return le(!0),function(){var Mt=Ce.current.instance;Mt.dispose();var Zt=Mt.getModel();Zt&&Zt.dispose(),Ce.current.subscription&&Ce.current.subscription.dispose(),gt&&window.removeEventListener("paste",Ge),Ut.unobserve(ze.current)}}catch(Mt){}})},[]),Object(H.useEffect)(function(){var Xe=Ce.current.instance;if(Xe&&oe)return document.addEventListener("keydown",rt,!1),function(){document.removeEventListener("keydown",rt)}},[ct,oe]),Object(H.useEffect)(function(){var Xe=Ce.current.instance;if(Xe&&oe){var Lt=N(Ae);j.editor.setModelLanguage(Xe.getModel(),Lt),console.log("language:",Ae,Xe.getModel(),Lt)}},[Ae,oe]),Object(H.useEffect)(function(){var Xe=Ce.current.instance;Xe&&oe&&j.editor.setTheme(lt)},[lt,oe]),Object(H.useEffect)(function(){var Xe=Ce.current.instance;Xe&&oe&&(Xe.updateOptions(Object(ae.a)({},Ee)),setTimeout(function(){Xe.getModel().updateOptions(Object(ae.a)({},Ee))},200))},[JSON.stringify(Ee),oe]),Object(H.useEffect)(function(){var Xe=Ce.current.instance;Xe&&oe&&Xe.layout()},[$,ue,oe]);var Nt=Object(H.useState)(o($)),_t=Object(L.a)(Nt,2),Qt=_t[0],Jt=_t[1],Yt=Object(H.useState)(o(ue)),cn=Object(L.a)(Yt,2),jt=cn[0],rn=cn[1],kt=Object(ae.a)(Object(ae.a)({},Fe),{},{width:Qt,height:jt});return U.a.createElement("div",{className:"my-monaco-editor",ref:ze,style:kt})};function Y(B){var R=B.width,$=R===void 0?"100%":R,te=B.height,ue=te===void 0?"100%":te,me=B.original,Me=B.modified,Ae=B.language,De=B.options,Fe=De===void 0?{}:De,Ne=Object(H.useRef)(),Ee=Object(H.useState)(null),se=Object(L.a)(Ee,2),He=se[0],ft=se[1];function lt(Je){var st;return Ne.current&&(st=new k.default(function(gt){var ut=Object(V.a)(gt),et;try{for(ut.s();!(et=ut.n()).done;){var qe=et.value;(qe.target.offsetHeight>0||qe.target.offsetWidth>0)&&Je.layout()}}catch(St){ut.e(St)}finally{ut.f()}}),st.observe(Ne.current)),st}Object(H.useEffect)(function(){Ne.current&&Q.e(27).then(Q.t.bind(null,"M/lh",7)).then(function(Je){j=Je;var st=j.editor.createDiffEditor(Ne.current,Object(ae.a)(Object(ae.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Fe),{},{wordWrap:!0}));ft(st);var gt=lt(st);return function(){st.dispose();var ut=st.getModel();ut&&ut.dispose(),gt.unobserve(Ne.current)}})},[]),Object(H.useEffect)(function(){He&&He.setModel({original:j.editor.createModel(me,Ae),modified:j.editor.createModel(Me,Ae)})},[me,Me,Ae,He]);var it=o($),ct=o(ue),Ve={width:it,height:ct};return U.a.createElement("div",{className:"my-diff-editor",ref:Ne,style:Ve})}},Zn6s:function(Rt,$e,Q){Rt.exports={flex_box_center:"flex_box_center___pqu8p",flex_space_between:"flex_space_between___13VO1",flex_box_vertical_center:"flex_box_vertical_center___2L1wM",flex_box_center_end:"flex_box_center_end___2woFr",flex_box_column:"flex_box_column___3DmPK",listItem:"listItem___2xCQw",description:"description___3zdUa",liked:"liked___31aDR",likedActive:"likedActive___2z67b",reply:"reply___3GTwE",replyList:"replyList___1pOD_",comment:"comment___2AGxg"}},ZpRC:function(Rt,$e,Q){"use strict";function ae(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function X(b,y){return(!y||b!=="hidden")&&b!=="visible"&&b!=="clip"}function P(b,y){if(b.clientHeight<b.scrollHeight||b.clientWidth<b.scrollWidth){var p=getComputedStyle(b,null);return X(p.overflowY,y)||X(p.overflowX,y)||function(c){var r=function(l){if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch(u){return null}}(c);return!!r&&(r.clientHeight<c.scrollHeight||r.clientWidth<c.scrollWidth)}(b)}return!1}function V(b,y,p,c,r,l,u,a){return l<b&&u>y||l>b&&u<y?0:l<=b&&a<=p||u>=y&&a>=p?l-b-c:u>y&&a<p||l<b&&a>p?u-y+r:0}var L=function(b,y){var p=window,c=y.scrollMode,r=y.block,l=y.inline,u=y.boundary,a=y.skipOverflowHiddenElements,s=typeof u=="function"?u:function(st){return st!==u};if(!ae(b))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,O=[],S=b;ae(S)&&s(S);){if((S=S.parentElement)===f){O.push(S);break}S!=null&&S===document.body&&P(S)&&!P(document.documentElement)||S!=null&&P(S,a)&&O.push(S)}for(var E=p.visualViewport?p.visualViewport.width:innerWidth,C=p.visualViewport?p.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,v=b.getBoundingClientRect(),h=v.height,o=v.width,_=v.top,m=v.right,T=v.bottom,N=v.left,j=r==="start"||r==="nearest"?_:r==="end"?T:_+h/2,W=l==="center"?N+o/2:l==="end"?m:N,Y=[],B=0;B<O.length;B++){var R=O[B],$=R.getBoundingClientRect(),te=$.height,ue=$.width,me=$.top,Me=$.right,Ae=$.bottom,De=$.left;if(c==="if-needed"&&_>=0&&N>=0&&T<=C&&m<=E&&_>=me&&T<=Ae&&N>=De&&m<=Me)return Y;var Fe=getComputedStyle(R),Ne=parseInt(Fe.borderLeftWidth,10),Ee=parseInt(Fe.borderTopWidth,10),se=parseInt(Fe.borderRightWidth,10),He=parseInt(Fe.borderBottomWidth,10),ft=0,lt=0,it="offsetWidth"in R?R.offsetWidth-R.clientWidth-Ne-se:0,ct="offsetHeight"in R?R.offsetHeight-R.clientHeight-Ee-He:0;if(f===R)ft=r==="start"?j:r==="end"?j-C:r==="nearest"?V(g,g+C,C,Ee,He,g+j,g+j+h,h):j-C/2,lt=l==="start"?W:l==="center"?W-E/2:l==="end"?W-E:V(w,w+E,E,Ne,se,w+W,w+W+o,o),ft=Math.max(0,ft+g),lt=Math.max(0,lt+w);else{ft=r==="start"?j-me-Ee:r==="end"?j-Ae+He+ct:r==="nearest"?V(me,Ae,te,Ee,He+ct,j,j+h,h):j-(me+te/2)+ct/2,lt=l==="start"?W-De-Ne:l==="center"?W-(De+ue/2)+it/2:l==="end"?W-Me+se+it:V(De,Me,ue,Ne,se+it,W,W+o,o);var Ve=R.scrollLeft,Je=R.scrollTop;j+=Je-(ft=Math.max(0,Math.min(Je+ft,R.scrollHeight-te+ct))),W+=Ve-(lt=Math.max(0,Math.min(Ve+lt,R.scrollWidth-ue+it)))}Y.push({el:R,top:ft,left:lt})}return Y};function M(b){return b===Object(b)&&Object.keys(b).length!==0}function H(b,y){y===void 0&&(y="auto");var p="scrollBehavior"in document.body.style;b.forEach(function(c){var r=c.el,l=c.top,u=c.left;r.scroll&&p?r.scroll({top:l,left:u,behavior:y}):(r.scrollTop=l,r.scrollLeft=u)})}function U(b){return b===!1?{block:"end",inline:"nearest"}:M(b)?b:{block:"start",inline:"nearest"}}function k(b,y){var p=!b.ownerDocument.documentElement.contains(b);if(M(y)&&typeof y.behavior=="function")return y.behavior(p?[]:L(b,y));if(p)return;var c=U(y);return H(L(b,c),c.behavior)}var I=$e.a=k},b7x8:function(Rt,$e,Q){"use strict";Q.r($e);var ae=Q("Znn+"),X=Q("ZTPi"),P=Q("sPJy"),V=Q("bE4q"),L=Q("k1fw"),M=Q("tJVT"),H=Q("q1tI"),U=Q.n(H),k=Q("Ty5D"),I=Q("55Ip"),b=Q("9kvl"),y=Q("jhfD"),p=Q("1vsH"),c=Q("DjyN"),r=Q("NUBc"),l=Q("5Dmo"),u=Q("3S7+"),a=Q("14J3"),s=Q("BMrR"),f=Q("+L6B"),O=Q("2/Rp"),S=Q("miYZ"),E=Q("tsqr"),C=Q("9og8"),w=Q("jCWc"),g=Q("kPKH"),v=Q("5NDa"),h=Q("5rEg"),o=Q("WmNS"),_=Q.n(o),m=Q("Ot1p"),T=Q("m3rI"),N=Q("9Bee"),j=Q("2qtc"),W=Q("kLXV"),Y=function(nt){var at=nt.shixunHomeworks,bt=nt.dispatch,Et=Object(k.i)();return U.a.createElement(W.a,{centered:!0,title:"\u63D0\u793A",visible:at.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(C.a)(_.a.mark(function Re(){var Te;return _.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:return ze.next=2,bt({type:"shixunHomeworks/deleteReply",payload:{object_id:at.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:Te=ze.sent,Te.status===0&&(E.b.success("\u5220\u9664\u6210\u529F"),bt({type:"shixunHomeworks/setActionTabs",payload:{}}),bt({type:"shixunHomeworks/getReplyList",payload:Object(L.a)({},at.actionTabs.params)}));case 4:case"end":return ze.stop()}},Re)})),onCancel:function(){bt({type:"shixunHomeworks/setActionTabs",payload:{}})}},U.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},B=Object(b.a)(function(pt){var nt=pt.shixunHomeworks;return{shixunHomeworks:nt}})(Y),R=Q("wd/R"),$=Q.n(R),te=Q("/MfK"),ue=Q("BtR2"),me=Q("Zn6s"),Me=Q.n(me);$.a.lang("ZH-cn");var Ae=function(nt){var at=nt.graduation,bt=nt.classroomList,Et=nt.globalSetting,Re=nt.loading,Te=nt.dispatch,Ke=Object(H.useState)(Object(L.a)({},Object(k.i)())),ze=Object(M.a)(Ke,2),Ce=ze[0],We=ze[1],ve=Object(H.useState)(!1),ce=Object(M.a)(ve,2),he=ce[0],ne=ce[1],oe=Object(H.useState)(-1),le=Object(M.a)(oe,2),pe=le[0],ge=le[1],Pe=Object(H.useState)(""),Ge=Object(M.a)(Pe,2),rt=Ge[0],vt=Ge[1],tt=at.detail,Wt=bt.detailLeftMenus,Nt=at.graduationDetail,_t=at.replyList,Qt=at.workDetail,Jt={1:"\u8BBE\u8BA1",2:"\u8BBA\u6587",3:"\u521B\u4F5C"},Yt={1:"\u751F\u4EA7/\u793E\u4F1A\u5B9E\u9645",2:"\u7ED3\u5408\u79D1\u7814",3:"\u5176\u5B83"},cn={1:"\u771F\u9898",2:"\u6A21\u62DF\u9898"},jt={1:"\u7EB5\u5411\u8BFE\u9898",2:"\u6A2A\u5411\u8BFE\u9898",3:"\u81EA\u9009"},rn={1:"\u65B0\u9898",2:"\u5F80\u5C4A\u9898\uFF0C\u6709\u65B0\u8981\u6C42",3:"\u5F80\u5C4A\u9898\uFF0C\u65E0\u65B0\u8981\u6C42"};return Ce.page_size=10,Object(H.useEffect)(function(){Te({type:"graduation/getReplyList",payload:Object(L.a)({},Ce)}),Te({type:"graduation/getTopisDetail",payload:Object(L.a)({},Ce)})},[Ce.categoryId]),U.a.createElement("section",{className:Me.a.bg},U.a.createElement("section",{className:" edu-container"},U.a.createElement("aside",{className:[Me.a.desc,"c-black","font14","bg-white"].join(" ")},U.a.createElement("h1",{className:Me.a.description},tt.description),U.a.createElement("div",{className:"mt30"},U.a.createElement("ul",{className:Me.a.listItem},U.a.createElement("li",null,U.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u7C7B\u578B\uFF1A"),U.a.createElement("span",null,Jt[tt==null?void 0:tt.topic_type]||"--")),U.a.createElement("li",null,U.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u6765\u6E90\uFF1A"),U.a.createElement("span",null,Yt[tt==null?void 0:tt.topic_source]||"--")),U.a.createElement("li",null,U.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u6027\u8D281\uFF1A"),U.a.createElement("span",null,cn[tt==null?void 0:tt.topic_property_first]||"--")),U.a.createElement("li",null,U.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u6027\u8D282\uFF1A"),U.a.createElement("span",null,jt[tt==null?void 0:tt.topic_property_second]||"--")),U.a.createElement("li",null,U.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u91CD\u590D\u60C5\u51B5\uFF1A"),U.a.createElement("span",null,rn[tt==null?void 0:tt.topic_repeat]||"--")),U.a.createElement("li",null,U.a.createElement("span",{className:"c-light-black"},"\u8C03\u7814\u6216\u5B9E\u4E60\u5730\u70B9\uFF1A"),U.a.createElement("span",null,tt.city||"--")),U.a.createElement("li",{className:"fl with50"},U.a.createElement("span",{className:"c-light-black"},"\u8BFE\u9898\u6765\u6E90\u5355\u4F4D\uFF1A"),U.a.createElement("span",null,tt.source_unit||"--"))))),U.a.createElement("aside",{className:[Me.a.reply,"bg-white","mt20"].join(" ")},he&&U.a.createElement(m.a,{onChange:function(Xe){vt(Xe)},height:200,isFocus:!0,watch:!0}),U.a.createElement(s.a,{onClick:function(){ne(!0)}},U.a.createElement(g.a,{flex:"1"},!he&&U.a.createElement(h.a,{size:"large",className:"current",placeholder:"\u8BF4\u70B9\u4EC0\u4E48",disabled:!0})),U.a.createElement(g.a,null,U.a.createElement(O.a,{type:"primary",size:"large",onClick:Object(C.a)(_.a.mark(function kt(){var Xe;return _.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(!(rt==="")){Ut.next=4;break}E.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Ut.next=8;break;case 4:return Ut.next=6,Te({type:"graduation/createReply",payload:{journals_for_message:{jour_id:Ce.categoryId,jour_type:"HomeworkCommon",reply_id:1,notes:rt}}});case 6:Xe=Ut.sent,Xe.status===0&&(E.b.success("\u53D1\u5E03\u6210\u529F"),Te({type:"graduation/getReplyList",payload:Object(L.a)({},Ce)}),ne(!1));case 8:case"end":return Ut.stop()}},kt)}))},"\u53D1\u8868")))),(_t==null?void 0:_t.comments)&&_t.comments!=""&&U.a.createElement("aside",{className:[Me.a.replyList,"bg-white"].join(" ")},_t==null?void 0:_t.comments.map(function(kt,Xe){var Lt,Ut;return U.a.createElement(s.a,{gutter:[12,12],key:Xe},U.a.createElement(g.a,{flex:"40px"},U.a.createElement("img",{width:"40",src:"".concat(T.a.IMG_SERVER,"/images/").concat(kt==null||((Lt=kt.author)===null||Lt===void 0)?void 0:Lt.image_url)})),U.a.createElement(g.a,{flex:"1"},U.a.createElement(s.a,{align:"middle"},U.a.createElement(g.a,{span:24},U.a.createElement("span",{className:"c-light-black"},kt==null||((Ut=kt.author)===null||Ut===void 0)?void 0:Ut.name),U.a.createElement("span",{className:"c-light-black ml10"},$()(kt==null?void 0:kt.created_on).fromNow()," \u53D1\u5E03")),U.a.createElement(g.a,{span:24},U.a.createElement(N.a,{value:kt.content})),kt.children&&U.a.createElement("aside",{className:Me.a.comment},kt.children.map(function(Mt,Zt){return U.a.createElement(s.a,{key:Zt},U.a.createElement(g.a,{span:24},U.a.createElement(s.a,null,U.a.createElement(g.a,{flex:"1"},Mt.author.name,U.a.createElement("span",{className:"c-light-black ml10"},$()(Mt==null?void 0:Mt.created_on).fromNow())),U.a.createElement(g.a,null,U.a.createElement(u.a,{title:"\u5220\u9664"},U.a.createElement(te.a,{className:"current",onClick:function(){Te({type:"graduation/setActionTabs",payload:{key:"\u5220\u9664",params:Ce,selectArr:kt}})}}))))),U.a.createElement(g.a,null,U.a.createElement("strong",null,U.a.createElement(N.a,{value:Mt.content}))))})),U.a.createElement(g.a,{span:24,className:"mt5 c-light-black"},pe===Xe&&U.a.createElement("aside",null,U.a.createElement(m.a,{onChange:function(Zt){vt(Zt)},height:150,isFocus:!0}),U.a.createElement(s.a,null,U.a.createElement(g.a,{span:24,className:"tr"},U.a.createElement(O.a,{type:"primary",size:"large",onClick:Object(C.a)(_.a.mark(function Mt(){return _.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(!(rt==="")){Ln.next=4;break}E.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Ln.next=9;break;case 4:return Ln.next=6,Te({type:"graduation/createReply",payload:{journals_for_message:{jour_id:Ce.categoryId,jour_type:"HomeworkCommon",m_parent_id:kt.id,reply_id:1,notes:rt}}});case 6:Te({type:"graduation/getReplyList",payload:Object(L.a)({},Ce)}),E.b.success("\u53D1\u5E03\u6210\u529F"),ge(-1);case 9:case"end":return Ln.stop()}},Mt)}))},"\u53D1\u8868")))),pe!==Xe&&U.a.createElement("div",{className:"tr"},U.a.createElement("span",{className:"iconfont icon-huifu1 mr5 ml30",onClick:function(){return ge(Xe)}}),kt.liked&&U.a.createElement("span",{className:"c-orange"},U.a.createElement(ue.a,{className:"mr5 ml30",onClick:Object(C.a)(_.a.mark(function Mt(){return _.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:return Ln.next=2,Te({type:"graduation/replyUnLike",payload:{object_id:kt.id,object_type:"message"}});case 2:Te({type:"graduation/getReplyList",payload:Object(L.a)({},Ce)});case 3:case"end":return Ln.stop()}},Mt)}))}),kt.praises_count),!kt.liked&&U.a.createElement("span",null,U.a.createElement(ue.a,{className:"mr5 ml30",onClick:Object(C.a)(_.a.mark(function Mt(){return _.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:return Ln.next=2,Te({type:"graduation/replyLike",payload:{object_id:kt.id,object_type:"message"}});case 2:Te({type:"graduation/getReplyList",payload:Object(L.a)({},Ce)});case 3:case"end":return Ln.stop()}},Mt)}))}),kt.praises_count))))))}))),U.a.createElement("aside",{className:"tc mt30 pb30"},U.a.createElement(r.a,{defaultCurrent:1,total:_t==null?void 0:_t.total_count,hideOnSinglePage:!0,current:Ce.page||1,onChange:function(Xe){Ce.page=Xe,Te({type:"graduation/getReplyList",payload:Object(L.a)({},Ce)})}})),U.a.createElement(B,null))},De=Object(b.a)(function(pt){var nt=pt.graduation,at=pt.classroomList,bt=pt.loading,Et=pt.globalSetting;return{graduation:nt,globalSetting:Et,classroomList:at,loading:bt.effects}})(Ae),Fe=Q("g9YV"),Ne=Q("wCAj"),Ee=Q("y8nQ"),se=Q("Vl3Y"),He=Q("PpiC"),ft=function(nt){var at=nt.graduation,bt=nt.dispatch,Et=Object(He.a)(nt,["graduation","dispatch"]),Re=Object(k.i)();return U.a.createElement(W.a,{centered:!0,title:"\u63D0\u793A",visible:at.actionTabs.key==="\u62D2\u7EDD",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(C.a)(_.a.mark(function Te(){var Ke;return _.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,bt({type:"graduation/refuseTopic",payload:Object(L.a)({student_graduation_topic:at.actionTabs.selectArrs.id},Re)});case 2:Ke=Ce.sent,Ke.status===0&&(E.b.success("\u62D2\u7EDD\u6210\u529F"),bt({type:"graduation/setActionTabs",payload:{}}),bt({type:"graduation/getTopisDetailList",payload:Object(L.a)({},at.actionTabs.params)}));case 4:case"end":return Ce.stop()}},Te)})),onCancel:function(){bt({type:"graduation/setActionTabs",payload:{}})}},U.a.createElement("p",null,"\u662F\u5426\u786E\u8BA4\u62D2\u7EDD\u5B66\u751F\u9009\u9898?"))},lt=Object(b.a)(function(pt){var nt=pt.graduation;return{graduation:nt}})(ft),it=Q("OaEy"),ct=Q("2fM7"),Ve=function(nt){var at,bt=nt.graduation,Et=nt.dispatch,Re=Object(He.a)(nt,["graduation","dispatch"]),Te=Object(k.i)(),Ke=bt.detailList,ze=se.a.useForm(),Ce=Object(M.a)(ze,1),We=Ce[0];return U.a.createElement(W.a,{centered:!0,title:"\u540C\u610F\u9009\u9898",visible:bt.actionTabs.key==="\u540C\u610F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(C.a)(_.a.mark(function ve(){var ce,he,ne;return _.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,We.validateFields();case 2:return he=We.getFieldsValue(),le.next=5,Et({type:"graduation/agreeTopic",payload:Object(L.a)({group_id:he.group_id,course_group_name:Ke==null||((ce=Ke.group_list)===null||ce===void 0)?void 0:ce.filter(function(pe){return pe.group_id==he.group_id})[0].group_name,student_graduation_topic:bt.actionTabs.selectArrs.id},Te)});case 5:ne=le.sent,ne.status===0&&(E.b.success("\u540C\u610F\u6210\u529F"),Et({type:"graduation/setActionTabs",payload:{}}),Et({type:"graduation/getTopisDetailList",payload:Object(L.a)({},bt.actionTabs.params)}));case 7:case"end":return le.stop()}},ve)})),onCancel:function(){Et({type:"graduation/setActionTabs",payload:{}})}},U.a.createElement("p",null,"\u786E\u8BA4\u540C\u610F\u5B66\u751F\u7684\u9009\u9898\uFF0C\u5C06\u5B66\u751F\u52A0\u5165\u6211\u7684\u5206\u73ED"),U.a.createElement(se.a,{form:We},U.a.createElement(se.a.Item,{name:"group_id",label:"\u9009\u62E9\uFF1A",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5206\u73ED"}]},U.a.createElement(ct.a,{placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED",size:"large"},Ke==null||((at=Ke.group_list)===null||at===void 0)?void 0:at.map(function(ve,ce){return U.a.createElement(ct.a.Option,{value:ve.group_id},ve.group_name)})))))},Je=Object(b.a)(function(pt){var nt=pt.graduation;return{graduation:nt}})(Ve),st=function(nt){var at=nt.graduation,bt=nt.loading,Et=nt.dispatch,Re=Object(H.useState)(Object(L.a)({},Object(k.i)())),Te=Object(M.a)(Re,2),Ke=Te[0],ze=Te[1],Ce=Object(k.h)(),We=at.detailList,ve=Object(H.useState)({}),ce=Object(M.a)(ve,2),he=ce[0],ne=ce[1],oe=se.a.useForm(),le=Object(M.a)(oe,1),pe=le[0],ge=function(rt,vt){Ke.page=rt,Ke.limit=20,Et({type:"graduation/getTopisDetailList",payload:Object(L.a)({},Ke)})},Pe=[{title:"\u5E8F\u53F7",dataIndex:"name",width:200,align:"center",render:function(rt,vt,tt){return tt+1}},{title:"\u59D3\u540D",dataIndex:"student_name"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u5206\u73ED",dataIndex:"class_group_name"},{title:"\u9009\u9898\u65F6\u95F4",dataIndex:"selected_time"},{title:"\u786E\u8BA4\u7ED3\u679C",dataIndex:"result",render:function(rt){return rt==="\u5DF2\u62D2\u7EDD"?U.a.createElement("span",{className:"c-orange"},"\u5DF2\u62D2\u7EDD"):rt}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(rt,vt){return U.a.createElement("div",null,(vt.result==="\u5F85\u786E\u8BA4"||vt.result==="\u5DF2\u540C\u610F")&&U.a.createElement("span",{className:"current",onClick:function(){Et({type:"graduation/setActionTabs",payload:{key:"\u62D2\u7EDD",selectArrs:vt,params:Ke}})}},"\u62D2\u7EDD"),vt.result==="\u5F85\u786E\u8BA4"&&U.a.createElement("span",{className:"current ml20 c-blue",onClick:function(){Et({type:"graduation/setActionTabs",payload:{key:"\u540C\u610F",selectArrs:vt,params:Ke}})}},"\u540C\u610F"))}}];return U.a.createElement(U.a.Fragment,null,U.a.createElement("section",{className:"minH500 bg-white "},U.a.createElement(Ne.a,{loading:bt["graduation/getTopisDetailList"],pagination:!1,dataSource:We.users_list,columns:Pe}),U.a.createElement(lt,null),U.a.createElement(Je,null)),U.a.createElement("aside",{className:"tc mb50 mt30"},U.a.createElement(r.a,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:ge,defaultCurrent:Ke.page||1,current:Ke.page||1,defaultPageSize:15,total:at.users_count})))},gt=Object(b.a)(function(pt){var nt=pt.graduation,at=pt.loading;return{graduation:nt,loading:at.effects}})(st),ut=Q("ep+k"),et=Q.n(ut),qe=function(nt){var at=nt.graduation,bt=nt.globalSetting,Et=nt.loading,Re=nt.dispatch,Te=Object(k.i)(),Ke=Object(k.h)(),ze=Object(H.useState)([]),Ce=Object(M.a)(ze,2),We=Ce[0],ve=Ce[1],ce=Object(H.useState)(Ke.query.tabs||0),he=Object(M.a)(ce,2),ne=he[0],oe=he[1],le=at.detailList,pe;Te.category=Ke.query.category_id,Object(H.useEffect)(function(){Re({type:"graduation/getTopisDetailList",payload:Object(L.a)({},Te)})},[Te.coursesId]);var ge=[{name:"\u9009\u9898\u5217\u8868",id:0,compontent:U.a.createElement(gt,null)},{name:"\u9009\u9898\u63CF\u8FF0",id:1,compontent:U.a.createElement(De,null)}];return U.a.createElement("section",null,U.a.createElement("div",{className:"edu-container"},le.course_name&&U.a.createElement("section",{className:"animated fadeIn"},U.a.createElement("aside",{className:"mt10"},U.a.createElement(V.a,{separator:">"},U.a.createElement(V.a.Item,null,U.a.createElement(I.a,{to:"/classrooms/".concat(le.course_id,"/shixun_homework")},le.course_name)),U.a.createElement(V.a.Item,null,U.a.createElement(I.a,{to:"/classrooms/".concat(le.course_id,"/graduation_topics/").concat(le.graduation_id)},"\u6BD5\u8BBE\u9009\u9898")),U.a.createElement(V.a.Item,null,"\u9009\u9898\u8BE6\u60C5"))),U.a.createElement("aside",{className:[et.a.title,"mt20"].join(" ")},U.a.createElement(I.a,{to:"/classrooms/".concat(le.course_id,"/graduation_topics/").concat(le.graduation_id)},U.a.createElement(y.a,{className:"font16 c-black"})),U.a.createElement("strong",{className:"font20 ml5"},le.graduation_topic_name),U.a.createElement(p.m,{status:[le.status_name]}))),U.a.createElement("aside",{className:"mt30 relative"},U.a.createElement("aside",{className:et.a.rightMenu},U.a.createElement(I.a,{className:et.a.shixunDetail,to:"/classrooms/".concat(Te.coursesId,"/graduation_topics/").concat(Te.categoryId,"/edit")},U.a.createElement("span",{className:"iconfont icon-shixunxiangqing"}),"\u7F16\u8F91\u9009\u9898")),U.a.createElement(X.a,{defaultActiveKey:ne,className:et.a.menuTabs},ge.map(function(Pe,Ge){return U.a.createElement(X.a.TabPane,{tab:Pe.name,key:Pe.id},Pe.compontent)})))))},St=$e.default=Object(b.a)(function(pt){var nt=pt.graduation,at=pt.loading,bt=pt.globalSetting;return{graduation:nt,globalSetting:bt,loading:at.effects}})(qe)},bT9E:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return X});var ae=Q("VTBJ");function X(P,V){var L=Object(ae.a)({},P);return Array.isArray(V)&&V.forEach(function(M){delete L[M]}),L}},biw7:function(Rt,$e,Q){"use strict";var ae=Q("q1tI"),X=Q.n(ae),P=ae.createContext(null);$e.a=P},c5Ni:function(Rt,$e,Q){},dejd:function(Rt,$e,Q){},dmUQ:function(Rt,$e,Q){"use strict";var ae=Q("Ff2n"),X=Q("rePB"),P=Q("1OyB"),V=Q("vuIU"),L=Q("Ji7U"),M=Q("md7G"),H=Q("foSv"),U=Q("q1tI"),k=Q.n(U),I=Q("TSYQ"),b=Q.n(I),y=Q("4IlW");function p(h,o){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(h);o&&(m=m.filter(function(T){return Object.getOwnPropertyDescriptor(h,T).enumerable})),_.push.apply(_,m)}return _}function c(h){for(var o=1;o<arguments.length;o++){var _=arguments[o]!=null?arguments[o]:{};o%2?p(Object(_),!0).forEach(function(m){Object(X.a)(h,m,_[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(_)):p(Object(_)).forEach(function(m){Object.defineProperty(h,m,Object.getOwnPropertyDescriptor(_,m))})}return h}function r(h){var o=l();return function(){var m=Object(H.a)(h),T;if(o){var N=Object(H.a)(this).constructor;T=Reflect.construct(m,arguments,N)}else T=m.apply(this,arguments);return Object(M.a)(this,T)}}function l(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(h){return!1}}function u(){}function a(h){h.preventDefault()}var s=function(o){return o.replace(/[^\w.-]+/g,"")},f=200,O=600,S=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,E=function(o){return o!=null},C=function(o,_){return _===o||typeof _=="number"&&typeof o=="number"&&isNaN(_)&&isNaN(o)},w=function(h){Object(L.a)(_,h);var o=r(_);function _(m){var T;Object(P.a)(this,_),T=o.call(this,m),T.onKeyDown=function(W){var Y=T.props,B=Y.onKeyDown,R=Y.onPressEnter;if(W.keyCode===y.a.UP){var $=T.getRatio(W);T.up(W,$,null),T.stop()}else if(W.keyCode===y.a.DOWN){var te=T.getRatio(W);T.down(W,te,null),T.stop()}else W.keyCode===y.a.ENTER&&R&&R(W);if(T.recordCursorPosition(),T.lastKeyCode=W.keyCode,B){for(var ue=arguments.length,me=new Array(ue>1?ue-1:0),Me=1;Me<ue;Me++)me[Me-1]=arguments[Me];B.apply(void 0,[W].concat(me))}},T.onKeyUp=function(W){var Y=T.props.onKeyUp;if(T.stop(),T.recordCursorPosition(),Y){for(var B=arguments.length,R=new Array(B>1?B-1:0),$=1;$<B;$++)R[$-1]=arguments[$];Y.apply(void 0,[W].concat(R))}},T.onChange=function(W){var Y=T.props.onChange;T.state.focused&&(T.inputting=!0),T.rawInput=T.props.parser(T.getValueFromEvent(W)),T.setState({inputValue:T.rawInput}),Y(T.toNumber(T.rawInput))},T.onMouseUp=function(){var W=T.props.onMouseUp;T.recordCursorPosition(),W&&W.apply(void 0,arguments)},T.onFocus=function(){var W;T.setState({focused:!0}),(W=T.props).onFocus.apply(W,arguments)},T.onBlur=function(){var W=T.props.onBlur;T.inputting=!1,T.setState({focused:!1});var Y=T.getCurrentValidValue(T.state.inputValue),B=T.setValue(Y,u);if(W){var R=T.input.value,$=T.getInputDisplayValue({focus:!1,value:B});T.input.value=$&&Number($),W.apply(void 0,arguments),T.input.value=R}},T.getRatio=function(W){var Y=1;return W.metaKey||W.ctrlKey?Y=.1:W.shiftKey&&(Y=10),Y},T.getFullNum=function(W){return isNaN(W)?W:/e/i.test(String(W))?Number(W).toFixed(18).replace(/\.?0+$/,""):W},T.getPrecision=function(W){if(E(T.props.precision))return T.props.precision;var Y=String(W);if(Y.indexOf("e-")>=0)return parseInt(Y.slice(Y.indexOf("e-")+2),10);var B=0;return Y.indexOf(".")>=0&&(B=Y.length-Y.indexOf(".")-1),B},T.getInputDisplayValue=function(W){var Y=W||T.state,B=Y.focused,R=Y.inputValue,$=Y.value,te;B?te=R:te=T.toPrecisionAsStep($),te==null&&(te="");var ue=T.formatWrapper(te);return E(T.props.decimalSeparator)&&(ue=ue.toString().replace(".",T.props.decimalSeparator)),ue},T.recordCursorPosition=function(){try{T.cursorStart=T.input.selectionStart,T.cursorEnd=T.input.selectionEnd,T.currentValue=T.input.value,T.cursorBefore=T.input.value.substring(0,T.cursorStart),T.cursorAfter=T.input.value.substring(T.cursorEnd)}catch(W){}},T.restoreByAfter=function(W){if(W===void 0)return!1;var Y=T.input.value,B=Y.lastIndexOf(W);if(B===-1)return!1;var R=T.cursorBefore.length;return T.lastKeyCode===y.a.DELETE&&T.cursorBefore.charAt(R-1)===W[0]?(T.fixCaret(R,R),!0):B+W.length===Y.length?(T.fixCaret(B,B),!0):!1},T.partRestoreByAfter=function(W){return W===void 0?!1:Array.prototype.some.call(W,function(Y,B){var R=W.substring(B);return T.restoreByAfter(R)})},T.isNotCompleteNumber=function(W){return isNaN(W)||W===""||W===null||W&&W.toString().indexOf(".")===W.toString().length-1},T.stop=function(){T.autoStepTimer&&clearTimeout(T.autoStepTimer)},T.down=function(W,Y,B){T.pressingUpOrDown=!0,T.step("down",W,Y,B)},T.up=function(W,Y,B){T.pressingUpOrDown=!0,T.step("up",W,Y,B)},T.saveInput=function(W){T.input=W};var N=m.value;N===void 0&&(N=m.defaultValue),T.state={focused:m.autoFocus};var j=T.getValidValue(T.toNumber(N));return T.state=c(c({},T.state),{},{inputValue:T.toPrecisionAsStep(j),value:j}),T}return Object(V.a)(_,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(T){var N=this.props,j=N.value,W=N.onChange,Y=N.max,B=N.min,R=this.state.focused;if(T){if(!C(T.value,j)||!C(T.max,Y)||!C(T.min,B)){var $=R?j:this.getValidValue(j),te;this.pressingUpOrDown?te=$:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep($),this.setState({value:$,inputValue:te})}var ue="value"in this.props?j:this.state.value;"max"in this.props&&T.max!==Y&&typeof ue=="number"&&ue>Y&&W&&W(Y),"min"in this.props&&T.min!==B&&typeof ue=="number"&&ue<B&&W&&W(B)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var me=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===y.a.BACKSPACE?me=this.cursorStart-1:this.lastKeyCode===y.a.DELETE&&(me=this.cursorStart):me=this.input.value.length,this.fixCaret(me,me)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case y.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case y.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Me){}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(T){var N=T;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(T){var N=T.target.value.trim().replace(/。/g,".");return E(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(T){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,W=parseFloat(T);return isNaN(W)?T:(W<N&&(W=N),W>j&&(W=j),W)}},{key:"setValue",value:function(T,N){var j=this.props.precision,W=this.isNotCompleteNumber(parseFloat(T))?null:parseFloat(T),Y=this.state.value,B=Y===void 0?null:Y,R=this.state.inputValue,$=R===void 0?null:R,te=typeof W=="number"?W.toFixed(j):"".concat(W),ue=W!==B||te!=="".concat($);return"value"in this.props?($=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:$},N)):this.setState({value:W,inputValue:this.toPrecisionAsStep(T)},N),ue&&this.props.onChange(W),W}},{key:"getMaxPrecision",value:function(T){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,W=j.precision,Y=j.step;if(E(W))return W;var B=this.getPrecision(N),R=this.getPrecision(Y),$=this.getPrecision(T);return T?Math.max($,B+R):B+R}},{key:"getPrecisionFactor",value:function(T){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(T,N);return Math.pow(10,j)}},{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(T){return this.props.formatter?this.props.formatter(T):T}},{key:"toPrecisionAsStep",value:function(T){if(this.isNotCompleteNumber(T)||T==="")return T;var N=Math.abs(this.getMaxPrecision(T));return isNaN(N)?T.toString():Number(T).toFixed(N)}},{key:"toNumber",value:function(T){var N=this.props.precision,j=this.state.focused,W=T&&T.length>16&&j;return this.isNotCompleteNumber(T)||W?T:E(N)?Math.round(T*Math.pow(10,N))/Math.pow(10,N):Number(T)}},{key:"upStep",value:function(T,N){var j=this.props.step,W=this.getPrecisionFactor(T,N),Y=Math.abs(this.getMaxPrecision(T,N)),B=((W*T+W*j*N)/W).toFixed(Y);return this.toNumber(B)}},{key:"downStep",value:function(T,N){var j=this.props.step,W=this.getPrecisionFactor(T,N),Y=Math.abs(this.getMaxPrecision(T,N)),B=((W*T-W*j*N)/W).toFixed(Y);return this.toNumber(B)}},{key:"step",value:function(T,N){var j=this,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Y=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var B=this.props;if(B.disabled)return;var R=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(R))return;var $=this["".concat(T,"Step")](R,W),te=$>B.max||$<B.min;if($>B.max?$=B.max:$<B.min&&($=B.min),this.setValue($,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),te)return;this.autoStepTimer=setTimeout(function(){j[T](N,W,!0)},Y?f:O)}},{key:"fixCaret",value:function(T,N){if(T===void 0||N===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,W=this.input.selectionEnd;(T!==j||N!==W)&&this.input.setSelectionRange(T,N)}catch(Y){}}},{key:"render",value:function(){var T,N=this.props,j=N.prefixCls,W=N.disabled,Y=N.readOnly,B=N.useTouch,R=N.autoComplete,$=N.upHandler,te=N.downHandler,ue=N.className,me=N.max,Me=N.min,Ae=N.style,De=N.title,Fe=N.onMouseEnter,Ne=N.onMouseLeave,Ee=N.onMouseOver,se=N.onMouseOut,He=N.required,ft=N.onClick,lt=N.tabIndex,it=N.type,ct=N.placeholder,Ve=N.id,Je=N.inputMode,st=N.pattern,gt=N.step,ut=N.maxLength,et=N.autoFocus,qe=N.name,St=N.onPaste,pt=N.onInput,nt=Object(ae.a)(N,["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"]),at=this.state,bt=at.value,Et=at.focused,Re=b()(j,(T={},Object(X.a)(T,ue,!!ue),Object(X.a)(T,"".concat(j,"-disabled"),W),Object(X.a)(T,"".concat(j,"-focused"),Et),T)),Te={};Object.keys(nt).forEach(function(pe){(pe.substr(0,5)==="data-"||pe.substr(0,5)==="aria-"||pe==="role")&&(Te[pe]=nt[pe])});var Ke=!Y&&!W,ze=this.getInputDisplayValue(null),Ce=(bt||bt===0)&&(isNaN(bt)||Number(bt)>=me),We=(bt||bt===0)&&(isNaN(bt)||Number(bt)<=Me),ve=Ce||W||Y,ce=We||W||Y,he=b()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(X.a)({},"".concat(j,"-handler-up-disabled"),ve)),ne=b()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(X.a)({},"".concat(j,"-handler-down-disabled"),ce)),oe=B?{onTouchStart:ve?u:this.up,onTouchEnd:this.stop}:{onMouseDown:ve?u:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},le=B?{onTouchStart:ce?u:this.down,onTouchEnd:this.stop}:{onMouseDown:ce?u:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:Re,style:Ae,title:De,onMouseEnter:Fe,onMouseLeave:Ne,onMouseOver:Ee,onMouseOut:se,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(j,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":ve,className:he}),$||k.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:a})),k.a.createElement("span",Object.assign({unselectable:"on"},le,{role:"button","aria-label":"Decrease Value","aria-disabled":ce,className:ne}),te||k.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:a}))),k.a.createElement("div",{className:"".concat(j,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Me,"aria-valuemax":me,"aria-valuenow":bt,required:He,type:it,placeholder:ct,onPaste:St,onClick:ft,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:lt,autoComplete:R,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ke?this.onKeyDown:u,onKeyUp:Ke?this.onKeyUp:u,autoFocus:et,maxLength:ut,readOnly:Y,disabled:W,max:me,min:Me,step:gt,name:qe,title:De,id:Ve,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ze),pattern:st,inputMode:Je,onInput:pt},Te))))}}]),_}(k.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:S,min:-S,step:1,style:{},onChange:u,onKeyDown:u,onPressEnter:u,onFocus:u,onBlur:u,parser:s,required:!1,autoComplete:"off"};var g=w,v=$e.a=g},"ep+k":function(Rt,$e,Q){Rt.exports={flex_box_center:"flex_box_center___26l9y",flex_space_between:"flex_space_between___3i4Hr",flex_box_vertical_center:"flex_box_vertical_center___3sZts",flex_box_center_end:"flex_box_center_end___3Rb0T",flex_box_column:"flex_box_column___3SYGi",title:"title___1gx-a",menuTabs:"menuTabs___3PSXg",rightMenu:"rightMenu___rsd7-",shixunDetail:"shixunDetail___1dxCB"}},fyJ8:function(Rt,$e,Q){"use strict";var ae=Q("rePB"),X=Q("VTBJ"),P=Q("Ff2n"),V=Q("U8pU"),L=Q("q1tI"),M=Q.n(L),H=Q("TSYQ"),U=Q.n(H),k=Q("c+Xe"),I=Q("sR1s");function b(l){return l&&Object(V.a)(l)==="object"&&!Array.isArray(l)&&!L.isValidElement(l)}function y(l){return typeof l=="string"?!0:Object(k.c)(l)}function p(l,u){var a,s=l.prefixCls,f=l.className,O=l.record,S=l.index,E=l.dataIndex,C=l.render,w=l.children,g=l.component,v=g===void 0?"td":g,h=l.colSpan,o=l.rowSpan,_=l.fixLeft,m=l.fixRight,T=l.firstFixLeft,N=l.lastFixLeft,j=l.firstFixRight,W=l.lastFixRight,Y=l.appendNode,B=l.additionalProps,R=B===void 0?{}:B,$=l.ellipsis,te=l.align,ue=l.rowType,me=l.isSticky,Me="".concat(s,"-cell"),Ae,De;if(w)De=w;else{var Fe=Object(I.b)(O,E);if(De=Fe,C){var Ne=C(Fe,O,S);b(Ne)?(De=Ne.children,Ae=Ne.props):De=Ne}}Object(V.a)(De)==="object"&&!Array.isArray(De)&&!L.isValidElement(De)&&(De=null),$&&(N||j)&&(De=L.createElement("span",{className:"".concat(Me,"-content")},De));var Ee=Ae||{},se=Ee.colSpan,He=Ee.rowSpan,ft=Ee.style,lt=Ee.className,it=Object(P.a)(Ee,["colSpan","rowSpan","style","className"]),ct=se!==void 0?se:h,Ve=He!==void 0?He:o;if(ct===0||Ve===0)return null;var Je={},st=typeof _=="number",gt=typeof m=="number";st&&(Je.position="sticky",Je.left=_),gt&&(Je.position="sticky",Je.right=m);var ut={};te&&(ut.textAlign=te);var et,qe=$===!0?{showTitle:!0}:$;qe&&(qe.showTitle||ue==="header")&&(typeof De=="string"||typeof De=="number"?et=De.toString():L.isValidElement(De)&&typeof De.props.children=="string"&&(et=De.props.children));var St=Object(X.a)(Object(X.a)(Object(X.a)({title:et},it),R),{},{colSpan:ct&&ct!==1?ct:null,rowSpan:Ve&&Ve!==1?Ve:null,className:U()(Me,f,(a={},Object(ae.a)(a,"".concat(Me,"-fix-left"),st),Object(ae.a)(a,"".concat(Me,"-fix-left-first"),T),Object(ae.a)(a,"".concat(Me,"-fix-left-last"),N),Object(ae.a)(a,"".concat(Me,"-fix-right"),gt),Object(ae.a)(a,"".concat(Me,"-fix-right-first"),j),Object(ae.a)(a,"".concat(Me,"-fix-right-last"),W),Object(ae.a)(a,"".concat(Me,"-ellipsis"),$),Object(ae.a)(a,"".concat(Me,"-with-append"),Y),Object(ae.a)(a,"".concat(Me,"-fix-sticky"),(st||gt)&&me),a),R.className,lt),style:Object(X.a)(Object(X.a)(Object(X.a)(Object(X.a)({},R.style),ut),Je),ft),ref:y(v)?u:null});return L.createElement(v,Object.assign({},St),Y,De)}var c=L.forwardRef(p);c.displayName="Cell";var r=L.memo(c,function(l,u){return u.shouldCellUpdate?!u.shouldCellUpdate(u.record,l.record):!1});$e.a=r},hW8S:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return V}),Q.d($e,"c",function(){return L}),Q.d($e,"b",function(){return M});var ae=Q("VTBJ"),X=Q("Ff2n"),P=Q("Kwbf"),V="RC_TABLE_INTERNAL_COL_DEFINE";function L(H){var U=H.expandable,k=Object(X.a)(H,["expandable"]);return"expandable"in H?Object(ae.a)(Object(ae.a)({},k),U):k}function M(H){return Object.keys(H).reduce(function(U,k){return(k.substr(0,5)==="data-"||k.substr(0,5)==="aria-")&&(U[k]=H[k]),U},{})}},k3GJ:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return Eo});var ae=Q("rePB"),X=Q("ODXe"),P=Q("Ff2n"),V=Q("VTBJ"),L=Q("q1tI"),M=Q("TSYQ"),H=Q.n(M),U=Q("Zm9Q"),k=Q("6cGi"),I=Q("KQm4"),b=Q("xEkU"),y=Q.n(b),p=Q("t23M");function c(fe){var Oe=Object(L.useRef)(),Ie=Object(L.useRef)(!1);function ye(){for(var ee=arguments.length,de=new Array(ee),re=0;re<ee;re++)de[re]=arguments[re];Ie.current||(y.a.cancel(Oe.current),Oe.current=y()(function(){fe.apply(void 0,de)}))}return Object(L.useEffect)(function(){return function(){Ie.current=!0,y.a.cancel(Oe.current)}},[]),ye}function r(fe){var Oe=Object(L.useRef)([]),Ie=Object(L.useState)({}),ye=Object(X.a)(Ie,2),ee=ye[1],de=Object(L.useRef)(typeof fe=="function"?fe():fe),re=c(function(){var xe=de.current;Oe.current.forEach(function(ke){xe=ke(xe)}),Oe.current=[],de.current=xe,ee({})});function _e(xe){Oe.current.push(xe),re()}return[de.current,_e]}var l=Q("4IlW");function u(fe,Oe){var Ie,ye=fe.prefixCls,ee=fe.id,de=fe.active,re=fe.rtl,_e=fe.tab,xe=_e.key,ke=_e.tab,Le=_e.disabled,je=_e.closeIcon,Ye=fe.tabBarGutter,yt=fe.tabPosition,mt=fe.closable,wt=fe.renderWrapper,en=fe.removeAriaLabel,pn=fe.editable,nn=fe.onClick,un=fe.onRemove,mn=fe.onFocus,fn="".concat(ye,"-tab");L.useEffect(function(){return un},[]);var dn={};yt==="top"||yt==="bottom"?dn[re?"marginLeft":"marginRight"]=Ye:dn.marginBottom=Ye;var On=pn&&mt!==!1&&!Le;function En(Xt){if(Le)return;nn(Xt)}function ei(Xt){Xt.preventDefault(),Xt.stopPropagation(),pn.onEdit("remove",{key:xe,event:Xt})}var xn=L.createElement("div",{key:xe,ref:Oe,className:H()(fn,(Ie={},Object(ae.a)(Ie,"".concat(fn,"-with-remove"),On),Object(ae.a)(Ie,"".concat(fn,"-active"),de),Object(ae.a)(Ie,"".concat(fn,"-disabled"),Le),Ie)),style:dn,onClick:En},L.createElement("div",{role:"tab","aria-selected":de,id:ee&&"".concat(ee,"-tab-").concat(xe),className:"".concat(fn,"-btn"),"aria-controls":ee&&"".concat(ee,"-panel-").concat(xe),"aria-disabled":Le,tabIndex:Le?null:0,onClick:function(Gt){Gt.stopPropagation(),En(Gt)},onKeyDown:function(Gt){[l.a.SPACE,l.a.ENTER].includes(Gt.which)&&(Gt.preventDefault(),En(Gt))},onFocus:mn},ke),On&&L.createElement("button",{type:"button","aria-label":en||"remove",tabIndex:0,className:"".concat(fn,"-remove"),onClick:function(Gt){Gt.stopPropagation(),ei(Gt)}},je||pn.removeIcon||"\xD7"));return wt&&(xn=wt(xn)),xn}var a=L.forwardRef(u),s={width:0,height:0,left:0,top:0};function f(fe,Oe,Ie){return Object(L.useMemo)(function(){for(var ye,ee=new Map,de=Oe.get((ye=fe[0])===null||ye===void 0?void 0:ye.key)||s,re=de.left+de.width,_e=0;_e<fe.length;_e+=1){var xe=fe[_e].key,ke=Oe.get(xe);if(!ke){var Le;ke=Oe.get((Le=fe[_e-1])===null||Le===void 0?void 0:Le.key)||s}var je=ee.get(xe)||Object(V.a)({},ke);je.right=re-je.left-je.width,ee.set(xe,je)}return ee},[fe.map(function(ye){return ye.key}).join("_"),Oe,Ie])}var O={width:0,height:0,left:0,top:0,right:0};function S(fe,Oe,Ie,ye,ee){var de=ee.tabs,re=ee.tabPosition,_e=ee.rtl,xe,ke,Le;["top","bottom"].includes(re)?(xe="width",ke=_e?"right":"left",Le=Math.abs(Oe.left)):(xe="height",ke="top",Le=-Oe.top);var je=Oe[xe],Ye=Ie[xe],yt=ye[xe],mt=je;return Ye+yt>je&&(mt=je-yt),Object(L.useMemo)(function(){if(!de.length)return[0,0];for(var wt=de.length,en=wt,pn=0;pn<wt;pn+=1){var nn=fe.get(de[pn].key)||O;if(nn[ke]+nn[xe]>Le+mt){en=pn-1;break}}for(var un=0,mn=wt-1;mn>=0;mn-=1){var fn=fe.get(de[mn].key)||O;if(fn[ke]<Le){un=mn+1;break}}return[un,en]},[fe,Le,mt,re,de.map(function(wt){return wt.key}).join("_"),_e])}var E=Q("wx14"),C=Q("1OyB"),w=Q("vuIU"),g=Q("JX7q"),v=Q("Ji7U"),h=Q("LK+K"),o=Q("I8Z2"),_=Q("bT9E"),m=Q("2GS6"),T=Q("Gytx"),N=Q.n(T),j=Q("U8pU"),W=/iPhone/i,Y=/iPod/i,B=/iPad/i,R=/\bAndroid(?:.+)Mobile\b/i,$=/Android/i,te=/\bAndroid(?:.+)SD4930UR\b/i,ue=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,me=/Windows Phone/i,Me=/\bWindows(?:.+)ARM\b/i,Ae=/BlackBerry/i,De=/BB10/i,Fe=/Opera Mini/i,Ne=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ee=/Mobile(?:.+)Firefox\b/i;function se(fe,Oe){return fe.test(Oe)}function He(fe){var Oe=fe||(typeof navigator!="undefined"?navigator.userAgent:""),Ie=(Oe||"").split("[FBAN");if(typeof Ie[1]!="undefined"){var ye=Ie,ee=Object(X.a)(ye,1);Oe=ee[0]}if(Ie=Oe.split("Twitter"),typeof Ie[1]!="undefined"){var de=Ie,re=Object(X.a)(de,1);Oe=re[0]}var _e={apple:{phone:se(W,Oe)&&!se(me,Oe),ipod:se(Y,Oe),tablet:!se(W,Oe)&&se(B,Oe)&&!se(me,Oe),device:(se(W,Oe)||se(Y,Oe)||se(B,Oe))&&!se(me,Oe)},amazon:{phone:se(te,Oe),tablet:!se(te,Oe)&&se(ue,Oe),device:se(te,Oe)||se(ue,Oe)},android:{phone:!se(me,Oe)&&se(te,Oe)||!se(me,Oe)&&se(R,Oe),tablet:!se(me,Oe)&&!se(te,Oe)&&!se(R,Oe)&&(se(ue,Oe)||se($,Oe)),device:!se(me,Oe)&&(se(te,Oe)||se(ue,Oe)||se(R,Oe)||se($,Oe))||se(/\bokhttp\b/i,Oe)},windows:{phone:se(me,Oe),tablet:se(Me,Oe),device:se(me,Oe)||se(Me,Oe)},other:{blackberry:se(Ae,Oe),blackberry10:se(De,Oe),opera:se(Fe,Oe),firefox:se(Ee,Oe),chrome:se(Ne,Oe),device:se(Ae,Oe)||se(De,Oe)||se(Fe,Oe)||se(Ee,Oe)||se(Ne,Oe)},any:null,phone:null,tablet:null};return _e.any=_e.apple.device||_e.android.device||_e.windows.device||_e.other.device,_e.phone=_e.apple.phone||_e.android.phone||_e.windows.phone,_e.tablet=_e.apple.tablet||_e.android.tablet||_e.windows.tablet,_e}var ft=Object(V.a)(Object(V.a)({},He()),{},{isMobile:He}),lt=ft;function it(){}function ct(fe,Oe,Ie){var ye=Oe||"";return fe.key||"".concat(ye,"item_").concat(Ie)}function Ve(fe){return"".concat(fe,"-menu-")}function Je(fe,Oe){var Ie=-1;L.Children.forEach(fe,function(ye){Ie+=1,ye&&ye.type&&ye.type.isMenuItemGroup?L.Children.forEach(ye.props.children,function(ee){Ie+=1,Oe(ee,Ie)}):Oe(ye,Ie)})}function st(fe,Oe,Ie){if(!fe||Ie.find)return;L.Children.forEach(fe,function(ye){if(ye){var ee=ye.type;if(!ee||!(ee.isSubMenu||ee.isMenuItem||ee.isMenuItemGroup))return;Oe.indexOf(ye.key)!==-1?Ie.find=!0:ye.props.children&&st(ye.props.children,Oe,Ie)}})}var gt=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],ut=function(Oe){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ye=Oe&&typeof Oe.getBoundingClientRect=="function"&&Oe.getBoundingClientRect().width;if(ye){if(Ie){var ee=getComputedStyle(Oe),de=ee.marginLeft,re=ee.marginRight;ye+=+de.replace("px","")+ +re.replace("px","")}ye=+ye.toFixed(6)}return ye||0},et=function(Oe,Ie,ye){Oe&&Object(j.a)(Oe.style)==="object"&&(Oe.style[Ie]=ye)},qe=function(){return lt.any},St=Q("bdgK"),pt=Q("i8i4"),nt=Q.n(pt),at=Q("wgJM"),bt=Q("l4aY"),Et=Q("m+aA"),Re=Q("c+Xe"),Te=Q("zT1h"),Ke=Q("QC+M");function ze(fe,Oe,Ie){return Ie?fe[0]===Oe[0]:fe[0]===Oe[0]&&fe[1]===Oe[1]}function Ce(fe,Oe,Ie){var ye=fe[Oe]||{};return Object(V.a)(Object(V.a)({},ye),Ie)}function We(fe,Oe,Ie,ye){for(var ee=Ie.points,de=Object.keys(fe),re=0;re<de.length;re+=1){var _e=de[re];if(ze(fe[_e].points,ee,ye))return"".concat(Oe,"-placement-").concat(_e)}return""}var ve=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var fe=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(fe)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(fe==null?void 0:fe.substr(0,4)))},ce=Q("MNnm");function he(fe,Oe){var Ie={};return Ie[fe.toLowerCase()]=Oe.toLowerCase(),Ie["Webkit".concat(fe)]="webkit".concat(Oe),Ie["Moz".concat(fe)]="moz".concat(Oe),Ie["ms".concat(fe)]="MS".concat(Oe),Ie["O".concat(fe)]="o".concat(Oe.toLowerCase()),Ie}function ne(fe,Oe){var Ie={animationend:he("Animation","AnimationEnd"),transitionend:he("Transition","TransitionEnd")};return fe&&("AnimationEvent"in Oe||delete Ie.animationend.animation,"TransitionEvent"in Oe||delete Ie.transitionend.transition),Ie}var oe=ne(Object(ce.a)(),typeof window!="undefined"?window:{}),le={};if(Object(ce.a)()){var pe=document.createElement("div");le=pe.style}var ge={};function Pe(fe){if(ge[fe])return ge[fe];var Oe=oe[fe];if(Oe)for(var Ie=Object.keys(Oe),ye=Ie.length,ee=0;ee<ye;ee+=1){var de=Ie[ee];if(Object.prototype.hasOwnProperty.call(Oe,de)&&de in le)return ge[fe]=Oe[de],ge[fe]}return""}var Ge=Pe("animationend"),rt=Pe("transitionend"),vt=!!(Ge&&rt),tt=Ge||"animationend",Wt=rt||"transitionend";function Nt(fe,Oe){if(!fe)return null;if(Object(j.a)(fe)==="object"){var Ie=Oe.replace(/-\w/g,function(ye){return ye[1].toUpperCase()});return fe[Ie]}return"".concat(fe,"-").concat(Oe)}var _t="none",Qt="appear",Jt="enter",Yt="leave",cn="none",jt="prepare",rn="start",kt="active",Xe="end";function Lt(fe){var Oe=Object(L.useRef)(!1),Ie=Object(L.useState)(fe),ye=Object(X.a)(Ie,2),ee=ye[0],de=ye[1];function re(_e){Oe.current||de(_e)}return Object(L.useEffect)(function(){return function(){Oe.current=!0}},[]),[ee,re]}var Ut=Object(ce.a)()?L.useLayoutEffect:L.useEffect,Mt=Ut,Zt=function(){var fe=L.useRef(null);function Oe(){at.a.cancel(fe.current)}function Ie(ye){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Oe();var de=Object(at.a)(function(){ee<=1?ye({isCanceled:function(){return de!==fe.current}}):Ie(ye,ee-1)});fe.current=de}return L.useEffect(function(){return function(){Oe()}},[]),[Ie,Oe]},Ln=[jt,rn,kt,Xe],Ni=!1,vn=!0;function At(fe){return fe===kt||fe===Xe}var li=function(fe,Oe){var Ie=L.useState(cn),ye=Object(X.a)(Ie,2),ee=ye[0],de=ye[1],re=Zt(),_e=Object(X.a)(re,2),xe=_e[0],ke=_e[1];function Le(){de(jt)}return Mt(function(){if(ee!==cn&&ee!==Xe){var je=Ln.indexOf(ee),Ye=Ln[je+1],yt=Oe(ee);yt===Ni?de(Ye):xe(function(mt){function wt(){if(mt.isCanceled())return;de(Ye)}yt===!0?wt():Promise.resolve(yt).then(wt)})}},[fe,ee]),L.useEffect(function(){return function(){ke()}},[]),[Le,ee]},Li=function(fe){var Oe=Object(L.useRef)(),Ie=Object(L.useRef)(fe);Ie.current=fe;var ye=L.useCallback(function(re){Ie.current(re)},[]);function ee(re){re&&(re.removeEventListener(Wt,ye),re.removeEventListener(tt,ye))}function de(re){Oe.current&&Oe.current!==re&&ee(Oe.current),re&&re!==Oe.current&&(re.addEventListener(Wt,ye),re.addEventListener(tt,ye),Oe.current=re)}return L.useEffect(function(){return function(){ee(Oe.current)}},[]),[de,ee]};function Zn(fe,Oe,Ie,ye){var ee=ye.motionEnter,de=ee===void 0?!0:ee,re=ye.motionAppear,_e=re===void 0?!0:re,xe=ye.motionLeave,ke=xe===void 0?!0:xe,Le=ye.motionDeadline,je=ye.motionLeaveImmediately,Ye=ye.onAppearPrepare,yt=ye.onEnterPrepare,mt=ye.onLeavePrepare,wt=ye.onAppearStart,en=ye.onEnterStart,pn=ye.onLeaveStart,nn=ye.onAppearActive,un=ye.onEnterActive,mn=ye.onLeaveActive,fn=ye.onAppearEnd,dn=ye.onEnterEnd,On=ye.onLeaveEnd,En=ye.onVisibleChanged,ei=Lt(),xn=Object(X.a)(ei,2),Xt=xn[0],Gt=xn[1],wn=Lt(_t),Rn=Object(X.a)(wn,2),Bt=Rn[0],An=Rn[1],ti=Lt(null),Mn=Object(X.a)(ti,2),Kn=Mn[0],Bn=Mn[1],ci=Object(L.useRef)(!1),wi=Object(L.useRef)(null),ri=Object(L.useRef)(!1),Vi=Object(L.useRef)(null);function br(){var Yn=Ie();return Yn||Vi.current}var Zi=Object(L.useRef)(!1);function Si(Yn){var Fn=br();if(Yn&&!Yn.deadline&&Yn.target!==Fn)return;var Ci;Bt===Qt&&Zi.current?Ci=fn==null?void 0:fn(Fn,Yn):Bt===Jt&&Zi.current?Ci=dn==null?void 0:dn(Fn,Yn):Bt===Yt&&Zi.current&&(Ci=On==null?void 0:On(Fn,Yn)),Ci!==!1&&!ri.current&&(An(_t),Bn(null))}var $n=Li(Si),zn=Object(X.a)($n,1),ai=zn[0],ni=L.useMemo(function(){var Yn,Fn,Ci;switch(Bt){case"appear":return Yn={},Object(ae.a)(Yn,jt,Ye),Object(ae.a)(Yn,rn,wt),Object(ae.a)(Yn,kt,nn),Yn;case"enter":return Fn={},Object(ae.a)(Fn,jt,yt),Object(ae.a)(Fn,rn,en),Object(ae.a)(Fn,kt,un),Fn;case"leave":return Ci={},Object(ae.a)(Ci,jt,mt),Object(ae.a)(Ci,rn,pn),Object(ae.a)(Ci,kt,mn),Ci;default:return{}}},[Bt]),_r=li(Bt,function(Yn){if(Yn===jt){var Fn=ni[jt];return Fn?Fn(br()):Ni}if(Hn in ni){var Ci;Bn(((Ci=ni[Hn])===null||Ci===void 0?void 0:Ci.call(ni,br(),null))||null)}return Hn===kt&&(ai(br()),Le>0&&(clearTimeout(wi.current),wi.current=setTimeout(function(){Si({deadline:!0})},Le))),vn}),Wr=Object(X.a)(_r,2),Kr=Wr[0],Hn=Wr[1],Or=At(Hn);Zi.current=Or,Mt(function(){Gt(Oe);var Yn=ci.current;if(ci.current=!0,!fe)return;var Fn;!Yn&&Oe&&_e&&(Fn=Qt),Yn&&Oe&&de&&(Fn=Jt),(Yn&&!Oe&&ke||!Yn&&je&&!Oe&&ke)&&(Fn=Yt),Fn&&(An(Fn),Kr())},[Oe]),Object(L.useEffect)(function(){(Bt===Qt&&!_e||Bt===Jt&&!de||Bt===Yt&&!ke)&&An(_t)},[_e,de,ke]),Object(L.useEffect)(function(){return function(){clearTimeout(wi.current),ri.current=!0}},[]),Object(L.useEffect)(function(){Xt!==void 0&&Bt===_t&&(En==null||En(Xt))},[Xt,Bt]);var zr=Kn;return ni[jt]&&Hn===rn&&(zr=Object(V.a)({transition:"none"},zr)),[Bt,Hn,zr,Xt!=null?Xt:Oe]}var an=function(fe){Object(v.a)(Ie,fe);var Oe=Object(h.a)(Ie);function Ie(){return Object(C.a)(this,Ie),Oe.apply(this,arguments)}return Object(w.a)(Ie,[{key:"render",value:function(){return this.props.children}}]),Ie}(L.Component),Qn=an;function Ii(fe){var Oe=fe;Object(j.a)(fe)==="object"&&(Oe=fe.transitionSupport);function Ie(ee){return!!(ee.motionName&&Oe)}var ye=L.forwardRef(function(ee,de){var re=ee.visible,_e=re===void 0?!0:re,xe=ee.removeOnLeave,ke=xe===void 0?!0:xe,Le=ee.forceRender,je=ee.children,Ye=ee.motionName,yt=ee.leavedClassName,mt=ee.eventProps,wt=Ie(ee),en=Object(L.useRef)(),pn=Object(L.useRef)();function nn(){try{return Object(Et.a)(en.current||pn.current)}catch(An){return null}}var un=Zn(wt,_e,nn,ee),mn=Object(X.a)(un,4),fn=mn[0],dn=mn[1],On=mn[2],En=mn[3],ei=L.useRef(En);En&&(ei.current=!0);var xn=Object(L.useRef)(de);xn.current=de;var Xt=L.useCallback(function(An){en.current=An,Object(Re.b)(xn.current,An)},[]),Gt,wn=Object(V.a)(Object(V.a)({},mt),{},{visible:_e});if(!je)Gt=null;else if(fn===_t||!Ie(ee))En?Gt=je(Object(V.a)({},wn),Xt):!ke&&ei.current?Gt=je(Object(V.a)(Object(V.a)({},wn),{},{className:yt}),Xt):Le?Gt=je(Object(V.a)(Object(V.a)({},wn),{},{style:{display:"none"}}),Xt):Gt=null;else{var Rn,Bt;dn===jt?Bt="prepare":At(dn)?Bt="active":dn===rn&&(Bt="start"),Gt=je(Object(V.a)(Object(V.a)({},wn),{},{className:H()(Nt(Ye,fn),(Rn={},Object(ae.a)(Rn,Nt(Ye,"".concat(fn,"-").concat(Bt)),Bt),Object(ae.a)(Rn,Ye,typeof Ye=="string"),Rn)),style:On}),Xt)}return L.createElement(Qn,{ref:pn},Gt)});return ye.displayName="CSSMotion",ye}var Ui=Ii(vt),ht="add",zt="keep",Di="remove",Hi="removed";function ir(fe){var Oe;return fe&&Object(j.a)(fe)==="object"&&"key"in fe?Oe=fe:Oe={key:fe},Object(V.a)(Object(V.a)({},Oe),{},{key:String(Oe.key)})}function Wi(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return fe.map(ir)}function G(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ie=[],ye=0,ee=Oe.length,de=Wi(fe),re=Wi(Oe);de.forEach(function(ke){for(var Le=!1,je=ye;je<ee;je+=1){var Ye=re[je];if(Ye.key===ke.key){ye<je&&(Ie=Ie.concat(re.slice(ye,je).map(function(yt){return Object(V.a)(Object(V.a)({},yt),{},{status:ht})})),ye=je),Ie.push(Object(V.a)(Object(V.a)({},Ye),{},{status:zt})),ye+=1,Le=!0;break}}Le||Ie.push(Object(V.a)(Object(V.a)({},ke),{},{status:Di}))}),ye<ee&&(Ie=Ie.concat(re.slice(ye).map(function(ke){return Object(V.a)(Object(V.a)({},ke),{},{status:ht})})));var _e={};Ie.forEach(function(ke){var Le=ke.key;_e[Le]=(_e[Le]||0)+1});var xe=Object.keys(_e).filter(function(ke){return _e[ke]>1});return xe.forEach(function(ke){Ie=Ie.filter(function(Le){var je=Le.key,Ye=Le.status;return je!==ke||Ye!==Di}),Ie.forEach(function(Le){Le.key===ke&&(Le.status=zt)})}),Ie}var x=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function A(fe){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ui,Ie=function(ye){Object(v.a)(de,ye);var ee=Object(h.a)(de);function de(){var re;return Object(C.a)(this,de),re=ee.apply(this,arguments),re.state={keyEntities:[]},re.removeKey=function(_e){re.setState(function(xe){var ke=xe.keyEntities;return{keyEntities:ke.map(function(Le){return Le.key!==_e?Le:Object(V.a)(Object(V.a)({},Le),{},{status:Hi})})}})},re}return Object(w.a)(de,[{key:"render",value:function(){var _e=this,xe=this.state.keyEntities,ke=this.props,Le=ke.component,je=ke.children,Ye=ke.onVisibleChanged,yt=Object(P.a)(ke,["component","children","onVisibleChanged"]),mt=Le||L.Fragment,wt={};return x.forEach(function(en){wt[en]=yt[en],delete yt[en]}),delete yt.keys,L.createElement(mt,yt,xe.map(function(en){var pn=en.status,nn=Object(P.a)(en,["status"]),un=pn===ht||pn===zt;return L.createElement(Oe,Object(E.a)({},wt,{key:nn.key,visible:un,eventProps:nn,onVisibleChanged:function(fn){Ye==null||Ye(fn,{key:nn.key}),fn||_e.removeKey(nn.key)}}),je)}))}}],[{key:"getDerivedStateFromProps",value:function(_e,xe){var ke=_e.keys,Le=xe.keyEntities,je=Wi(ke),Ye=G(Le,je);return{keyEntities:Ye.filter(function(yt){var mt=Le.find(function(wt){var en=wt.key;return yt.key===en});return!(mt&&mt.status===Hi&&yt.status===Di)})}}}]),de}(L.Component);return Ie.defaultProps={component:"div"},Ie}var F=A(vt),q=Ui;function z(fe){var Oe=fe.prefixCls,Ie=fe.motion,ye=fe.animation,ee=fe.transitionName;return Ie||(ye?{motionName:"".concat(Oe,"-").concat(ye)}:ee?{motionName:ee}:null)}function we(fe){var Oe=fe.prefixCls,Ie=fe.visible,ye=fe.zIndex,ee=fe.mask,de=fe.maskMotion,re=fe.maskAnimation,_e=fe.maskTransitionName;if(!ee)return null;var xe={};return(de||_e||re)&&(xe=Object(V.a)({motionAppear:!0},z({motion:de,prefixCls:Oe,transitionName:_e,animation:re}))),L.createElement(q,Object(E.a)({},xe,{visible:Ie,removeOnLeave:!0}),function(ke){var Le=ke.className;return L.createElement("div",{style:{zIndex:ye},className:H()("".concat(Oe,"-mask"),Le)})})}var Ze=Q("9mu1"),xt=Q("o0o1"),Dt=Q.n(xt),ot=Q("HaE+"),Kt=["measure","align",null,"motion"],$t=function(fe,Oe){var Ie=Object(L.useState)(null),ye=Object(X.a)(Ie,2),ee=ye[0],de=ye[1],re=Object(L.useRef)(),_e=Object(L.useRef)(!1);function xe(je){_e.current||de(je)}function ke(){at.a.cancel(re.current)}function Le(je){ke(),re.current=Object(at.a)(function(){xe(function(Ye){switch(ee){case"align":return"motion";case"motion":return"stable";default:}return Ye}),je==null||je()})}return Object(L.useEffect)(function(){xe("measure")},[fe]),Object(L.useEffect)(function(){switch(ee){case"measure":Oe();break;default:}ee&&(re.current=Object(at.a)(Object(ot.a)(Dt.a.mark(function je(){var Ye,yt;return Dt.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:Ye=Kt.indexOf(ee),yt=Kt[Ye+1],yt&&Ye!==-1&&xe(yt);case 3:case"end":return wt.stop()}},je)}))))},[ee]),Object(L.useEffect)(function(){return function(){_e.current=!0,ke()}},[]),[ee,Le]},Pn=function(fe){var Oe=L.useState({width:0,height:0}),Ie=Object(X.a)(Oe,2),ye=Ie[0],ee=Ie[1];function de(_e){ee({width:_e.offsetWidth,height:_e.offsetHeight})}var re=L.useMemo(function(){var _e={};if(fe){var xe=ye.width,ke=ye.height;fe.indexOf("height")!==-1&&ke?_e.height=ke:fe.indexOf("minHeight")!==-1&&ke&&(_e.minHeight=ke),fe.indexOf("width")!==-1&&xe?_e.width=xe:fe.indexOf("minWidth")!==-1&&xe&&(_e.minWidth=xe)}return _e},[fe,ye]);return[re,de]},yi=L.forwardRef(function(fe,Oe){var Ie=fe.visible,ye=fe.prefixCls,ee=fe.className,de=fe.style,re=fe.children,_e=fe.zIndex,xe=fe.stretch,ke=fe.destroyPopupOnHide,Le=fe.forceRender,je=fe.align,Ye=fe.point,yt=fe.getRootDomNode,mt=fe.getClassNameFromAlign,wt=fe.onAlign,en=fe.onMouseEnter,pn=fe.onMouseLeave,nn=fe.onMouseDown,un=fe.onTouchStart,mn=Object(L.useRef)(),fn=Object(L.useRef)(),dn=Object(L.useState)(),On=Object(X.a)(dn,2),En=On[0],ei=On[1],xn=Pn(xe),Xt=Object(X.a)(xn,2),Gt=Xt[0],wn=Xt[1];function Rn(){xe&&wn(yt())}var Bt=$t(Ie,Rn),An=Object(X.a)(Bt,2),ti=An[0],Mn=An[1],Kn=Object(L.useRef)();function Bn(){return Ye||yt}function ci(){var $n;($n=mn.current)===null||$n===void 0||$n.forceAlign()}function wi($n,zn){var ai=mt(zn);En!==ai&&ei(ai),ti==="align"&&(En!==ai?Promise.resolve().then(function(){ci()}):Mn(function(){var ni;(ni=Kn.current)===null||ni===void 0||ni.call(Kn)}),wt==null||wt($n,zn))}var ri=Object(V.a)({},z(fe));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function($n){var zn=ri[$n];ri[$n]=function(ai,ni){return Mn(),zn==null?void 0:zn(ai,ni)}});function Vi(){return new Promise(function($n){Kn.current=$n})}L.useEffect(function(){!ri.motionName&&ti==="motion"&&Mn()},[ri.motionName,ti]),L.useImperativeHandle(Oe,function(){return{forceAlign:ci,getElement:function(){return fn.current}}});var br=Object(V.a)(Object(V.a)({},Gt),{},{zIndex:_e,opacity:ti==="motion"||ti==="stable"||!Ie?void 0:0,pointerEvents:ti==="stable"?void 0:"none"},de),Zi=!0;(je==null?void 0:je.points)&&(ti==="align"||ti==="stable")&&(Zi=!1);var Si=re;return L.Children.count(re)>1&&(Si=L.createElement("div",{className:"".concat(ye,"-content")},re)),L.createElement(q,Object(E.a)({visible:Ie,ref:fn,leavedClassName:"".concat(ye,"-hidden")},ri,{onAppearPrepare:Vi,onEnterPrepare:Vi,removeOnLeave:ke,forceRender:Le}),function($n,zn){var ai=$n.className,ni=$n.style,_r=H()(ye,ee,En,ai);return L.createElement(Ze.a,{target:Bn(),key:"popup",ref:mn,monitorWindowResize:!0,disabled:Zi,align:je,onAlign:wi},L.createElement("div",{ref:zn,className:_r,onMouseEnter:en,onMouseLeave:pn,onMouseDownCapture:nn,onTouchStartCapture:un,style:Object(V.a)(Object(V.a)({},ni),br)},Si))})});yi.displayName="PopupInner";var fi=yi,Vn=L.forwardRef(function(fe,Oe){var Ie=fe.prefixCls,ye=fe.visible,ee=fe.zIndex,de=fe.children,re=fe.mobile;re=re===void 0?{}:re;var _e=re.popupClassName,xe=re.popupStyle,ke=re.popupMotion,Le=ke===void 0?{}:ke,je=re.popupRender,Ye=L.useRef();L.useImperativeHandle(Oe,function(){return{forceAlign:function(){},getElement:function(){return Ye.current}}});var yt=Object(V.a)({zIndex:ee},xe),mt=de;return L.Children.count(de)>1&&(mt=L.createElement("div",{className:"".concat(Ie,"-content")},de)),je&&(mt=je(mt)),L.createElement(q,Object(E.a)({visible:ye,ref:Ye,removeOnLeave:!0},Le),function(wt,en){var pn=wt.className,nn=wt.style,un=H()(Ie,_e,pn);return L.createElement("div",{ref:en,className:un,style:Object(V.a)(Object(V.a)({},nn),yt)},mt)})});Vn.displayName="MobilePopupInner";var rr=Vn,wr=["visible","mobile"],ii=L.forwardRef(function(fe,Oe){var Ie=fe.visible,ye=fe.mobile,ee=Object(P.a)(fe,wr),de=Object(L.useState)(Ie),re=Object(X.a)(de,2),_e=re[0],xe=re[1],ke=Object(L.useState)(!1),Le=Object(X.a)(ke,2),je=Le[0],Ye=Le[1],yt=Object(V.a)(Object(V.a)({},ee),{},{visible:_e});Object(L.useEffect)(function(){xe(Ie),Ie&&ye&&Ye(ve())},[Ie,ye]);var mt=je?L.createElement(rr,Object(E.a)({},yt,{mobile:ye,ref:Oe})):L.createElement(fi,Object(E.a)({},yt,{ref:Oe}));return L.createElement("div",null,L.createElement(we,yt),mt)});ii.displayName="Popup";var Ki=ii,yr=L.createContext(null),ar=yr;function bi(){}function Rr(){return""}function Sr(fe){return fe?fe.ownerDocument:window.document}var Ar=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Nr(fe){var Oe=function(Ie){Object(v.a)(ee,Ie);var ye=Object(h.a)(ee);function ee(de){var re;Object(C.a)(this,ee),re=ye.call(this,de),re.popupRef=L.createRef(),re.triggerRef=L.createRef(),re.attachId=void 0,re.clickOutsideHandler=void 0,re.touchOutsideHandler=void 0,re.contextMenuOutsideHandler1=void 0,re.contextMenuOutsideHandler2=void 0,re.mouseDownTimeout=void 0,re.focusTime=void 0,re.preClickTime=void 0,re.preTouchTime=void 0,re.delayTimer=void 0,re.hasPopupMouseDown=void 0,re.onMouseEnter=function(xe){var ke=re.props.mouseEnterDelay;re.fireEvents("onMouseEnter",xe),re.delaySetPopupVisible(!0,ke,ke?null:xe)},re.onMouseMove=function(xe){re.fireEvents("onMouseMove",xe),re.setPoint(xe)},re.onMouseLeave=function(xe){re.fireEvents("onMouseLeave",xe),re.delaySetPopupVisible(!1,re.props.mouseLeaveDelay)},re.onPopupMouseEnter=function(){re.clearDelayTimer()},re.onPopupMouseLeave=function(xe){var ke;if(xe.relatedTarget&&!xe.relatedTarget.setTimeout&&Object(bt.a)((ke=re.popupRef.current)===null||ke===void 0?void 0:ke.getElement(),xe.relatedTarget))return;re.delaySetPopupVisible(!1,re.props.mouseLeaveDelay)},re.onFocus=function(xe){re.fireEvents("onFocus",xe),re.clearDelayTimer(),re.isFocusToShow()&&(re.focusTime=Date.now(),re.delaySetPopupVisible(!0,re.props.focusDelay))},re.onMouseDown=function(xe){re.fireEvents("onMouseDown",xe),re.preClickTime=Date.now()},re.onTouchStart=function(xe){re.fireEvents("onTouchStart",xe),re.preTouchTime=Date.now()},re.onBlur=function(xe){re.fireEvents("onBlur",xe),re.clearDelayTimer(),re.isBlurToHide()&&re.delaySetPopupVisible(!1,re.props.blurDelay)},re.onContextMenu=function(xe){xe.preventDefault(),re.fireEvents("onContextMenu",xe),re.setPopupVisible(!0,xe)},re.onContextMenuClose=function(){re.isContextMenuToShow()&&re.close()},re.onClick=function(xe){if(re.fireEvents("onClick",xe),re.focusTime){var ke;if(re.preClickTime&&re.preTouchTime?ke=Math.min(re.preClickTime,re.preTouchTime):re.preClickTime?ke=re.preClickTime:re.preTouchTime&&(ke=re.preTouchTime),Math.abs(ke-re.focusTime)<20)return;re.focusTime=0}re.preClickTime=0,re.preTouchTime=0,re.isClickToShow()&&(re.isClickToHide()||re.isBlurToHide())&&xe&&xe.preventDefault&&xe.preventDefault();var Le=!re.state.popupVisible;(re.isClickToHide()&&!Le||Le&&re.isClickToShow())&&re.setPopupVisible(!re.state.popupVisible,xe)},re.onPopupMouseDown=function(){if(re.hasPopupMouseDown=!0,clearTimeout(re.mouseDownTimeout),re.mouseDownTimeout=window.setTimeout(function(){re.hasPopupMouseDown=!1},0),re.context){var xe;(xe=re.context).onPopupMouseDown.apply(xe,arguments)}},re.onDocumentClick=function(xe){if(re.props.mask&&!re.props.maskClosable)return;var ke=xe.target,Le=re.getRootDomNode(),je=re.getPopupDomNode();(!Object(bt.a)(Le,ke)||re.isContextMenuOnly())&&!Object(bt.a)(je,ke)&&!re.hasPopupMouseDown&&re.close()},re.getRootDomNode=function(){var xe=re.props.getTriggerDOMNode;if(xe)return xe(re.triggerRef.current);try{var ke=Object(Et.a)(re.triggerRef.current);if(ke)return ke}catch(Le){}return nt.a.findDOMNode(Object(g.a)(re))},re.getPopupClassNameFromAlign=function(xe){var ke=[],Le=re.props,je=Le.popupPlacement,Ye=Le.builtinPlacements,yt=Le.prefixCls,mt=Le.alignPoint,wt=Le.getPopupClassNameFromAlign;return je&&Ye&&ke.push(We(Ye,yt,xe,mt)),wt&&ke.push(wt(xe)),ke.join(" ")},re.getComponent=function(){var xe=re.props,ke=xe.prefixCls,Le=xe.destroyPopupOnHide,je=xe.popupClassName,Ye=xe.onPopupAlign,yt=xe.popupMotion,mt=xe.popupAnimation,wt=xe.popupTransitionName,en=xe.popupStyle,pn=xe.mask,nn=xe.maskAnimation,un=xe.maskTransitionName,mn=xe.maskMotion,fn=xe.zIndex,dn=xe.popup,On=xe.stretch,En=xe.alignPoint,ei=xe.mobile,xn=xe.forceRender,Xt=re.state,Gt=Xt.popupVisible,wn=Xt.point,Rn=re.getPopupAlign(),Bt={};return re.isMouseEnterToShow()&&(Bt.onMouseEnter=re.onPopupMouseEnter),re.isMouseLeaveToHide()&&(Bt.onMouseLeave=re.onPopupMouseLeave),Bt.onMouseDown=re.onPopupMouseDown,Bt.onTouchStart=re.onPopupMouseDown,L.createElement(Ki,Object(E.a)({prefixCls:ke,destroyPopupOnHide:Le,visible:Gt,point:En&&wn,className:je,align:Rn,onAlign:Ye,animation:mt,getClassNameFromAlign:re.getPopupClassNameFromAlign},Bt,{stretch:On,getRootDomNode:re.getRootDomNode,style:en,mask:pn,zIndex:fn,transitionName:wt,maskAnimation:nn,maskTransitionName:un,maskMotion:mn,ref:re.popupRef,motion:yt,mobile:ei,forceRender:xn}),typeof dn=="function"?dn():dn)},re.attachParent=function(xe){at.a.cancel(re.attachId);var ke=re.props,Le=ke.getPopupContainer,je=ke.getDocument,Ye=re.getRootDomNode(),yt;Le?(Ye||Le.length===0)&&(yt=Le(Ye)):yt=je(re.getRootDomNode()).body,yt?yt.appendChild(xe):re.attachId=Object(at.a)(function(){re.attachParent(xe)})},re.getContainer=function(){var xe=re.props.getDocument,ke=xe(re.getRootDomNode()).createElement("div");return ke.style.position="absolute",ke.style.top="0",ke.style.left="0",ke.style.width="100%",re.attachParent(ke),ke},re.setPoint=function(xe){var ke=re.props.alignPoint;if(!ke||!xe)return;re.setState({point:{pageX:xe.pageX,pageY:xe.pageY}})},re.handlePortalUpdate=function(){re.state.prevPopupVisible!==re.state.popupVisible&&re.props.afterPopupVisibleChange(re.state.popupVisible)},re.triggerContextValue={onPopupMouseDown:re.onPopupMouseDown};var _e;return"popupVisible"in de?_e=!!de.popupVisible:_e=!!de.defaultPopupVisible,re.state={prevPopupVisible:_e,popupVisible:_e},Ar.forEach(function(xe){re["fire".concat(xe)]=function(ke){re.fireEvents(xe,ke)}}),re}return Object(w.a)(ee,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var re=this.props,_e=this.state;if(_e.popupVisible){var xe;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(xe=re.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Te.a)(xe,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(xe=xe||re.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Te.a)(xe,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(xe=xe||re.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Te.a)(xe,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Te.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),at.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var re;return((re=this.popupRef.current)===null||re===void 0?void 0:re.getElement())||null}},{key:"getPopupAlign",value:function(){var re=this.props,_e=re.popupPlacement,xe=re.popupAlign,ke=re.builtinPlacements;return _e&&ke?Ce(ke,_e,xe):xe}},{key:"setPopupVisible",value:function(re,_e){var xe=this.props.alignPoint,ke=this.state.popupVisible;this.clearDelayTimer(),ke!==re&&("popupVisible"in this.props||this.setState({popupVisible:re,prevPopupVisible:ke}),this.props.onPopupVisibleChange(re)),xe&&_e&&re&&this.setPoint(_e)}},{key:"delaySetPopupVisible",value:function(re,_e,xe){var ke=this,Le=_e*1e3;if(this.clearDelayTimer(),Le){var je=xe?{pageX:xe.pageX,pageY:xe.pageY}:null;this.delayTimer=window.setTimeout(function(){ke.setPopupVisible(re,je),ke.clearDelayTimer()},Le)}else this.setPopupVisible(re,xe)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(re){var _e=this.props.children.props,xe=this.props;return _e[re]&&xe[re]?this["fire".concat(re)]:_e[re]||xe[re]}},{key:"isClickToShow",value:function(){var re=this.props,_e=re.action,xe=re.showAction;return _e.indexOf("click")!==-1||xe.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var re=this.props.action;return re==="contextMenu"||re.length===1&&re[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var re=this.props,_e=re.action,xe=re.showAction;return _e.indexOf("contextMenu")!==-1||xe.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var re=this.props,_e=re.action,xe=re.hideAction;return _e.indexOf("click")!==-1||xe.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var re=this.props,_e=re.action,xe=re.showAction;return _e.indexOf("hover")!==-1||xe.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var re=this.props,_e=re.action,xe=re.hideAction;return _e.indexOf("hover")!==-1||xe.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var re=this.props,_e=re.action,xe=re.showAction;return _e.indexOf("focus")!==-1||xe.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var re=this.props,_e=re.action,xe=re.hideAction;return _e.indexOf("focus")!==-1||xe.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var re;(re=this.popupRef.current)===null||re===void 0||re.forceAlign()}}},{key:"fireEvents",value:function(re,_e){var xe=this.props.children.props[re];xe&&xe(_e);var ke=this.props[re];ke&&ke(_e)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var re=this.state.popupVisible,_e=this.props,xe=_e.children,ke=_e.forceRender,Le=_e.alignPoint,je=_e.className,Ye=_e.autoDestroy,yt=L.Children.only(xe),mt={key:"trigger"};this.isContextMenuToShow()?mt.onContextMenu=this.onContextMenu:mt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(mt.onClick=this.onClick,mt.onMouseDown=this.onMouseDown,mt.onTouchStart=this.onTouchStart):(mt.onClick=this.createTwoChains("onClick"),mt.onMouseDown=this.createTwoChains("onMouseDown"),mt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(mt.onMouseEnter=this.onMouseEnter,Le&&(mt.onMouseMove=this.onMouseMove)):mt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?mt.onMouseLeave=this.onMouseLeave:mt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(mt.onFocus=this.onFocus,mt.onBlur=this.onBlur):(mt.onFocus=this.createTwoChains("onFocus"),mt.onBlur=this.createTwoChains("onBlur"));var wt=H()(yt&&yt.props&&yt.props.className,je);wt&&(mt.className=wt);var en=Object(V.a)({},mt);Object(Re.c)(yt)&&(en.ref=Object(Re.a)(this.triggerRef,yt.ref));var pn=L.cloneElement(yt,en),nn;return(re||this.popupRef.current||ke)&&(nn=L.createElement(fe,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!re&&Ye&&(nn=null),L.createElement(ar.Provider,{value:this.triggerContextValue},pn,nn)}}],[{key:"getDerivedStateFromProps",value:function(re,_e){var xe=re.popupVisible,ke={};return xe!==void 0&&_e.popupVisible!==xe&&(ke.popupVisible=xe,ke.prevPopupVisible=_e.popupVisible),ke}}]),ee}(L.Component);return Oe.contextType=ar,Oe.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Rr,getDocument:Sr,onPopupVisibleChange:bi,afterPopupVisibleChange:bi,onPopupAlign:bi,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Oe}var or=Nr(Ke.a),ui={adjustX:1,adjustY:1},pr={topLeft:{points:["bl","tl"],overflow:ui,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ui,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ui,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ui,offset:[4,0]}},Ur={topLeft:{points:["bl","tl"],overflow:ui,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ui,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ui,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ui,offset:[4,0]}},mr=pr,In=0,on={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Wn=function(Oe,Ie,ye){var ee=Ve(Ie),de=Oe.getState();Oe.setState({defaultActiveFirst:Object(V.a)(Object(V.a)({},de.defaultActiveFirst),{},Object(ae.a)({},ee,ye))})},ln=function(fe){Object(v.a)(Ie,fe);var Oe=Object(h.a)(Ie);function Ie(ye){var ee;Object(C.a)(this,Ie),ee=Oe.call(this,ye),ee.onDestroy=function(Le){ee.props.onDestroy(Le)},ee.onKeyDown=function(Le){var je=Le.keyCode,Ye=ee.menuInstance,yt=ee.props.store,mt=ee.getVisible();if(je===l.a.ENTER)return ee.onTitleClick(Le),Wn(yt,ee.props.eventKey,!0),!0;if(je===l.a.RIGHT)return mt?Ye.onKeyDown(Le):(ee.triggerOpenChange(!0),Wn(yt,ee.props.eventKey,!0)),!0;if(je===l.a.LEFT){var wt;if(mt)wt=Ye.onKeyDown(Le);else return;return wt||(ee.triggerOpenChange(!1),wt=!0),wt}return mt&&(je===l.a.UP||je===l.a.DOWN)?Ye.onKeyDown(Le):void 0},ee.onOpenChange=function(Le){ee.props.onOpenChange(Le)},ee.onPopupVisibleChange=function(Le){ee.triggerOpenChange(Le,Le?"mouseenter":"mouseleave")},ee.onMouseEnter=function(Le){var je=ee.props,Ye=je.eventKey,yt=je.onMouseEnter,mt=je.store;Wn(mt,ee.props.eventKey,!1),yt({key:Ye,domEvent:Le})},ee.onMouseLeave=function(Le){var je=ee.props,Ye=je.parentMenu,yt=je.eventKey,mt=je.onMouseLeave;Ye.subMenuInstance=Object(g.a)(ee),mt({key:yt,domEvent:Le})},ee.onTitleMouseEnter=function(Le){var je=ee.props,Ye=je.eventKey,yt=je.onItemHover,mt=je.onTitleMouseEnter;yt({key:Ye,hover:!0}),mt({key:Ye,domEvent:Le})},ee.onTitleMouseLeave=function(Le){var je=ee.props,Ye=je.parentMenu,yt=je.eventKey,mt=je.onItemHover,wt=je.onTitleMouseLeave;Ye.subMenuInstance=Object(g.a)(ee),mt({key:yt,hover:!1}),wt({key:yt,domEvent:Le})},ee.onTitleClick=function(Le){var je=Object(g.a)(ee),Ye=je.props;if(Ye.onTitleClick({key:Ye.eventKey,domEvent:Le}),Ye.triggerSubMenuAction==="hover")return;ee.triggerOpenChange(!ee.getVisible(),"click"),Wn(Ye.store,ee.props.eventKey,!1)},ee.onSubMenuClick=function(Le){typeof ee.props.onClick=="function"&&ee.props.onClick(ee.addKeyPath(Le))},ee.onSelect=function(Le){ee.props.onSelect(Le)},ee.onDeselect=function(Le){ee.props.onDeselect(Le)},ee.getPrefixCls=function(){return"".concat(ee.props.rootPrefixCls,"-submenu")},ee.getActiveClassName=function(){return"".concat(ee.getPrefixCls(),"-active")},ee.getDisabledClassName=function(){return"".concat(ee.getPrefixCls(),"-disabled")},ee.getSelectedClassName=function(){return"".concat(ee.getPrefixCls(),"-selected")},ee.getOpenClassName=function(){return"".concat(ee.props.rootPrefixCls,"-submenu-open")},ee.getVisible=function(){return ee.state.isOpen},ee.getMode=function(){return ee.state.mode},ee.saveMenuInstance=function(Le){ee.menuInstance=Le},ee.addKeyPath=function(Le){return Object(V.a)(Object(V.a)({},Le),{},{keyPath:(Le.keyPath||[]).concat(ee.props.eventKey)})},ee.triggerOpenChange=function(Le,je){var Ye=ee.props.eventKey,yt=function(){ee.onOpenChange({key:Ye,item:Object(g.a)(ee),trigger:je,open:Le})};je==="mouseenter"?ee.mouseenterTimeout=setTimeout(function(){yt()},0):yt()},ee.isChildrenSelected=function(){var Le={find:!1};return st(ee.props.children,ee.props.selectedKeys,Le),Le.find},ee.isInlineMode=function(){return ee.getMode()==="inline"},ee.adjustWidth=function(){if(!ee.subMenuTitle||!ee.menuInstance)return;var Le=pt.findDOMNode(ee.menuInstance);if(Le.offsetWidth>=ee.subMenuTitle.offsetWidth)return;Le.style.minWidth="".concat(ee.subMenuTitle.offsetWidth,"px")},ee.saveSubMenuTitle=function(Le){ee.subMenuTitle=Le},ee.getBaseProps=function(){var Le=Object(g.a)(ee),je=Le.props,Ye=ee.getMode();return{mode:Ye==="horizontal"?"vertical":Ye,visible:ee.getVisible(),level:je.level+1,inlineIndent:je.inlineIndent,focusable:!1,onClick:ee.onSubMenuClick,onSelect:ee.onSelect,onDeselect:ee.onDeselect,onDestroy:ee.onDestroy,selectedKeys:je.selectedKeys,eventKey:"".concat(je.eventKey,"-menu-"),openKeys:je.openKeys,motion:je.motion,onOpenChange:ee.onOpenChange,subMenuOpenDelay:je.subMenuOpenDelay,parentMenu:Object(g.a)(ee),subMenuCloseDelay:je.subMenuCloseDelay,forceSubMenuRender:je.forceSubMenuRender,triggerSubMenuAction:je.triggerSubMenuAction,builtinPlacements:je.builtinPlacements,defaultActiveFirst:je.store.getState().defaultActiveFirst[Ve(je.eventKey)],multiple:je.multiple,prefixCls:je.rootPrefixCls,id:ee.internalMenuId,manualRef:ee.saveMenuInstance,itemIcon:je.itemIcon,expandIcon:je.expandIcon,direction:je.direction}},ee.getMotion=function(Le,je){var Ye=Object(g.a)(ee),yt=Ye.haveRendered,mt=ee.props,wt=mt.motion,en=mt.rootPrefixCls,pn=Object(V.a)(Object(V.a)({},wt),{},{leavedClassName:"".concat(en,"-hidden"),removeOnLeave:!1,motionAppear:yt||!je||Le!=="inline"});return pn};var de=ye.store,re=ye.eventKey,_e=de.getState(),xe=_e.defaultActiveFirst;ee.isRootMenu=!1;var ke=!1;return xe&&(ke=xe[re]),Wn(de,re,ke),ee.state={mode:ye.mode,isOpen:ye.isOpen},ee}return Object(w.a)(Ie,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ee=this,de=this.props,re=de.mode,_e=de.parentMenu,xe=de.manualRef,ke=de.isOpen,Le=function(){ee.setState({mode:re,isOpen:ke})},je=ke!==this.state.isOpen,Ye=re!==this.state.mode;if((Ye||je)&&(at.a.cancel(this.updateStateRaf),Ye?this.updateStateRaf=Object(at.a)(Le):Le()),xe&&xe(this),re!=="horizontal"||!(_e==null?void 0:_e.isRootMenu)||!ke)return;this.minWidthTimeout=setTimeout(function(){return ee.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ee=this.props,de=ee.onDestroy,re=ee.eventKey;de&&de(re),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),at.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ee,de){var re=this.getBaseProps();return L.createElement(Lr,Object(E.a)({},re,{id:this.internalMenuId,className:ee,style:de}),this.props.children)}},{key:"renderChildren",value:function(){var ee=this,de=this.getBaseProps(),re=de.mode,_e=de.visible,xe=de.forceSubMenuRender,ke=de.direction,Le=this.getMotion(re,_e);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||_e||xe,!this.haveOpened)return L.createElement("div",null);var je=H()("".concat(de.prefixCls,"-sub"),Object(ae.a)({},"".concat(de.prefixCls,"-rtl"),ke==="rtl"));return this.isInlineMode()?L.createElement(q,Object(E.a)({visible:de.visible,forceRender:xe},Le),function(Ye){var yt=Ye.className,mt=Ye.style,wt=H()(je,yt);return ee.renderPopupMenu(wt,mt)}):this.renderPopupMenu(je)}},{key:"render",value:function(){var ee,de,re,_e=Object(V.a)({},this.props),xe=this.getVisible(),ke=this.getPrefixCls(),Le=this.isInlineMode(),je=this.getMode(),Ye=H()(ke,"".concat(ke,"-").concat(je),(ee={},Object(ae.a)(ee,_e.className,!!_e.className),Object(ae.a)(ee,this.getOpenClassName(),xe),Object(ae.a)(ee,this.getActiveClassName(),_e.active||xe&&!Le),Object(ae.a)(ee,this.getDisabledClassName(),_e.disabled),Object(ae.a)(ee,this.getSelectedClassName(),this.isChildrenSelected()),ee));this.internalMenuId||(_e.eventKey?this.internalMenuId="".concat(_e.eventKey,"$Menu"):(In+=1,this.internalMenuId="$__$".concat(In,"$Menu")));var yt={},mt={},wt={};_e.disabled||(yt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},mt={onClick:this.onTitleClick},wt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var en={},pn=_e.direction,nn=pn==="rtl";Le&&(nn?en.paddingRight=_e.inlineIndent*_e.level:en.paddingLeft=_e.inlineIndent*_e.level);var un={};this.getVisible()&&(un={"aria-owns":this.internalMenuId});var mn=null;je!=="horizontal"&&(mn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(mn=L.createElement(this.props.expandIcon,Object(V.a)({},this.props))));var fn=L.createElement("div",Object(E.a)({ref:this.saveSubMenuTitle,style:en,className:"".concat(ke,"-title"),role:"button"},wt,mt,{"aria-expanded":xe},un,{"aria-haspopup":"true",title:typeof _e.title=="string"?_e.title:void 0}),_e.title,mn||L.createElement("i",{className:"".concat(ke,"-arrow")})),dn=this.renderChildren(),On=((de=_e.parentMenu)===null||de===void 0?void 0:de.isRootMenu)?_e.parentMenu.props.getPopupContainer:function(Bn){return Bn.parentNode},En=on[je],ei=_e.popupOffset?{offset:_e.popupOffset}:{},xn=H()((re={},Object(ae.a)(re,_e.popupClassName,_e.popupClassName&&!Le),Object(ae.a)(re,"".concat(ke,"-rtl"),nn),re)),Xt=_e.disabled,Gt=_e.triggerSubMenuAction,wn=_e.subMenuOpenDelay,Rn=_e.forceSubMenuRender,Bt=_e.subMenuCloseDelay,An=_e.builtinPlacements;gt.forEach(function(Bn){return delete _e[Bn]}),delete _e.onClick;var ti=nn?Object(V.a)(Object(V.a)({},Ur),An):Object(V.a)(Object(V.a)({},pr),An);delete _e.direction;var Mn=this.getBaseProps(),Kn=Le?null:this.getMotion(Mn.mode,Mn.visible);return L.createElement("li",Object(E.a)({},_e,yt,{className:Ye,role:"menuitem"}),L.createElement(or,{prefixCls:ke,popupClassName:H()("".concat(ke,"-popup"),xn),getPopupContainer:On,builtinPlacements:ti,popupPlacement:En,popupVisible:Le?!1:xe,popupAlign:ei,popup:Le?null:dn,action:Xt||Le?[]:[Gt],mouseEnterDelay:wn,mouseLeaveDelay:Bt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Rn,popupMotion:Kn},fn),Le?dn:null)}}]),Ie}(L.Component);ln.defaultProps={onMouseEnter:it,onMouseLeave:it,onTitleMouseEnter:it,onTitleMouseLeave:it,onTitleClick:it,manualRef:it,mode:"vertical",title:""};var Xn=Object(o.b)(function(fe,Oe){var Ie=fe.openKeys,ye=fe.activeKey,ee=fe.selectedKeys,de=Oe.eventKey,re=Oe.subMenuKey;return{isOpen:Ie.indexOf(de)>-1,active:ye[re]===de,selectedKeys:ee}})(ln);Xn.isSubMenu=!0;var Cn=Xn,sr="menuitem-overflowed",di=.5,_i=function(fe){Object(v.a)(Ie,fe);var Oe=Object(h.a)(Ie);function Ie(){var ye;return Object(C.a)(this,Ie),ye=Oe.apply(this,arguments),ye.resizeObserver=null,ye.mutationObserver=null,ye.originalTotalWidth=0,ye.overflowedItems=[],ye.menuItemSizes=[],ye.cancelFrameId=null,ye.state={lastVisibleIndex:void 0},ye.childRef=L.createRef(),ye.getMenuItemNodes=function(){var ee=ye.props.prefixCls,de=ye.childRef.current;return de?[].slice.call(de.children).filter(function(re){return re.className.split(" ").indexOf("".concat(ee,"-overflowed-submenu"))<0}):[]},ye.getOverflowedSubMenuItem=function(ee,de,re){var _e=ye.props,xe=_e.overflowedIndicator,ke=_e.level,Le=_e.mode,je=_e.prefixCls,Ye=_e.theme;if(ke!==1||Le!=="horizontal")return null;var yt=ye.props.children[0],mt=yt.props,wt=mt.children,en=mt.title,pn=mt.style,nn=Object(P.a)(mt,["children","title","style"]),un=Object(V.a)({},pn),mn="".concat(ee,"-overflowed-indicator"),fn="".concat(ee,"-overflowed-indicator");de.length===0&&re!==!0?un=Object(V.a)(Object(V.a)({},un),{},{display:"none"}):re&&(un=Object(V.a)(Object(V.a)({},un),{},{visibility:"hidden",position:"absolute"}),mn="".concat(mn,"-placeholder"),fn="".concat(fn,"-placeholder"));var dn=Ye?"".concat(je,"-").concat(Ye):"",On={};return gt.forEach(function(En){nn[En]!==void 0&&(On[En]=nn[En])}),L.createElement(Cn,Object(E.a)({title:xe,className:"".concat(je,"-overflowed-submenu"),popupClassName:dn},On,{key:mn,eventKey:fn,disabled:!1,style:un}),de)},ye.setChildrenWidthAndResize=function(){if(ye.props.mode!=="horizontal")return;var ee=ye.childRef.current;if(!ee)return;var de=ee.children;if(!de||de.length===0)return;var re=ee.children[de.length-1];et(re,"display","inline-block");var _e=ye.getMenuItemNodes(),xe=_e.filter(function(ke){return ke.className.split(" ").indexOf(sr)>=0});xe.forEach(function(ke){et(ke,"display","inline-block")}),ye.menuItemSizes=_e.map(function(ke){return ut(ke,!0)}),xe.forEach(function(ke){et(ke,"display","none")}),ye.overflowedIndicatorWidth=ut(ee.children[ee.children.length-1],!0),ye.originalTotalWidth=ye.menuItemSizes.reduce(function(ke,Le){return ke+Le},0),ye.handleResize(),et(re,"display","none")},ye.handleResize=function(){if(ye.props.mode!=="horizontal")return;var ee=ye.childRef.current;if(!ee)return;var de=ut(ee);ye.overflowedItems=[];var re=0,_e;ye.originalTotalWidth>de+di&&(_e=-1,ye.menuItemSizes.forEach(function(xe){re+=xe,re+ye.overflowedIndicatorWidth<=de&&(_e+=1)})),ye.setState({lastVisibleIndex:_e})},ye}return Object(w.a)(Ie,[{key:"componentDidMount",value:function(){var ee=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var de=this.childRef.current;if(!de)return;this.resizeObserver=new St.default(function(re){re.forEach(function(){var _e=ee.cancelFrameId;cancelAnimationFrame(_e),ee.cancelFrameId=requestAnimationFrame(ee.setChildrenWidthAndResize)})}),[].slice.call(de.children).concat(de).forEach(function(re){ee.resizeObserver.observe(re)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ee.resizeObserver.disconnect(),[].slice.call(de.children).concat(de).forEach(function(re){ee.resizeObserver.observe(re)}),ee.setChildrenWidthAndResize()}),this.mutationObserver.observe(de,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(ee){var de=this,re=this.state.lastVisibleIndex;return(ee||[]).reduce(function(_e,xe,ke){var Le=xe;if(de.props.mode==="horizontal"){var je=de.getOverflowedSubMenuItem(xe.props.eventKey,[]);re!==void 0&&de.props.className.indexOf("".concat(de.props.prefixCls,"-root"))!==-1&&(ke>re&&(Le=L.cloneElement(xe,{style:{display:"none"},eventKey:"".concat(xe.props.eventKey,"-hidden"),className:"".concat(sr)})),ke===re+1&&(de.overflowedItems=ee.slice(re+1).map(function(yt){return L.cloneElement(yt,{key:yt.props.eventKey,mode:"vertical-left"})}),je=de.getOverflowedSubMenuItem(xe.props.eventKey,de.overflowedItems)));var Ye=[].concat(Object(I.a)(_e),[je,Le]);return ke===ee.length-1&&Ye.push(de.getOverflowedSubMenuItem(xe.props.eventKey,[],!0)),Ye}return[].concat(Object(I.a)(_e),[Le])},[])}},{key:"render",value:function(){var ee=this.props,de=ee.visible,re=ee.prefixCls,_e=ee.overflowedIndicator,xe=ee.mode,ke=ee.level,Le=ee.tag,je=ee.children,Ye=ee.theme,yt=Object(P.a)(ee,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),mt=Le;return L.createElement(mt,Object(E.a)({ref:this.childRef},yt),this.renderChildren(je))}}]),Ie}(L.Component);_i.defaultProps={tag:"div",className:""};var Cr=_i;function lr(fe){return fe.length?fe.every(function(Oe){return!!Oe.props.disabled}):!0}function gr(fe,Oe,Ie){var ye=fe.getState();fe.setState({activeKey:Object(V.a)(Object(V.a)({},ye.activeKey),{},Object(ae.a)({},Oe,Ie))})}function ji(fe){return fe.eventKey||"0-menu-"}function zi(fe,Oe){var Ie=Oe,ye=fe.children,ee=fe.eventKey;if(Ie){var de;if(Je(ye,function(re,_e){re&&re.props&&!re.props.disabled&&Ie===ct(re,ee,_e)&&(de=!0)}),de)return Ie}return Ie=null,fe.defaultActiveFirst&&Je(ye,function(re,_e){!Ie&&re&&!re.props.disabled&&(Ie=ct(re,ee,_e))}),Ie}function jr(fe){if(!fe)return;var Oe=this.instanceArray.indexOf(fe);Oe!==-1?this.instanceArray[Oe]=fe:this.instanceArray.push(fe)}var $i=function(fe){Object(v.a)(Ie,fe);var Oe=Object(h.a)(Ie);function Ie(ye){var ee;return Object(C.a)(this,Ie),ee=Oe.call(this,ye),ee.onKeyDown=function(de,re){var _e=de.keyCode,xe;if(ee.getFlatInstanceArray().forEach(function(Le){Le&&Le.props.active&&Le.onKeyDown&&(xe=Le.onKeyDown(de))}),xe)return 1;var ke=null;return(_e===l.a.UP||_e===l.a.DOWN)&&(ke=ee.step(_e===l.a.UP?-1:1)),ke?(de.preventDefault(),gr(ee.props.store,ji(ee.props),ke.props.eventKey),typeof re=="function"&&re(ke),1):void 0},ee.onItemHover=function(de){var re=de.key,_e=de.hover;gr(ee.props.store,ji(ee.props),_e?re:null)},ee.onDeselect=function(de){ee.props.onDeselect(de)},ee.onSelect=function(de){ee.props.onSelect(de)},ee.onClick=function(de){ee.props.onClick(de)},ee.onOpenChange=function(de){ee.props.onOpenChange(de)},ee.onDestroy=function(de){ee.props.onDestroy(de)},ee.getFlatInstanceArray=function(){return ee.instanceArray},ee.step=function(de){var re=ee.getFlatInstanceArray(),_e=ee.props.store.getState().activeKey[ji(ee.props)],xe=re.length;if(!xe)return null;de<0&&(re=re.concat().reverse());var ke=-1;if(re.every(function(yt,mt){return yt&&yt.props.eventKey===_e?(ke=mt,!1):!0}),!ee.props.defaultActiveFirst&&ke!==-1&&lr(re.slice(ke,xe-1)))return;var Le=(ke+1)%xe,je=Le;do{var Ye=re[je];if(!Ye||Ye.props.disabled)je=(je+1)%xe;else return Ye}while(je!==Le);return null},ee.renderCommonMenuItem=function(de,re,_e){var xe=ee.props.store.getState(),ke=Object(g.a)(ee),Le=ke.props,je=ct(de,Le.eventKey,re),Ye=de.props;if(!Ye||typeof de.type=="string")return de;var yt=je===xe.activeKey,mt=Object(V.a)(Object(V.a)({mode:Ye.mode||Le.mode,level:Le.level,inlineIndent:Le.inlineIndent,renderMenuItem:ee.renderMenuItem,rootPrefixCls:Le.prefixCls,index:re,parentMenu:Le.parentMenu,manualRef:Ye.disabled?void 0:Object(m.a)(de.ref,jr.bind(Object(g.a)(ee))),eventKey:je,active:!Ye.disabled&&yt,multiple:Le.multiple,onClick:function(en){(Ye.onClick||it)(en),ee.onClick(en)},onItemHover:ee.onItemHover,motion:Le.motion,subMenuOpenDelay:Le.subMenuOpenDelay,subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,onOpenChange:ee.onOpenChange,onDeselect:ee.onDeselect,onSelect:ee.onSelect,builtinPlacements:Le.builtinPlacements,itemIcon:Ye.itemIcon||ee.props.itemIcon,expandIcon:Ye.expandIcon||ee.props.expandIcon},_e),{},{direction:Le.direction});return(Le.mode==="inline"||qe())&&(mt.triggerSubMenuAction="click"),L.cloneElement(de,Object(V.a)(Object(V.a)({},mt),{},{key:je||re}))},ee.renderMenuItem=function(de,re,_e){if(!de)return null;var xe=ee.props.store.getState(),ke={openKeys:xe.openKeys,selectedKeys:xe.selectedKeys,triggerSubMenuAction:ee.props.triggerSubMenuAction,subMenuKey:_e};return ee.renderCommonMenuItem(de,re,ke)},ye.store.setState({activeKey:Object(V.a)(Object(V.a)({},ye.store.getState().activeKey),{},Object(ae.a)({},ye.eventKey,zi(ye,ye.activeKey)))}),ee.instanceArray=[],ee}return Object(w.a)(Ie,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ee){return this.props.visible||ee.visible||this.props.className!==ee.className||!N()(this.props.style,ee.style)}},{key:"componentDidUpdate",value:function(ee){var de=this.props,re="activeKey"in de?de.activeKey:de.store.getState().activeKey[ji(de)],_e=zi(de,re);if(_e!==re)gr(de.store,ji(de),_e);else if("activeKey"in ee){var xe=zi(ee,ee.activeKey);_e!==xe&&gr(de.store,ji(de),_e)}}},{key:"render",value:function(){var ee=this,de=Object(E.a)({},this.props);this.instanceArray=[];var re=H()(de.prefixCls,de.className,"".concat(de.prefixCls,"-").concat(de.mode)),_e={className:re,role:de.role||"menu"};de.id&&(_e.id=de.id),de.focusable&&(_e.tabIndex=0,_e.onKeyDown=this.onKeyDown);var xe=de.prefixCls,ke=de.eventKey,Le=de.visible,je=de.level,Ye=de.mode,yt=de.overflowedIndicator,mt=de.theme;return gt.forEach(function(wt){return delete de[wt]}),delete de.onClick,L.createElement(Cr,Object(E.a)({},de,{prefixCls:xe,mode:Ye,tag:"ul",level:je,theme:mt,visible:Le,overflowedIndicator:yt},_e),Object(U.a)(de.children).map(function(wt,en){return ee.renderMenuItem(wt,en,ke||"0-menu-")}))}}]),Ie}(L.Component);$i.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:it};var Fr=Object(o.b)()($i),Lr=Fr,Ji=Q("Kwbf");function Jr(fe,Oe,Ie){var ye=fe.prefixCls,ee=fe.motion,de=fe.defaultMotions,re=de===void 0?{}:de,_e=fe.openAnimation,xe=fe.openTransitionName,ke=Oe.switchingModeFromInline;if(ee)return ee;if(Object(j.a)(_e)==="object"&&_e)Object(Ji.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof _e=="string")return{motionName:"".concat(ye,"-open-").concat(_e)};if(xe)return{motionName:xe};var Le=re[Ie];return Le||(ke?null:re.other)}var Ft=function(fe){Object(v.a)(Ie,fe);var Oe=Object(h.a)(Ie);function Ie(ye){var ee;Object(C.a)(this,Ie),ee=Oe.call(this,ye),ee.onSelect=function(_e){var xe=Object(g.a)(ee),ke=xe.props;if(ke.selectable){var Le=ee.store.getState(),je=Le.selectedKeys,Ye=_e.key;ke.multiple?je=je.concat([Ye]):je=[Ye],"selectedKeys"in ke||ee.store.setState({selectedKeys:je}),ke.onSelect(Object(V.a)(Object(V.a)({},_e),{},{selectedKeys:je}))}},ee.onClick=function(_e){var xe=ee.getRealMenuMode(),ke=Object(g.a)(ee),Le=ke.store,je=ke.props.onOpenChange;xe!=="inline"&&!("openKeys"in ee.props)&&(Le.setState({openKeys:[]}),je([])),ee.props.onClick(_e)},ee.onKeyDown=function(_e,xe){ee.innerMenu.getWrappedInstance().onKeyDown(_e,xe)},ee.onOpenChange=function(_e){var xe=Object(g.a)(ee),ke=xe.props,Le=ee.store.getState().openKeys.concat(),je=!1,Ye=function(mt){var wt=!1;if(mt.open)wt=Le.indexOf(mt.key)===-1,wt&&Le.push(mt.key);else{var en=Le.indexOf(mt.key);wt=en!==-1,wt&&Le.splice(en,1)}je=je||wt};Array.isArray(_e)?_e.forEach(Ye):Ye(_e),je&&("openKeys"in ee.props||ee.store.setState({openKeys:Le}),ke.onOpenChange(Le))},ee.onDeselect=function(_e){var xe=Object(g.a)(ee),ke=xe.props;if(ke.selectable){var Le=ee.store.getState().selectedKeys.concat(),je=_e.key,Ye=Le.indexOf(je);Ye!==-1&&Le.splice(Ye,1),"selectedKeys"in ke||ee.store.setState({selectedKeys:Le}),ke.onDeselect(Object(V.a)(Object(V.a)({},_e),{},{selectedKeys:Le}))}},ee.onMouseEnter=function(_e){ee.restoreModeVerticalFromInline();var xe=ee.props.onMouseEnter;xe&&xe(_e)},ee.onTransitionEnd=function(_e){var xe=_e.propertyName==="width"&&_e.target===_e.currentTarget,ke=_e.target.className,Le=Object.prototype.toString.call(ke)==="[object SVGAnimatedString]"?ke.animVal:ke,je=_e.propertyName==="font-size"&&Le.indexOf("anticon")>=0;(xe||je)&&ee.restoreModeVerticalFromInline()},ee.setInnerMenu=function(_e){ee.innerMenu=_e},ee.isRootMenu=!0;var de=ye.defaultSelectedKeys,re=ye.defaultOpenKeys;return"selectedKeys"in ye&&(de=ye.selectedKeys||[]),"openKeys"in ye&&(re=ye.openKeys||[]),ee.store=Object(o.c)({selectedKeys:de,openKeys:re,activeKey:{"0-menu-":zi(ye,ye.activeKey)}}),ee.state={switchingModeFromInline:!1,prevProps:ye,inlineOpenKeys:[],store:ee.store},ee}return Object(w.a)(Ie,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ee){var de=this.props,re=de.siderCollapsed,_e=de.inlineCollapsed,xe=de.onOpenChange;(!ee.inlineCollapsed&&_e||!ee.siderCollapsed&&re)&&xe([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ee=this.props.collapsedWidth,de=this.store,re=this.prevOpenKeys,_e=this.getInlineCollapsed()&&(ee===0||ee==="0"||ee==="0px");_e?(this.prevOpenKeys=de.getState().openKeys.concat(),this.store.setState({openKeys:[]})):re&&(this.store.setState({openKeys:re}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ee=this.props.mode,de=this.state.switchingModeFromInline,re=this.getInlineCollapsed();return de&&re?"inline":re?"vertical":ee}},{key:"getInlineCollapsed",value:function(){var ee=this.props,de=ee.inlineCollapsed,re=ee.siderCollapsed;return re!==void 0?re:de}},{key:"restoreModeVerticalFromInline",value:function(){var ee=this.state.switchingModeFromInline;ee&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var ee=Object(V.a)({},Object(_.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),de=this.getRealMenuMode();return ee.className+=" ".concat(ee.prefixCls,"-root"),ee.direction==="rtl"&&(ee.className+=" ".concat(ee.prefixCls,"-rtl")),ee=Object(V.a)(Object(V.a)({},ee),{},{mode:de,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Jr(this.props,this.state,de)}),delete ee.openAnimation,delete ee.openTransitionName,L.createElement(o.a,{store:this.store},L.createElement(Lr,Object(E.a)({},ee,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ee,de){var re=de.prevProps,_e=de.store,xe=_e.getState(),ke={},Le={prevProps:ee};return re.mode==="inline"&&ee.mode!=="inline"&&(Le.switchingModeFromInline=!0),"openKeys"in ee?ke.openKeys=ee.openKeys||[]:((ee.inlineCollapsed&&!re.inlineCollapsed||ee.siderCollapsed&&!re.siderCollapsed)&&(Le.switchingModeFromInline=!0,Le.inlineOpenKeys=xe.openKeys,ke.openKeys=[]),(!ee.inlineCollapsed&&re.inlineCollapsed||!ee.siderCollapsed&&re.siderCollapsed)&&(ke.openKeys=de.inlineOpenKeys,Le.inlineOpenKeys=[])),Object.keys(ke).length&&_e.setState(ke),Le}}]),Ie}(L.Component);Ft.defaultProps={selectable:!0,onClick:it,onSelect:it,onOpenChange:it,onDeselect:it,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:L.createElement("span",null,"\xB7\xB7\xB7")};var qt=Ft,Ht=function(fe){Object(v.a)(Ie,fe);var Oe=Object(h.a)(Ie);function Ie(){var ye;return Object(C.a)(this,Ie),ye=Oe.apply(this,arguments),ye.onKeyDown=function(ee){var de=ee.keyCode;return de===l.a.ENTER?(ye.onClick(ee),!0):void 0},ye.onMouseLeave=function(ee){var de=ye.props,re=de.eventKey,_e=de.onItemHover,xe=de.onMouseLeave;_e({key:re,hover:!1}),xe({key:re,domEvent:ee})},ye.onMouseEnter=function(ee){var de=ye.props,re=de.eventKey,_e=de.onItemHover,xe=de.onMouseEnter;_e({key:re,hover:!0}),xe({key:re,domEvent:ee})},ye.onClick=function(ee){var de=ye.props,re=de.eventKey,_e=de.multiple,xe=de.onClick,ke=de.onSelect,Le=de.onDeselect,je=de.isSelected,Ye={key:re,keyPath:[re],item:Object(g.a)(ye),domEvent:ee};xe(Ye),_e?je?Le(Ye):ke(Ye):je||ke(Ye)},ye.saveNode=function(ee){ye.node=ee},ye}return Object(w.a)(Ie,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ee=this.props;ee.onDestroy&&ee.onDestroy(ee.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var ee,de=Object(V.a)({},this.props),re=H()(this.getPrefixCls(),de.className,(ee={},Object(ae.a)(ee,this.getActiveClassName(),!de.disabled&&de.active),Object(ae.a)(ee,this.getSelectedClassName(),de.isSelected),Object(ae.a)(ee,this.getDisabledClassName(),de.disabled),ee)),_e=Object(V.a)(Object(V.a)({},de.attribute),{},{title:typeof de.title=="string"?de.title:void 0,className:re,role:de.role||"menuitem","aria-disabled":de.disabled});de.role==="option"?_e=Object(V.a)(Object(V.a)({},_e),{},{role:"option","aria-selected":de.isSelected}):(de.role===null||de.role==="none")&&(_e.role="none");var xe={onClick:de.disabled?null:this.onClick,onMouseLeave:de.disabled?null:this.onMouseLeave,onMouseEnter:de.disabled?null:this.onMouseEnter},ke=Object(V.a)({},de.style);de.mode==="inline"&&(de.direction==="rtl"?ke.paddingRight=de.inlineIndent*de.level:ke.paddingLeft=de.inlineIndent*de.level),gt.forEach(function(je){return delete de[je]}),delete de.direction;var Le=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Le=L.createElement(this.props.itemIcon,this.props)),L.createElement("li",Object(E.a)({},Object(_.a)(de,["onClick","onMouseEnter","onMouseLeave","onSelect"]),_e,xe,{style:ke,ref:this.saveNode}),de.children,Le)}}]),Ie}(L.Component);Ht.isMenuItem=!0,Ht.defaultProps={onSelect:it,onMouseEnter:it,onMouseLeave:it,manualRef:it};var sn=Object(o.b)(function(fe,Oe){var Ie=fe.activeKey,ye=fe.selectedKeys,ee=Oe.eventKey,de=Oe.subMenuKey;return{active:Ie[de]===ee,isSelected:Array.isArray(ye)?ye.indexOf(ee)!==-1:ye===ee}})(Ht),yn=sn,Nn=function(fe){Object(v.a)(Ie,fe);var Oe=Object(h.a)(Ie);function Ie(){var ye;return Object(C.a)(this,Ie),ye=Oe.apply(this,arguments),ye.renderInnerMenuItem=function(ee){var de=ye.props,re=de.renderMenuItem,_e=de.index;return re(ee,_e,ye.props.subMenuKey)},ye}return Object(w.a)(Ie,[{key:"render",value:function(){var ee=Object(E.a)({},this.props),de=ee.className,re=de===void 0?"":de,_e=ee.rootPrefixCls,xe="".concat(_e,"-item-group-title"),ke="".concat(_e,"-item-group-list"),Le=ee.title,je=ee.children;return gt.forEach(function(Ye){return delete ee[Ye]}),delete ee.direction,L.createElement("li",Object(E.a)({},ee,{onClick:function(yt){return yt.stopPropagation()},className:"".concat(re," ").concat(_e,"-item-group")}),L.createElement("div",{className:xe,title:typeof Le=="string"?Le:void 0},Le),L.createElement("ul",{className:ke},L.Children.map(je,this.renderInnerMenuItem)))}}]),Ie}(L.Component);Nn.isMenuItemGroup=!0,Nn.defaultProps={disabled:!0};var bn=Nn,qn=function(Oe){var Ie=Oe.className,ye=Oe.rootPrefixCls,ee=Oe.style;return L.createElement("li",{className:"".concat(Ie," ").concat(ye,"-item-divider"),style:ee})};qn.defaultProps={disabled:!0,className:"",style:{}};var ki=qn,hn=qt,ur=Q("eDIo");function Dn(fe,Oe){var Ie=fe.prefixCls,ye=fe.editable,ee=fe.locale,de=fe.style;return!ye||ye.showAdd===!1?null:L.createElement("button",{ref:Oe,type:"button",className:"".concat(Ie,"-nav-add"),style:de,"aria-label":(ee==null?void 0:ee.addAriaLabel)||"Add tab",onClick:function(_e){ye.onEdit("add",{event:_e})}},ye.addIcon||"+")}var pi=L.forwardRef(Dn);function Ei(fe,Oe){var Ie=fe.prefixCls,ye=fe.id,ee=fe.tabs,de=fe.locale,re=fe.mobile,_e=fe.moreIcon,xe=_e===void 0?"More":_e,ke=fe.moreTransitionName,Le=fe.style,je=fe.className,Ye=fe.editable,yt=fe.tabBarGutter,mt=fe.rtl,wt=fe.onTabClick,en=Object(L.useState)(!1),pn=Object(X.a)(en,2),nn=pn[0],un=pn[1],mn=Object(L.useState)(null),fn=Object(X.a)(mn,2),dn=fn[0],On=fn[1],En="".concat(ye,"-more-popup"),ei="".concat(Ie,"-dropdown"),xn=dn!==null?"".concat(En,"-").concat(dn):null,Xt=de==null?void 0:de.dropdownAriaLabel,Gt=L.createElement(hn,{onClick:function(Kn){var Bn=Kn.key,ci=Kn.domEvent;wt(Bn,ci),un(!1)},id:En,tabIndex:-1,role:"listbox","aria-activedescendant":xn,selectedKeys:[dn],"aria-label":Xt!==void 0?Xt:"expanded dropdown"},ee.map(function(Mn){return L.createElement(yn,{key:Mn.key,id:"".concat(En,"-").concat(Mn.key),role:"option","aria-controls":ye&&"".concat(ye,"-panel-").concat(Mn.key),disabled:Mn.disabled},Mn.tab)}));function wn(Mn){for(var Kn=ee.filter(function(Vi){return!Vi.disabled}),Bn=Kn.findIndex(function(Vi){return Vi.key===dn})||0,ci=Kn.length,wi=0;wi<ci;wi+=1){Bn=(Bn+Mn+ci)%ci;var ri=Kn[Bn];if(!ri.disabled){On(ri.key);return}}}function Rn(Mn){var Kn=Mn.which;if(!nn){[l.a.DOWN,l.a.SPACE,l.a.ENTER].includes(Kn)&&(un(!0),Mn.preventDefault());return}switch(Kn){case l.a.UP:wn(-1),Mn.preventDefault();break;case l.a.DOWN:wn(1),Mn.preventDefault();break;case l.a.ESC:un(!1);break;case l.a.SPACE:case l.a.ENTER:dn!==null&&wt(dn,Mn);break}}Object(L.useEffect)(function(){var Mn=document.getElementById(xn);Mn&&Mn.scrollIntoView&&Mn.scrollIntoView(!1)},[dn]),Object(L.useEffect)(function(){nn||On(null)},[nn]);var Bt=Object(ae.a)({},mt?"marginLeft":"marginRight",yt);ee.length||(Bt.visibility="hidden",Bt.order=1);var An=H()(Object(ae.a)({},"".concat(ei,"-rtl"),mt)),ti=re?null:L.createElement(ur.a,{prefixCls:ei,overlay:Gt,trigger:["hover"],visible:nn,transitionName:ke,onVisibleChange:un,overlayClassName:An,mouseEnterDelay:.1,mouseLeaveDelay:.1},L.createElement("button",{type:"button",className:"".concat(Ie,"-nav-more"),style:Bt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":En,id:"".concat(ye,"-more"),"aria-expanded":nn,onKeyDown:Rn},xe));return L.createElement("div",{className:H()("".concat(Ie,"-nav-operations"),je),style:Le,ref:Oe},ti,L.createElement(pi,{prefixCls:Ie,locale:de,editable:Ye}))}var Qi=L.forwardRef(Ei),ma=Object(L.createContext)(null),kn=.1,Tn=.01,_n=20,Gi=Math.pow(.995,_n);function Br(){var fe=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(fe)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(fe.substr(0,4)))}function Hr(fe,Oe){var Ie=Object(L.useState)(),ye=Object(X.a)(Ie,2),ee=ye[0],de=ye[1],re=Object(L.useState)(0),_e=Object(X.a)(re,2),xe=_e[0],ke=_e[1],Le=Object(L.useState)(0),je=Object(X.a)(Le,2),Ye=je[0],yt=je[1],mt=Object(L.useState)(),wt=Object(X.a)(mt,2),en=wt[0],pn=wt[1],nn=Object(L.useRef)();function un(Xt){var Gt=Xt.touches[0],wn=Gt.screenX,Rn=Gt.screenY;de({x:wn,y:Rn}),window.clearInterval(nn.current)}function mn(Xt){if(!ee)return;Xt.preventDefault();var Gt=Xt.touches[0],wn=Gt.screenX,Rn=Gt.screenY;de({x:wn,y:Rn});var Bt=wn-ee.x,An=Rn-ee.y;Oe(Bt,An);var ti=Date.now();ke(ti),yt(ti-xe),pn({x:Bt,y:An})}function fn(){if(!ee)return;if(de(null),pn(null),en){var Xt=en.x/Ye,Gt=en.y/Ye,wn=Math.abs(Xt),Rn=Math.abs(Gt);if(Math.max(wn,Rn)<kn)return;var Bt=Xt,An=Gt;nn.current=window.setInterval(function(){if(Math.abs(Bt)<Tn&&Math.abs(An)<Tn){window.clearInterval(nn.current);return}Bt*=Gi,An*=Gi,Oe(Bt*_n,An*_n)},_n)}}var dn=Object(L.useRef)(0),On=Object(L.useRef)(!1),En=Object(L.useRef)();function ei(Xt){var Gt=Xt.deltaX,wn=Xt.deltaY,Rn=0,Bt=Math.abs(Gt),An=Math.abs(wn);Bt===An?Rn=En.current==="x"?Gt:wn:Bt>An?(Rn=Gt,En.current="x"):(Rn=wn,En.current="y");var ti=Date.now();ti-dn.current>100&&(On.current=!1),(Oe(-Rn,-Rn)||On.current)&&(Xt.preventDefault(),On.current=!0),dn.current=ti}var xn=Object(L.useRef)(null);xn.current={onTouchStart:un,onTouchMove:mn,onTouchEnd:fn,onWheel:ei},L.useEffect(function(){function Xt(Bt){xn.current.onTouchStart(Bt)}function Gt(Bt){xn.current.onTouchMove(Bt)}function wn(Bt){xn.current.onTouchEnd(Bt)}function Rn(Bt){xn.current.onWheel(Bt)}return document.addEventListener("touchmove",Gt,{passive:!1}),document.addEventListener("touchend",wn,{passive:!1}),fe.current.addEventListener("touchstart",Xt,{passive:!1}),fe.current.addEventListener("wheel",Rn),function(){document.removeEventListener("touchmove",Gt),document.removeEventListener("touchend",wn)}},[])}function ga(){var fe=Object(L.useRef)(new Map);function Oe(ye){return fe.current.has(ye)||fe.current.set(ye,L.createRef()),fe.current.get(ye)}function Ie(ye){fe.current.delete(ye)}return[Oe,Ie]}function va(fe,Oe){var Ie=L.useRef(fe),ye=L.useState({}),ee=Object(X.a)(ye,2),de=ee[1];function re(_e){var xe=typeof _e=="function"?_e(Ie.current):_e;xe!==Ie.current&&Oe(xe,Ie.current),Ie.current=xe,de({})}return[Ie.current,re]}var Sa=function(Oe){var Ie=Oe.position,ye=Oe.prefixCls,ee=Oe.extra;if(!ee)return null;var de,re=ee;return Ie==="right"&&(de=re.right||!re.left&&re||null),Ie==="left"&&(de=re.left||null),de?L.createElement("div",{className:"".concat(ye,"-extra-content")},de):null};function Va(fe,Oe){var Ie,ye=L.useContext(ma),ee=ye.prefixCls,de=ye.tabs,re=fe.className,_e=fe.style,xe=fe.id,ke=fe.animated,Le=fe.activeKey,je=fe.rtl,Ye=fe.extra,yt=fe.editable,mt=fe.locale,wt=fe.tabPosition,en=fe.tabBarGutter,pn=fe.children,nn=fe.onTabClick,un=fe.onTabScroll,mn=Object(L.useRef)(),fn=Object(L.useRef)(),dn=Object(L.useRef)(),On=Object(L.useRef)(),En=ga(),ei=Object(X.a)(En,2),xn=ei[0],Xt=ei[1],Gt=wt==="top"||wt==="bottom",wn=va(0,function(jn,Sn){Gt&&un&&un({direction:jn>Sn?"left":"right"})}),Rn=Object(X.a)(wn,2),Bt=Rn[0],An=Rn[1],ti=va(0,function(jn,Sn){!Gt&&un&&un({direction:jn>Sn?"top":"bottom"})}),Mn=Object(X.a)(ti,2),Kn=Mn[0],Bn=Mn[1],ci=Object(L.useState)(0),wi=Object(X.a)(ci,2),ri=wi[0],Vi=wi[1],br=Object(L.useState)(0),Zi=Object(X.a)(br,2),Si=Zi[0],$n=Zi[1],zn=Object(L.useState)(0),ai=Object(X.a)(zn,2),ni=ai[0],_r=ai[1],Wr=Object(L.useState)(0),Kr=Object(X.a)(Wr,2),Hn=Kr[0],Or=Kr[1],zr=Object(L.useState)(null),Yn=Object(X.a)(zr,2),Fn=Yn[0],Ci=Yn[1],To=Object(L.useState)(null),Ja=Object(X.a)(To,2),Gr=Ja[0],aa=Ja[1],Ca=Object(L.useState)(0),Qa=Object(X.a)(Ca,2),Oa=Qa[0],Xo=Qa[1],Yo=Object(L.useState)(0),wo=Object(X.a)(Yo,2),Za=wo[0],qa=wo[1],oa=r(new Map),sa=Object(X.a)(oa,2),$o=sa[0],Ra=sa[1],ya=f(de,$o,ri),la="".concat(ee,"-nav-operations-hidden"),ua=0,Er=0;Gt?je?(ua=0,Er=Math.max(0,ri-Fn)):(ua=Math.min(0,Fn-ri),Er=0):(ua=Math.min(0,Gr-Si),Er=0);function Qr(jn){return jn<ua?[ua,!1]:jn>Er?[Er,!1]:[jn,!0]}var Vr=Object(L.useRef)(),ba=Object(L.useState)(),Zr=Object(X.a)(ba,2),Aa=Zr[0],eo=Zr[1];function La(){eo(Date.now())}function to(){window.clearTimeout(Vr.current)}Hr(mn,function(jn,Sn){var Oi=!1;function er(da,Dr){da(function(xa){var Yr=Qr(xa+Dr),Ri=Object(X.a)(Yr,2),ka=Ri[0],io=Ri[1];return Oi=io,ka})}if(Gt){if(Fn>=ri)return Oi;er(An,jn)}else{if(Gr>=Si)return Oi;er(Bn,Sn)}return to(),La(),Oi}),Object(L.useEffect)(function(){return to(),Aa&&(Vr.current=window.setTimeout(function(){eo(0)},100)),to},[Aa]);function Xr(){var jn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Le,Sn=ya.get(jn);if(!Sn)return;if(Gt){var Oi=Bt;je?Sn.right<Bt?Oi=Sn.right:Sn.right+Sn.width>Bt+Fn&&(Oi=Sn.right+Sn.width-Fn):Sn.left<-Bt?Oi=-Sn.left:Sn.left+Sn.width>-Bt+Fn&&(Oi=-(Sn.left+Sn.width-Fn)),Bn(0),An(Qr(Oi)[0])}else{var er=Kn;Sn.top<-Kn?er=-Sn.top:Sn.top+Sn.height>-Kn+Gr&&(er=-(Sn.top+Sn.height-Gr)),An(0),Bn(Qr(er)[0])}}var qr=S(ya,{width:Fn,height:Gr,left:Bt,top:Kn},{width:ni,height:Hn},{width:Oa,height:Za},Object(V.a)(Object(V.a)({},fe),{},{tabs:de})),So=Object(X.a)(qr,2),Jo=So[0],Qo=So[1],Zo=de.map(function(jn){var Sn=jn.key;return L.createElement(a,{id:xe,prefixCls:ee,key:Sn,rtl:je,tab:jn,closable:jn.closable,editable:yt,active:Sn===Le,tabPosition:wt,tabBarGutter:en,renderWrapper:pn,removeAriaLabel:mt==null?void 0:mt.removeAriaLabel,ref:xn(Sn),onClick:function(er){nn(Sn,er)},onRemove:function(){Xt(Sn)},onFocus:function(){Xr(Sn),La(),je||(mn.current.scrollLeft=0),mn.current.scrollTop=0}})}),no=c(function(){var jn,Sn,Oi,er,da,Dr,xa,Yr,Ri,ka=((jn=mn.current)===null||jn===void 0?void 0:jn.offsetWidth)||0,io=((Sn=mn.current)===null||Sn===void 0?void 0:Sn.offsetHeight)||0,ro=((Oi=On.current)===null||Oi===void 0?void 0:Oi.offsetWidth)||0,tr=((er=On.current)===null||er===void 0?void 0:er.offsetHeight)||0,Un=((da=dn.current)===null||da===void 0?void 0:da.offsetWidth)||0,Tr=((Dr=dn.current)===null||Dr===void 0?void 0:Dr.offsetHeight)||0;Ci(ka),aa(io),Xo(ro),qa(tr);var kr=(((xa=fn.current)===null||xa===void 0?void 0:xa.offsetWidth)||0)-ro,Mr=(((Yr=fn.current)===null||Yr===void 0?void 0:Yr.offsetHeight)||0)-tr;Vi(kr),$n(Mr);var ao=(Ri=dn.current)===null||Ri===void 0?void 0:Ri.className.includes(la);_r(kr-(ao?0:Un)),Or(Mr-(ao?0:Tr)),Ra(function(){var Ma=new Map;return de.forEach(function(Lo){var Io=Lo.key,ta=xn(Io).current;ta&&Ma.set(Io,{width:ta.offsetWidth,height:ta.offsetHeight,left:ta.offsetLeft,top:ta.offsetTop})}),Ma})}),qo=de.slice(0,Jo),qi=de.slice(Qo+1),mi=[].concat(Object(I.a)(qo),Object(I.a)(qi)),Fi=Object(L.useState)(),gi=Object(X.a)(Fi,2),_a=gi[0],es=gi[1],xr=ya.get(Le),Co=Object(L.useRef)();function Oo(){y.a.cancel(Co.current)}Object(L.useEffect)(function(){var jn={};return xr&&(Gt?(je?jn.right=xr.right:jn.left=xr.left,jn.width=xr.width):(jn.top=xr.top,jn.height=xr.height)),Oo(),Co.current=y()(function(){es(jn)}),Oo},[xr,Gt,je]),Object(L.useEffect)(function(){Xr()},[Le,xr,ya,Gt]),Object(L.useEffect)(function(){no()},[je,en,Le,de.map(function(jn){return jn.key}).join("_")]);var Ro=!!mi.length,ea="".concat(ee,"-nav-wrap"),Ia,Ea,Ao,Da;return Gt?je?(Ea=Bt>0,Ia=Bt+Fn<ri):(Ia=Bt<0,Ea=-Bt+Fn<ri):(Ao=Kn<0,Da=-Kn+Gr<Si),L.createElement("div",{ref:Oe,role:"tablist",className:H()("".concat(ee,"-nav"),re),style:_e,onKeyDown:function(){La()}},L.createElement(Sa,{position:"left",extra:Ye,prefixCls:ee}),L.createElement(p.a,{onResize:no},L.createElement("div",{className:H()(ea,(Ie={},Object(ae.a)(Ie,"".concat(ea,"-ping-left"),Ia),Object(ae.a)(Ie,"".concat(ea,"-ping-right"),Ea),Object(ae.a)(Ie,"".concat(ea,"-ping-top"),Ao),Object(ae.a)(Ie,"".concat(ea,"-ping-bottom"),Da),Ie)),ref:mn},L.createElement(p.a,{onResize:no},L.createElement("div",{ref:fn,className:"".concat(ee,"-nav-list"),style:{transform:"translate(".concat(Bt,"px, ").concat(Kn,"px)"),transition:Aa?"none":void 0}},Zo,L.createElement(pi,{ref:On,prefixCls:ee,locale:mt,editable:yt,style:{visibility:Ro?"hidden":null}}),L.createElement("div",{className:H()("".concat(ee,"-ink-bar"),Object(ae.a)({},"".concat(ee,"-ink-bar-animated"),ke.inkBar)),style:_a}))))),L.createElement(Qi,Object.assign({},fe,{ref:dn,prefixCls:ee,tabs:mi,className:!Ro&&la})),L.createElement(Sa,{position:"right",extra:Ye,prefixCls:ee}))}var Xa=L.forwardRef(Va);function Go(fe){var Oe=fe.id,Ie=fe.activeKey,ye=fe.animated,ee=fe.tabPosition,de=fe.rtl,re=fe.destroyInactiveTabPane,_e=L.useContext(ma),xe=_e.prefixCls,ke=_e.tabs,Le=ye.tabPane,je=ke.findIndex(function(Ye){return Ye.key===Ie});return L.createElement("div",{className:H()("".concat(xe,"-content-holder"))},L.createElement("div",{className:H()("".concat(xe,"-content"),"".concat(xe,"-content-").concat(ee),Object(ae.a)({},"".concat(xe,"-content-animated"),Le)),style:je&&Le?Object(ae.a)({},de?"marginRight":"marginLeft","-".concat(je,"00%")):null},ke.map(function(Ye){return L.cloneElement(Ye.node,{key:Ye.key,prefixCls:xe,tabKey:Ye.key,id:Oe,animated:Le,active:Ye.key===Ie,destroyInactiveTabPane:re})})))}function Eo(fe){var Oe=fe.prefixCls,Ie=fe.forceRender,ye=fe.className,ee=fe.style,de=fe.id,re=fe.active,_e=fe.animated,xe=fe.destroyInactiveTabPane,ke=fe.tabKey,Le=fe.children,je=L.useState(Ie),Ye=Object(X.a)(je,2),yt=Ye[0],mt=Ye[1];L.useEffect(function(){re?mt(!0):xe&&mt(!1)},[re,xe]);var wt={};return re||(_e?(wt.visibility="hidden",wt.height=0,wt.overflowY="hidden"):wt.display="none"),L.createElement("div",{id:de&&"".concat(de,"-panel-").concat(ke),role:"tabpanel",tabIndex:re?0:-1,"aria-labelledby":de&&"".concat(de,"-tab-").concat(ke),"aria-hidden":!re,style:Object(V.a)(Object(V.a)({},wt),ee),className:H()("".concat(Oe,"-tabpane"),re&&"".concat(Oe,"-tabpane-active"),ye)},(re||yt||Ie)&&Le)}var Ya=0;function xo(fe){return Object(U.a)(fe).map(function(Oe){if(L.isValidElement(Oe)){var Ie=Oe.key!==void 0?String(Oe.key):void 0;return Object(V.a)(Object(V.a)({key:Ie},Oe.props),{},{node:Oe})}return null}).filter(function(Oe){return Oe})}function Vo(fe,Oe){var Ie,ye=fe.id,ee=fe.prefixCls,de=ee===void 0?"rc-tabs":ee,re=fe.className,_e=fe.children,xe=fe.direction,ke=fe.activeKey,Le=fe.defaultActiveKey,je=fe.editable,Ye=fe.animated,yt=fe.tabPosition,mt=yt===void 0?"top":yt,wt=fe.tabBarGutter,en=fe.tabBarStyle,pn=fe.tabBarExtraContent,nn=fe.locale,un=fe.moreIcon,mn=fe.moreTransitionName,fn=fe.destroyInactiveTabPane,dn=fe.renderTabBar,On=fe.onChange,En=fe.onTabClick,ei=fe.onTabScroll,xn=Object(P.a)(fe,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Xt=xo(_e),Gt=xe==="rtl",wn;Ye===!1?wn={inkBar:!1,tabPane:!1}:wn=Object(V.a)({inkBar:!0,tabPane:!1},Ye!==!0?Ye:null);var Rn=Object(L.useState)(!1),Bt=Object(X.a)(Rn,2),An=Bt[0],ti=Bt[1];Object(L.useEffect)(function(){ti(Br())},[]);var Mn=Object(k.a)(function(){var Hn;return(Hn=Xt[0])===null||Hn===void 0?void 0:Hn.key},{value:ke,defaultValue:Le}),Kn=Object(X.a)(Mn,2),Bn=Kn[0],ci=Kn[1],wi=Object(L.useState)(function(){return Xt.findIndex(function(Hn){return Hn.key===Bn})}),ri=Object(X.a)(wi,2),Vi=ri[0],br=ri[1];Object(L.useEffect)(function(){var Hn=Xt.findIndex(function(zr){return zr.key===Bn});if(Hn===-1){var Or;Hn=Math.max(0,Math.min(Vi,Xt.length-1)),ci((Or=Xt[Hn])===null||Or===void 0?void 0:Or.key)}br(Hn)},[Xt.map(function(Hn){return Hn.key}).join("_"),Bn,Vi]);var Zi=Object(k.a)(null,{value:ye}),Si=Object(X.a)(Zi,2),$n=Si[0],zn=Si[1],ai=mt;An&&!["left","right"].includes(mt)&&(ai="top"),Object(L.useEffect)(function(){ye||(zn("rc-tabs-".concat(Ya)),Ya+=1)},[]);function ni(Hn,Or){En==null||En(Hn,Or),ci(Hn),On==null||On(Hn)}var _r={id:$n,activeKey:Bn,animated:wn,tabPosition:ai,rtl:Gt,mobile:An},Wr,Kr=Object(V.a)(Object(V.a)({},_r),{},{editable:je,locale:nn,moreIcon:un,moreTransitionName:mn,tabBarGutter:wt,onTabClick:ni,onTabScroll:ei,extra:pn,style:en,panes:_e});return dn?Wr=dn(Kr,Xa):Wr=L.createElement(Xa,Object.assign({},Kr)),L.createElement(ma.Provider,{value:{tabs:Xt,prefixCls:de}},L.createElement("div",Object.assign({ref:Oe,id:ye,className:H()(de,"".concat(de,"-").concat(ai),(Ie={},Object(ae.a)(Ie,"".concat(de,"-mobile"),An),Object(ae.a)(Ie,"".concat(de,"-editable"),je),Object(ae.a)(Ie,"".concat(de,"-rtl"),Gt),Ie),re)},xn),Wr,L.createElement(Go,Object.assign({destroyInactiveTabPane:fn},_r,{animated:wn}))))}var ra=L.forwardRef(Vo);ra.TabPane=Eo;var Ir=ra,$a=$e.b=Ir},kSUc:function(Rt,$e,Q){},lZu9:function(Rt,$e,Q){(function(ae){ae(Q("VrN/"),Q("1eCo"),Q("8EBN"))})(function(ae){"use strict";ae.defineMode("markdown",function(X,P){var V=ae.getMode(X,"text/html"),L=V.name=="null";function M(B){if(ae.findModeByName){var R=ae.findModeByName(B);R&&(B=R.mime||R.mimes[0])}var $=ae.getMode(X,B);return $.name=="null"?null:$}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var H={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 U in H)H.hasOwnProperty(U)&&P.tokenTypeOverrides[U]&&(H[U]=P.tokenTypeOverrides[U]);var k=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,y=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,r=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,l=/^\s*\[[^\]]+?\]:.*$/,u=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,a=" ";function s(B,R,$){return R.f=R.inline=$,$(B,R)}function f(B,R,$){return R.f=R.block=$,$(B,R)}function O(B){return!B||!/\S/.test(B.string)}function S(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==C){var R=L;if(!R){var $=ae.innerMode(V,B.htmlState);R=$.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText}R&&(B.f=h,B.block=E,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function E(B,R){var $=B.column()===R.indentation,te=O(R.prevLine.stream),ue=R.indentedCode,me=R.prevLine.hr,Me=R.list!==!1,Ae=(R.listStack[R.listStack.length-1]||0)+3;R.indentedCode=!1;var De=R.indentation;if(R.indentationDiff===null&&(R.indentationDiff=R.indentation,Me)){for(R.list=null;De<R.listStack[R.listStack.length-1];)R.listStack.pop(),R.listStack.length?R.indentation=R.listStack[R.listStack.length-1]:R.list=!1;R.list!==!1&&(R.indentationDiff=De-R.listStack[R.listStack.length-1])}var Fe=!te&&!me&&!R.prevLine.header&&(!Me||!ue)&&!R.prevLine.fencedCodeEnd,Ne=(R.list===!1||me||te)&&R.indentation<=Ae&&B.match(k),Ee=null;if(R.indentationDiff>=4&&(ue||R.prevLine.fencedCodeEnd||R.prevLine.header||te))return B.skipToEnd(),R.indentedCode=!0,H.code;if(B.eatSpace())return null;if($&&R.indentation<=Ae&&(Ee=B.match(y))&&Ee[1].length<=6)return R.quote=0,R.header=Ee[1].length,R.thisLine.header=!0,P.highlightFormatting&&(R.formatting="header"),R.f=R.inline,g(R);if(R.indentation<=Ae&&B.eat(">"))return R.quote=$?1:R.quote+1,P.highlightFormatting&&(R.formatting="quote"),B.eatSpace(),g(R);if(!Ne&&!R.setext&&$&&R.indentation<=Ae&&(Ee=B.match(I))){var se=Ee[1]?"ol":"ul";return R.indentation=De+B.current().length,R.list=!0,R.quote=0,R.listStack.push(R.indentation),R.em=!1,R.strong=!1,R.code=!1,R.strikethrough=!1,P.taskLists&&B.match(b,!1)&&(R.taskList=!0),R.f=R.inline,P.highlightFormatting&&(R.formatting=["list","list-"+se]),g(R)}else{if($&&R.indentation<=Ae&&(Ee=B.match(r,!0)))return R.quote=0,R.fencedEndRE=new RegExp(Ee[1]+"+ *$"),R.localMode=P.fencedCodeBlockHighlighting&&M(Ee[2]||P.fencedCodeBlockDefaultMode),R.localMode&&(R.localState=ae.startState(R.localMode)),R.f=R.block=w,P.highlightFormatting&&(R.formatting="code-block"),R.code=-1,g(R);if(R.setext||(!Fe||!Me)&&!R.quote&&R.list===!1&&!R.code&&!Ne&&!l.test(B.string)&&(Ee=B.lookAhead(1))&&(Ee=Ee.match(p)))return R.setext?(R.header=R.setext,R.setext=0,B.skipToEnd(),P.highlightFormatting&&(R.formatting="header")):(R.header=Ee[0].charAt(0)=="="?1:2,R.setext=R.header),R.thisLine.header=!0,R.f=R.inline,g(R);if(Ne)return B.skipToEnd(),R.hr=!0,R.thisLine.hr=!0,H.hr;if(B.peek()==="[")return s(B,R,N)}return s(B,R,R.inline)}function C(B,R){var $=V.token(B,R.htmlState);if(!L){var te=ae.innerMode(V,R.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||R.md_inside&&B.current().indexOf(">")>-1)&&(R.f=h,R.block=E,R.htmlState=null)}return $}function w(B,R){var $=R.listStack[R.listStack.length-1]||0,te=R.indentation<$,ue=$+3;if(R.fencedEndRE&&R.indentation<=ue&&(te||B.match(R.fencedEndRE))){P.highlightFormatting&&(R.formatting="code-block");var me;return te||(me=g(R)),R.localMode=R.localState=null,R.block=E,R.f=h,R.fencedEndRE=null,R.code=0,R.thisLine.fencedCodeEnd=!0,te?f(B,R,R.block):me}else return R.localMode?R.localMode.token(B,R.localState):(B.skipToEnd(),H.code)}function g(B){var R=[];if(B.formatting){R.push(H.formatting),typeof B.formatting=="string"&&(B.formatting=[B.formatting]);for(var $=0;$<B.formatting.length;$++)R.push(H.formatting+"-"+B.formatting[$]),B.formatting[$]==="header"&&R.push(H.formatting+"-"+B.formatting[$]+"-"+B.header),B.formatting[$]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=B.quote?R.push(H.formatting+"-"+B.formatting[$]+"-"+B.quote):R.push("error"))}if(B.taskOpen)return R.push("meta"),R.length?R.join(" "):null;if(B.taskClosed)return R.push("property"),R.length?R.join(" "):null;if(B.linkHref?R.push(H.linkHref,"url"):(B.strong&&R.push(H.strong),B.em&&R.push(H.em),B.strikethrough&&R.push(H.strikethrough),B.emoji&&R.push(H.emoji),B.linkText&&R.push(H.linkText),B.code&&R.push(H.code),B.image&&R.push(H.image),B.imageAltText&&R.push(H.imageAltText,"link"),B.imageMarker&&R.push(H.imageMarker)),B.header&&R.push(H.header,H.header+"-"+B.header),B.quote&&(R.push(H.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=B.quote?R.push(H.quote+"-"+B.quote):R.push(H.quote+"-"+P.maxBlockquoteDepth)),B.list!==!1){var te=(B.listStack.length-1)%3;te?te===1?R.push(H.list2):R.push(H.list3):R.push(H.list1)}return B.trailingSpaceNewLine?R.push("trailing-space-new-line"):B.trailingSpace&&R.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),R.length?R.join(" "):null}function v(B,R){return B.match(c,!0)?g(R):void 0}function h(B,R){var $=R.text(B,R);if(typeof $!="undefined")return $;if(R.list)return R.list=null,g(R);if(R.taskList){var te=B.match(b,!0)[1]===" ";return te?R.taskOpen=!0:R.taskClosed=!0,P.highlightFormatting&&(R.formatting="task"),R.taskList=!1,g(R)}if(R.taskOpen=!1,R.taskClosed=!1,R.header&&B.match(/^#+$/,!0))return P.highlightFormatting&&(R.formatting="header"),g(R);var ue=B.next();if(R.linkTitle){R.linkTitle=!1;var me=ue;ue==="("&&(me=")"),me=(me+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Me="^\\s*(?:[^"+me+"\\\\]+|\\\\\\\\|\\\\.)"+me;if(B.match(new RegExp(Me),!0))return H.linkHref}if(ue==="`"){var Ae=R.formatting;P.highlightFormatting&&(R.formatting="code"),B.eatWhile("`");var De=B.current().length;if(R.code==0&&(!R.quote||De==1))return R.code=De,g(R);if(De==R.code){var Fe=g(R);return R.code=0,Fe}else return R.formatting=Ae,g(R)}else if(R.code)return g(R);if(ue==="\\"&&(B.next(),P.highlightFormatting)){var Ne=g(R),Ee=H.formatting+"-escape";return Ne?Ne+" "+Ee:Ee}if(ue==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return R.imageMarker=!0,R.image=!0,P.highlightFormatting&&(R.formatting="image"),g(R);if(ue==="["&&R.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return R.imageMarker=!1,R.imageAltText=!0,P.highlightFormatting&&(R.formatting="image"),g(R);if(ue==="]"&&R.imageAltText){P.highlightFormatting&&(R.formatting="image");var Ne=g(R);return R.imageAltText=!1,R.image=!1,R.inline=R.f=_,Ne}if(ue==="["&&!R.image)return R.linkText&&B.match(/^.*?\]/)||(R.linkText=!0,P.highlightFormatting&&(R.formatting="link")),g(R);if(ue==="]"&&R.linkText){P.highlightFormatting&&(R.formatting="link");var Ne=g(R);return R.linkText=!1,R.inline=R.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?_:h,Ne}if(ue==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){R.f=R.inline=o,P.highlightFormatting&&(R.formatting="link");var Ne=g(R);return Ne?Ne+=" ":Ne="",Ne+H.linkInline}if(ue==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){R.f=R.inline=o,P.highlightFormatting&&(R.formatting="link");var Ne=g(R);return Ne?Ne+=" ":Ne="",Ne+H.linkEmail}if(P.xml&&ue==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var se=B.string.indexOf(">",B.pos);if(se!=-1){var He=B.string.substring(B.start,se);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(He)&&(R.md_inside=!0)}return B.backUp(1),R.htmlState=ae.startState(V),f(B,R,C)}if(P.xml&&ue==="<"&&B.match(/^\/\w*?>/))return R.md_inside=!1,"tag";if(ue==="*"||ue==="_"){for(var ft=1,lt=B.pos==1?" ":B.string.charAt(B.pos-2);ft<3&&B.eat(ue);)ft++;var it=B.peek()||" ",ct=!/\s/.test(it)&&(!u.test(it)||/\s/.test(lt)||u.test(lt)),Ve=!/\s/.test(lt)&&(!u.test(lt)||/\s/.test(it)||u.test(it)),Je=null,st=null;if(ft%2&&(!R.em&&ct&&(ue==="*"||!Ve||u.test(lt))?Je=!0:R.em==ue&&Ve&&(ue==="*"||!ct||u.test(it))&&(Je=!1)),ft>1&&(!R.strong&&ct&&(ue==="*"||!Ve||u.test(lt))?st=!0:R.strong==ue&&Ve&&(ue==="*"||!ct||u.test(it))&&(st=!1)),st!=null||Je!=null){P.highlightFormatting&&(R.formatting=Je==null?"strong":st==null?"em":"strong em"),Je===!0&&(R.em=ue),st===!0&&(R.strong=ue);var Fe=g(R);return Je===!1&&(R.em=!1),st===!1&&(R.strong=!1),Fe}}else if(ue===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return g(R);B.backUp(1)}if(P.strikethrough){if(ue==="~"&&B.eatWhile(ue)){if(R.strikethrough){P.highlightFormatting&&(R.formatting="strikethrough");var Fe=g(R);return R.strikethrough=!1,Fe}else if(B.match(/^[^\s]/,!1))return R.strikethrough=!0,P.highlightFormatting&&(R.formatting="strikethrough"),g(R)}else if(ue===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return g(R);B.backUp(2)}}if(P.emoji&&ue===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){R.emoji=!0,P.highlightFormatting&&(R.formatting="emoji");var gt=g(R);return R.emoji=!1,gt}return ue===" "&&(B.match(/^ +$/,!1)?R.trailingSpace++:R.trailingSpace&&(R.trailingSpaceNewLine=!0)),g(R)}function o(B,R){var $=B.next();if($===">"){R.f=R.inline=h,P.highlightFormatting&&(R.formatting="link");var te=g(R);return te?te+=" ":te="",te+H.linkInline}return B.match(/^[^>]+/,!0),H.linkInline}function _(B,R){if(B.eatSpace())return null;var $=B.next();return $==="("||$==="["?(R.f=R.inline=T($==="("?")":"]"),P.highlightFormatting&&(R.formatting="link-string"),R.linkHref=!0,g(R)):"error"}var m={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function T(B){return function(R,$){var te=R.next();if(te===B){$.f=$.inline=h,P.highlightFormatting&&($.formatting="link-string");var ue=g($);return $.linkHref=!1,ue}return R.match(m[B]),$.linkHref=!0,g($)}}function N(B,R){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(R.f=j,B.next(),P.highlightFormatting&&(R.formatting="link"),R.linkText=!0,g(R)):s(B,R,h)}function j(B,R){if(B.match(/^\]:/,!0)){R.f=R.inline=W,P.highlightFormatting&&(R.formatting="link");var $=g(R);return R.linkText=!1,$}return B.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function W(B,R){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?R.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),R.f=R.inline=h,H.linkHref+" url")}var Y={startState:function(){return{f:E,prevLine:{stream:null},thisLine:{stream:null},block:E,htmlState:null,indentation:0,inline:h,text:v,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(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&ae.copyState(V,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?ae.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,R){if(R.formatting=!1,B!=R.thisLine.stream){if(R.header=0,R.hr=!1,B.match(/^\s*$/,!0))return S(R),null;if(R.prevLine=R.thisLine,R.thisLine={stream:B},R.taskList=!1,R.trailingSpace=0,R.trailingSpaceNewLine=!1,!R.localState&&(R.f=R.block,R.f!=C)){var $=B.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(R.indentation=$,R.indentationDiff=null,$>0)return null}}return R.f(B,R)},innerMode:function(B){return B.block==C?{state:B.htmlState,mode:V}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:Y}},indent:function(B,R,$){return B.block==C&&V.indent?V.indent(B.htmlState,R,$):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,R,$):ae.Pass},blankLine:S,getType:g,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Y},"xml"),ae.defineMIME("text/markdown","markdown"),ae.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return U});var ae=Q("q1tI"),X=Q("biw7"),P=Q("fyJ8");function V(k){var I=k.className,b=k.index,y=k.children,p=k.colSpan,c=k.rowSpan,r=ae.useContext(X.a),l=r.prefixCls,u=r.fixedInfoList,a=u[b];return ae.createElement(P.a,Object.assign({className:I,index:b,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:y,props:{colSpan:p,rowSpan:c}}}},a))}function L(k){return ae.createElement("tr",Object.assign({},k))}function M(k){var I=k.children,b=ae.useContext(X.a),y=b.prefixCls;return ae.createElement("tfoot",{className:"".concat(y,"-summary")},I)}var H=$e.b=M,U={Cell:V,Row:L}},osHv:function(Rt,$e,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";var X=ae.Pos;function P(u,a){return u.line-a.line||u.ch-a.ch}var V="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",L=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+V+"]["+L+"]*)","g");function H(u,a,s,f){this.line=a,this.ch=s,this.cm=u,this.text=u.getLine(a),this.min=f?Math.max(f.from,u.firstLine()):u.firstLine(),this.max=f?Math.min(f.to-1,u.lastLine()):u.lastLine()}function U(u,a){var s=u.cm.getTokenTypeAt(X(u.line,a));return s&&/\btag\b/.test(s)}function k(u){return u.line>=u.max?void 0:(u.ch=0,u.text=u.cm.getLine(++u.line),!0)}function I(u){return u.line<=u.min?void 0:(u.text=u.cm.getLine(--u.line),u.ch=u.text.length,!0)}function b(u){for(;;){var a=u.text.indexOf(">",u.ch);if(a==-1){if(k(u))continue;return}if(!U(u,a+1)){u.ch=a+1;continue}var s=u.text.lastIndexOf("/",a),f=s>-1&&!/\S/.test(u.text.slice(s+1,a));return u.ch=a+1,f?"selfClose":"regular"}}function y(u){for(;;){var a=u.ch?u.text.lastIndexOf("<",u.ch-1):-1;if(a==-1){if(I(u))continue;return}if(!U(u,a+1)){u.ch=a;continue}M.lastIndex=a,u.ch=a;var s=M.exec(u.text);if(s&&s.index==a)return s}}function p(u){for(;;){M.lastIndex=u.ch;var a=M.exec(u.text);if(!a){if(k(u))continue;return}if(!U(u,a.index+1)){u.ch=a.index+1;continue}return u.ch=a.index+a[0].length,a}}function c(u){for(;;){var a=u.ch?u.text.lastIndexOf(">",u.ch-1):-1;if(a==-1){if(I(u))continue;return}if(!U(u,a+1)){u.ch=a;continue}var s=u.text.lastIndexOf("/",a),f=s>-1&&!/\S/.test(u.text.slice(s+1,a));return u.ch=a+1,f?"selfClose":"regular"}}function r(u,a){for(var s=[];;){var f=p(u),O,S=u.line,E=u.ch-(f?f[0].length:0);if(!f||!(O=b(u)))return;if(O=="selfClose")continue;if(f[1]){for(var C=s.length-1;C>=0;--C)if(s[C]==f[2]){s.length=C;break}if(C<0&&(!a||a==f[2]))return{tag:f[2],from:X(S,E),to:X(u.line,u.ch)}}else s.push(f[2])}}function l(u,a){for(var s=[];;){var f=c(u);if(!f)return;if(f=="selfClose"){y(u);continue}var O=u.line,S=u.ch,E=y(u);if(!E)return;if(E[1])s.push(E[2]);else{for(var C=s.length-1;C>=0;--C)if(s[C]==E[2]){s.length=C;break}if(C<0&&(!a||a==E[2]))return{tag:E[2],from:X(u.line,u.ch),to:X(O,S)}}}}ae.registerHelper("fold","xml",function(u,a){for(var s=new H(u,a.line,0);;){var f=p(s);if(!f||s.line!=a.line)return;var O=b(s);if(!O)return;if(!f[1]&&O!="selfClose"){var S=X(s.line,s.ch),E=r(s,f[2]);return E&&P(E.from,S)>0?{from:S,to:E.from}:null}}}),ae.findMatchingTag=function(u,a,s){var f=new H(u,a.line,a.ch,s);if(f.text.indexOf(">")==-1&&f.text.indexOf("<")==-1)return;var O=b(f),S=O&&X(f.line,f.ch),E=O&&y(f);if(!O||!E||P(f,a)>0)return;var C={from:X(f.line,f.ch),to:S,tag:E[2]};return O=="selfClose"?{open:C,close:null,at:"open"}:E[1]?{open:l(f,E[2]),close:C,at:"close"}:(f=new H(u,S.line,S.ch,s),{open:C,close:r(f,E[2]),at:"open"})},ae.findEnclosingTag=function(u,a,s,f){for(var O=new H(u,a.line,a.ch,s);;){var S=l(O,f);if(!S)break;var E=new H(u,a.line,a.ch,s),C=r(E,S.tag);if(C)return{open:S,close:C}}},ae.scanForClosingTag=function(u,a,s,f){var O=new H(u,a.line,a.ch,f?{from:0,to:f}:null);return r(O,s)}})},p5ED:function(Rt,$e,Q){"use strict";var ae=Q("+L6B"),X=Q("2/Rp"),P=Q("5Dmo"),V=Q("3S7+"),L=Q("k1fw"),M=Q("tJVT"),H=Q("q1tI"),U=Q.n(H),k=Q("vHTk"),I=Q.n(k),b=Q("yEEn"),y=Q("ZW9T"),p=Q("1vsH");$e.a=function(c){var r=c.name,l=c.data,u=c.theme,a=c.type,s=c.filename,f=c.monacoEditor,O=c.className,S=c.style,E=c.close,C=c.onClose,w=c.hasMask,g=Object(H.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),v=Object(M.a)(g,2),h=v[0],o=v[1],_=Object(H.useState)(""),m=Object(M.a)(_,2),T=m[0],N=m[1],j,W=1024*1024,Y=10*W,B=Object(H.useRef)();a==="office"&&(j=Object(p.T)(l).filesize,j>Y&&(a="other")),s&&(f.filename=s),Object(H.useEffect)(function(){var te,ue,me=(te=document.cookie)===null||te===void 0||((ue=te.replace(/\s/g,""))===null||ue===void 0)?void 0:ue.split(";");me==null||me.map(function(Me){var Ae=Me.split("=");Ae[0]==="_educoder_session"&&N(Ae[1])})},[]);var R=function(){if(l.startsWith("http")||l.startsWith("/")){$();return}Object(p.z)(s||"educoder",l,s)},$=function(){Object(p.x)(s||r,l)};return console.log("data:",l,"fileanme:",s," name:",r),U.a.createElement("div",{style:Object(L.a)({},S||{}),className:"".concat(w&&I.a.bgBlack," ").concat(a?I.a.wrp:"hide")},E&&U.a.createElement("div",{className:I.a.close,ref:B},U.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return B.current}},U.a.createElement("span",{onClick:$},U.a.createElement("i",{className:"icon-quxiaozhiding"}))),U.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return B.current}},U.a.createElement("span",{className:"",onClick:C},U.a.createElement("i",{className:"icon-guanbi1"})))),U.a.createElement("div",{className:"".concat(I.a[O]," ").concat(O," ").concat(I.a.monaco," ").concat(a==="txt"?"show":"hide")},a==="txt"&&U.a.createElement(y.b,f)),a==="audio"&&U.a.createElement("audio",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?l:"data:audio/mp3;base64,").concat(l),autoPlay:!0}),a==="video"&&U.a.createElement(U.a.Fragment,null,l!=null&&l.startsWith("/")?U.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):U.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),a==="html"&&U.a.createElement("iframe",{src:l+"&disposition=inline"}),a==="pdf"&&U.a.createElement("embed",{className:I.a.embed,src:l}),a==="image"&&U.a.createElement(U.a.Fragment,null,U.a.createElement("img",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)})),a==="other"&&U.a.createElement("div",null,U.a.createElement(X.a,{type:"primary",size:"large",onClick:R},U.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(a==="download"||a==="office")&&U.a.createElement(X.a,{type:"primary",size:"large",onClick:R},U.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Rt,$e,Q){},psGv:function(Rt,$e,Q){var ae,X;(function(){var P;(function(){"use strict";var H=[,,function(b){function y(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}y.prototype.clone_empty=function(){var r=new y(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},y.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},y.prototype.has_match=function(r){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(r))return!0;return!1},y.prototype.set_indent=function(r,l){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},y.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},y.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},y.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},y.prototype.is_empty=function(){return this.__items.length===0},y.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},y.prototype.push=function(r){this.__items.push(r);var l=r.lastIndexOf(`
`);l!==-1?this.__character_count=r.length-l:this.__character_count+=r.length},y.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},y.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},y.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},y.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},y.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function p(r,l){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),l=l||"",r.indent_level>0&&(l=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}p.prototype.get_indent_size=function(r,l){var u=this.__base_string_length;return l=l||0,r<0&&(u=0),u+=r*this.__indent_size,u+=l,u},p.prototype.get_indent_string=function(r,l){var u=this.__base_string;return l=l||0,r<0&&(r=0,u=""),l+=r*this.__indent_size,this.__ensure_cache(l),u+=this.__cache[l],u},p.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var r=this.__cache.length,l=0,u="";this.__indent_size&&r>=this.__indent_size&&(l=Math.floor(r/this.__indent_size),r-=l*this.__indent_size,u=new Array(l+1).join(this.__indent_string)),r&&(u+=new Array(r+1).join(" ")),this.__cache.push(u)};function c(r,l){this.__indent_cache=new p(r,l),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new y(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(r,l){return this.__indent_cache.get_indent_string(r,l)},c.prototype.get_indent_size=function(r,l){return this.__indent_cache.get_indent_size(r,l)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(r){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
`);return r!==`
`&&(u=u.replace(/[\n]/g,r)),u},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(r,l){return r=r||0,l=l||0,this.next_line.set_indent(r,l),this.__lines.length>1?(this.current_line.set_indent(r,l),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(r){for(var l=0;l<r.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},c.prototype.remove_indent=function(r){for(var l=this.__lines.length;r<l;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(r,l){for(var u=this.__lines.length-2;u>=0;){var a=this.__lines[u];if(a.is_empty())break;if(a.item(0).indexOf(r)!==0&&a.item(-1)!==l){this.__lines.splice(u+1,0,new y(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},b.exports.Output=c},function(b){function y(p,c,r,l){this.type=p,this.text=c,this.comments_before=null,this.newlines=r||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}b.exports.Token=y},,,function(b){function y(r,l){this.raw_options=p(r,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}y.prototype._get_array=function(r,l){var u=this.raw_options[r],a=l||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(a=u.concat()):typeof u=="string"&&(a=u.split(/[^a-zA-Z0-9_\/\-]+/)),a},y.prototype._get_boolean=function(r,l){var u=this.raw_options[r],a=u===void 0?!!l:!!u;return a},y.prototype._get_characters=function(r,l){var u=this.raw_options[r],a=l||"";return typeof u=="string"&&(a=u.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},y.prototype._get_number=function(r,l){var u=this.raw_options[r];l=parseInt(l,10),isNaN(l)&&(l=0);var a=parseInt(u,10);return isNaN(a)&&(a=l),a},y.prototype._get_selection=function(r,l,u){var a=this._get_selection_list(r,l,u);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[r]+"'");return a[0]},y.prototype._get_selection_list=function(r,l,u){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[l[0]],!this._is_valid_selection(u,l))throw new Error("Invalid Default Value!");var a=this._get_array(r,u);if(!this._is_valid_selection(a,l))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[r]+"'");return a},y.prototype._is_valid_selection=function(r,l){return r.length&&l.length&&!r.some(function(u){return l.indexOf(u)===-1})};function p(r,l){var u={};r=c(r);var a;for(a in r)a!==l&&(u[a]=r[a]);if(l&&r[l])for(a in r[l])u[a]=r[l][a];return u}function c(r){var l={},u;for(u in r){var a=u.replace(/-/g,"_");l[a]=r[u]}return l}b.exports.Options=y,b.exports.normalizeOpts=c,b.exports.mergeOpts=p},,function(b){var y=RegExp.prototype.hasOwnProperty("sticky");function p(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},p.prototype.peek=function(c){var r=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(r=this.__input.charAt(c)),r},p.prototype.__match=function(c,r){c.lastIndex=r;var l=c.exec(this.__input);return l&&!(y&&c.sticky)&&(l.index!==r&&(l=null)),l},p.prototype.test=function(c,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(c,r):!1},p.prototype.testChar=function(c,r){var l=this.peek(r);return c.lastIndex=0,l!==null&&c.test(l)},p.prototype.match=function(c){var r=this.__match(c,this.__position);return r?this.__position+=r[0].length:r=null,r},p.prototype.read=function(c,r,l){var u="",a;return c&&(a=this.match(c),a&&(u+=a[0])),r&&(a||!c)&&(u+=this.readUntil(r,l)),u},p.prototype.readUntil=function(c,r){var l="",u=this.__position;c.lastIndex=this.__position;var a=c.exec(this.__input);return a?(u=a.index,r&&(u+=a[0].length)):u=this.__input_length,l=this.__input.substring(this.__position,u),this.__position=u,l},p.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},p.prototype.get_regexp=function(c,r){var l=null,u="g";return r&&y&&(u="y"),typeof c=="string"&&c!==""?l=new RegExp(c,u):c&&(l=new RegExp(c.source,u)),l},p.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(c){var r=this.__position,l=this.readUntilAfter(c);return this.__position=r,l},p.prototype.lookBack=function(c){var r=this.__position-1;return r>=c.length&&this.__input.substring(r-c.length,r).toLowerCase()===c},b.exports.InputScanner=p},function(b,y,p){var c=p(8).InputScanner,r=p(3).Token,l=p(10).TokenStream,u=p(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(f,O){this._input=new c(f),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var f,O=new r(a.START,""),S=null,E=[],C=new l;O.type!==a.EOF;){for(f=this._get_next_token(O,S);this._is_comment(f);)C.add(f),f=this._get_next_token(O,S);C.isEmpty()||(f.comments_before=C,C=new l),f.parent=S,this._is_opening(f)?(E.push(S),S=f):S&&this._is_closing(f,S)&&(f.opened=S,S.closed=f,S=E.pop(),f.parent=S),f.previous=O,O.next=f,this.__tokens.add(f),O=f}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(f,O){this._readWhitespace();var S=this._input.read(/.+/g);return S?this._create_token(a.RAW,S):this._create_token(a.EOF,"")},s.prototype._is_comment=function(f){return!1},s.prototype._is_opening=function(f){return!1},s.prototype._is_closing=function(f,O){return!1},s.prototype._create_token=function(f,O){var S=new r(f,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return S},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=s,b.exports.TOKEN=a},function(b){function y(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}y.prototype.restart=function(){this.__position=0},y.prototype.isEmpty=function(){return this.__tokens_length===0},y.prototype.hasNext=function(){return this.__position<this.__tokens_length},y.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},y.prototype.peek=function(p){var c=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(c=this.__tokens[p]),c},y.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},b.exports.TokenStream=y},function(b,y,p){var c=p(12).Pattern;function r(l,u){c.call(this,l,u),u?this._line_regexp=this._input.get_regexp(u._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new c,r.prototype.__set_whitespace_patterns=function(l,u){l+="\\t ",u+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+u+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+u+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var u=this.__split(this._newline_regexp,l);this.newline_count=u.length-1,this.whitespace_before_token=u[this.newline_count]}return l},r.prototype.matching=function(l,u){var a=this._create();return a.__set_whitespace_patterns(l,u),a._update(),a},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(l,u){l.lastIndex=0;for(var a=0,s=[],f=l.exec(u);f;)s.push(u.substring(a,f.index)),a=f.index+f[0].length,f=l.exec(u);return a<u.length?s.push(u.substring(a,u.length)):s.push(""),s},b.exports.WhitespacePattern=r},function(b){function y(p,c){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}y.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},y.prototype.read_match=function(){return this._input.match(this._match_pattern)},y.prototype.until_after=function(p){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(p),c._update(),c},y.prototype.until=function(p){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(p),c._update(),c},y.prototype.starting_with=function(p){var c=this._create();return c._starting_pattern=this._input.get_regexp(p,!0),c._update(),c},y.prototype.matching=function(p){var c=this._create();return c._match_pattern=this._input.get_regexp(p,!0),c._update(),c},y.prototype._create=function(){return new y(this._input,this)},y.prototype._update=function(){},b.exports.Pattern=y},function(b){function y(p,c){p=typeof p=="string"?p:p.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+c,"g")}y.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(p);r;)c[r[1]]=r[2],r=this.__directive_pattern.exec(p);return c},y.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=y},function(b,y,p){var c=p(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(u,a){c.call(this,u,a),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var s=new c(u);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new c,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(u){var a=this._create();return a._disabled[u]=!0,a._update(),a},l.prototype.read_options=function(u){var a=this._create();for(var s in r)a._disabled[s]=u.templating.indexOf(s)===-1;return a._update(),a},l.prototype.exclude=function(u){var a=this._create();return a._excluded[u]=!0,a._update(),a},l.prototype.read=function(){var u="";this._match_pattern?u=this._input.read(this._starting_pattern):u=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),u+=a,a=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},l.prototype.__set_templated_pattern=function(){var u=[];this._disabled.php||u.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||u.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(u.push(this.__patterns.django._starting_pattern.source),u.push(this.__patterns.django_value._starting_pattern.source),u.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||u.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&u.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+u.join("|")+")")},l.prototype._read_template=function(){var u="",a=this._input.peek();if(a==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(u=u||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(u=u||this.__patterns.handlebars_comment.read(),u=u||this.__patterns.handlebars_unescaped.read(),u=u||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(u=u||this.__patterns.django_value.read()),this._excluded.django||(u=u||this.__patterns.django_comment.read(),u=u||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(u=u||this.__patterns.smarty_comment.read(),u=u||this.__patterns.smarty_literal.read(),u=u||this.__patterns.smarty.read()));return u},b.exports.TemplatablePattern=l},,,,function(b,y,p){var c=p(19).Beautifier,r=p(20).Options;function l(u,a,s,f){var O=new c(u,a,s,f);return O.beautify()}b.exports=l,b.exports.defaultOptions=function(){return new r}},function(b,y,p){var c=p(20).Options,r=p(2).Output,l=p(21).Tokenizer,u=p(21).TOKEN,a=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,f=function(_,m){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=_.max_preserve_newlines,this.preserve_newlines=_.preserve_newlines,this._output=new r(_,m)};f.prototype.current_line_has_match=function(_){return this._output.current_line.has_match(_)},f.prototype.set_space_before_token=function(_,m){this._output.space_before_token=_,this._output.non_breaking_space=m},f.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},f.prototype.add_raw_token=function(_){this._output.add_raw_token(_)},f.prototype.print_preserved_newlines=function(_){var m=0;_.type!==u.TEXT&&_.previous.type!==u.TEXT&&(m=_.newlines?1:0),this.preserve_newlines&&(m=_.newlines<this.max_preserve_newlines+1?_.newlines:this.max_preserve_newlines+1);for(var T=0;T<m;T++)this.print_newline(T>0);return m!==0},f.prototype.traverse_whitespace=function(_){return _.whitespace_before||_.newlines?(this.print_preserved_newlines(_)||(this._output.space_before_token=!0),!0):!1},f.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},f.prototype.print_newline=function(_){this._output.add_new_line(_)},f.prototype.print_token=function(_){_.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(_.text))},f.prototype.indent=function(){this.indent_level++},f.prototype.get_full_indent=function(_){return _=this.indent_level+(_||0),_<1?"":this._output.get_indent_string(_)};var O=function(_){for(var m=null,T=_.next;T.type!==u.EOF&&_.closed!==T;){if(T.type===u.ATTRIBUTE&&T.text==="type"){T.next&&T.next.type===u.EQUALS&&T.next.next&&T.next.next.type===u.VALUE&&(m=T.next.next.text);break}T=T.next}return m},S=function(_,m){var T=null,N=null;return m.closed?(_==="script"?T="text/javascript":_==="style"&&(T="text/css"),T=O(m)||T,T.search("text/css")>-1?N="css":T.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":T.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":T.search(/test\/null/)>-1&&(N="null"),N):null};function E(_,m){return m.indexOf(_)!==-1}function C(_,m,T){this.parent=_||null,this.tag=m?m.tag_name:"",this.indent_level=T||0,this.parser_token=m||null}function w(_){this._printer=_,this._current_frame=null}w.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},w.prototype.record_tag=function(_){var m=new C(this._current_frame,_,this._printer.indent_level);this._current_frame=m},w.prototype._try_pop_frame=function(_){var m=null;return _&&(m=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),m},w.prototype._get_frame=function(_,m){for(var T=this._current_frame;T&&!(_.indexOf(T.tag)!==-1);){if(m&&m.indexOf(T.tag)!==-1){T=null;break}T=T.parent}return T},w.prototype.try_pop=function(_,m){var T=this._get_frame([_],m);return this._try_pop_frame(T)},w.prototype.indent_to_tag=function(_){var m=this._get_frame(_);m&&(this._printer.indent_level=m.indent_level)};function g(_,m,T,N){this._source_text=_||"",m=m||{},this._js_beautify=T,this._css_beautify=N,this._tag_stack=null;var j=new c(m,"html");this._options=j,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}g.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,m=this._options.eol;this._options.eol==="auto"&&(m=`
`,_&&a.test(_)&&(m=_.match(a)[0])),_=_.replace(s,`
`);var T=_.match(/^[\t ]*/)[0],N={text:"",type:""},j=new v,W=new f(this._options,T),Y=new l(_,this._options).tokenize();this._tag_stack=new w(W);for(var B=null,R=Y.next();R.type!==u.EOF;)R.type===u.TAG_OPEN||R.type===u.COMMENT?(B=this._handle_tag_open(W,R,j,N),j=B):R.type===u.ATTRIBUTE||R.type===u.EQUALS||R.type===u.VALUE||R.type===u.TEXT&&!j.tag_complete?B=this._handle_inside_tag(W,R,j,Y):R.type===u.TAG_CLOSE?B=this._handle_tag_close(W,R,j):R.type===u.TEXT?B=this._handle_text(W,R,j):W.add_raw_token(R),N=B,R=Y.next();var $=W._output.get_code(m);return $},g.prototype._handle_tag_close=function(_,m,T){var N={text:m.text,type:m.type};return _.alignment_size=0,T.tag_complete=!0,_.set_space_before_token(m.newlines||m.whitespace_before!=="",!0),T.is_unformatted?_.add_raw_token(m):(T.tag_start_char==="<"&&(_.set_space_before_token(m.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&T.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(m)),T.indent_content&&!(T.is_unformatted||T.is_content_unformatted)&&(_.indent(),T.indent_content=!1),!T.is_inline_element&&!(T.is_unformatted||T.is_content_unformatted)&&_.set_wrap_point(),N},g.prototype._handle_inside_tag=function(_,m,T,N){var j=T.has_wrapped_attrs,W={text:m.text,type:m.type};if(_.set_space_before_token(m.newlines||m.whitespace_before!=="",!0),T.is_unformatted)_.add_raw_token(m);else if(T.tag_start_char==="{"&&m.type===u.TEXT)_.print_preserved_newlines(m)?(m.newlines=0,_.add_raw_token(m)):_.print_token(m);else{if(m.type===u.ATTRIBUTE?(_.set_space_before_token(!0),T.attr_count+=1):(m.type===u.EQUALS||m.type===u.VALUE&&m.previous.type===u.EQUALS)&&_.set_space_before_token(!1),m.type===u.ATTRIBUTE&&T.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(m),j=j||m.newlines!==0),this._is_wrap_attributes_force)){var Y=T.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&T.attr_count===1){var B=!0,R=0,$;do{if($=N.peek(R),$.type===u.ATTRIBUTE){B=!1;break}R+=1}while(R<4&&$.type!==u.EOF&&$.type!==u.TAG_CLOSE);Y=!B}Y&&(_.print_newline(!1),j=!0)}_.print_token(m),j=j||_.previous_token_wrapped(),T.has_wrapped_attrs=j}return W},g.prototype._handle_text=function(_,m,T){var N={text:m.text,type:"TK_CONTENT"};return T.custom_beautifier_name?this._print_custom_beatifier_text(_,m,T):T.is_unformatted||T.is_content_unformatted?_.add_raw_token(m):(_.traverse_whitespace(m),_.print_token(m)),N},g.prototype._print_custom_beatifier_text=function(_,m,T){var N=this;if(m.text!==""){var j=m.text,W,Y=1,B="",R="";T.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?W=this._js_beautify:T.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?W=this._css_beautify:T.custom_beautifier_name==="html"&&(W=function(Ae,De){var Fe=new g(Ae,De,N._js_beautify,N._css_beautify);return Fe.beautify()}),this._options.indent_scripts==="keep"?Y=0:this._options.indent_scripts==="separate"&&(Y=-_.indent_level);var $=_.get_full_indent(Y);if(j=j.replace(/\n[ \t]*$/,""),T.custom_beautifier_name!=="html"&&j[0]==="<"&&j.match(/^(<!--|<!\[CDATA\[)/)){var te=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(j);if(!te){_.add_raw_token(m);return}B=$+te[1]+`
`,j=te[4],te[5]&&(R=$+te[5]),j=j.replace(/\n[ \t]*$/,""),(te[2]||te[3].indexOf(`
`)!==-1)&&(te=te[3].match(/[ \t]+$/),te&&(m.whitespace_before=te[0]))}if(j)if(W){var ue=function(){this.eol=`
`};ue.prototype=this._options.raw_options;var me=new ue;j=W($+j,me)}else{var Me=m.whitespace_before;Me&&(j=j.replace(new RegExp(`
(`+Me+")?","g"),`
`)),j=$+j.replace(/\n/g,`
`+$)}B&&(j?j=B+j+`
`+R:j=B+R),_.print_newline(!1),j&&(m.text=j,m.whitespace_before="",m.newlines=0,_.add_raw_token(m),_.print_newline(!0))}},g.prototype._handle_tag_open=function(_,m,T,N){var j=this._get_tag_open_token(m);return(T.is_unformatted||T.is_content_unformatted)&&!T.is_empty_element&&m.type===u.TAG_OPEN&&m.text.indexOf("</")===0?(_.add_raw_token(m),j.start_tag_token=this._tag_stack.try_pop(j.tag_name)):(_.traverse_whitespace(m),this._set_tag_position(_,m,j,T,N),j.is_inline_element||_.set_wrap_point(),_.print_token(m)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(j.alignment_size=m.text.length+1),!j.tag_complete&&!j.is_unformatted&&(_.alignment_size=j.alignment_size),j};var v=function(_,m){if(this.parent=_||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!m)this.tag_complete=!0;else{var T;this.tag_start_char=m.text[0],this.text=m.text,this.tag_start_char==="<"?(T=m.text.match(/^<([^\s>]*)/),this.tag_check=T?T[1]:""):(T=m.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=T?T[1]:"",(m.text.startsWith("{{#>")||m.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&m.next!==null?this.tag_check=m.next.text.split(" ")[0]:this.tag_check=m.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),m.type===u.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||m.closed&&m.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};g.prototype._get_tag_open_token=function(_){var m=new v(this._tag_stack.get_parser_token(),_);return m.alignment_size=this._options.wrap_attributes_indent_size,m.is_end_tag=m.is_end_tag||E(m.tag_check,this._options.void_elements),m.is_empty_element=m.tag_complete||m.is_start_tag&&m.is_end_tag,m.is_unformatted=!m.tag_complete&&E(m.tag_check,this._options.unformatted),m.is_content_unformatted=!m.is_empty_element&&E(m.tag_check,this._options.content_unformatted),m.is_inline_element=E(m.tag_name,this._options.inline)||m.tag_name.includes("-")||m.tag_start_char==="{",m},g.prototype._set_tag_position=function(_,m,T,N,j){if(T.is_empty_element||(T.is_end_tag?T.start_tag_token=this._tag_stack.try_pop(T.tag_name):(this._do_optional_end_element(T)&&(T.is_inline_element||_.print_newline(!1)),this._tag_stack.record_tag(T),(T.tag_name==="script"||T.tag_name==="style")&&!(T.is_unformatted||T.is_content_unformatted)&&(T.custom_beautifier_name=S(T.tag_check,m)))),E(T.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.print_newline(!0)),T.is_empty_element){if(T.tag_start_char==="{"&&T.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),T.indent_content=!0;var W=_.current_line_has_match(/{{#if/);W||_.print_newline(!1)}T.tag_name==="!--"&&j.type===u.TAG_CLOSE&&N.is_end_tag&&T.text.indexOf(`
`)===-1||(T.is_inline_element||T.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,T))}else if(T.is_end_tag){var Y=!1;Y=T.start_tag_token&&T.start_tag_token.multiline_content,Y=Y||!T.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(j.type===u.TAG_CLOSE&&T.start_tag_token===N)&&j.type!=="TK_CONTENT",(T.is_content_unformatted||T.is_unformatted)&&(Y=!1),Y&&_.print_newline(!1)}else T.indent_content=!T.custom_beautifier_name,T.tag_start_char==="<"&&(T.tag_name==="html"?T.indent_content=this._options.indent_inner_html:T.tag_name==="head"?T.indent_content=this._options.indent_head_inner_html:T.tag_name==="body"&&(T.indent_content=this._options.indent_body_inner_html)),!(T.is_inline_element||T.is_unformatted)&&(j.type!=="TK_CONTENT"||T.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,T)},g.prototype._calcluate_parent_multiline=function(_,m){m.parent&&_._output.just_added_newline()&&!((m.is_inline_element||m.is_unformatted)&&m.parent.is_inline_element)&&(m.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],o=["a","audio","del","ins","map","noscript","video"];g.prototype._do_optional_end_element=function(_){var m=null;if(_.is_empty_element||!_.is_start_tag||!_.parent)return;if(_.tag_name==="body")m=m||this._tag_stack.try_pop("head");else if(_.tag_name==="li")m=m||this._tag_stack.try_pop("li",["ol","ul"]);else if(_.tag_name==="dd"||_.tag_name==="dt")m=m||this._tag_stack.try_pop("dt",["dl"]),m=m||this._tag_stack.try_pop("dd",["dl"]);else if(_.parent.tag_name==="p"&&h.indexOf(_.tag_name)!==-1){var T=_.parent.parent;(!T||o.indexOf(T.tag_name)===-1)&&(m=m||this._tag_stack.try_pop("p"))}else _.tag_name==="rp"||_.tag_name==="rt"?(m=m||this._tag_stack.try_pop("rt",["ruby","rtc"]),m=m||this._tag_stack.try_pop("rp",["ruby","rtc"])):_.tag_name==="optgroup"?m=m||this._tag_stack.try_pop("optgroup",["select"]):_.tag_name==="option"?m=m||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):_.tag_name==="colgroup"?m=m||this._tag_stack.try_pop("caption",["table"]):_.tag_name==="thead"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"])):_.tag_name==="tbody"||_.tag_name==="tfoot"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"]),m=m||this._tag_stack.try_pop("thead",["table"]),m=m||this._tag_stack.try_pop("tbody",["table"])):_.tag_name==="tr"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"]),m=m||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(_.tag_name==="th"||_.tag_name==="td")&&(m=m||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),m=m||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return _.parent=this._tag_stack.get_parser_token(),m},b.exports.Beautifier=g},function(b,y,p){var c=p(6).Options;function r(l){c.call(this,l,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}r.prototype=new c,b.exports.Options=r},function(b,y,p){var c=p(9).Tokenizer,r=p(9).TOKEN,l=p(13).Directives,u=p(14).TemplatablePattern,a=p(12).Pattern,s={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},f=new l(/<\!--/,/-->/),O=function(S,E){c.call(this,S,E),this._current_tag_name="";var C=new u(this._input).read_options(this._options),w=new a(this._input);if(this.__patterns={word:C.until(/[\n\r\t <]/),single_quote:C.until_after(/'/),double_quote:C.until_after(/"/),attribute:C.until(/[\n\r\t =>]|\/>/),element_name:C.until(/[\n\r\t >\/]/),handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),handlebars_open:w.until(/[\n\r\t }]/),handlebars_raw_close:w.until(/}}/),comment:w.starting_with(/<!--/).until_after(/-->/),cdata:w.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:w.starting_with(/<!\[/).until_after(/]>/),processing:w.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var g=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=w.matching(g).until_after(g)}};O.prototype=new c,O.prototype._is_comment=function(S){return!1},O.prototype._is_opening=function(S){return S.type===s.TAG_OPEN},O.prototype._is_closing=function(S,E){return S.type===s.TAG_CLOSE&&E&&((S.text===">"||S.text==="/>")&&E.text[0]==="<"||S.text==="}}"&&E.text[0]==="{"&&E.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(S,E){var C=null;this._readWhitespace();var w=this._input.peek();return w===null?this._create_token(s.EOF,""):(C=C||this._read_open_handlebars(w,E),C=C||this._read_attribute(w,S,E),C=C||this._read_close(w,E),C=C||this._read_raw_content(w,S,E),C=C||this._read_content_word(w),C=C||this._read_comment_or_cdata(w),C=C||this._read_processing(w),C=C||this._read_open(w,E),C=C||this._create_token(s.UNKNOWN,this._input.next()),C)},O.prototype._read_comment_or_cdata=function(S){var E=null,C=null,w=null;if(S==="<"){var g=this._input.peek(1);g==="!"&&(C=this.__patterns.comment.read(),C?(w=f.get_directives(C),w&&w.ignore==="start"&&(C+=f.readIgnored(this._input))):C=this.__patterns.cdata.read()),C&&(E=this._create_token(s.COMMENT,C),E.directives=w)}return E},O.prototype._read_processing=function(S){var E=null,C=null,w=null;if(S==="<"){var g=this._input.peek(1);(g==="!"||g==="?")&&(C=this.__patterns.conditional_comment.read(),C=C||this.__patterns.processing.read()),C&&(E=this._create_token(s.COMMENT,C),E.directives=w)}return E},O.prototype._read_open=function(S,E){var C=null,w=null;return E||S==="<"&&(C=this._input.next(),this._input.peek()==="/"&&(C+=this._input.next()),C+=this.__patterns.element_name.read(),w=this._create_token(s.TAG_OPEN,C)),w},O.prototype._read_open_handlebars=function(S,E){var C=null,w=null;return E||this._options.indent_handlebars&&S==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(C=this.__patterns.handlebars_comment.read(),C=C||this.__patterns.handlebars.read(),w=this._create_token(s.COMMENT,C)):(C=this.__patterns.handlebars_open.read(),w=this._create_token(s.TAG_OPEN,C))),w},O.prototype._read_close=function(S,E){var C=null,w=null;return E&&(E.text[0]==="<"&&(S===">"||S==="/"&&this._input.peek(1)===">")?(C=this._input.next(),S==="/"&&(C+=this._input.next()),w=this._create_token(s.TAG_CLOSE,C)):E.text[0]==="{"&&S==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),w=this._create_token(s.TAG_CLOSE,"}}"))),w},O.prototype._read_attribute=function(S,E,C){var w=null,g="";if(C&&C.text[0]==="<")if(S==="=")w=this._create_token(s.EQUALS,this._input.next());else if(S==='"'||S==="'"){var v=this._input.next();S==='"'?v+=this.__patterns.double_quote.read():v+=this.__patterns.single_quote.read(),w=this._create_token(s.VALUE,v)}else g=this.__patterns.attribute.read(),g&&(E.type===s.EQUALS?w=this._create_token(s.VALUE,g):w=this._create_token(s.ATTRIBUTE,g));return w},O.prototype._is_content_unformatted=function(S){return this._options.void_elements.indexOf(S)===-1&&(this._options.content_unformatted.indexOf(S)!==-1||this._options.unformatted.indexOf(S)!==-1)},O.prototype._read_raw_content=function(S,E,C){var w="";if(C&&C.text[0]==="{")w=this.__patterns.handlebars_raw_close.read();else if(E.type===s.TAG_CLOSE&&E.opened.text[0]==="<"&&E.text[0]!=="/"){var g=E.opened.text.substr(1).toLowerCase();if(g==="script"||g==="style"){var v=this._read_comment_or_cdata(S);if(v)return v.type=s.TEXT,v;w=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(g)&&(w=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig")))}return w?this._create_token(s.TEXT,w):null},O.prototype._read_content_word=function(S){var E="";if(this._options.unformatted_content_delimiter&&(S===this._options.unformatted_content_delimiter[0]&&(E=this.__patterns.unformatted_content_delimiter.read())),E||(E=this.__patterns.word.read()),E)return this._create_token(s.TEXT,E)},b.exports.Tokenizer=O,b.exports.TOKEN=s}],U={};function k(b){var y=U[b];if(y!==void 0)return y.exports;var p=U[b]={exports:{}};return H[b](p,p.exports,k),p.exports}var I=k(18);P=I})();var V=P;if(!0)!(ae=[Q,Q("6UM0"),Q("TXwP")],X=function(H){var U=Q("6UM0"),k=Q("TXwP");return{html_beautify:function(I,b){return V(I,b,U.js_beautify,k.css_beautify)}}}.apply($e,ae),X!==void 0&&(Rt.exports=X));else var L,M})()},"rAM+":function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return X});var ae=Q("Qw5x");function X(P,V){var L;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(L=Object(ae.a)(P))||V&&P&&typeof P.length=="number"){L&&(P=L);var M=0,H=function(){};return{s:H,n:function(){return M>=P.length?{done:!0}:{done:!1,value:P[M++]}},e:function(y){throw y},f:H}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U=!0,k=!1,I;return{s:function(){L=P[Symbol.iterator]()},n:function(){var y=L.next();return U=y.done,y},e:function(y){k=!0,I=y},f:function(){try{!U&&L.return!=null&&L.return()}finally{if(k)throw I}}}}},rUJ1:function(Rt,$e){const Q=/[&<>"']/,ae=/[&<>"']/g,X=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,V={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},L=w=>V[w];function M(w,g){if(g){if(Q.test(w))return w.replace(ae,L)}else if(X.test(w))return w.replace(P,L);return w}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(w){return w.replace(H,(g,v)=>(v=v.toLowerCase(),v==="colon"?":":v.charAt(0)==="#"?v.charAt(1)==="x"?String.fromCharCode(parseInt(v.substring(2),16)):String.fromCharCode(+v.substring(1)):""))}const k=/(^|[^\[])\^/g;function I(w,g){w=w.source||w,g=g||"";const v={replace:(h,o)=>(o=o.source||o,o=o.replace(k,"$1"),w=w.replace(h,o),v),getRegex:()=>new RegExp(w,g)};return v}const b=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(w,g,v){if(w){let h;try{h=decodeURIComponent(U(v)).replace(b,"").toLowerCase()}catch(o){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}g&&!y.test(v)&&(v=a(g,v));try{v=encodeURI(v).replace(/%25/g,"%")}catch(h){return null}return v}const c={},r=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(w,g){c[" "+w]||(r.test(w)?c[" "+w]=w+"/":c[" "+w]=S(w,"/",!0)),w=c[" "+w];const v=w.indexOf(":")===-1;return g.substring(0,2)==="//"?v?g:w.replace(l,"$1")+g:g.charAt(0)==="/"?v?g:w.replace(u,"$1")+g:w+g}const s={exec:function(){}};function f(w){let g=1,v,h;for(;g<arguments.length;g++){v=arguments[g];for(h in v)Object.prototype.hasOwnProperty.call(v,h)&&(w[h]=v[h])}return w}function O(w,g){const v=w.replace(/\|/g,(_,m,T)=>{let N=!1,j=m;for(;--j>=0&&T[j]==="\\";)N=!N;return N?"|":" |"}),h=v.split(/ \|/);let o=0;if(h.length>g)h.splice(g);else for(;h.length<g;)h.push("");for(;o<h.length;o++)h[o]=h[o].trim().replace(/\\\|/g,"|");return h}function S(w,g,v){const h=w.length;if(h===0)return"";let o=0;for(;o<h;){const _=w.charAt(h-o-1);if(_===g&&!v)o++;else if(_!==g&&v)o++;else break}return w.substr(0,h-o)}function E(w,g){if(w.indexOf(g[1])===-1)return-1;const v=w.length;let h=0,o=0;for(;o<v;o++)if(w[o]==="\\")o++;else if(w[o]===g[0])h++;else if(w[o]===g[1]&&(h--,h<0))return o;return-1}function C(w){w&&w.sanitize&&!w.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")}Rt.exports={escape:M,unescape:U,edit:I,cleanUrl:p,resolveUrl:a,noopTest:s,merge:f,splitCells:O,rtrim:S,findClosingBracket:E,checkSanitizeDeprecation:C}},sR1s:function(Rt,$e,Q){"use strict";Q.d($e,"b",function(){return V}),Q.d($e,"a",function(){return L}),Q.d($e,"c",function(){return M}),Q.d($e,"d",function(){return H});var ae=Q("U8pU"),X="RC_TABLE_KEY";function P(U){return U==null?[]:Array.isArray(U)?U:[U]}function V(U,k){if(!k&&typeof k!="number")return U;for(var I=P(k),b=U,y=0;y<I.length;y+=1){if(!b)return null;var p=I[y];b=b[p]}return b}function L(U){var k=[],I={};return U.forEach(function(b){for(var y=b||{},p=y.key,c=y.dataIndex,r=p||P(c).join("-")||X;I[r];)r="".concat(r,"_next");I[r]=!0,k.push(r)}),k}function M(){var U={};function k(p,c){c&&Object.keys(c).forEach(function(r){var l=c[r];l&&Object(ae.a)(l)==="object"?(p[r]=p[r]||{},k(p[r],l)):p[r]=l})}for(var I=arguments.length,b=new Array(I),y=0;y<I;y++)b[y]=arguments[y];return b.forEach(function(p){k(U,p)}),U}function H(U){return U!=null}},sboe:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return P});var ae=Q("q1tI"),X=Q.n(ae),P=ae.createContext(null)},t23M:function(Rt,$e,Q){"use strict";var ae=Q("VTBJ"),X=Q("1OyB"),P=Q("vuIU"),V=Q("Ji7U"),L=Q("LK+K"),M=Q("q1tI"),H=Q.n(M),U=Q("m+aA"),k=Q("Zm9Q"),I=Q("Kwbf"),b=Q("c+Xe"),y=Q("bdgK"),p="rc-observer-key",c=function(r){Object(V.a)(u,r);var l=Object(L.a)(u);function u(){var a;return Object(X.a)(this,u),a=l.apply(this,arguments),a.resizeObserver=null,a.childNode=null,a.currentElement=null,a.state={width:0,height:0,offsetHeight:0,offsetWidth:0},a.onResize=function(s){var f=a.props.onResize,O=s[0].target,S=O.getBoundingClientRect(),E=S.width,C=S.height,w=O.offsetWidth,g=O.offsetHeight,v=Math.floor(E),h=Math.floor(C);if(a.state.width!==v||a.state.height!==h||a.state.offsetWidth!==w||a.state.offsetHeight!==g){var o={width:v,height:h,offsetWidth:w,offsetHeight:g};a.setState(o),f&&Promise.resolve().then(function(){f(Object(ae.a)(Object(ae.a)({},o),{},{offsetWidth:w,offsetHeight:g}))})}},a.setChildNode=function(s){a.childNode=s},a}return Object(P.a)(u,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var s=this.props.disabled;if(s){this.destroyObserver();return}var f=Object(U.a)(this.childNode||this),O=f!==this.currentElement;O&&(this.destroyObserver(),this.currentElement=f),!this.resizeObserver&&f&&(this.resizeObserver=new y.default(this.onResize),this.resizeObserver.observe(f))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var s=this.props.children,f=Object(k.a)(s);if(f.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(f.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var O=f[0];if(M.isValidElement(O)&&Object(b.c)(O)){var S=O.ref;f[0]=M.cloneElement(O,{ref:Object(b.a)(S,this.setChildNode)})}return f.length===1?f[0]:f.map(function(E,C){return!M.isValidElement(E)||"key"in E&&E.key!==null?E:M.cloneElement(E,{key:"".concat(p,"-").concat(C)})})}}]),u}(M.Component);c.displayName="ResizeObserver",$e.a=c},ulZh:function(Rt,$e,Q){typeof window!="undefined"&&function(X,P){Rt.exports=P()}(this,function(){return function(ae){var X={};function P(V){if(X[V])return X[V].exports;var L=X[V]={i:V,l:!1,exports:{}};return ae[V].call(L.exports,L,L.exports,P),L.l=!0,L.exports}return P.m=ae,P.c=X,P.d=function(V,L,M){P.o(V,L)||Object.defineProperty(V,L,{enumerable:!0,get:M})},P.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},P.t=function(V,L){if(L&1&&(V=P(V)),L&8)return V;if(L&4&&typeof V=="object"&&V&&V.__esModule)return V;var M=Object.create(null);if(P.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:V}),L&2&&typeof V!="string")for(var H in V)P.d(M,H,function(U){return V[U]}.bind(null,H));return M},P.n=function(V){var L=V&&V.__esModule?function(){return V.default}:function(){return V};return P.d(L,"a",L),L},P.o=function(V,L){return Object.prototype.hasOwnProperty.call(V,L)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ae,X,P){"use strict";var V=Object.prototype.hasOwnProperty,L="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(L=!1));function H(b,y,p){this.fn=b,this.context=y,this.once=p||!1}function U(b,y,p,c,r){if(typeof p!="function")throw new TypeError("The listener must be a function");var l=new H(p,c||b,r),u=L?L+y:y;return b._events[u]?b._events[u].fn?b._events[u]=[b._events[u],l]:b._events[u].push(l):(b._events[u]=l,b._eventsCount++),b}function k(b,y){--b._eventsCount===0?b._events=new M:delete b._events[y]}function I(){this._events=new M,this._eventsCount=0}I.prototype.eventNames=function(){var y=[],p,c;if(this._eventsCount===0)return y;for(c in p=this._events)V.call(p,c)&&y.push(L?c.slice(1):c);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(p)):y},I.prototype.listeners=function(y){var p=L?L+y:y,c=this._events[p];if(!c)return[];if(c.fn)return[c.fn];for(var r=0,l=c.length,u=new Array(l);r<l;r++)u[r]=c[r].fn;return u},I.prototype.listenerCount=function(y){var p=L?L+y:y,c=this._events[p];return c?c.fn?1:c.length:0},I.prototype.emit=function(y,p,c,r,l,u){var a=L?L+y:y;if(!this._events[a])return!1;var s=this._events[a],f=arguments.length,O,S;if(s.fn){s.once&&this.removeListener(y,s.fn,void 0,!0);switch(f){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,p),!0;case 3:return s.fn.call(s.context,p,c),!0;case 4:return s.fn.call(s.context,p,c,r),!0;case 5:return s.fn.call(s.context,p,c,r,l),!0;case 6:return s.fn.call(s.context,p,c,r,l,u),!0}for(S=1,O=new Array(f-1);S<f;S++)O[S-1]=arguments[S];s.fn.apply(s.context,O)}else{var E=s.length,C;for(S=0;S<E;S++){s[S].once&&this.removeListener(y,s[S].fn,void 0,!0);switch(f){case 1:s[S].fn.call(s[S].context);break;case 2:s[S].fn.call(s[S].context,p);break;case 3:s[S].fn.call(s[S].context,p,c);break;case 4:s[S].fn.call(s[S].context,p,c,r);break;default:if(!O)for(C=1,O=new Array(f-1);C<f;C++)O[C-1]=arguments[C];s[S].fn.apply(s[S].context,O)}}}return!0},I.prototype.on=function(y,p,c){return U(this,y,p,c,!1)},I.prototype.once=function(y,p,c){return U(this,y,p,c,!0)},I.prototype.removeListener=function(y,p,c,r){var l=L?L+y:y;if(!this._events[l])return this;if(!p)return k(this,l),this;var u=this._events[l];if(u.fn)u.fn===p&&(!r||u.once)&&(!c||u.context===c)&&k(this,l);else{for(var a=0,s=[],f=u.length;a<f;a++)(u[a].fn!==p||r&&!u[a].once||c&&u[a].context!==c)&&s.push(u[a]);s.length?this._events[l]=s.length===1?s[0]:s:k(this,l)}return this},I.prototype.removeAllListeners=function(y){var p;return y?(p=L?L+y:y,this._events[p]&&k(this,p)):(this._events=new M,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=L,I.EventEmitter=I,ae.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(ae,X,P){(function(V){var L=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,k={buildAbsoluteURL:function(I,b,y){if(y=y||{},I=I.trim(),b=b.trim(),!b){if(!y.alwaysNormalize)return I;var p=k.parseURL(I);if(!p)throw new Error("Error trying to parse base URL.");return p.path=k.normalizePath(p.path),k.buildURLFromParts(p)}var c=k.parseURL(b);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return y.alwaysNormalize?(c.path=k.normalizePath(c.path),k.buildURLFromParts(c)):b;var r=k.parseURL(I);if(!r)throw new Error("Error trying to parse base URL.");if(!r.netLoc&&r.path&&r.path[0]!=="/"){var l=M.exec(r.path);r.netLoc=l[1],r.path=l[2]}r.netLoc&&!r.path&&(r.path="/");var u={scheme:r.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(u.netLoc=r.netLoc,c.path[0]!=="/"))if(!c.path)u.path=r.path,c.params||(u.params=r.params,c.query||(u.query=r.query));else{var a=r.path,s=a.substring(0,a.lastIndexOf("/")+1)+c.path;u.path=k.normalizePath(s)}return u.path===null&&(u.path=y.alwaysNormalize?k.normalizePath(c.path):c.path),k.buildURLFromParts(u)},parseURL:function(I){var b=L.exec(I);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(H,"");I.length!==(I=I.replace(U,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};ae.exports=k})(this)},"./node_modules/webworkify-webpack/index.js":function(ae,X,P){function V(y){var p={};function c(l){if(p[l])return p[l].exports;var u=p[l]={i:l,l:!1,exports:{}};return y[l].call(u.exports,u,u.exports,c),u.l=!0,u.exports}c.m=y,c.c=p,c.i=function(l){return l},c.d=function(l,u,a){c.o(l,u)||Object.defineProperty(l,u,{configurable:!1,enumerable:!0,get:a})},c.r=function(l){Object.defineProperty(l,"__esModule",{value:!0})},c.n=function(l){var u=l&&l.__esModule?function(){return l.default}:function(){return l};return c.d(u,"a",u),u},c.o=function(l,u){return Object.prototype.hasOwnProperty.call(l,u)},c.p="/",c.oe=function(l){throw console.error(l),l};var r=c(c.s=ENTRY_MODULE);return r.default||r}var L="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function H(y){return(y+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(y){return!isNaN(1*y)}function k(y,p,c){var r={};r[c]=[];var l=p.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return r;for(var a=u[1],s=new RegExp("(\\\\n|\\W)"+H(a)+M,"g"),f;f=s.exec(l);){if(f[3]==="dll-reference")continue;r[c].push(f[3])}for(s=new RegExp("\\("+H(a)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+M,"g");f=s.exec(l);)y[f[2]]||(r[c].push(f[1]),y[f[2]]=P(f[1]).m),r[f[2]]=r[f[2]]||[],r[f[2]].push(f[4]);for(var O=Object.keys(r),S=0;S<O.length;S++)for(var E=0;E<r[O[S]].length;E++)U(r[O[S]][E])&&(r[O[S]][E]=1*r[O[S]][E]);return r}function I(y){var p=Object.keys(y);return p.reduce(function(c,r){return c||y[r].length>0},!1)}function b(y,p){for(var c={main:[p]},r={main:[]},l={main:{}};I(c);)for(var u=Object.keys(c),a=0;a<u.length;a++){var s=u[a],f=c[s],O=f.pop();if(l[s]=l[s]||{},l[s][O]||!y[s][O])continue;l[s][O]=!0,r[s]=r[s]||[],r[s].push(O);for(var S=k(y,y[s][O],s),E=Object.keys(S),C=0;C<E.length;C++)c[E[C]]=c[E[C]]||[],c[E[C]]=c[E[C]].concat(S[E[C]])}return r}ae.exports=function(y,p){p=p||{};var c={main:P.m},r=p.all?{main:Object.keys(c.main)}:b(c,y),l="";Object.keys(r).filter(function(O){return O!=="main"}).forEach(function(O){for(var S=0;r[O][S];)S++;r[O].push(S),c[O][S]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+O+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+r[O].map(function(E){return""+JSON.stringify(E)+": "+c[O][E].toString()}).join(",")+`});
`}),l=l+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(y))+")({"+r.main.map(function(O){return""+JSON.stringify(O)+": "+c.main[O].toString()}).join(",")+"}))(self);";var u=new window.Blob([l],{type:"text/javascript"});if(p.bare)return u;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,s=a.createObjectURL(u),f=new window.Worker(s);return f.objectURL=s,f}},"./src/config.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"hlsDefaultConfig",function(){return C}),P.d(X,"mergeConfig",function(){return g}),P.d(X,"enableStreamingMode",function(){return v});var V=P("./src/controller/abr-controller.ts"),L=P("./src/controller/audio-stream-controller.ts"),M=P("./src/controller/audio-track-controller.ts"),H=P("./src/controller/subtitle-stream-controller.ts"),U=P("./src/controller/subtitle-track-controller.ts"),k=P("./src/controller/buffer-controller.ts"),I=P("./src/controller/timeline-controller.ts"),b=P("./src/controller/cap-level-controller.ts"),y=P("./src/controller/fps-controller.ts"),p=P("./src/controller/eme-controller.ts"),c=P("./src/controller/cmcd-controller.ts"),r=P("./src/utils/xhr-loader.ts"),l=P("./src/utils/fetch-loader.ts"),u=P("./src/utils/cues.ts"),a=P("./src/utils/mediakeys-helper.ts"),s=P("./src/utils/logger.ts");function f(){return f=Object.assign||function(h){for(var o=1;o<arguments.length;o++){var _=arguments[o];for(var m in _)Object.prototype.hasOwnProperty.call(_,m)&&(h[m]=_[m])}return h},f.apply(this,arguments)}function O(h,o){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(h);o&&(m=m.filter(function(T){return Object.getOwnPropertyDescriptor(h,T).enumerable})),_.push.apply(_,m)}return _}function S(h){for(var o=1;o<arguments.length;o++){var _=arguments[o]!=null?arguments[o]:{};o%2?O(Object(_),!0).forEach(function(m){E(h,m,_[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(_)):O(Object(_)).forEach(function(m){Object.defineProperty(h,m,Object.getOwnPropertyDescriptor(_,m))})}return h}function E(h,o,_){return o in h?Object.defineProperty(h,o,{value:_,enumerable:!0,configurable:!0,writable:!0}):h[o]=_,h}var C=S(S({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:r.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:k.default,capLevelController:b.default,fpsController:y.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},w()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:U.default,timelineController:I.TimelineController,audioStreamController:L.default,audioTrackController:M.default,emeController:p.default,cmcdController:c.default});function w(){return{cueHandler:u.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function g(h,o){if((o.liveSyncDurationCount||o.liveMaxLatencyDurationCount)&&(o.liveSyncDuration||o.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(o.liveMaxLatencyDurationCount!==void 0&&(o.liveSyncDurationCount===void 0||o.liveMaxLatencyDurationCount<=o.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(o.liveMaxLatencyDuration!==void 0&&(o.liveSyncDuration===void 0||o.liveMaxLatencyDuration<=o.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return f({},h,o)}function v(h){var o=h.loader;if(o!==l.default&&o!==r.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var _=Object(l.fetchSupported)();_&&(h.loader=l.default,h.progressive=!0,h.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),L=P("./src/utils/ewma-bandwidth-estimator.ts"),M=P("./src/events.ts"),H=P("./src/utils/buffer-helper.ts"),U=P("./src/errors.ts"),k=P("./src/types/loader.ts"),I=P("./src/utils/logger.ts");function b(c,r){for(var l=0;l<r.length;l++){var u=r[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}function y(c,r,l){return r&&b(c.prototype,r),l&&b(c,l),c}var p=function(){function c(l){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=l;var u=l.config;this.bwEstimator=new L.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var r=c.prototype;return r.registerListeners=function(){var u=this.hls;u.on(M.Events.FRAG_LOADING,this.onFragLoading,this),u.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(M.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var u=this.hls;u.off(M.Events.FRAG_LOADING,this.onFragLoading,this),u.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(M.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},r.onFragLoading=function(u,a){var s=a.frag;if(s.type===k.PlaylistLevelType.MAIN&&!this.timer){var f;this.fragCurrent=s,this.partCurrent=(f=a.part)!=null?f:null,this.timer=self.setInterval(this.onCheck,100)}},r.onLevelLoaded=function(u,a){var s=this.hls.config;a.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},r._abandonRulesCheck=function(){var u=this.fragCurrent,a=this.partCurrent,s=this.hls,f=s.autoLevelEnabled,O=s.config,S=s.media;if(!u||!S)return;var E=a?a.stats:u.stats,C=a?a.duration:u.duration;if(E.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!f||S.paused||!S.playbackRate||!S.readyState)return;var w=performance.now()-E.loading.start,g=Math.abs(S.playbackRate);if(w<=500*C/g)return;var v=s.levels,h=s.minAutoLevel,o=v[u.level],_=E.total||Math.max(E.loaded,Math.round(C*o.maxBitrate/8)),m=Math.max(1,E.bwEstimate?E.bwEstimate/8:E.loaded*1e3/w),T=(_-E.loaded)/m,N=S.currentTime,j=(H.BufferHelper.bufferInfo(S,N,O.maxBufferHole).end-N)/g;if(j>=2*C/g||T<=j)return;var W=Number.POSITIVE_INFINITY,Y;for(Y=u.level-1;Y>h;Y--){var B=v[Y].maxBitrate;if(W=C*B/(8*.8*m),W<j)break}if(W>=T)return;var R=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+u.sn+(a?" part "+a.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+Y+`
Current BW estimate: `+(Object(V.isFiniteNumber)(R)?(R/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+T.toFixed(3)+` s
Estimated load time for the next fragment: `+W.toFixed(3)+` s
Time to underbuffer: `+j.toFixed(3)+" s"),s.nextLoadLevel=Y,this.bwEstimator.sample(w,E.loaded),this.clearTimer(),u.loader&&(this.fragCurrent=this.partCurrent=null,u.loader.abort()),s.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:a,stats:E})},r.onFragLoaded=function(u,a){var s=a.frag,f=a.part;if(s.type===k.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(s.sn)){var O=f?f.stats:s.stats,S=f?f.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var E=this.hls.levels[s.level],C=(E.loaded?E.loaded.bytes:0)+O.loaded,w=(E.loaded?E.loaded.duration:0)+S;E.loaded={bytes:C,duration:w},E.realBitrate=Math.round(8*C/w)}if(s.bitrateTest){var g={stats:O,frag:s,part:f,id:s.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,g),s.bitrateTest=!1}}},r.onFragBuffered=function(u,a){var s=a.frag,f=a.part,O=f?f.stats:s.stats;if(O.aborted)return;if(s.type!==k.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var S=O.parsing.end-O.loading.start;this.bwEstimator.sample(S,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=S/1e3:this.bitrateTestDelay=0},r.onError=function(u,a){switch(a.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var u=this.fragCurrent,a=this.partCurrent,s=this.hls,f=s.maxAutoLevel,O=s.config,S=s.minAutoLevel,E=s.media,C=a?a.duration:u?u.duration:0,w=E?E.currentTime:0,g=E&&E.playbackRate!==0?Math.abs(E.playbackRate):1,v=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,h=(H.BufferHelper.bufferInfo(E,w,O.maxBufferHole).end-w)/g,o=this.findBestLevel(v,S,f,h,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(o>=0)return o;I.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=C?Math.min(C,O.maxStarvationDelay):O.maxStarvationDelay,m=O.abrBandWidthFactor,T=O.abrBandWidthUpFactor;if(!h){var N=this.bitrateTestDelay;if(N){var j=C?Math.min(C,O.maxLoadingDelay):O.maxLoadingDelay;_=j-N,I.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),m=T=1}}return o=this.findBestLevel(v,S,f,h+_,m,T),Math.max(o,0)},r.findBestLevel=function(u,a,s,f,O,S){for(var E,C=this.fragCurrent,w=this.partCurrent,g=this.lastLoadedFragLevel,v=this.hls.levels,h=v[g],o=!!(h!=null&&(E=h.details)!==null&&E!==void 0&&E.live),_=h==null?void 0:h.codecSet,m=w?w.duration:C?C.duration:0,T=s;T>=a;T--){var N=v[T];if(!N||_&&N.codecSet!==_)continue;var j=N.details,W=(w?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||m,Y=void 0;T<=g?Y=O*u:Y=S*u;var B=v[T].maxBitrate,R=B*W/Y;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+T+"/"+Math.round(Y)+"/"+B+"/"+W+"/"+f+"/"+R),Y>B&&(!R||o&&!this.bitrateTestDelay||R<f))return T}return-1},y(c,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,a=this.bwEstimator;if(u!==-1&&(!a||!a.canEstimate()))return u;var s=this.getNextABRAutoLevel();return u!==-1&&(s=Math.min(u,s)),s},set:function(u){this._nextAutoLevel=u}}]),c}();X.default=p},"./src/controller/audio-stream-controller.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),L=P("./src/controller/base-stream-controller.ts"),M=P("./src/events.ts"),H=P("./src/utils/buffer-helper.ts"),U=P("./src/controller/fragment-tracker.ts"),k=P("./src/types/level.ts"),I=P("./src/types/loader.ts"),b=P("./src/loader/fragment.ts"),y=P("./src/demux/chunk-cache.ts"),p=P("./src/demux/transmuxer-interface.ts"),c=P("./src/types/transmuxer.ts"),r=P("./src/controller/fragment-finders.ts"),l=P("./src/utils/discontinuities.ts"),u=P("./src/errors.ts"),a=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(C){for(var w=1;w<arguments.length;w++){var g=arguments[w];for(var v in g)Object.prototype.hasOwnProperty.call(g,v)&&(C[v]=g[v])}return C},s.apply(this,arguments)}function f(C,w){C.prototype=Object.create(w.prototype),C.prototype.constructor=C,O(C,w)}function O(C,w){return O=Object.setPrototypeOf||function(v,h){return v.__proto__=h,v},O(C,w)}var S=100,E=function(C){f(w,C);function w(v,h){var o;return o=C.call(this,v,h,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o._registerListeners(),o}var g=w.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var h=this.hls;h.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(M.Events.ERROR,this.onError,this),h.on(M.Events.BUFFER_RESET,this.onBufferReset,this),h.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var h=this.hls;h.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(M.Events.ERROR,this.onError,this),h.off(M.Events.BUFFER_RESET,this.onBufferReset,this),h.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onInitPtsFound=function(h,o){var _=o.frag,m=o.id,T=o.initPTS;if(m==="main"){var N=_.cc;this.initPTS[_.cc]=T,this.log("InitPTS for cc: "+N+" found from main: "+T),this.videoTrackCC=N,this.state===L.State.WAITING_INIT_PTS&&this.tick()}},g.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=L.State.STOPPED;return}var o=this.lastCurrentTime;this.stopLoad(),this.setInterval(S),this.fragLoadError=0,o>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),this.state=L.State.IDLE):(this.loadedmetadata=!1,this.state=L.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},g.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_TRACK:{var h,o=this.levels,_=this.trackId,m=o==null||((h=o[_])===null||h===void 0)?void 0:h.details;if(m){if(this.waitForCdnTuneIn(m))break;this.state=L.State.WAITING_INIT_PTS}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var T,N=performance.now(),j=this.retryDate;(!j||N>=j||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=L.State.IDLE);break}case L.State.WAITING_INIT_PTS:{var W=this.waitingData;if(W){var Y=W.frag,B=W.part,R=W.cache,$=W.complete;if(this.initPTS[Y.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.FRAG_LOADING;var te=R.flush(),ue={frag:Y,part:B,payload:te,networkDetails:null};this._handleFragmentLoadProgress(ue),$&&C.prototype._handleFragmentLoadComplete.call(this,ue)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+Y.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var me=this.getLoadPosition(),Me=H.BufferHelper.bufferInfo(this.mediaBuffer,me,this.config.maxBufferHole),Ae=Object(r.fragmentWithinToleranceTest)(Me.end,this.config.maxFragLookUpTolerance,Y);Ae<0&&(a.logger.log("Waiting fragment cc ("+Y.cc+") @ "+Y.start+" cancelled because another fragment at "+Me.end+" is needed"),this.clearWaitingFragment())}}else this.state=L.State.IDLE}}this.onTickEnd()},g.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.IDLE)},g.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var o=this.mediaBuffer?this.mediaBuffer:h,_=o.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},g.doTickIdle=function(){var h,o,_=this.hls,m=this.levels,T=this.media,N=this.trackId,j=_.config;if(!m||!m[N])return;if(!T&&(this.startFragRequested||!j.startFragPrefetch))return;var W=m[N],Y=W.details;if(!Y||Y.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(Y)){this.state=L.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(B===null)return;var R=B.len,$=this.getMaxBufferLength(),te=this.audioSwitch;if(R>=$&&!te)return;if(!te&&this._streamEnded(B,Y)){_.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=L.State.ENDED;return}var ue=Y.fragments,me=ue[0].start,Me=B.end;if(te){var Ae=this.getLoadPosition();Me=Ae,Y.PTSKnown&&Ae<me&&((B.end>me||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),T.currentTime=me+.05))}var De=this.getNextFragment(Me,Y);if(!De){this.bufferFlushed=!0;return}((h=De.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((o=De.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(De,Y):this.loadFragment(De,Y,Me)},g.getMaxBufferLength=function(){var h=C.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return o===null?h:Math.max(h,o.len)},g.onMediaDetaching=function(){this.videoBuffer=null,C.prototype.onMediaDetaching.call(this)},g.onAudioTracksUpdated=function(h,o){var _=o.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(m){return new k.Level(m)})},g.onAudioTrackSwitching=function(h,o){var _=!!o.url;this.trackId=o.id;var m=this.fragCurrent;m!=null&&m.loader&&m.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(S):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=L.State.IDLE):this.state=L.State.STOPPED,this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},g.onLevelLoaded=function(h,o){this.mainDetails=o.details},g.onAudioTrackLoaded=function(h,o){var _,m=this.levels,T=o.details,N=o.id;if(!m){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+T.startSN+","+T.endSN+"],duration:"+T.totalduration);var j=m[N],W=0;if(T.live||(_=j.details)!==null&&_!==void 0&&_.live){var Y=this.mainDetails;if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed||!Y)return;!j.details&&T.hasProgramDateTime&&Y.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(T,Y),W=T.fragments[0].start):W=this.alignPlaylists(T,j.details)}j.details=T,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!T.live)&&this.setStartPosition(j.details,W),this.state===L.State.WAITING_TRACK&&!this.waitForCdnTuneIn(T)&&(this.state=L.State.IDLE),this.tick()},g._handleFragmentLoadProgress=function(h){var o,_=h.frag,m=h.part,T=h.payload,N=this.config,j=this.trackId,W=this.levels;if(!W){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var Y=W[j];console.assert(Y,"Audio track is defined on fragment load progress");var B=Y.details;console.assert(B,"Audio track details are defined on fragment load progress");var R=N.defaultAudioCodec||Y.audioCodec||"mp4a.40.2",$=this.transmuxer;$||($=this.transmuxer=new p.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[_.cc],ue=(o=_.initSegment)===null||o===void 0?void 0:o.data;if(te!==void 0){var me=!1,Me=m?m.index:-1,Ae=Me!==-1,De=new c.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,T.byteLength,Me,Ae);$.push(T,ue,R,"",_,m,B.totalduration,me,De,te)}else{a.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+j);var Fe=this.waitingData=this.waitingData||{frag:_,part:m,cache:new y.default,complete:!1},Ne=Fe.cache;Ne.push(new Uint8Array(T)),this.waitingVideoCC=this.videoTrackCC,this.state=L.State.WAITING_INIT_PTS}},g._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}C.prototype._handleFragmentLoadComplete.call(this,h)},g.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},g.onBufferCreated=function(h,o){var _=o.tracks.audio;_&&(this.mediaBuffer=_.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},g.onFragBuffered=function(h,o){var _=o.frag,m=o.part;if(_.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(m?" p: "+m.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,m)},g.onError=function(h,o){switch(o.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,o);break;case u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==L.State.ERROR&&this.state!==L.State.STOPPED&&(this.state=o.fatal?L.State.ERROR:L.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var _=!0,m=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);m&&m.len>.5&&(_=!this.reduceMaxBufferLength(m.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},g.onBufferFlushed=function(h,o){var _=o.type;_===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},g._handleTransmuxComplete=function(h){var o,_="audio",m=this.hls,T=h.remuxResult,N=h.chunkMeta,j=this.getCurrentContext(N);if(!j){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var W=j.frag,Y=j.part,B=T.audio,R=T.text,$=T.id3,te=T.initSegment;if(this.fragContextChanged(W))return;if(this.state=L.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,W,N),m.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:_,tracks:te.tracks})),B){var ue=B.startPTS,me=B.endPTS,Me=B.startDTS,Ae=B.endDTS;Y&&(Y.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:me,startDTS:Me,endDTS:Ae}),W.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,ue,me,Me,Ae),this.bufferFragmentData(B,W,Y,N)}if($!=null&&(o=$.samples)!==null&&o!==void 0&&o.length){var De=s({frag:W,id:_},$);m.trigger(M.Events.FRAG_PARSING_METADATA,De)}if(R){var Fe=s({frag:W,id:_},R);m.trigger(M.Events.FRAG_PARSING_USERDATA,Fe)}},g._bufferInitSegment=function(h,o,_){if(this.state!==L.State.PARSING)return;h.video&&delete h.video;var m=h.audio;if(!m)return;m.levelCodec=m.codec,m.id="audio",this.log("Init audio buffer, container:"+m.container+", codecs[parsed]=["+m.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,h);var T=m.initSegment;if(T!=null&&T.byteLength){var N={type:"audio",frag:o,part:null,chunkMeta:_,parent:o.type,data:T};this.hls.trigger(M.Events.BUFFER_APPENDING,N)}this.tick()},g.loadFragment=function(h,o,_){var m=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||m===U.FragmentState.NOT_LOADED||m===U.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):o.live&&!Object(V.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=L.State.WAITING_INIT_PTS):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,h,o,_)))},g.completeAudioSwitch=function(){var h=this.hls,o=this.media,_=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:_})},w}(L.default);X.default=E},"./src/controller/audio-track-controller.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),L=P("./src/errors.ts"),M=P("./src/controller/base-playlist-controller.ts"),H=P("./src/types/loader.ts");function U(p,c){for(var r=0;r<c.length;r++){var l=c[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}function k(p,c,r){return c&&U(p.prototype,c),r&&U(p,r),p}function I(p,c){p.prototype=Object.create(c.prototype),p.prototype.constructor=p,b(p,c)}function b(p,c){return b=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},b(p,c)}var y=function(p){I(c,p);function c(l){var u;return u=p.call(this,l,"[audio-track-controller]")||this,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.trackName="",u.selectDefaultTrack=!0,u.registerListeners(),u}var r=c.prototype;return r.registerListeners=function(){var u=this.hls;u.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(V.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var u=this.hls;u.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(V.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},r.onManifestParsed=function(u,a){this.tracks=a.audioTracks||[]},r.onAudioTrackLoaded=function(u,a){var s=a.id,f=a.details,O=this.tracksInGroup[s];if(!O){this.warn("Invalid audio track id "+s);return}var S=O.details;O.details=a.details,this.log("audioTrack "+s+" loaded ["+f.startSN+"-"+f.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,a,S))},r.onLevelLoading=function(u,a){this.switchLevel(a.level)},r.onLevelSwitching=function(u,a){this.switchLevel(a.level)},r.switchLevel=function(u){var a=this.hls.levels[u];if(!(a!=null&&a.audioGroupIds))return;var s=a.audioGroupIds[a.urlId];if(this.groupId!==s){this.groupId=s;var f=this.tracks.filter(function(S){return!s||S.groupId===s});this.selectDefaultTrack&&!f.some(function(S){return S.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var O={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,O),this.selectInitialTrack()}},r.onError=function(u,a){if(p.prototype.onError.call(this,u,a),a.fatal||!a.context)return;a.context.type===H.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},r.setAudioTrack=function(u){var a=this.tracksInGroup;if(u<0||u>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=a[this.trackId];this.log("Now switching to audio-track index "+u);var f=a[u],O=f.id,S=f.groupId,E=S===void 0?"":S,C=f.name,w=f.type,g=f.url;if(this.trackId=u,this.trackName=C,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:E,name:C,type:w,url:g}),f.details&&!f.details.live)return;var v=this.switchParams(f.url,s==null?void 0:s.details);this.loadPlaylist(v)},r.selectInitialTrack=function(){var u=this.tracksInGroup;console.assert(u.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,s=this.findTrackId(a)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(u){for(var a=this.tracksInGroup,s=0;s<a.length;s++){var f=a[s];if((!this.selectDefaultTrack||f.default)&&(!u||u===f.name))return f.id}return-1},r.loadPlaylist=function(u){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var s=a.id,f=a.groupId,O=a.url;if(u)try{O=u.addDirectives(O)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:O,id:s,groupId:f,deliveryDirectives:u||null})}},k(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1,this.setAudioTrack(u)}}]),c}(M.default);X.default=y},"./src/controller/base-playlist-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return k});var V=P("./src/polyfills/number.ts"),L=P("./src/types/level.ts"),M=P("./src/controller/level-helper.ts"),H=P("./src/utils/logger.ts"),U=P("./src/errors.ts"),k=function(){function I(y,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,p+":"),this.warn=H.logger.warn.bind(H.logger,p+":"),this.hls=y}var b=I.prototype;return b.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},b.onError=function(p,c){c.fatal&&c.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},b.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},b.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},b.stopLoad=function(){this.canLoad=!1,this.clearTimer()},b.switchParams=function(p,c){var r=c==null?void 0:c.renditionReports;if(r)for(var l=0;l<r.length;l++){var u=r[l],a=""+u.URI;if(a===p.substr(-a.length)){var s=parseInt(u["LAST-MSN"]),f=parseInt(u["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var O=Math.min(c.age-c.partTarget,c.targetduration);f!==void 0&&O>c.partTarget&&(f+=1)}if(Object(V.isFiniteNumber)(s))return new L.HlsUrlParameters(s,Object(V.isFiniteNumber)(f)?f:void 0,L.HlsSkip.No)}}},b.loadPlaylist=function(p){},b.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},b.playlistLoaded=function(p,c,r){var l=this,u=c.details,a=c.stats,s=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(u.advancedDateTime=Date.now()-s,u.live||r!=null&&r.live){if(u.reloaded(r),r&&this.log("live playlist "+p+" "+(u.advanced?"REFRESHED "+u.lastPartSn+"-"+u.lastPartIndex:"MISSED")),r&&u.fragments.length>0&&Object(M.mergeDetails)(r,u),!this.canLoad||!u.live)return;var f,O=void 0,S=void 0;if(u.canBlockReload&&u.endSN&&u.advanced){var E=this.hls.config.lowLatencyMode,C=u.lastPartSn,w=u.endSN,g=u.lastPartIndex,v=g!==-1,h=C===w,o=E?0:g;v?(O=h?w+1:C,S=h?o:g+1):O=w+1;var _=u.age,m=_+u.ageHeader,T=Math.min(m-u.partTarget,u.targetduration*1.5);if(T>0){if(r&&T>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+T+" with playlist age: "+u.age),T=0;else{var N=Math.floor(T/u.targetduration);if(O+=N,S!==void 0){var j=Math.round(T%u.targetduration/u.partTarget);S+=j}this.log("CDN Tune-in age: "+u.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+T+" skip sn "+N+" to part "+S)}u.tuneInGoal=T}if(f=this.getDeliveryDirectives(u,c.deliveryDirectives,O,S),E||!h){this.loadPlaylist(f);return}}else f=this.getDeliveryDirectives(u,c.deliveryDirectives,O,S);var W=Object(M.computeReloadInterval)(u,a);O!==void 0&&u.canBlockReload&&(W-=u.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(W)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(f)},W)}else this.clearTimer()},b.getDeliveryDirectives=function(p,c,r,l){var u=Object(L.getSkipValue)(p,r);return c!=null&&c.skip&&p.deltaUpdateFailed&&(r=c.msn,l=c.part,u=L.HlsSkip.No),new L.HlsUrlParameters(r,l,u)},b.retryLoadingOrFail=function(p){var c=this,r=this.hls.config,l=this.retryCount<r.levelLoadingMaxRetry;if(l){var u;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(u=p.context)!==null&&u!==void 0&&u.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return l},I}()},"./src/controller/base-stream-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"State",function(){return w}),P.d(X,"default",function(){return g});var V=P("./src/polyfills/number.ts"),L=P("./src/task-loop.ts"),M=P("./src/controller/fragment-tracker.ts"),H=P("./src/utils/buffer-helper.ts"),U=P("./src/utils/logger.ts"),k=P("./src/events.ts"),I=P("./src/errors.ts"),b=P("./src/types/transmuxer.ts"),y=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/discontinuities.ts"),c=P("./src/controller/fragment-finders.ts"),r=P("./src/controller/level-helper.ts"),l=P("./src/loader/fragment-loader.ts"),u=P("./src/crypt/decrypter.ts"),a=P("./src/utils/time-ranges.ts"),s=P("./src/types/loader.ts");function f(v,h){for(var o=0;o<h.length;o++){var _=h[o];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}function O(v,h,o){return h&&f(v.prototype,h),o&&f(v,o),v}function S(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function E(v,h){v.prototype=Object.create(h.prototype),v.prototype.constructor=v,C(v,h)}function C(v,h){return C=Object.setPrototypeOf||function(_,m){return _.__proto__=m,_},C(v,h)}var w={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},g=function(v){E(h,v);function h(_,m,T){var N;return N=v.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=w.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=T,N.log=U.logger.log.bind(U.logger,T+":"),N.warn=U.logger.warn.bind(U.logger,T+":"),N.hls=_,N.fragmentLoader=new l.default(_.config),N.fragmentTracker=m,N.config=_.config,N.decrypter=new u.default(_,_.config),_.on(k.Events.KEY_LOADED,N.onKeyLoaded,S(N)),N}var o=h.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(m){},o.stopLoad=function(){this.fragmentLoader.abort();var m=this.fragCurrent;m&&this.fragmentTracker.removeFragment(m),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=w.STOPPED},o._streamEnded=function(m,T){var N=this.fragCurrent,j=this.fragmentTracker;if(!T.live&&N&&N.sn===T.endSN&&!m.nextStart){var W=j.getState(N);return W===M.FragmentState.PARTIAL||W===M.FragmentState.OK}return!1},o.onMediaAttached=function(m,T){var N=this.media=this.mediaBuffer=T.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===w.STOPPED&&this.startLoad(j.startPosition)},o.onMediaDetaching=function(){var m=this.media;m!=null&&m.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),m&&(m.removeEventListener("seeking",this.onvseeking),m.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},o.onMediaSeeking=function(){var m=this.config,T=this.fragCurrent,N=this.media,j=this.mediaBuffer,W=this.state,Y=N?N.currentTime:0,B=H.BufferHelper.bufferInfo(j||N,Y,m.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(Y)?Y.toFixed(3):Y)+", state: "+W),W===w.ENDED)this.resetLoadingState();else if(T&&!B.len){var R=m.maxFragLookUpTolerance,$=T.start-R,te=T.start+T.duration+R,ue=Y>te;(Y<$||ue)&&(ue&&T.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),T.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=Y),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=Y),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(m,T){if(this.state!==w.KEY_LOADING||T.frag!==this.fragCurrent||!this.levels)return;this.state=w.IDLE;var N=this.levels[T.frag.level].details;N&&this.loadFragment(T.frag,N,T.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),v.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=w.STOPPED,this.hls.off(k.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,v.prototype.onHandlerDestroyed.call(this)},o.loadKey=function(m,T){this.log("Loading key for "+m.sn+" of ["+T.startSN+"-"+T.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level),this.state=w.KEY_LOADING,this.fragCurrent=m,this.hls.trigger(k.Events.KEY_LOADING,{frag:m})},o.loadFragment=function(m,T,N){this._loadFragForPlayback(m,T,N)},o._loadFragForPlayback=function(m,T,N){var j=this,W=function(B){if(j.fragContextChanged(m)){j.warn("Fragment "+m.sn+(B.part?" p: "+B.part.index:"")+" of level "+m.level+" was dropped during download."),j.fragmentTracker.removeFragment(m);return}m.stats.chunkCount++,j._handleFragmentLoadProgress(B)};this._doFragLoad(m,T,N,W).then(function(Y){if(!Y)return;j.fragLoadError=0;var B=j.state;if(j.fragContextChanged(m)){(B===w.FRAG_LOADING||B===w.BACKTRACKING||!j.fragCurrent&&B===w.PARSING)&&(j.fragmentTracker.removeFragment(m),j.state=w.IDLE);return}if("payload"in Y&&(j.log("Loaded fragment "+m.sn+" of level "+m.level),j.hls.trigger(k.Events.FRAG_LOADED,Y),j.state===w.BACKTRACKING)){j.fragmentTracker.backtrack(m,Y),j.resetFragmentLoading(m);return}j._handleFragmentLoadComplete(Y)}).catch(function(Y){j.warn(Y),j.resetFragmentLoading(m)})},o.flushMainBuffer=function(m,T,N){if(N===void 0&&(N=null),!(m-T))return;var j={startOffset:m,endOffset:T,type:N};this.fragLoadError=0,this.hls.trigger(k.Events.BUFFER_FLUSHING,j)},o._loadInitSegment=function(m){var T=this;this._doFragLoad(m).then(function(N){if(!N||T.fragContextChanged(m)||!T.levels)throw new Error("init load aborted");return N}).then(function(N){var j=T.hls,W=N.payload,Y=m.decryptdata;if(W&&W.byteLength>0&&Y&&Y.key&&Y.iv&&Y.method==="AES-128"){var B=self.performance.now();return T.decrypter.webCryptoDecrypt(new Uint8Array(W),Y.key.buffer,Y.iv.buffer).then(function(R){var $=self.performance.now();return j.trigger(k.Events.FRAG_DECRYPTED,{frag:m,payload:R,stats:{tstart:B,tdecrypt:$}}),N.payload=R,N})}return N}).then(function(N){var j=T.fragCurrent,W=T.hls,Y=T.levels;if(!Y)throw new Error("init load aborted, missing levels");var B=Y[m.level].details;console.assert(B,"Level details are defined when init segment is loaded");var R=m.stats;T.state=w.IDLE,T.fragLoadError=0,m.data=new Uint8Array(N.payload),R.parsing.start=R.buffering.start=self.performance.now(),R.parsing.end=R.buffering.end=self.performance.now(),N.frag===j&&W.trigger(k.Events.FRAG_BUFFERED,{stats:R,frag:j,part:null,id:m.type}),T.tick()}).catch(function(N){T.warn(N),T.resetFragmentLoading(m)})},o.fragContextChanged=function(m){var T=this.fragCurrent;return!m||!T||m.level!==T.level||m.sn!==T.sn||m.urlId!==T.urlId},o.fragBufferedComplete=function(m,T){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+m.type+" sn: "+m.sn+(T?" part: "+T.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+m.level+" "+a.default.toString(H.BufferHelper.getBuffered(N))),this.state=w.IDLE,this.tick()},o._handleFragmentLoadComplete=function(m){var T=this.transmuxer;if(!T)return;var N=m.frag,j=m.part,W=m.partsLoaded,Y=!W||W.length===0||W.some(function(R){return!R}),B=new b.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,j?j.index:-1,!Y);T.flush(B)},o._handleFragmentLoadProgress=function(m){},o._doFragLoad=function(m,T,N,j){var W=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(m.start,N||0),this.config.lowLatencyMode&&T){var Y=T.partList;if(Y&&j){N>m.end&&T.fragmentHint&&(m=T.fragmentHint);var B=this.getNextPart(Y,m,N);if(B>-1){var R=Y[B];return this.log("Loading part sn: "+m.sn+" p: "+R.index+" cc: "+m.cc+" of playlist ["+T.startSN+"-"+T.endSN+"] parts [0-"+B+"-"+(Y.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=R.start+R.duration,this.state=w.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:m,part:Y[B],targetBufferTime:N}),this.doFragPartsLoad(m,Y,B,j).catch(function($){return W.handleFragLoadError($)})}else if(!m.url||this.loadedEndOfParts(Y,N))return Promise.resolve(null)}}return this.log("Loading fragment "+m.sn+" cc: "+m.cc+" "+(T?"of ["+T.startSN+"-"+T.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+m.level+", target: "+parseFloat(N.toFixed(3))),Object(V.isFiniteNumber)(m.sn)&&!this.bitrateTest&&(this.nextLoadPosition=m.start+m.duration),this.state=w.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:m,targetBufferTime:N}),this.fragmentLoader.load(m,j).catch(function($){return W.handleFragLoadError($)})},o.doFragPartsLoad=function(m,T,N,j){var W=this;return new Promise(function(Y,B){var R=[],$=function te(ue){var me=T[ue];W.fragmentLoader.loadPart(m,me,j).then(function(Me){R[me.index]=Me;var Ae=Me.part;W.hls.trigger(k.Events.FRAG_LOADED,Me);var De=T[ue+1];if(De&&De.fragment===m)te(ue+1);else return Y({frag:m,part:Ae,partsLoaded:R})}).catch(B)};$(N)})},o.handleFragLoadError=function(m){var T=m.data;return T&&T.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(T.frag,T.part):this.hls.trigger(k.Events.ERROR,T),null},o._handleTransmuxerFlush=function(m){var T=this.getCurrentContext(m);if(!T||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var N=T.frag,j=T.part,W=T.level,Y=self.performance.now();N.stats.parsing.end=Y,j&&(j.stats.parsing.end=Y),this.updateLevelTiming(N,j,W,m.partial)},o.getCurrentContext=function(m){var T=this.levels,N=m.level,j=m.sn,W=m.part;if(!T||!T[N])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+N+". The current chunk will not be buffered."),null;var Y=T[N],B=W>-1?Object(r.getPartWith)(Y,j,W):null,R=B?B.fragment:Object(r.getFragmentWithSN)(Y,j,this.fragCurrent);return R?{frag:R,part:B,level:Y}:null},o.bufferFragmentData=function(m,T,N,j){if(!m||this.state!==w.PARSING)return;var W=m.data1,Y=m.data2,B=W;if(W&&Y&&(B=Object(y.appendUint8Array)(W,Y)),!B||!B.length)return;var R={type:m.type,frag:T,part:N,chunkMeta:j,parent:T.type,data:B};this.hls.trigger(k.Events.BUFFER_APPENDING,R),m.dropped&&m.independent&&!N&&this.flushBufferGap(T)},o.flushBufferGap=function(m){var T=this.media;if(!T)return;if(!H.BufferHelper.isBuffered(T,T.currentTime)){this.flushMainBuffer(0,m.start);return}var N=T.currentTime,j=H.BufferHelper.bufferInfo(T,N,0),W=m.duration,Y=Math.min(this.config.maxFragLookUpTolerance*2,W*.25),B=Math.max(Math.min(m.start-Y,j.end-Y),N+Y);m.start-B>Y&&this.flushMainBuffer(B,m.start)},o.getFwdBufferInfo=function(m,T){var N=this.config,j=this.getLoadPosition();if(!Object(V.isFiniteNumber)(j))return null;var W=H.BufferHelper.bufferInfo(m,j,N.maxBufferHole);if(W.len===0&&W.nextStart!==void 0){var Y=this.fragmentTracker.getBufferedFrag(j,T);if(Y&&W.nextStart<Y.end)return H.BufferHelper.bufferInfo(m,j,Math.max(W.nextStart,N.maxBufferHole))}return W},o.getMaxBufferLength=function(m){var T=this.config,N;return m?N=Math.max(8*T.maxBufferSize/m,T.maxBufferLength):N=T.maxBufferLength,Math.min(N,T.maxMaxBufferLength)},o.reduceMaxBufferLength=function(m){var T=this.config,N=m||T.maxBufferLength;return T.maxMaxBufferLength>=N?(T.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+T.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(m,T){var N,j,W=T.fragments,Y=W.length;if(!Y)return null;var B=this.config,R=W[0].start,$;if(T.live){var te=B.initialLiveManifestSize;if(Y<te)return this.warn("Not enough fragments to start playback (have: "+Y+", need: "+te+")"),null;!T.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&($=this.getInitialLiveFragment(T,W),this.startPosition=$?this.hls.liveSyncPosition||$.start:m)}else m<=R&&($=W[0]);if(!$){var ue=B.lowLatencyMode?T.partEnd:T.fragmentEnd;$=this.getFragmentAtPosition(m,ue,T)}return(N=$)!==null&&N!==void 0&&N.initSegment&&!((j=$)!==null&&j!==void 0&&j.initSegment.data)&&!this.bitrateTest&&($=$.initSegment),$},o.getNextPart=function(m,T,N){for(var j=-1,W=!1,Y=!0,B=0,R=m.length;B<R;B++){var $=m[B];if(Y=Y&&!$.independent,j>-1&&N<$.start)break;var te=$.loaded;!te&&(W||$.independent||Y)&&$.fragment===T&&(j=B),W=te}return j},o.loadedEndOfParts=function(m,T){var N=m[m.length-1];return N&&T>N.start&&N.loaded},o.getInitialLiveFragment=function(m,T){var N=this.fragPrevious,j=null;if(N){if(m.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),j=Object(c.findFragmentByPDT)(T,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var W=N.sn+1;if(W>=m.startSN&&W<=m.endSN){var Y=T[W-m.startSN];N.cc===Y.cc&&(j=Y,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(c.findFragWithCC)(T,N.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(j=this.getFragmentAtPosition(B,this.bitrateTest?m.fragmentEnd:m.edge,m))}return j},o.getFragmentAtPosition=function(m,T,N){var j=this.config,W=this.fragPrevious,Y=N.fragments,B=N.endSN,R=N.fragmentHint,$=j.maxFragLookUpTolerance,te=!!(j.lowLatencyMode&&N.partList&&R);te&&R&&!this.bitrateTest&&(Y=Y.concat(R),B=R.sn);var ue;if(m<T){var me=m>T-$?0:$;ue=Object(c.findFragmentByPTS)(W,Y,m,me)}else ue=Y[Y.length-1];if(ue){var Me=ue.sn-N.startSN,Ae=W&&ue.level===W.level,De=Y[Me+1],Fe=this.fragmentTracker.getState(ue);if(Fe===M.FragmentState.BACKTRACKED){ue=null;for(var Ne=Me;Y[Ne]&&this.fragmentTracker.getState(Y[Ne])===M.FragmentState.BACKTRACKED;)W?ue=Y[Ne--]:ue=Y[--Ne];ue||(ue=De)}else W&&ue.sn===W.sn&&!te&&(Ae&&(ue.sn<B&&this.fragmentTracker.getState(De)!==M.FragmentState.OK?(this.log("SN "+ue.sn+" just loaded, load next one: "+De.sn),ue=De):ue=null))}return ue},o.synchronizeToLiveEdge=function(m){var T=this.config,N=this.media;if(!N)return;var j=this.hls.liveSyncPosition,W=N.currentTime,Y=m.fragments[0].start,B=m.edge,R=W>=Y-T.maxFragLookUpTolerance&&W<=B;if(j!==null&&N.duration>j&&(W<j||!R)){var $=T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:T.liveMaxLatencyDurationCount*m.targetduration;(!R&&N.readyState<4||W<B-$)&&(this.loadedmetadata||(this.nextLoadPosition=j),N.readyState&&(this.warn("Playback: "+W.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+j.toFixed(3)),N.currentTime=j))}},o.alignPlaylists=function(m,T){var N=this.levels,j=this.levelLastLoaded,W=this.fragPrevious,Y=j!==null?N[j]:null,B=m.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var R=m.fragments[0].start,$=!T,te=m.alignedSliding&&Object(V.isFiniteNumber)(R);if($||!te&&!R){Object(p.alignStream)(W,Y,m);var ue=m.fragments[0].start;return this.log("Live playlist sliding: "+ue.toFixed(2)+" start-sn: "+(T?T.startSN:"na")+"->"+m.startSN+" prev-sn: "+(W?W.sn:"na")+" fragments: "+B),ue}return R},o.waitForCdnTuneIn=function(m){var T=3;return m.live&&m.canBlockReload&&m.tuneInGoal>Math.max(m.partHoldBack,m.partTarget*T)},o.setStartPosition=function(m,T){var N=this.startPosition;if(N<T&&(N=-1),N===-1||this.lastCurrentTime===-1){var j=m.startTimeOffset;Object(V.isFiniteNumber)(j)?(N=T+j,j<0&&(N+=m.totalduration),N=Math.min(Math.max(T,N),T+m.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+N),this.startPosition=N):m.live?N=this.hls.liveSyncPosition||T:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},o.getLoadPosition=function(){var m=this.media,T=0;return this.loadedmetadata&&m?T=m.currentTime:this.nextLoadPosition&&(T=this.nextLoadPosition),T},o.handleFragLoadAborted=function(m,T){this.transmuxer&&m.sn!=="initSegment"&&m.stats.aborted&&(this.warn("Fragment "+m.sn+(T?" part"+T.index:"")+" of level "+m.level+" was aborted"),this.resetFragmentLoading(m))},o.resetFragmentLoading=function(m){(!this.fragCurrent||!this.fragContextChanged(m))&&(this.state=w.IDLE)},o.onFragmentOrKeyLoadError=function(m,T){if(T.fatal)return;var N=T.frag;if(!N||N.type!==m)return;var j=this.fragCurrent;console.assert(j&&N.sn===j.sn&&N.level===j.level&&N.urlId===j.urlId,"Frag load error must match current frag to retry");var W=this.config;if(this.fragLoadError+1<=W.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var Y=Math.min(Math.pow(2,this.fragLoadError)*W.fragLoadingRetryDelay,W.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+m+" "+N.level+" failed to load, retrying in "+Y+"ms"),this.retryDate=self.performance.now()+Y,this.fragLoadError++,this.state=w.FRAG_LOADING_WAITING_RETRY}else T.levelRetry?(m===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=w.IDLE):(U.logger.error(T.details+" reaches max retry, redispatch as fatal ..."),T.fatal=!0,this.hls.stopLoad(),this.state=w.ERROR)},o.afterBufferFlushed=function(m,T,N){if(!m)return;var j=H.BufferHelper.getBuffered(m);this.fragmentTracker.detectEvictedFragments(T,j,N),this.state===w.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=w.IDLE},o.resetLiveStartWhenNotLoaded=function(m){if(!this.loadedmetadata){this.startFragRequested=!1;var T=this.levels?this.levels[m].details:null;if(T!=null&&T.live)return this.startPosition=-1,this.setStartPosition(T,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(m,T,N,j){var W=this,Y=N.details;console.assert(!!Y,"level.details must be defined");var B=Object.keys(m.elementaryStreams).reduce(function(R,$){var te=m.elementaryStreams[$];if(te){var ue=te.endPTS-te.startPTS;if(ue<=0)return W.warn("Could not parse fragment "+m.sn+" "+$+" duration reliably ("+ue+") resetting transmuxer to fallback to playlist timing"),W.resetTransmuxer(),R||!1;var me=j?0:Object(r.updateFragPTSDTS)(Y,m,te.startPTS,te.endPTS,te.startDTS,te.endDTS);return W.hls.trigger(k.Events.LEVEL_PTS_UPDATED,{details:Y,level:N,drift:me,type:$,frag:m,start:te.startPTS,end:te.endPTS}),!0}return R},!1);B?(this.state=w.PARSED,this.hls.trigger(k.Events.FRAG_PARSED,{frag:m,part:T})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(h,[{key:"state",get:function(){return this._state},set:function(m){var T=this._state;T!==m&&(this._state=m,this.log(T+"->"+m))}}]),h}(L.default)},"./src/controller/buffer-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c});var V=P("./src/polyfills/number.ts"),L=P("./src/events.ts"),M=P("./src/utils/logger.ts"),H=P("./src/errors.ts"),U=P("./src/utils/buffer-helper.ts"),k=P("./src/utils/mediasource-helper.ts"),I=P("./src/loader/fragment.ts"),b=P("./src/controller/buffer-operation-queue.ts"),y=Object(k.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function r(u){var a=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=a.hls,f=a.media,O=a.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),f&&(a.updateMediaElementDuration(),s.trigger(L.Events.MEDIA_ATTACHED,{media:f})),O&&O.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=u,this._initSourceBuffer(),this.registerListeners()}var l=r.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var a=this.hls;a.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(L.Events.BUFFER_RESET,this.onBufferReset,this),a.on(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(L.Events.BUFFER_EOS,this.onBufferEos,this),a.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(L.Events.FRAG_PARSED,this.onFragParsed,this),a.on(L.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var a=this.hls;a.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(L.Events.BUFFER_RESET,this.onBufferReset,this),a.off(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(L.Events.BUFFER_EOS,this.onBufferEos,this),a.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(L.Events.FRAG_PARSED,this.onFragParsed,this),a.off(L.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(a,s){var f=2;(s.audio&&!s.video||!s.altAudio)&&(f=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=f,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(a,s){var f=this.media=s.media;if(f&&y){var O=this.mediaSource=new y;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),f.src=self.URL.createObjectURL(O),this._objectUrl=f.src}},l.onMediaDetaching=function(){var a=this.media,s=this.mediaSource,f=this._objectUrl;if(s){if(M.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(O){M.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(f&&self.URL.revokeObjectURL(f),a.src===f?(a.removeAttribute("src"),a.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(L.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(s){var f=a.sourceBuffer[s];try{f&&(a.removeBufferListeners(s),a.mediaSource&&a.mediaSource.removeSourceBuffer(f),a.sourceBuffer[s]=void 0)}catch(O){M.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",O)}}),this._initSourceBuffer()},l.onBufferCodecs=function(a,s){var f=this,O=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(S){if(O){var E=f.tracks[S];if(E&&typeof E.buffer.changeType=="function"){var C=s[S],w=C.codec,g=C.levelCodec,v=C.container,h=(E.levelCodec||E.codec).replace(p,"$1"),o=(g||w).replace(p,"$1");if(h!==o){var _=v+";codecs="+(g||w);f.appendChangeType(S,_)}}}else f.pendingTracks[S]=s[S]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(a,s){var f=this,O=this.operationQueue,S={execute:function(){var C=f.sourceBuffer[a];C&&(M.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+s),C.changeType(s)),O.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(C){M.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",C)}};O.append(S,a)},l.onBufferAppending=function(a,s){var f=this,O=this.hls,S=this.operationQueue,E=this.tracks,C=s.data,w=s.type,g=s.frag,v=s.part,h=s.chunkMeta,o=h.buffering[w],_=self.performance.now();o.start=_;var m=g.stats.buffering,T=v?v.stats.buffering:null;m.start===0&&(m.start=_),T&&T.start===0&&(T.start=_);var N=E.audio,j=w==="audio"&&h.id===1&&(N==null?void 0:N.container)==="audio/mpeg",W={execute:function(){if(o.executeStart=self.performance.now(),j){var B=f.sourceBuffer[w];if(B){var R=g.start-B.timestampOffset;Math.abs(R)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+g.start+" (delta: "+R+") sn: "+g.sn+")"),B.timestampOffset=g.start)}}f.appendExecutor(C,w)},onStart:function(){},onComplete:function(){var B=self.performance.now();o.executeEnd=o.end=B,m.first===0&&(m.first=B),T&&T.first===0&&(T.first=B);var R=f.sourceBuffer,$={};for(var te in R)$[te]=U.BufferHelper.getBuffered(R[te]);f.appendError=0,f.hls.trigger(L.Events.BUFFER_APPENDED,{type:w,frag:g,part:v,chunkMeta:h,parent:g.type,timeRanges:$})},onError:function(B){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",B);var R={type:H.ErrorTypes.MEDIA_ERROR,parent:g.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=H.ErrorDetails.BUFFER_FULL_ERROR:(f.appendError++,R.details=H.ErrorDetails.BUFFER_APPEND_ERROR,f.appendError>O.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),R.fatal=!0)),O.trigger(L.Events.ERROR,R)}};S.append(W,w)},l.onBufferFlushing=function(a,s){var f=this,O=this.operationQueue,S=function(C){return{execute:f.removeExecutor.bind(f,C,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(L.Events.BUFFER_FLUSHED,{type:C})},onError:function(g){M.logger.warn("[buffer-controller]: Failed to remove from "+C+" SourceBuffer",g)}}};s.type?O.append(S(s.type),s.type):this.getSourceBufferTypes().forEach(function(E){O.append(S(E),E)})},l.onFragParsed=function(a,s){var f=this,O=s.frag,S=s.part,E=[],C=S?S.elementaryStreams:O.elementaryStreams;C[I.ElementaryStreamTypes.AUDIOVIDEO]?E.push("audiovideo"):(C[I.ElementaryStreamTypes.AUDIO]&&E.push("audio"),C[I.ElementaryStreamTypes.VIDEO]&&E.push("video"));var w=function(){var v=self.performance.now();O.stats.buffering.end=v,S&&(S.stats.buffering.end=v);var h=S?S.stats:O.stats;f.hls.trigger(L.Events.FRAG_BUFFERED,{frag:O,part:S,stats:h,id:O.type})};E.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(w,E)},l.onFragChanged=function(a,s){this.flushBackBuffer()},l.onBufferEos=function(a,s){var f=this,O=this.getSourceBufferTypes().reduce(function(S,E){var C=f.sourceBuffer[E];return(!s.type||s.type===E)&&(C&&!C.ended&&(C.ended=!0,M.logger.log("[buffer-controller]: "+E+" sourceBuffer now EOS"))),S&&!!(!C||C.ended)},!0);O&&this.blockBuffers(function(){var S=f.mediaSource;if(!S||S.readyState!=="open")return;S.endOfStream()})},l.onLevelUpdated=function(a,s){var f=s.details;if(!f.fragments.length)return;this.details=f,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var a=this.hls,s=this.details,f=this.media,O=this.sourceBuffer;if(!f||s===null)return;var S=this.getSourceBufferTypes();if(!S.length)return;var E=s.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(V.isFiniteNumber)(E)||E<0)return;var C=f.currentTime,w=s.levelTargetDuration,g=Math.max(E,w),v=Math.floor(C/w)*w-g;S.forEach(function(h){var o=O[h];if(o){var _=U.BufferHelper.getBuffered(o);_.length>0&&v>_.start(0)&&(a.trigger(L.Events.BACK_BUFFER_REACHED,{bufferEnd:v}),s.live&&a.trigger(L.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:v}),a.trigger(L.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:v,type:h}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,s=this.hls,f=this.media,O=this.mediaSource,S=a.fragments[0].start+a.totalduration,E=f.duration,C=Object(V.isFiniteNumber)(O.duration)?O.duration:0;a.live&&s.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(a)):(S>C&&S>E||!Object(V.isFiniteNumber)(E))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+S.toFixed(3)),O.duration=S)},l.updateSeekableRange=function(a){var s=this.mediaSource,f=a.fragments,O=f.length;if(O&&a.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var S=Math.max(0,f[0].start),E=Math.max(S,S+a.totalduration);s.setLiveSeekableRange(S,E)}},l.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,s=this.operationQueue,f=this.pendingTracks,O=Object.keys(f).length;if(O&&!a||O===2){this.createSourceBuffers(f),this.pendingTracks={};var S=this.getSourceBufferTypes();if(S.length===0){this.hls.trigger(L.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}S.forEach(function(E){s.executeNext(E)})}},l.createSourceBuffers=function(a){var s=this.sourceBuffer,f=this.mediaSource;if(!f)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var S in a)if(!s[S]){var E=a[S];if(!E)throw Error("source buffer exists for track "+S+", however track does not");var C=E.levelCodec||E.codec,w=E.container+";codecs="+C;M.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var g=s[S]=f.addSourceBuffer(w),v=S;this.addBufferListener(v,"updatestart",this._onSBUpdateStart),this.addBufferListener(v,"updateend",this._onSBUpdateEnd),this.addBufferListener(v,"error",this._onSBUpdateError),this.tracks[S]={buffer:g,codec:C,container:E.container,levelCodec:E.levelCodec,id:E.id},O++}catch(h){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(L.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:w})}}O&&this.hls.trigger(L.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(a){var s=this.operationQueue,f=s.current(a);f.onStart()},l._onSBUpdateEnd=function(a){var s=this.operationQueue,f=s.current(a);f.onComplete(),s.shiftAndExecuteNext(a)},l._onSBUpdateError=function(a,s){M.logger.error("[buffer-controller]: "+a+" SourceBuffer error",s),this.hls.trigger(L.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var f=this.operationQueue.current(a);f&&f.onError(s)},l.removeExecutor=function(a,s,f){var O=this.media,S=this.mediaSource,E=this.operationQueue,C=this.sourceBuffer,w=C[a];if(!O||!S||!w){M.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),E.shiftAndExecuteNext(a);return}var g=Object(V.isFiniteNumber)(O.duration)?O.duration:Infinity,v=Object(V.isFiniteNumber)(S.duration)?S.duration:Infinity,h=Math.max(0,s),o=Math.min(f,g,v);o>h?(M.logger.log("[buffer-controller]: Removing ["+h+","+o+"] from the "+a+" SourceBuffer"),console.assert(!w.updating,a+" sourceBuffer must not be updating"),w.remove(h,o)):E.shiftAndExecuteNext(a)},l.appendExecutor=function(a,s){var f=this.operationQueue,O=this.sourceBuffer,S=O[s];if(!S){M.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(s);return}S.ended=!1,console.assert(!S.updating,s+" sourceBuffer must not be updating"),S.appendBuffer(a)},l.blockBuffers=function(a,s){var f=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var O=this.operationQueue,S=s.map(function(E){return O.appendBlocker(E)});Promise.all(S).then(function(){a(),s.forEach(function(E){var C=f.sourceBuffer[E];(!C||!C.updating)&&O.shiftAndExecuteNext(E)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(a,s,f){var O=this.sourceBuffer[a];if(!O)return;var S=f.bind(this,a);this.listeners[a].push({event:s,listener:S}),O.addEventListener(s,S)},l.removeBufferListeners=function(a){var s=this.sourceBuffer[a];if(!s)return;this.listeners[a].forEach(function(f){s.removeEventListener(f.event,f.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return L});var V=P("./src/utils/logger.ts"),L=function(){function M(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var H=M.prototype;return H.append=function(k,I){var b=this.queues[I];b.push(k),b.length===1&&this.buffers[I]&&this.executeNext(I)},H.insertAbort=function(k,I){var b=this.queues[I];b.unshift(k),this.executeNext(I)},H.appendBlocker=function(k){var I,b=new Promise(function(p){I=p}),y={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(y,k),b},H.executeNext=function(k){var I=this.buffers,b=this.queues,y=I[k],p=b[k];if(p.length){var c=p[0];try{c.execute()}catch(r){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(r),(!y||!y.updating)&&(p.shift(),this.executeNext(k))}}},H.shiftAndExecuteNext=function(k){this.queues[k].shift(),this.executeNext(k)},H.current=function(k){return this.queues[k][0]},M}()},"./src/controller/cap-level-controller.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/events.ts");function L(U,k){for(var I=0;I<k.length;I++){var b=k[I];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(U,b.key,b)}}function M(U,k,I){return k&&L(U.prototype,k),I&&L(U,I),U}var H=function(){function U(I){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=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var k=U.prototype;return k.setStreamController=function(b){this.streamController=b},k.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},k.registerListeners=function(){var b=this.hls;b.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.unregisterListener=function(){var b=this.hls;b.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.onFpsDropLevelCapping=function(b,y){U.isLevelAllowed(y.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(y.droppedLevel)},k.onMediaAttaching=function(b,y){this.media=y.media instanceof HTMLVideoElement?y.media:null},k.onManifestParsed=function(b,y){var p=this.hls;this.restrictedLevels=[],this.firstLevel=y.firstLevel,p.config.capLevelToPlayerSize&&y.video&&this.startCapping()},k.onBufferCodecs=function(b,y){var p=this.hls;p.config.capLevelToPlayerSize&&y.video&&this.startCapping()},k.onMediaDetaching=function(){this.stopCapping()},k.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var y=this.hls;y.autoLevelCapping=this.getMaxLevel(b.length-1),y.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=y.autoLevelCapping}}},k.getMaxLevel=function(b){var y=this,p=this.hls.levels;if(!p.length)return-1;var c=p.filter(function(r,l){return U.isLevelAllowed(l,y.restrictedLevels)&&l<=b});return this.clientRect=null,U.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},k.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()},k.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},k.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,y={width:0,height:0};if(b){var p=b.getBoundingClientRect();y.width=p.width,y.height=p.height,!y.width&&!y.height&&(y.width=p.right-p.left||b.width||0,y.height=p.bottom-p.top||b.height||0)}return this.clientRect=y,y},U.isLevelAllowed=function(b,y){return y===void 0&&(y=[]),y.indexOf(b)===-1},U.getMaxLevelByMediaSize=function(b,y,p){if(!b||!b.length)return-1;for(var c=function(s,f){return f?s.width!==f.width||s.height!==f.height:!0},r=b.length-1,l=0;l<b.length;l+=1){var u=b[l];if((u.width>=y||u.height>=p)&&c(u,b[l+1])){r=l;break}}return r},M(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(y){}return b}}]),U}();X.default=H},"./src/controller/cmcd-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c});var V=P("./src/events.ts"),L=P("./src/types/cmcd.ts"),M=P("./src/utils/buffer-helper.ts"),H=P("./src/utils/logger.ts");function U(r,l){for(var u=0;u<l.length;u++){var a=l[u];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}function k(r,l,u){return l&&U(r.prototype,l),u&&U(r,u),r}function I(r,l){var u=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(u)return(u=u.call(r)).next.bind(u);if(Array.isArray(r)||(u=b(r))||l&&r&&typeof r.length=="number"){u&&(r=u);var a=0;return function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b(r,l){if(!r)return;if(typeof r=="string")return y(r,l);var u=Object.prototype.toString.call(r).slice(8,-1);if(u==="Object"&&r.constructor&&(u=r.constructor.name),u==="Map"||u==="Set")return Array.from(r);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return y(r,l)}function y(r,l){(l==null||l>r.length)&&(l=r.length);for(var u=0,a=new Array(l);u<l;u++)a[u]=r[u];return a}function p(){return p=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var a in u)Object.prototype.hasOwnProperty.call(u,a)&&(r[a]=u[a])}return r},p.apply(this,arguments)}var c=function(){function r(u){var a=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){a.initialized&&(a.starved=!0),a.buffering=!0},this.onPlaying=function(){a.initialized||(a.initialized=!0),a.buffering=!1},this.applyPlaylistData=function(O){try{a.apply(O,{ot:L.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(S){H.logger.warn("Could not generate manifest CMCD data.",S)}},this.applyFragmentData=function(O){try{var S=O.frag,E=a.hls.levels[S.level],C=a.getObjectType(S),w={d:S.duration*1e3,ot:C};(C===L.CMCDObjectType.VIDEO||C===L.CMCDObjectType.AUDIO||C==L.CMCDObjectType.MUXED)&&(w.br=E.bitrate/1e3,w.tb=a.getTopBandwidth(C),w.bl=a.getBufferLength(C)),a.apply(O,w)}catch(g){H.logger.warn("Could not generate segment CMCD data.",g)}},this.hls=u;var s=this.config=u.config,f=s.cmcd;f!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=f.sessionId||r.uuid(),this.cid=f.contentId,this.useHeaders=f.useHeaders===!0,this.registerListeners())}var l=r.prototype;return l.registerListeners=function(){var a=this.hls;a.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(V.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var a=this.hls;a.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(V.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},l.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},l.onMediaAttached=function(a,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},l.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},l.onBufferCreated=function(a,s){var f,O;this.audioBuffer=(f=s.tracks.audio)===null||f===void 0?void 0:f.buffer,this.videoBuffer=(O=s.tracks.video)===null||O===void 0?void 0:O.buffer},l.createData=function(){var a;return{v:L.CMCDVersion,sf:L.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(a=this.media)===null||a===void 0?void 0:a.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},l.apply=function(a,s){s===void 0&&(s={}),p(s,this.createData());var f=s.ot===L.CMCDObjectType.INIT||s.ot===L.CMCDObjectType.VIDEO||s.ot===L.CMCDObjectType.MUXED;if(this.starved&&f&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var O=r.toHeaders(s);if(!Object.keys(O).length)return;a.headers||(a.headers={}),p(a.headers,O)}else{var S=r.toQuery(s);if(!S)return;a.url=r.appendQueryToUri(a.url,S)}},l.getObjectType=function(a){var s=a.type;return s==="subtitle"?L.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?L.CMCDObjectType.INIT:s==="audio"?L.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?L.CMCDObjectType.VIDEO:L.CMCDObjectType.MUXED:void 0},l.getTopBandwidth=function(a){for(var s=0,f=a===L.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=I(f),S;!(S=O()).done;){var E=S.value;E.bitrate>s&&(s=E.bitrate)}return s>0?s:NaN},l.getBufferLength=function(a){var s=this.hls.media,f=a===L.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!f||!s)return NaN;var O=M.BufferHelper.bufferInfo(f,s.currentTime,this.config.maxBufferHole);return O.len*1e3},l.createPlaylistLoader=function(){var a=this.config.pLoader,s=this.applyPlaylistData,f=a||this.config.loader;return function(){function O(E){this.loader=void 0,this.loader=new f(E)}var S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(C,w,g){s(C),this.loader.load(C,w,g)},k(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},l.createFragmentLoader=function(){var a=this.config.fLoader,s=this.applyFragmentData,f=a||this.config.loader;return function(){function O(E){this.loader=void 0,this.loader=new f(E)}var S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(C,w,g){s(C),this.loader.load(C,w,g)},k(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},r.uuid=function(){var a=URL.createObjectURL(new Blob),s=a.toString();return URL.revokeObjectURL(a),s.substr(s.lastIndexOf("/")+1)},r.serialize=function(a){for(var s=[],f=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},O=function(j){return Math.round(j)},S=function(j){return O(j/100)*100},E=function(j){return encodeURIComponent(j)},C={br:O,d:O,bl:S,dl:S,mtp:S,nor:E,rtp:S,tb:O},w=Object.keys(a||{}).sort(),g=I(w),v;!(v=g()).done;){var h=v.value,o=a[h];if(!f(o))continue;if(h==="v"&&o===1)continue;if(h=="pr"&&o===1)continue;var _=C[h];_&&(o=_(o));var m=typeof o,T=void 0;h==="ot"||h==="sf"||h==="st"?T=h+"="+o:m==="boolean"?T=h:m==="number"?T=h+"="+o:T=h+"="+JSON.stringify(o),s.push(T)}return s.join(",")},r.toHeaders=function(a){for(var s=Object.keys(a),f={},O=["Object","Request","Session","Status"],S=[{},{},{},{}],E={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},C=0,w=s;C<w.length;C++){var g=w[C],v=E[g]!=null?E[g]:1;S[v][g]=a[g]}for(var h=0;h<S.length;h++){var o=r.serialize(S[h]);o&&(f["CMCD-"+O[h]]=o)}return f},r.toQuery=function(a){return"CMCD="+encodeURIComponent(r.serialize(a))},r.appendQueryToUri=function(a,s){if(!s)return a;var f=a.includes("?")?"&":"?";return""+a+f+s},r}()},"./src/controller/eme-controller.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),L=P("./src/errors.ts"),M=P("./src/utils/logger.ts"),H=P("./src/utils/mediakeys-helper.ts");function U(c,r){for(var l=0;l<r.length;l++){var u=r[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}function k(c,r,l){return r&&U(c.prototype,r),l&&U(c,l),c}var I=3,b=function(r,l,u){var a={audioCapabilities:[],videoCapabilities:[]};return r.forEach(function(s){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:u.audioRobustness||""})}),l.forEach(function(s){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:u.videoRobustness||""})}),[a]},y=function(r,l,u,a){switch(r){case H.KeySystems.WIDEVINE:return b(l,u,a);default:throw new Error("Unknown key-system: "+r)}},p=function(){function c(l){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=l,this._config=l.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 r=c.prototype;return r.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},r._registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r._unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r.getLicenseServerUrl=function(u){switch(u){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+u+'"')},r._attemptKeySystemAccess=function(u,a,s){var f=this,O=y(u,a,s,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var S=this.requestMediaKeySystemAccess(u,O);this.mediaKeysPromise=S.then(function(E){return f._onMediaKeySystemAccessObtained(u,E)}),S.catch(function(E){M.logger.error('Failed to obtain key-system "'+u+'" access:',E)})},r._onMediaKeySystemAccessObtained=function(u,a){var s=this;M.logger.log('Access for key-system "'+u+'" obtained');var f={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:u};this._mediaKeysList.push(f);var O=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(S){return f.mediaKeys=S,M.logger.log('Media-keys created for key-system "'+u+'"'),s._onMediaKeysCreated(),S});return O.catch(function(S){M.logger.error("Failed to create media-keys:",S)}),O},r._onMediaKeysCreated=function(){var u=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),u._onNewMediaKeySession(a.mediaKeysSession))})},r._onNewMediaKeySession=function(u){var a=this;M.logger.log("New key-system session "+u.sessionId),u.addEventListener("message",function(s){a._onKeySessionMessage(u,s.message)},!1)},r._onKeySessionMessage=function(u,a){M.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(s){M.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),u.update(s)})},r.onMediaEncrypted=function(u){var a=this;if(M.logger.log('Media is encrypted using "'+u.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(O){if(!a._media)return;a._attemptSetMediaKeys(O),a._generateRequestWithPreferredKeySession(u.initDataType,u.initData)};this.mediaKeysPromise.then(s).catch(s)},r._attemptSetMediaKeys=function(u){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},r._generateRequestWithPreferredKeySession=function(u,a){var s=this,f=this._mediaKeysList[0];if(!f){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(f.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var O=f.mediaKeysSession;if(!O){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+u+'" init data type'),f.mediaKeysSessionInitialized=!0,O.generateRequest(u,a).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(S){M.logger.error("Error generating key-session request:",S),s.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},r._createLicenseXhr=function(u,a,s){var f=new XMLHttpRequest;f.responseType="arraybuffer",f.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,f,u,a,s);var O=this._licenseXhrSetup;if(O)try{O.call(this.hls,f,u),O=void 0}catch(S){M.logger.error(S)}try{f.readyState||f.open("POST",u,!0),O&&O.call(this.hls,f,u)}catch(S){throw new Error("issue setting up KeySystem license XHR "+S)}return f},r._onLicenseRequestReadyStageChange=function(u,a,s,f){switch(u.readyState){case 4:if(u.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var O=u.response,S=this._licenseResponseCallback;if(S)try{O=S.call(this.hls,u,a)}catch(C){M.logger.error(C)}f(O)}else{if(M.logger.error("License Request XHR failed ("+a+"). Status: "+u.status+" ("+u.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var E=I-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+E+" attempts left"),this._requestLicense(s,f)}break}},r._generateLicenseRequestChallenge=function(u,a){switch(u.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+u.mediaKeySystemDomain)},r._requestLicense=function(u,a){M.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var f=this.getLicenseServerUrl(s.mediaKeySystemDomain),O=this._createLicenseXhr(f,u,a);M.logger.log("Sending license request to URL: "+f);var S=this._generateLicenseRequestChallenge(s,u);O.send(S)}catch(E){M.logger.error("Failure requesting DRM license: "+E),this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(u,a){if(!this._emeEnabled)return;var s=a.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var u=this._media,a=this._mediaKeysList;if(!u)return;u.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return u.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(u,a){if(!this._emeEnabled)return;var s=a.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),f=a.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,s,f)},k(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();X.default=p},"./src/controller/fps-controller.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),L=P("./src/utils/logger.ts"),M=function(){function H(k){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=k,this.registerListeners()}var U=H.prototype;return U.setStreamController=function(I){this.streamController=I},U.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(I,b){var y=this.hls.config;if(y.capLevelOnFPSDrop){var p=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),y.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(I,b,y){var p=performance.now();if(b){if(this.lastTime){var c=p-this.lastTime,r=y-this.lastDroppedFrames,l=b-this.lastDecodedFrames,u=1e3*r/c,a=this.hls;if(a.trigger(V.Events.FPS_DROP,{currentDropped:r,currentDecoded:l,totalDroppedFrames:y}),u>0&&r>a.config.fpsDroppedMonitoringThreshold*l){var s=a.currentLevel;L.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=s)&&(s=s-1,a.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:a.currentLevel}),a.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=y,this.lastDecodedFrames=b}},U.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var b=I.getVideoPlaybackQuality();this.checkFPS(I,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},H}();X.default=M},"./src/controller/fragment-finders.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"findFragmentByPDT",function(){return M}),P.d(X,"findFragmentByPTS",function(){return H}),P.d(X,"fragmentWithinToleranceTest",function(){return U}),P.d(X,"pdtWithinToleranceTest",function(){return k}),P.d(X,"findFragWithCC",function(){return I});var V=P("./src/polyfills/number.ts"),L=P("./src/utils/binary-search.ts");function M(b,y,p){if(y===null||!Array.isArray(b)||!b.length||!Object(V.isFiniteNumber)(y))return null;var c=b[0].programDateTime;if(y<(c||0))return null;var r=b[b.length-1].endProgramDateTime;if(y>=(r||0))return null;p=p||0;for(var l=0;l<b.length;++l){var u=b[l];if(k(y,p,u))return u}return null}function H(b,y,p,c){p===void 0&&(p=0),c===void 0&&(c=0);var r=null;if(b?r=y[b.sn-y[0].sn+1]||null:p===0&&y[0].start===0&&(r=y[0]),r&&U(p,c,r)===0)return r;var l=L.default.search(y,U.bind(null,p,c));return l||r}function U(b,y,p){b===void 0&&(b=0),y===void 0&&(y=0);var c=Math.min(y,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-c<=b?1:p.start-c>b&&p.start?-1:0}function k(b,y,p){var c=Math.min(y,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,r=p.endProgramDateTime||0;return r-c>b}function I(b,y){return L.default.search(b,function(p){return p.cc<y?1:p.cc>y?-1:0})}},"./src/controller/fragment-tracker.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"FragmentState",function(){return M}),P.d(X,"FragmentTracker",function(){return H});var V=P("./src/events.ts"),L=P("./src/types/loader.ts"),M;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(M||(M={}));var H=function(){function I(y){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=y,this._registerListeners()}var b=I.prototype;return b._registerListeners=function(){var p=this.hls;p.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var p=this.hls;p.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(p,c){if(c===L.PlaylistLevelType.MAIN){var r=this.activeFragment,l=this.activeParts;if(!r)return null;if(l)for(var u=l.length;u--;){var a=l[u],s=a?a.end:r.appendedPTS;if(a.start<=p&&s!==void 0&&p<=s)return u>9&&(this.activeParts=l.slice(u-9)),a}else if(r.start<=p&&r.appendedPTS!==void 0&&p<=r.appendedPTS)return r}return this.getBufferedFrag(p,c)},b.getBufferedFrag=function(p,c){for(var r=this.fragments,l=Object.keys(r),u=l.length;u--;){var a=r[l[u]];if((a==null?void 0:a.body.type)===c&&a.buffered){var s=a.body;if(s.start<=p&&p<=s.end)return s}}return null},b.detectEvictedFragments=function(p,c,r){var l=this;Object.keys(this.fragments).forEach(function(u){var a=l.fragments[u];if(!a)return;if(!a.buffered){a.body.type===r&&l.removeFragment(a.body);return}var s=a.range[p];if(!s)return;s.time.some(function(f){var O=!l.isTimeBuffered(f.startPTS,f.endPTS,c);return O&&l.removeFragment(a.body),O})})},b.detectPartialFragments=function(p){var c=this,r=this.timeRanges,l=p.frag,u=p.part;if(!r||l.sn==="initSegment")return;var a=k(l),s=this.fragments[a];if(!s)return;Object.keys(r).forEach(function(f){var O=l.elementaryStreams[f];if(!O)return;var S=r[f],E=u!==null||O.partial===!0;s.range[f]=c.getBufferedTimes(l,u,E,S)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},b.fragBuffered=function(p){var c=k(p),r=this.fragments[c];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},b.getBufferedTimes=function(p,c,r,l){for(var u={time:[],partial:r},a=c?c.start:p.start,s=c?c.end:p.end,f=p.minEndPTS||s,O=p.maxStartPTS||a,S=0;S<l.length;S++){var E=l.start(S)-this.bufferPadding,C=l.end(S)+this.bufferPadding;if(O>=E&&f<=C){u.time.push({startPTS:Math.max(a,l.start(S)),endPTS:Math.min(s,l.end(S))});break}else if(a<C&&s>E)u.partial=!0,u.time.push({startPTS:Math.max(a,l.start(S)),endPTS:Math.min(s,l.end(S))});else if(s<=E)break}return u},b.getPartialFragment=function(p){var c=null,r,l,u,a=0,s=this.bufferPadding,f=this.fragments;return Object.keys(f).forEach(function(O){var S=f[O];if(!S)return;U(S)&&(l=S.body.start-s,u=S.body.end+s,p>=l&&p<=u&&(r=Math.min(p-l,u-p),a<=r&&(c=S.body,a=r)))}),c},b.getState=function(p){var c=k(p),r=this.fragments[c];return r?r.buffered?U(r)?M.PARTIAL:M.OK:r.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},b.backtrack=function(p,c){var r=k(p),l=this.fragments[r];if(!l||l.backtrack)return null;var u=l.backtrack=c||l.loaded;return l.loaded=null,u},b.getBacktrackData=function(p){var c=k(p),r=this.fragments[c];if(r){var l,u=r.backtrack;if(u!=null&&(l=u.payload)!==null&&l!==void 0&&l.byteLength)return u;this.removeFragment(p)}return null},b.isTimeBuffered=function(p,c,r){for(var l,u,a=0;a<r.length;a++){if(l=r.start(a)-this.bufferPadding,u=r.end(a)+this.bufferPadding,p>=l&&c<=u)return!0;if(c<=l)return!1}return!1},b.onFragLoaded=function(p,c){var r=c.frag,l=c.part;if(r.sn==="initSegment"||r.bitrateTest||l)return;var u=k(r);this.fragments[u]={body:r,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(p,c){var r=this,l=c.frag,u=c.part,a=c.timeRanges;if(l.type===L.PlaylistLevelType.MAIN)if(this.activeFragment=l,u){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(u)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(f){var O=a[f];if(r.detectEvictedFragments(f,O),!u)for(var S=0;S<O.length;S++)l.appendedPTS=Math.max(O.end(S),l.appendedPTS||0)})},b.onFragBuffered=function(p,c){this.detectPartialFragments(c)},b.hasFragment=function(p){var c=k(p);return!!this.fragments[c]},b.removeFragmentsInRange=function(p,c,r){var l=this;Object.keys(this.fragments).forEach(function(u){var a=l.fragments[u];if(!a)return;if(a.buffered){var s=a.body;s.type===r&&s.start<c&&s.end>p&&l.removeFragment(s)}})},b.removeFragment=function(p){var c=k(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[c]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function U(I){var b,y;return I.buffered&&(((b=I.range.video)===null||b===void 0?void 0:b.partial)||((y=I.range.audio)===null||y===void 0?void 0:y.partial))}function k(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"STALL_MINIMUM_DURATION_MS",function(){return U}),P.d(X,"MAX_START_GAP_JUMP",function(){return k}),P.d(X,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),P.d(X,"SKIP_BUFFER_RANGE_START",function(){return b}),P.d(X,"default",function(){return y});var V=P("./src/utils/buffer-helper.ts"),L=P("./src/errors.ts"),M=P("./src/events.ts"),H=P("./src/utils/logger.ts"),U=250,k=2,I=.1,b=.05,y=function(){function p(r,l,u,a){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=r,this.media=l,this.fragmentTracker=u,this.hls=a}var c=p.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(l){var u=this.config,a=this.media,s=this.stalled,f=a.currentTime,O=a.seeking,S=this.seeking&&!O,E=!this.seeking&&O;if(this.seeking=O,f!==l){if(this.moved=!0,s!==null){if(this.stallReported){var C=self.performance.now()-s;H.logger.warn("playback not stuck anymore @"+f+", after "+Math.round(C)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((E||S)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!V.BufferHelper.getBuffered(a).length)return;var w=V.BufferHelper.bufferInfo(a,f,0),g=w.len>0,v=w.nextStart||0;if(!g&&!v)return;if(O){var h=w.len>k,o=!v||v-f>k&&!this.fragmentTracker.getPartialFragment(f);if(h||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,m=Math.max(v,w.start||0)-f,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=T==null||((_=T.details)===null||_===void 0)?void 0:_.live,j=N?T.details.targetduration*2:k;if(m>0&&m<=j){this._trySkipBufferHole(null);return}}var W=self.performance.now();if(s===null){this.stalled=W;return}var Y=W-s;!O&&Y>=U&&this._reportStall(w.len);var B=V.BufferHelper.bufferInfo(a,f,u.maxBufferHole);this._tryFixBufferStall(B,Y)},c._tryFixBufferStall=function(l,u){var a=this.config,s=this.fragmentTracker,f=this.media,O=f.currentTime,S=s.getPartialFragment(O);if(S){var E=this._trySkipBufferHole(S);if(E)return}l.len>a.maxBufferHole&&u>a.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(l){var u=this.hls,a=this.media,s=this.stallReported;s||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+l+")"),u.trigger(M.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},c._trySkipBufferHole=function(l){for(var u=this.config,a=this.hls,s=this.media,f=s.currentTime,O=0,S=V.BufferHelper.getBuffered(s),E=0;E<S.length;E++){var C=S.start(E);if(f+u.maxBufferHole>=O&&f<C){var w=Math.max(C+b,s.currentTime+I);return H.logger.warn("skipping hole, adjusting currentTime from "+f+" to "+w),this.moved=!0,this.stalled=null,s.currentTime=w,l&&a.trigger(M.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+f+" to "+w,frag:l}),w}O=S.end(E)}return 0},c._tryNudgeBuffer=function(){var l=this.config,u=this.hls,a=this.media,s=a.currentTime,f=(this.nudgeRetry||0)+1;if(this.nudgeRetry=f,f<l.nudgeMaxRetry){var O=s+f*l.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+s+" to "+O),a.currentTime=O,u.trigger(M.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+l.nudgeMaxRetry+" nudges"),u.trigger(M.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),L=P("./src/utils/texttrack-utils.ts"),M=P("./src/demux/id3.ts"),H=.25,U=function(){function k(b){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=b,this._registerListeners()}var I=k.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var y=this.hls;y.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),y.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var y=this.hls;y.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),y.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(y,p){this.media=p.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(L.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(y){if(!this.media)return;for(var p=0;p<y.length;p++){var c=y[p];if(c.kind==="metadata"&&c.label==="id3")return Object(L.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(y,p){if(!this.media)return;var c=p.frag,r=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var l=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,u=0;u<r.length;u++){var a=M.getID3Frames(r[u].data);if(a){var s=r[u].pts,f=u<r.length-1?r[u+1].pts:c.end,O=f-s;O<=0&&(f=s+H);for(var S=0;S<a.length;S++){var E=a[S];if(!M.isTimeStampFrame(E)){var C=new l(s,f,"");C.value=E,this.id3Track.addCue(C)}}}}},I.onBufferFlushing=function(y,p){var c=p.startOffset,r=p.endOffset,l=p.type;if(!l||l==="audio"){var u=this.id3Track;u&&Object(L.removeCuesInRange)(u,c,r)}},k}();X.default=U},"./src/controller/latency-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return k});var V=P("./src/errors.ts"),L=P("./src/events.ts"),M=P("./src/utils/logger.ts");function H(I,b){for(var y=0;y<b.length;y++){var p=b[y];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(I,p.key,p)}}function U(I,b,y){return b&&H(I.prototype,b),y&&H(I,y),I}var k=function(){function I(y){var p=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return p.timeupdate()},this.hls=y,this.config=y.config,this.registerListeners()}var b=I.prototype;return b.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},b.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(L.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(L.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(L.Events.ERROR,this.onError)},b.onMediaAttached=function(p,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},b.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},b.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},b.onLevelUpdated=function(p,c){var r=c.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},b.onError=function(p,c){if(c.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},b.timeupdate=function(){var p=this.media,c=this.levelDetails;if(!p||!c)return;this.currentTime=p.currentTime;var r=this.computeLatency();if(r===null)return;this._latency=r;var l=this.config,u=l.lowLatencyMode,a=l.maxLiveSyncPlaybackRate;if(!u||a===1)return;var s=this.targetLatency;if(s===null)return;var f=r-s,O=Math.min(this.maxLatency,s+c.targetduration),S=f<O;if(c.live&&S&&f>.05&&this.forwardBufferLength>1){var E=Math.min(2,Math.max(1,a)),C=Math.round(2/(1+Math.exp(-.75*f-this.edgeStalled))*20)/20;p.playbackRate=Math.min(E,Math.max(1,C))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},b.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},b.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},U(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,c=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:c?p.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var c=p.holdBack,r=p.partHoldBack,l=p.targetduration,u=this.config,a=u.liveSyncDuration,s=u.liveSyncDurationCount,f=u.lowLatencyMode,O=this.hls.userConfig,S=f&&r||c;(O.liveSyncDuration||O.liveSyncDurationCount||S===0)&&(S=a!==void 0?a:s*l);var E=l,C=1;return S+Math.min(this.stallCount*C,E)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),c=this.targetLatency,r=this.levelDetails;if(p===null||c===null||r===null)return null;var l=r.edge,u=p-c-this.edgeStalled,a=l-r.totalduration,s=l-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,u),s)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var c=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-c,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,c=this.levelDetails;if(!p||!c)return 0;var r=p.buffered.length;return r?p.buffered.end(r-1):c.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return u});var V=P("./src/types/level.ts"),L=P("./src/events.ts"),M=P("./src/errors.ts"),H=P("./src/utils/codecs.ts"),U=P("./src/controller/level-helper.ts"),k=P("./src/controller/base-playlist-controller.ts"),I=P("./src/types/loader.ts");function b(){return b=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var O in f)Object.prototype.hasOwnProperty.call(f,O)&&(a[O]=f[O])}return a},b.apply(this,arguments)}function y(a,s){for(var f=0;f<s.length;f++){var O=s[f];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(a,O.key,O)}}function p(a,s,f){return s&&y(a.prototype,s),f&&y(a,f),a}function c(a,s){a.prototype=Object.create(s.prototype),a.prototype.constructor=a,r(a,s)}function r(a,s){return r=Object.setPrototypeOf||function(O,S){return O.__proto__=S,O},r(a,s)}var l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(a){c(s,a);function s(O){var S;return S=a.call(this,O,"[level-controller]")||this,S._levels=[],S._firstLevel=-1,S._startLevel=void 0,S.currentLevelIndex=-1,S.manualLevelIndex=-1,S.onParsedComplete=void 0,S._registerListeners(),S}var f=s.prototype;return f._registerListeners=function(){var S=this.hls;S.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),S.on(L.Events.ERROR,this.onError,this)},f._unregisterListeners=function(){var S=this.hls;S.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),S.off(L.Events.ERROR,this.onError,this)},f.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},f.startLoad=function(){var S=this._levels;S.forEach(function(E){E.loadError=0}),a.prototype.startLoad.call(this)},f.onManifestLoaded=function(S,E){var C=[],w=[],g=[],v,h={},o,_=!1,m=!1,T=!1;if(E.levels.forEach(function(Y){var B=Y.attrs;_=_||!!(Y.width&&Y.height),m=m||!!Y.videoCodec,T=T||!!Y.audioCodec,l&&Y.audioCodec&&Y.audioCodec.indexOf("mp4a.40.34")!==-1&&(Y.audioCodec=void 0);var R=Y.bitrate+"-"+Y.attrs.RESOLUTION+"-"+Y.attrs.CODECS;o=h[R],o?o.url.push(Y.url):(o=new V.Level(Y),h[R]=o,C.push(o)),B&&(B.AUDIO&&Object(U.addGroupId)(o,"audio",B.AUDIO),B.SUBTITLES&&Object(U.addGroupId)(o,"text",B.SUBTITLES))}),(_||m)&&T&&(C=C.filter(function(Y){var B=Y.videoCodec,R=Y.width,$=Y.height;return!!B||!!(R&&$)})),C=C.filter(function(Y){var B=Y.audioCodec,R=Y.videoCodec;return(!B||Object(H.isCodecSupportedInMp4)(B,"audio"))&&(!R||Object(H.isCodecSupportedInMp4)(R,"video"))}),E.audioTracks&&(w=E.audioTracks.filter(function(Y){return!Y.audioCodec||Object(H.isCodecSupportedInMp4)(Y.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(w)),E.subtitles&&(g=E.subtitles,Object(U.assignTrackIdsByGroup)(g)),C.length>0){v=C[0].bitrate,C.sort(function(Y,B){return Y.bitrate-B.bitrate}),this._levels=C;for(var N=0;N<C.length;N++)if(C[N].bitrate===v){this._firstLevel=N,this.log("manifest loaded, "+C.length+" level(s) found, first bitrate: "+v);break}var j=T&&!m,W={levels:C,audioTracks:w,subtitleTracks:g,firstLevel:this._firstLevel,stats:E.stats,audio:T,video:m,altAudio:!j&&w.some(function(Y){return!!Y.url})};this.hls.trigger(L.Events.MANIFEST_PARSED,W),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:E.url,reason:"no level with compatible codecs found in manifest"})},f.onError=function(S,E){if(a.prototype.onError.call(this,S,E),E.fatal)return;var C=E.context,w=this._levels[this.currentLevelIndex];if(C&&(C.type===I.PlaylistContextType.AUDIO_TRACK&&w.audioGroupIds&&C.groupId===w.audioGroupIds[w.urlId]||C.type===I.PlaylistContextType.SUBTITLE_TRACK&&w.textGroupIds&&C.groupId===w.textGroupIds[w.urlId])){this.redundantFailover(this.currentLevelIndex);return}var g=!1,v=!0,h;switch(E.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(E.frag){var o=this._levels[E.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=E.frag.level)):h=E.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:C&&(C.deliveryDirectives&&(v=!1),h=C.level),g=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:h=E.level,g=!0;break}h!==void 0&&this.recoverLevel(E,h,g,v)},f.recoverLevel=function(S,E,C,w){var g=S.details,v=this._levels[E];if(v.loadError++,C){var h=this.retryLoadingOrFail(S);if(h)S.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var o=v.url.length;if(o>1&&v.loadError<o)S.levelRetry=!0,this.redundantFailover(E);else if(this.manualLevelIndex===-1){var _=E===0?this._levels.length-1:E-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(g+": switch to "+_),S.levelRetry=!0,this.hls.nextAutoLevel=_)}}},f.redundantFailover=function(S){var E=this._levels[S],C=E.url.length;if(C>1){var w=(E.urlId+1)%C;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(g){g.urlId=w}),this.level=S}},f.onFragLoaded=function(S,E){var C=E.frag;if(C!==void 0&&C.type===I.PlaylistLevelType.MAIN){var w=this._levels[C.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},f.onLevelLoaded=function(S,E){var C,w=E.level,g=E.details,v=this._levels[w];if(!v){var h;this.warn("Invalid level index "+w),(h=E.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(g.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(v.fragmentError===0&&(v.loadError=0,this.retryCount=0),this.playlistLoaded(w,E,v.details)):(C=E.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(g.deltaUpdateFailed=!0)},f.onAudioTrackSwitched=function(S,E){var C=this.hls.levels[this.currentLevelIndex];if(!C)return;if(C.audioGroupIds){for(var w=-1,g=this.hls.audioTracks[E.id].groupId,v=0;v<C.audioGroupIds.length;v++)if(C.audioGroupIds[v]===g){w=v;break}w!==C.urlId&&(C.urlId=w,this.startLoad())}},f.loadPlaylist=function(S){var E=this.currentLevelIndex,C=this._levels[E];if(this.canLoad&&C&&C.url.length>0){var w=C.urlId,g=C.url[w];if(S)try{g=S.addDirectives(g)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Attempt loading level index "+E+(S?" at sn "+S.msn+" part "+S.part:"")+" with URL-id "+w+" "+g),this.clearTimer(),this.hls.trigger(L.Events.LEVEL_LOADING,{url:g,level:E,id:w,deliveryDirectives:S||null})}},f.removeLevel=function(S,E){var C=function(v,h){return h!==E},w=this._levels.filter(function(g,v){return v!==S?!0:g.url.length>1&&E!==void 0?(g.url=g.url.filter(C),g.audioGroupIds&&(g.audioGroupIds=g.audioGroupIds.filter(C)),g.textGroupIds&&(g.textGroupIds=g.textGroupIds.filter(C)),g.urlId=0,!0):!1}).map(function(g,v){var h=g.details;return h!=null&&h.fragments&&h.fragments.forEach(function(o){o.level=v}),g});this._levels=w,this.hls.trigger(L.Events.LEVELS_UPDATED,{levels:w})},p(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(S){var E,C=this._levels;if(C.length===0)return;if(this.currentLevelIndex===S&&(E=C[S])!==null&&E!==void 0&&E.details)return;if(S<0||S>=C.length){var w=S<0;if(this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:S,fatal:w,reason:"invalid level idx"}),w)return;S=Math.min(S,C.length-1)}this.clearTimer();var g=this.currentLevelIndex,v=C[g],h=C[S];this.log("switching to level "+S+" from "+g),this.currentLevelIndex=S;var o=b({},h,{level:S,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete o._urlId,this.hls.trigger(L.Events.LEVEL_SWITCHING,o);var _=h.details;if(!_||_.live){var m=this.switchParams(h.uri,v==null?void 0:v.details);this.loadPlaylist(m)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(S){this.manualLevelIndex=S,this._startLevel===void 0&&(this._startLevel=S),S!==-1&&(this.level=S)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(S){this._firstLevel=S}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var S=this.hls.config.startLevel;return S!==void 0?S:this._firstLevel}else return this._startLevel},set:function(S){this._startLevel=S}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(S){this.level=S,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=S)}}]),s}(k.default)},"./src/controller/level-helper.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"addGroupId",function(){return M}),P.d(X,"assignTrackIdsByGroup",function(){return H}),P.d(X,"updatePTS",function(){return U}),P.d(X,"updateFragPTSDTS",function(){return I}),P.d(X,"mergeDetails",function(){return b}),P.d(X,"mapPartIntersection",function(){return y}),P.d(X,"mapFragmentIntersection",function(){return p}),P.d(X,"adjustSliding",function(){return c}),P.d(X,"addSliding",function(){return r}),P.d(X,"computeReloadInterval",function(){return l}),P.d(X,"getFragmentWithSN",function(){return u}),P.d(X,"getPartWith",function(){return a});var V=P("./src/polyfills/number.ts"),L=P("./src/utils/logger.ts");function M(s,f,O){switch(f){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(O);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(O);break}}function H(s){var f={};s.forEach(function(O){var S=O.groupId||"";O.id=f[S]=f[S]||0,f[S]++})}function U(s,f,O){var S=s[f],E=s[O];k(S,E)}function k(s,f){var O=f.startPTS;if(Object(V.isFiniteNumber)(O)){var S=0,E;f.sn>s.sn?(S=O-s.start,E=s):(S=s.start-O,E=f),E.duration!==S&&(E.duration=S)}else if(f.sn>s.sn){var C=s.cc===f.cc;C&&s.minEndPTS?f.start=s.start+(s.minEndPTS-s.start):f.start=s.start+s.duration}else f.start=Math.max(s.start-f.duration,0)}function I(s,f,O,S,E,C){var w=S-O;w<=0&&(L.logger.warn("Fragment should have a positive duration",f),S=O+f.duration,C=E+f.duration);var g=O,v=S,h=f.startPTS,o=f.endPTS;if(Object(V.isFiniteNumber)(h)){var _=Math.abs(h-O);Object(V.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(_,f.deltaPTS):f.deltaPTS=_,g=Math.max(O,h),O=Math.min(O,h),E=Math.min(E,f.startDTS),v=Math.min(S,o),S=Math.max(S,o),C=Math.max(C,f.endDTS)}f.duration=S-O;var m=O-f.start;f.appendedPTS=S,f.start=f.startPTS=O,f.maxStartPTS=g,f.startDTS=E,f.endPTS=S,f.minEndPTS=v,f.endDTS=C;var T=f.sn;if(!s||T<s.startSN||T>s.endSN)return 0;var N,j=T-s.startSN,W=s.fragments;for(W[j]=f,N=j;N>0;N--)k(W[N],W[N-1]);for(N=j;N<W.length-1;N++)k(W[N],W[N+1]);return s.fragmentHint&&k(W[W.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,m}function b(s,f){for(var O=null,S=s.fragments,E=S.length-1;E>=0;E--){var C=S[E].initSegment;if(C){O=C;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var w=0,g;if(p(s,f,function(N,j){N.relurl&&(w=N.cc-j.cc),Object(V.isFiniteNumber)(N.startPTS)&&Object(V.isFiniteNumber)(N.endPTS)&&(j.start=j.startPTS=N.startPTS,j.startDTS=N.startDTS,j.appendedPTS=N.appendedPTS,j.maxStartPTS=N.maxStartPTS,j.endPTS=N.endPTS,j.endDTS=N.endDTS,j.minEndPTS=N.minEndPTS,j.duration=N.endPTS-N.startPTS,j.duration&&(g=j),f.PTSKnown=f.alignedSliding=!0),j.elementaryStreams=N.elementaryStreams,j.loader=N.loader,j.stats=N.stats,j.urlId=N.urlId,N.initSegment&&(j.initSegment=N.initSegment,O=N.initSegment)}),O){var v=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments;v.forEach(function(N){var j;(!N.initSegment||N.initSegment.relurl===((j=O)===null||j===void 0?void 0:j.relurl))&&(N.initSegment=O)})}if(f.skippedSegments&&(f.deltaUpdateFailed=f.fragments.some(function(N){return!N}),f.deltaUpdateFailed)){L.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=f.skippedSegments;h--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}var o=f.fragments;if(w){L.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<o.length;_++)o[_].cc+=w}f.skippedSegments&&(f.startCC=f.fragments[0].cc),y(s.partList,f.partList,function(N,j){j.elementaryStreams=N.elementaryStreams,j.stats=N.stats}),g?I(f,g,g.startPTS,g.endPTS,g.startDTS,g.endDTS):c(s,f),o.length&&(f.totalduration=f.edge-o[0].start),f.driftStartTime=s.driftStartTime,f.driftStart=s.driftStart;var m=f.advancedDateTime;if(f.advanced&&m){var T=f.edge;f.driftStart||(f.driftStartTime=m,f.driftStart=T),f.driftEndTime=m,f.driftEnd=T}else f.driftEndTime=s.driftEndTime,f.driftEnd=s.driftEnd,f.advancedDateTime=s.advancedDateTime}function y(s,f,O){if(s&&f)for(var S=0,E=0,C=s.length;E<=C;E++){var w=s[E],g=f[E+S];w&&g&&w.index===g.index&&w.fragment.sn===g.fragment.sn?O(w,g):S--}}function p(s,f,O){for(var S=f.skippedSegments,E=Math.max(s.startSN,f.startSN)-f.startSN,C=(s.fragmentHint?1:0)+(S?f.endSN:Math.min(s.endSN,f.endSN))-f.startSN,w=f.startSN-s.startSN,g=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,v=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,h=E;h<=C;h++){var o=v[w+h],_=g[h];S&&!_&&h<S&&(_=f.fragments[h]=o),o&&_&&O(o,_)}}function c(s,f){var O=f.startSN+f.skippedSegments-s.startSN,S=s.fragments;if(O<0||O>=S.length)return;r(f,S[O].start)}function r(s,f){if(f){for(var O=s.fragments,S=s.skippedSegments;S<O.length;S++)O[S].start+=f;s.fragmentHint&&(s.fragmentHint.start+=f)}}function l(s,f){var O=1e3*s.levelTargetDuration,S=O/2,E=s.age,C=E>0&&E<O*3,w=f.loading.end-f.loading.start,g,v=s.availabilityDelay;if(s.updated===!1)if(C){var h=333*s.misses;g=Math.max(Math.min(S,w*2),h),s.availabilityDelay=(s.availabilityDelay||0)+g}else g=S;else C?(v=Math.min(v||O/2,E),s.availabilityDelay=v,g=v+O-E):g=O-w;return Math.round(g)}function u(s,f,O){if(!s||!s.details)return null;var S=s.details,E=S.fragments[f-S.startSN];return E||(E=S.fragmentHint,E&&E.sn===f?E:f<S.startSN&&O&&O.sn===f?O:null)}function a(s,f,O){if(!s||!s.details)return null;var S=s.details.partList;if(S)for(var E=S.length;E--;){var C=S[E];if(C.index===O&&C.fragment.sn===f)return C}return null}},"./src/controller/stream-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return S});var V=P("./src/polyfills/number.ts"),L=P("./src/controller/base-stream-controller.ts"),M=P("./src/is-supported.ts"),H=P("./src/events.ts"),U=P("./src/utils/buffer-helper.ts"),k=P("./src/controller/fragment-tracker.ts"),I=P("./src/types/loader.ts"),b=P("./src/loader/fragment.ts"),y=P("./src/demux/transmuxer-interface.ts"),p=P("./src/types/transmuxer.ts"),c=P("./src/controller/gap-controller.ts"),r=P("./src/errors.ts"),l=P("./src/utils/logger.ts");function u(E,C){for(var w=0;w<C.length;w++){var g=C[w];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}function a(E,C,w){return C&&u(E.prototype,C),w&&u(E,w),E}function s(E,C){E.prototype=Object.create(C.prototype),E.prototype.constructor=E,f(E,C)}function f(E,C){return f=Object.setPrototypeOf||function(g,v){return g.__proto__=v,g},f(E,C)}var O=100,S=function(E){s(C,E);function C(g,v){var h;return h=E.call(this,g,v,"[stream-controller]")||this,h.audioCodecSwap=!1,h.gapController=null,h.level=-1,h._forceStartLoad=!1,h.altAudio=!1,h.audioOnly=!1,h.fragPlaying=null,h.onvplaying=null,h.onvseeked=null,h.fragLastKbps=0,h.stalled=!1,h.couldBacktrack=!1,h.audioCodecSwitch=!1,h.videoBuffer=null,h._registerListeners(),h}var w=C.prototype;return w._registerListeners=function(){var v=this.hls;v.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),v.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.on(H.Events.ERROR,this.onError,this),v.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),v.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var v=this.hls;v.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.off(H.Events.ERROR,this.onError,this),v.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),v.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},w.startLoad=function(v){if(this.levels){var h=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=o.startLevel;_===-1&&(o.config.testBandwidth?(_=0,this.bitrateTest=!0):_=o.nextAutoLevel),this.level=o.nextLoadLevel=_,this.loadedmetadata=!1}h>0&&v===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),v=h),this.state=L.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()}else this._forceStartLoad=!0,this.state=L.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,E.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_LEVEL:{var v,h=this.levels,o=this.level,_=h==null||((v=h[o])===null||v===void 0)?void 0:v.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=L.State.IDLE;break}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var m,T=self.performance.now(),N=this.retryDate;(!N||T>=N||(m=this.media)!==null&&m!==void 0&&m.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=L.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){E.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var v,h,o=this.hls,_=this.levelLastLoaded,m=this.levels,T=this.media,N=o.config,j=o.nextLoadLevel;if(_===null||!T&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!m||!m[j])return;var W=m[j];this.level=o.nextLoadLevel=j;var Y=W.details;if(!Y||this.state===L.State.WAITING_LEVEL||Y.live&&this.levelLastLoaded!==j){this.state=L.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:T,I.PlaylistLevelType.MAIN);if(B===null)return;var R=B.len,$=this.getMaxBufferLength(W.maxBitrate);if(R>=$)return;if(this._streamEnded(B,Y)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,te),this.state=L.State.ENDED;return}var ue=B.end,me=this.getNextFragment(ue,Y);if(this.couldBacktrack&&!this.fragPrevious&&me&&me.sn!=="initSegment"){var Me=me.sn-Y.startSN;Me>1&&(me=Y.fragments[Me-1],this.fragmentTracker.removeFragment(me))}if(me&&this.fragmentTracker.getState(me)===k.FragmentState.OK&&this.nextLoadPosition>ue){var Ae=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(T,Ae,I.PlaylistLevelType.MAIN),me=this.getNextFragment(this.nextLoadPosition,Y)}if(!me)return;me.initSegment&&!me.initSegment.data&&!this.bitrateTest&&(me=me.initSegment),((v=me.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((h=me.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(me,Y):this.loadFragment(me,Y,ue)},w.loadFragment=function(v,h,o){var _,m=this.fragmentTracker.getState(v);if(this.fragCurrent=v,m===k.FragmentState.BACKTRACKED){var T=this.fragmentTracker.getBacktrackData(v);if(T){this._handleFragmentLoadProgress(T),this._handleFragmentLoadComplete(T);return}else m=k.FragmentState.NOT_LOADED}m===k.FragmentState.NOT_LOADED||m===k.FragmentState.PARTIAL?v.sn==="initSegment"?this._loadInitSegment(v):this.bitrateTest?(v.bitrateTest=!0,this.log("Fragment "+v.sn+" of level "+v.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(v)):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,v,h,o)):m===k.FragmentState.APPENDING?this.reduceMaxBufferLength(v.duration)&&this.fragmentTracker.removeFragment(v):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(v){var h=this.fragmentTracker.getAppendedFrag(v,I.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},w.getBufferedFrag=function(v){return this.fragmentTracker.getBufferedFrag(v,I.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(v){return v?this.getBufferedFrag(v.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var v=this.levels,h=this.media;if(h!=null&&h.readyState){var o,_=this.getAppendedFrag(h.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!h.paused&&v){var m=this.hls.nextLoadLevel,T=v[m],N=this.fragLastKbps;N&&this.fragCurrent?o=this.fragCurrent.duration*T.maxBitrate/(1e3*N)+1:o=0}else o=0;var j=this.getBufferedFrag(h.currentTime+o);if(j){var W=this.followingBufferedFrag(j);if(W){this.abortCurrentFrag();var Y=W.maxStartPTS?W.maxStartPTS:W.start,B=W.duration,R=Math.max(j.end,Y+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(R,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var v=this.fragCurrent;this.fragCurrent=null,v!=null&&v.loader&&v.loader.abort(),this.state===L.State.KEY_LOADING&&(this.state=L.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(v,h){E.prototype.flushMainBuffer.call(this,v,h,this.altAudio?"video":null)},w.onMediaAttached=function(v,h){E.prototype.onMediaAttached.call(this,v,h);var o=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,o,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var v=this.media;v&&(v.removeEventListener("playing",this.onvplaying),v.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),E.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var v=this.media,h=v?v.currentTime:null;Object(V.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(v,h){var o=!1,_=!1,m;h.levels.forEach(function(T){m=T.audioCodec,m&&(m.indexOf("mp4a.40.2")!==-1&&(o=!0),m.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=o&&_&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},w.onLevelLoading=function(v,h){var o=this.levels;if(!o||this.state!==L.State.IDLE)return;var _=o[h.level];(!_.details||_.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(_.details))&&(this.state=L.State.WAITING_LEVEL)},w.onLevelLoaded=function(v,h){var o,_=this.levels,m=h.level,T=h.details,N=T.totalduration;if(!_){this.warn("Levels were reset while loading level "+m);return}this.log("Level "+m+" loaded ["+T.startSN+","+T.endSN+"], cc ["+T.startCC+", "+T.endCC+"] duration:"+N);var j=this.fragCurrent;j&&(this.state===L.State.FRAG_LOADING||this.state===L.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==h.level&&j.loader&&(this.state=L.State.IDLE,j.loader.abort()));var W=_[m],Y=0;if(T.live||(o=W.details)!==null&&o!==void 0&&o.live){if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed)return;Y=this.alignPlaylists(T,W.details)}if(W.details=T,this.levelLastLoaded=m,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:T,level:m}),this.state===L.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(T))return;this.state=L.State.IDLE}this.startFragRequested?T.live&&this.synchronizeToLiveEdge(T):this.setStartPosition(T,Y),this.tick()},w._handleFragmentLoadProgress=function(v){var h,o=v.frag,_=v.part,m=v.payload,T=this.levels;if(!T){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var N=T[o.level],j=N.details;if(!j){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var W=N.videoCodec,Y=j.PTSKnown||!j.live,B=(h=o.initSegment)===null||h===void 0?void 0:h.data,R=this._getAudioCodec(N),$=this.transmuxer=this.transmuxer||new y.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=_?_.index:-1,ue=te!==-1,me=new p.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,m.byteLength,te,ue),Me=this.initPTS[o.cc];$.push(m,B,R,W,o,_,j.totalduration,Y,me,Me)},w.onAudioTrackSwitching=function(v,h){var o=this.altAudio,_=!!h.url,m=h.id;if(!_){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var T=this.fragCurrent;T!=null&&T.loader&&(this.log("Switching to main audio track, cancel main fragment load"),T.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;o&&N.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:m})}},w.onAudioTrackSwitched=function(v,h){var o=h.id,_=!!this.hls.audioTracks[o].url;if(_){var m=this.videoBuffer;m&&this.mediaBuffer!==m&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=m)}this.altAudio=_,this.tick()},w.onBufferCreated=function(v,h){var o=h.tracks,_,m,T=!1;for(var N in o){var j=o[N];if(j.id==="main"){if(m=N,_=j,N==="video"){var W=o[N];W&&(this.videoBuffer=W.buffer)}}else T=!0}T&&_?(this.log("Alternate track found, use "+m+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(v,h){var o=h.frag,_=h.part;if(o&&o.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(_?" p: "+_.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===L.State.PARSED&&(this.state=L.State.IDLE);return}var m=_?_.stats:o.stats;this.fragLastKbps=Math.round(8*m.total/(m.buffering.end-m.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,_)},w.onError=function(v,h){switch(h.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.MAIN,h);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=L.State.ERROR):!h.levelRetry&&this.state===L.State.WAITING_LEVEL&&(this.state=L.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var o=!0,_=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);_&&_.len>.5&&(o=!this.reduceMaxBufferLength(_.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var v=this.media,h=this.gapController;if(!v||!h||!v.readyState)return;var o=U.BufferHelper.getBuffered(v);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=v.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=L.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(v,h){var o=h.type;if(o!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(o===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,o,I.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(v,h){this.levels=h.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var v=this.media,h=v.currentTime,o=this.startPosition;if(o>=0&&h<o){if(v.seeking){l.logger.log("could not seek to "+o+", already seeking at "+h);return}var _=U.BufferHelper.getBuffered(v),m=_.length?_.start(0):0,T=m-o;T>0&&(T<this.config.maxBufferHole||T<this.config.maxFragLookUpTolerance)&&(l.logger.log("adjusting start position by "+T+" to match buffer start"),o+=T,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+h),v.currentTime=o}},w._getAudioCodec=function(v){var h=this.config.defaultAudioCodec||v.audioCodec;return this.audioCodecSwap&&h&&(this.log("Swapping audio codec"),h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5"),h},w._loadBitrateTestFrag=function(v){var h=this;this._doFragLoad(v).then(function(o){var _=h.hls;if(!o||_.nextLoadLevel||h.fragContextChanged(v))return;h.fragLoadError=0,h.state=L.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var m=v.stats;m.parsing.start=m.parsing.end=m.buffering.start=m.buffering.end=self.performance.now(),_.trigger(H.Events.FRAG_LOADED,o)})},w._handleTransmuxComplete=function(v){var h,o="main",_=this.hls,m=v.remuxResult,T=v.chunkMeta,N=this.getCurrentContext(T);if(!N){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(T.level);return}var j=N.frag,W=N.part,Y=N.level,B=m.video,R=m.text,$=m.id3,te=m.initSegment,ue=this.altAudio?void 0:m.audio;if(this.fragContextChanged(j))return;if(this.state=L.State.PARSING,te){te.tracks&&(this._bufferInitSegment(Y,te.tracks,j,T),_.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:o,tracks:te.tracks}));var me=te.initPTS,Me=te.timescale;Object(V.isFiniteNumber)(me)&&(this.initPTS[j.cc]=me,_.trigger(H.Events.INIT_PTS_FOUND,{frag:j,id:o,initPTS:me,timescale:Me}))}if(B&&m.independent!==!1){if(Y.details){var Ae=B.startPTS,De=B.endPTS,Fe=B.startDTS,Ne=B.endDTS;if(W)W.elementaryStreams[B.type]={startPTS:Ae,endPTS:De,startDTS:Fe,endDTS:Ne};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var Ee=this.getLoadPosition()+this.config.maxBufferHole;if(Ee<Ae){this.backtrack(j);return}j.setElementaryStreamInfo(B.type,j.start,De,j.start,Ne,!0)}j.setElementaryStreamInfo(B.type,Ae,De,Fe,Ne),this.bufferFragmentData(B,j,W,T)}}else if(m.independent===!1){this.backtrack(j);return}if(ue){var se=ue.startPTS,He=ue.endPTS,ft=ue.startDTS,lt=ue.endDTS;W&&(W.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:He,startDTS:ft,endDTS:lt}),j.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,se,He,ft,lt),this.bufferFragmentData(ue,j,W,T)}if($!=null&&(h=$.samples)!==null&&h!==void 0&&h.length){var it={frag:j,id:o,samples:$.samples};_.trigger(H.Events.FRAG_PARSING_METADATA,it)}if(R){var ct={frag:j,id:o,samples:R.samples};_.trigger(H.Events.FRAG_PARSING_USERDATA,ct)}},w._bufferInitSegment=function(v,h,o,_){var m=this;if(this.state!==L.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var T=h.audio,N=h.video,j=h.audiovideo;if(T){var W=v.audioCodec,Y=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(W&&(W.indexOf("mp4a.40.5")!==-1?W="mp4a.40.2":W="mp4a.40.5"),T.metadata.channelCount!==1&&Y.indexOf("firefox")===-1&&(W="mp4a.40.5")),Y.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(W="mp4a.40.2",this.log("Android: force audio codec to "+W)),v.audioCodec&&v.audioCodec!==W&&this.log('Swapping manifest audio codec "'+v.audioCodec+'" for "'+W+'"'),T.levelCodec=W,T.id="main",this.log("Init audio buffer, container:"+T.container+", codecs[selected/level/parsed]=["+(W||"")+"/"+(v.audioCodec||"")+"/"+T.codec+"]")}N&&(N.levelCodec=v.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(v.videoCodec||"")+"/"+N.codec+"]")),j&&this.log("Init audiovideo buffer, container:"+j.container+", codecs[level/parsed]=["+(v.attrs.CODECS||"")+"/"+j.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(B){var R=h[B],$=R.initSegment;$!=null&&$.byteLength&&m.hls.trigger(H.Events.BUFFER_APPENDING,{type:B,data:$,frag:o,part:null,chunkMeta:_,parent:o.type})}),this.tick()},w.backtrack=function(v){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(v);var h=this.fragmentTracker.backtrack(v);this.fragPrevious=null,this.nextLoadPosition=v.start,h?this.resetFragmentLoading(v):this.state=L.State.BACKTRACKING},w.checkFragmentChanged=function(){var v=this.media,h=null;if(v&&v.readyState>1&&v.seeking===!1){var o=v.currentTime;if(U.BufferHelper.isBuffered(v,o)?h=this.getAppendedFrag(o):U.BufferHelper.isBuffered(v,o+.1)&&(h=this.getAppendedFrag(o+.1)),h){var _=this.fragPlaying,m=h.level;(!_||h.sn!==_.sn||_.level!==m||h.urlId!==_.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:h}),(!_||_.level!==m)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:m}),this.fragPlaying=h)}}},a(C,[{key:"nextLevel",get:function(){var v=this.nextBufferedFrag;return v?v.level:-1}},{key:"currentLevel",get:function(){var v=this.media;if(v){var h=this.getAppendedFrag(v.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var v=this.media;if(v){var h=this.getAppendedFrag(v.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),C}(L.default)},"./src/controller/subtitle-stream-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"SubtitleStreamController",function(){return s});var V=P("./src/events.ts"),L=P("./src/utils/logger.ts"),M=P("./src/utils/buffer-helper.ts"),H=P("./src/controller/fragment-finders.ts"),U=P("./src/utils/discontinuities.ts"),k=P("./src/controller/level-helper.ts"),I=P("./src/controller/fragment-tracker.ts"),b=P("./src/controller/base-stream-controller.ts"),y=P("./src/types/loader.ts"),p=P("./src/types/level.ts");function c(f,O){for(var S=0;S<O.length;S++){var E=O[S];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(f,E.key,E)}}function r(f,O,S){return O&&c(f.prototype,O),S&&c(f,S),f}function l(f,O){f.prototype=Object.create(O.prototype),f.prototype.constructor=f,u(f,O)}function u(f,O){return u=Object.setPrototypeOf||function(E,C){return E.__proto__=C,E},u(f,O)}var a=500,s=function(f){l(O,f);function O(E,C){var w;return w=f.call(this,E,C,"[subtitle-stream-controller]")||this,w.levels=[],w.currentTrackId=-1,w.tracksBuffered=[],w.mainDetails=null,w._registerListeners(),w}var S=O.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var C=this.hls;C.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(V.Events.ERROR,this.onError,this),C.on(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.on(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.on(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S._unregisterListeners=function(){var C=this.hls;C.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(V.Events.ERROR,this.onError,this),C.off(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.off(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.off(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S.startLoad=function(){this.stopLoad(),this.state=b.State.IDLE,this.setInterval(a),this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},S.onLevelLoaded=function(C,w){this.mainDetails=w.details},S.onSubtitleFragProcessed=function(C,w){var g=w.frag,v=w.success;if(this.fragPrevious=g,this.state=b.State.IDLE,!v)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var o,_=g.start,m=0;m<h.length;m++)if(_>=h[m].start&&_<=h[m].end){o=h[m];break}var T=g.start+g.duration;o?o.end=T:(o={start:_,end:T},h.push(o)),this.fragmentTracker.fragBuffered(g)},S.onBufferFlushing=function(C,w){var g=w.startOffset,v=w.endOffset;if(g===0&&v!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,o=this.levels;if(!o.length||!o[h]||!o[h].details)return;var _=o[h].details,m=_.targetduration,T=v-m;if(T<=0)return;w.endOffsetSubtitles=Math.max(0,T),this.tracksBuffered.forEach(function(N){for(var j=0;j<N.length;){if(N[j].end<=T){N.shift();continue}else if(N[j].start<T)N[j].start=T;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(g,T,y.PlaylistLevelType.SUBTITLE)}},S.onError=function(C,w){var g,v=w.frag;if(!v||v.type!==y.PlaylistLevelType.SUBTITLE)return;(g=this.fragCurrent)!==null&&g!==void 0&&g.loader&&this.fragCurrent.loader.abort(),this.state=b.State.IDLE},S.onSubtitleTracksUpdated=function(C,w){var g=this,v=w.subtitleTracks;this.tracksBuffered=[],this.levels=v.map(function(h){return new p.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){g.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},S.onSubtitleTrackSwitch=function(C,w){if(this.currentTrackId=w.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var g=this.levels[this.currentTrackId];g!=null&&g.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,g&&this.setInterval(a)},S.onSubtitleTrackLoaded=function(C,w){var g,v=w.details,h=w.id,o=this.currentTrackId,_=this.levels;if(!_.length)return;var m=_[o];if(h>=_.length||h!==o||!m)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,v.live||(g=m.details)!==null&&g!==void 0&&g.live){var T=this.mainDetails;if(v.deltaUpdateFailed||!T)return;var N=T.fragments[0];if(!m.details)v.hasProgramDateTime&&T.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(v,T):N&&Object(k.addSliding)(v,N.start);else{var j=this.alignPlaylists(v,m.details);j===0&&N&&Object(k.addSliding)(v,N.start)}}if(m.details=v,this.levelLastLoaded=h,this.tick(),v.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var W=Object(H.findFragmentByPTS)(null,v.fragments,this.media.currentTime,0);W||(this.warn("Subtitle playlist not aligned with playback"),m.details=void 0)}},S._handleFragmentLoadComplete=function(C){var w=C.frag,g=C.payload,v=w.decryptdata,h=this.hls;if(this.fragContextChanged(w))return;if(g&&g.byteLength>0&&v&&v.key&&v.iv&&v.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(g),v.key.buffer,v.iv.buffer).then(function(_){var m=performance.now();h.trigger(V.Events.FRAG_DECRYPTED,{frag:w,payload:_,stats:{tstart:o,tdecrypt:m}})})}},S.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var C,w=this.currentTrackId,g=this.levels;if(!g.length||!g[w]||!g[w].details)return;var v=g[w].details,h=v.targetduration,o=this.config,_=this.media,m=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-h,o.maxBufferHole),T=m.end,N=m.len,j=this.getMaxBufferLength()+h;if(N>j)return;console.assert(v,"Subtitle track details are defined on idle subtitle stream controller tick");var W=v.fragments,Y=W.length,B=v.edge,R,$=this.fragPrevious;if(T<B){var te=o.maxFragLookUpTolerance;$&&v.hasProgramDateTime&&(R=Object(H.findFragmentByPDT)(W,$.endProgramDateTime,te)),R||(R=Object(H.findFragmentByPTS)($,W,T,te),!R&&$&&$.start<W[0].start&&(R=W[0]))}else R=W[Y-1];(C=R)!==null&&C!==void 0&&C.encrypted?(L.logger.log("Loading key for "+R.sn),this.state=b.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:R})):R&&this.fragmentTracker.getState(R)===I.FragmentState.NOT_LOADED&&this.loadFragment(R,v,T)}},S.loadFragment=function(C,w,g){this.fragCurrent=C,f.prototype.loadFragment.call(this,C,w,g)},r(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(b.default)},"./src/controller/subtitle-track-controller.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),L=P("./src/utils/texttrack-utils.ts"),M=P("./src/controller/base-playlist-controller.ts"),H=P("./src/types/loader.ts");function U(c,r){for(var l=0;l<r.length;l++){var u=r[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}function k(c,r,l){return r&&U(c.prototype,r),l&&U(c,l),c}function I(c,r){c.prototype=Object.create(r.prototype),c.prototype.constructor=c,b(c,r)}function b(c,r){return b=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},b(c,r)}var y=function(c){I(r,c);function r(u){var a;return a=c.call(this,u,"[subtitle-track-controller]")||this,a.media=null,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.selectDefaultTrack=!0,a.queuedDefaultTrack=-1,a.trackChangeListener=function(){return a.onTextTracksChanged()},a.asyncPollTrackChange=function(){return a.pollTrackChange(0)},a.useTextTrackPolling=!1,a.subtitlePollingInterval=-1,a.subtitleDisplay=!0,a.registerListeners(),a}var l=r.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},l.registerListeners=function(){var a=this.hls;a.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(V.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var a=this.hls;a.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(V.Events.ERROR,this.onError,this)},l.onMediaAttached=function(a,s){if(this.media=s.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)},l.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},l.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var a=p(this.media.textTracks);a.forEach(function(s){Object(L.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(a,s){this.tracks=s.subtitleTracks},l.onSubtitleTrackLoaded=function(a,s){var f=s.id,O=s.details,S=this.trackId,E=this.tracksInGroup[S];if(!E){this.warn("Invalid subtitle track id "+f);return}var C=E.details;E.details=s.details,this.log("subtitle track "+f+" loaded ["+O.startSN+"-"+O.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,s,C))},l.onLevelLoading=function(a,s){this.switchLevel(s.level)},l.onLevelSwitching=function(a,s){this.switchLevel(s.level)},l.switchLevel=function(a){var s=this.hls.levels[a];if(!(s!=null&&s.textGroupIds))return;var f=s.textGroupIds[s.urlId];if(this.groupId!==f){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,S=this.tracks.filter(function(w){return!f||w.groupId===f});this.tracksInGroup=S;var E=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=f;var C={subtitleTracks:S};this.log("Updating subtitle tracks, "+S.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,C),E!==-1&&this.setSubtitleTrack(E,O)}},l.findTrackId=function(a){for(var s=this.tracksInGroup,f=0;f<s.length;f++){var O=s[f];if((!this.selectDefaultTrack||O.default)&&(!a||a===O.name))return O.id}return-1},l.onError=function(a,s){if(c.prototype.onError.call(this,a,s),s.fatal||!s.context)return;s.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},l.loadPlaylist=function(a){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var f=s.id,O=s.groupId,S=s.url;if(a)try{S=a.addDirectives(S)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:S,id:f,groupId:O,deliveryDirectives:a||null})}},l.toggleTrackModes=function(a){var s=this,f=this.media,O=this.subtitleDisplay,S=this.trackId;if(!f)return;var E=p(f.textTracks),C=E.filter(function(v){return v.groupId===s.groupId});if(a===-1)[].slice.call(E).forEach(function(v){v.mode="disabled"});else{var w=C[S];w&&(w.mode="disabled")}var g=C[a];g&&(g.mode=O?"showing":"hidden")},l.setSubtitleTrack=function(a,s){var f,O=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(f=O[a])!==null&&f!==void 0&&f.details)||a<-1||a>=O.length)return;this.clearTimer();var S=O[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,S){var E=S.id,C=S.groupId,w=C===void 0?"":C,g=S.name,v=S.type,h=S.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:E,groupId:w,name:g,type:v,url:h});var o=this.switchParams(S.url,s==null?void 0:s.details);this.loadPlaylist(o)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:a})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,s=p(this.media.textTracks),f=0;f<s.length;f++)if(s[f].mode==="hidden")a=f;else if(s[f].mode==="showing"){a=f;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},k(r,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,s)}}]),r}(M.default);function p(c){for(var r=[],l=0;l<c.length;l++){var u=c[l];u.kind==="subtitles"&&u.label&&r.push(c[l])}return r}X.default=y},"./src/controller/timeline-controller.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"TimelineController",function(){return p});var V=P("./src/polyfills/number.ts"),L=P("./src/events.ts"),M=P("./src/utils/cea-608-parser.ts"),H=P("./src/utils/output-filter.ts"),U=P("./src/utils/webvtt-parser.ts"),k=P("./src/utils/texttrack-utils.ts"),I=P("./src/utils/imsc1-ttml-parser.ts"),b=P("./src/types/loader.ts"),y=P("./src/utils/logger.ts"),p=function(){function u(s){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=l(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var f=new H.default(this,"textTrack1"),O=new H.default(this,"textTrack2"),S=new H.default(this,"textTrack3"),E=new H.default(this,"textTrack4");this.cea608Parser1=new M.default(1,f,O),this.cea608Parser2=new M.default(3,S,E)}s.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(L.Events.FRAG_LOADING,this.onFragLoading,this),s.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=u.prototype;return a.destroy=function(){var f=this.hls;f.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.off(L.Events.FRAG_LOADING,this.onFragLoading,this),f.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.off(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(f,O,S,E,C){for(var w=!1,g=C.length;g--;){var v=C[g],h=r(v[0],v[1],O,S);if(h>=0&&(v[0]=Math.min(v[0],O),v[1]=Math.max(v[1],S),w=!0,h/(S-O)>.5))return}if(w||C.push([O,S]),this.config.renderTextTracksNatively){var o=this.captionsTracks[f];this.Cues.newCue(o,O,S,E)}else{var _=this.Cues.newCue(null,O,S,E);this.hls.trigger(L.Events.CUES_PARSED,{type:"captions",cues:_,track:f})}},a.onInitPtsFound=function(f,O){var S=this,E=O.frag,C=O.id,w=O.initPTS,g=O.timescale,v=this.unparsedVttFrags;C==="main"&&(this.initPTS[E.cc]=w,this.timescale[E.cc]=g),v.length&&(this.unparsedVttFrags=[],v.forEach(function(h){S.onFragLoaded(L.Events.FRAG_LOADED,h)}))},a.getExistingTrack=function(f){var O=this.media;if(O)for(var S=0;S<O.textTracks.length;S++){var E=O.textTracks[S];if(E[f])return E}return null},a.createCaptionsTrack=function(f){this.config.renderTextTracksNatively?this.createNativeTrack(f):this.createNonNativeTrack(f)},a.createNativeTrack=function(f){if(this.captionsTracks[f])return;var O=this.captionsProperties,S=this.captionsTracks,E=this.media,C=O[f],w=C.label,g=C.languageCode,v=this.getExistingTrack(f);if(v)S[f]=v,Object(k.clearCurrentCues)(S[f]),Object(k.sendAddTrackEvent)(S[f],E);else{var h=this.createTextTrack("captions",w,g);h&&(h[f]=!0,S[f]=h)}},a.createNonNativeTrack=function(f){if(this.nonNativeCaptionsTracks[f])return;var O=this.captionsProperties[f];if(!O)return;var S=O.label,E={_id:f,label:S,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[f]=E,this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[E]})},a.createTextTrack=function(f,O,S){var E=this.media;return E?E.addTextTrack(f,O,S):void 0},a.onMediaAttaching=function(f,O){this.media=O.media,this._cleanTracks()},a.onMediaDetaching=function(){var f=this.captionsTracks;Object.keys(f).forEach(function(O){Object(k.clearCurrentCues)(f[O]),delete f[O]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},a._cleanTracks=function(){var f=this.media;if(!f)return;var O=f.textTracks;if(O)for(var S=0;S<O.length;S++)Object(k.clearCurrentCues)(O[S])},a.onSubtitleTracksUpdated=function(f,O){var S=this;this.textTracks=[];var E=O.subtitleTracks||[],C=E.some(function(h){return h.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||C&&this.config.enableIMSC1){var w=this.tracks&&E&&this.tracks.length===E.length;if(this.tracks=E||[],this.config.renderTextTracksNatively){var g=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,o){var _;if(o<g.length){for(var m=null,T=0;T<g.length;T++)if(c(g[T],h)){m=g[T];break}m&&(_=m)}_?Object(k.clearCurrentCues)(_):(_=S.createTextTrack("subtitles",h.name,h.lang),_&&(_.mode="disabled")),_&&(_.groupId=h.groupId,S.textTracks.push(_))})}else if(!w&&this.tracks&&this.tracks.length){var v=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:v})}}},a.onManifestLoaded=function(f,O){var S=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(E){var C=/(?:CC|SERVICE)([1-4])/.exec(E.instreamId);if(!C)return;var w="textTrack"+C[1],g=S.captionsProperties[w];if(!g)return;g.label=E.name,E.lang&&(g.languageCode=E.lang),g.media=E})},a.onFragLoading=function(f,O){var S=this.cea608Parser1,E=this.cea608Parser2,C=this.lastSn,w=this.lastPartIndex;if(!this.enabled||!(S&&E))return;if(O.frag.type===b.PlaylistLevelType.MAIN){var g,v,h=O.frag.sn,o=(g=O==null||((v=O.part)===null||v===void 0)?void 0:v.index)!=null?g:-1;h===C+1||h===C&&o===w+1||(S.reset(),E.reset()),this.lastSn=h,this.lastPartIndex=o}},a.onFragLoaded=function(f,O){var S=O.frag,E=O.payload,C=this.initPTS,w=this.unparsedVttFrags;if(S.type===b.PlaylistLevelType.SUBTITLE)if(E.byteLength){if(!Object(V.isFiniteNumber)(C[S.cc])){w.push(O),C.length&&this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Missing initial subtitle PTS")});return}var g=S.decryptdata;if(g==null||g.key==null||g.method!=="AES-128"){var v=this.tracks[S.level],h=this.vttCCs;h[S.cc]||(h[S.cc]={start:S.start,prevCC:this.prevCC,new:!0},this.prevCC=S.cc),v&&v.textCodec===I.IMSC1_CODEC?this._parseIMSC1(S,E):this._parseVTTs(S,E,h)}}else this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(f,O){var S=this,E=this.hls;Object(I.parseIMSC1)(O,this.initPTS[f.cc],this.timescale[f.cc],function(C){S._appendCues(C,f.level),E.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(C){y.logger.log("Failed to parse IMSC1: "+C),E.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:C})})},a._parseVTTs=function(f,O,S){var E=this,C=this.hls;Object(U.parseWebVTT)(O,this.initPTS[f.cc],this.timescale[f.cc],S,f.cc,f.start,function(w){E._appendCues(w,f.level),C.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(w){E._fallbackToIMSC1(f,O),y.logger.log("Failed to parse VTT cue: "+w),C.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:w})})},a._fallbackToIMSC1=function(f,O){var S=this,E=this.tracks[f.level];E.textCodec||Object(I.parseIMSC1)(O,this.initPTS[f.cc],this.timescale[f.cc],function(){E.textCodec=I.IMSC1_CODEC,S._parseIMSC1(f,O)},function(){E.textCodec="wvtt"})},a._appendCues=function(f,O){var S=this.hls;if(this.config.renderTextTracksNatively){var E=this.textTracks[O];if(E.mode==="disabled")return;f.forEach(function(g){return Object(k.addCueToTrack)(E,g)})}else{var C=this.tracks[O],w=C.default?"default":"subtitles"+O;S.trigger(L.Events.CUES_PARSED,{type:"subtitles",cues:f,track:w})}},a.onFragDecrypted=function(f,O){var S=O.frag;if(S.type===b.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[S.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(L.Events.FRAG_LOADED,O)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(f,O){var S=this.cea608Parser1,E=this.cea608Parser2;if(!this.enabled||!(S&&E))return;for(var C=0;C<O.samples.length;C++){var w=O.samples[C].bytes;if(w){var g=this.extractCea608Data(w);S.addData(O.samples[C].pts,g[0]),E.addData(O.samples[C].pts,g[1])}}},a.onBufferFlushing=function(f,O){var S=O.startOffset,E=O.endOffset,C=O.endOffsetSubtitles,w=O.type,g=this.media;if(!g||g.currentTime<E)return;if(!w||w==="video"){var v=this.captionsTracks;Object.keys(v).forEach(function(o){return Object(k.removeCuesInRange)(v[o],S,E)})}if(this.config.renderTextTracksNatively&&(S===0&&C!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(o){return Object(k.removeCuesInRange)(h[o],S,C)})}},a.extractCea608Data=function(f){for(var O=f[0]&31,S=2,E=[[],[]],C=0;C<O;C++){var w=f[S++],g=127&f[S++],v=127&f[S++],h=(4&w)!==0,o=3&w;if(g===0&&v===0)continue;h&&((o===0||o===1)&&(E[o].push(g),E[o].push(v)))}return E},u}();function c(u,a){return u&&u.label===a.name&&!(u.textTrack1||u.textTrack2)}function r(u,a,s,f){return Math.min(a,f)-Math.max(u,s)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function L(H,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=U}var M=L.prototype;return M.decrypt=function(U,k){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},k,U)},L}()},"./src/crypt/aes-decryptor.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"removePadding",function(){return L}),P.d(X,"default",function(){return M});var V=P("./src/utils/typed-array.ts");function L(H){var U=H.byteLength,k=U&&new DataView(H.buffer).getUint8(U-1);return k?Object(V.sliceUint8)(H,0,U-k):H}var M=function(){function H(){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 U=H.prototype;return U.uint8ArrayToUint32Array_=function(I){for(var b=new DataView(I),y=new Uint32Array(4),p=0;p<4;p++)y[p]=b.getUint32(p*4);return y},U.initTable=function(){var I=this.sBox,b=this.invSBox,y=this.subMix,p=y[0],c=y[1],r=y[2],l=y[3],u=this.invSubMix,a=u[0],s=u[1],f=u[2],O=u[3],S=new Uint32Array(256),E=0,C=0,w=0;for(w=0;w<256;w++)w<128?S[w]=w<<1:S[w]=w<<1^283;for(w=0;w<256;w++){var g=C^C<<1^C<<2^C<<3^C<<4;g=g>>>8^g&255^99,I[E]=g,b[g]=E;var v=S[E],h=S[v],o=S[h],_=S[g]*257^g*16843008;p[E]=_<<24|_>>>8,c[E]=_<<16|_>>>16,r[E]=_<<8|_>>>24,l[E]=_,_=o*16843009^h*65537^v*257^E*16843008,a[g]=_<<24|_>>>8,s[g]=_<<16|_>>>16,f[g]=_<<8|_>>>24,O[g]=_,E?(E=v^S[S[S[o^v]]],C^=S[S[C]]):E=C=1}},U.expandKey=function(I){for(var b=this.uint8ArrayToUint32Array_(I),y=!0,p=0;p<b.length&&y;)y=b[p]===this.key[p],p++;if(y)return;this.key=b;var c=this.keySize=b.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var r=this.ksRows=(c+6+1)*4,l,u,a=this.keySchedule=new Uint32Array(r),s=this.invKeySchedule=new Uint32Array(r),f=this.sBox,O=this.rcon,S=this.invSubMix,E=S[0],C=S[1],w=S[2],g=S[3],v,h;for(l=0;l<r;l++){if(l<c){v=a[l]=b[l];continue}h=v,l%c===0?(h=h<<8|h>>>24,h=f[h>>>24]<<24|f[h>>>16&255]<<16|f[h>>>8&255]<<8|f[h&255],h^=O[l/c|0]<<24):c>6&&l%c===4&&(h=f[h>>>24]<<24|f[h>>>16&255]<<16|f[h>>>8&255]<<8|f[h&255]),a[l]=v=(a[l-c]^h)>>>0}for(u=0;u<r;u++)l=r-u,u&3?h=a[l]:h=a[l-4],u<4||l<=4?s[u]=h:s[u]=E[f[h>>>24]]^C[f[h>>>16&255]]^w[f[h>>>8&255]]^g[f[h&255]],s[u]=s[u]>>>0},U.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},U.decrypt=function(I,b,y){for(var p=this.keySize+6,c=this.invKeySchedule,r=this.invSBox,l=this.invSubMix,u=l[0],a=l[1],s=l[2],f=l[3],O=this.uint8ArrayToUint32Array_(y),S=O[0],E=O[1],C=O[2],w=O[3],g=new Int32Array(I),v=new Int32Array(g.length),h,o,_,m,T,N,j,W,Y,B,R,$,te,ue,me=this.networkToHostOrderSwap;b<g.length;){for(Y=me(g[b]),B=me(g[b+1]),R=me(g[b+2]),$=me(g[b+3]),T=Y^c[0],N=$^c[1],j=R^c[2],W=B^c[3],te=4,ue=1;ue<p;ue++)h=u[T>>>24]^a[N>>16&255]^s[j>>8&255]^f[W&255]^c[te],o=u[N>>>24]^a[j>>16&255]^s[W>>8&255]^f[T&255]^c[te+1],_=u[j>>>24]^a[W>>16&255]^s[T>>8&255]^f[N&255]^c[te+2],m=u[W>>>24]^a[T>>16&255]^s[N>>8&255]^f[j&255]^c[te+3],T=h,N=o,j=_,W=m,te=te+4;h=r[T>>>24]<<24^r[N>>16&255]<<16^r[j>>8&255]<<8^r[W&255]^c[te],o=r[N>>>24]<<24^r[j>>16&255]<<16^r[W>>8&255]<<8^r[T&255]^c[te+1],_=r[j>>>24]<<24^r[W>>16&255]<<16^r[T>>8&255]<<8^r[N&255]^c[te+2],m=r[W>>>24]<<24^r[T>>16&255]<<16^r[N>>8&255]<<8^r[j&255]^c[te+3],v[b]=me(h^S),v[b+1]=me(m^E),v[b+2]=me(_^C),v[b+3]=me(o^w),S=Y,E=B,C=R,w=$,b=b+4}return v.buffer},H}()},"./src/crypt/decrypter.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return b});var V=P("./src/crypt/aes-crypto.ts"),L=P("./src/crypt/fast-aes-key.ts"),M=P("./src/crypt/aes-decryptor.ts"),H=P("./src/utils/logger.ts"),U=P("./src/utils/mp4-tools.ts"),k=P("./src/utils/typed-array.ts"),I=16,b=function(){function y(c,r,l){var u=l===void 0?{}:l,a=u.removePKCS7Padding,s=a===void 0?!0:a;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=c,this.config=r,this.removePKCS7Padding=s,s)try{var f=self.crypto;f&&(this.subtle=f.subtle||f.webkitSubtle)}catch(O){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=y.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var r=this.currentResult;if(!r){this.reset();return}var l=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(l):l},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(r,l,u,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(r),l,u);var s=this.flush();s&&a(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(r),l,u).then(a)},p.softwareDecrypt=function(r,l,u){var a=this.currentIV,s=this.currentResult,f=this.remainderData;this.logOnce("JS AES decrypt"),f&&(r=Object(U.appendUint8Array)(f,r),this.remainderData=null);var O=this.getValidChunk(r);if(!O.length)return null;a&&(u=a);var S=this.softwareDecrypter;S||(S=this.softwareDecrypter=new M.default),S.expandKey(l);var E=s;return this.currentResult=S.decrypt(O.buffer,0,u),this.currentIV=Object(k.sliceUint8)(O,-16).buffer,E||null},p.webCryptoDecrypt=function(r,l,u){var a=this,s=this.subtle;return(this.key!==l||!this.fastAesKey)&&(this.key=l,this.fastAesKey=new L.default(s,l)),this.fastAesKey.expandKey().then(function(f){if(!s)return Promise.reject(new Error("web crypto not initialized"));var O=new V.default(s,u);return O.decrypt(r.buffer,f)}).catch(function(f){return a.onWebCryptoError(f,r,l,u)})},p.onWebCryptoError=function(r,l,u,a){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",r),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(l,u,a)},p.getValidChunk=function(r){var l=r,u=r.length-r.length%I;return u!==r.length&&(l=Object(k.sliceUint8)(r,0,u),this.remainderData=Object(k.sliceUint8)(r,u)),l},p.logOnce=function(r){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+r),this.logEnabled=!1},y}()},"./src/crypt/fast-aes-key.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function L(H,U){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=U}var M=L.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},L}()},"./src/demux/aacdemuxer.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/demux/base-audio-demuxer.ts"),L=P("./src/demux/adts.ts"),M=P("./src/utils/logger.ts"),H=P("./src/demux/id3.ts");function U(b,y){b.prototype=Object.create(y.prototype),b.prototype.constructor=b,k(b,y)}function k(b,y){return k=Object.setPrototypeOf||function(c,r){return c.__proto__=r,c},k(b,y)}var I=function(b){U(y,b);function y(c,r){var l;return l=b.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=c,l.config=r,l}var p=y.prototype;return p.resetInitSegment=function(r,l,u){b.prototype.resetInitSegment.call(this,r,l,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:r,duration:u,inputTimeScale:9e4,dropped:0}},y.probe=function(r){if(!r)return!1;for(var l=H.getID3Data(r,0)||[],u=l.length,a=r.length;u<a;u++)if(L.probe(r,u))return M.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(r,l){return L.canParse(r,l)},p.appendFrame=function(r,l,u){L.initTrackConfig(r,this.observer,l,u,r.manifestCodec);var a=L.appendFrame(r,l,u,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},y}(V.default);I.minProbeByteLength=9,X.default=I},"./src/demux/adts.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"getAudioConfig",function(){return H}),P.d(X,"isHeaderPattern",function(){return U}),P.d(X,"getHeaderLength",function(){return k}),P.d(X,"getFullFrameLength",function(){return I}),P.d(X,"canGetFrameLength",function(){return b}),P.d(X,"isHeader",function(){return y}),P.d(X,"canParse",function(){return p}),P.d(X,"probe",function(){return c}),P.d(X,"initTrackConfig",function(){return r}),P.d(X,"getFrameDuration",function(){return l}),P.d(X,"parseFrameHeader",function(){return u}),P.d(X,"appendFrame",function(){return a});var V=P("./src/utils/logger.ts"),L=P("./src/errors.ts"),M=P("./src/events.ts");function H(s,f,O,S){var E,C,w,g,v=navigator.userAgent.toLowerCase(),h=S,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];E=((f[O+2]&192)>>>6)+1;var _=(f[O+2]&60)>>>2;if(_>o.length-1){s.trigger(M.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return w=(f[O+2]&1)<<2,w|=(f[O+3]&192)>>>6,V.logger.log("manifest codec:"+S+", ADTS type:"+E+", samplingIndex:"+_),/firefox/i.test(v)?_>=6?(E=5,g=new Array(4),C=_-3):(E=2,g=new Array(2),C=_):v.indexOf("android")!==-1?(E=2,g=new Array(2),C=_):(E=5,g=new Array(4),S&&(S.indexOf("mp4a.40.29")!==-1||S.indexOf("mp4a.40.5")!==-1)||!S&&_>=6?C=_-3:((S&&S.indexOf("mp4a.40.2")!==-1&&(_>=6&&w===1||/vivaldi/i.test(v))||!S&&w===1)&&(E=2,g=new Array(2)),C=_)),g[0]=E<<3,g[0]|=(_&14)>>1,g[1]|=(_&1)<<7,g[1]|=w<<3,E===5&&(g[1]|=(C&14)>>1,g[2]=(C&1)<<7,g[2]|=2<<2,g[3]=0),{config:g,samplerate:o[_],channelCount:w,codec:"mp4a.40."+E,manifestCodec:h}}function U(s,f){return s[f]===255&&(s[f+1]&246)===240}function k(s,f){return s[f+1]&1?7:9}function I(s,f){return(s[f+3]&3)<<11|s[f+4]<<3|(s[f+5]&224)>>>5}function b(s,f){return f+5<s.length}function y(s,f){return f+1<s.length&&U(s,f)}function p(s,f){return b(s,f)&&U(s,f)&&I(s,f)<=s.length-f}function c(s,f){if(y(s,f)){var O=k(s,f);if(f+O>=s.length)return!1;var S=I(s,f);if(S<=O)return!1;var E=f+S;return E===s.length||y(s,E)}return!1}function r(s,f,O,S,E){if(!s.samplerate){var C=H(f,O,S,E);if(!C)return;s.config=C.config,s.samplerate=C.samplerate,s.channelCount=C.channelCount,s.codec=C.codec,s.manifestCodec=C.manifestCodec,V.logger.log("parsed codec:"+s.codec+", rate:"+C.samplerate+", channels:"+C.channelCount)}}function l(s){return 1024*9e4/s}function u(s,f,O,S,E){var C=k(s,f),w=I(s,f);if(w-=C,w>0){var g=O+S*E;return{headerLength:C,frameLength:w,stamp:g}}}function a(s,f,O,S,E){var C=l(s.samplerate),w=u(f,O,S,E,C);if(w){var g=w.frameLength,v=w.headerLength,h=w.stamp,o=v+g,_=Math.max(0,O+o-f.length),m;_?(m=new Uint8Array(o-v),m.set(f.subarray(O+v,f.length),0)):m=f.subarray(O+v,O+o);var T={unit:m,pts:h};return _||s.samples.push(T),{sample:T,length:o,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"initPTSFn",function(){return I});var V=P("./src/polyfills/number.ts"),L=P("./src/demux/id3.ts"),M=P("./src/demux/dummy-demuxed-track.ts"),H=P("./src/utils/mp4-tools.ts"),U=P("./src/utils/typed-array.ts"),k=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var y=b.prototype;return y.resetInitSegment=function(c,r,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},y.resetTimeStamp=function(){},y.resetContiguity=function(){},y.canParse=function(c,r){return!1},y.appendFrame=function(c,r,l){},y.demux=function(c,r){this.cachedData&&(c=Object(H.appendUint8Array)(this.cachedData,c),this.cachedData=null);var l=L.getID3Data(c,0),u=l?l.length:0,a,s,f=this._audioTrack,O=this._id3Track,S=l?L.getTimeStamp(l):void 0,E=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(S,r)),l&&l.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),s=this.initPTS;u<E;){if(this.canParse(c,u)){var C=this.appendFrame(f,c,u);C?(this.frameIndex++,s=C.sample.pts,u+=C.length,a=u):u=E}else L.canParse(c,u)?(l=L.getID3Data(c,u),O.samples.push({pts:s,dts:s,data:l}),u+=l.length,a=u):u++;if(u===E&&a!==E){var w=Object(U.sliceUint8)(c,a);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,w):this.cachedData=w}}return{audioTrack:f,avcTrack:Object(M.dummyTrack)(),id3Track:O,textTrack:Object(M.dummyTrack)()}},y.demuxSampleAes=function(c,r,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},y.flush=function(c){var r=this.cachedData;return r&&(this.cachedData=null,this.demux(r,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},y.destroy=function(){},b}(),I=function(y,p){return Object(V.isFiniteNumber)(y)?y*90:p*9e4};X.default=k},"./src/demux/chunk-cache.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function M(){this.chunks=[],this.dataLength=0}var H=M.prototype;return H.push=function(k){this.chunks.push(k),this.dataLength+=k.length},H.flush=function(){var k=this.chunks,I=this.dataLength,b;if(k.length)k.length===1?b=k[0]:b=L(k,I);else return new Uint8Array(0);return this.reset(),b},H.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function L(M,H){for(var U=new Uint8Array(H),k=0,I=0;I<M.length;I++){var b=M[I];U.set(b,k),k+=b.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"dummyTrack",function(){return V});function V(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/utils/logger.ts"),L=function(){function M(U){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=U,this.bytesAvailable=U.byteLength,this.word=0,this.bitsAvailable=0}var H=M.prototype;return H.loadWord=function(){var k=this.data,I=this.bytesAvailable,b=k.byteLength-I,y=new Uint8Array(4),p=Math.min(4,I);if(p===0)throw new Error("no bytes available");y.set(k.subarray(b,b+p)),this.word=new DataView(y.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},H.skipBits=function(k){var I;this.bitsAvailable>k?(this.word<<=k,this.bitsAvailable-=k):(k-=this.bitsAvailable,I=k>>3,k-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=k,this.bitsAvailable-=k)},H.readBits=function(k){var I=Math.min(this.bitsAvailable,k),b=this.word>>>32-I;return k>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=k-I,I>0&&this.bitsAvailable?b<<I|this.readBits(I):b},H.skipLZ=function(){var k;for(k=0;k<this.bitsAvailable;++k)if((this.word&2147483648>>>k)!==0)return this.word<<=k,this.bitsAvailable-=k,k;return this.loadWord(),k+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var k=this.skipLZ();return this.readBits(k+1)-1},H.readEG=function(){var k=this.readUEG();return 1&k?1+k>>>1:-1*(k>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(k){for(var I=8,b=8,y,p=0;p<k;p++)b!==0&&(y=this.readEG(),b=(I+y+256)%256),I=b===0?I:b},H.readSPS=function(){var k=0,I=0,b=0,y=0,p,c,r,l=this.readUByte.bind(this),u=this.readBits.bind(this),a=this.readUEG.bind(this),s=this.readBoolean.bind(this),f=this.skipBits.bind(this),O=this.skipEG.bind(this),S=this.skipUEG.bind(this),E=this.skipScalingList.bind(this);l();var C=l();if(u(5),f(3),l(),S(),C===100||C===110||C===122||C===244||C===44||C===83||C===86||C===118||C===128){var w=a();if(w===3&&f(1),S(),S(),f(1),s())for(c=w!==3?8:12,r=0;r<c;r++)s()&&(r<6?E(16):E(64))}S();var g=a();if(g===0)a();else if(g===1)for(f(1),O(),O(),p=a(),r=0;r<p;r++)O();S(),f(1);var v=a(),h=a(),o=u(1);o===0&&f(1),f(1),s()&&(k=a(),I=a(),b=a(),y=a());var _=[1,1];if(s()&&s()){var m=l();switch(m){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((v+1)*16-k*2-I*2),height:(2-o)*(h+1)*16-(o?2:4)*(b+y),pixelRatio:_}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();X.default=L},"./src/demux/id3.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"isHeader",function(){return V}),P.d(X,"isFooter",function(){return L}),P.d(X,"getID3Data",function(){return M}),P.d(X,"canParse",function(){return U}),P.d(X,"getTimeStamp",function(){return k}),P.d(X,"isTimeStampFrame",function(){return I}),P.d(X,"getID3Frames",function(){return y}),P.d(X,"decodeFrame",function(){return p}),P.d(X,"utf8ArrayToStr",function(){return a}),P.d(X,"testables",function(){return s});var V=function(E,C){return C+10<=E.length&&(E[C]===73&&E[C+1]===68&&E[C+2]===51&&(E[C+3]<255&&E[C+4]<255&&(E[C+6]<128&&E[C+7]<128&&E[C+8]<128&&E[C+9]<128)))},L=function(E,C){return C+10<=E.length&&(E[C]===51&&E[C+1]===68&&E[C+2]===73&&(E[C+3]<255&&E[C+4]<255&&(E[C+6]<128&&E[C+7]<128&&E[C+8]<128&&E[C+9]<128)))},M=function(E,C){for(var w=C,g=0;V(E,C);){g+=10;var v=H(E,C+6);g+=v,L(E,C+10)&&(g+=10),C+=g}return g>0?E.subarray(w,w+g):void 0},H=function(E,C){var w=0;return w=(E[C]&127)<<21,w|=(E[C+1]&127)<<14,w|=(E[C+2]&127)<<7,w|=E[C+3]&127,w},U=function(E,C){return V(E,C)&&H(E,C+6)+10<=E.length-C},k=function(E){for(var C=y(E),w=0;w<C.length;w++){var g=C[w];if(I(g))return u(g)}return},I=function(E){return E&&E.key==="PRIV"&&E.info==="com.apple.streaming.transportStreamTimestamp"},b=function(E){var C=String.fromCharCode(E[0],E[1],E[2],E[3]),w=H(E,4),g=10;return{type:C,size:w,data:E.subarray(g,g+w)}},y=function(E){for(var C=0,w=[];V(E,C);){var g=H(E,C+6);C+=10;for(var v=C+g;C+8<v;){var h=b(E.subarray(C)),o=p(h);o&&w.push(o),C+=h.size+10}L(E,C)&&(C+=10)}return w},p=function(E){return E.type==="PRIV"?c(E):E.type[0]==="W"?l(E):r(E)},c=function(E){if(E.size<2)return;var C=a(E.data,!0),w=new Uint8Array(E.data.subarray(C.length+1));return{key:E.type,info:C,data:w.buffer}},r=function(E){if(E.size<2)return;if(E.type==="TXXX"){var C=1,w=a(E.data.subarray(C),!0);C+=w.length+1;var g=a(E.data.subarray(C));return{key:E.type,info:w,data:g}}var v=a(E.data.subarray(1));return{key:E.type,data:v}},l=function(E){if(E.type==="WXXX"){if(E.size<2)return;var C=1,w=a(E.data.subarray(C),!0);C+=w.length+1;var g=a(E.data.subarray(C));return{key:E.type,info:w,data:g}}var v=a(E.data);return{key:E.type,data:v}},u=function(E){if(E.data.byteLength===8){var C=new Uint8Array(E.data),w=C[3]&1,g=(C[4]<<23)+(C[5]<<15)+(C[6]<<7)+C[7];return g/=45,w&&(g+=4772185884e-2),Math.round(g)}return},a=function(E,C){C===void 0&&(C=!1);var w=O();if(w){var g=w.decode(E);if(C){var v=g.indexOf("\0");return v!==-1?g.substring(0,v):g}return g.replace(/\0/g,"")}for(var h=E.length,o,_,m,T="",N=0;N<h;){if(o=E[N++],o===0&&C)return T;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:T+=String.fromCharCode(o);break;case 12:case 13:_=E[N++],T+=String.fromCharCode((o&31)<<6|_&63);break;case 14:_=E[N++],m=E[N++],T+=String.fromCharCode((o&15)<<12|(_&63)<<6|(m&63)<<0);break;default:}}return T},s={decodeTextFrame:r},f;function O(){return!f&&typeof self.TextDecoder!="undefined"&&(f=new self.TextDecoder("utf-8")),f}},"./src/demux/mp3demuxer.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/demux/base-audio-demuxer.ts"),L=P("./src/demux/id3.ts"),M=P("./src/utils/logger.ts"),H=P("./src/demux/mpegaudio.ts");function U(b,y){b.prototype=Object.create(y.prototype),b.prototype.constructor=b,k(b,y)}function k(b,y){return k=Object.setPrototypeOf||function(c,r){return c.__proto__=r,c},k(b,y)}var I=function(b){U(y,b);function y(){return b.apply(this,arguments)||this}var p=y.prototype;return p.resetInitSegment=function(r,l,u){b.prototype.resetInitSegment.call(this,r,l,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:u,inputTimeScale:9e4,dropped:0}},y.probe=function(r){if(!r)return!1;for(var l=L.getID3Data(r,0)||[],u=l.length,a=r.length;u<a;u++)if(H.probe(r,u))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(r,l){return H.canParse(r,l)},p.appendFrame=function(r,l,u){return this.initPTS===null?void 0:H.appendFrame(r,l,u,this.initPTS,this.frameIndex)},y}(V.default);I.minProbeByteLength=4,X.default=I},"./src/demux/mp4demuxer.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/utils/mp4-tools.ts"),L=P("./src/demux/dummy-demuxed-track.ts"),M=function(){function H(k,I){this.remainderData=null,this.config=void 0,this.config=I}var U=H.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},H.probe=function(I){return Object(V.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},U.demux=function(I){var b=I,y=Object(L.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(V.appendUint8Array)(this.remainderData,I));var p=Object(V.segmentValidRange)(b);this.remainderData=p.remainder,y.samples=p.valid||new Uint8Array}else y.samples=b;return{audioTrack:Object(L.dummyTrack)(),avcTrack:y,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},U.flush=function(){var I=Object(L.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(L.dummyTrack)(),avcTrack:I,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},U.demuxSampleAes=function(I,b,y){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},H}();M.minProbeByteLength=1024,X.default=M},"./src/demux/mpegaudio.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"appendFrame",function(){return k}),P.d(X,"parseHeader",function(){return I}),P.d(X,"isHeaderPattern",function(){return b}),P.d(X,"isHeader",function(){return y}),P.d(X,"canParse",function(){return p}),P.d(X,"probe",function(){return c});var V=null,L=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function k(r,l,u,a,s){if(u+24>l.length)return;var f=I(l,u);if(f&&u+f.frameLength<=l.length){var O=f.samplesPerFrame*9e4/f.sampleRate,S=a+s*O,E={unit:l.subarray(u,u+f.frameLength),pts:S,dts:S};return r.config=[],r.channelCount=f.channelCount,r.samplerate=f.sampleRate,r.samples.push(E),{sample:E,length:f.frameLength,missing:0}}}function I(r,l){var u=r[l+1]>>3&3,a=r[l+1]>>1&3,s=r[l+2]>>4&15,f=r[l+2]>>2&3;if(u!==1&&s!==0&&s!==15&&f!==3){var O=r[l+2]>>1&1,S=r[l+3]>>6,E=u===3?3-a:a===3?3:4,C=L[E*14+s-1]*1e3,w=u===3?0:u===2?1:2,g=M[w*3+f],v=S===3?1:2,h=H[u][a],o=U[a],_=h*8*o,m=Math.floor(h*C/g+O)*o;if(V===null){var T=navigator.userAgent||"",N=T.match(/Chrome\/(\d+)/i);V=N?parseInt(N[1]):0}var j=!!V&&V<=87;return j&&a===2&&C>=224e3&&S===0&&(r[l+3]=r[l+3]|128),{sampleRate:g,channelCount:v,frameLength:m,samplesPerFrame:_}}}function b(r,l){return r[l]===255&&(r[l+1]&224)===224&&(r[l+1]&6)!==0}function y(r,l){return l+1<r.length&&b(r,l)}function p(r,l){var u=4;return b(r,l)&&u<=r.length-l}function c(r,l){if(l+1<r.length&&b(r,l)){var u=4,a=I(r,l),s=u;a!=null&&a.frameLength&&(s=a.frameLength);var f=l+s;return f===r.length||y(r,f)}return!1}},"./src/demux/sample-aes.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/crypt/decrypter.ts"),L=P("./src/demux/tsdemuxer.ts"),M=function(){function H(k,I,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new V.default(k,I,{removePKCS7Padding:!1})}var U=H.prototype;return U.decryptBuffer=function(I,b){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,b)},U.decryptAacSample=function(I,b,y,p){var c=I[b].unit,r=c.subarray(16,c.length-c.length%16),l=r.buffer.slice(r.byteOffset,r.byteOffset+r.length),u=this;this.decryptBuffer(l,function(a){var s=new Uint8Array(a);c.set(s,16),p||u.decryptAacSamples(I,b+1,y)})},U.decryptAacSamples=function(I,b,y){for(;;b++){if(b>=I.length){y();return}if(I[b].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(I,b,y,p),!p)return}},U.getAvcEncryptedData=function(I){for(var b=Math.floor((I.length-48)/160)*16+16,y=new Int8Array(b),p=0,c=32;c<=I.length-16;c+=160,p+=16)y.set(I.subarray(c,c+16),p);return y},U.getAvcDecryptedUnit=function(I,b){for(var y=new Uint8Array(b),p=0,c=32;c<=I.length-16;c+=160,p+=16)I.set(y.subarray(p,p+16),c);return I},U.decryptAvcSample=function(I,b,y,p,c,r){var l=Object(L.discardEPB)(c.data),u=this.getAvcEncryptedData(l),a=this;this.decryptBuffer(u.buffer,function(s){c.data=a.getAvcDecryptedUnit(l,s),r||a.decryptAvcSamples(I,b,y+1,p)})},U.decryptAvcSamples=function(I,b,y,p){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,y=0){if(b>=I.length){p();return}for(var c=I[b].units;!(y>=c.length);y++){var r=c[y];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(I,b,y,p,r,l),!l)return}}},H}();X.default=M},"./src/demux/transmuxer-interface.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c});var V=P("./node_modules/webworkify-webpack/index.js"),L=P.n(V),M=P("./src/events.ts"),H=P("./src/demux/transmuxer.ts"),U=P("./src/utils/logger.ts"),k=P("./src/errors.ts"),I=P("./src/utils/mediasource-helper.ts"),b=P("./node_modules/eventemitter3/index.js"),y=P.n(b),p=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function r(u,a,s,f){var O=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=u,this.id=a,this.onTransmuxComplete=s,this.onFlush=f;var S=u.config,E=function(h,o){o=o||{},o.frag=O.frag,o.id=O.id,u.trigger(h,o)};this.observer=new b.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,E),this.observer.on(M.Events.ERROR,E);var C={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(S.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var g;try{g=this.worker=V("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(v){u.trigger(M.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(v.message+" ("+v.filename+":"+v.lineno+")")})},g.postMessage({cmd:"init",typeSupported:C,vendor:w,id:a,config:JSON.stringify(S)})}catch(v){U.logger.warn("Error in worker:",v),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new H.default(this.observer,C,S,w,a),this.worker=null}}else this.transmuxer=new H.default(this.observer,C,S,w,a)}var l=r.prototype;return l.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var f=this.observer;f&&f.removeAllListeners(),this.observer=null},l.push=function(a,s,f,O,S,E,C,w,g,v){var h=this;g.transmuxing.start=self.performance.now();var o=this.transmuxer,_=this.worker,m=E?E.start:S.start,T=S.decryptdata,N=this.frag,j=!(N&&S.cc===N.cc),W=!(N&&g.level===N.level),Y=N?g.sn-N.sn:-1,B=this.part?g.part-this.part.index:1,R=!W&&(Y===1||Y===0&&B===1),$=self.performance.now();(W||Y||S.stats.parsing.start===0)&&(S.stats.parsing.start=$),E&&(B||!R)&&(E.stats.parsing.start=$);var te=new H.TransmuxState(j,R,w,W,m);if(!R||j){U.logger.log("[transmuxer-interface, "+S.type+"]: Starting new transmux session for sn: "+g.sn+" p: "+g.part+" level: "+g.level+" id: "+g.id+`
discontinuity: `+j+`
trackSwitch: `+W+`
contiguous: `+R+`
accurateTimeOffset: `+w+`
timeOffset: `+m);var ue=new H.TransmuxConfig(f,O,s,C,v);this.configureTransmuxer(ue)}if(this.frag=S,this.part=E,_)_.postMessage({cmd:"demux",data:a,decryptdata:T,chunkMeta:g,state:te},a instanceof ArrayBuffer?[a]:[]);else if(o){var me=o.push(a,T,g,te);Object(H.isPromise)(me)?me.then(function(Me){h.handleTransmuxComplete(Me)}):this.handleTransmuxComplete(me)}},l.flush=function(a){var s=this;a.transmuxing.start=self.performance.now();var f=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:a});else if(f){var S=f.flush(a);Object(H.isPromise)(S)?S.then(function(E){s.handleFlushResult(E,a)}):this.handleFlushResult(S,a)}},l.handleFlushResult=function(a,s){var f=this;a.forEach(function(O){f.handleTransmuxComplete(O)}),this.onFlush(s)},l.onWorkerMessage=function(a){var s=a.data,f=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,f.trigger(s.event,s.data);break}}},l.configureTransmuxer=function(a){var s=this.worker,f=this.transmuxer;s?s.postMessage({cmd:"configure",config:a}):f&&f.configure(a)},l.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},r}()},"./src/demux/transmuxer-worker.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return k});var V=P("./src/demux/transmuxer.ts"),L=P("./src/events.ts"),M=P("./src/utils/logger.ts"),H=P("./node_modules/eventemitter3/index.js"),U=P.n(H);function k(c){var r=new H.EventEmitter,l=function(a,s){c.postMessage({event:a,data:s})};r.on(L.Events.FRAG_DECRYPTED,l),r.on(L.Events.ERROR,l),c.addEventListener("message",function(u){var a=u.data;switch(a.cmd){case"init":{var s=JSON.parse(a.config);c.transmuxer=new V.default(r,a.typeSupported,s,a.vendor,a.id),Object(M.enableLogs)(s.debug),l("init",null);break}case"configure":{c.transmuxer.configure(a.config);break}case"demux":{var f=c.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(V.isPromise)(f)?f.then(function(E){I(c,E)}):I(c,f);break}case"flush":{var O=a.chunkMeta,S=c.transmuxer.flush(O);Object(V.isPromise)(S)?S.then(function(E){y(c,E,O)}):y(c,S,O);break}default:break}})}function I(c,r){if(p(r.remuxResult))return;var l=[],u=r.remuxResult,a=u.audio,s=u.video;a&&b(l,a),s&&b(l,s),c.postMessage({event:"transmuxComplete",data:r},l)}function b(c,r){r.data1&&c.push(r.data1.buffer),r.data2&&c.push(r.data2.buffer)}function y(c,r,l){r.forEach(function(u){I(c,u)}),c.postMessage({event:"flush",data:l})}function p(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return s}),P.d(X,"isPromise",function(){return S}),P.d(X,"TransmuxConfig",function(){return E}),P.d(X,"TransmuxState",function(){return C});var V=P("./src/events.ts"),L=P("./src/errors.ts"),M=P("./src/crypt/decrypter.ts"),H=P("./src/demux/aacdemuxer.ts"),U=P("./src/demux/mp4demuxer.ts"),k=P("./src/demux/tsdemuxer.ts"),I=P("./src/demux/mp3demuxer.ts"),b=P("./src/remux/mp4-remuxer.ts"),y=P("./src/remux/passthrough-remuxer.ts"),p=P("./src/demux/chunk-cache.ts"),c=P("./src/utils/mp4-tools.ts"),r=P("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(w){r.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var u=[{demux:k.default,remux:b.default},{demux:U.default,remux:y.default},{demux:H.default,remux:b.default},{demux:I.default,remux:b.default}],a=1024;u.forEach(function(w){var g=w.demux;a=Math.max(a,g.minProbeByteLength)});var s=function(){function w(v,h,o,_,m){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new p.default,this.observer=v,this.typeSupported=h,this.config=o,this.vendor=_,this.id=m}var g=w.prototype;return g.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},g.push=function(h,o,_,m){var T=this,N=_.transmuxing;N.executeStart=l();var j=new Uint8Array(h),W=this.cache,Y=this.config,B=this.currentTransmuxState,R=this.transmuxConfig;m&&(this.currentTransmuxState=m);var $=f(j,o);if($&&$.method==="AES-128"){var te=this.getDecrypter();if(Y.enableSoftwareAES){var ue=te.softwareDecrypt(j,$.key.buffer,$.iv.buffer);if(!ue)return N.executeEnd=l(),O(_);j=new Uint8Array(ue)}else return this.decryptionPromise=te.webCryptoDecrypt(j,$.key.buffer,$.iv.buffer).then(function(Je){var st=T.push(Je,null,_);return T.decryptionPromise=null,st}),this.decryptionPromise}var me=m||B,Me=me.contiguous,Ae=me.discontinuity,De=me.trackSwitch,Fe=me.accurateTimeOffset,Ne=me.timeOffset,Ee=R.audioCodec,se=R.videoCodec,He=R.defaultInitPts,ft=R.duration,lt=R.initSegmentData;if((Ae||De)&&this.resetInitSegment(lt,Ee,se,ft),Ae&&this.resetInitialTimestamp(He),Me||this.resetContiguity(),this.needsProbing(j,Ae,De)){if(W.dataLength){var it=W.flush();j=Object(c.appendUint8Array)(it,j)}this.configureTransmuxer(j,R)}var ct=this.transmux(j,$,Ne,Fe,_),Ve=this.currentTransmuxState;return Ve.contiguous=!0,Ve.discontinuity=!1,Ve.trackSwitch=!1,N.executeEnd=l(),ct},g.flush=function(h){var o=this,_=h.transmuxing;_.executeStart=l();var m=this.decrypter,T=this.cache,N=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return o.flush(h)});var W=[],Y=N.timeOffset;if(m){var B=m.flush();B&&W.push(this.push(B,null,h))}var R=T.dataLength;T.reset();var $=this.demuxer,te=this.remuxer;if(!$||!te)return R>=a&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=l(),[O(h)];var ue=$.flush(Y);return S(ue)?ue.then(function(me){return o.flushRemux(W,me,h),W}):(this.flushRemux(W,ue,h),W)},g.flushRemux=function(h,o,_){var m=o.audioTrack,T=o.avcTrack,N=o.id3Track,j=o.textTrack,W=this.currentTransmuxState,Y=W.accurateTimeOffset,B=W.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var R=this.remuxer.remux(m,T,N,j,B,Y,!0,this.id);h.push({remuxResult:R,chunkMeta:_}),_.transmuxing.executeEnd=l()},g.resetInitialTimestamp=function(h){var o=this.demuxer,_=this.remuxer;if(!o||!_)return;o.resetTimeStamp(h),_.resetTimeStamp(h)},g.resetContiguity=function(){var h=this.demuxer,o=this.remuxer;if(!h||!o)return;h.resetContiguity(),o.resetNextTimestamp()},g.resetInitSegment=function(h,o,_,m){var T=this.demuxer,N=this.remuxer;if(!T||!N)return;T.resetInitSegment(o,_,m),N.resetInitSegment(h,o,_)},g.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},g.transmux=function(h,o,_,m,T){var N;return o&&o.method==="SAMPLE-AES"?N=this.transmuxSampleAes(h,o,_,m,T):N=this.transmuxUnencrypted(h,_,m,T),N},g.transmuxUnencrypted=function(h,o,_,m){var T=this.demuxer.demux(h,o,!1,!this.config.progressive),N=T.audioTrack,j=T.avcTrack,W=T.id3Track,Y=T.textTrack,B=this.remuxer.remux(N,j,W,Y,o,_,!1,this.id);return{remuxResult:B,chunkMeta:m}},g.transmuxSampleAes=function(h,o,_,m,T){var N=this;return this.demuxer.demuxSampleAes(h,o,_).then(function(j){var W=N.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,_,m,!1,N.id);return{remuxResult:W,chunkMeta:T}})},g.configureTransmuxer=function(h,o){for(var _=this.config,m=this.observer,T=this.typeSupported,N=this.vendor,j=o.audioCodec,W=o.defaultInitPts,Y=o.duration,B=o.initSegmentData,R=o.videoCodec,$,te=0,ue=u.length;te<ue;te++)if(u[te].demux.probe(h)){$=u[te];break}$||(r.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),$={demux:U.default,remux:y.default});var me=this.demuxer,Me=this.remuxer,Ae=$.remux,De=$.demux;(!Me||!(Me instanceof Ae))&&(this.remuxer=new Ae(m,_,T,N)),(!me||!(me instanceof De))&&(this.demuxer=new De(m,_,T),this.probe=De.probe),this.resetInitSegment(B,j,R,Y),this.resetInitialTimestamp(W)},g.needsProbing=function(h,o,_){return!this.demuxer||!this.remuxer||o||_},g.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new M.default(this.observer,this.config)),h},w}();function f(w,g){var v=null;return w.byteLength>0&&g!=null&&g.key!=null&&g.iv!==null&&g.method!=null&&(v=g),v}var O=function(g){return{remuxResult:{},chunkMeta:g}};function S(w){return"then"in w&&w.then instanceof Function}var E=function(g,v,h,o,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=g,this.videoCodec=v,this.initSegmentData=h,this.duration=o,this.defaultInitPts=_},C=function(g,v,h,o,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=g,this.contiguous=v,this.accurateTimeOffset=h,this.trackSwitch=o,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"discardEPB",function(){return O});var V=P("./src/demux/adts.ts"),L=P("./src/demux/mpegaudio.ts"),M=P("./src/demux/exp-golomb.ts"),H=P("./src/demux/id3.ts"),U=P("./src/demux/sample-aes.ts"),k=P("./src/events.ts"),I=P("./src/utils/mp4-tools.ts"),b=P("./src/utils/logger.ts"),y=P("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},c=function(){function S(C,w,g){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=C,this.config=w,this.typeSupported=g}S.probe=function(w){var g=S.syncOffset(w);return g<0?!1:(g&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+g+", junk ahead ?"),!0)},S.syncOffset=function(w){for(var g=Math.min(1e3,w.length-3*188),v=0;v<g;){if(w[v]===71&&w[v+188]===71&&w[v+2*188]===71)return v;v++}return-1},S.createTrack=function(w,g){return{container:w==="video"||w==="audio"?"video/mp2t":void 0,type:w,id:p[w],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:w==="audio"?g:void 0}};var E=S.prototype;return E.resetInitSegment=function(w,g,v){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=S.createTrack("video",v),this._audioTrack=S.createTrack("audio",v),this._id3Track=S.createTrack("id3",v),this._txtTrack=S.createTrack("text",v),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=w,this.videoCodec=g,this._duration=v},E.resetTimeStamp=function(){},E.resetContiguity=function(){var w=this._audioTrack,g=this._avcTrack,v=this._id3Track;w&&(w.pesData=null),g&&(g.pesData=null),v&&(v.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},E.demux=function(w,g,v,h){v===void 0&&(v=!1),h===void 0&&(h=!1),v||(this.sampleAes=null);var o,_=this._avcTrack,m=this._audioTrack,T=this._id3Track,N=_.pid,j=_.pesData,W=m.pid,Y=T.pid,B=m.pesData,R=T.pesData,$=!1,te=this.pmtParsed,ue=this._pmtId,me=w.length;if(this.remainderData&&(w=Object(I.appendUint8Array)(this.remainderData,w),me=w.length,this.remainderData=null),me<188&&!h)return this.remainderData=w,{audioTrack:m,avcTrack:_,id3Track:T,textTrack:this._txtTrack};var Me=Math.max(0,S.syncOffset(w));me-=(me+Me)%188,me<w.byteLength&&!h&&(this.remainderData=new Uint8Array(w.buffer,me,w.buffer.byteLength-me));for(var Ae=Me;Ae<me;Ae+=188)if(w[Ae]===71){var De=!!(w[Ae+1]&64),Fe=((w[Ae+1]&31)<<8)+w[Ae+2],Ne=(w[Ae+3]&48)>>4,Ee=void 0;if(Ne>1){if(Ee=Ae+5+w[Ae+4],Ee===Ae+188)continue}else Ee=Ae+4;switch(Fe){case N:De&&(j&&(o=a(j))&&this.parseAVCPES(o,!1),j={data:[],size:0}),j&&(j.data.push(w.subarray(Ee,Ae+188)),j.size+=Ae+188-Ee);break;case W:De&&(B&&(o=a(B))&&(m.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),B={data:[],size:0}),B&&(B.data.push(w.subarray(Ee,Ae+188)),B.size+=Ae+188-Ee);break;case Y:De&&(R&&(o=a(R))&&this.parseID3PES(o),R={data:[],size:0}),R&&(R.data.push(w.subarray(Ee,Ae+188)),R.size+=Ae+188-Ee);break;case 0:De&&(Ee+=w[Ee]+1),ue=this._pmtId=l(w,Ee);break;case ue:{De&&(Ee+=w[Ee]+1);var se=u(w,Ee,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,v);N=se.avc,N>0&&(_.pid=N),W=se.audio,W>0&&(m.pid=W,m.isAAC=se.isAAC),Y=se.id3,Y>0&&(T.pid=Y),$&&!te&&(b.logger.log("reparse from beginning"),$=!1,Ae=Me-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:$=!0;break}}else this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=j,m.pesData=B,T.pesData=R;var He={audioTrack:m,avcTrack:_,id3Track:T,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(He),He},E.flush=function(){var w=this.remainderData;this.remainderData=null;var g;return w?g=this.demux(w,-1,!1,!0):g={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(g),this.sampleAes?this.decrypt(g,this.sampleAes):g},E.extractRemainingSamples=function(w){var g=w.audioTrack,v=w.avcTrack,h=w.id3Track,o=v.pesData,_=g.pesData,m=h.pesData,T;o&&(T=a(o))?(this.parseAVCPES(T,!0),v.pesData=null):v.pesData=o,_&&(T=a(_))?(g.isAAC?this.parseAACPES(T):this.parseMPEGPES(T),g.pesData=null):(_!=null&&_.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=_),m&&(T=a(m))?(this.parseID3PES(T),h.pesData=null):h.pesData=m},E.demuxSampleAes=function(w,g,v){var h=this.demux(w,v,!0,!this.config.progressive),o=this.sampleAes=new U.default(this.observer,this.config,g);return this.decrypt(h,o)},E.decrypt=function(w,g){return new Promise(function(v){var h=w.audioTrack,o=w.avcTrack;h.samples&&h.isAAC?g.decryptAacSamples(h.samples,0,function(){o.samples?g.decryptAvcSamples(o.samples,0,0,function(){v(w)}):v(w)}):o.samples&&g.decryptAvcSamples(o.samples,0,0,function(){v(w)})})},E.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},E.parseAVCPES=function(w,g){var v=this,h=this._avcTrack,o=this.parseAVCNALu(w.data),_=!1,m=this.avcSample,T,N=!1;w.data=null,m&&o.length&&!h.audFound&&(s(m,h),m=this.avcSample=r(!1,w.pts,w.dts,"")),o.forEach(function(j){switch(j.type){case 1:{T=!0,m||(m=v.avcSample=r(!0,w.pts,w.dts,"")),_&&(m.debug+="NDR "),m.frame=!0;var W=j.data;if(N&&W.length>4){var Y=new M.default(W).readSliceType();(Y===2||Y===4||Y===7||Y===9)&&(m.key=!0)}break}case 5:T=!0,m||(m=v.avcSample=r(!0,w.pts,w.dts,"")),_&&(m.debug+="IDR "),m.key=!0,m.frame=!0;break;case 6:{T=!0,_&&m&&(m.debug+="SEI ");var B=new M.default(O(j.data));B.readUByte();for(var R=0,$=0,te=!1,ue=0;!te&&B.bytesAvailable>1;){R=0;do ue=B.readUByte(),R+=ue;while(ue===255);$=0;do ue=B.readUByte(),$+=ue;while(ue===255);if(R===4&&B.bytesAvailable!==0){te=!0;var me=B.readUByte();if(me===181){var Me=B.readUShort();if(Me===49){var Ae=B.readUInt();if(Ae===1195456820){var De=B.readUByte();if(De===3){for(var Fe=B.readUByte(),Ne=B.readUByte(),Ee=31&Fe,se=[Fe,Ne],He=0;He<Ee;He++)se.push(B.readUByte()),se.push(B.readUByte()),se.push(B.readUByte());f(v._txtTrack.samples,{type:3,pts:w.pts,bytes:se})}}}}}else if(R===5&&B.bytesAvailable!==0){if(te=!0,$>16){for(var ft=[],lt=0;lt<16;lt++)ft.push(B.readUByte().toString(16)),(lt===3||lt===5||lt===7||lt===9)&&ft.push("-");for(var it=$-16,ct=new Uint8Array(it),Ve=0;Ve<it;Ve++)ct[Ve]=B.readUByte();f(v._txtTrack.samples,{pts:w.pts,payloadType:R,uuid:ft.join(""),userData:Object(H.utf8ArrayToStr)(ct),userDataBytes:ct})}}else if($<B.bytesAvailable)for(var Je=0;Je<$;Je++)B.readUByte()}break}case 7:if(T=!0,N=!0,_&&m&&(m.debug+="SPS "),!h.sps){var st=new M.default(j.data),gt=st.readSPS();h.width=gt.width,h.height=gt.height,h.pixelRatio=gt.pixelRatio,h.sps=[j.data],h.duration=v._duration;for(var ut=j.data.subarray(1,4),et="avc1.",qe=0;qe<3;qe++){var St=ut[qe].toString(16);St.length<2&&(St="0"+St),et+=St}h.codec=et}break;case 8:T=!0,_&&m&&(m.debug+="PPS "),h.pps||(h.pps=[j.data]);break;case 9:T=!1,h.audFound=!0,m&&s(m,h),m=v.avcSample=r(!1,w.pts,w.dts,_?"AUD ":"");break;case 12:T=!1;break;default:T=!1,m&&(m.debug+="unknown NAL "+j.type+" ");break}if(m&&T){var pt=m.units;pt.push(j)}}),g&&m&&(s(m,h),this.avcSample=null)},E.getLastNalUnit=function(){var w,g=this.avcSample,v;if(!g||g.units.length===0){var h=this._avcTrack.samples;g=h[h.length-1]}if((w=g)!==null&&w!==void 0&&w.units){var o=g.units;v=o[o.length-1]}return v},E.parseAVCNALu=function(w){var g=w.byteLength,v=this._avcTrack,h=v.naluState||0,o=h,_=[],m=0,T,N,j,W=-1,Y=0;for(h===-1&&(W=0,Y=w[0]&31,h=0,m=1);m<g;){if(T=w[m++],!h){h=T?0:1;continue}if(h===1){h=T?0:2;continue}if(!T)h=3;else if(T===1){if(W>=0){var B={data:w.subarray(W,m-h-1),type:Y};_.push(B)}else{var R=this.getLastNalUnit();if(R&&(o&&m<=4-o&&(R.state&&(R.data=R.data.subarray(0,R.data.byteLength-o))),N=m-h-1,N>0)){var $=new Uint8Array(R.data.byteLength+N);$.set(R.data,0),$.set(w.subarray(0,N),R.data.byteLength),R.data=$,R.state=0}}m<g?(j=w[m]&31,W=m,Y=j,h=0):h=-1}else h=0}if(W>=0&&h>=0){var te={data:w.subarray(W,g),type:Y,state:h};_.push(te)}if(_.length===0){var ue=this.getLastNalUnit();if(ue){var me=new Uint8Array(ue.data.byteLength+w.byteLength);me.set(ue.data,0),me.set(w,ue.data.byteLength),ue.data=me}}return v.naluState=h,_},E.parseAACPES=function(w){var g=0,v=this._audioTrack,h=this.aacOverFlow,o=w.data;if(h){this.aacOverFlow=null;var _=h.sample.unit.byteLength,m=Math.min(h.missing,_),T=_-m;h.sample.unit.set(o.subarray(0,m),T),v.samples.push(h.sample),g=h.missing}var N,j;for(N=g,j=o.length;N<j-1&&!V.isHeader(o,N);N++);if(N!==g){var W,Y;if(N<j-1?(W="AAC PES did not start with ADTS header,offset:"+N,Y=!1):(W="no ADTS header found in AAC PES",Y=!0),b.logger.warn("parsing error:"+W),this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:Y,reason:W}),Y)return}V.initTrackConfig(v,this.observer,o,N,this.audioCodec);var B;if(w.pts!==void 0)B=w.pts;else if(h){var R=V.getFrameDuration(v.samplerate);B=h.sample.pts+R}else{b.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var $=0;N<j;)if(V.isHeader(o,N)){if(N+5<j){var te=V.appendFrame(v,o,N,B,$);if(te)if(te.missing)this.aacOverFlow=te;else{N+=te.length,$++;continue}}break}else N++},E.parseMPEGPES=function(w){var g=w.data,v=g.length,h=0,o=0,_=w.pts;if(_===void 0){b.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<v;)if(L.isHeader(g,o)){var m=L.appendFrame(this._audioTrack,g,o,_,h);if(m)o+=m.length,h++;else break}else o++},E.parseID3PES=function(w){if(w.pts===void 0){b.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(w)},S}();c.minProbeByteLength=188;function r(S,E,C,w){return{key:S,frame:!1,pts:E,dts:C,units:[],debug:w,length:0}}function l(S,E){return(S[E+10]&31)<<8|S[E+11]}function u(S,E,C,w){var g={audio:-1,avc:-1,id3:-1,isAAC:!0},v=(S[E+1]&15)<<8|S[E+2],h=E+3+v-4,o=(S[E+10]&15)<<8|S[E+11];for(E+=12+o;E<h;){var _=(S[E+1]&31)<<8|S[E+2];switch(S[E]){case 207:if(!w){b.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:g.audio===-1&&(g.audio=_);break;case 21:g.id3===-1&&(g.id3=_);break;case 219:if(!w){b.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:g.avc===-1&&(g.avc=_);break;case 3:case 4:C?g.audio===-1&&(g.audio=_,g.isAAC=!1):b.logger.log("MPEG audio found, not supported in this browser");break;case 36:b.logger.warn("Unsupported HEVC stream type found");break;default:break}E+=((S[E+3]&15)<<8|S[E+4])+5}return g}function a(S){var E=0,C,w,g,v,h,o=S.data;if(!S||S.size===0)return null;for(;o[0].length<19&&o.length>1;){var _=new Uint8Array(o[0].length+o[1].length);_.set(o[0]),_.set(o[1],o[0].length),o[0]=_,o.splice(1,1)}C=o[0];var m=(C[0]<<16)+(C[1]<<8)+C[2];if(m===1){if(w=(C[4]<<8)+C[5],w&&w>S.size-6)return null;var T=C[7];T&192&&(v=(C[9]&14)*536870912+(C[10]&255)*4194304+(C[11]&254)*16384+(C[12]&255)*128+(C[13]&254)/2,T&64?(h=(C[14]&14)*536870912+(C[15]&255)*4194304+(C[16]&254)*16384+(C[17]&255)*128+(C[18]&254)/2,v-h>60*9e4&&(b.logger.warn(Math.round((v-h)/9e4)+"s delta between PTS and DTS, align them"),v=h)):h=v),g=C[8];var N=g+9;if(S.size<=N)return null;S.size-=N;for(var j=new Uint8Array(S.size),W=0,Y=o.length;W<Y;W++){C=o[W];var B=C.byteLength;if(N)if(N>B){N-=B;continue}else C=C.subarray(N),B-=N,N=0;j.set(C,E),E+=B}return w&&(w-=g+3),{data:j,pts:v,dts:h,len:w}}return null}function s(S,E){if(S.units.length&&S.frame){if(S.pts===void 0){var C=E.samples,w=C.length;if(w){var g=C[w-1];S.pts=g.pts,S.dts=g.dts}else{E.dropped++;return}}E.samples.push(S)}S.debug.length&&b.logger.log(S.pts+"/"+S.dts+":"+S.debug)}function f(S,E){var C=S.length;if(C>0){if(E.pts>=S[C-1].pts)S.push(E);else for(var w=C-1;w>=0;w--)if(E.pts<S[w].pts){S.splice(w,0,E);break}}else S.push(E)}function O(S){for(var E=S.byteLength,C=[],w=1;w<E-2;)S[w]===0&&S[w+1]===0&&S[w+2]===3?(C.push(w+2),w+=2):w++;if(C.length===0)return S;var g=E-C.length,v=new Uint8Array(g),h=0;for(w=0;w<g;h++,w++)h===C[0]&&(h++,C.shift()),v[w]=S[h];return v}X.default=c},"./src/errors.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"ErrorTypes",function(){return V}),P.d(X,"ErrorDetails",function(){return L});var V;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(V||(V={}));var L;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(L||(L={}))},"./src/events.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"Events",function(){return V});var V;(function(L){L.MEDIA_ATTACHING="hlsMediaAttaching",L.MEDIA_ATTACHED="hlsMediaAttached",L.MEDIA_DETACHING="hlsMediaDetaching",L.MEDIA_DETACHED="hlsMediaDetached",L.BUFFER_RESET="hlsBufferReset",L.BUFFER_CODECS="hlsBufferCodecs",L.BUFFER_CREATED="hlsBufferCreated",L.BUFFER_APPENDING="hlsBufferAppending",L.BUFFER_APPENDED="hlsBufferAppended",L.BUFFER_EOS="hlsBufferEos",L.BUFFER_FLUSHING="hlsBufferFlushing",L.BUFFER_FLUSHED="hlsBufferFlushed",L.MANIFEST_LOADING="hlsManifestLoading",L.MANIFEST_LOADED="hlsManifestLoaded",L.MANIFEST_PARSED="hlsManifestParsed",L.LEVEL_SWITCHING="hlsLevelSwitching",L.LEVEL_SWITCHED="hlsLevelSwitched",L.LEVEL_LOADING="hlsLevelLoading",L.LEVEL_LOADED="hlsLevelLoaded",L.LEVEL_UPDATED="hlsLevelUpdated",L.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",L.LEVELS_UPDATED="hlsLevelsUpdated",L.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",L.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",L.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",L.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",L.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",L.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",L.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",L.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",L.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",L.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",L.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",L.CUES_PARSED="hlsCuesParsed",L.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",L.INIT_PTS_FOUND="hlsInitPtsFound",L.FRAG_LOADING="hlsFragLoading",L.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",L.FRAG_LOADED="hlsFragLoaded",L.FRAG_DECRYPTED="hlsFragDecrypted",L.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",L.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",L.FRAG_PARSING_METADATA="hlsFragParsingMetadata",L.FRAG_PARSED="hlsFragParsed",L.FRAG_BUFFERED="hlsFragBuffered",L.FRAG_CHANGED="hlsFragChanged",L.FPS_DROP="hlsFpsDrop",L.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",L.ERROR="hlsError",L.DESTROYING="hlsDestroying",L.KEY_LOADING="hlsKeyLoading",L.KEY_LOADED="hlsKeyLoaded",L.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",L.BACK_BUFFER_REACHED="hlsBackBufferReached"})(V||(V={}))},"./src/hls.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return S});var V=P("./node_modules/url-toolkit/src/url-toolkit.js"),L=P.n(V),M=P("./src/loader/playlist-loader.ts"),H=P("./src/loader/key-loader.ts"),U=P("./src/controller/id3-track-controller.ts"),k=P("./src/controller/latency-controller.ts"),I=P("./src/controller/level-controller.ts"),b=P("./src/controller/fragment-tracker.ts"),y=P("./src/controller/stream-controller.ts"),p=P("./src/is-supported.ts"),c=P("./src/utils/logger.ts"),r=P("./src/config.ts"),l=P("./node_modules/eventemitter3/index.js"),u=P.n(l),a=P("./src/events.ts"),s=P("./src/errors.ts");function f(E,C){for(var w=0;w<C.length;w++){var g=C[w];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}function O(E,C,w){return C&&f(E.prototype,C),w&&f(E,w),E}var S=function(){E.isSupported=function(){return Object(p.isSupported)()};function E(w){w===void 0&&(w={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new l.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var g=this.config=Object(r.mergeConfig)(E.DefaultConfig,w);this.userConfig=w,Object(c.enableLogs)(g.debug),this._autoLevelCapping=-1,g.progressive&&Object(r.enableStreamingMode)(g);var v=g.abrController,h=g.bufferController,o=g.capLevelController,_=g.fpsController,m=this.abrController=new v(this),T=this.bufferController=new h(this),N=this.capLevelController=new o(this),j=new _(this),W=new M.default(this),Y=new H.default(this),B=new U.default(this),R=this.levelController=new I.default(this),$=new b.FragmentTracker(this),te=this.streamController=new y.default(this,$);N.setStreamController(te),j.setStreamController(te);var ue=[R,te];this.networkControllers=ue;var me=[W,Y,m,T,N,j,B,$];this.audioTrackController=this.createController(g.audioTrackController,null,ue),this.createController(g.audioStreamController,$,ue),this.subtitleTrackController=this.createController(g.subtitleTrackController,null,ue),this.createController(g.subtitleStreamController,$,ue),this.createController(g.timelineController,null,me),this.emeController=this.createController(g.emeController,null,me),this.cmcdController=this.createController(g.cmcdController,null,me),this.latencyController=this.createController(k.default,null,me),this.coreComponents=me}var C=E.prototype;return C.createController=function(g,v,h){if(g){var o=v?new g(this,v):new g(this);return h&&h.push(o),o}return null},C.on=function(g,v,h){h===void 0&&(h=this),this._emitter.on(g,v,h)},C.once=function(g,v,h){h===void 0&&(h=this),this._emitter.once(g,v,h)},C.removeAllListeners=function(g){this._emitter.removeAllListeners(g)},C.off=function(g,v,h,o){h===void 0&&(h=this),this._emitter.off(g,v,h,o)},C.listeners=function(g){return this._emitter.listeners(g)},C.emit=function(g,v,h){return this._emitter.emit(g,v,h)},C.trigger=function(g,v){if(this.config.debug)return this.emit(g,g,v);try{return this.emit(g,g,v)}catch(h){c.logger.error("An internal error happened while handling event "+g+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(a.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:g,error:h})}return!1},C.listenerCount=function(g){return this._emitter.listenerCount(g)},C.destroy=function(){c.logger.log("destroy"),this.trigger(a.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(g){return g.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(g){return g.destroy()}),this.coreComponents.length=0},C.attachMedia=function(g){c.logger.log("attachMedia"),this._media=g,this.trigger(a.Events.MEDIA_ATTACHING,{media:g})},C.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},C.loadSource=function(g){this.stopLoad();var v=this.media,h=this.url,o=this.url=V.buildAbsoluteURL(self.location.href,g,{alwaysNormalize:!0});c.logger.log("loadSource:"+o),v&&h&&h!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(v)),this.trigger(a.Events.MANIFEST_LOADING,{url:g})},C.startLoad=function(g){g===void 0&&(g=-1),c.logger.log("startLoad("+g+")"),this.networkControllers.forEach(function(v){v.startLoad(g)})},C.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(g){g.stopLoad()})},C.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},C.recoverMediaError=function(){c.logger.log("recoverMediaError");var g=this._media;this.detachMedia(),g&&this.attachMedia(g)},C.removeLevel=function(g,v){v===void 0&&(v=0),this.levelController.removeLevel(g,v)},O(E,[{key:"levels",get:function(){var g=this.levelController.levels;return g||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(g){c.logger.log("set currentLevel:"+g),this.loadLevel=g,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(g){c.logger.log("set nextLevel:"+g),this.levelController.manualLevel=g,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(g){c.logger.log("set loadLevel:"+g),this.levelController.manualLevel=g}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(g){this.levelController.nextLoadLevel=g}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(g){c.logger.log("set firstLevel:"+g),this.levelController.firstLevel=g}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(g){c.logger.log("set startLevel:"+g),g!==-1&&(g=Math.max(g,this.minAutoLevel)),this.levelController.startLevel=g}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(g){var v=!!g;v!==this.config.capLevelToPlayerSize&&(v?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=v)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(g){this._autoLevelCapping!==g&&(c.logger.log("set autoLevelCapping:"+g),this._autoLevelCapping=g)}},{key:"bandwidthEstimate",get:function(){var g=this.abrController.bwEstimator;return g?g.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var g=this.levels,v=this.config.minAutoBitrate;if(!g)return 0;for(var h=g.length,o=0;o<h;o++)if(g[o].maxBitrate>v)return o;return 0}},{key:"maxAutoLevel",get:function(){var g=this.levels,v=this.autoLevelCapping,h;return v===-1&&g&&g.length?h=g.length-1:h=v,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(g){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,g)}},{key:"audioTracks",get:function(){var g=this.audioTrackController;return g?g.audioTracks:[]}},{key:"audioTrack",get:function(){var g=this.audioTrackController;return g?g.audioTrack:-1},set:function(g){var v=this.audioTrackController;v&&(v.audioTrack=g)}},{key:"subtitleTracks",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTrack:-1},set:function(g){var v=this.subtitleTrackController;v&&(v.subtitleTrack=g)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var g=this.subtitleTrackController;return g?g.subtitleDisplay:!1},set:function(g){var v=this.subtitleTrackController;v&&(v.subtitleDisplay=g)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(g){this.config.lowLatencyMode=g}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return a.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return E.defaultConfig?E.defaultConfig:r.hlsDefaultConfig},set:function(g){E.defaultConfig=g}}]),E}();S.defaultConfig=void 0},"./src/is-supported.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"isSupported",function(){return M}),P.d(X,"changeTypeSupported",function(){return H});var V=P("./src/utils/mediasource-helper.ts");function L(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var U=Object(V.getMediaSource)();if(!U)return!1;var k=L(),I=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!k||k.prototype&&typeof k.prototype.appendBuffer=="function"&&typeof k.prototype.remove=="function";return!!I&&!!b}function H(){var U,k=L();return typeof(k==null||((U=k.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c}),P.d(X,"LoadError",function(){return l});var V=P("./src/polyfills/number.ts"),L=P("./src/errors.ts");function M(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,b(u,a)}function H(u){var a=typeof Map=="function"?new Map:void 0;return H=function(f){if(f===null||!I(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(f))return a.get(f);a.set(f,O)}function O(){return U(f,arguments,y(this).constructor)}return O.prototype=Object.create(f.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),b(O,f)},H(u)}function U(u,a,s){return k()?U=Reflect.construct:U=function(O,S,E){var C=[null];C.push.apply(C,S);var w=Function.bind.apply(O,C),g=new w;return E&&b(g,E.prototype),g},U.apply(null,arguments)}function k(){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 I(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function b(u,a){return b=Object.setPrototypeOf||function(f,O){return f.__proto__=O,f},b(u,a)}function y(u){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},y(u)}var p=Math.pow(2,17),c=function(){function u(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var a=u.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(f,O){var S=this,E=f.url;if(!E)return Promise.reject(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,networkDetails:null},"Fragment does not have a "+(E?"part list":"url")));this.abort();var C=this.config,w=C.fLoader,g=C.loader;return new Promise(function(v,h){S.loader&&S.loader.destroy();var o=S.loader=f.loader=w?new w(C):new g(C),_=r(f),m={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:p};f.stats=o.stats,o.load(_,m,{onSuccess:function(N,j,W,Y){S.resetLoader(f,o),v({frag:f,part:null,payload:N.data,networkDetails:Y})},onError:function(N,j,W){S.resetLoader(f,o),h(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,response:N,networkDetails:W}))},onAbort:function(N,j,W){S.resetLoader(f,o),h(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,networkDetails:W}))},onTimeout:function(N,j,W){S.resetLoader(f,o),h(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,networkDetails:W}))},onProgress:function(N,j,W,Y){O&&O({frag:f,part:null,payload:W,networkDetails:Y})}})})},a.loadPart=function(f,O,S){var E=this;this.abort();var C=this.config,w=C.fLoader,g=C.loader;return new Promise(function(v,h){E.loader&&E.loader.destroy();var o=E.loader=f.loader=w?new w(C):new g(C),_=r(f,O),m={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:p};O.stats=o.stats,o.load(_,m,{onSuccess:function(N,j,W,Y){E.resetLoader(f,o),E.updateStatsFromPart(f,O);var B={frag:f,part:O,payload:N.data,networkDetails:Y};S(B),v(B)},onError:function(N,j,W){E.resetLoader(f,o),h(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,part:O,response:N,networkDetails:W}))},onAbort:function(N,j,W){f.stats.aborted=O.stats.aborted,E.resetLoader(f,o),h(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,part:O,networkDetails:W}))},onTimeout:function(N,j,W){E.resetLoader(f,o),h(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,part:O,networkDetails:W}))}})})},a.updateStatsFromPart=function(f,O){var S=f.stats,E=O.stats,C=E.total;if(S.loaded+=E.loaded,C){var w=Math.round(f.duration/O.duration),g=Math.min(Math.round(S.loaded/C),w),v=w-g,h=v*Math.round(S.loaded/g);S.total=S.loaded+h}else S.total=Math.max(S.loaded,S.total);var o=S.loading,_=E.loading;o.start?o.first+=_.first-_.start:(o.start=_.start,o.first=_.first),o.end=_.end},a.resetLoader=function(f,O){f.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},u}();function r(u,a){a===void 0&&(a=null);var s=a||u,f={frag:u,part:a,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},O=s.byteRangeStartOffset,S=s.byteRangeEndOffset;return Object(V.isFiniteNumber)(O)&&Object(V.isFiniteNumber)(S)&&(f.rangeStart=O,f.rangeEnd=S),f}var l=function(u){M(a,u);function a(s){for(var f,O=arguments.length,S=new Array(O>1?O-1:0),E=1;E<O;E++)S[E-1]=arguments[E];return f=u.call.apply(u,[this].concat(S))||this,f.data=void 0,f.data=s,f}return a}(H(Error))},"./src/loader/fragment.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"ElementaryStreamTypes",function(){return c}),P.d(X,"BaseSegment",function(){return r}),P.d(X,"Fragment",function(){return l}),P.d(X,"Part",function(){return u});var V=P("./src/polyfills/number.ts"),L=P("./node_modules/url-toolkit/src/url-toolkit.js"),M=P.n(L),H=P("./src/utils/logger.ts"),U=P("./src/loader/level-key.ts"),k=P("./src/loader/load-stats.ts");function I(a,s){a.prototype=Object.create(s.prototype),a.prototype.constructor=a,b(a,s)}function b(a,s){return b=Object.setPrototypeOf||function(O,S){return O.__proto__=S,O},b(a,s)}function y(a,s){for(var f=0;f<s.length;f++){var O=s[f];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(a,O.key,O)}}function p(a,s,f){return s&&y(a.prototype,s),f&&y(a,f),a}var c;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(c||(c={}));var r=function(){function a(f){var O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[c.AUDIO]=null,O[c.VIDEO]=null,O[c.AUDIOVIDEO]=null,O),this.baseurl=f}var s=a.prototype;return s.setByteRange=function(O,S){var E=O.split("@",2),C=[];E.length===1?C[0]=S?S.byteRangeEndOffset:0:C[0]=parseInt(E[1]),C[1]=parseInt(E[0])+C[0],this._byteRange=C},p(a,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(L.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(O){this._url=O}}]),a}(),l=function(a){I(s,a);function s(O,S){var E;return E=a.call(this,S)||this,E._decryptdata=null,E.rawProgramDateTime=null,E.programDateTime=null,E.tagList=[],E.duration=0,E.sn=0,E.levelkey=void 0,E.type=void 0,E.loader=null,E.level=-1,E.cc=0,E.startPTS=void 0,E.endPTS=void 0,E.appendedPTS=void 0,E.startDTS=void 0,E.endDTS=void 0,E.start=0,E.deltaPTS=void 0,E.maxStartPTS=void 0,E.minEndPTS=void 0,E.stats=new k.LoadStats,E.urlId=0,E.data=void 0,E.bitrateTest=!1,E.title=null,E.initSegment=null,E.type=O,E}var f=s.prototype;return f.createInitializationVector=function(S){for(var E=new Uint8Array(16),C=12;C<16;C++)E[C]=S>>8*(15-C)&255;return E},f.setDecryptDataFromLevelKey=function(S,E){var C=S;return(S==null?void 0:S.method)==="AES-128"&&S.uri&&!S.iv&&(C=U.LevelKey.fromURI(S.uri),C.method=S.method,C.iv=this.createInitializationVector(E),C.keyFormat="identity"),C},f.setElementaryStreamInfo=function(S,E,C,w,g,v){v===void 0&&(v=!1);var h=this.elementaryStreams,o=h[S];if(!o){h[S]={startPTS:E,endPTS:C,startDTS:w,endDTS:g,partial:v};return}o.startPTS=Math.min(o.startPTS,E),o.endPTS=Math.max(o.endPTS,C),o.startDTS=Math.min(o.startDTS,w),o.endDTS=Math.max(o.endDTS,g)},f.clearElementaryStreamInfo=function(){var S=this.elementaryStreams;S[c.AUDIO]=null,S[c.VIDEO]=null,S[c.AUDIOVIDEO]=null},p(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var S=this.sn;typeof S!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),S=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,S)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(V.isFiniteNumber)(this.programDateTime))return null;var S=Object(V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+S*1e3}},{key:"encrypted",get:function(){var S;return!!((S=this.decryptdata)!==null&&S!==void 0&&S.keyFormat&&this.decryptdata.uri)}}]),s}(r),u=function(a){I(s,a);function s(f,O,S,E,C){var w;w=a.call(this,S)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new k.LoadStats,w.duration=f.decimalFloatingPoint("DURATION"),w.gap=f.bool("GAP"),w.independent=f.bool("INDEPENDENT"),w.relurl=f.enumeratedString("URI"),w.fragment=O,w.index=E;var g=f.enumeratedString("BYTERANGE");return g&&w.setByteRange(g,C),C&&(w.fragOffset=C.fragOffset+C.duration),w}return p(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),s}(r)},"./src/loader/key-loader.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return H});var V=P("./src/events.ts"),L=P("./src/errors.ts"),M=P("./src/utils/logger.ts"),H=function(){function U(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var k=U.prototype;return k._registerListeners=function(){this.hls.on(V.Events.KEY_LOADING,this.onKeyLoading,this)},k._unregisterListeners=function(){this.hls.off(V.Events.KEY_LOADING,this.onKeyLoading)},k.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var y=this.loaders[b];y&&y.destroy()}this.loaders={}},k.onKeyLoading=function(b,y){var p=y.frag,c=p.type,r=this.loaders[c];if(!p.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=p.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var u=this.hls.config;if(r&&(M.logger.warn("abort previous key loader for type:"+c),r.abort()),!l){M.logger.warn("key uri is falsy");return}var a=u.loader,s=p.loader=this.loaders[c]=new a(u);this.decrypturl=l,this.decryptkey=null;var f={url:l,frag:p,responseType:"arraybuffer"},O={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(f,O,S)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:p}))},k.loadsuccess=function(b,y,p){var c=p.frag;if(!c.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(b.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:c})},k.loaderror=function(b,y){var p=y.frag,c=p.loader;c&&c.abort(),delete this.loaders[p.type],this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:b})},k.loadtimeout=function(b,y){var p=y.frag,c=p.loader;c&&c.abort(),delete this.loaders[p.type],this.hls.trigger(V.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},U}()},"./src/loader/level-details.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"LevelDetails",function(){return U});var V=P("./src/polyfills/number.ts");function L(k,I){for(var b=0;b<I.length;b++){var y=I[b];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(k,y.key,y)}}function M(k,I,b){return I&&L(k.prototype,I),b&&L(k,b),k}var H=10,U=function(){function k(b){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=b}var I=k.prototype;return I.reloaded=function(y){if(!y){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-y.lastPartSn,c=this.lastPartIndex-y.lastPartIndex;this.updated=this.endSN!==y.endSN||!!c||!!p,this.advanced=this.endSN>y.endSN||p>0||p===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(y.misses*.6):this.misses=y.misses+1,this.availabilityDelay=y.availabilityDelay},M(k,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(V.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var y=this.driftEndTime-this.driftStartTime;if(y>0){var p=this.driftEnd-this.driftStart;return p*1e3/y}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var y;return(y=this.fragments)!==null&&y!==void 0&&y.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 y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),k}()},"./src/loader/level-key.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"LevelKey",function(){return U});var V=P("./node_modules/url-toolkit/src/url-toolkit.js"),L=P.n(V);function M(k,I){for(var b=0;b<I.length;b++){var y=I[b];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(k,y.key,y)}}function H(k,I,b){return I&&M(k.prototype,I),b&&M(k,b),k}var U=function(){k.fromURL=function(b,y){return new k(b,y)},k.fromURI=function(b){return new k(b)};function k(I,b){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,b?this._uri=Object(V.buildAbsoluteURL)(I,b,{alwaysNormalize:!0}):this._uri=I}return H(k,[{key:"uri",get:function(){return this._uri}}]),k}()},"./src/loader/load-stats.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"LoadStats",function(){return V});var V=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(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return s});var V=P("./src/polyfills/number.ts"),L=P("./node_modules/url-toolkit/src/url-toolkit.js"),M=P.n(L),H=P("./src/loader/fragment.ts"),U=P("./src/loader/level-details.ts"),k=P("./src/loader/level-key.ts"),I=P("./src/utils/attr-list.ts"),b=P("./src/utils/logger.ts"),y=P("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,c=/#EXT-X-MEDIA:(.*)/g,r=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),l=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),u=/\.(mp4|m4s|m4v|m4a)$/i;function a(C){var w,g;return u.test((w=(g=L.parseURL(C))===null||g===void 0?void 0:g.path)!=null?w:"")}var s=function(){function C(){}return C.findGroup=function(g,v){for(var h=0;h<g.length;h++){var o=g[h];if(o.id===v)return o}},C.convertAVC1ToAVCOTI=function(g){var v=g.split(".");if(v.length>2){var h=v.shift()+".";return h+=parseInt(v.shift()).toString(16),h+=("000"+parseInt(v.shift()).toString(16)).substr(-4),h}return g},C.resolve=function(g,v){return L.buildAbsoluteURL(v,g,{alwaysNormalize:!0})},C.parseMasterPlaylist=function(g,v){var h=[],o={},_=!1;p.lastIndex=0;for(var m;(m=p.exec(g))!=null;)if(m[1]){var T=new I.AttrList(m[1]),N={attrs:T,bitrate:T.decimalInteger("AVERAGE-BANDWIDTH")||T.decimalInteger("BANDWIDTH"),name:T.NAME,url:C.resolve(m[2],v)},j=T.decimalResolution("RESOLUTION");j&&(N.width=j.width,N.height=j.height),f((T.CODECS||"").split(/[ ,]+/).filter(function(Y){return Y}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=C.convertAVC1ToAVCOTI(N.videoCodec)),h.push(N)}else if(m[3]){var W=new I.AttrList(m[3]);W["DATA-ID"]&&(_=!0,o[W["DATA-ID"]]=W)}return{levels:h,sessionData:_?o:null}},C.parseMasterPlaylistMedia=function(g,v,h,o){o===void 0&&(o=[]);var _,m=[],T=0;for(c.lastIndex=0;(_=c.exec(g))!==null;){var N=new I.AttrList(_[1]);if(N.TYPE===h){var j={attrs:N,bitrate:0,id:T++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:h,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?C.resolve(N.URI,v):""};if(o.length){var W=C.findGroup(o,j.groupId)||o[0];O(j,W,"audioCodec"),O(j,W,"textCodec")}m.push(j)}}return m},C.parseLevelPlaylist=function(g,v,h,o,_){var m=new U.LevelDetails(v),T=m.fragments,N=null,j=0,W=0,Y=0,B=0,R=null,$=new H.Fragment(o,v),te,ue,me,Me=-1,Ae=!1;for(r.lastIndex=0,m.m3u8=g;(te=r.exec(g))!==null;){Ae&&(Ae=!1,$=new H.Fragment(o,v),$.start=Y,$.sn=j,$.cc=B,$.level=h,N&&($.initSegment=N,$.rawProgramDateTime=N.rawProgramDateTime));var De=te[1];if(De){$.duration=parseFloat(De);var Fe=(" "+te[2]).slice(1);$.title=Fe||null,$.tagList.push(Fe?["INF",De,Fe]:["INF",De])}else if(te[3])Object(V.isFiniteNumber)($.duration)&&($.start=Y,me&&($.levelkey=me),$.sn=j,$.level=h,$.cc=B,$.urlId=_,T.push($),$.relurl=(" "+te[3]).slice(1),E($,R),R=$,Y+=$.duration,j++,W=0,Ae=!0);else if(te[4]){var Ne=(" "+te[4]).slice(1);R?$.setByteRange(Ne,R):$.setByteRange(Ne)}else if(te[5])$.rawProgramDateTime=(" "+te[5]).slice(1),$.tagList.push(["PROGRAM-DATE-TIME",$.rawProgramDateTime]),Me===-1&&(Me=T.length);else{if(te=te[0].match(l),!te){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(ue=1;ue<te.length&&!(typeof te[ue]!="undefined");ue++);var Ee=(" "+te[ue]).slice(1),se=(" "+te[ue+1]).slice(1),He=te[ue+2]?(" "+te[ue+2]).slice(1):"";switch(Ee){case"PLAYLIST-TYPE":m.type=se.toUpperCase();break;case"MEDIA-SEQUENCE":j=m.startSN=parseInt(se);break;case"SKIP":{var ft=new I.AttrList(se),lt=ft.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(lt)){m.skippedSegments=lt;for(var it=lt;it--;)T.unshift(null);j+=lt}var ct=ft.enumeratedString("RECENTLY-REMOVED-DATERANGES");ct&&(m.recentlyRemovedDateranges=ct.split(" "));break}case"TARGETDURATION":m.targetduration=parseFloat(se);break;case"VERSION":m.version=parseInt(se);break;case"EXTM3U":break;case"ENDLIST":m.live=!1;break;case"#":(se||He)&&$.tagList.push(He?[se,He]:[se]);break;case"DIS":B++;case"GAP":$.tagList.push([Ee]);break;case"BITRATE":$.tagList.push([Ee,se]);break;case"DISCONTINUITY-SEQ":B=parseInt(se);break;case"KEY":{var Ve,Je=new I.AttrList(se),st=Je.enumeratedString("METHOD"),gt=Je.URI,ut=Je.hexadecimalInteger("IV"),et=Je.enumeratedString("KEYFORMATVERSIONS"),qe=Je.enumeratedString("KEYID"),St=(Ve=Je.enumeratedString("KEYFORMAT"))!=null?Ve:"identity",pt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(pt.indexOf(St)>-1){b.logger.warn("Keyformat "+St+" is not supported from the manifest");continue}else if(St!=="identity")continue;st&&(me=k.LevelKey.fromURL(v,gt),gt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(st)>=0&&(me.method=st,me.keyFormat=St,qe&&(me.keyID=qe),et&&(me.keyFormatVersions=et),me.iv=ut));break}case"START":{var nt=new I.AttrList(se),at=nt.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(at)&&(m.startTimeOffset=at);break}case"MAP":{var bt=new I.AttrList(se);$.relurl=bt.URI,bt.BYTERANGE&&$.setByteRange(bt.BYTERANGE),$.level=h,$.sn="initSegment",me&&($.levelkey=me),$.initSegment=null,N=$,Ae=!0;break}case"SERVER-CONTROL":{var Et=new I.AttrList(se);m.canBlockReload=Et.bool("CAN-BLOCK-RELOAD"),m.canSkipUntil=Et.optionalFloat("CAN-SKIP-UNTIL",0),m.canSkipDateRanges=m.canSkipUntil>0&&Et.bool("CAN-SKIP-DATERANGES"),m.partHoldBack=Et.optionalFloat("PART-HOLD-BACK",0),m.holdBack=Et.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Re=new I.AttrList(se);m.partTarget=Re.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Te=m.partList;Te||(Te=m.partList=[]);var Ke=W>0?Te[Te.length-1]:void 0,ze=W++,Ce=new H.Part(new I.AttrList(se),$,v,ze,Ke);Te.push(Ce),$.duration+=Ce.duration;break}case"PRELOAD-HINT":{var We=new I.AttrList(se);m.preloadHint=We;break}case"RENDITION-REPORT":{var ve=new I.AttrList(se);m.renditionReports=m.renditionReports||[],m.renditionReports.push(ve);break}default:b.logger.warn("line parsed but not handled: "+te);break}}}R&&!R.relurl?(T.pop(),Y-=R.duration,m.partList&&(m.fragmentHint=R)):m.partList&&(E($,R),$.cc=B,m.fragmentHint=$);var ce=T.length,he=T[0],ne=T[ce-1];if(Y+=m.skippedSegments*m.targetduration,Y>0&&ce&&ne){m.averagetargetduration=Y/ce;var oe=ne.sn;m.endSN=oe!=="initSegment"?oe:0,he&&(m.startCC=he.cc,he.initSegment||m.fragments.every(function(le){return le.relurl&&a(le.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),$=new H.Fragment(o,v),$.relurl=ne.relurl,$.level=h,$.sn="initSegment",he.initSegment=$,m.needSidxRanges=!0))}else m.endSN=0,m.startCC=0;return m.fragmentHint&&(Y+=m.fragmentHint.duration),m.totalduration=Y,m.endCC=B,Me>0&&S(T,Me),m},C}();function f(C,w){["video","audio","text"].forEach(function(g){var v=C.filter(function(o){return Object(y.isCodecType)(o,g)});if(v.length){var h=v.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});w[g+"Codec"]=h.length>0?h[0]:v[0],C=C.filter(function(o){return v.indexOf(o)===-1})}}),w.unknownCodecs=C}function O(C,w,g){var v=w[g];v&&(C[g]=v)}function S(C,w){for(var g=C[w],v=w;v--;){var h=C[v];if(!h)return;h.programDateTime=g.programDateTime-h.duration*1e3,g=h}}function E(C,w){C.rawProgramDateTime?C.programDateTime=Date.parse(C.rawProgramDateTime):w!=null&&w.programDateTime&&(C.programDateTime=w.endProgramDateTime),Object(V.isFiniteNumber)(C.programDateTime)||(C.programDateTime=null,C.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),L=P("./src/events.ts"),M=P("./src/errors.ts"),H=P("./src/utils/logger.ts"),U=P("./src/utils/mp4-tools.ts"),k=P("./src/loader/m3u8-parser.ts"),I=P("./src/types/loader.ts"),b=P("./src/utils/attr-list.ts");function y(r){var l=r.type;switch(l){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function p(r,l){var u=r.url;return(u===void 0||u.indexOf("data:")===0)&&(u=l.url),u}var c=function(){function r(u){this.hls=void 0,this.loaders=Object.create(null),this.hls=u,this.registerListeners()}var l=r.prototype;return l.registerListeners=function(){var a=this.hls;a.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var a=this.hls;a.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(a){var s=this.hls.config,f=s.pLoader,O=s.loader,S=f||O,E=new S(s);return a.loader=E,this.loaders[a.type]=E,E},l.getInternalLoader=function(a){return this.loaders[a.type]},l.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},l.destroyInternalLoaders=function(){for(var a in this.loaders){var s=this.loaders[a];s&&s.destroy(),this.resetInternalLoader(a)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(a,s){var f=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:f,deliveryDirectives:null})},l.onLevelLoading=function(a,s){var f=s.id,O=s.level,S=s.url,E=s.deliveryDirectives;this.load({id:f,groupId:null,level:O,responseType:"text",type:I.PlaylistContextType.LEVEL,url:S,deliveryDirectives:E})},l.onAudioTrackLoading=function(a,s){var f=s.id,O=s.groupId,S=s.url,E=s.deliveryDirectives;this.load({id:f,groupId:O,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:S,deliveryDirectives:E})},l.onSubtitleTrackLoading=function(a,s){var f=s.id,O=s.groupId,S=s.url,E=s.deliveryDirectives;this.load({id:f,groupId:O,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:S,deliveryDirectives:E})},l.load=function(a){var s,f=this.hls.config,O=this.getInternalLoader(a);if(O){var S=O.context;if(S&&S.url===a.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),O.abort()}var E,C,w,g;switch(a.type){case I.PlaylistContextType.MANIFEST:E=f.manifestLoadingMaxRetry,C=f.manifestLoadingTimeOut,w=f.manifestLoadingRetryDelay,g=f.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:E=0,C=f.levelLoadingTimeOut;break;default:E=f.levelLoadingMaxRetry,C=f.levelLoadingTimeOut,w=f.levelLoadingRetryDelay,g=f.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(a),(s=a.deliveryDirectives)!==null&&s!==void 0&&s.part){var v;if(a.type===I.PlaylistContextType.LEVEL&&a.level!==null?v=this.hls.levels[a.level].details:a.type===I.PlaylistContextType.AUDIO_TRACK&&a.id!==null?v=this.hls.audioTracks[a.id].details:a.type===I.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(v=this.hls.subtitleTracks[a.id].details),v){var h=v.partTarget,o=v.targetduration;h&&o&&(C=Math.min(Math.max(h*3,o*.8)*1e3,C))}}var _={timeout:C,maxRetry:E,retryDelay:w,maxRetryDelay:g,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(a,_,m)},l.loadsuccess=function(a,s,f,O){if(O===void 0&&(O=null),f.isSidxRequest){this.handleSidxRequest(a,f),this.handlePlaylistLoaded(a,s,f,O);return}this.resetInternalLoader(f.type);var S=a.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,f,"no EXTM3U delimiter",O);return}s.parsing.start=performance.now(),S.indexOf("#EXTINF:")>0||S.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,s,f,O):this.handleMasterPlaylist(a,s,f,O)},l.loaderror=function(a,s,f){f===void 0&&(f=null),this.handleNetworkError(s,f,!1,a)},l.loadtimeout=function(a,s,f){f===void 0&&(f=null),this.handleNetworkError(s,f,!0)},l.handleMasterPlaylist=function(a,s,f,O){var S=this.hls,E=a.data,C=p(a,f),w=k.default.parseMasterPlaylist(E,C),g=w.levels,v=w.sessionData;if(!g.length){this.handleManifestParsingError(a,f,"no level found in manifest",O);return}var h=g.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),o=g.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),_=k.default.parseMasterPlaylistMedia(E,C,"AUDIO",h),m=k.default.parseMasterPlaylistMedia(E,C,"SUBTITLES",o),T=k.default.parseMasterPlaylistMedia(E,C,"CLOSED-CAPTIONS");if(_.length){var N=_.some(function(j){return!j.url});!N&&g[0].audioCodec&&!g[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new b.AttrList({}),bitrate:0,url:""}))}S.trigger(L.Events.MANIFEST_LOADED,{levels:g,audioTracks:_,subtitles:m,captions:T,url:C,stats:s,networkDetails:O,sessionData:v})},l.handleTrackOrLevelPlaylist=function(a,s,f,O){var S=this.hls,E=f.id,C=f.level,w=f.type,g=p(a,f),v=Object(V.isFiniteNumber)(E)?E:0,h=Object(V.isFiniteNumber)(C)?C:v,o=y(f),_=k.default.parseLevelPlaylist(a.data,g,h,o,v);if(!_.fragments.length){S.trigger(L.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:typeof f.level=="number"?f.level:void 0});return}if(w===I.PlaylistContextType.MANIFEST){var m={attrs:new b.AttrList({}),bitrate:0,details:_,name:"",url:g};S.trigger(L.Events.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:g,stats:s,networkDetails:O,sessionData:null})}if(s.parsing.end=performance.now(),_.needSidxRanges){var T,N=(T=_.fragments[0].initSegment)===null||T===void 0?void 0:T.url;this.load({url:N,isSidxRequest:!0,type:w,level:C,levelDetails:_,id:E,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}f.levelDetails=_,this.handlePlaylistLoaded(a,s,f,O)},l.handleSidxRequest=function(a,s){var f=Object(U.parseSegmentIndex)(new Uint8Array(a.data));if(!f)return;var O=f.references,S=s.levelDetails;O.forEach(function(E,C){var w=E.info,g=S.fragments[C];g.byteRange.length===0&&g.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),g.initSegment&&g.initSegment.setByteRange(String(f.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(a,s,f,O){this.hls.trigger(L.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===I.PlaylistContextType.MANIFEST,url:a.url,reason:f,response:a,context:s,networkDetails:O})},l.handleNetworkError=function(a,s,f,O){f===void 0&&(f=!1),H.logger.warn("[playlist-loader]: A network "+(f?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var S=M.ErrorDetails.UNKNOWN,E=!1,C=this.getInternalLoader(a);switch(a.type){case I.PlaylistContextType.MANIFEST:S=f?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,E=!0;break;case I.PlaylistContextType.LEVEL:S=f?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,E=!1;break;case I.PlaylistContextType.AUDIO_TRACK:S=f?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,E=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:S=f?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,E=!1;break}C&&this.resetInternalLoader(a.type);var w={type:M.ErrorTypes.NETWORK_ERROR,details:S,fatal:E,url:a.url,loader:C,context:a,networkDetails:s};O&&(w.response=O),this.hls.trigger(L.Events.ERROR,w)},l.handlePlaylistLoaded=function(a,s,f,O){var S=f.type,E=f.level,C=f.id,w=f.groupId,g=f.loader,v=f.levelDetails,h=f.deliveryDirectives;if(!(v!=null&&v.targetduration)){this.handleManifestParsingError(a,f,"invalid target duration",O);return}if(!g)return;v.live&&(g.getCacheAge&&(v.ageHeader=g.getCacheAge()||0),(!g.getCacheAge||isNaN(v.ageHeader))&&(v.ageHeader=0));switch(S){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(L.Events.LEVEL_LOADED,{details:v,level:E||0,id:C||0,stats:s,networkDetails:O,deliveryDirectives:h});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(L.Events.AUDIO_TRACK_LOADED,{details:v,id:C||0,groupId:w||"",stats:s,networkDetails:O,deliveryDirectives:h});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADED,{details:v,id:C||0,groupId:w||"",stats:s,networkDetails:O,deliveryDirectives:h});break}},r}();X.default=c},"./src/polyfills/number.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"isFiniteNumber",function(){return V}),P.d(X,"MAX_SAFE_INTEGER",function(){return L});var V=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},L=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ae,X,P){"use strict";P.r(X);var V=function(){function L(){}return L.getSilentFrame=function(H,U){switch(H){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===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(U===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(U===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(U===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(U===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},L}();X.default=V},"./src/remux/mp4-generator.ts":function(ae,X,P){"use strict";P.r(X);var V=Math.pow(2,32)-1,L=function(){function M(){}return M.init=function(){M.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var U;for(U in M.types)M.types.hasOwnProperty(U)&&(M.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var k=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]),I=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:k,audio:I};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),y=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=y,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,p,r,p,c),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,b))},M.box=function(U){for(var k=8,I=arguments.length,b=new Array(I>1?I-1:0),y=1;y<I;y++)b[y-1]=arguments[y];for(var p=b.length,c=p;p--;)k+=b[p].byteLength;var r=new Uint8Array(k);for(r[0]=k>>24&255,r[1]=k>>16&255,r[2]=k>>8&255,r[3]=k&255,r.set(U,4),p=0,k=8;p<c;p++)r.set(b[p],k),k+=b[p].byteLength;return r},M.hdlr=function(U){return M.box(M.types.hdlr,M.HDLR_TYPES[U])},M.mdat=function(U){return M.box(M.types.mdat,U)},M.mdhd=function(U,k){k*=U;var I=Math.floor(k/(V+1)),b=Math.floor(k%(V+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,I>>24,I>>16&255,I>>8&255,I&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},M.mdia=function(U){return M.box(M.types.mdia,M.mdhd(U.timescale,U.duration),M.hdlr(U.type),M.minf(U))},M.mfhd=function(U){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},M.minf=function(U){return U.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(U)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(U))},M.moof=function(U,k,I){return M.box(M.types.moof,M.mfhd(U),M.traf(I,k))},M.moov=function(U){for(var k=U.length,I=[];k--;)I[k]=M.trak(U[k]);return M.box.apply(null,[M.types.moov,M.mvhd(U[0].timescale,U[0].duration)].concat(I).concat(M.mvex(U)))},M.mvex=function(U){for(var k=U.length,I=[];k--;)I[k]=M.trex(U[k]);return M.box.apply(null,[M.types.mvex].concat(I))},M.mvhd=function(U,k){k*=U;var I=Math.floor(k/(V+1)),b=Math.floor(k%(V+1)),y=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,I>>24,I>>16&255,I>>8&255,I&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,y)},M.sdtp=function(U){var k=U.samples||[],I=new Uint8Array(4+k.length),b,y;for(b=0;b<k.length;b++)y=k[b].flags,I[b+4]=y.dependsOn<<4|y.isDependedOn<<2|y.hasRedundancy;return M.box(M.types.sdtp,I)},M.stbl=function(U){return M.box(M.types.stbl,M.stsd(U),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(U){var k=[],I=[],b,y,p;for(b=0;b<U.sps.length;b++)y=U.sps[b],p=y.byteLength,k.push(p>>>8&255),k.push(p&255),k=k.concat(Array.prototype.slice.call(y));for(b=0;b<U.pps.length;b++)y=U.pps[b],p=y.byteLength,I.push(p>>>8&255),I.push(p&255),I=I.concat(Array.prototype.slice.call(y));var c=M.box(M.types.avcC,new Uint8Array([1,k[3],k[4],k[5],252|3,224|U.sps.length].concat(k).concat([U.pps.length]).concat(I))),r=U.width,l=U.height,u=U.pixelRatio[0],a=U.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r>>8&255,r&255,l>>8&255,l&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]),c,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,a>>24,a>>16&255,a>>8&255,a&255])))},M.esds=function(U){var k=U.config.length;return new Uint8Array([0,0,0,0,3,23+k,0,1,0,4,15+k,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([k]).concat(U.config).concat([6,1,2]))},M.mp4a=function(U){var k=U.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]),M.box(M.types.esds,M.esds(U)))},M.mp3=function(U){var k=U.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]))},M.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(U)):M.box(M.types.stsd,M.STSD,M.mp4a(U)):M.box(M.types.stsd,M.STSD,M.avc1(U))},M.tkhd=function(U){var k=U.id,I=U.duration*U.timescale,b=U.width,y=U.height,p=Math.floor(I/(V+1)),c=Math.floor(I%(V+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&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,b>>8&255,b&255,0,0,y>>8&255,y&255,0,0]))},M.traf=function(U,k){var I=M.sdtp(U),b=U.id,y=Math.floor(k/(V+1)),p=Math.floor(k%(V+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,y>>24,y>>16&255,y>>8&255,y&255,p>>24,p>>16&255,p>>8&255,p&255])),M.trun(U,I.length+16+20+8+16+8+8),I)},M.trak=function(U){return U.duration=U.duration||4294967295,M.box(M.types.trak,M.tkhd(U),M.mdia(U))},M.trex=function(U){var k=U.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(U,k){var I=U.samples||[],b=I.length,y=12+16*b,p=new Uint8Array(y),c,r,l,u,a,s;for(k+=8+y,p.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255],0),c=0;c<b;c++)r=I[c],l=r.duration,u=r.size,a=r.flags,s=r.cts,p.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*c);return M.box(M.types.trun,p)},M.initSegment=function(U){M.types||M.init();var k=M.moov(U),I=new Uint8Array(M.FTYP.byteLength+k.byteLength);return I.set(M.FTYP),I.set(k,M.FTYP.byteLength),I},M}();L.types=void 0,L.HDLR_TYPES=void 0,L.STTS=void 0,L.STSC=void 0,L.STCO=void 0,L.STSZ=void 0,L.VMHD=void 0,L.SMHD=void 0,L.STSD=void 0,L.FTYP=void 0,L.DINF=void 0,X.default=L},"./src/remux/mp4-remuxer.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return s}),P.d(X,"normalizePts",function(){return f});var V=P("./src/polyfills/number.ts"),L=P("./src/remux/aac-helper.ts"),M=P("./src/remux/mp4-generator.ts"),H=P("./src/events.ts"),U=P("./src/errors.ts"),k=P("./src/utils/logger.ts"),I=P("./src/types/loader.ts"),b=P("./src/utils/timescale-conversion.ts");function y(){return y=Object.assign||function(C){for(var w=1;w<arguments.length;w++){var g=arguments[w];for(var v in g)Object.prototype.hasOwnProperty.call(g,v)&&(C[v]=g[v])}return C},y.apply(this,arguments)}var p=10*1e3,c=1024,r=1152,l=null,u=null,a=!1,s=function(){function C(g,v,h,o){if(o===void 0&&(o=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=g,this.config=v,this.typeSupported=h,this.ISGenerated=!1,l===null){var _=navigator.userAgent||"",m=_.match(/Chrome\/(\d+)/i);l=m?parseInt(m[1]):0}if(u===null){var T=navigator.userAgent.match(/Safari\/(\d+)/i);u=T?parseInt(T[1]):0}a=!!l&&l<75||!!u&&u<600}var w=C.prototype;return w.destroy=function(){},w.resetTimeStamp=function(v){k.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=v},w.resetNextTimestamp=function(){k.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},w.resetInitSegment=function(){k.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},w.getVideoStartPts=function(v){var h=!1,o=v.reduce(function(_,m){var T=m.pts-_;return T<-4294967296?(h=!0,f(_,m.pts)):T>0?_:m.pts},v[0].pts);return h&&k.logger.debug("PTS rollover detected"),o},w.remux=function(v,h,o,_,m,T,N,j){var W,Y,B,R,$,te,ue=m,me=m,Me=v.pid>-1,Ae=h.pid>-1,De=h.samples.length,Fe=v.samples.length>0,Ne=De>1,Ee=(!Me||Fe)&&(!Ae||Ne)||this.ISGenerated||N;if(Ee){this.ISGenerated||(B=this.generateIS(v,h,m));var se=this.isVideoContiguous,He=-1;if(Ne&&(He=O(h.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,He>0){k.logger.warn("[mp4-remuxer]: Dropped "+He+" out of "+De+" video samples due to a missing keyframe");var ft=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(He),h.dropped+=He,me+=(h.samples[0].pts-ft)/(h.timescale||9e4)}else He===-1&&(k.logger.warn("[mp4-remuxer]: No keyframe found out of "+De+" video samples"),te=!1);if(this.ISGenerated){if(Fe&&Ne){var lt=this.getVideoStartPts(h.samples),it=f(v.samples[0].pts,lt)-lt,ct=it/h.inputTimeScale;ue+=Math.max(0,ct),me+=Math.max(0,-ct)}if(Fe){if(v.samplerate||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(v,h,m)),Y=this.remuxAudio(v,ue,this.isAudioContiguous,T,Ae||Ne||j===I.PlaylistLevelType.AUDIO?me:void 0),Ne){var Ve=Y?Y.endPTS-Y.startPTS:0;h.inputTimeScale||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(v,h,m)),W=this.remuxVideo(h,me,se,Ve)}}else Ne&&(W=this.remuxVideo(h,me,se,0));W&&(W.firstKeyFrame=He,W.independent=He!==-1)}}return this.ISGenerated&&(o.samples.length&&($=this.remuxID3(o,m)),_.samples.length&&(R=this.remuxText(_,m))),{audio:Y,video:W,initSegment:B,independent:te,text:R,id3:$}},w.generateIS=function(v,h,o){var _=v.samples,m=h.samples,T=this.typeSupported,N={},j=!Object(V.isFiniteNumber)(this._initPTS),W="audio/mp4",Y,B,R;if(j&&(Y=B=Infinity),v.config&&_.length&&(v.timescale=v.samplerate,v.isAAC||(T.mpeg?(W="audio/mpeg",v.codec=""):T.mp3&&(v.codec="mp3")),N.audio={id:"audio",container:W,codec:v.codec,initSegment:!v.isAAC&&T.mpeg?new Uint8Array(0):M.default.initSegment([v]),metadata:{channelCount:v.channelCount}},j&&(R=v.inputTimeScale,Y=B=_[0].pts-Math.round(R*o))),h.sps&&h.pps&&m.length&&(h.timescale=h.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:M.default.initSegment([h]),metadata:{width:h.width,height:h.height}},j)){R=h.inputTimeScale;var $=this.getVideoStartPts(m),te=Math.round(R*o);B=Math.min(B,f(m[0].dts,$)-te),Y=Math.min(Y,$-te)}if(Object.keys(N).length)return this.ISGenerated=!0,j&&(this._initPTS=Y,this._initDTS=B),{tracks:N,initPTS:Y,timescale:R}},w.remuxVideo=function(v,h,o,_){var m=v.inputTimeScale,T=v.samples,N=[],j=T.length,W=this._initPTS,Y=this.nextAvcDts,B=8,R,$,te,ue=Number.POSITIVE_INFINITY,me=Number.NEGATIVE_INFINITY,Me=0,Ae=!1;if(!o||Y===null){var De=h*m,Fe=T[0].pts-f(T[0].dts,T[0].pts);Y=De-Fe}for(var Ne=0;Ne<j;Ne++){var Ee=T[Ne];if(Ee.pts=f(Ee.pts-W,Y),Ee.dts=f(Ee.dts-W,Y),Ee.dts>Ee.pts){var se=9e4*.2;Me=Math.max(Math.min(Me,Ee.pts-Ee.dts),-1*se)}Ee.dts<T[Ne>0?Ne-1:Ne].dts&&(Ae=!0)}Ae&&T.sort(function(Wt,Nt){var _t=Wt.dts-Nt.dts,Qt=Wt.pts-Nt.pts;return _t||Qt}),$=T[0].dts,te=T[T.length-1].dts;var He=Math.round((te-$)/(j-1));if(Me<0){if(Me<He*-2){k.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(b.toMsFromMpegTsClock)(-He,!0)+" ms");for(var ft=Me,lt=0;lt<j;lt++)T[lt].dts=ft=Math.max(ft,T[lt].pts-He),T[lt].pts=Math.max(ft,T[lt].pts)}else{k.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(b.toMsFromMpegTsClock)(Me,!0)+" ms to overcome this issue");for(var it=0;it<j;it++)T[it].dts=T[it].dts+Me}$=T[0].dts}if(o){var ct=$-Y,Ve=ct>He,Je=ct<-1;if(Ve||Je){Ve?k.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(ct,!0)+" ms ("+ct+"dts) hole between fragments detected, filling it"):k.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-ct,!0)+" ms ("+ct+"dts) overlapping between fragments detected"),$=Y;var st=T[0].pts-ct;T[0].dts=$,T[0].pts=st,k.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(st,!0)+"/"+Object(b.toMsFromMpegTsClock)($,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(ct,!0)+" ms")}}a&&($=Math.max(0,$));for(var gt=0,ut=0,et=0;et<j;et++){for(var qe=T[et],St=qe.units,pt=St.length,nt=0,at=0;at<pt;at++)nt+=St[at].data.length;ut+=nt,gt+=pt,qe.length=nt,qe.dts=Math.max(qe.dts,$),qe.pts=Math.max(qe.pts,qe.dts,0),ue=Math.min(qe.pts,ue),me=Math.max(qe.pts,me)}te=T[j-1].dts;var bt=ut+4*gt+8,Et;try{Et=new Uint8Array(bt)}catch(Wt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:bt,reason:"fail allocating video mdat "+bt});return}var Re=new DataView(Et.buffer);Re.setUint32(0,bt),Et.set(M.default.types.mdat,4);for(var Te=0;Te<j;Te++){for(var Ke=T[Te],ze=Ke.units,Ce=0,We=0,ve=ze.length;We<ve;We++){var ce=ze[We],he=ce.data,ne=ce.data.byteLength;Re.setUint32(B,ne),B+=4,Et.set(he,B),B+=ne,Ce+=4+ne}if(Te<j-1)R=T[Te+1].dts-Ke.dts;else{var oe=this.config,le=Ke.dts-T[Te>0?Te-1:Te].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var pe=Math.floor(oe.maxBufferHole*m),ge=(_?ue+_*m:this.nextAudioPts)-Ke.pts;ge>pe?(R=ge-le,R<0&&(R=le),k.logger.log("[mp4-remuxer]: It is approximately "+ge/90+" ms to the next segment; using duration "+R/90+" ms for the last video frame.")):R=le}else R=le}var Pe=Math.round(Ke.pts-Ke.dts);N.push(new S(Ke.key,R,Ce,Pe))}if(N.length&&l&&l<70){var Ge=N[0].flags;Ge.dependsOn=2,Ge.isNonSync=0}console.assert(R!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=Y=te+R,this.isVideoContiguous=!0;var rt=M.default.moof(v.sequenceNumber++,$,y({},v,{samples:N})),vt="video",tt={data1:rt,data2:Et,startPTS:ue/m,endPTS:(me+R)/m,startDTS:$/m,endDTS:Y/m,type:vt,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:v.dropped};return v.samples=[],v.dropped=0,console.assert(Et.length,"MDAT length must not be zero"),tt},w.remuxAudio=function(v,h,o,_,m){var T=v.inputTimeScale,N=v.samplerate?v.samplerate:T,j=T/N,W=v.isAAC?c:r,Y=W*j,B=this._initPTS,R=!v.isAAC&&this.typeSupported.mpeg,$=[],te=v.samples,ue=R?0:8,me=this.nextAudioPts||-1,Me=h*T;if(this.isAudioContiguous=o=o||te.length&&me>0&&(_&&Math.abs(Me-me)<9e3||Math.abs(f(te[0].pts-B,Me)-me)<20*Y),te.forEach(function(he){he.pts=f(he.pts-B,Me)}),!o||me<0){if(te=te.filter(function(he){return he.pts>=0}),!te.length)return;m===0?me=0:_?me=Math.max(0,Me):me=te[0].pts}if(v.isAAC)for(var Ae=m!==void 0,De=this.config.maxAudioFramesDrift,Fe=0,Ne=me;Fe<te.length;Fe++){var Ee=te[Fe],se=Ee.pts,He=se-Ne,ft=Math.abs(1e3*He/T);if(He<=-De*Y&&Ae)Fe===0&&(k.logger.warn("Audio frame @ "+(se/T).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*He/T)+" ms."),this.nextAudioPts=me=Ne=se);else if(He>=De*Y&&ft<p&&Ae){var lt=Math.round(He/Y);Ne=se-lt*Y,Ne<0&&(lt--,Ne+=Y),Fe===0&&(this.nextAudioPts=me=Ne),k.logger.warn("[mp4-remuxer]: Injecting "+lt+" audio frame @ "+(Ne/T).toFixed(3)+"s due to "+Math.round(1e3*He/T)+" ms gap.");for(var it=0;it<lt;it++){var ct=Math.max(Ne,0),Ve=L.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);Ve||(k.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ve=Ee.unit.subarray()),te.splice(Fe,0,{unit:Ve,pts:ct}),Ne+=Y,Fe++}}Ee.pts=Ne,Ne+=Y}for(var Je=null,st=null,gt,ut=0,et=te.length;et--;)ut+=te[et].unit.byteLength;for(var qe=0,St=te.length;qe<St;qe++){var pt=te[qe],nt=pt.unit,at=pt.pts;if(st!==null){var bt=$[qe-1];bt.duration=Math.round((at-st)/j)}else if(o&&v.isAAC&&(at=me),Je=at,ut>0){ut+=ue;try{gt=new Uint8Array(ut)}catch(he){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ut,reason:"fail allocating audio mdat "+ut});return}if(!R){var Et=new DataView(gt.buffer);Et.setUint32(0,ut),gt.set(M.default.types.mdat,4)}}else return;gt.set(nt,ue);var Re=nt.byteLength;ue+=Re,$.push(new S(!0,W,Re,0)),st=at}var Te=$.length;if(!Te)return;var Ke=$[$.length-1];this.nextAudioPts=me=st+j*Ke.duration;var ze=R?new Uint8Array(0):M.default.moof(v.sequenceNumber++,Je/j,y({},v,{samples:$}));v.samples=[];var Ce=Je/T,We=me/T,ve="audio",ce={data1:ze,data2:gt,startPTS:Ce,endPTS:We,startDTS:Ce,endDTS:We,type:ve,hasAudio:!0,hasVideo:!1,nb:Te};return this.isAudioContiguous=!0,console.assert(gt.length,"MDAT length must not be zero"),ce},w.remuxEmptyAudio=function(v,h,o,_){var m=v.inputTimeScale,T=v.samplerate?v.samplerate:m,N=m/T,j=this.nextAudioPts,W=(j!==null?j:_.startDTS*m)+this._initDTS,Y=_.endDTS*m+this._initDTS,B=N*c,R=Math.ceil((Y-W)/B),$=L.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);if(k.logger.warn("[mp4-remuxer]: remux empty Audio"),!$){k.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],ue=0;ue<R;ue++){var me=W+ue*B;te.push({unit:$,pts:me,dts:me})}return v.samples=te,this.remuxAudio(v,h,o,!1)},w.remuxID3=function(v,h){var o=v.samples.length;if(!o)return;for(var _=v.inputTimeScale,m=this._initPTS,T=this._initDTS,N=0;N<o;N++){var j=v.samples[N];j.pts=f(j.pts-m,h*_)/_,j.dts=f(j.dts-T,h*_)/_}var W=v.samples;return v.samples=[],{samples:W}},w.remuxText=function(v,h){var o=v.samples.length;if(!o)return;for(var _=v.inputTimeScale,m=this._initPTS,T=0;T<o;T++){var N=v.samples[T];N.pts=f(N.pts-m,h*_)/_}v.samples.sort(function(W,Y){return W.pts-Y.pts});var j=v.samples;return v.samples=[],{samples:j}},C}();function f(C,w){var g;if(w===null)return C;for(w<C?g=-8589934592:g=8589934592;Math.abs(C-w)>4294967296;)C+=g;return C}function O(C){for(var w=0;w<C.length;w++)if(C[w].key)return w;return-1}var S=function(w,g,v,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=g,this.size=v,this.cts=h,this.flags=new E(w)},E=function(w){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=w?2:1,this.isNonSync=w?0:1}},"./src/remux/passthrough-remuxer.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),L=P("./src/utils/mp4-tools.ts"),M=P("./src/loader/fragment.ts"),H=P("./src/utils/logger.ts"),U=function(){function b(){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 y=b.prototype;return y.destroy=function(){},y.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},y.resetNextTimestamp=function(){this.lastEndDTS=null},y.resetInitSegment=function(c,r,l){this.audioCodec=r,this.videoCodec=l,this.generateInitSegment(c),this.emitInitSegment=!0},y.generateInitSegment=function(c){var r=this.audioCodec,l=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var u=this.initData=Object(L.parseInitSegment)(c);r||(r=I(u.audio,M.ElementaryStreamTypes.AUDIO)),l||(l=I(u.video,M.ElementaryStreamTypes.VIDEO));var a={};u.audio&&u.video?a.audiovideo={container:"video/mp4",codec:r+","+l,initSegment:c,id:"main"}:u.audio?a.audio={container:"audio/mp4",codec:r,initSegment:c,id:"audio"}:u.video?a.video={container:"video/mp4",codec:l,initSegment:c,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},y.remux=function(c,r,l,u,a){var s=this.initPTS,f=this.lastEndDTS,O={audio:void 0,video:void 0,text:u,id3:l,initSegment:void 0};Object(V.isFiniteNumber)(f)||(f=this.lastEndDTS=a||0);var S=r.samples;if(!S||!S.length)return O;var E={initPTS:void 0,timescale:1},C=this.initData;if((!C||!C.length)&&(this.generateInitSegment(S),C=this.initData),!C||!C.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(E.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(s)||(this.initPTS=E.initPTS=s=k(C,S,f));var w=Object(L.getDuration)(S,C),g=f,v=w+g;Object(L.offsetStartDTS)(C,S,s),w>0?this.lastEndDTS=v:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!C.audio,o=!!C.video,_="";h&&(_+="audio"),o&&(_+="video");var m={data1:S,startPTS:g,startDTS:g,endPTS:v,endDTS:v,type:_,hasAudio:h,hasVideo:o,nb:1,dropped:0};return O.audio=m.type==="audio"?m:void 0,O.video=m.type!=="audio"?m:void 0,O.text=u,O.id3=l,O.initSegment=E,O},b}(),k=function(y,p,c){return Object(L.getStartDTS)(y,p)-c};function I(b,y){var p=b==null?void 0:b.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||y===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}X.default=U},"./src/task-loop.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function L(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=L.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},L}()},"./src/types/cmcd.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"CMCDVersion",function(){return V}),P.d(X,"CMCDObjectType",function(){return L}),P.d(X,"CMCDStreamingFormat",function(){return M}),P.d(X,"CMCDStreamType",function(){return H});var V=1,L;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(L||(L={}));var M;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(M||(M={}));var H;(function(U){U.VOD="v",U.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"HlsSkip",function(){return M}),P.d(X,"getSkipValue",function(){return H}),P.d(X,"HlsUrlParameters",function(){return U}),P.d(X,"Level",function(){return k});function V(I,b){for(var y=0;y<b.length;y++){var p=b[y];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(I,p.key,p)}}function L(I,b,y){return b&&V(I.prototype,b),y&&V(I,y),I}var M;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(M||(M={}));function H(I,b){var y=I.canSkipUntil,p=I.canSkipDateRanges,c=I.endSN,r=b!==void 0?b-c:0;return y&&r<y?p?M.v2:M.Yes:M.No}var U=function(){function I(y,p,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=y,this.part=p,this.skip=c}var b=I.prototype;return b.addDirectives=function(p){var c=new self.URL(p);return this.msn!==void 0&&c.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&c.searchParams.set("_HLS_part",this.part.toString()),this.skip&&c.searchParams.set("_HLS_skip",this.skip),c.toString()},I}(),k=function(){function I(b){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=[b.url],this.attrs=b.attrs,this.bitrate=b.bitrate,b.details&&(this.details=b.details),this.id=b.id||0,this.name=b.name,this.width=b.width||0,this.height=b.height||0,this.audioCodec=b.audioCodec,this.videoCodec=b.videoCodec,this.unknownCodecs=b.unknownCodecs,this.codecSet=[b.videoCodec,b.audioCodec].filter(function(y){return y}).join(",").replace(/\.[^.,]+/g,"")}return L(I,[{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(y){var p=y%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),I}()},"./src/types/loader.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"PlaylistContextType",function(){return V}),P.d(X,"PlaylistLevelType",function(){return L});var V;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var L;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(L||(L={}))},"./src/types/transmuxer.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"ChunkMetadata",function(){return V});var V=function(H,U,k,I,b,y){I===void 0&&(I=0),b===void 0&&(b=-1),y===void 0&&(y=!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=L(),this.buffering={audio:L(),video:L(),audiovideo:L()},this.level=H,this.sn=U,this.id=k,this.size=I,this.part=b,this.partial=y};function L(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"AttrList",function(){return M});var V=/^(\d+)x(\d+)$/,L=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function H(k){typeof k=="string"&&(k=H.parseAttrList(k));for(var I in k)k.hasOwnProperty(I)&&(this[I]=k[I])}var U=H.prototype;return U.decimalInteger=function(I){var b=parseInt(this[I],10);return b>Number.MAX_SAFE_INTEGER?Infinity:b},U.hexadecimalInteger=function(I){if(this[I]){var b=(this[I]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var y=new Uint8Array(b.length/2),p=0;p<b.length/2;p++)y[p]=parseInt(b.slice(p*2,p*2+2),16);return y}else return null},U.hexadecimalIntegerAsNumber=function(I){var b=parseInt(this[I],16);return b>Number.MAX_SAFE_INTEGER?Infinity:b},U.decimalFloatingPoint=function(I){return parseFloat(this[I])},U.optionalFloat=function(I,b){var y=this[I];return y?parseFloat(y):b},U.enumeratedString=function(I){return this[I]},U.bool=function(I){return this[I]==="YES"},U.decimalResolution=function(I){var b=V.exec(this[I]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},H.parseAttrList=function(I){var b,y={},p='"';for(L.lastIndex=0;(b=L.exec(I))!==null;){var c=b[2];c.indexOf(p)===0&&c.lastIndexOf(p)===c.length-1&&(c=c.slice(1,-1)),y[b[1]]=c}return y},H}()},"./src/utils/binary-search.ts":function(ae,X,P){"use strict";P.r(X);var V={search:function(M,H){for(var U=0,k=M.length-1,I=null,b=null;U<=k;){I=(U+k)/2|0,b=M[I];var y=H(b);if(y>0)U=I+1;else if(y<0)k=I-1;else return b}return null}};X.default=V},"./src/utils/buffer-helper.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"BufferHelper",function(){return M});var V=P("./src/utils/logger.ts"),L={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function H(){}return H.isBuffered=function(k,I){try{if(k){for(var b=H.getBuffered(k),y=0;y<b.length;y++)if(I>=b.start(y)&&I<=b.end(y))return!0}}catch(p){}return!1},H.bufferInfo=function(k,I,b){try{if(k){var y=H.getBuffered(k),p=[],c;for(c=0;c<y.length;c++)p.push({start:y.start(c),end:y.end(c)});return this.bufferedInfo(p,I,b)}}catch(r){}return{len:0,start:I,end:I,nextStart:void 0}},H.bufferedInfo=function(k,I,b){I=Math.max(0,I),k.sort(function(E,C){var w=E.start-C.start;return w||C.end-E.end});var y=[];if(b)for(var p=0;p<k.length;p++){var c=y.length;if(c){var r=y[c-1].end;k[p].start-r<b?k[p].end>r&&(y[c-1].end=k[p].end):y.push(k[p])}else y.push(k[p])}else y=k;for(var l=0,u,a=I,s=I,f=0;f<y.length;f++){var O=y[f].start,S=y[f].end;if(I+b>=O&&I<S)a=O,s=S,l=s-I;else if(I+b<O){u=O;break}}return{len:l,start:a||0,end:s||0,nextStart:u}},H.getBuffered=function(k){try{return k.buffered}catch(I){return V.logger.log("failed to get media.buffered",I),L}},H}()},"./src/utils/cea-608-parser.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"Row",function(){return s}),P.d(X,"CaptionScreen",function(){return f});var V=P("./src/utils/logger.ts"),L={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},M=function(v){var h=v;return L.hasOwnProperty(v)&&(h=L[v]),String.fromCharCode(h)},H=15,U=100,k={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},b={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},y={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(g){g[g.ERROR=0]="ERROR",g[g.TEXT=1]="TEXT",g[g.WARNING=2]="WARNING",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g[g.DATA=3]="DATA"})(c||(c={}));var r=function(){function g(){this.time=null,this.verboseLevel=c.ERROR}var v=g.prototype;return v.log=function(o,_){this.verboseLevel>=o&&V.logger.log(this.time+" ["+o+"] "+_)},g}(),l=function(v){for(var h=[],o=0;o<v.length;o++)h.push(v[o].toString(16));return h},u=function(){function g(h,o,_,m,T){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=h||"white",this.underline=o||!1,this.italics=_||!1,this.background=m||"black",this.flash=T||!1}var v=g.prototype;return v.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},v.setStyles=function(o){for(var _=["foreground","underline","italics","background","flash"],m=0;m<_.length;m++){var T=_[m];o.hasOwnProperty(T)&&(this[T]=o[T])}},v.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},v.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},v.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},v.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},g}(),a=function(){function g(h,o,_,m,T,N){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new u(o,_,m,T,N)}var v=g.prototype;return v.reset=function(){this.uchar=" ",this.penState.reset()},v.setChar=function(o,_){this.uchar=o,this.penState.copy(_)},v.setPenState=function(o){this.penState.copy(o)},v.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},v.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},v.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},g}(),s=function(){function g(h){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var o=0;o<U;o++)this.chars.push(new a);this.logger=h,this.pos=0,this.currPenState=new u}var v=g.prototype;return v.equals=function(o){for(var _=!0,m=0;m<U;m++)if(!this.chars[m].equals(o.chars[m])){_=!1;break}return _},v.copy=function(o){for(var _=0;_<U;_++)this.chars[_].copy(o.chars[_])},v.isEmpty=function(){for(var o=!0,_=0;_<U;_++)if(!this.chars[_].isEmpty()){o=!1;break}return o},v.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},v.moveCursor=function(o){var _=this.pos+o;if(o>1)for(var m=this.pos+1;m<_+1;m++)this.chars[m].setPenState(this.currPenState);this.setCursor(_)},v.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},v.insertChar=function(o){o>=144&&this.backSpace();var _=M(o);if(this.pos>=U){this.logger.log(c.ERROR,"Cannot insert "+o.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},v.clearFromPos=function(o){var _;for(_=o;_<U;_++)this.chars[_].reset()},v.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},v.clearToEndOfRow=function(){this.clearFromPos(this.pos)},v.getTextString=function(){for(var o=[],_=!0,m=0;m<U;m++){var T=this.chars[m].uchar;T!==" "&&(_=!1),o.push(T)}return _?"":o.join("")},v.setPenStyles=function(o){this.currPenState.setStyles(o);var _=this.chars[this.pos];_.setPenState(this.currPenState)},g}(),f=function(){function g(h){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var o=0;o<H;o++)this.rows.push(new s(h));this.logger=h,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var v=g.prototype;return v.reset=function(){for(var o=0;o<H;o++)this.rows[o].clear();this.currRow=H-1},v.equals=function(o){for(var _=!0,m=0;m<H;m++)if(!this.rows[m].equals(o.rows[m])){_=!1;break}return _},v.copy=function(o){for(var _=0;_<H;_++)this.rows[_].copy(o.rows[_])},v.isEmpty=function(){for(var o=!0,_=0;_<H;_++)if(!this.rows[_].isEmpty()){o=!1;break}return o},v.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},v.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},v.insertChar=function(o){var _=this.rows[this.currRow];_.insertChar(o)},v.setPen=function(o){var _=this.rows[this.currRow];_.setPenStyles(o)},v.moveCursor=function(o){var _=this.rows[this.currRow];_.moveCursor(o)},v.setCursor=function(o){this.logger.log(c.INFO,"setCursor: "+o);var _=this.rows[this.currRow];_.setCursor(o)},v.setPAC=function(o){this.logger.log(c.INFO,"pacData = "+JSON.stringify(o));var _=o.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var m=0;m<H;m++)this.rows[m].clear();var T=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var j=N.rows[T].cueStartTime,W=this.logger.time;if(j&&W!==null&&j<W)for(var Y=0;Y<this.nrRollUpRows;Y++)this.rows[_-this.nrRollUpRows+Y+1].copy(N.rows[T+Y])}}this.currRow=_;var B=this.rows[this.currRow];if(o.indent!==null){var R=o.indent,$=Math.max(R-1,0);B.setCursor(o.indent),o.color=B.chars[$].penState.foreground}var te={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(te)},v.setBkgData=function(o){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},v.setRollUpRows=function(o){this.nrRollUpRows=o},v.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(c.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(c.TEXT,this.getDisplayText());var o=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(o,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(c.INFO,"Rolling up")},v.getDisplayText=function(o){o=o||!1;for(var _=[],m="",T=-1,N=0;N<H;N++){var j=this.rows[N].getTextString();j&&(T=N+1,o?_.push("Row "+T+": '"+j+"'"):_.push(j.trim()))}return _.length>0&&(o?m="["+_.join(" | ")+"]":m=_.join(`
`)),m},v.getTextAndFormat=function(){return this.rows},g}(),O=function(){function g(h,o,_){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=h,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new f(_),this.nonDisplayedMemory=new f(_),this.lastOutputScreen=new f(_),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var v=g.prototype;return v.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},v.getHandler=function(){return this.outputFilter},v.setHandler=function(o){this.outputFilter=o},v.setPAC=function(o){this.writeScreen.setPAC(o)},v.setBkgData=function(o){this.writeScreen.setBkgData(o)},v.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(c.INFO,"MODE="+o),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=o},v.insertChars=function(o){for(var _=0;_<o.length;_++)this.writeScreen.insertChar(o[_]);var m=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,m+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(c.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},v.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},v.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},v.ccAOF=function(){},v.ccAON=function(){},v.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},v.ccRU=function(o){this.logger.log(c.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},v.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},v.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},v.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},v.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},v.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},v.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},v.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},v.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var o=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=o,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},v.ccTO=function(o){this.logger.log(c.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},v.ccMIDROW=function(o){var _={flash:!1};if(_.underline=o%2===1,_.italics=o>=46,_.italics)_.foreground="white";else{var m=Math.floor(o/2)-16,T=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=T[m]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},v.outputDataUpdate=function(o){o===void 0&&(o=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},v.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},g}(),S=function(){function g(h,o,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var m=new r;this.channels=[null,new O(h,o,m),new O(h+1,_,m)],this.cmdHistory=w(),this.logger=m}var v=g.prototype;return v.getHandler=function(o){return this.channels[o].getHandler()},v.setHandler=function(o,_){this.channels[o].setHandler(_)},v.addData=function(o,_){var m,T,N,j=!1;this.logger.time=o;for(var W=0;W<_.length;W+=2){if(T=_[W]&127,N=_[W+1]&127,T===0&&N===0)continue;if(this.logger.log(c.DATA,"["+l([_[W],_[W+1]])+"] -> ("+l([T,N])+")"),m=this.parseCmd(T,N),m||(m=this.parseMidrow(T,N)),m||(m=this.parsePAC(T,N)),m||(m=this.parseBackgroundAttributes(T,N)),!m&&(j=this.parseChars(T,N),j)){var Y=this.currentChannel;if(Y&&Y>0){var B=this.channels[Y];B.insertChars(j)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!m&&!j&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+l([T,N])+" orig: "+l([_[W],_[W+1]]))}},v.parseCmd=function(o,_){var m=this.cmdHistory,T=(o===20||o===28||o===21||o===29)&&_>=32&&_<=47,N=(o===23||o===31)&&_>=33&&_<=35;if(!(T||N))return!1;if(C(o,_,m))return E(null,null,m),this.logger.log(c.DEBUG,"Repeated command ("+l([o,_])+") is dropped"),!0;var j=o===20||o===21||o===23?1:2,W=this.channels[j];return o===20||o===21||o===28||o===29?_===32?W.ccRCL():_===33?W.ccBS():_===34?W.ccAOF():_===35?W.ccAON():_===36?W.ccDER():_===37?W.ccRU(2):_===38?W.ccRU(3):_===39?W.ccRU(4):_===40?W.ccFON():_===41?W.ccRDC():_===42?W.ccTR():_===43?W.ccRTD():_===44?W.ccEDM():_===45?W.ccCR():_===46?W.ccENM():_===47&&W.ccEOC():W.ccTO(_-32),E(o,_,m),this.currentChannel=j,!0},v.parseMidrow=function(o,_){var m=0;if((o===17||o===25)&&_>=32&&_<=47){if(o===17?m=1:m=2,m!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var T=this.channels[m];return T?(T.ccMIDROW(_),this.logger.log(c.DEBUG,"MIDROW ("+l([o,_])+")"),!0):!1}return!1},v.parsePAC=function(o,_){var m,T=this.cmdHistory,N=(o>=17&&o<=23||o>=25&&o<=31)&&_>=64&&_<=127,j=(o===16||o===24)&&_>=64&&_<=95;if(!(N||j))return!1;if(C(o,_,T))return E(null,null,T),!0;var W=o<=23?1:2;_>=64&&_<=95?m=W===1?k[o]:b[o]:m=W===1?I[o]:y[o];var Y=this.channels[W];return Y?(Y.setPAC(this.interpretPAC(m,_)),E(o,_,T),this.currentChannel=W,!0):!1},v.interpretPAC=function(o,_){var m,T={color:null,italics:!1,indent:null,underline:!1,row:o};return _>95?m=_-96:m=_-64,T.underline=(m&1)===1,m<=13?T.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(m/2)]:m<=15?(T.italics=!0,T.color="white"):T.indent=Math.floor((m-16)/2)*4,T},v.parseChars=function(o,_){var m,T=null,N=null;if(o>=25?(m=2,N=o-8):(m=1,N=o),N>=17&&N<=19){var j;N===17?j=_+80:N===18?j=_+112:j=_+144,this.logger.log(c.INFO,"Special char '"+M(j)+"' in channel "+m),T=[j]}else o>=32&&o<=127&&(T=_===0?[o]:[o,_]);if(T){var W=l(T);this.logger.log(c.DEBUG,"Char codes = "+W.join(",")),E(o,_,this.cmdHistory)}return T},v.parseBackgroundAttributes=function(o,_){var m=(o===16||o===24)&&_>=32&&_<=47,T=(o===23||o===31)&&_>=45&&_<=47;if(!(m||T))return!1;var N,j={};o===16||o===24?(N=Math.floor((_-32)/2),j.background=p[N],_%2===1&&(j.background=j.background+"_semi")):_===45?j.background="transparent":(j.foreground="black",_===47&&(j.underline=!0));var W=o<=23?1:2,Y=this.channels[W];return Y.setBkgData(j),E(o,_,this.cmdHistory),!0},v.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var _=this.channels[o];_&&_.reset()}this.cmdHistory=w()},v.cueSplitAtTime=function(o){for(var _=0;_<this.channels.length;_++){var m=this.channels[_];m&&m.cueSplitAtTime(o)}},g}();function E(g,v,h){h.a=g,h.b=v}function C(g,v,h){return h.a===g&&h.b===v}function w(){return{a:null,b:null}}X.default=S},"./src/utils/codecs.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"isCodecType",function(){return L}),P.d(X,"isCodecSupportedInMp4",function(){return M});var V={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 L(H,U){var k=V[U];return!!k&&k[H.slice(0,4)]===!0}function M(H,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/utils/vttparser.ts"),L=P("./src/utils/webvtt-parser.ts"),M=P("./src/utils/texttrack-utils.ts"),H=/\s/,U={newCue:function(I,b,y,p){for(var c=[],r,l,u,a,s,f=self.VTTCue||self.TextTrackCue,O=0;O<p.rows.length;O++)if(r=p.rows[O],u=!0,a=0,s="",!r.isEmpty()){for(var S=0;S<r.chars.length;S++)H.test(r.chars[S].uchar)&&u?a++:(s+=r.chars[S].uchar,u=!1);r.cueStartTime=b,b===y&&(y+=1e-4),a>=16?a--:a++;var E=Object(V.fixLineBreaks)(s.trim()),C=Object(L.generateCueId)(b,y,E);(!I||!I.cues||!I.cues.getCueById(C))&&(l=new f(b,y,E),l.id=C,l.line=O+1,l.align="left",l.position=10+Math.min(80,Math.floor(a*8/32)*10),c.push(l))}return I&&c.length&&(c.sort(function(w,g){return w.line==="auto"||g.line==="auto"?0:w.line>8&&g.line>8?g.line-w.line:w.line-g.line}),c.forEach(function(w){return Object(M.addCueToTrack)(I,w)})),c}};X.default=U},"./src/utils/discontinuities.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"findFirstFragWithCC",function(){return H}),P.d(X,"shouldAlignOnDiscontinuities",function(){return U}),P.d(X,"findDiscontinuousReferenceFrag",function(){return k}),P.d(X,"adjustSlidingStart",function(){return b}),P.d(X,"alignStream",function(){return y}),P.d(X,"alignPDT",function(){return c}),P.d(X,"alignFragmentByPDTDelta",function(){return r}),P.d(X,"alignMediaPlaylistByPDT",function(){return l});var V=P("./src/polyfills/number.ts"),L=P("./src/utils/logger.ts"),M=P("./src/controller/level-helper.ts");function H(u,a){for(var s=null,f=0,O=u.length;f<O;f++){var S=u[f];if(S&&S.cc===a){s=S;break}}return s}function U(u,a,s){return!!(a.details&&(s.endCC>s.startCC||u&&u.cc<s.startCC))}function k(u,a){var s=u.fragments,f=a.fragments;if(!f.length||!s.length){L.logger.log("No fragments to align");return}var O=H(s,f[0].cc);if(!O||O&&!O.startPTS){L.logger.log("No frag in previous level to align on");return}return O}function I(u,a){if(u){var s=u.start+a;u.start=u.startPTS=s,u.endPTS=s+u.duration}}function b(u,a){for(var s=a.fragments,f=0,O=s.length;f<O;f++)I(s[f],u);a.fragmentHint&&I(a.fragmentHint,u),a.alignedSliding=!0}function y(u,a,s){if(!a)return;p(u,s,a),!s.alignedSliding&&a.details&&c(s,a.details),!s.alignedSliding&&a.details&&!s.skippedSegments&&Object(M.adjustSliding)(a.details,s)}function p(u,a,s){if(U(u,s,a)){var f=k(s.details,a);f&&Object(V.isFiniteNumber)(f.start)&&(L.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),b(f.start,a))}}function c(u,a){if(!a.fragments.length||!u.hasProgramDateTime||!a.hasProgramDateTime)return;var s=a.fragments[0].programDateTime,f=u.fragments[0].programDateTime,O=(f-s)/1e3+a.fragments[0].start;O&&Object(V.isFiniteNumber)(O)&&(L.logger.log("Adjusting PTS using programDateTime delta "+(f-s)+"ms, sliding:"+O.toFixed(3)+" "+u.url+" "),b(O,u))}function r(u,a){var s=u.programDateTime;if(!s)return;var f=(s-a)/1e3;u.start=u.startPTS=f,u.endPTS=f+u.duration}function l(u,a){if(!a.fragments.length||!u.hasProgramDateTime||!a.hasProgramDateTime)return;var s=a.fragments[0].programDateTime,f=a.fragments[0].start,O=s-f*1e3;u.fragments.forEach(function(S){r(S,O)}),u.fragmentHint&&r(u.fragmentHint,O),u.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/utils/ewma.ts"),L=function(){function M(U,k,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(U),this.fast_=new V.default(k)}var H=M.prototype;return H.update=function(k,I){var b=this.slow_,y=this.fast_;this.slow_.halfLife!==k&&(this.slow_=new V.default(k,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new V.default(I,y.getEstimate(),y.getTotalWeight()))},H.sample=function(k,I){k=Math.max(k,this.minDelayMs_);var b=8*I,y=k/1e3,p=b/y;this.fast_.sample(y,p),this.slow_.sample(y,p)},H.canEstimate=function(){var k=this.fast_;return k&&k.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},M}();X.default=L},"./src/utils/ewma.ts":function(ae,X,P){"use strict";P.r(X);var V=function(){function L(H,U,k){U===void 0&&(U=0),k===void 0&&(k=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=U,this.totalWeight_=k}var M=L.prototype;return M.sample=function(U,k){var I=Math.pow(this.alpha_,U);this.estimate_=k*(1-I)+I*this.estimate_,this.totalWeight_+=U},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},L}();X.default=V},"./src/utils/fetch-loader.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"fetchSupported",function(){return r});var V=P("./src/polyfills/number.ts"),L=P("./src/loader/load-stats.ts"),M=P("./src/demux/chunk-cache.ts");function H(f,O){f.prototype=Object.create(O.prototype),f.prototype.constructor=f,y(f,O)}function U(f){var O=typeof Map=="function"?new Map:void 0;return U=function(E){if(E===null||!b(E))return E;if(typeof E!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(E))return O.get(E);O.set(E,C)}function C(){return k(E,arguments,p(this).constructor)}return C.prototype=Object.create(E.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),y(C,E)},U(f)}function k(f,O,S){return I()?k=Reflect.construct:k=function(C,w,g){var v=[null];v.push.apply(v,w);var h=Function.bind.apply(C,v),o=new h;return g&&y(o,g.prototype),o},k.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(f){return!1}}function b(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function y(f,O){return y=Object.setPrototypeOf||function(E,C){return E.__proto__=C,E},y(f,O)}function p(f){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},p(f)}function c(){return c=Object.assign||function(f){for(var O=1;O<arguments.length;O++){var S=arguments[O];for(var E in S)Object.prototype.hasOwnProperty.call(S,E)&&(f[E]=S[E])}return f},c.apply(this,arguments)}function r(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(f){}return!1}var l=function(){function f(S){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=S.fetchSetup||a,this.controller=new self.AbortController,this.stats=new L.LoadStats}var O=f.prototype;return O.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},O.abortInternal=function(){var E=this.response;(!E||!E.ok)&&(this.stats.aborted=!0,this.controller.abort())},O.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},O.load=function(E,C,w){var g=this,v=this.stats;if(v.loading.start)throw new Error("Loader can only be used once.");v.loading.start=self.performance.now();var h=u(E,this.controller.signal),o=w.onProgress,_=E.responseType==="arraybuffer",m=_?"byteLength":"length";this.context=E,this.config=C,this.callbacks=w,this.request=this.fetchSetup(E,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){g.abortInternal(),w.onTimeout(v,E,g.response)},C.timeout),self.fetch(this.request).then(function(T){if(g.response=g.loader=T,!T.ok){var N=T.status,j=T.statusText;throw new s(j||"fetch, bad network response",N,T)}return v.loading.first=Math.max(self.performance.now(),v.loading.start),v.total=parseInt(T.headers.get("Content-Length")||"0"),o&&Object(V.isFiniteNumber)(C.highWaterMark)?g.loadProgressively(T,v,E,C.highWaterMark,o):_?T.arrayBuffer():T.text()}).then(function(T){var N=g.response;self.clearTimeout(g.requestTimeout),v.loading.end=Math.max(self.performance.now(),v.loading.first),v.loaded=v.total=T[m];var j={url:N.url,data:T};o&&!Object(V.isFiniteNumber)(C.highWaterMark)&&o(v,E,T,N),w.onSuccess(j,v,E,N)}).catch(function(T){if(self.clearTimeout(g.requestTimeout),v.aborted)return;var N=T.code||0;w.onError({code:N,text:T.message},E,T.details)})},O.getCacheAge=function(){var E=null;if(this.response){var C=this.response.headers.get("age");E=C?parseFloat(C):null}return E},O.loadProgressively=function(E,C,w,g,v){g===void 0&&(g=0);var h=new M.default,o=E.body.getReader(),_=function m(){return o.read().then(function(T){if(T.done)return h.dataLength&&v(C,w,h.flush(),E),Promise.resolve(new ArrayBuffer(0));var N=T.value,j=N.length;return C.loaded+=j,j<g||h.dataLength?(h.push(N),h.dataLength>=g&&v(C,w,h.flush(),E)):v(C,w,N,E),m()}).catch(function(){return Promise.reject()})};return _()},f}();function u(f,O){var S={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(c({},f.headers))};return f.rangeEnd&&S.headers.set("Range","bytes="+f.rangeStart+"-"+String(f.rangeEnd-1)),S}function a(f,O){return new self.Request(f.url,O)}var s=function(f){H(O,f);function O(S,E,C){var w;return w=f.call(this,S)||this,w.code=void 0,w.details=void 0,w.code=E,w.details=C,w}return O}(U(Error));X.default=l},"./src/utils/imsc1-ttml-parser.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"IMSC1_CODEC",function(){return b}),P.d(X,"parseIMSC1",function(){return r});var V=P("./src/utils/mp4-tools.ts"),L=P("./src/utils/vttparser.ts"),M=P("./src/utils/vttcue.ts"),H=P("./src/demux/id3.ts"),U=P("./src/utils/timescale-conversion.ts"),k=P("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(g){for(var v=1;v<arguments.length;v++){var h=arguments[v];for(var o in h)Object.prototype.hasOwnProperty.call(h,o)&&(g[o]=h[o])}return g},I.apply(this,arguments)}var b="stpp.ttml.im1t",y=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function r(g,v,h,o,_){var m=Object(V.findBox)(new Uint8Array(g),["mdat"]);if(m.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var T=m[0],N=Object(H.utf8ArrayToStr)(new Uint8Array(g,T.start,T.end-T.start)),j=Object(U.toTimescaleFromScale)(v,1,h);try{o(l(N,j))}catch(W){_(W)}}function l(g,v){var h=new DOMParser,o=h.parseFromString(g,"text/xml"),_=o.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var m={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},T=Object.keys(m).reduce(function(B,R){return B[R]=_.getAttribute("ttp:"+R)||m[R],B},{}),N=_.getAttribute("xml:space")!=="preserve",j=a(u(_,"styling","style")),W=a(u(_,"layout","region")),Y=u(_,"body","[begin]");return[].map.call(Y,function(B){var R=s(B,N);if(!R||!B.hasAttribute("begin"))return null;var $=E(B.getAttribute("begin"),T),te=E(B.getAttribute("dur"),T),ue=E(B.getAttribute("end"),T);if($===null)throw S(B);if(ue===null){if(te===null)throw S(B);ue=$+te}var me=new M.default($-v,ue-v,R);me.id=Object(k.generateCueId)(me.startTime,me.endTime,me.text);var Me=W[B.getAttribute("region")],Ae=j[B.getAttribute("style")];me.position=10,me.size=80;var De=f(Me,Ae),Fe=De.textAlign;if(Fe){var Ne=c[Fe];Ne&&(me.lineAlign=Ne),me.align=Fe}return I(me,De),me}).filter(function(B){return B!==null})}function u(g,v,h){var o=g.getElementsByTagName(v)[0];return o?[].slice.call(o.querySelectorAll(h)):[]}function a(g){return g.reduce(function(v,h){var o=h.getAttribute("xml:id");return o&&(v[o]=h),v},{})}function s(g,v){return[].slice.call(g.childNodes).reduce(function(h,o,_){var m;return o.nodeName==="br"&&_?h+`
`:(m=o.childNodes)!==null&&m!==void 0&&m.length?s(o,v):v?h+o.textContent.trim().replace(/\s+/g," "):h+o.textContent},"")}function f(g,v){var h="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(_,m){var T=O(v,h,m)||O(g,h,m);return T&&(_[m]=T),_},{})}function O(g,v,h){return g.hasAttributeNS(v,h)?g.getAttributeNS(v,h):null}function S(g){return new Error("Could not parse ttml timestamp "+g)}function E(g,v){if(!g)return null;var h=Object(L.parseTimeStamp)(g);return h===null&&(y.test(g)?h=C(g,v):p.test(g)&&(h=w(g,v))),h}function C(g,v){var h=y.exec(g),o=(h[4]|0)+(h[5]|0)/v.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+o/v.frameRate}function w(g,v){var h=p.exec(g),o=Number(h[1]),_=h[2];switch(_){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/v.frameRate;case"t":return o/v.tickRate}return o}},"./src/utils/logger.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"enableLogs",function(){return k}),P.d(X,"logger",function(){return I});var V=function(){},L={trace:V,debug:V,log:V,warn:V,info:V,error:V},M=L;function H(b){var y=self.console[b];return y?y.bind(self.console,"["+b+"] >"):V}function U(b){for(var y=arguments.length,p=new Array(y>1?y-1:0),c=1;c<y;c++)p[c-1]=arguments[c];p.forEach(function(r){M[r]=b[r]?b[r].bind(b):H(r)})}function k(b){if(self.console&&b===!0||typeof b=="object"){U(b,"debug","log","info","warn","error");try{M.log()}catch(y){M=L}}else M=L}var I=M},"./src/utils/mediakeys-helper.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"KeySystems",function(){return V}),P.d(X,"requestMediaKeySystemAccess",function(){return L});var V;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(V||(V={}));var L=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"getMediaSource",function(){return V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"bin2str",function(){return U}),P.d(X,"readUint16",function(){return k}),P.d(X,"readUint32",function(){return I}),P.d(X,"writeUint32",function(){return b}),P.d(X,"findBox",function(){return y}),P.d(X,"parseSegmentIndex",function(){return p}),P.d(X,"parseInitSegment",function(){return c}),P.d(X,"getStartDTS",function(){return r}),P.d(X,"getDuration",function(){return l}),P.d(X,"computeRawDurationFromSamples",function(){return u}),P.d(X,"offsetStartDTS",function(){return a}),P.d(X,"segmentValidRange",function(){return s}),P.d(X,"appendUint8Array",function(){return f});var V=P("./src/utils/typed-array.ts"),L=P("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,H=[].push;function U(O){return String.fromCharCode.apply(null,O)}function k(O,S){"data"in O&&(S+=O.start,O=O.data);var E=O[S]<<8|O[S+1];return E<0?65536+E:E}function I(O,S){"data"in O&&(S+=O.start,O=O.data);var E=O[S]<<24|O[S+1]<<16|O[S+2]<<8|O[S+3];return E<0?4294967296+E:E}function b(O,S,E){"data"in O&&(S+=O.start,O=O.data),O[S]=E>>24,O[S+1]=E>>16&255,O[S+2]=E>>8&255,O[S+3]=E&255}function y(O,S){var E=[];if(!S.length)return E;var C,w,g;"data"in O?(C=O.data,w=O.start,g=O.end):(C=O,w=0,g=C.byteLength);for(var v=w;v<g;){var h=I(C,v),o=U(C.subarray(v+4,v+8)),_=h>1?v+h:g;if(o===S[0])if(S.length===1)E.push({data:C,start:v+8,end:_});else{var m=y({data:C,start:v+8,end:_},S.slice(1));m.length&&H.apply(E,m)}v=_}return E}function p(O){var S=y(O,["moov"]),E=S[0],C=E?E.end:null,w=y(O,["sidx"]);if(!w||!w[0])return null;var g=[],v=w[0],h=v.data[0],o=h===0?8:16,_=I(v,o);o+=4;var m=0,T=0;h===0?o+=8:o+=16,o+=2;var N=v.end+T,j=k(v,o);o+=2;for(var W=0;W<j;W++){var Y=o,B=I(v,Y);Y+=4;var R=B&2147483647,$=(B&2147483648)>>>31;if($===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=I(v,Y);Y+=4,g.push({referenceSize:R,subsegmentDuration:te,info:{duration:te/_,start:N,end:N+R-1}}),N+=R,Y+=4,o=Y}return{earliestPresentationTime:m,timescale:_,version:h,referencesCount:j,references:g,moovEndOffset:C}}function c(O){for(var S=[],E=y(O,["moov","trak"]),C=0;C<E.length;C++){var w=E[C],g=y(w,["tkhd"])[0];if(g){var v=g.data[g.start],h=v===0?12:20,o=I(g,h),_=y(w,["mdia","mdhd"])[0];if(_){v=_.data[_.start],h=v===0?12:20;var m=I(_,h),T=y(w,["mdia","hdlr"])[0];if(T){var N=U(T.data.subarray(T.start+8,T.start+12)),j={soun:L.ElementaryStreamTypes.AUDIO,vide:L.ElementaryStreamTypes.VIDEO}[N];if(j){var W=y(w,["mdia","minf","stbl","stsd"])[0],Y=void 0;W&&(Y=U(W.data.subarray(W.start+12,W.start+16))),S[o]={timescale:m,type:j},S[j]={timescale:m,id:o,codec:Y}}}}}}var B=y(O,["moov","mvex","trex"]);return B.forEach(function(R){var $=I(R,4),te=S[$];te&&(te.default={duration:I(R,12),flags:I(R,20)})}),S}function r(O,S){return y(S,["moof","traf"]).reduce(function(E,C){var w=y(C,["tfdt"])[0],g=w.data[w.start],v=y(C,["tfhd"]).reduce(function(h,o){var _=I(o,4),m=O[_];if(m){var T=I(w,4);g===1&&(T*=Math.pow(2,32),T+=I(w,8));var N=m.timescale||9e4,j=T/N;if(isFinite(j)&&(h===null||j<h))return j}return h},null);return v!==null&&isFinite(v)&&(E===null||v<E)?v:E},null)||0}function l(O,S){for(var E=0,C=0,w=0,g=y(O,["moof","traf"]),v=0;v<g.length;v++){var h=g[v],o=y(h,["tfhd"])[0],_=I(o,4),m=S[_];if(!m)continue;var T=m.default,N=I(o,0)|(T==null?void 0:T.flags),j=T==null?void 0:T.duration;N&8&&(N&2?j=I(o,12):j=I(o,8));for(var W=m.timescale||9e4,Y=y(h,["trun"]),B=0;B<Y.length;B++){if(j){var R=I(Y[B],4);E=j*R}else E=u(Y[B]);m.type===L.ElementaryStreamTypes.VIDEO?C+=E/W:m.type===L.ElementaryStreamTypes.AUDIO&&(w+=E/W)}}if(C===0&&w===0){var $=p(O);if($!=null&&$.references)return $.references.reduce(function(te,ue){return te+ue.info.duration||0},0)}return C||w}function u(O){var S=I(O,0),E=8;S&1&&(E+=4),S&4&&(E+=4);for(var C=0,w=I(O,4),g=0;g<w;g++){if(S&256){var v=I(O,E);C+=v,E+=4}S&512&&(E+=4),S&1024&&(E+=4),S&2048&&(E+=4)}return C}function a(O,S,E){y(S,["moof","traf"]).forEach(function(C){y(C,["tfhd"]).forEach(function(w){var g=I(w,4),v=O[g];if(!v)return;var h=v.timescale||9e4;y(C,["tfdt"]).forEach(function(o){var _=o.data[o.start],m=I(o,4);if(_===0)b(o,4,m-E*h);else{m*=Math.pow(2,32),m+=I(o,8),m-=E*h,m=Math.max(m,0);var T=Math.floor(m/(M+1)),N=Math.floor(m%(M+1));b(o,4,T),b(o,8,N)}})})})}function s(O){var S={valid:null,remainder:null},E=y(O,["moof"]);if(E){if(E.length<2)return S.remainder=O,S}else return S;var C=E[E.length-1];return S.valid=Object(V.sliceUint8)(O,0,C.start-8),S.remainder=Object(V.sliceUint8)(O,C.start-8),S}function f(O,S){var E=new Uint8Array(O.length+S.length);return E.set(O),E.set(S,O.length),E}},"./src/utils/output-filter.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function L(H,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=U}var M=L.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(U,k,I){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=k,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},L}()},"./src/utils/texttrack-utils.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"sendAddTrackEvent",function(){return L}),P.d(X,"addCueToTrack",function(){return M}),P.d(X,"clearCurrentCues",function(){return H}),P.d(X,"removeCuesInRange",function(){return U}),P.d(X,"getCuesInRange",function(){return I});var V=P("./src/utils/logger.ts");function L(b,y){var p;try{p=new Event("addtrack")}catch(c){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=b,y.dispatchEvent(p)}function M(b,y){var p=b.mode;if(p==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(y.id))try{if(b.addCue(y),!b.cues.getCueById(y.id))throw new Error("addCue is failed for: "+y)}catch(r){V.logger.debug("[texttrack-utils]: "+r);var c=new self.TextTrackCue(y.startTime,y.endTime,y.text);c.id=y.id,b.addCue(c)}p==="disabled"&&(b.mode=p)}function H(b){var y=b.mode;if(y==="disabled"&&(b.mode="hidden"),b.cues)for(var p=b.cues.length;p--;)b.removeCue(b.cues[p]);y==="disabled"&&(b.mode=y)}function U(b,y,p){var c=b.mode;if(c==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var r=I(b.cues,y,p),l=0;l<r.length;l++)b.removeCue(r[l]);c==="disabled"&&(b.mode=c)}function k(b,y){if(y<b[0].startTime)return 0;var p=b.length-1;if(y>b[p].endTime)return-1;for(var c=0,r=p;c<=r;){var l=Math.floor((r+c)/2);if(y<b[l].startTime)r=l-1;else if(y>b[l].startTime&&c<p)c=l+1;else return l}return b[c].startTime-y<y-b[r].startTime?c:r}function I(b,y,p){var c=[],r=k(b,y);if(r>-1)for(var l=r,u=b.length;l<u;l++){var a=b[l];if(a.startTime>=y&&a.endTime<=p)c.push(a);else if(a.startTime>p)return c}return c}},"./src/utils/time-ranges.ts":function(ae,X,P){"use strict";P.r(X);var V={toString:function(M){for(var H="",U=M.length,k=0;k<U;k++)H+="["+M.start(k).toFixed(3)+","+M.end(k).toFixed(3)+"]";return H}};X.default=V},"./src/utils/timescale-conversion.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"toTimescaleFromBase",function(){return L}),P.d(X,"toTimescaleFromScale",function(){return M}),P.d(X,"toMsFromMpegTsClock",function(){return H}),P.d(X,"toMpegTsClockFromTimescale",function(){return U});var V=9e4;function L(k,I,b,y){b===void 0&&(b=1),y===void 0&&(y=!1);var p=k*I*b;return y?Math.round(p):p}function M(k,I,b,y){return b===void 0&&(b=1),y===void 0&&(y=!1),L(k,I,1/b,y)}function H(k,I){return I===void 0&&(I=!1),L(k,1e3,1/V,I)}function U(k,I){return I===void 0&&(I=1),L(k,V,1/I)}},"./src/utils/typed-array.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"sliceUint8",function(){return V});function V(L,M,H){return Uint8Array.prototype.slice?L.slice(M,H):new Uint8Array(Array.prototype.slice.call(L,M,H))}},"./src/utils/vttcue.ts":function(ae,X,P){"use strict";P.r(X),X.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],L=["start","middle","end","left","right"];function M(b,y){if(typeof y!="string")return!1;if(!Array.isArray(b))return!1;var p=y.toLowerCase();return~b.indexOf(p)?p:!1}function H(b){return M(V,b)}function U(b){return M(L,b)}function k(b){for(var y=arguments.length,p=new Array(y>1?y-1:0),c=1;c<y;c++)p[c-1]=arguments[c];for(var r=1;r<arguments.length;r++){var l=arguments[r];for(var u in l)b[u]=l[u]}return b}function I(b,y,p){var c=this,r={enumerable:!0};c.hasBeenReset=!1;var l="",u=!1,a=b,s=y,f=p,O=null,S="",E=!0,C="auto",w="start",g=50,v="middle",h=50,o="middle";Object.defineProperty(c,"id",k({},r,{get:function(){return l},set:function(m){l=""+m}})),Object.defineProperty(c,"pauseOnExit",k({},r,{get:function(){return u},set:function(m){u=!!m}})),Object.defineProperty(c,"startTime",k({},r,{get:function(){return a},set:function(m){if(typeof m!="number")throw new TypeError("Start time must be set to a number.");a=m,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",k({},r,{get:function(){return s},set:function(m){if(typeof m!="number")throw new TypeError("End time must be set to a number.");s=m,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",k({},r,{get:function(){return f},set:function(m){f=""+m,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",k({},r,{get:function(){return O},set:function(m){O=m,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",k({},r,{get:function(){return S},set:function(m){var T=H(m);if(T===!1)throw new SyntaxError("An invalid or illegal string was specified.");S=T,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",k({},r,{get:function(){return E},set:function(m){E=!!m,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",k({},r,{get:function(){return C},set:function(m){if(typeof m!="number"&&m!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");C=m,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",k({},r,{get:function(){return w},set:function(m){var T=U(m);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");w=T,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",k({},r,{get:function(){return g},set:function(m){if(m<0||m>100)throw new Error("Position must be between 0 and 100.");g=m,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",k({},r,{get:function(){return v},set:function(m){var T=U(m);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");v=T,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",k({},r,{get:function(){return h},set:function(m){if(m<0||m>100)throw new Error("Size must be between 0 and 100.");h=m,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",k({},r,{get:function(){return o},set:function(m){var T=U(m);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");o=T,this.hasBeenReset=!0}})),c.displayState=void 0}return I.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"parseTimeStamp",function(){return M}),P.d(X,"fixLineBreaks",function(){return y}),P.d(X,"VTTParser",function(){return p});var V=P("./src/utils/vttcue.ts"),L=function(){function c(){}var r=c.prototype;return r.decode=function(u,a){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))},c}();function M(c){function r(u,a,s,f){return(u|0)*3600+(a|0)*60+(s|0)+parseFloat(f||0)}var l=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?r(l[2],l[3],0,l[4]):r(l[1],l[2],l[3],l[4]):null}var H=function(){function c(){this.values=Object.create(null)}var r=c.prototype;return r.set=function(u,a){!this.get(u)&&a!==""&&(this.values[u]=a)},r.get=function(u,a,s){return s?this.has(u)?this.values[u]:a[s]:this.has(u)?this.values[u]:a},r.has=function(u){return u in this.values},r.alt=function(u,a,s){for(var f=0;f<s.length;++f)if(a===s[f]){this.set(u,a);break}},r.integer=function(u,a){/^-?\d+$/.test(a)&&this.set(u,parseInt(a,10))},r.percent=function(u,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var s=parseFloat(a);if(s>=0&&s<=100)return this.set(u,s),!0}return!1},c}();function U(c,r,l,u){var a=u?c.split(u):[c];for(var s in a){if(typeof a[s]!="string")continue;var f=a[s].split(l);if(f.length!==2)continue;var O=f[0],S=f[1];r(O,S)}}var k=new V.default(0,0,""),I=k.align==="middle"?"middle":"center";function b(c,r,l){var u=c;function a(){var O=M(c);if(O===null)throw new Error("Malformed timestamp: "+u);return c=c.replace(/^[^\sa-zA-Z-]+/,""),O}function s(O,S){var E=new H;U(O,function(g,v){var h;switch(g){case"region":for(var o=l.length-1;o>=0;o--)if(l[o].id===v){E.set(g,l[o].region);break}break;case"vertical":E.alt(g,v,["rl","lr"]);break;case"line":h=v.split(","),E.integer(g,h[0]),E.percent(g,h[0])&&E.set("snapToLines",!1),E.alt(g,h[0],["auto"]),h.length===2&&E.alt("lineAlign",h[1],["start",I,"end"]);break;case"position":h=v.split(","),E.percent(g,h[0]),h.length===2&&E.alt("positionAlign",h[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":E.percent(g,v);break;case"align":E.alt(g,v,["start",I,"end","left","right"]);break}},/:/,/\s/),S.region=E.get("region",null),S.vertical=E.get("vertical","");var C=E.get("line","auto");C==="auto"&&k.line===-1&&(C=-1),S.line=C,S.lineAlign=E.get("lineAlign","start"),S.snapToLines=E.get("snapToLines",!0),S.size=E.get("size",100),S.align=E.get("align",I);var w=E.get("position","auto");w==="auto"&&k.position===50&&(w=S.align==="start"||S.align==="left"?0:S.align==="end"||S.align==="right"?100:50),S.position=w}function f(){c=c.replace(/^\s+/,"")}if(f(),r.startTime=a(),f(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);c=c.substr(3),f(),r.endTime=a(),f(),s(c,r)}function y(c){return c.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new L,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var r=c.prototype;return r.parse=function(u){var a=this;u&&(a.buffer+=a.decoder.decode(u,{stream:!0}));function s(){var w=a.buffer,g=0;for(w=y(w);g<w.length&&w[g]!=="\r"&&w[g]!==`
`;)++g;var v=w.substr(0,g);return w[g]==="\r"&&++g,w[g]===`
`&&++g,a.buffer=w.substr(g),v}function f(w){U(w,function(g,v){},/:/)}try{var O="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;O=s();var S=O.match(/^()?WEBVTT([ \t].*)?$/);if(!S||!S[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var E=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;E?E=!1:O=s();switch(a.state){case"HEADER":/:/.test(O)?f(O):O||(a.state="ID");continue;case"NOTE":O||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(O)){a.state="NOTE";break}if(!O)continue;if(a.cue=new V.default(0,0,""),a.state="CUE",O.indexOf("-->")===-1){a.cue.id=O;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{b(O,a.cue,a.regionList)}catch(w){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var C=O.indexOf("-->")!==-1;if(!O||C&&(E=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=`
`),a.cue.text+=O}continue;case"BADCUE":O||(a.state="ID")}}}catch(w){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.flush=function(){var u=this;try{if((u.cue||u.state==="HEADER")&&(u.buffer+=`
`,u.parse()),u.state==="INITIAL"||u.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){u.onparsingerror&&u.onparsingerror(a)}return u.onflush&&u.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(ae,X,P){"use strict";P.r(X),P.d(X,"generateCueId",function(){return p}),P.d(X,"parseWebVTT",function(){return r});var V=P("./src/polyfills/number.ts"),L=P("./src/utils/vttparser.ts"),M=P("./src/demux/id3.ts"),H=P("./src/utils/timescale-conversion.ts"),U=P("./src/remux/mp4-remuxer.ts"),k=/\r\n|\n\r|\n|\r/g,I=function(u,a,s){return s===void 0&&(s=0),u.substr(s,a.length)===a},b=function(u){var a=parseInt(u.substr(-3)),s=parseInt(u.substr(-6,2)),f=parseInt(u.substr(-9,2)),O=u.length>9?parseInt(u.substr(0,u.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(a)||!Object(V.isFiniteNumber)(s)||!Object(V.isFiniteNumber)(f)||!Object(V.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+u);return a+=1e3*s,a+=60*1e3*f,a+=60*60*1e3*O,a},y=function(u){for(var a=5381,s=u.length;s;)a=a*33^u.charCodeAt(--s);return(a>>>0).toString()};function p(l,u,a){return y(l.toString())+y(u.toString())+y(a)}var c=function(u,a,s){var f=u[a],O=u[f.prevCC];if(!O||!O.new&&f.new){u.ccOffset=u.presentationOffset=f.start,f.new=!1;return}for(;(S=O)!==null&&S!==void 0&&S.new;){var S;u.ccOffset+=f.start-O.start,f.new=!1,f=O,O=u[f.prevCC]}u.presentationOffset=s};function r(l,u,a,s,f,O,S,E){var C=new L.VTTParser,w=Object(M.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(k,`
`).split(`
`),g=[],v=Object(H.toMpegTsClockFromTimescale)(u,a),h="00:00.000",o=0,_=0,m,T=!0,N=!1;C.oncue=function(j){var W=s[f],Y=s.ccOffset,B=(o-v)/9e4;if(W!=null&&W.new&&(_!==void 0?Y=s.ccOffset=W.start:c(s,f,B)),B&&(Y=B-s.presentationOffset),N){var R=j.endTime-j.startTime,$=Object(U.normalizePts)((j.startTime+Y-_)*9e4,O*9e4)/9e4;j.startTime=$,j.endTime=$+R}var te=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(te)),j.id||(j.id=p(j.startTime,j.endTime,te)),j.endTime>0&&g.push(j)},C.onparsingerror=function(j){m=j},C.onflush=function(){if(m){E(m);return}S(g)},w.forEach(function(j){if(T)if(I(j,"X-TIMESTAMP-MAP=")){T=!1,N=!0,j.substr(16).split(",").forEach(function(W){I(W,"LOCAL:")?h=W.substr(6):I(W,"MPEGTS:")&&(o=parseInt(W.substr(7)))});try{_=b(h)/1e3}catch(W){N=!1,m=W}return}else j===""&&(T=!1);C.parse(j+`
`)}),C.flush()}},"./src/utils/xhr-loader.ts":function(ae,X,P){"use strict";P.r(X);var V=P("./src/utils/logger.ts"),L=P("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,H=function(){function U(I){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=I?I.xhrSetup:null,this.stats=new L.LoadStats,this.retryDelay=0}var k=U.prototype;return k.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},k.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},k.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},k.load=function(b,y,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=y,this.callbacks=p,this.retryDelay=y.retryDelay,this.loadInternal()},k.loadInternal=function(){var b=this.config,y=this.context;if(!b)return;var p=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var r=this.xhrSetup;try{if(r)try{r(p,y.url)}catch(a){p.open("GET",y.url,!0),r(p,y.url)}p.readyState||p.open("GET",y.url,!0);var l=this.context.headers;if(l)for(var u in l)p.setRequestHeader(u,l[u])}catch(a){this.callbacks.onError({code:p.status,text:a.message},y,p);return}y.rangeEnd&&p.setRequestHeader("Range","bytes="+y.rangeStart+"-"+(y.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=y.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),p.send()},k.readystatechange=function(){var b=this.context,y=this.loader,p=this.stats;if(!b||!y)return;var c=y.readyState,r=this.config;if(p.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),c===4){y.onreadystatechange=null,y.onprogress=null;var l=y.status;if(l>=200&&l<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var u,a;if(b.responseType==="arraybuffer"?(u=y.response,a=u.byteLength):(u=y.responseText,a=u.length),p.loaded=p.total=a,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(p,b,u,y),!this.callbacks)return;var f={url:y.responseURL,data:u};this.callbacks.onSuccess(f,p,b,y)}else p.retry>=r.maxRetry||l>=400&&l<499?(V.logger.error(l+" while loading "+b.url),this.callbacks.onError({code:l,text:y.statusText},b,y)):(V.logger.warn(l+" while loading "+b.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,r.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},k.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},k.loadprogress=function(b){var y=this.stats;y.loaded=b.loaded,b.lengthComputable&&(y.total=b.total)},k.getCacheAge=function(){var b=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var y=this.loader.getResponseHeader("age");b=y?parseFloat(y):null}return b},U}();X.default=H}}).default})},vHTk:function(Rt,$e,Q){Rt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return nt});var ae=Q("rePB"),X=Q("VTBJ"),P=Q("KQm4"),V=Q("U8pU"),L=Q("ODXe"),M=Q("q1tI"),H=Q("TSYQ"),U=Q.n(H),k=Q("Gytx"),I=Q.n(k),b=Q("Kwbf"),y=Q("t23M"),p=Q("qx4F"),c=Q("6eGT"),r=Q("IBYe"),l=Q("Ff2n"),u=Q("c+Xe"),a=Q("fyJ8"),s=Q("biw7");function f(Re,Te,Ke,ze,Ce){var We=Ke[Re]||{},ve=Ke[Te]||{},ce,he;We.fixed==="left"?ce=ze.left[Re]:ve.fixed==="right"&&(he=ze.right[Te]);var ne=!1,oe=!1,le=!1,pe=!1,ge=Ke[Te+1],Pe=Ke[Re-1];if(Ce==="rtl"){if(ce!==void 0){var Ge=Pe&&Pe.fixed==="left";pe=!Ge}else if(he!==void 0){var rt=ge&&ge.fixed==="right";le=!rt}}else if(ce!==void 0){var vt=ge&&ge.fixed==="left";ne=!vt}else if(he!==void 0){var tt=Pe&&Pe.fixed==="right";oe=!tt}return{fixLeft:ce,fixRight:he,lastFixLeft:ne,firstFixRight:oe,lastFixRight:le,firstFixLeft:pe,isSticky:ze.isSticky}}var O=Q("sR1s");function S(Re){var Te=Re.cells,Ke=Re.stickyOffsets,ze=Re.flattenColumns,Ce=Re.rowComponent,We=Re.cellComponent,ve=Re.onHeaderRow,ce=Re.index,he=M.useContext(s.a),ne=he.prefixCls,oe=he.direction,le;ve&&(le=ve(Te.map(function(ge){return ge.column}),ce));var pe=Object(O.a)(Te.map(function(ge){return ge.column}));return M.createElement(Ce,Object.assign({},le),Te.map(function(ge,Pe){var Ge=ge.column,rt=f(ge.colStart,ge.colEnd,ze,Ke,oe),vt;return Ge&&Ge.onHeaderCell&&(vt=ge.column.onHeaderCell(Ge)),M.createElement(a.a,Object.assign({},ge,{ellipsis:Ge.ellipsis,align:Ge.align,component:We,prefixCls:ne,key:pe[Pe]},rt,{additionalProps:vt,rowType:"header"}))}))}S.displayName="HeaderRow";var E=S;function C(Re){var Te=[];function Ke(ve,ce){var he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Te[he]=Te[he]||[];var ne=ce,oe=ve.filter(Boolean).map(function(le){var pe={key:le.key,className:le.className||"",children:le.title,column:le,colStart:ne},ge=1,Pe=le.children;return Pe&&Pe.length>0&&(ge=Ke(Pe,ne,he+1).reduce(function(Ge,rt){return Ge+rt},0),pe.hasSubColumns=!0),"colSpan"in le&&(ge=le.colSpan),"rowSpan"in le&&(pe.rowSpan=le.rowSpan),pe.colSpan=ge,pe.colEnd=pe.colStart+ge-1,Te[he].push(pe),ne+=ge,ge});return oe}Ke(Re,0);for(var ze=Te.length,Ce=function(ce){Te[ce].forEach(function(he){!("rowSpan"in he)&&!he.hasSubColumns&&(he.rowSpan=ze-ce)})},We=0;We<ze;We+=1)Ce(We);return Te}function w(Re){var Te=Re.stickyOffsets,Ke=Re.columns,ze=Re.flattenColumns,Ce=Re.onHeaderRow,We=M.useContext(s.a),ve=We.prefixCls,ce=We.getComponent,he=M.useMemo(function(){return C(Ke)},[Ke]),ne=ce(["header","wrapper"],"thead"),oe=ce(["header","row"],"tr"),le=ce(["header","cell"],"th");return M.createElement(ne,{className:"".concat(ve,"-thead")},he.map(function(pe,ge){var Pe=M.createElement(E,{key:ge,flattenColumns:ze,cells:pe,stickyOffsets:Te,rowComponent:oe,cellComponent:le,onHeaderRow:Ce,index:ge});return Pe}))}var g=w,v=Q("hW8S");function h(Re){for(var Te=Re.colWidths,Ke=Re.columns,ze=Re.columCount,Ce=[],We=ze||Ke.length,ve=!1,ce=We-1;ce>=0;ce-=1){var he=Te[ce],ne=Ke&&Ke[ce],oe=ne&&ne[v.a];(he||oe||ve)&&(Ce.unshift(M.createElement("col",Object.assign({key:ce,style:{width:he,minWidth:he}},oe))),ve=!0)}return M.createElement("colgroup",null,Ce)}var o=h;function _(Re,Te){return Object(M.useMemo)(function(){for(var Ke=[],ze=0;ze<Te;ze+=1){var Ce=Re[ze];if(Ce!==void 0)Ke[ze]=Ce;else return null}return Ke},[Re.join("_"),Te])}var m=M.forwardRef(function(Re,Te){var Ke=Re.noData,ze=Re.columns,Ce=Re.flattenColumns,We=Re.colWidths,ve=Re.columCount,ce=Re.stickyOffsets,he=Re.direction,ne=Re.fixHeader,oe=Re.offsetHeader,le=Re.stickyClassName,pe=Re.onScroll,ge=Object(l.a)(Re,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Pe=M.useContext(s.a),Ge=Pe.prefixCls,rt=Pe.scrollbarSize,vt=Pe.isSticky,tt=vt&&!ne?0:rt,Wt=M.useRef(null),Nt=M.useCallback(function(rn){Object(u.b)(Te,rn),Object(u.b)(Wt,rn)},[]);M.useEffect(function(){var rn;function kt(Xe){var Lt=Xe.currentTarget,Ut=Xe.deltaX;Ut&&(pe({currentTarget:Lt,scrollLeft:Lt.scrollLeft+Ut}),Xe.preventDefault())}return(rn=Wt.current)===null||rn===void 0||rn.addEventListener("wheel",kt),function(){var Xe;(Xe=Wt.current)===null||Xe===void 0||Xe.removeEventListener("wheel",kt)}},[]);var _t=Ce[Ce.length-1],Qt={fixed:_t?_t.fixed:null,onHeaderCell:function(){return{className:"".concat(Ge,"-cell-scrollbar")}}},Jt=Object(M.useMemo)(function(){return tt?[].concat(Object(P.a)(ze),[Qt]):ze},[tt,ze]),Yt=Object(M.useMemo)(function(){return tt?[].concat(Object(P.a)(Ce),[Qt]):Ce},[tt,Ce]),cn=Object(M.useMemo)(function(){var rn=ce.right,kt=ce.left;return Object(X.a)(Object(X.a)({},ce),{},{left:he==="rtl"?[].concat(Object(P.a)(kt.map(function(Xe){return Xe+tt})),[0]):kt,right:he==="rtl"?rn:[].concat(Object(P.a)(rn.map(function(Xe){return Xe+tt})),[0]),isSticky:vt})},[tt,ce,vt]),jt=_(We,ve);return M.createElement("div",{style:Object(X.a)({overflow:"hidden"},vt?{top:oe}:{}),ref:Nt,className:U()("".concat(Ge,"-header"),Object(ae.a)({},le,!!le))},M.createElement("table",{style:{tableLayout:"fixed",visibility:Ke||jt?null:"hidden"}},M.createElement(o,{colWidths:jt?[].concat(Object(P.a)(jt),[tt]):[],columCount:ve+1,columns:Yt}),M.createElement(g,Object.assign({},ge,{stickyOffsets:cn,columns:Jt,flattenColumns:Yt}))))});m.displayName="FixedHeader";var T=m,N=M.createContext(null),j=N;function W(Re){var Te=Re.prefixCls,Ke=Re.children,ze=Re.component,Ce=Re.cellComponent,We=Re.fixHeader,ve=Re.fixColumn,ce=Re.horizonScroll,he=Re.className,ne=Re.expanded,oe=Re.componentWidth,le=Re.colSpan,pe=M.useContext(s.a),ge=pe.scrollbarSize;return M.useMemo(function(){var Pe=Ke;return ve&&(Pe=M.createElement("div",{style:{width:oe-(We?ge:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Te,"-expanded-row-fixed")},Pe)),M.createElement(ze,{className:he,style:{display:ne?null:"none"}},M.createElement(a.a,{component:Ce,prefixCls:Te,colSpan:le},Pe))},[Ke,ze,We,ce,he,ne,oe,le,ge])}var Y=W;function B(Re){var Te=Re.className,Ke=Re.style,ze=Re.record,Ce=Re.index,We=Re.rowKey,ve=Re.getRowKey,ce=Re.rowExpandable,he=Re.expandedKeys,ne=Re.onRow,oe=Re.indent,le=oe===void 0?0:oe,pe=Re.rowComponent,ge=Re.cellComponent,Pe=Re.childrenColumnName,Ge=M.useContext(s.a),rt=Ge.prefixCls,vt=Ge.fixedInfoList,tt=M.useContext(j),Wt=tt.fixHeader,Nt=tt.fixColumn,_t=tt.horizonScroll,Qt=tt.componentWidth,Jt=tt.flattenColumns,Yt=tt.expandableType,cn=tt.expandRowByClick,jt=tt.onTriggerExpand,rn=tt.rowClassName,kt=tt.expandedRowClassName,Xe=tt.indentSize,Lt=tt.expandIcon,Ut=tt.expandedRowRender,Mt=tt.expandIconColumnIndex,Zt=M.useState(!1),Ln=Object(L.a)(Zt,2),Ni=Ln[0],vn=Ln[1],At=he&&he.has(Re.recordKey);M.useEffect(function(){At&&vn(!0)},[At]);var li=Yt==="row"&&(!ce||ce(ze)),Li=Yt==="nest",Zn=Pe&&ze&&ze[Pe],an=li||Li,Qn;ne&&(Qn=ne(ze,Ce));var Ii=function(x){if(cn&&an&&jt(ze,x),Qn&&Qn.onClick){for(var A,F=arguments.length,q=new Array(F>1?F-1:0),z=1;z<F;z++)q[z-1]=arguments[z];(A=Qn).onClick.apply(A,[x].concat(q))}},Ui;typeof rn=="string"?Ui=rn:typeof rn=="function"&&(Ui=rn(ze,Ce,le));var ht=Object(O.a)(Jt),zt=M.createElement(pe,Object.assign({},Qn,{"data-row-key":We,className:U()(Te,"".concat(rt,"-row"),"".concat(rt,"-row-level-").concat(le),Ui,Qn&&Qn.className),style:Object(X.a)(Object(X.a)({},Ke),Qn?Qn.style:null),onClick:Ii}),Jt.map(function(G,x){var A=G.render,F=G.dataIndex,q=G.className,z=ht[x],we=vt[x],Ze;x===(Mt||0)&&Li&&(Ze=M.createElement(M.Fragment,null,M.createElement("span",{style:{paddingLeft:"".concat(Xe*le,"px")},className:"".concat(rt,"-row-indent indent-level-").concat(le)}),Lt({prefixCls:rt,expanded:At,expandable:Zn,record:ze,onExpand:jt})));var xt;return G.onCell&&(xt=G.onCell(ze,Ce)),M.createElement(a.a,Object.assign({className:q,ellipsis:G.ellipsis,align:G.align,component:ge,prefixCls:rt,key:z,record:ze,index:Ce,dataIndex:F,render:A,shouldCellUpdate:G.shouldCellUpdate},we,{appendNode:Ze,additionalProps:xt}))})),Di;if(li&&(Ni||At)){var Hi=Ut(ze,Ce,le+1,At),ir=kt&&kt(ze,Ce,le);Di=M.createElement(Y,{expanded:At,className:U()("".concat(rt,"-expanded-row"),"".concat(rt,"-expanded-row-level-").concat(le+1),ir),prefixCls:rt,fixHeader:Wt,fixColumn:Nt,horizonScroll:_t,component:pe,componentWidth:Qt,cellComponent:ge,colSpan:Jt.length},Hi)}var Wi;return Zn&&At&&(Wi=(ze[Pe]||[]).map(function(G,x){var A=ve(G,x);return M.createElement(B,Object.assign({},Re,{key:A,rowKey:A,record:G,recordKey:A,index:x,indent:le+1}))})),M.createElement(M.Fragment,null,zt,Di,Wi)}B.displayName="BodyRow";var R=B,$=M.createContext(null),te=$;function ue(Re){var Te=Re.columnKey,Ke=Re.onColumnResize,ze=M.useRef();return M.useEffect(function(){ze.current&&Ke(Te,ze.current.offsetWidth)},[]),M.createElement(y.a,{onResize:function(We){var ve=We.offsetWidth;Ke(Te,ve)}},M.createElement("td",{ref:ze,style:{padding:0,border:0,height:0}},M.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function me(Re){var Te=Re.data,Ke=Re.getRowKey,ze=Re.measureColumnWidth,Ce=Re.expandedKeys,We=Re.onRow,ve=Re.rowExpandable,ce=Re.emptyNode,he=Re.childrenColumnName,ne=M.useContext(te),oe=ne.onColumnResize,le=M.useContext(s.a),pe=le.prefixCls,ge=le.getComponent,Pe=M.useContext(j),Ge=Pe.fixHeader,rt=Pe.horizonScroll,vt=Pe.flattenColumns,tt=Pe.componentWidth;return M.useMemo(function(){var Wt=ge(["body","wrapper"],"tbody"),Nt=ge(["body","row"],"tr"),_t=ge(["body","cell"],"td"),Qt;Te.length?Qt=Te.map(function(Yt,cn){var jt=Ke(Yt,cn);return M.createElement(R,{key:jt,rowKey:jt,record:Yt,recordKey:jt,index:cn,rowComponent:Nt,cellComponent:_t,expandedKeys:Ce,onRow:We,getRowKey:Ke,rowExpandable:ve,childrenColumnName:he})}):Qt=M.createElement(Y,{expanded:!0,className:"".concat(pe,"-placeholder"),prefixCls:pe,fixHeader:Ge,fixColumn:rt,horizonScroll:rt,component:Nt,componentWidth:tt,cellComponent:_t,colSpan:vt.length},ce);var Jt=Object(O.a)(vt);return M.createElement(Wt,{className:"".concat(pe,"-tbody")},ze&&M.createElement("tr",{"aria-hidden":"true",className:"".concat(pe,"-measure-row"),style:{height:0}},Jt.map(function(Yt){return M.createElement(ue,{key:Yt,columnKey:Yt,onColumnResize:oe})})),Qt)},[Te,pe,We,ze,Ce,Ke,ge,tt,ce,vt])}var Me=M.memo(me);Me.displayName="Body";var Ae=Me,De=Q("wRmb"),Fe=Q("xEkU"),Ne=Q.n(Fe);function Ee(Re){var Te=Object(M.useRef)(Re),Ke=Object(M.useState)({}),ze=Object(L.a)(Ke,2),Ce=ze[1],We=Object(M.useRef)(null),ve=Object(M.useRef)([]);function ce(he){We.current===null&&(ve.current=[],We.current=Ne()(function(){ve.current.forEach(function(ne){Te.current=ne(Te.current)}),We.current=null,Ce({})})),ve.current.push(he)}return Object(M.useEffect)(function(){return function(){Ne.a.cancel(We.current)}},[]),[Te.current,ce]}function se(Re){var Te=Object(M.useRef)(Re),Ke=Object(M.useRef)(null);function ze(){window.clearTimeout(Ke.current)}function Ce(ve){Te.current=ve,ze(),Ke.current=window.setTimeout(function(){Te.current=null,Ke.current=null},100)}function We(){return Te.current}return Object(M.useEffect)(function(){return ze},[]),[Ce,We]}function He(Re,Te,Ke){var ze=Object(M.useMemo)(function(){for(var Ce=[],We=[],ve=0,ce=0,he=0;he<Te;he+=1)if(Ke==="rtl"){We[he]=ce,ce+=Re[he]||0;var ne=Te-he-1;Ce[ne]=ve,ve+=Re[ne]||0}else{Ce[he]=ve,ve+=Re[he]||0;var oe=Te-he-1;We[oe]=ce,ce+=Re[oe]||0}return{left:Ce,right:We}},[Re,Te,Ke]);return ze}var ft=He;function lt(Re){var Te=Re.className,Ke=Re.children;return M.createElement("div",{className:Te},Ke)}var it=lt,ct=Q("n6Qo");function Ve(Re){var Te,Ke=Re.prefixCls,ze=Re.record,Ce=Re.onExpand,We=Re.expanded,ve=Re.expandable,ce="".concat(Ke,"-row-expand-icon");if(!ve)return M.createElement("span",{className:U()(ce,"".concat(Ke,"-row-spaced"))});var he=function(oe){Ce(ze,oe),oe.stopPropagation()};return M.createElement("span",{className:U()(ce,(Te={},Object(ae.a)(Te,"".concat(Ke,"-row-expanded"),We),Object(ae.a)(Te,"".concat(Ke,"-row-collapsed"),!We),Te)),onClick:he})}function Je(Re,Te,Ke){var ze=[];function Ce(We){(We||[]).forEach(function(ve,ce){ze.push(Te(ve,ce)),Ce(ve[Ke])})}return Ce(Re),ze}var st=Q("zT1h"),gt=Q("y0+3"),ut=function(Te,Ke){var ze,Ce,We=Te.scrollBodyRef,ve=Te.onScroll,ce=Te.offsetScroll,he=M.useContext(s.a),ne=he.prefixCls,oe=((ze=We.current)===null||ze===void 0?void 0:ze.scrollWidth)||0,le=((Ce=We.current)===null||Ce===void 0?void 0:Ce.clientWidth)||0,pe=oe&&le*(le/oe),ge=M.useRef(),Pe=Ee({scrollLeft:0,isHiddenScrollBar:!1}),Ge=Object(L.a)(Pe,2),rt=Ge[0],vt=Ge[1],tt=M.useRef({delta:0,x:0}),Wt=M.useState(!1),Nt=Object(L.a)(Wt,2),_t=Nt[0],Qt=Nt[1],Jt=function(){Qt(!1)},Yt=function(Xe){Xe.persist(),tt.current.delta=Xe.pageX-rt.scrollLeft,tt.current.x=0,Qt(!0),Xe.preventDefault()},cn=function(Xe){var Lt,Ut=Xe||((Lt=window)===null||Lt===void 0?void 0:Lt.event),Mt=Ut.buttons;if(!_t||Mt===0){_t&&Qt(!1);return}var Zt=tt.current.x+Xe.pageX-tt.current.x-tt.current.delta;Zt<=0&&(Zt=0),Zt+pe>=le&&(Zt=le-pe),ve({scrollLeft:Zt/le*(oe+2)}),tt.current.x=Xe.pageX},jt=function(){var Xe=Object(gt.b)(We.current).top,Lt=Xe+We.current.offsetHeight,Ut=document.documentElement.scrollTop+window.innerHeight;Lt-Object(p.a)()<=Ut||Xe>=Ut-ce?vt(function(Mt){return Object(X.a)(Object(X.a)({},Mt),{},{isHiddenScrollBar:!0})}):vt(function(Mt){return Object(X.a)(Object(X.a)({},Mt),{},{isHiddenScrollBar:!1})})},rn=function(Xe){vt(function(Lt){return Object(X.a)(Object(X.a)({},Lt),{},{scrollLeft:Xe/oe*le||0})})};return M.useImperativeHandle(Ke,function(){return{setScrollLeft:rn}}),M.useEffect(function(){var kt=Object(st.a)(document.body,"mouseup",Jt,!1),Xe=Object(st.a)(document.body,"mousemove",cn,!1);return jt(),function(){kt.remove(),Xe.remove()}},[pe,_t]),M.useEffect(function(){var kt=Object(st.a)(window,"scroll",jt,!1),Xe=Object(st.a)(window,"resize",jt,!1);return function(){kt.remove(),Xe.remove()}},[]),M.useEffect(function(){rt.isHiddenScrollBar||vt(function(kt){var Xe,Lt;return Object(X.a)(Object(X.a)({},kt),{},{scrollLeft:We.current.scrollLeft/((Xe=We.current)===null||Xe===void 0?void 0:Xe.scrollWidth)*((Lt=We.current)===null||Lt===void 0?void 0:Lt.clientWidth)})})},[rt.isHiddenScrollBar]),oe<=le||!pe||rt.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(p.a)(),width:le,bottom:ce},className:"".concat(ne,"-sticky-scroll")},M.createElement("div",{onMouseDown:Yt,ref:ge,className:U()("".concat(ne,"-sticky-scroll-bar"),Object(ae.a)({},"".concat(ne,"-sticky-scroll-bar-active"),_t)),style:{width:"".concat(pe,"px"),transform:"translate3d(".concat(rt.scrollLeft,"px, 0, 0)")}}))},et=M.forwardRef(ut);function qe(Re,Te){return M.useMemo(function(){var Ke=!!Re;return{isSticky:Ke,stickyClassName:Ke?"".concat(Te,"-sticky-header"):"",offsetHeader:Object(V.a)(Re)==="object"&&Re.offsetHeader||0,offsetScroll:Object(V.a)(Re)==="object"&&Re.offsetScroll||0}},[Re,Te])}var St=[],pt={},nt="rc-table-internal-hook",at=M.memo(function(Re){var Te=Re.children;return Te},function(Re,Te){return I()(Re.props,Te.props)?Re.pingLeft!==Te.pingLeft||Re.pingRight!==Te.pingRight:!1});function bt(Re){var Te,Ke=Re.prefixCls,ze=Re.className,Ce=Re.rowClassName,We=Re.style,ve=Re.data,ce=Re.rowKey,he=Re.scroll,ne=Re.tableLayout,oe=Re.direction,le=Re.title,pe=Re.footer,ge=Re.summary,Pe=Re.id,Ge=Re.showHeader,rt=Re.components,vt=Re.emptyText,tt=Re.onRow,Wt=Re.onHeaderRow,Nt=Re.internalHooks,_t=Re.transformColumns,Qt=Re.internalRefs,Jt=Re.sticky,Yt=ve||St,cn=!!Yt.length,jt=M.useState(0),rn=Object(L.a)(jt,2),kt=rn[0],Xe=rn[1];M.useEffect(function(){Xe(Object(p.a)())});var Lt=M.useMemo(function(){return Object(O.c)(rt,{})},[rt]),Ut=M.useCallback(function(kn,Tn){return Object(O.b)(Lt,kn)||Tn},[Lt]),Mt=M.useMemo(function(){return typeof ce=="function"?ce:function(kn){var Tn=kn&&kn[ce];return Tn}},[ce]),Zt=Object(v.c)(Re),Ln=Zt.expandIcon,Ni=Zt.expandedRowKeys,vn=Zt.defaultExpandedRowKeys,At=Zt.defaultExpandAllRows,li=Zt.expandedRowRender,Li=Zt.onExpand,Zn=Zt.onExpandedRowsChange,an=Zt.expandRowByClick,Qn=Zt.rowExpandable,Ii=Zt.expandIconColumnIndex,Ui=Zt.expandedRowClassName,ht=Zt.childrenColumnName,zt=Zt.indentSize,Di=Ln||Ve,Hi=ht||"children",ir=M.useMemo(function(){return li?"row":Re.expandable&&Nt===nt&&Re.expandable.__PARENT_RENDER_ICON__||Yt.some(function(kn){return kn&&Object(V.a)(kn)==="object"&&kn[Hi]})?"nest":!1},[!!li,Yt]),Wi=M.useState(function(){return vn||(At?Je(Yt,Mt,Hi):[])}),G=Object(L.a)(Wi,2),x=G[0],A=G[1],F=M.useMemo(function(){return new Set(Ni||x||[])},[Ni,x]),q=M.useCallback(function(kn){var Tn=Mt(kn,Yt.indexOf(kn)),_n,Gi=F.has(Tn);Gi?(F.delete(Tn),_n=Object(P.a)(F)):_n=[].concat(Object(P.a)(F),[Tn]),A(_n),Li&&Li(!Gi,kn),Zn&&Zn(_n)},[Mt,F,Yt,Li,Zn]),z=M.useState(0),we=Object(L.a)(z,2),Ze=we[0],xt=we[1],Dt=Object(De.b)(Object(X.a)(Object(X.a)(Object(X.a)({},Re),Zt),{},{expandable:!!li,expandedKeys:F,getRowKey:Mt,onTriggerExpand:q,expandIcon:Di,expandIconColumnIndex:Ii,direction:oe}),Nt===nt?_t:null),ot=Object(L.a)(Dt,2),Kt=ot[0],$t=ot[1],Pn=M.useMemo(function(){return{columns:Kt,flattenColumns:$t}},[Kt,$t]),yi=M.useRef(),fi=M.useRef(),Vn=M.useRef(),rr=M.useState(!1),wr=Object(L.a)(rr,2),ii=wr[0],Ki=wr[1],yr=M.useState(!1),ar=Object(L.a)(yr,2),bi=ar[0],Rr=ar[1],Sr=Ee(new Map),Ar=Object(L.a)(Sr,2),Nr=Ar[0],or=Ar[1],ui=Object(O.a)($t),pr=ui.map(function(kn){return Nr.get(kn)}),Ur=M.useMemo(function(){return pr},[pr.join("_")]),mr=ft(Ur,$t.length,oe),In=he&&Object(O.d)(he.y),on=he&&Object(O.d)(he.x),Wn=on&&$t.some(function(kn){var Tn=kn.fixed;return Tn}),ln=M.useRef(),Xn=qe(Jt,Ke),Cn=Xn.isSticky,sr=Xn.offsetHeader,di=Xn.offsetScroll,_i=Xn.stickyClassName,Cr,lr,gr;In&&(lr={overflowY:"scroll",maxHeight:he.y}),on&&(Cr={overflowX:"auto"},In||(lr={overflowY:"hidden"}),gr={width:he.x===!0?"auto":he.x,minWidth:"100%"});var ji=M.useCallback(function(kn,Tn){or(function(_n){var Gi=new Map(_n);return Gi.set(kn,Tn),Gi})},[]),zi=se(null),jr=Object(L.a)(zi,2),$i=jr[0],Fr=jr[1];function Lr(kn,Tn){if(!Tn)return;typeof Tn=="function"?Tn(kn):Tn.scrollLeft!==kn&&(Tn.scrollLeft=kn)}var Ji=function(Tn){var _n=Tn.currentTarget,Gi=Tn.scrollLeft,Br=typeof Gi=="number"?Gi:_n.scrollLeft,Hr=_n||pt;if(!Fr()||Fr()===Hr){var ga;$i(Hr),Lr(Br,fi.current),Lr(Br,Vn.current),Lr(Br,(ga=ln.current)===null||ga===void 0?void 0:ga.setScrollLeft)}if(_n){var va=_n.scrollWidth,Sa=_n.clientWidth;Ki(Br>0),Rr(Br<va-Sa)}},Jr=function(){Vn.current&&Ji({currentTarget:Vn.current})},Ft=function(Tn){var _n=Tn.width;Jr(),xt(yi.current?yi.current.offsetWidth:_n)};M.useEffect(function(){return Jr},[]),M.useEffect(function(){on&&Jr()},[on]),M.useEffect(function(){Nt===nt&&Qt&&(Qt.body.current=Vn.current)});var qt=Ut(["table"],"table"),Ht=M.useMemo(function(){return ne||(Wn?he.x==="max-content"?"auto":"fixed":In||$t.some(function(kn){var Tn=kn.ellipsis;return Tn})?"fixed":"auto")},[In,Wn,$t,ne]),sn,yn={colWidths:Ur,columCount:$t.length,stickyOffsets:mr,onHeaderRow:Wt,fixHeader:In},Nn=M.useMemo(function(){return cn?null:typeof vt=="function"?vt():vt},[cn,vt]),bn=M.createElement(Ae,{data:Yt,measureColumnWidth:In||on||Cn,expandedKeys:F,rowExpandable:Qn,getRowKey:Mt,onRow:tt,emptyNode:Nn,childrenColumnName:Hi}),qn=M.createElement(o,{colWidths:$t.map(function(kn){var Tn=kn.width;return Tn}),columns:$t}),ki=ge&&M.createElement(ct.b,null,ge(Yt)),hn=Ut(["body"]);if(In||Cn){var ur;typeof hn=="function"?(ur=hn(Yt,{scrollbarSize:kt,ref:Vn,onScroll:Ji}),yn.colWidths=$t.map(function(kn,Tn){var _n=kn.width,Gi=Tn===Kt.length-1?_n-kt:_n;return typeof Gi=="number"&&!Number.isNaN(Gi)?Gi:(Object(b.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):ur=M.createElement("div",{style:Object(X.a)(Object(X.a)({},Cr),lr),onScroll:Ji,ref:Vn,className:U()("".concat(Ke,"-body"))},M.createElement(qt,{style:Object(X.a)(Object(X.a)({},gr),{},{tableLayout:Ht})},qn,bn,ki),Cn&&M.createElement(et,{ref:ln,offsetScroll:di,scrollBodyRef:Vn,onScroll:Ji})),sn=M.createElement(M.Fragment,null,Ge!==!1&&M.createElement(T,Object.assign({noData:!Yt.length},yn,Pn,{direction:oe,offsetHeader:sr,stickyClassName:_i,ref:fi,onScroll:Ji})),ur)}else sn=M.createElement("div",{style:Object(X.a)(Object(X.a)({},Cr),lr),className:U()("".concat(Ke,"-content")),onScroll:Ji,ref:Vn},M.createElement(qt,{style:Object(X.a)(Object(X.a)({},gr),{},{tableLayout:Ht})},qn,Ge!==!1&&M.createElement(g,Object.assign({},yn,Pn)),bn,ki));var Dn=Object(v.b)(Re),pi=M.createElement("div",Object.assign({className:U()(Ke,ze,(Te={},Object(ae.a)(Te,"".concat(Ke,"-rtl"),oe==="rtl"),Object(ae.a)(Te,"".concat(Ke,"-ping-left"),ii),Object(ae.a)(Te,"".concat(Ke,"-ping-right"),bi),Object(ae.a)(Te,"".concat(Ke,"-layout-fixed"),ne==="fixed"),Object(ae.a)(Te,"".concat(Ke,"-fixed-header"),In),Object(ae.a)(Te,"".concat(Ke,"-fixed-column"),Wn),Object(ae.a)(Te,"".concat(Ke,"-scroll-horizontal"),on),Object(ae.a)(Te,"".concat(Ke,"-has-fix-left"),$t[0]&&$t[0].fixed),Object(ae.a)(Te,"".concat(Ke,"-has-fix-right"),$t[$t.length-1]&&$t[$t.length-1].fixed==="right"),Te)),style:We,id:Pe,ref:yi},Dn),M.createElement(at,{pingLeft:ii,pingRight:bi,props:Object(X.a)(Object(X.a)({},Re),{},{stickyOffsets:mr,mergedExpandedKeys:F})},le&&M.createElement(it,{className:"".concat(Ke,"-title")},le(Yt)),M.createElement("div",{className:"".concat(Ke,"-container")},sn),pe&&M.createElement(it,{className:"".concat(Ke,"-footer")},pe(Yt))));on&&(pi=M.createElement(y.a,{onResize:Ft},pi));var Ei=M.useMemo(function(){return{prefixCls:Ke,getComponent:Ut,scrollbarSize:kt,direction:oe,fixedInfoList:$t.map(function(kn,Tn){return f(Tn,Tn,$t,mr,oe)}),isSticky:Cn}},[Ke,Ut,kt,oe,$t,mr,oe,Cn]),Qi=M.useMemo(function(){return Object(X.a)(Object(X.a)({},Pn),{},{tableLayout:Ht,rowClassName:Ce,expandedRowClassName:Ui,componentWidth:Ze,fixHeader:In,fixColumn:Wn,horizonScroll:on,expandIcon:Di,expandableType:ir,expandRowByClick:an,expandedRowRender:li,onTriggerExpand:q,expandIconColumnIndex:Ii,indentSize:zt})},[Pn,Ht,Ce,Ui,Ze,In,Wn,on,Di,ir,an,li,q,Ii,zt]),ma=M.useMemo(function(){return{onColumnResize:ji}},[ji]);return M.createElement(s.a.Provider,{value:Ei},M.createElement(j.Provider,{value:Qi},M.createElement(te.Provider,{value:ma},pi)))}bt.Column=r.a,bt.ColumnGroup=c.a,bt.Summary=ct.a,bt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Et=$e.b=bt},wRmb:function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return I});var ae=Q("rePB"),X=Q("KQm4"),P=Q("VTBJ"),V=Q("Ff2n"),L=Q("q1tI"),M=Q.n(L),H=Q("Kwbf"),U=Q("Zm9Q"),k=Q("hW8S");function I(r){return Object(U.a)(r).filter(function(l){return L.isValidElement(l)}).map(function(l){var u=l.key,a=l.props,s=a.children,f=Object(V.a)(a,["children"]),O=Object(P.a)({key:u},f);return s&&(O.children=I(s)),O})}function b(r){return r.reduce(function(l,u){var a=u.fixed,s=a===!0?"left":a,f=u.children;return f&&f.length>0?[].concat(Object(X.a)(l),Object(X.a)(b(f).map(function(O){return Object(P.a)({fixed:s},O)}))):[].concat(Object(X.a)(l),[Object(P.a)(Object(P.a)({},u),{},{fixed:s})])},[])}function y(r){for(var l=!0,u=0;u<r.length;u+=1){var a=r[u];if(l&&a.fixed!=="left")l=!1;else if(!l&&a.fixed==="left"){Object(H.a)(!1,"Index ".concat(u-1," of `columns` missing `fixed='left'` prop."));break}}for(var s=!0,f=r.length-1;f>=0;f-=1){var O=r[f];if(s&&O.fixed!=="right")s=!1;else if(!s&&O.fixed==="right"){Object(H.a)(!1,"Index ".concat(f+1," of `columns` missing `fixed='right'` prop."));break}}}function p(r){return r.map(function(l){var u=l.fixed,a=Object(V.a)(l,["fixed"]),s=u;return u==="left"?s="right":u==="right"&&(s="left"),Object(P.a)({fixed:s},a)})}function c(r,l){var u=r.prefixCls,a=r.columns,s=r.children,f=r.expandable,O=r.expandedKeys,S=r.getRowKey,E=r.onTriggerExpand,C=r.expandIcon,w=r.rowExpandable,g=r.expandIconColumnIndex,v=r.direction,h=r.expandRowByClick,o=L.useMemo(function(){return a||I(s)},[a,s]),_=L.useMemo(function(){if(f){var N,j=g||0,W=o[j],Y=(N={},Object(ae.a)(N,k.a,{className:"".concat(u,"-expand-icon-col")}),Object(ae.a)(N,"title",""),Object(ae.a)(N,"fixed",W?W.fixed:null),Object(ae.a)(N,"className","".concat(u,"-row-expand-icon-cell")),Object(ae.a)(N,"render",function($,te,ue){var me=S(te,ue),Me=O.has(me),Ae=w?w(te):!0,De=C({prefixCls:u,expanded:Me,expandable:Ae,record:te,onExpand:E});return h?L.createElement("span",{onClick:function(Ne){return Ne.stopPropagation()}},De):De}),N),B=o.slice();return j>=0&&B.splice(j,0,Y),B}return o},[f,o,S,O,C,v]),m=L.useMemo(function(){var N=_;return l&&(N=l(N)),N.length||(N=[{render:function(){return null}}]),N},[l,_,v]),T=L.useMemo(function(){return v==="rtl"?p(b(m)):b(m)},[m,v]);return[m,T]}$e.b=c},"y0+3":function(Rt,$e,Q){"use strict";Q.d($e,"a",function(){return b}),Q.d($e,"b",function(){return p});var ae=/margin|padding|width|height|max|min|offset/,X={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function V(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function L(c,r,l){if(r=r.toLowerCase(),l==="auto"){if(r==="height")return c.offsetHeight;if(r==="width")return c.offsetWidth}return r in X||(X[r]=ae.test(r)),X[r]?parseFloat(l)||0:l}function M(c,r){var l=arguments.length,u=V(c);return r=P[r]?"cssFloat"in c.style?"cssFloat":"styleFloat":r,l===1?u:L(c,r,u[r]||c.style[r])}function H(c,r,l){var u=arguments.length;if(r=P[r]?"cssFloat"in c.style?"cssFloat":"styleFloat":r,u===3)return typeof l=="number"&&ae.test(r)&&(l="".concat(l,"px")),c.style[r]=l,l;for(var a in r)r.hasOwnProperty(a)&&H(c,a,r[a]);return V(c)}function U(c){return c===document.body?document.documentElement.clientWidth:c.offsetWidth}function k(c){return c===document.body?window.innerHeight||document.documentElement.clientHeight:c.offsetHeight}function I(){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:r}}function b(){var c=document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:r}}function y(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function p(c){var r=c.getBoundingClientRect(),l=document.documentElement;return{left:r.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:r.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}}}]);