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__MyProblem__index.187d3b0...

445 lines
1.3 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[193,3,5,7,8,20],{"+NIl":function(Fe,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(X,P){"use strict";function V(c,o){c.cmdState.push(o)}function j(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function M(c){var o=c.cmdState.pop();o&&o.closeBracket()}function G(c){for(var o=c.cmdState,d=o.length-1;d>=0;d--){var i=o[d];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function W(c,o,d){return function(){this.name=c,this.bracketNo=0,this.style=o,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=W("importmodule","tag",["string","builtin"]),n.documentclass=W("documentclass","tag",["","atom"]),n.usepackage=W("usepackage","tag",["atom"]),n.begin=W("begin","tag",["atom"]),n.end=W("end","tag",["atom"]),n.label=W("label","tag",["atom"]),n.ref=W("ref","tag",["atom"]),n.eqref=W("eqref","tag",["atom"]),n.cite=W("cite","tag",["atom"]),n.bibitem=W("bibitem","tag",["atom"]),n.Bibitem=W("Bibitem","tag",["atom"]),n.RBibitem=W("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(c,o){c.f=o}function m(c,o){var d;if(c.match(/^\\[a-zA-Z@]+/)){var i=c.current().slice(1);return d=n.hasOwnProperty(i)?n[i]:n.DEFAULT,d=new d,V(o,d),D(o,h),d.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return D(o,function(r,s){return p(r,s,"\\]")}),"keyword";if(c.match("\\("))return D(o,function(r,s){return p(r,s,"\\)")}),"keyword";if(c.match("$$"))return D(o,function(r,s){return p(r,s,"$$")}),"keyword";if(c.match("$"))return D(o,function(r,s){return p(r,s,"$")}),"keyword";var a=c.next();if(a=="%")return c.skipToEnd(),"comment";if(a=="}"||a=="]"){if(d=j(o),d)d.closeBracket(a),D(o,h);else return"error";return"bracket"}else return a=="{"||a=="["?(d=n.DEFAULT,d=new d,V(o,d),"bracket"):/\d/.test(a)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=G(o),d.name=="begin"&&(d.argument=c.current()),d.styleIdentifier())}function p(c,o,d){if(c.eatSpace())return null;if(d&&c.match(d))return D(o,m),"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 i=c.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(c.skipToEnd(),"comment"):"error"}function h(c,o){var d=c.peek(),i;return d=="{"||d=="["?(i=j(o),i.openBracket(d),c.eat(d),D(o,m),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(D(o,m),M(o),m(c,o))}return{startState:function(){var c=P.inMathMode?function(o,d){return p(o,d)}:m;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,o){return o.f(c,o)},blankLine:function(c){c.f=m,c.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+aKw":function(Fe,oe,k){"use strict";var Z=k("tJVT"),X=k("q1tI"),P=k.n(X),V=function(G){return String(G).length===1?"0".concat(G):G},j=function(G){var W=G.className,n=W===void 0?"":W,D=G.onChange,m=G.defaultValue,p=m===void 0?0:m,h=Object(X.useState)(p),c=Object(Z.a)(h,2),o=c[0],d=c[1];Object(X.useEffect)(function(){var s=setTimeout(function(){d(o+1e3)},1e3);return D(o+1e3),function(){clearInterval(s)}},[o]);var i=parseInt(o/(60*6e4))||"00",a=parseInt(o%(60*6e4)/6e4)||"00",r=parseInt(o%6e4/1e3)||"00";return P.a.createElement("div",{className:n},V(i),":",V(a),":",V(r))};oe.a=j},"+k/U":function(Fe,oe,k){Fe.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"+ua5":function(Fe,oe,k){},"/cxE":function(Fe,oe,k){"use strict";k.d(oe,"f",function(){return P}),k.d(oe,"g",function(){return V}),k.d(oe,"h",function(){return j}),k.d(oe,"e",function(){return G}),k.d(oe,"b",function(){return W}),k.d(oe,"c",function(){return n}),k.d(oe,"d",function(){return D}),k.d(oe,"a",function(){return m});class Z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
`+p.stack):p},0)}}emit(p){this.listeners.forEach(h=>{h(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const X=new Z;function P(p){G(p)||X.onUnexpectedError(p);return}function V(p){G(p)||X.onUnexpectedExternalError(p);return}function j(p){if(p instanceof Error){let{name:h,message:c}=p;const o=p.stacktrace||p.stack;return{$isError:!0,name:h,message:c,stack:o}}return p}const M="Canceled";function G(p){return p instanceof Error&&p.name===M&&p.message===M}function W(){const p=new Error(M);return p.name=p.message,p}function n(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function D(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class m extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"07cG":function(Fe,oe,k){Fe.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(Fe,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(W,n,D){var m=D&&D!=Z.Init;if(n&&!m)W.on("blur",j),W.on("change",M),W.on("swapDoc",M),Z.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){V(W)}),M(W);else if(!n&&m){W.off("blur",j),W.off("change",M),W.off("swapDoc",M),Z.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),X(W);var p=W.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}n&&!W.hasFocus()&&j(W)});function X(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function P(W){X(W);var n=W.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=W.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var D=W.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),n.appendChild(D),W.display.lineSpace.insertBefore(n,W.display.lineSpace.firstChild)}function V(W){setTimeout(function(){var n=!1,D=W.getInputField();D.nodeName=="TEXTAREA"?n=!D.value:W.lineCount()==1&&(n=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),n?P(W):X(W)},20)}function j(W){G(W)&&P(W)}function M(W){var n=W.getWrapperElement(),D=G(W);n.className=n.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?P(W):X(W)}function G(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(Fe,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){"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};Z.defineMode("xml",function(V,j){var M=V.indentUnit,G={},W=j.htmlMode?X:P;for(var n in W)G[n]=W[n];for(var n in j)G[n]=j[n];var D,m;function p(f,C){function E(U){return C.tokenize=U,U(f,C)}var v=f.next();if(v=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?E(o("atom","]]>")):null:f.match("--")?E(o("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),E(d(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),C.tokenize=o("meta","?>"),"meta"):(D=f.eat("/")?"closeTag":"openTag",C.tokenize=h,"tag bracket");if(v=="&"){var N;return f.eat("#")?f.eat("x")?N=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):N=f.eatWhile(/[\d]/)&&f.eat(";"):N=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),N?"atom":"error"}else return f.eatWhile(/[^&<]/),null}p.isInText=!0;function h(f,C){var E=f.next();if(E==">"||E=="/"&&f.eat(">"))return C.tokenize=p,D=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return D="equals",null;if(E=="<"){C.tokenize=p,C.state=s,C.tagName=C.tagStart=null;var v=C.tokenize(f,C);return v?v+" tag error":"tag error"}else return/[\'\"]/.test(E)?(C.tokenize=c(E),C.stringStartCol=f.column(),C.tokenize(f,C)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(f){var C=function(E,v){for(;!E.eol();)if(E.next()==f){v.tokenize=h;break}return"string"};return C.isInAttribute=!0,C}function o(f,C){return function(E,v){for(;!E.eol();){if(E.match(C)){v.tokenize=p;break}E.next()}return f}}function d(f){return function(C,E){for(var v;(v=C.next())!=null;){if(v=="<")return E.tokenize=d(f+1),E.tokenize(C,E);if(v==">")if(f==1){E.tokenize=p;break}else return E.tokenize=d(f-1),E.tokenize(C,E)}return"meta"}}function i(f,C,E){this.prev=f.context,this.tagName=C,this.indent=f.indented,this.startOfLine=E,(G.doNotIndent.hasOwnProperty(C)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function a(f){f.context&&(f.context=f.context.prev)}function r(f,C){for(var E;;){if(!f.context)return;if(E=f.context.tagName,!G.contextGrabbers.hasOwnProperty(E)||!G.contextGrabbers[E].hasOwnProperty(C))return;a(f)}}function s(f,C,E){return f=="openTag"?(E.tagStart=C.column(),S):f=="closeTag"?w:s}function S(f,C,E){return f=="word"?(E.tagName=C.current(),m="tag",O):G.allowMissingTagName&&f=="endTag"?(m="tag bracket",O(f,C,E)):(m="error",S)}function w(f,C,E){if(f=="word"){var v=C.current();return E.context&&E.context.tagName!=v&&G.implicitlyClosed.hasOwnProperty(E.context.tagName)&&a(E),E.context&&E.context.tagName==v||G.matchClosing===!1?(m="tag",x):(m="tag error",L)}else return G.allowMissingTagName&&f=="endTag"?(m="tag bracket",x(f,C,E)):(m="error",L)}function x(f,C,E){return f!="endTag"?(m="error",x):(a(E),s)}function L(f,C,E){return m="error",x(f,C,E)}function O(f,C,E){if(f=="word")return m="attribute",_;if(f=="endTag"||f=="selfcloseTag"){var v=E.tagName,N=E.tagStart;return E.tagName=E.tagStart=null,f=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(v)?r(E,v):(r(E,v),E.context=new i(E,v,N==E.indented)),s}return m="error",O}function _(f,C,E){return f=="equals"?b:(G.allowMissing||(m="error"),O(f,C,E))}function b(f,C,E){return f=="string"?g:f=="word"&&G.allowUnquoted?(m="string",O):(m="error",O(f,C,E))}function g(f,C,E){return f=="string"?g:O(f,C,E)}return{startState:function(f){var C={tokenize:p,state:s,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(C.baseIndent=f),C},token:function(f,C){if(!C.tagName&&f.sol()&&(C.indented=f.indentation()),f.eatSpace())return null;D=null;var E=C.tokenize(f,C);return(E||D)&&E!="comment"&&(m=null,C.state=C.state(D||E,f,C),m&&(E=m=="error"?E+" error":m)),E},indent:function(f,C,E){var v=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+M;if(v&&v.noIndent)return Z.Pass;if(f.tokenize!=h&&f.tokenize!=p)return E?E.match(/^(\s*)/)[0].length:0;if(f.tagName)return G.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+M*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var N=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(N&&N[1])for(;v;)if(v.tagName==N[2]){v=v.prev;break}else if(G.implicitlyClosed.hasOwnProperty(v.tagName))v=v.prev;else break;else if(N)for(;v;){var U=G.contextGrabbers[v.tagName];if(U&&U.hasOwnProperty(N[2]))v=v.prev;else break}for(;v&&v.prev&&!v.startOfLine;)v=v.prev;return v?v.indent+M:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(f){f.state==b&&(f.state=O)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var C=[],E=f.context;E;E=E.prev)E.tagName&&C.push(E.tagName);return C.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Fe,oe,k){"use strict";k.d(oe,"d",function(){return qe}),k.d(oe,"b",function(){return Te}),k.d(oe,"c",function(){return Ze}),k.d(oe,"a",function(){return Ot});var Z=k("VTBJ"),X=k("1OyB"),P=k("vuIU"),V=k("JX7q"),j=k("Ji7U"),M=k("LK+K"),G=k("q1tI"),W=k("I8Z2"),n=k("BGR+"),D=k("wx14"),m=k("rePB"),p=k("4IlW"),h=k("2GS6"),c=k("Gytx"),o=k.n(c),d=k("TSYQ"),i=k.n(d),a=k("U8pU"),r=k("ODXe"),s=/iPhone/i,S=/iPod/i,w=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,L=/Android/i,O=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,g=/\bWindows(?:.+)ARM\b/i,f=/BlackBerry/i,C=/BB10/i,E=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function U(ot,He){return ot.test(He)}function A(ot){var He=ot||(typeof navigator!="undefined"?navigator.userAgent:""),Ge=He.split("[FBAN");if(typeof Ge[1]!="undefined"){var Ue=Ge,le=Object(r.a)(Ue,1);He=le[0]}if(Ge=He.split("Twitter"),typeof Ge[1]!="undefined"){var _e=Ge,Ve=Object(r.a)(_e,1);He=Ve[0]}var je={apple:{phone:U(s,He)&&!U(b,He),ipod:U(S,He),tablet:!U(s,He)&&U(w,He)&&!U(b,He),device:(U(s,He)||U(S,He)||U(w,He))&&!U(b,He)},amazon:{phone:U(O,He),tablet:!U(O,He)&&U(_,He),device:U(O,He)||U(_,He)},android:{phone:!U(b,He)&&U(O,He)||!U(b,He)&&U(x,He),tablet:!U(b,He)&&!U(O,He)&&!U(x,He)&&(U(_,He)||U(L,He)),device:!U(b,He)&&(U(O,He)||U(_,He)||U(x,He)||U(L,He))||U(/\bokhttp\b/i,He)},windows:{phone:U(b,He),tablet:U(g,He),device:U(b,He)||U(g,He)},other:{blackberry:U(f,He),blackberry10:U(C,He),opera:U(E,He),firefox:U(N,He),chrome:U(v,He),device:U(f,He)||U(C,He)||U(E,He)||U(N,He)||U(v,He)},any:null,phone:null,tablet:null};return je.any=je.apple.device||je.android.device||je.windows.device||je.other.device,je.phone=je.apple.phone||je.android.phone||je.windows.phone,je.tablet=je.apple.tablet||je.android.tablet||je.windows.tablet,je}var H=Object(Z.a)(Object(Z.a)({},A()),{},{isMobile:A}),F=H;function T(){}function z(ot,He,Ge){var Ue=He||"";return ot.key||"".concat(Ue,"item_").concat(Ge)}function Q(ot){return"".concat(ot,"-menu-")}function ne(ot,He){var Ge=-1;G.Children.forEach(ot,function(Ue){Ge+=1,Ue&&Ue.type&&Ue.type.isMenuItemGroup?G.Children.forEach(Ue.props.children,function(le){Ge+=1,He(le,Ge)}):He(Ue,Ge)})}function se(ot,He,Ge){if(!ot||Ge.find)return;G.Children.forEach(ot,function(Ue){if(Ue){var le=Ue.type;if(!le||!(le.isSubMenu||le.isMenuItem||le.isMenuItemGroup))return;He.indexOf(Ue.key)!==-1?Ge.find=!0:Ue.props.children&&se(Ue.props.children,He,Ge)}})}var xe=["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"],me=function(He){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=He&&typeof He.getBoundingClientRect=="function"&&He.getBoundingClientRect().width;if(Ue){if(Ge){var le=getComputedStyle(He),_e=le.marginLeft,Ve=le.marginRight;Ue+=+_e.replace("px","")+ +Ve.replace("px","")}Ue=+Ue.toFixed(6)}return Ue||0},ve=function(He,Ge,Ue){He&&Object(a.a)(He.style)==="object"&&(He.style[Ge]=Ue)},Oe=function(){return F.any},Re=k("KQm4"),fe=k("Ff2n"),ue=k("i8i4"),Pe=k("bdgK"),et=k("uciX"),rt=k("8XRh"),tt={adjustX:1,adjustY:1},it={topLeft:{points:["bl","tl"],overflow:tt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:tt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:tt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:tt,offset:[4,0]}},ze={topLeft:{points:["bl","tl"],overflow:tt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:tt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:tt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:tt,offset:[4,0]}},Qe=it,at=0,he={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Se=function(He,Ge,Ue){var le=Q(Ge),_e=He.getState();He.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},_e.defaultActiveFirst),{},Object(m.a)({},le,Ue))})},Le=function(ot){Object(j.a)(Ge,ot);var He=Object(M.a)(Ge);function Ge(Ue){var le;Object(X.a)(this,Ge),le=He.call(this,Ue),le.onDestroy=function(Ie){le.props.onDestroy(Ie)},le.onKeyDown=function(Ie){var $e=Ie.keyCode,xt=le.menuInstance,Ft=le.props,ct=Ft.isOpen,Ut=Ft.store;if($e===p.a.ENTER)return le.onTitleClick(Ie),Se(Ut,le.props.eventKey,!0),!0;if($e===p.a.RIGHT)return ct?xt.onKeyDown(Ie):(le.triggerOpenChange(!0),Se(Ut,le.props.eventKey,!0)),!0;if($e===p.a.LEFT){var $t;if(ct)$t=xt.onKeyDown(Ie);else return;return $t||(le.triggerOpenChange(!1),$t=!0),$t}return ct&&($e===p.a.UP||$e===p.a.DOWN)?xt.onKeyDown(Ie):void 0},le.onOpenChange=function(Ie){le.props.onOpenChange(Ie)},le.onPopupVisibleChange=function(Ie){le.triggerOpenChange(Ie,Ie?"mouseenter":"mouseleave")},le.onMouseEnter=function(Ie){var $e=le.props,xt=$e.eventKey,Ft=$e.onMouseEnter,ct=$e.store;Se(ct,le.props.eventKey,!1),Ft({key:xt,domEvent:Ie})},le.onMouseLeave=function(Ie){var $e=le.props,xt=$e.parentMenu,Ft=$e.eventKey,ct=$e.onMouseLeave;xt.subMenuInstance=Object(V.a)(le),ct({key:Ft,domEvent:Ie})},le.onTitleMouseEnter=function(Ie){var $e=le.props,xt=$e.eventKey,Ft=$e.onItemHover,ct=$e.onTitleMouseEnter;Ft({key:xt,hover:!0}),ct({key:xt,domEvent:Ie})},le.onTitleMouseLeave=function(Ie){var $e=le.props,xt=$e.parentMenu,Ft=$e.eventKey,ct=$e.onItemHover,Ut=$e.onTitleMouseLeave;xt.subMenuInstance=Object(V.a)(le),ct({key:Ft,hover:!1}),Ut({key:Ft,domEvent:Ie})},le.onTitleClick=function(Ie){var $e=Object(V.a)(le),xt=$e.props;if(xt.onTitleClick({key:xt.eventKey,domEvent:Ie}),xt.triggerSubMenuAction==="hover")return;le.triggerOpenChange(!xt.isOpen,"click"),Se(xt.store,le.props.eventKey,!1)},le.onSubMenuClick=function(Ie){typeof le.props.onClick=="function"&&le.props.onClick(le.addKeyPath(Ie))},le.onSelect=function(Ie){le.props.onSelect(Ie)},le.onDeselect=function(Ie){le.props.onDeselect(Ie)},le.getPrefixCls=function(){return"".concat(le.props.rootPrefixCls,"-submenu")},le.getActiveClassName=function(){return"".concat(le.getPrefixCls(),"-active")},le.getDisabledClassName=function(){return"".concat(le.getPrefixCls(),"-disabled")},le.getSelectedClassName=function(){return"".concat(le.getPrefixCls(),"-selected")},le.getOpenClassName=function(){return"".concat(le.props.rootPrefixCls,"-submenu-open")},le.saveMenuInstance=function(Ie){le.menuInstance=Ie},le.addKeyPath=function(Ie){return Object(Z.a)(Object(Z.a)({},Ie),{},{keyPath:(Ie.keyPath||[]).concat(le.props.eventKey)})},le.triggerOpenChange=function(Ie,$e){var xt=le.props.eventKey,Ft=function(){le.onOpenChange({key:xt,item:Object(V.a)(le),trigger:$e,open:Ie})};$e==="mouseenter"?le.mouseenterTimeout=setTimeout(function(){Ft()},0):Ft()},le.isChildrenSelected=function(){var Ie={find:!1};return se(le.props.children,le.props.selectedKeys,Ie),Ie.find},le.isOpen=function(){return le.props.openKeys.indexOf(le.props.eventKey)!==-1},le.adjustWidth=function(){if(!le.subMenuTitle||!le.menuInstance)return;var Ie=ue.findDOMNode(le.menuInstance);if(Ie.offsetWidth>=le.subMenuTitle.offsetWidth)return;Ie.style.minWidth="".concat(le.subMenuTitle.offsetWidth,"px")},le.saveSubMenuTitle=function(Ie){le.subMenuTitle=Ie},le.getBaseProps=function(){var Ie=Object(V.a)(le),$e=Ie.props;return{mode:$e.mode==="horizontal"?"vertical":$e.mode,visible:le.props.isOpen,level:$e.level+1,inlineIndent:$e.inlineIndent,focusable:!1,onClick:le.onSubMenuClick,onSelect:le.onSelect,onDeselect:le.onDeselect,onDestroy:le.onDestroy,selectedKeys:$e.selectedKeys,eventKey:"".concat($e.eventKey,"-menu-"),openKeys:$e.openKeys,motion:$e.motion,onOpenChange:le.onOpenChange,subMenuOpenDelay:$e.subMenuOpenDelay,parentMenu:Object(V.a)(le),subMenuCloseDelay:$e.subMenuCloseDelay,forceSubMenuRender:$e.forceSubMenuRender,triggerSubMenuAction:$e.triggerSubMenuAction,builtinPlacements:$e.builtinPlacements,defaultActiveFirst:$e.store.getState().defaultActiveFirst[Q($e.eventKey)],multiple:$e.multiple,prefixCls:$e.rootPrefixCls,id:le.internalMenuId,manualRef:le.saveMenuInstance,itemIcon:$e.itemIcon,expandIcon:$e.expandIcon,direction:$e.direction}},le.getMotion=function(Ie,$e){var xt=Object(V.a)(le),Ft=xt.haveRendered,ct=le.props,Ut=ct.motion,$t=ct.rootPrefixCls,Vt=Object(Z.a)(Object(Z.a)({},Ut),{},{leavedClassName:"".concat($t,"-hidden"),removeOnLeave:!1,motionAppear:Ft||!$e||Ie!=="inline"});return Vt};var _e=Ue.store,Ve=Ue.eventKey,je=_e.getState(),ht=je.defaultActiveFirst;le.isRootMenu=!1;var ft=!1;return ht&&(ft=ht[Ve]),Se(_e,Ve,ft),le}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this,_e=this.props,Ve=_e.mode,je=_e.parentMenu,ht=_e.manualRef;if(ht&&ht(this),Ve!=="horizontal"||!je.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return le.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var le=this.props,_e=le.onDestroy,Ve=le.eventKey;_e&&_e(Ve),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(le){var _e=this,Ve=this.getBaseProps(),je=this.getMotion(Ve.mode,Ve.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ve.visible||Ve.forceSubMenuRender,!this.haveOpened)return G.createElement("div",null);var ht=Ve.direction;return G.createElement(rt.default,Object.assign({visible:Ve.visible},je),function(ft){var Ie=ft.className,$e=ft.style,xt=i()("".concat(Ve.prefixCls,"-sub"),Ie,Object(m.a)({},"".concat(Ve.prefixCls,"-rtl"),ht==="rtl"));return G.createElement(ye,Object.assign({},Ve,{id:_e.internalMenuId,className:xt,style:$e}),le)})}},{key:"render",value:function(){var le,_e=Object(Z.a)({},this.props),Ve=_e.isOpen,je=this.getPrefixCls(),ht=_e.mode==="inline",ft=i()(je,"".concat(je,"-").concat(_e.mode),(le={},Object(m.a)(le,_e.className,!!_e.className),Object(m.a)(le,this.getOpenClassName(),Ve),Object(m.a)(le,this.getActiveClassName(),_e.active||Ve&&!ht),Object(m.a)(le,this.getDisabledClassName(),_e.disabled),Object(m.a)(le,this.getSelectedClassName(),this.isChildrenSelected()),le));this.internalMenuId||(_e.eventKey?this.internalMenuId="".concat(_e.eventKey,"$Menu"):(at+=1,this.internalMenuId="$__$".concat(at,"$Menu")));var Ie={},$e={},xt={};_e.disabled||(Ie={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},$e={onClick:this.onTitleClick},xt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Ft={},ct=_e.direction;ht&&(ct==="rtl"?Ft.paddingRight=_e.inlineIndent*_e.level:Ft.paddingLeft=_e.inlineIndent*_e.level);var Ut={};this.props.isOpen&&(Ut={"aria-owns":this.internalMenuId});var $t=null;_e.mode!=="horizontal"&&($t=this.props.expandIcon,typeof this.props.expandIcon=="function"&&($t=G.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var Vt=G.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Ft,className:"".concat(je,"-title"),role:"button"},xt,$e,{"aria-expanded":Ve},Ut,{"aria-haspopup":"true",title:typeof _e.title=="string"?_e.title:void 0}),_e.title,$t||G.createElement("i",{className:"".concat(je,"-arrow")})),At=this.renderChildren(_e.children),Tn=_e.parentMenu.isRootMenu?_e.parentMenu.props.getPopupContainer:function(ur){return ur.parentNode},Fn=he[_e.mode],Sn=_e.popupOffset?{offset:_e.popupOffset}:{},Wt=_e.mode==="inline"?"":_e.popupClassName;Wt+=ct==="rtl"?" ".concat(je,"-rtl"):"";var hn=_e.disabled,Mn=_e.triggerSubMenuAction,Bn=_e.subMenuOpenDelay,ut=_e.forceSubMenuRender,Ct=_e.subMenuCloseDelay,Hn=_e.builtinPlacements;xe.forEach(function(ur){return delete _e[ur]}),delete _e.onClick;var pr=ct==="rtl"?Object.assign({},ze,Hn):Object.assign({},it,Hn);return delete _e.direction,G.createElement("li",Object.assign({},_e,Ie,{className:ft,role:"menuitem"}),ht&&Vt,ht&&At,!ht&&G.createElement(et.a,{prefixCls:je,popupClassName:i()("".concat(je,"-popup"),Wt),getPopupContainer:Tn,builtinPlacements:pr,popupPlacement:Fn,popupVisible:Ve,popupAlign:Sn,popup:At,action:hn?[]:[Mn],mouseEnterDelay:Bn,mouseLeaveDelay:Ct,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ut},Vt))}}]),Ge}(G.Component);Le.defaultProps={onMouseEnter:T,onMouseLeave:T,onTitleMouseEnter:T,onTitleMouseLeave:T,onTitleClick:T,manualRef:T,mode:"vertical",title:""};var Me=Object(W.b)(function(ot,He){var Ge=ot.openKeys,Ue=ot.activeKey,le=ot.selectedKeys,_e=He.eventKey,Ve=He.subMenuKey;return{isOpen:Ge.indexOf(_e)>-1,active:Ue[Ve]===_e,selectedKeys:le}})(Le);Me.isSubMenu=!0;var qe=Me,st="menuitem-overflowed",mt=.5,gt=function(ot){Object(j.a)(Ge,ot);var He=Object(M.a)(Ge);function Ge(){var Ue;return Object(X.a)(this,Ge),Ue=He.apply(this,arguments),Ue.resizeObserver=null,Ue.mutationObserver=null,Ue.originalTotalWidth=0,Ue.overflowedItems=[],Ue.menuItemSizes=[],Ue.cancelFrameId=null,Ue.state={lastVisibleIndex:void 0},Ue.getMenuItemNodes=function(){var le=Ue.props.prefixCls,_e=ue.findDOMNode(Object(V.a)(Ue));return _e?[].slice.call(_e.children).filter(function(Ve){return Ve.className.split(" ").indexOf("".concat(le,"-overflowed-submenu"))<0}):[]},Ue.getOverflowedSubMenuItem=function(le,_e,Ve){var je=Ue.props,ht=je.overflowedIndicator,ft=je.level,Ie=je.mode,$e=je.prefixCls,xt=je.theme;if(ft!==1||Ie!=="horizontal")return null;var Ft=Ue.props.children[0],ct=Ft.props,Ut=ct.children,$t=ct.title,Vt=ct.style,At=Object(fe.a)(ct,["children","title","style"]),Tn=Object(Z.a)({},Vt),Fn="".concat(le,"-overflowed-indicator"),Sn="".concat(le,"-overflowed-indicator");_e.length===0&&Ve!==!0?Tn=Object(Z.a)(Object(Z.a)({},Tn),{},{display:"none"}):Ve&&(Tn=Object(Z.a)(Object(Z.a)({},Tn),{},{visibility:"hidden",position:"absolute"}),Fn="".concat(Fn,"-placeholder"),Sn="".concat(Sn,"-placeholder"));var Wt=xt?"".concat($e,"-").concat(xt):"",hn={};return xe.forEach(function(Mn){At[Mn]!==void 0&&(hn[Mn]=At[Mn])}),G.createElement(qe,Object.assign({title:ht,className:"".concat($e,"-overflowed-submenu"),popupClassName:Wt},hn,{key:Fn,eventKey:Sn,disabled:!1,style:Tn}),_e)},Ue.setChildrenWidthAndResize=function(){if(Ue.props.mode!=="horizontal")return;var le=ue.findDOMNode(Object(V.a)(Ue));if(!le)return;var _e=le.children;if(!_e||_e.length===0)return;var Ve=le.children[_e.length-1];ve(Ve,"display","inline-block");var je=Ue.getMenuItemNodes(),ht=je.filter(function(ft){return ft.className.split(" ").indexOf(st)>=0});ht.forEach(function(ft){ve(ft,"display","inline-block")}),Ue.menuItemSizes=je.map(function(ft){return me(ft,!0)}),ht.forEach(function(ft){ve(ft,"display","none")}),Ue.overflowedIndicatorWidth=me(le.children[le.children.length-1],!0),Ue.originalTotalWidth=Ue.menuItemSizes.reduce(function(ft,Ie){return ft+Ie},0),Ue.handleResize(),ve(Ve,"display","none")},Ue.handleResize=function(){if(Ue.props.mode!=="horizontal")return;var le=ue.findDOMNode(Object(V.a)(Ue));if(!le)return;var _e=me(le);Ue.overflowedItems=[];var Ve=0,je;Ue.originalTotalWidth>_e+mt&&(je=-1,Ue.menuItemSizes.forEach(function(ht){Ve+=ht,Ve+Ue.overflowedIndicatorWidth<=_e&&(je+=1)})),Ue.setState({lastVisibleIndex:je})},Ue}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){var le=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var _e=ue.findDOMNode(this);if(!_e)return;this.resizeObserver=new Pe.default(function(Ve){Ve.forEach(function(){var je=le.cancelFrameId;cancelAnimationFrame(je),le.cancelFrameId=requestAnimationFrame(le.setChildrenWidthAndResize)})}),[].slice.call(_e.children).concat(_e).forEach(function(Ve){le.resizeObserver.observe(Ve)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){le.resizeObserver.disconnect(),[].slice.call(_e.children).concat(_e).forEach(function(Ve){le.resizeObserver.observe(Ve)}),le.setChildrenWidthAndResize()}),this.mutationObserver.observe(_e,{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(le){var _e=this,Ve=this.state.lastVisibleIndex;return(le||[]).reduce(function(je,ht,ft){var Ie=ht;if(_e.props.mode==="horizontal"){var $e=_e.getOverflowedSubMenuItem(ht.props.eventKey,[]);Ve!==void 0&&_e.props.className.indexOf("".concat(_e.props.prefixCls,"-root"))!==-1&&(ft>Ve&&(Ie=G.cloneElement(ht,{style:{display:"none"},eventKey:"".concat(ht.props.eventKey,"-hidden"),className:"".concat(st)})),ft===Ve+1&&(_e.overflowedItems=le.slice(Ve+1).map(function(Ft){return G.cloneElement(Ft,{key:Ft.props.eventKey,mode:"vertical-left"})}),$e=_e.getOverflowedSubMenuItem(ht.props.eventKey,_e.overflowedItems)));var xt=[].concat(Object(Re.a)(je),[$e,Ie]);return ft===le.length-1&&xt.push(_e.getOverflowedSubMenuItem(ht.props.eventKey,[],!0)),xt}return[].concat(Object(Re.a)(je),[Ie])},[])}},{key:"render",value:function(){var le=this.props,_e=le.visible,Ve=le.prefixCls,je=le.overflowedIndicator,ht=le.mode,ft=le.level,Ie=le.tag,$e=le.children,xt=le.theme,Ft=Object(fe.a)(le,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),ct=Ie;return G.createElement(ct,Object.assign({},Ft),this.renderChildren($e))}}]),Ge}(G.Component);gt.defaultProps={tag:"div",className:""};var St=gt;function Et(ot){return ot.length?ot.every(function(He){return!!He.props.disabled}):!0}function Ae(ot,He,Ge){var Ue=ot.getState();ot.setState({activeKey:Object(Z.a)(Object(Z.a)({},Ue.activeKey),{},Object(m.a)({},He,Ge))})}function Ce(ot){return ot.eventKey||"0-menu-"}function Xe(ot,He){var Ge=He,Ue=ot.children,le=ot.eventKey;if(Ge){var _e;if(ne(Ue,function(Ve,je){Ve&&Ve.props&&!Ve.props.disabled&&Ge===z(Ve,le,je)&&(_e=!0)}),_e)return Ge}return Ge=null,ot.defaultActiveFirst&&ne(Ue,function(Ve,je){!Ge&&Ve&&!Ve.props.disabled&&(Ge=z(Ve,le,je))}),Ge}function Je(ot){if(ot){var He=this.instanceArray.indexOf(ot);He!==-1?this.instanceArray[He]=ot:this.instanceArray.push(ot)}}var ke=function(ot){Object(j.a)(Ge,ot);var He=Object(M.a)(Ge);function Ge(Ue){var le;return Object(X.a)(this,Ge),le=He.call(this,Ue),le.onKeyDown=function(_e,Ve){var je=_e.keyCode,ht;if(le.getFlatInstanceArray().forEach(function(Ie){Ie&&Ie.props.active&&Ie.onKeyDown&&(ht=Ie.onKeyDown(_e))}),ht)return 1;var ft=null;return(je===p.a.UP||je===p.a.DOWN)&&(ft=le.step(je===p.a.UP?-1:1)),ft?(_e.preventDefault(),Ae(le.props.store,Ce(le.props),ft.props.eventKey),typeof Ve=="function"&&Ve(ft),1):void 0},le.onItemHover=function(_e){var Ve=_e.key,je=_e.hover;Ae(le.props.store,Ce(le.props),je?Ve:null)},le.onDeselect=function(_e){le.props.onDeselect(_e)},le.onSelect=function(_e){le.props.onSelect(_e)},le.onClick=function(_e){le.props.onClick(_e)},le.onOpenChange=function(_e){le.props.onOpenChange(_e)},le.onDestroy=function(_e){le.props.onDestroy(_e)},le.getFlatInstanceArray=function(){return le.instanceArray},le.step=function(_e){var Ve=le.getFlatInstanceArray(),je=le.props.store.getState().activeKey[Ce(le.props)],ht=Ve.length;if(!ht)return null;_e<0&&(Ve=Ve.concat().reverse());var ft=-1;if(Ve.every(function(Ft,ct){return Ft&&Ft.props.eventKey===je?(ft=ct,!1):!0}),!le.props.defaultActiveFirst&&ft!==-1&&Et(Ve.slice(ft,ht-1)))return;var Ie=(ft+1)%ht,$e=Ie;do{var xt=Ve[$e];if(!xt||xt.props.disabled)$e=($e+1)%ht;else return xt}while($e!==Ie);return null},le.renderCommonMenuItem=function(_e,Ve,je){var ht=le.props.store.getState(),ft=Object(V.a)(le),Ie=ft.props,$e=z(_e,Ie.eventKey,Ve),xt=_e.props;if(!xt||typeof _e.type=="string")return _e;var Ft=$e===ht.activeKey,ct=Object(Z.a)(Object(Z.a)({mode:xt.mode||Ie.mode,level:Ie.level,inlineIndent:Ie.inlineIndent,renderMenuItem:le.renderMenuItem,rootPrefixCls:Ie.prefixCls,index:Ve,parentMenu:Ie.parentMenu,manualRef:xt.disabled?void 0:Object(h.a)(_e.ref,Je.bind(Object(V.a)(le))),eventKey:$e,active:!xt.disabled&&Ft,multiple:Ie.multiple,onClick:function($t){(xt.onClick||T)($t),le.onClick($t)},onItemHover:le.onItemHover,motion:Ie.motion,subMenuOpenDelay:Ie.subMenuOpenDelay,subMenuCloseDelay:Ie.subMenuCloseDelay,forceSubMenuRender:Ie.forceSubMenuRender,onOpenChange:le.onOpenChange,onDeselect:le.onDeselect,onSelect:le.onSelect,builtinPlacements:Ie.builtinPlacements,itemIcon:xt.itemIcon||le.props.itemIcon,expandIcon:xt.expandIcon||le.props.expandIcon},je),{},{direction:Ie.direction});return(Ie.mode==="inline"||Oe())&&(ct.triggerSubMenuAction="click"),G.cloneElement(_e,ct)},le.renderMenuItem=function(_e,Ve,je){if(!_e)return null;var ht=le.props.store.getState(),ft={openKeys:ht.openKeys,selectedKeys:ht.selectedKeys,triggerSubMenuAction:le.props.triggerSubMenuAction,subMenuKey:je};return le.renderCommonMenuItem(_e,Ve,ft)},Ue.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},Ue.store.getState().activeKey),{},Object(m.a)({},Ue.eventKey,Xe(Ue,Ue.activeKey)))}),le.instanceArray=[],le}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(le){return this.props.visible||le.visible||this.props.className!==le.className||!o()(this.props.style,le.style)}},{key:"componentDidUpdate",value:function(le){var _e=this.props,Ve="activeKey"in _e?_e.activeKey:_e.store.getState().activeKey[Ce(_e)],je=Xe(_e,Ve);if(je!==Ve)Ae(_e.store,Ce(_e),je);else if("activeKey"in le){var ht=Xe(le,le.activeKey);je!==ht&&Ae(_e.store,Ce(_e),je)}}},{key:"render",value:function(){var le=this,_e=Object(D.a)({},this.props);this.instanceArray=[];var Ve=i()(_e.prefixCls,_e.className,"".concat(_e.prefixCls,"-").concat(_e.mode)),je={className:Ve,role:_e.role||"menu"};_e.id&&(je.id=_e.id),_e.focusable&&(je.tabIndex=0,je.onKeyDown=this.onKeyDown);var ht=_e.prefixCls,ft=_e.eventKey,Ie=_e.visible,$e=_e.level,xt=_e.mode,Ft=_e.overflowedIndicator,ct=_e.theme;return xe.forEach(function(Ut){return delete _e[Ut]}),delete _e.onClick,G.createElement(St,Object.assign({},_e,{prefixCls:ht,mode:xt,tag:"ul",level:$e,theme:ct,visible:Ie,overflowedIndicator:Ft},je),G.Children.map(_e.children,function(Ut,$t){return le.renderMenuItem(Ut,$t,ft||"0-menu-")}))}}]),Ge}(G.Component);ke.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:T};var Ke=Object(W.b)()(ke),ye=Ke,ce=k("Kwbf");function pe(ot,He,Ge){var Ue=ot.prefixCls,le=ot.motion,_e=ot.defaultMotions,Ve=_e===void 0?{}:_e,je=ot.openAnimation,ht=ot.openTransitionName,ft=He.switchingModeFromInline;if(le)return le;if(Object(a.a)(je)==="object"&&je)Object(ce.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof je=="string")return{motionName:"".concat(Ue,"-open-").concat(je)};if(ht)return{motionName:ht};var Ie=Ve[Ge];return Ie||(ft?null:Ve.other)}var ie=function(ot){Object(j.a)(Ge,ot);var He=Object(M.a)(Ge);function Ge(Ue){var le;Object(X.a)(this,Ge),le=He.call(this,Ue),le.inlineOpenKeys=[],le.onSelect=function(je){var ht=Object(V.a)(le),ft=ht.props;if(ft.selectable){var Ie=le.store.getState(),$e=Ie.selectedKeys,xt=je.key;ft.multiple?$e=$e.concat([xt]):$e=[xt],"selectedKeys"in ft||le.store.setState({selectedKeys:$e}),ft.onSelect(Object(Z.a)(Object(Z.a)({},je),{},{selectedKeys:$e}))}},le.onClick=function(je){var ht=le.getRealMenuMode(),ft=Object(V.a)(le),Ie=ft.store,$e=ft.props.onOpenChange;ht!=="inline"&&!("openKeys"in le.props)&&(Ie.setState({openKeys:[]}),$e([])),le.props.onClick(je)},le.onKeyDown=function(je,ht){le.innerMenu.getWrappedInstance().onKeyDown(je,ht)},le.onOpenChange=function(je){var ht=Object(V.a)(le),ft=ht.props,Ie=le.store.getState().openKeys.concat(),$e=!1,xt=function(ct){var Ut=!1;if(ct.open)Ut=Ie.indexOf(ct.key)===-1,Ut&&Ie.push(ct.key);else{var $t=Ie.indexOf(ct.key);Ut=$t!==-1,Ut&&Ie.splice($t,1)}$e=$e||Ut};Array.isArray(je)?je.forEach(xt):xt(je),$e&&("openKeys"in le.props||le.store.setState({openKeys:Ie}),ft.onOpenChange(Ie))},le.onDeselect=function(je){var ht=Object(V.a)(le),ft=ht.props;if(ft.selectable){var Ie=le.store.getState().selectedKeys.concat(),$e=je.key,xt=Ie.indexOf($e);xt!==-1&&Ie.splice(xt,1),"selectedKeys"in ft||le.store.setState({selectedKeys:Ie}),ft.onDeselect(Object(Z.a)(Object(Z.a)({},je),{},{selectedKeys:Ie}))}},le.onMouseEnter=function(je){le.restoreModeVerticalFromInline();var ht=le.props.onMouseEnter;ht&&ht(je)},le.onTransitionEnd=function(je){var ht=je.propertyName==="width"&&je.target===je.currentTarget,ft=je.target.className,Ie=Object.prototype.toString.call(ft)==="[object SVGAnimatedString]"?ft.animVal:ft,$e=je.propertyName==="font-size"&&Ie.indexOf("anticon")>=0;(ht||$e)&&le.restoreModeVerticalFromInline()},le.setInnerMenu=function(je){le.innerMenu=je},le.isRootMenu=!0;var _e=Ue.defaultSelectedKeys,Ve=Ue.defaultOpenKeys;return"selectedKeys"in Ue&&(_e=Ue.selectedKeys||[]),"openKeys"in Ue&&(Ve=Ue.openKeys||[]),le.store=Object(W.c)({selectedKeys:_e,openKeys:Ve,activeKey:{"0-menu-":Xe(Ue,Ue.activeKey)}}),le.state={switchingModeFromInline:!1},le}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(le){this.updateOpentKeysWhenSwitchMode(le),this.updateMiniStore();var _e=this.props,Ve=_e.siderCollapsed,je=_e.inlineCollapsed,ht=_e.onOpenChange;(!le.inlineCollapsed&&je||!le.siderCollapsed&&Ve)&&ht([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(le){var _e=this.props,Ve=this.store,je=this.inlineOpenKeys,ht=Ve.getState(),ft={};le.mode==="inline"&&_e.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in _e||((_e.inlineCollapsed&&!le.inlineCollapsed||_e.siderCollapsed&&!le.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=ht.openKeys.concat(),ft.openKeys=[]),(!_e.inlineCollapsed&&le.inlineCollapsed||!_e.siderCollapsed&&le.siderCollapsed)&&(ft.openKeys=je,this.inlineOpenKeys=[])),Object.keys(ft).length&&Ve.setState(ft)}},{key:"updateMenuDisplay",value:function(){var le=this.props.collapsedWidth,_e=this.store,Ve=this.prevOpenKeys,je=this.getInlineCollapsed()&&(le===0||le==="0"||le==="0px");je?(this.prevOpenKeys=_e.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Ve&&(this.store.setState({openKeys:Ve}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var le=this.props.mode,_e=this.state.switchingModeFromInline,Ve=this.getInlineCollapsed();return _e&&Ve?"inline":Ve?"vertical":le}},{key:"getInlineCollapsed",value:function(){var le=this.props,_e=le.inlineCollapsed,Ve=le.siderCollapsed;return Ve!==void 0?Ve:_e}},{key:"restoreModeVerticalFromInline",value:function(){var le=this.state.switchingModeFromInline;le&&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 le=Object(Z.a)({},Object(n.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),_e=this.getRealMenuMode();return le.className+=" ".concat(le.prefixCls,"-root"),le.direction==="rtl"&&(le.className+=" ".concat(le.prefixCls,"-rtl")),le=Object(Z.a)(Object(Z.a)({},le),{},{mode:_e,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:pe(this.props,this.state,_e)}),delete le.openAnimation,delete le.openTransitionName,G.createElement(W.a,{store:this.store},G.createElement(ye,Object.assign({},le,{ref:this.setInnerMenu}),this.props.children))}}]),Ge}(G.Component);ie.defaultProps={selectable:!0,onClick:T,onSelect:T,onOpenChange:T,onDeselect:T,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:G.createElement("span",null,"\xB7\xB7\xB7")};var ae=ie,de=function(ot){Object(j.a)(Ge,ot);var He=Object(M.a)(Ge);function Ge(){var Ue;return Object(X.a)(this,Ge),Ue=He.apply(this,arguments),Ue.onKeyDown=function(le){var _e=le.keyCode;return _e===p.a.ENTER?(Ue.onClick(le),!0):void 0},Ue.onMouseLeave=function(le){var _e=Ue.props,Ve=_e.eventKey,je=_e.onItemHover,ht=_e.onMouseLeave;je({key:Ve,hover:!1}),ht({key:Ve,domEvent:le})},Ue.onMouseEnter=function(le){var _e=Ue.props,Ve=_e.eventKey,je=_e.onItemHover,ht=_e.onMouseEnter;je({key:Ve,hover:!0}),ht({key:Ve,domEvent:le})},Ue.onClick=function(le){var _e=Ue.props,Ve=_e.eventKey,je=_e.multiple,ht=_e.onClick,ft=_e.onSelect,Ie=_e.onDeselect,$e=_e.isSelected,xt={key:Ve,keyPath:[Ve],item:Object(V.a)(Ue),domEvent:le};ht(xt),je?$e?Ie(xt):ft(xt):$e||ft(xt)},Ue.saveNode=function(le){Ue.node=le},Ue}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var le=this.props;le.onDestroy&&le.onDestroy(le.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 le,_e=Object(Z.a)({},this.props),Ve=i()(this.getPrefixCls(),_e.className,(le={},Object(m.a)(le,this.getActiveClassName(),!_e.disabled&&_e.active),Object(m.a)(le,this.getSelectedClassName(),_e.isSelected),Object(m.a)(le,this.getDisabledClassName(),_e.disabled),le)),je=Object(Z.a)(Object(Z.a)({},_e.attribute),{},{title:typeof _e.title=="string"?_e.title:void 0,className:Ve,role:_e.role||"menuitem","aria-disabled":_e.disabled});_e.role==="option"?je=Object(Z.a)(Object(Z.a)({},je),{},{role:"option","aria-selected":_e.isSelected}):(_e.role===null||_e.role==="none")&&(je.role="none");var ht={onClick:_e.disabled?null:this.onClick,onMouseLeave:_e.disabled?null:this.onMouseLeave,onMouseEnter:_e.disabled?null:this.onMouseEnter},ft=Object(Z.a)({},_e.style);_e.mode==="inline"&&(_e.direction==="rtl"?ft.paddingRight=_e.inlineIndent*_e.level:ft.paddingLeft=_e.inlineIndent*_e.level),xe.forEach(function($e){return delete _e[$e]}),delete _e.direction;var Ie=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ie=G.createElement(this.props.itemIcon,this.props)),G.createElement("li",Object.assign({},Object(n.default)(_e,["onClick","onMouseEnter","onMouseLeave","onSelect"]),je,ht,{style:ft,ref:this.saveNode}),_e.children,Ie)}}]),Ge}(G.Component);de.isMenuItem=!0,de.defaultProps={onSelect:T,onMouseEnter:T,onMouseLeave:T,manualRef:T};var ge=Object(W.b)(function(ot,He){var Ge=ot.activeKey,Ue=ot.selectedKeys,le=He.eventKey,_e=He.subMenuKey;return{active:Ge[_e]===le,isSelected:Ue.indexOf(le)!==-1}})(de),Te=ge,De=function(ot){Object(j.a)(Ge,ot);var He=Object(M.a)(Ge);function Ge(){var Ue;return Object(X.a)(this,Ge),Ue=He.apply(this,arguments),Ue.renderInnerMenuItem=function(le){var _e=Ue.props,Ve=_e.renderMenuItem,je=_e.index;return Ve(le,je,Ue.props.subMenuKey)},Ue}return Object(P.a)(Ge,[{key:"render",value:function(){var le=Object(D.a)({},this.props),_e=le.className,Ve=_e===void 0?"":_e,je=le.rootPrefixCls,ht="".concat(je,"-item-group-title"),ft="".concat(je,"-item-group-list"),Ie=le.title,$e=le.children;return xe.forEach(function(xt){return delete le[xt]}),delete le.onClick,delete le.direction,G.createElement("li",Object.assign({},le,{className:"".concat(Ve," ").concat(je,"-item-group")}),G.createElement("div",{className:ht,title:typeof Ie=="string"?Ie:void 0},Ie),G.createElement("ul",{className:ft},G.Children.map($e,this.renderInnerMenuItem)))}}]),Ge}(G.Component);De.isMenuItemGroup=!0,De.defaultProps={disabled:!0};var Ze=De,pt=function(He){var Ge=He.className,Ue=He.rootPrefixCls,le=He.style;return G.createElement("li",{className:"".concat(Ge," ").concat(Ue,"-item-divider"),style:le})};pt.defaultProps={disabled:!0,className:"",style:{}};var Ot=pt,yt=oe.e=ae},"24hK":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return X});class Z{constructor(P){this.element=P,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class X{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let P=this._first;for(;P!==Z.Undefined;){const V=P.next;P.prev=Z.Undefined,P.next=Z.Undefined,P=V}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,V){const j=new Z(P);if(this._first===Z.Undefined)this._first=j,this._last=j;else if(V){const G=this._last;this._last=j,j.prev=G,G.next=j}else{const G=this._first;this._first=j,j.next=G,G.prev=j}this._size+=1;let M=!1;return()=>{M||(M=!0,this._remove(j))}}shift(){if(this._first===Z.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===Z.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==Z.Undefined&&P.next!==Z.Undefined){const V=P.prev;V.next=P.next,P.next.prev=V}else P.prev===Z.Undefined&&P.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):P.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):P.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==Z.Undefined;)yield P.element,P=P.next}}},"3/fG":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return X});function Z(P,V){let j;return V.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(M,G){const W=G[0];return typeof V[W]!="undefined"?V[W]:M}),j}function X(P,V,...j){return Z(V,j)}},"55Ip":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return r});var Z=k("Ty5D"),X=k("dI71"),P=k("q1tI"),V=k.n(P),j=k("YS25"),M=k("17x9"),G=k.n(M),W=k("wx14"),n=k("zLVn"),D=k("9R94"),m=function(b){Object(X.a)(g,b);function g(){for(var C,E=arguments.length,v=new Array(E),N=0;N<E;N++)v[N]=arguments[N];return C=b.call.apply(b,[this].concat(v))||this,C.history=Object(j.a)(C.props),C}var f=g.prototype;return f.render=function(){return V.a.createElement(Z.c,{history:this.history,children:this.props.children})},g}(V.a.Component),p=function(b){Object(X.a)(g,b);function g(){for(var C,E=arguments.length,v=new Array(E),N=0;N<E;N++)v[N]=arguments[N];return C=b.call.apply(b,[this].concat(v))||this,C.history=Object(j.b)(C.props),C}var f=g.prototype;return f.render=function(){return V.a.createElement(Z.c,{history:this.history,children:this.props.children})},g}(V.a.Component),h=function(g,f){return typeof g=="function"?g(f):g},c=function(g,f){return typeof g=="string"?Object(j.c)(g,null,null,f):g},o=function(g){return g},d=V.a.forwardRef;typeof d=="undefined"&&(d=o);function i(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var a=d(function(b,g){var f=b.innerRef,C=b.navigate,E=b.onClick,v=Object(n.a)(b,["innerRef","navigate","onClick"]),N=v.target,U=Object(W.a)({},v,{onClick:function(H){try{E&&E(H)}catch(F){throw H.preventDefault(),F}!H.defaultPrevented&&H.button===0&&(!N||N==="_self")&&!i(H)&&(H.preventDefault(),C())}});return o!==d?U.ref=g||f:U.ref=f,V.a.createElement("a",U)}),r=d(function(b,g){var f=b.component,C=f===void 0?a:f,E=b.replace,v=b.to,N=b.innerRef,U=Object(n.a)(b,["component","replace","to","innerRef"]);return V.a.createElement(Z.e.Consumer,null,function(A){A||Object(D.a)(!1);var H=A.history,F=c(h(v,A.location),A.location),T=F?H.createHref(F):"",z=Object(W.a)({},U,{href:T,navigate:function(){var ne=h(v,A.location),se=E?H.replace:H.push;se(ne)}});return o!==d?z.ref=g||N:z.innerRef=N,V.a.createElement(C,z)})});if(!1)var s,S;var w=function(g){return g},x=V.a.forwardRef;typeof x=="undefined"&&(x=w);function L(){for(var b=arguments.length,g=new Array(b),f=0;f<b;f++)g[f]=arguments[f];return g.filter(function(C){return C}).join(" ")}var O=x(function(b,g){var f=b["aria-current"],C=f===void 0?"page":f,E=b.activeClassName,v=E===void 0?"active":E,N=b.activeStyle,U=b.className,A=b.exact,H=b.isActive,F=b.location,T=b.sensitive,z=b.strict,Q=b.style,ne=b.to,se=b.innerRef,xe=Object(n.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return V.a.createElement(Z.e.Consumer,null,function(me){me||Object(D.a)(!1);var ve=F||me.location,Oe=c(h(ne,ve),ve),Re=Oe.pathname,fe=Re&&Re.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=fe?Object(Z.f)(ve.pathname,{path:fe,exact:A,sensitive:T,strict:z}):null,Pe=!!(H?H(ue,ve):ue),et=Pe?L(U,v):U,rt=Pe?Object(W.a)({},Q,{},N):Q,tt=Object(W.a)({"aria-current":Pe&&C||null,className:et,style:rt,to:Oe},xe);return w!==x?tt.ref=g||se:tt.innerRef=se,V.a.createElement(r,tt)})});if(!1)var _},"5VLF":function(Fe,oe,k){"use strict";var Z,X;function P(V,j,M){var G=function(W,n){return V.js_beautify(W,n)};return G.js=V.js_beautify,G.css=j.css_beautify,G.html=M.html_beautify,G.js_beautify=V.js_beautify,G.css_beautify=j.css_beautify,G.html_beautify=M.html_beautify,G}!(Z=[k("6UM0"),k("TXwP"),k("psGv")],X=function(V,j,M){return P(V,j,M)}.apply(oe,Z),X!==void 0&&(Fe.exports=X))},"5Y4S":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return P});var Z=k("MNsG");const X=Z.b.performance&&typeof Z.b.performance.now=="function";class P{constructor(V){this._highResolution=X&&V,this._startTime=this._now(),this._stopTime=-1}static create(V=!0){return new P(V)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Z.b.performance.now():Date.now()}}},"5nXd":function(Fe,oe,k){var Z=k("MFOe"),X=Z.slice,P=Z.pluck,V=Z.each,j=Z.bind,M=Z.create,G=Z.isList,W=Z.isFunction,n=Z.isObject;Fe.exports={createStore:p};var D={version:"2.0.12",enabled:!1,get:function(h,c){var o=this.storage.read(this._namespacePrefix+h);return this._deserialize(o,c)},set:function(h,c){return c===void 0?this.remove(h):(this.storage.write(this._namespacePrefix+h,this._serialize(c)),c)},remove:function(h){this.storage.remove(this._namespacePrefix+h)},each:function(h){var c=this;this.storage.each(function(o,d){h.call(c,c._deserialize(o),(d||"").replace(c._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(h){return this._namespacePrefix=="__storejs_"+h+"_"},createStore:function(){return p.apply(this,arguments)},addPlugin:function(h){this._addPlugin(h)},namespace:function(h){return p(this.storage,this.plugins,h)}};function m(){var h=typeof console=="undefined"?null:console;if(!h)return;var c=h.warn?h.warn:h.log;c.apply(h,arguments)}function p(h,c,o){o||(o=""),h&&!G(h)&&(h=[h]),c&&!G(c)&&(c=[c]);var d=o?"__storejs_"+o+"_":"",i=o?new RegExp("^"+d):null,a=/^[a-zA-Z0-9_\-]*$/;if(!a.test(o))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var r={_namespacePrefix:d,_namespaceRegexp:i,_testStorage:function(S){try{var w="__storejs__test__";S.write(w,w);var x=S.read(w)===w;return S.remove(w),x}catch(L){return!1}},_assignPluginFnProp:function(S,w){var x=this[w];this[w]=function(){var O=X(arguments,0),_=this;function b(){return x?(V(arguments,function(f,C){O[C]=f}),x.apply(_,O)):void 0}var g=[b].concat(O);return S.apply(_,g)}},_serialize:function(S){return JSON.stringify(S)},_deserialize:function(S,w){if(!S)return w;var x="";try{x=JSON.parse(S)}catch(L){x=S}return x!==void 0?x:w},_addStorage:function(S){if(this.enabled)return;this._testStorage(S)&&(this.storage=S,this.enabled=!0)},_addPlugin:function(S){var w=this;if(G(S)){V(S,function(O){w._addPlugin(O)});return}var x=P(this.plugins,function(O){return S===O});if(x)return;if(this.plugins.push(S),!W(S))throw new Error("Plugins must be function values that return objects");var L=S.call(this);if(!n(L))throw new Error("Plugins must return an object of function properties");V(L,function(O,_){if(!W(O))throw new Error("Bad plugin property: "+_+" from plugin "+S.name+". Plugins should only return functions.");w._assignPluginFnProp(O,_)})},addStorage:function(S){m("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(S)}},s=M(r,D,{plugins:[]});return s.raw={},V(s,function(S,w){W(S)&&(s.raw[w]=j(s,S))}),V(h,function(S){s._addStorage(S)}),V(c,function(S){s._addPlugin(S)}),s}},"6+eU":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return x});var Z=k("wx14"),X=k("rePB"),P=k("VTBJ"),V=k("1OyB"),j=k("vuIU"),M=k("Ji7U"),G=k("LK+K"),W=k("q1tI"),n=k.n(W),D=k("TSYQ"),m=k.n(D),p=function(O){var _,b="".concat(O.rootPrefixCls,"-item"),g=m()(b,"".concat(b,"-").concat(O.page),(_={},Object(X.a)(_,"".concat(b,"-active"),O.active),Object(X.a)(_,O.className,!!O.className),Object(X.a)(_,"".concat(b,"-disabled"),!O.page),_)),f=function(){O.onClick(O.page)},C=function(v){O.onKeyPress(v,O.onClick,O.page)};return n.a.createElement("li",{title:O.showTitle?O.page:null,className:g,onClick:f,onKeyPress:C,tabIndex:"0"},O.itemRender(O.page,"page",n.a.createElement("a",{rel:"nofollow"},O.page)))},h=p,c={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},o=function(L){Object(M.a)(_,L);var O=Object(G.a)(_);function _(){var b;Object(V.a)(this,_);for(var g=arguments.length,f=new Array(g),C=0;C<g;C++)f[C]=arguments[C];return b=O.call.apply(O,[this].concat(f)),b.state={goInputText:""},b.buildOptionText=function(E){return"".concat(E," ").concat(b.props.locale.items_per_page)},b.changeSize=function(E){b.props.changeSize(Number(E))},b.handleChange=function(E){b.setState({goInputText:E.target.value})},b.handleBlur=function(E){var v=b.props,N=v.goButton,U=v.quickGo,A=v.rootPrefixCls,H=b.state.goInputText;if(N||H==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(A,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(A,"-next"))>=0))return;b.setState({goInputText:""}),U(b.getValidValue())},b.go=function(E){var v=b.state.goInputText;if(v==="")return;(E.keyCode===c.ENTER||E.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(j.a)(_,[{key:"getValidValue",value:function(){var g=this.state,f=g.goInputText,C=g.current;return!f||isNaN(f)?C:Number(f)}},{key:"getPageSizeOptions",value:function(){var g=this.props,f=g.pageSize,C=g.pageSizeOptions;return C.some(function(E){return E.toString()===f.toString()})?C:C.concat([f.toString()]).sort(function(E,v){var N=isNaN(Number(E))?0:Number(E),U=isNaN(Number(v))?0:Number(v);return N-U})}},{key:"render",value:function(){var g=this,f=this.props,C=f.pageSize,E=f.locale,v=f.rootPrefixCls,N=f.changeSize,U=f.quickGo,A=f.goButton,H=f.selectComponentClass,F=f.buildOptionText,T=f.selectPrefixCls,z=f.disabled,Q=this.state.goInputText,ne="".concat(v,"-options"),se=H,xe=null,me=null,ve=null;if(!N&&!U)return null;var Oe=this.getPageSizeOptions();if(N&&se){var Re=Oe.map(function(fe,ue){return n.a.createElement(se.Option,{key:ue,value:fe.toString()},(F||g.buildOptionText)(fe))});xe=n.a.createElement(se,{disabled:z,prefixCls:T,showSearch:!1,className:"".concat(ne,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||Oe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},Re)}return U&&(A&&(ve=typeof A=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:z,className:"".concat(ne,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),me=n.a.createElement("div",{className:"".concat(ne,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:z,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,ve)),n.a.createElement("li",{className:"".concat(ne)},xe,me)}}]),_}(n.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=o,i=k("N2Kk");function a(){}function r(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function s(L,O,_){return _}function S(L,O,_){var b=typeof L=="undefined"?O.pageSize:L;return Math.floor((_.total-1)/b)+1}var w=function(L){Object(M.a)(_,L);var O=Object(G.a)(_);function _(b){var g;Object(V.a)(this,_),g=O.call(this,b),g.getJumpPrevPage=function(){return Math.max(1,g.state.current-(g.props.showLessItems?3:5))},g.getJumpNextPage=function(){return Math.min(S(void 0,g.state,g.props),g.state.current+(g.props.showLessItems?3:5))},g.getItemIcon=function(N,U){var A=g.props.prefixCls,H=N||n.a.createElement("button",{type:"button","aria-label":U,className:"".concat(A,"-item-link")});return typeof N=="function"&&(H=n.a.createElement(N,Object(P.a)({},g.props))),H},g.savePaginationNode=function(N){g.paginationNode=N},g.isValid=function(N){return r(N)&&N!==g.state.current},g.shouldDisplayQuickJumper=function(){var N=g.props,U=N.showQuickJumper,A=N.pageSize,H=N.total;return H<=A?!1:U},g.handleKeyDown=function(N){(N.keyCode===c.ARROW_UP||N.keyCode===c.ARROW_DOWN)&&N.preventDefault()},g.handleKeyUp=function(N){var U=g.getValidValue(N),A=g.state.currentInputValue;U!==A&&g.setState({currentInputValue:U}),N.keyCode===c.ENTER?g.handleChange(U):N.keyCode===c.ARROW_UP?g.handleChange(U-1):N.keyCode===c.ARROW_DOWN&&g.handleChange(U+1)},g.changePageSize=function(N){var U=g.state.current,A=S(N,g.state,g.props);U=U>A?A:U,A===0&&(U=g.state.current),typeof N=="number"&&("pageSize"in g.props||g.setState({pageSize:N}),"current"in g.props||g.setState({current:U,currentInputValue:U})),g.props.onShowSizeChange(U,N),"onChange"in g.props&&g.props.onChange&&g.props.onChange(U,N)},g.handleChange=function(N){var U=g.props.disabled,A=N;if(g.isValid(A)&&!U){var H=S(void 0,g.state,g.props);A>H?A=H:A<1&&(A=1),"current"in g.props||g.setState({current:A,currentInputValue:A});var F=g.state.pageSize;return g.props.onChange(A,F),A}return g.state.current},g.prev=function(){g.hasPrev()&&g.handleChange(g.state.current-1)},g.next=function(){g.hasNext()&&g.handleChange(g.state.current+1)},g.jumpPrev=function(){g.handleChange(g.getJumpPrevPage())},g.jumpNext=function(){g.handleChange(g.getJumpNextPage())},g.hasPrev=function(){return g.state.current>1},g.hasNext=function(){return g.state.current<S(void 0,g.state,g.props)},g.runIfEnter=function(N,U){if(N.key==="Enter"||N.charCode===13){for(var A=arguments.length,H=new Array(A>2?A-2:0),F=2;F<A;F++)H[F-2]=arguments[F];U.apply(void 0,H)}},g.runIfEnterPrev=function(N){g.runIfEnter(N,g.prev)},g.runIfEnterNext=function(N){g.runIfEnter(N,g.next)},g.runIfEnterJumpPrev=function(N){g.runIfEnter(N,g.jumpPrev)},g.runIfEnterJumpNext=function(N){g.runIfEnter(N,g.jumpNext)},g.handleGoTO=function(N){(N.keyCode===c.ENTER||N.type==="click")&&g.handleChange(g.state.currentInputValue)};var f=b.onChange!==a,C="current"in b;C&&!f&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var E=b.defaultCurrent;"current"in b&&(E=b.current);var v=b.defaultPageSize;return"pageSize"in b&&(v=b.pageSize),E=Math.min(E,S(v,void 0,b)),g.state={current:E,currentInputValue:E,pageSize:v},g}return Object(j.a)(_,[{key:"componentDidUpdate",value:function(g,f){var C=this.props.prefixCls;if(f.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(C,"-item-").concat(f.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(g){var f=g.target.value,C=S(void 0,this.state,this.props),E=this.state.currentInputValue,v;return f===""?v=f:isNaN(Number(f))?v=E:f>=C?v=C:v=Number(f),v}},{key:"getShowSizeChanger",value:function(){var g=this.props,f=g.showSizeChanger,C=g.total,E=g.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:C>E}},{key:"renderPrev",value:function(g){var f=this.props,C=f.prevIcon,E=f.itemRender,v=E(g,"prev",this.getItemIcon(C,"prev page")),N=!this.hasPrev();return Object(W.isValidElement)(v)?Object(W.cloneElement)(v,{disabled:N}):v}},{key:"renderNext",value:function(g){var f=this.props,C=f.nextIcon,E=f.itemRender,v=E(g,"next",this.getItemIcon(C,"next page")),N=!this.hasNext();return Object(W.isValidElement)(v)?Object(W.cloneElement)(v,{disabled:N}):v}},{key:"render",value:function(){var g=this,f=this.props,C=f.prefixCls,E=f.className,v=f.style,N=f.disabled,U=f.hideOnSinglePage,A=f.total,H=f.locale,F=f.showQuickJumper,T=f.showLessItems,z=f.showTitle,Q=f.showTotal,ne=f.simple,se=f.itemRender,xe=f.showPrevNextJumpers,me=f.jumpPrevIcon,ve=f.jumpNextIcon,Oe=f.selectComponentClass,Re=f.selectPrefixCls,fe=f.pageSizeOptions,ue=this.state,Pe=ue.current,et=ue.pageSize,rt=ue.currentInputValue;if(U===!0&&A<=et)return null;var tt=S(void 0,this.state,this.props),it=[],ze=null,Qe=null,at=null,he=null,Se=null,Le=F&&F.goButton,Me=T?1:2,qe=Pe-1>0?Pe-1:0,st=Pe+1<tt?Pe+1:tt,mt=Object.keys(this.props).reduce(function(ie,ae){return(ae.substr(0,5)==="data-"||ae.substr(0,5)==="aria-"||ae==="role")&&(ie[ae]=g.props[ae]),ie},{});if(ne)return Le&&(typeof Le=="boolean"?Se=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):Se=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Le),Se=n.a.createElement("li",{title:z?"".concat(H.jump_to).concat(Pe,"/").concat(tt):null,className:"".concat(C,"-simple-pager")},Se)),n.a.createElement("ul",Object(Z.a)({className:m()(C,"".concat(C,"-simple"),Object(X.a)({},"".concat(C,"-disabled"),N),E),style:v,ref:this.savePaginationNode},mt),n.a.createElement("li",{title:z?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:m()("".concat(C,"-prev"),Object(X.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(qe)),n.a.createElement("li",{title:z?"".concat(Pe,"/").concat(tt):null,className:"".concat(C,"-simple-pager")},n.a.createElement("input",{type:"text",value:rt,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(C,"-slash")},"/"),tt),n.a.createElement("li",{title:z?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:m()("".concat(C,"-next"),Object(X.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(st)),Se);if(tt<=3+Me*2){var gt={locale:H,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:z,itemRender:se};tt||it.push(n.a.createElement(h,Object(Z.a)({},gt,{key:"noPager",page:tt,className:"".concat(C,"-disabled")})));for(var St=1;St<=tt;St+=1){var Et=Pe===St;it.push(n.a.createElement(h,Object(Z.a)({},gt,{key:St,page:St,active:Et})))}}else{var Ae=T?H.prev_3:H.prev_5,Ce=T?H.next_3:H.next_5;xe&&(ze=n.a.createElement("li",{title:z?Ae:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:m()("".concat(C,"-jump-prev"),Object(X.a)({},"".concat(C,"-jump-prev-custom-icon"),!!me))},se(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(me,"prev page"))),Qe=n.a.createElement("li",{title:z?Ce:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:m()("".concat(C,"-jump-next"),Object(X.a)({},"".concat(C,"-jump-next-custom-icon"),!!ve))},se(this.getJumpNextPage(),"jump-next",this.getItemIcon(ve,"next page")))),he=n.a.createElement(h,{locale:H,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:tt,page:tt,active:!1,showTitle:z,itemRender:se}),at=n.a.createElement(h,{locale:H,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:z,itemRender:se});var Xe=Math.max(1,Pe-Me),Je=Math.min(Pe+Me,tt);Pe-1<=Me&&(Je=1+Me*2),tt-Pe<=Me&&(Xe=tt-Me*2);for(var ke=Xe;ke<=Je;ke+=1){var Ke=Pe===ke;it.push(n.a.createElement(h,{locale:H,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ke,page:ke,active:Ke,showTitle:z,itemRender:se}))}Pe-1>=Me*2&&Pe!==1+2&&(it[0]=Object(W.cloneElement)(it[0],{className:"".concat(C,"-item-after-jump-prev")}),it.unshift(ze)),tt-Pe>=Me*2&&Pe!==tt-2&&(it[it.length-1]=Object(W.cloneElement)(it[it.length-1],{className:"".concat(C,"-item-before-jump-next")}),it.push(Qe)),Xe!==1&&it.unshift(at),Je!==tt&&it.push(he)}var ye=null;Q&&(ye=n.a.createElement("li",{className:"".concat(C,"-total-text")},Q(A,[A===0?0:(Pe-1)*et+1,Pe*et>A?A:Pe*et])));var ce=!this.hasPrev()||!tt,pe=!this.hasNext()||!tt;return n.a.createElement("ul",Object(Z.a)({className:m()(C,E,Object(X.a)({},"".concat(C,"-disabled"),N)),style:v,unselectable:"unselectable",ref:this.savePaginationNode},mt),ye,n.a.createElement("li",{title:z?H.prev_page:null,onClick:this.prev,tabIndex:ce?null:0,onKeyPress:this.runIfEnterPrev,className:m()("".concat(C,"-prev"),Object(X.a)({},"".concat(C,"-disabled"),ce)),"aria-disabled":ce},this.renderPrev(qe)),it,n.a.createElement("li",{title:z?H.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:m()("".concat(C,"-next"),Object(X.a)({},"".concat(C,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(st)),n.a.createElement(d,{disabled:N,locale:H,rootPrefixCls:C,selectComponentClass:Oe,selectPrefixCls:Re,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Pe,pageSize:et,pageSizeOptions:fe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Le}))}}],[{key:"getDerivedStateFromProps",value:function(g,f){var C={};if("current"in g&&(C.current=g.current,g.current!==f.current&&(C.currentInputValue=C.current)),"pageSize"in g&&g.pageSize!==f.pageSize){var E=f.current,v=S(g.pageSize,f,g);E=E>v?v:E,"current"in g||(C.current=E,C.currentInputValue=E),C.pageSize=g.pageSize}return C}}]),_}(n.a.Component);w.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:i.a,style:{},itemRender:s,totalBoundaryShowSizeChanger:50};var x=w},"6RRn":function(Fe,oe,k){"use strict";var Z=k("wCXF"),X=k("n6Qo");k.d(oe,"b",function(){return X.a});var P=k("IBYe"),V=k("6eGT"),j=k("hW8S");k.d(oe,"a",function(){return j.a}),oe.c=Z.b},"6UM0":function(Fe,oe,k){var Z,X;(function(){var P;(function(){"use strict";var j=[function(n,D,m){var p=m(1).Beautifier,h=m(5).Options;function c(o,d){var i=new p(o,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,D,m){var p=m(2).Output,h=m(3).Token,c=m(4),o=m(5).Options,d=m(7).Tokenizer,i=m(7).line_starters,a=m(7).positionable_operators,r=m(7).TOKEN;function s(T,z){return z.indexOf(T)!==-1}function S(T){return T.replace(/^\s+/g,"")}function w(T){for(var z={},Q=0;Q<T.length;Q++)z[T[Q].replace(/-/g,"_")]=T[Q];return z}function x(T,z){return T&&T.type===r.RESERVED&&T.text===z}function L(T,z){return T&&T.type===r.RESERVED&&s(T.text,z)}var O=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],b=w(_),g=[b.before_newline,b.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(T,z){if(z.multiline_frame||z.mode===f.ForInitializer||z.mode===f.Conditional)return;T.remove_indent(z.start_line_index)}function E(T){T=T.replace(c.allLineBreaks,`
`);for(var z=[],Q=T.indexOf(`
`);Q!==-1;)z.push(T.substring(0,Q)),T=T.substring(Q+1),Q=T.indexOf(`
`);return T.length&&z.push(T),z}function v(T){return T===f.ArrayLiteral}function N(T){return s(T,[f.Expression,f.ForInitializer,f.Conditional])}function U(T,z){for(var Q=0;Q<T.length;Q++){var ne=T[Q].trim();if(ne.charAt(0)!==z)return!1}return!0}function A(T,z){for(var Q=0,ne=T.length,se;Q<ne;Q++)if(se=T[Q],se&&se.indexOf(z)!==0)return!1;return!0}function H(T,z){z=z||{},this._source_text=T||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(z)}H.prototype.create_flags=function(T,z){var Q=0;T&&(Q=T.indentation_level,!this._output.just_added_newline()&&T.line_indent_level>Q&&(Q=T.line_indent_level));var ne={mode:z,parent:T,last_token:T?T.last_token:new h(r.START_BLOCK,""),last_word:T?T.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:Q,alignment:0,line_indent_level:T?T.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return ne},H.prototype._reset=function(T){var z=T.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var Q=new d(T,this._options);return this._tokens=Q.tokenize(),T},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T,z=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=`
`,z&&c.lineBreak.test(z||"")&&(Q=z.match(c.lineBreak)[0]));for(var ne=this._tokens.next();ne;)this.handle_token(ne),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ne,ne=this._tokens.next();return T=this._output.get_code(Q),T},H.prototype.handle_token=function(T,z){T.type===r.START_EXPR?this.handle_start_expr(T):T.type===r.END_EXPR?this.handle_end_expr(T):T.type===r.START_BLOCK?this.handle_start_block(T):T.type===r.END_BLOCK?this.handle_end_block(T):T.type===r.WORD?this.handle_word(T):T.type===r.RESERVED?this.handle_word(T):T.type===r.SEMICOLON?this.handle_semicolon(T):T.type===r.STRING?this.handle_string(T):T.type===r.EQUALS?this.handle_equals(T):T.type===r.OPERATOR?this.handle_operator(T):T.type===r.COMMA?this.handle_comma(T):T.type===r.BLOCK_COMMENT?this.handle_block_comment(T,z):T.type===r.COMMENT?this.handle_comment(T,z):T.type===r.DOT?this.handle_dot(T):T.type===r.EOF?this.handle_eof(T):T.type===r.UNKNOWN?this.handle_unknown(T,z):this.handle_unknown(T,z)},H.prototype.handle_whitespace_and_comments=function(T,z){var Q=T.newlines,ne=this._options.keep_array_indentation&&v(this._flags.mode);if(T.comments_before)for(var se=T.comments_before.next();se;)this.handle_whitespace_and_comments(se,z),this.handle_token(se,z),se=T.comments_before.next();if(ne)for(var xe=0;xe<Q;xe+=1)this.print_newline(xe>0,z);else if(this._options.max_preserve_newlines&&Q>this._options.max_preserve_newlines&&(Q=this._options.max_preserve_newlines),this._options.preserve_newlines&&Q>1){this.print_newline(!1,z);for(var me=1;me<Q;me+=1)this.print_newline(!0,z)}};var F=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(T,z){if(z=z===void 0?!1:z,this._output.just_added_newline())return;var Q=this._options.preserve_newlines&&T.newlines||z,ne=s(this._flags.last_token.text,a)||s(T.text,a);if(ne){var se=s(this._flags.last_token.text,a)&&s(this._options.operator_position,g)||s(T.text,a);Q=Q&&se}if(Q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,F))return;this._output.set_wrap_point()}},H.prototype.print_newline=function(T,z){if(!z&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Q=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&x(Q,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(T)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(T){this._output.just_added_newline()&&(this._options.keep_array_indentation&&T.newlines&&(T.text==="["||v(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(T.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))},H.prototype.print_token=function(T){if(this._output.raw){this._output.add_raw_token(T);return}if(this._options.comma_first&&T.previous&&T.previous.type===r.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(T),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(T),this._output.non_breaking_space=!0,this._output.add_token(T.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},H.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.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))},H.prototype.set_mode=function(T){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,T),this._flags=this.create_flags(this._previous_flags,T),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(T){var z=!1;return z=z||L(this._flags.last_token,["var","let","const"])&&T.type===r.WORD,z=z||x(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&L(this._flags.last_token,F)&&!T.newlines,z=z||x(this._flags.last_token,"else")&&!(x(T,"if")&&!T.comments_before),z=z||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),z=z||this._flags.last_token.type===r.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(T.text==="--"||T.text==="++")&&this._last_last_text!=="function"&&T.type!==r.WORD&&T.type!==r.RESERVED,z=z||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),z?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(T,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T,L(T,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T);var z=f.Expression;if(T.text==="["){if(this._flags.last_token.type===r.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(T),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=f.ArrayLiteral,v(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())),s(this._flags.last_token.type,[r.START_EXPR,r.END_EXPR,r.WORD,r.OPERATOR,r.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===r.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=f.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=f.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&T.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T);else if(this._flags.last_token.type===r.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var ne=this._tokens.peek(-4);L(Q,["async","function"])||Q.text==="*"&&L(ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(ne.text==="{"||ne.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(T);(this._flags.last_token.type===r.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&s(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===r.START_BLOCK?this.print_newline():(this._flags.last_token.type===r.END_EXPR||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===r.COMMA)&&this.allow_wrap_or_preserved_newline(T,T.newlines),this.print_token(T),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(T){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(T),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(T,T.text==="]"&&v(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===r.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(T),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},H.prototype.handle_start_block=function(T){this.handle_whitespace_and_comments(T);var z=this._tokens.peek(),Q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===r.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):Q&&(s(Q.text,[":",","])&&s(z.type,[r.STRING,r.WORD,r.RESERVED])||s(z.text,["get","set","..."])&&s(Q.type,[r.WORD,r.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(Q.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===r.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):s(this._flags.last_token.type,[r.EQUALS,r.START_EXPR,r.COMMA,r.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ne=!z.comments_before&&z.text==="}",se=ne&&this._flags.last_word==="function"&&this._flags.last_token.type===r.END_EXPR;if(this._options.brace_preserve_inline){var xe=0,me=null;this._flags.inline_frame=!0;do if(xe+=1,me=this._tokens.peek(xe-1),me.newlines){this._flags.inline_frame=!1;break}while(me.type!==r.EOF&&!(me.type===r.END_BLOCK&&me.opened===T))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&T.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==r.OPERATOR&&(se||this._flags.last_token.type===r.EQUALS||L(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(v(this._previous_flags.mode)&&(this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.COMMA)&&((this._flags.last_token.type===r.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(T),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==r.OPERATOR&&this._flags.last_token.type!==r.START_EXPR&&(this._flags.last_token.type===r.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(T),this.indent(),!ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(T){for(this.handle_whitespace_and_comments(T);this._flags.mode===f.Statement;)this.restore_mode();var z=this._flags.last_token.type===r.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(v(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(T)},H.prototype.handle_word=function(T){if(T.type===r.RESERVED){if(s(T.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)T.type=r.WORD;else if(T.text==="import"&&s(this._tokens.peek().text,["(","."]))T.type=r.WORD;else if(s(T.text,["as","from"])&&!this._flags.import_block)T.type=r.WORD;else if(this._flags.mode===f.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(T.type=r.WORD)}}if(this.start_of_statement(T)?L(this._flags.last_token,["var","let","const"])&&T.type===r.WORD&&(this._flags.declaration_statement=!0):T.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==r.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(T),this.print_newline()):this.handle_whitespace_and_comments(T),this._flags.do_block&&!this._flags.do_while)if(x(T,"while")){this._output.space_before_token=!0,this.print_token(T),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&&x(T,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(T,["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(T),this._flags.in_case=!0;return}if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T)),x(T,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===r.OPERATOR))&&(!this._output.just_added_blankline()&&!T.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,F)?this._output.space_before_token=!0:x(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===r.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||v(this._flags.mode))||this.print_newline(),this.print_token(T),this._flags.last_word=T.text;return}var Q="NONE";if(this._flags.last_token.type===r.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":L(T,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&T.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&this._flags.mode===f.BlockStatement?Q="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&N(this._flags.mode)?Q="SPACE":this._flags.last_token.type===r.STRING?Q="NEWLINE":this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&s(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===r.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===r.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),L(T,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Q="SPACE":Q="NEWLINE"),L(T,["else","catch","finally"]))if((!(this._flags.last_token.type===r.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&T.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ne=this._output.current_line;ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?L(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(T,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==r.END_EXPR?(this._flags.last_token.type!==r.START_EXPR||!L(T,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(T,"if")&&x(T.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(T,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&v(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Q==="SPACE"&&(this._output.space_before_token=!0);T.previous&&(T.previous.type===r.WORD||T.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(T),this._flags.last_word=T.text,T.type===r.RESERVED&&(T.text==="do"?this._flags.do_block=!0:T.text==="if"?this._flags.if_block=!0:T.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(T,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(T){this.start_of_statement(T)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(T);for(var z=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&x(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(T)},H.prototype.handle_string=function(T){T.text.startsWith("`")&&T.newlines===0&&T.whitespace_before===""&&(T.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(T)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(T),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T):T.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(T.previous.text==="]"||T.previous.text===")")&&T.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(T)},H.prototype.handle_equals=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0},H.prototype.handle_comma=function(T){this.handle_whitespace_and_comments(T,!0),this.print_token(T),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(T)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(T)},H.prototype.handle_operator=function(T){var z=T.text==="*"&&(L(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),Q=s(T.text,["-","+"])&&(s(this._flags.last_token.type,[r.START_BLOCK,r.START_EXPR,r.EQUALS,r.OPERATOR])||s(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(T)){var ne=!z;this.handle_whitespace_and_comments(T,ne)}if(T.text==="*"&&this._flags.last_token.type===r.DOT){this.print_token(T);return}if(T.text==="::"){this.print_token(T);return}if(this._flags.last_token.type===r.OPERATOR&&s(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(T),T.text===":"&&this._flags.in_case){this.print_token(T),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==r.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 se=!0,xe=!0,me=!1;if(T.text===":"?this._flags.ternary_depth===0?se=!1:(this._flags.ternary_depth-=1,me=!0):T.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!z&&this._options.preserve_newlines&&s(T.text,a)){var ve=T.text===":",Oe=ve&&me,Re=ve&&!me;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Re,this.print_token(T),(!ve||Oe)&&this.allow_wrap_or_preserved_newline(T),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!ve||Oe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(T):this._output.space_before_token=!1,this.print_token(T),this._output.space_before_token=!0;return;case b.preserve_newline:Re||this.allow_wrap_or_preserved_newline(T),se=!(this._output.just_added_newline()||Re),this._output.space_before_token=se,this.print_token(T),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(T),se=!1;var fe=this._tokens.peek();xe=fe&&s(fe.type,[r.WORD,r.RESERVED])}else if(T.text==="...")this.allow_wrap_or_preserved_newline(T),se=this._flags.last_token.type===r.START_BLOCK,xe=!1;else if(s(T.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(T),se=!1,xe=!1,T.newlines&&(T.text==="--"||T.text==="++"||T.text==="~")){var ue=L(this._flags.last_token,O)&&T.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(se=!0),this._flags.last_token.type===r.RESERVED?se=!0:this._flags.last_token.type===r.END_EXPR?se=!(this._flags.last_token.text==="]"&&(T.text==="--"||T.text==="++")):this._flags.last_token.type===r.OPERATOR&&(se=s(T.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(T.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(xe=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||se,this.print_token(T),this._output.space_before_token=xe},H.prototype.handle_block_comment=function(T,z){if(this._output.raw){this._output.add_raw_token(T),T.directives&&T.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(T.directives){this.print_newline(!1,z),this.print_token(T),T.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(T.text)&&!T.newlines){this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0;return}else this.print_block_commment(T,z)},H.prototype.print_block_commment=function(T,z){var Q=E(T.text),ne,se=!1,xe=!1,me=T.whitespace_before,ve=me.length;if(this.print_newline(!1,z),this.print_token_line_indentation(T),this._output.add_token(Q[0]),this.print_newline(!1,z),Q.length>1){for(Q=Q.slice(1),se=U(Q,"*"),xe=A(Q,me),se&&(this._flags.alignment=1),ne=0;ne<Q.length;ne++)se?(this.print_token_line_indentation(T),this._output.add_token(S(Q[ne]))):xe&&Q[ne]?(this.print_token_line_indentation(T),this._output.add_token(Q[ne].substring(ve))):(this._output.current_line.set_indent(-1),this._output.add_token(Q[ne])),this.print_newline(!1,z);this._flags.alignment=0}},H.prototype.handle_comment=function(T,z){T.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(T),this.print_newline(!1,z)},H.prototype.handle_dot=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(T,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(T)},H.prototype.handle_unknown=function(T,z){this.print_token(T),T.text[T.text.length-1]===`
`&&this.print_newline(!1,z)},H.prototype.handle_eof=function(T){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(T)},n.exports.Beautifier=H},function(n){function D(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var h=new D(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},D.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},D.prototype.has_match=function(h){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(h))return!0;return!1},D.prototype.set_indent=function(h,c){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(h){this.__items.push(h);var c=h.lastIndexOf(`
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},D.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function m(h,c){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),c=c||"",h.indent_level>0&&(c=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}m.prototype.get_indent_size=function(h,c){var o=this.__base_string_length;return c=c||0,h<0&&(o=0),o+=h*this.__indent_size,o+=c,o},m.prototype.get_indent_string=function(h,c){var o=this.__base_string;return c=c||0,h<0&&(h=0,o=""),c+=h*this.__indent_size,this.__ensure_cache(c),o+=this.__cache[c],o},m.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var h=this.__cache.length,c=0,o="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,o=new Array(c+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function p(h,c){this.__indent_cache=new m(h,c),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(h,c){return this.__indent_cache.get_indent_string(h,c)},p.prototype.get_indent_size=function(h,c){return this.__indent_cache.get_indent_size(h,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(h){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 o=this.__lines.join(`
`);return h!==`
`&&(o=o.replace(/[\n]/g,h)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(h,c){return h=h||0,c=c||0,this.next_line.set_indent(h,c),this.__lines.length>1?(this.current_line.set_indent(h,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(h){for(var c=0;c<h.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.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(" "))},p.prototype.remove_indent=function(h){for(var c=this.__lines.length;h<c;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(h,c){for(var o=this.__lines.length-2;o>=0;){var d=this.__lines[o];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=p},function(n){function D(m,p,h,c){this.type=m,this.text=p,this.comments_before=null,this.newlines=h||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=D},function(n,D){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\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",o="(?:\\\\u[0-9a-fA-F]{4}|["+m+h+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+p+h+c+"])*";D.identifier=new RegExp(o+d,"g"),D.identifierStart=new RegExp(o),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+h+c+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(n,D,m){var p=m(6).Options,h=["before-newline","after-newline","preserve-newline"];function c(o){p.call(this,o,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="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 i=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<i.length;a++)i[a]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[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",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new p,n.exports.Options=c},function(n){function D(h,c){this.raw_options=m(h,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"])}D.prototype._get_array=function(h,c){var o=this.raw_options[h],d=c||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(d=o.concat()):typeof o=="string"&&(d=o.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(h,c){var o=this.raw_options[h],d=o===void 0?!!c:!!o;return d},D.prototype._get_characters=function(h,c){var o=this.raw_options[h],d=c||"";return typeof o=="string"&&(d=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},D.prototype._get_number=function(h,c){var o=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(o,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(h,c,o){var d=this._get_selection_list(h,c,o);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[h]+"'");return d[0]},D.prototype._get_selection_list=function(h,c,o){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[c[0]],!this._is_valid_selection(o,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,o);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[h]+"'");return d},D.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(o){return c.indexOf(o)===-1})};function m(h,c){var o={};h=p(h);var d;for(d in h)d!==c&&(o[d]=h[d]);if(c&&h[c])for(d in h[c])o[d]=h[c][d];return o}function p(h){var c={},o;for(o in h){var d=o.replace(/-/g,"_");c[d]=h[o]}return c}n.exports.Options=D,n.exports.normalizeOpts=p,n.exports.mergeOpts=m},function(n,D,m){var p=m(8).InputScanner,h=m(9).Tokenizer,c=m(9).TOKEN,o=m(13).Directives,d=m(4),i=m(12).Pattern,a=m(14).TemplatablePattern;function r(U,A){return A.indexOf(U)!==-1}var s={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},S=new o(/\/\*/,/\*\//),w=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,L=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var b=new RegExp(_),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+f.join("|")+")$"),E,v=function(U,A){h.call(this,U,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new i(this._input),F=new a(this._input).read_options(this._options);this.__patterns={template:F,identifier:F.starting_with(d.identifier).matching(d.identifierMatch),number:H.matching(w),punct:H.matching(b),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(/<!--/),html_comment_end:H.matching(/-->/),include:H.starting_with(/#include/).until_after(d.lineBreak),shebang:H.starting_with(/#!/).until_after(d.lineBreak),xml:H.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:F.until(/['\\\n\r\u2028\u2029]/),double_quote:F.until(/["\\\n\r\u2028\u2029]/),template_text:F.until(/[`\\$]/),template_expression:F.until(/[`}\\]/)}};v.prototype=new h,v.prototype._is_comment=function(U){return U.type===s.COMMENT||U.type===s.BLOCK_COMMENT||U.type===s.UNKNOWN},v.prototype._is_opening=function(U){return U.type===s.START_BLOCK||U.type===s.START_EXPR},v.prototype._is_closing=function(U,A){return(U.type===s.END_BLOCK||U.type===s.END_EXPR)&&A&&(U.text==="]"&&A.text==="["||U.text===")"&&A.text==="("||U.text==="}"&&A.text==="{")},v.prototype._reset=function(){E=!1},v.prototype._get_next_token=function(U,A){var H=null;this._readWhitespace();var F=this._input.peek();return F===null?this._create_token(s.EOF,""):(H=H||this._read_non_javascript(F),H=H||this._read_string(F),H=H||this._read_word(U),H=H||this._read_singles(F),H=H||this._read_comment(F),H=H||this._read_regexp(F,U),H=H||this._read_xml(F,U),H=H||this._read_punctuation(),H=H||this._create_token(s.UNKNOWN,this._input.next()),H)},v.prototype._read_word=function(U){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(d.allLineBreaks,`
`),!(U.type===s.DOT||U.type===s.RESERVED&&(U.text==="set"||U.text==="get"))&&C.test(A)?(A==="in"||A==="of")&&(U.type===s.WORD||U.type===s.STRING)?this._create_token(s.OPERATOR,A):this._create_token(s.RESERVED,A):this._create_token(s.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(s.WORD,A)},v.prototype._read_singles=function(U){var A=null;return U==="("||U==="["?A=this._create_token(s.START_EXPR,U):U===")"||U==="]"?A=this._create_token(s.END_EXPR,U):U==="{"?A=this._create_token(s.START_BLOCK,U):U==="}"?A=this._create_token(s.END_BLOCK,U):U===";"?A=this._create_token(s.SEMICOLON,U):U==="."&&L.test(this._input.peek(1))?A=this._create_token(s.DOT,U):U===","&&(A=this._create_token(s.COMMA,U)),A&&this._input.next(),A},v.prototype._read_punctuation=function(){var U=this.__patterns.punct.read();if(U!=="")return U==="="?this._create_token(s.EQUALS,U):U==="?."?this._create_token(s.DOT,U):this._create_token(s.OPERATOR,U)},v.prototype._read_non_javascript=function(U){var A="";if(U==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(s.UNKNOWN,A.trim()+`
`);if(A=this.__patterns.include.read(),A)return this._create_token(s.UNKNOWN,A.trim()+`
`);U=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(x)){do U=this._input.next(),H+=U;while(this._input.hasNext()&&U!=="#"&&U!=="=");return U==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,H)}this._input.back()}else if(U==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)A+=this._input.next();return E=!0,this._create_token(s.COMMENT,A)}}else if(E&&U==="-"&&(A=this.__patterns.html_comment_end.read(),A))return E=!1,this._create_token(s.COMMENT,A);return null},v.prototype._read_comment=function(U){var A=null;if(U==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var F=S.get_directives(H);F&&F.ignore==="start"&&(H+=S.readIgnored(this._input)),H=H.replace(d.allLineBreaks,`
`),A=this._create_token(s.BLOCK_COMMENT,H),A.directives=F}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),A=this._create_token(s.COMMENT,H))}return A},v.prototype._read_string=function(U){if(U==="`"||U==="'"||U==='"'){var A=this._input.next();return this.has_char_escapes=!1,U==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(U),this.has_char_escapes&&this._options.unescape_strings&&(A=N(A)),this._input.peek()===U&&(A+=this._input.next()),A=A.replace(d.allLineBreaks,`
`),this._create_token(s.STRING,A)}return null},v.prototype._allow_regexp_or_xml=function(U){return U.type===s.RESERVED&&r(U.text,["return","case","throw","else","do","typeof","yield"])||U.type===s.END_EXPR&&U.text===")"&&U.opened.previous.type===s.RESERVED&&r(U.opened.previous.text,["if","while","for"])||r(U.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},v.prototype._read_regexp=function(U,A){if(U==="/"&&this._allow_regexp_or_xml(A)){for(var H=this._input.next(),F=!1,T=!1;this._input.hasNext()&&(F||T||this._input.peek()!==U)&&!this._input.testChar(d.newline);)H+=this._input.peek(),F?F=!1:(F=this._input.peek()==="\\",this._input.peek()==="["?T=!0:this._input.peek()==="]"&&(T=!1)),this._input.next();return this._input.peek()===U&&(H+=this._input.next(),H+=this._input.read(d.identifier)),this._create_token(s.STRING,H)}return null},v.prototype._read_xml=function(U,A){if(this._options.e4x&&U==="<"&&this._allow_regexp_or_xml(A)){var H="",F=this.__patterns.xml.read_match();if(F){for(var T=F[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=T.indexOf("{")===0,Q=0;F;){var ne=!!F[1],se=F[2],xe=!!F[F.length-1]||se.slice(0,8)==="![CDATA[";if(!xe&&(se===T||z&&se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ne?--Q:++Q),H+=F[0],Q<=0)break;F=this.__patterns.xml.read_match()}return F||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(d.allLineBreaks,`
`),this._create_token(s.STRING,H)}}return null};function N(U){for(var A="",H=0,F=new p(U),T=null;F.hasNext();)if(T=F.match(/([\s]|[^\\]|\\\\)+/g),T&&(A+=T[0]),F.peek()==="\\"){if(F.next(),F.peek()==="x")T=F.match(/x([0-9A-Fa-f]{2})/g);else if(F.peek()==="u")T=F.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",F.hasNext()&&(A+=F.next());continue}if(!T)return U;if(H=parseInt(T[1],16),H>126&&H<=255&&T[0].indexOf("x")===0)return U;if(H>=0&&H<32){A+="\\"+T[0];continue}else H===34||H===39||H===92?A+="\\"+String.fromCharCode(H):A+=String.fromCharCode(H)}return A}v.prototype._read_string_recursive=function(U,A,H){var F,T;U==="'"?T=this.__patterns.single_quote:U==='"'?T=this.__patterns.double_quote:U==="`"?T=this.__patterns.template_text:U==="}"&&(T=this.__patterns.template_expression);for(var z=T.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===U||!A&&d.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(F=this._input.peek(),F==="x"||F==="u"?this.has_char_escapes=!0:F==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Q+=this._input.next()):H&&(H==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),H===Q&&(U==="`"?Q+=this._read_string_recursive("}",A,"`"):Q+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=T.read(),z+=Q}return z},n.exports.Tokenizer=v,n.exports.TOKEN=s,n.exports.positionable_operators=O.slice(),n.exports.line_starters=g.slice()},function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function m(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},m.prototype.peek=function(p){var h=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(h=this.__input.charAt(p)),h},m.prototype.__match=function(p,h){p.lastIndex=h;var c=p.exec(this.__input);return c&&!(D&&p.sticky)&&(c.index!==h&&(c=null)),c},m.prototype.test=function(p,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(p,h):!1},m.prototype.testChar=function(p,h){var c=this.peek(h);return p.lastIndex=0,c!==null&&p.test(c)},m.prototype.match=function(p){var h=this.__match(p,this.__position);return h?this.__position+=h[0].length:h=null,h},m.prototype.read=function(p,h,c){var o="",d;return p&&(d=this.match(p),d&&(o+=d[0])),h&&(d||!p)&&(o+=this.readUntil(h,c)),o},m.prototype.readUntil=function(p,h){var c="",o=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(o=d.index,h&&(o+=d[0].length)):o=this.__input_length,c=this.__input.substring(this.__position,o),this.__position=o,c},m.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},m.prototype.get_regexp=function(p,h){var c=null,o="g";return h&&D&&(o="y"),typeof p=="string"&&p!==""?c=new RegExp(p,o):p&&(c=new RegExp(p.source,o)),c},m.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(p){var h=this.__position,c=this.readUntilAfter(p);return this.__position=h,c},m.prototype.lookBack=function(p){var h=this.__position-1;return h>=p.length&&this.__input.substring(h-p.length,h).toLowerCase()===p},n.exports.InputScanner=m},function(n,D,m){var p=m(8).InputScanner,h=m(3).Token,c=m(10).TokenStream,o=m(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(a,r){this._input=new p(a),this._options=r||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var a,r=new h(d.START,""),s=null,S=[],w=new c;r.type!==d.EOF;){for(a=this._get_next_token(r,s);this._is_comment(a);)w.add(a),a=this._get_next_token(r,s);w.isEmpty()||(a.comments_before=w,w=new c),a.parent=s,this._is_opening(a)?(S.push(s),s=a):s&&this._is_closing(a,s)&&(a.opened=s,s.closed=a,s=S.pop(),a.parent=s),a.previous=r,r.next=a,this.__tokens.add(a),r=a}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(a,r){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(d.RAW,s):this._create_token(d.EOF,"")},i.prototype._is_comment=function(a){return!1},i.prototype._is_opening=function(a){return!1},i.prototype._is_closing=function(a,r){return!1},i.prototype._create_token=function(a,r){var s=new h(a,r,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=i,n.exports.TOKEN=d},function(n){function D(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},D.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(p=this.__tokens[m]),p},D.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},n.exports.TokenStream=D},function(n,D,m){var p=m(12).Pattern;function h(c,o){p.call(this,c,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new p,h.prototype.__set_whitespace_patterns=function(c,o){c+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},h.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 o=this.__split(this._newline_regexp,c);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return c},h.prototype.matching=function(c,o){var d=this._create();return d.__set_whitespace_patterns(c,o),d._update(),d},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(c,o){c.lastIndex=0;for(var d=0,i=[],a=c.exec(o);a;)i.push(o.substring(d,a.index)),d=a.index+a[0].length,a=c.exec(o);return d<o.length?i.push(o.substring(d,o.length)):i.push(""),i},n.exports.WhitespacePattern=h},function(n){function D(m,p){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}D.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(m){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(m),p._update(),p},D.prototype.until=function(m){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(m),p._update(),p},D.prototype.starting_with=function(m){var p=this._create();return p._starting_pattern=this._input.get_regexp(m,!0),p._update(),p},D.prototype.matching=function(m){var p=this._create();return p._match_pattern=this._input.get_regexp(m,!0),p._update(),p},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},n.exports.Pattern=D},function(n){function D(m,p){m=typeof m=="string"?m:m.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+p,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(m);h;)p[h[1]]=h[2],h=this.__directive_pattern.exec(m);return p},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},function(n,D,m){var p=m(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(o,d){p.call(this,o,d),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var i=new p(o);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new p,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(o){var d=this._create();return d._disabled[o]=!0,d._update(),d},c.prototype.read_options=function(o){var d=this._create();for(var i in h)d._disabled[i]=o.templating.indexOf(i)===-1;return d._update(),d},c.prototype.exclude=function(o){var d=this._create();return d._excluded[o]=!0,d._update(),d},c.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),o+=d,d=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},c.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},c.prototype._read_template=function(){var o="",d=this._input.peek();if(d==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(o=o||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},n.exports.TemplatablePattern=c}],M={};function G(n){var D=M[n];if(D!==void 0)return D.exports;var m=M[n]={exports:{}};return j[n](m,m.exports,G),m.exports}var W=G(0);P=W})();var V=P;!(Z=[],X=function(){return{js_beautify:V}}.apply(oe,Z),X!==void 0&&(Fe.exports=X))})()},"6eGT":function(Fe,oe,k){"use strict";function Z(X){return null}oe.a=Z},"746U":function(Fe,oe,k){"use strict";k.d(oe,"f",function(){return Z}),k.d(oe,"l",function(){return X}),k.d(oe,"k",function(){return P}),k.d(oe,"j",function(){return V}),k.d(oe,"g",function(){return j}),k.d(oe,"m",function(){return M}),k.d(oe,"h",function(){return G}),k.d(oe,"n",function(){return W}),k.d(oe,"c",function(){return n}),k.d(oe,"a",function(){return D}),k.d(oe,"i",function(){return m}),k.d(oe,"o",function(){return p}),k.d(oe,"e",function(){return o}),k.d(oe,"d",function(){return d}),k.d(oe,"p",function(){return i}),k.d(oe,"b",function(){return a});function Z(r){return Array.isArray(r)}function X(r){return typeof r=="string"}function P(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function V(r){return typeof r=="number"&&!isNaN(r)}function j(r){return r===!0||r===!1}function M(r){return typeof r=="undefined"}function G(r){return!W(r)}function W(r){return M(r)||r===null}function n(r,s){if(!r)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function D(r){if(W(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function m(r){return typeof r=="function"}function p(r,s){const S=Math.min(r.length,s.length);for(let w=0;w<S;w++)h(r[w],s[w])}function h(r,s){if(X(s)){if(typeof r!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(m(s)){try{if(r instanceof s)return}catch(S){}if(!W(r)&&r.constructor===s)return;if(s.length===1&&s.call(void 0,r)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function c(r){let s=[],S=Object.getPrototypeOf(r);for(;Object.prototype!==S;)s=s.concat(Object.getOwnPropertyNames(S)),S=Object.getPrototypeOf(S);return s}function o(r){const s=[];for(const S of c(r))typeof r[S]=="function"&&s.push(S);return s}function d(r,s){const S=x=>function(){const L=Array.prototype.slice.call(arguments,0);return s(x,L)};let w={};for(const x of r)w[x]=S(x);return w}function i(r){return r===null?void 0:r}function a(r,s="Unreachable"){throw new Error(s)}},"7Cbv":function(Fe,oe,k){"use strict";var Z=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(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(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 j(h){return typeof h=="string"&&V.test(h)}for(var M=j,G=[],W=0;W<256;++W)G.push((W+256).toString(16).substr(1));function n(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(G[h[c+0]]+G[h[c+1]]+G[h[c+2]]+G[h[c+3]]+"-"+G[h[c+4]]+G[h[c+5]]+"-"+G[h[c+6]]+G[h[c+7]]+"-"+G[h[c+8]]+G[h[c+9]]+"-"+G[h[c+10]]+G[h[c+11]]+G[h[c+12]]+G[h[c+13]]+G[h[c+14]]+G[h[c+15]]).toLowerCase();if(!M(o))throw TypeError("Stringified UUID is invalid");return o}var D=n;function m(h,c,o){h=h||{};var d=h.random||(h.rng||P)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,c){o=o||0;for(var i=0;i<16;++i)c[o+i]=d[i];return c}return D(d)}var p=oe.a=m},"7ahc":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return S});var Z=k("k1fw"),X=k("0Owb"),P=k("+L6B"),V=k("2/Rp"),j=k("y8nQ"),M=k("Vl3Y"),G=k("tJVT"),W=k("OaEy"),n=k("2fM7"),D=k("q1tI"),m=k.n(D),p=k("VrN/"),h=k.n(p),c=k("p77/"),o=k.n(c),d=k("c5Ni"),i=k.n(d),a=n.a.Option,r={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};oe.b=function(w){var x=w.callback,L=w.onCancel,O=Object(D.useState)("python"),_=Object(G.a)(O,2),b=_[0],g=_[1];function f(E){g(s[E][1])}function C(E){x(E)}return m.a.createElement(M.a,Object(X.a)({},r,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(n.a,{onChange:f},Object.keys(s).map(function(E){return m.a.createElement(a,{key:E,value:E},s[E][0])}))),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(S,{mode:b})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(V.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function S(w){var x=w.value,L=w.onChange,O=w.mode,_=w.options,b=_===void 0?{}:_,g=Object(D.useRef)(),f=Object(D.useState)(),C=Object(G.a)(f,2),E=C[0],v=C[1];return Object(D.useEffect)(function(){if(E){function N(U){var A=U.getValue();L&&L(A)}return E.on("change",N),function(){E.off("change",N)}}},[E,L]),Object(D.useEffect)(function(){E&&E.setOption("mode",O)},[E,O]),Object(D.useEffect)(function(){E&&((x!==E.getValue()||x==="")&&setTimeout(function(){E.setValue(x||" ")},300))},[E,x]),Object(D.useEffect)(function(){if(g.current&&!E){var N=h.a.fromTextArea(g.current,Object(Z.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));v(N)}},[g.current,E]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:g}))}},"7ixt":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return P});var Z={adjustX:1,adjustY:1},X=[0,0],P={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:X},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:X},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:X},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:X},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:X},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:X},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:X},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:X},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:X},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:X},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:X},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:X}},V=P},"815F":function(Fe,oe,k){"use strict";k.d(oe,"e",function(){return G}),k.d(oe,"c",function(){return n}),k.d(oe,"d",function(){return D}),k.d(oe,"a",function(){return p}),k.d(oe,"f",function(){return h}),k.d(oe,"b",function(){return c});var Z=k("KQm4"),X=k("VTBJ"),P=k("Ff2n"),V=k("Zm9Q"),j=k("Kwbf"),M=k("OZM5");function G(o,d){return o!=null?o:d}function W(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function i(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(s){var S=s.key,w=s.children;Object(j.a)(S!=null,"Tree node must have a certain key: [".concat(r).concat(S,"]"));var x=String(S);Object(j.a)(!d.has(x)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(x)),d.set(x,!0),i(w,"".concat(r).concat(x," > "))})}i(o)}function n(o){function d(i){var a=Object(V.a)(i);return a.map(function(r){if(!Object(M.i)(r))return Object(j.a)(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var s=r.key,S=r.props,w=S.children,x=Object(P.a)(S,["children"]),L=Object(X.a)({key:s},x),O=d(w);return O.length&&(L.children=O),L}).filter(function(r){return r})}return d(o)}function D(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(d===!0?[]:d),a=[];function r(s){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return s.map(function(w,x){var L=Object(M.h)(S?S.pos:"0",x),O=G(w.key,L),_=Object(X.a)(Object(X.a)({},w),{},{parent:S,pos:L,children:null,data:w,isStart:[].concat(Object(Z.a)(S?S.isStart:[]),[x===0]),isEnd:[].concat(Object(Z.a)(S?S.isEnd:[]),[x===s.length-1])});return a.push(_),d===!0||i.has(O)?_.children=r(w.children||[],_):_.children=[],_})}return r(o),a}function m(o,d,i){var a;i?typeof i=="string"?a=function(S){return S[i]}:typeof i=="function"&&(a=function(S){return i(S)}):a=function(S,w){return G(S.key,w)};function r(s,S,w){var x=s?s.children:o,L=s?Object(M.h)(w.pos,S):"0";if(s){var O=a(s,L),_={node:s,index:S,pos:L,key:O,parentPos:w.node?w.pos:null,level:w.level+1};d(_)}x&&x.forEach(function(b,g){r(b,g,{node:s,pos:L,level:w?w.level+1:-1})})}r(null)}function p(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=d.initWrapper,a=d.processEntity,r=d.onProcessFinished,s=arguments.length>2?arguments[2]:void 0,S={},w={},x={posEntities:S,keyEntities:w};return i&&(x=i(x)||x),m(o,function(L){var O=L.node,_=L.index,b=L.pos,g=L.key,f=L.parentPos,C=L.level,E={node:O,index:_,key:g,pos:b,level:C},v=G(g,b);S[b]=E,w[v]=E,E.parent=S[f],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),a&&a(E,x)},s),r&&r(x),x}function h(o,d){var i=d.expandedKeys,a=d.selectedKeys,r=d.loadedKeys,s=d.loadingKeys,S=d.checkedKeys,w=d.halfCheckedKeys,x=d.dragOverNodeKey,L=d.dropPosition,O=d.keyEntities,_=O[o],b={eventKey:o,expanded:i.indexOf(o)!==-1,selected:a.indexOf(o)!==-1,loaded:r.indexOf(o)!==-1,loading:s.indexOf(o)!==-1,checked:S.indexOf(o)!==-1,halfChecked:w.indexOf(o)!==-1,pos:String(_?_.pos:""),dragOver:x===o&&L===0,dragOverGapTop:x===o&&L===-1,dragOverGapBottom:x===o&&L===1};return b}function c(o){var d=o.data,i=o.expanded,a=o.selected,r=o.checked,s=o.loaded,S=o.loading,w=o.halfChecked,x=o.dragOver,L=o.dragOverGapTop,O=o.dragOverGapBottom,_=o.pos,b=o.active,g=Object(X.a)(Object(X.a)({},d),{},{expanded:i,selected:a,checked:r,loaded:s,loading:S,halfChecked:w,dragOver:x,dragOverGapTop:L,dragOverGapBottom:O,pos:_,active:b});return"props"in g||Object.defineProperty(g,"props",{get:function(){return Object(j.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),g}},"8EBN":function(Fe,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){"use strict";Z.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<Z.modeInfo.length;X++){var P=Z.modeInfo[X];P.mimes&&(P.mime=P.mimes[0])}Z.findModeByMIME=function(V){V=V.toLowerCase();for(var j=0;j<Z.modeInfo.length;j++){var M=Z.modeInfo[j];if(M.mime==V)return M;if(M.mimes){for(var G=0;G<M.mimes.length;G++)if(M.mimes[G]==V)return M}}if(/\+xml$/.test(V))return Z.findModeByMIME("application/xml");if(/\+json$/.test(V))return Z.findModeByMIME("application/json")},Z.findModeByExtension=function(V){V=V.toLowerCase();for(var j=0;j<Z.modeInfo.length;j++){var M=Z.modeInfo[j];if(M.ext){for(var G=0;G<M.ext.length;G++)if(M.ext[G]==V)return M}}},Z.findModeByFileName=function(V){for(var j=0;j<Z.modeInfo.length;j++){var M=Z.modeInfo[j];if(M.file&&M.file.test(V))return M}var G=V.lastIndexOf("."),W=G>-1&&V.substring(G+1,V.length);if(W)return Z.findModeByExtension(W)},Z.findModeByName=function(V){V=V.toLowerCase();for(var j=0;j<Z.modeInfo.length;j++){var M=Z.modeInfo[j];if(M.name.toLowerCase()==V)return M;if(M.alias){for(var G=0;G<M.alias.length;G++)if(M.alias[G].toLowerCase()==V)return M}}}})},"8HAY":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return j}),k.d(oe,"b",function(){return M}),k.d(oe,"d",function(){return G}),k.d(oe,"e",function(){return W}),k.d(oe,"c",function(){return n});var Z=k("MI8n"),X=k("pmY6"),P=k("3/fG"),V=function(D,m,p,h){function c(o){return o instanceof p?o:new p(function(d){d(o)})}return new(p||(p=Promise))(function(o,d){function i(s){try{r(h.next(s))}catch(S){d(S)}}function a(s){try{r(h.throw(s))}catch(S){d(S)}}function r(s){s.done?o(s.value):c(s.value).then(i,a)}r((h=h.apply(D,m||[])).next())})};class j extends X.a{constructor(D,m="",p="",h=!0,c){super();this._onDidChange=this._register(new Z.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=m,this._cssClass=p,this._enabled=h,this._actionCallback=c}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,m){return V(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class M extends X.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new Z.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Z.b),this.onDidRun=this._onDidRun.event}run(D,m){return V(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let p;try{yield this.runAction(D,m)}catch(h){p=h}this._onDidRun.fire({action:D,error:p})})}runAction(D,m){return V(this,void 0,void 0,function*(){yield D.run(m)})}}class G extends j{constructor(D){super(G.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class W{constructor(D,m,p,h){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=m,this.class=h,this._actions=p}get actions(){return this._actions}dispose(){}run(){return V(this,void 0,void 0,function*(){})}}class n extends j{constructor(){super(n.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(Fe,oe,k){Fe.exports={button:"button___1wy9m"}},"9Bee":function(Fe,oe,k){"use strict";var Z=k("DYRE"),X=k("zeV3"),P=k("+L6B"),V=k("2/Rp"),j=k("k1fw"),M=k("9og8"),G=k("tJVT"),W=k("WmNS"),n=k.n(W),D=k("q1tI"),m=k.n(D),p=k("vg9a"),h=k("DlQD"),c=k.n(h),o=k("rUJ1");function d(J,I){var R=J.match(/^(\s+)(?:```)/);if(R===null)return I;var K=R[1];return I.split(`
`).map(function(ee){var Y=ee.match(/^\s+/);if(Y===null)return ee;var Ee=Object(G.a)(Y,1),Ye=Ee[0];return Ye.length>=K.length?ee.slice(K.length):ee}).join(`
`)}var i=[],a=["<ul>"],r=new c.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){i.length=0,a=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(J,I,R,K){if(I>=J.length||J[I].level<=R)return I;var ee=J[I];K.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),I++;var Y=[];return I=x(J,I,ee.level,Y),Y.length>0&&(K.push("<ul>"),Y.forEach(function(Ee){K.push(Ee)}),K.push("</ul>")),K.push("</li>"),I=x(J,I,R,K),I}function L(){return x(i,0,0,a),a.push("</ul>"),a.join("")}var O={heading:function(I){var R=s.exec(I);if(R)return{type:"heading",raw:R[0],depth:R[1].length,text:R[2]}},fences:function(I){var R=this.rules.block.fences.exec(I);if(R){var K=R[0],ee=d(K,R[3]||""),Y=R[2]?R[2].trim():R[2];if(["latex","katex","math"].indexOf(Y)>=0){var Ee=g(),Ye=ee;ee=Ee,f[Ee]={type:"block",expression:Ye}}return{type:"code",raw:K,lang:Y,text:ee}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,g=function(){return"__special_katext_id_".concat(b++,"__")},f={};function C(){return f}function E(){b=0,f={}}function v(J){return J=J.replace(_,function(I,R){var K=g();return f[K]={type:"inline",expression:R},K}),J}var N=r.listitem;r.listitem=function(J){return N(v(J))};var U=r.paragraph;r.paragraph=function(J){return U(v(J))};var A=r.tablecell;r.tablecell=function(J,I){return A(v(J),I)},r.code=function(J,I,R){var K=(I||"").match(/\S*/)[0];return K?["latex","katex","math"].indexOf(K)>=0?"<p class='editormd-tex'>".concat(J,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(I,'">').concat(R?J:Object(o.escape)(J,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(R?J:Object(o.escape)(J,!0))+"</code></pre>"},r.heading=function(J,I,R){var K=this.options.headerPrefix+R.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:K,level:I,text:J}),"<h"+I+' id="'+K+'">'+J+"</h"+I+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:O,renderer:r});var H=c.a,F=k("SJMd"),T=k("ulZh"),z=k.n(T),Q=k("m3rI"),ne=k("Oy/b"),se=k("p5ED"),xe=k("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 me=function(J,I){return(me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,K){R.__proto__=K}||function(R,K){for(var ee in K)Object.prototype.hasOwnProperty.call(K,ee)&&(R[ee]=K[ee])})(J,I)};function ve(J,I){function R(){this.constructor=J}me(J,I),J.prototype=I===null?Object.create(I):(R.prototype=I.prototype,new R)}function Oe(J,I,R,K){return new(R||(R=Promise))(function(ee,Y){function Ee(vt){try{lt(K.next(vt))}catch(We){Y(We)}}function Ye(vt){try{lt(K.throw(vt))}catch(We){Y(We)}}function lt(vt){var We;vt.done?ee(vt.value):(We=vt.value,We instanceof R?We:new R(function(_t){_t(We)})).then(Ee,Ye)}lt((K=K.apply(J,I||[])).next())})}function Re(J,I){var R,K,ee,Y,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return Y={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function Ye(lt){return function(vt){return function(We){if(R)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(R=1,K&&(ee=2&We[0]?K.return:We[0]?K.throw||((ee=K.return)&&ee.call(K),0):K.next)&&!(ee=ee.call(K,We[1])).done)return ee;switch(K=0,ee&&(We=[2&We[0],ee.value]),We[0]){case 0:case 1:ee=We;break;case 4:return Ee.label++,{value:We[1],done:!1};case 5:Ee.label++,K=We[1],We=[0];continue;case 7:We=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||We[0]!==6&&We[0]!==2)){Ee=0;continue}if(We[0]===3&&(!ee||We[1]>ee[0]&&We[1]<ee[3])){Ee.label=We[1];break}if(We[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=We;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(We);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}We=I.call(J,Ee)}catch(_t){We=[6,_t],K=0}finally{R=ee=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([lt,vt])}}}function fe(){for(var J=0,I=0,R=arguments.length;I<R;I++)J+=arguments[I].length;var K=Array(J),ee=0;for(I=0;I<R;I++)for(var Y=arguments[I],Ee=0,Ye=Y.length;Ee<Ye;Ee++,ee++)K[ee]=Y[Ee];return K}var ue=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(I,R){for(var K=0,ee=R;K<ee.length;K++){var Y=ee[K],Ee=Y[0],Ye=Y[1];I.setAttribute(Ee,Ye)}},J.createRect=function(I,R,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",I.toString()),ee.setAttribute("height",R.toString()),K&&J.setAttributes(ee,K),ee},J.createLine=function(I,R,K,ee,Y){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",I.toString()),Ee.setAttribute("y1",R.toString()),Ee.setAttribute("x2",K.toString()),Ee.setAttribute("y2",ee.toString()),Y&&J.setAttributes(Ee,Y),Ee},J.createPolygon=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",I),R&&J.setAttributes(K,R),K},J.createCircle=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(I/2).toString()),K.setAttribute("cy",(I/2).toString()),K.setAttribute("r",I.toString()),R&&J.setAttributes(K,R),K},J.createEllipse=function(I,R,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(I/2).toString()),ee.setAttribute("cy",(R/2).toString()),ee.setAttribute("rx",(I/2).toString()),ee.setAttribute("ry",(R/2).toString()),K&&J.setAttributes(ee,K),ee},J.createGroup=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","g");return I&&J.setAttributes(R,I),R},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(I,R,K,ee,Y,Ee,Ye){var lt=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(lt,[["id",I],["orient",R],["markerWidth",K.toString()],["markerHeight",ee.toString()],["refX",Y.toString()],["refY",Ee.toString()]]),lt.appendChild(Ye),lt},J.createText=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","text");return R.setAttribute("x","0"),R.setAttribute("y","0"),I&&J.setAttributes(R,I),R},J.createTSpan=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=I,R&&J.setAttributes(K,R),K},J.createImage=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","image");return I&&J.setAttributes(R,I),R},J.createPoint=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=I,K.y=R,K},J.createPath=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",I),R&&J.setAttributes(K,R),K},J}(),Pe=function(){function J(){}return J.addKey=function(I){J.key=I},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),et=function(){function J(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return J.prototype.rasterize=function(I,R,K){var ee=this;return new Promise(function(Y){var Ee=K!==void 0?K:document.createElement("canvas");I===null&&(ee.markersOnly=!0,ee.naturalSize=!1);var Ye=document.createElementNS("http://www.w3.org/2000/svg","svg");Ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ye.setAttribute("width",R.width.baseVal.valueAsString),Ye.setAttribute("height",R.height.baseVal.valueAsString),Ye.setAttribute("viewBox","0 0 "+R.viewBox.baseVal.width.toString()+" "+R.viewBox.baseVal.height.toString()),Ye.innerHTML=R.innerHTML,ee.naturalSize===!0?(Ye.width.baseVal.value=I.naturalWidth,Ye.height.baseVal.value=I.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(Ye.width.baseVal.value=ee.width,Ye.height.baseVal.value=ee.height),Ee.width=Ye.width.baseVal.value,Ee.height=Ye.height.baseVal.value;var lt=Ye.outerHTML,vt=Ee.getContext("2d");ee.markersOnly!==!0&&vt.drawImage(I,0,0,Ee.width,Ee.height);var We=window.URL,_t=new Image(Ee.width,Ee.height);_t.setAttribute("crossOrigin","anonymous");var Lt=new Blob([lt],{type:"image/svg+xml"}),Mt=We.createObjectURL(Lt);_t.onload=function(){vt.drawImage(_t,0,0),We.revokeObjectURL(Mt);var en=Ee.toDataURL(ee.imageType,ee.imageQuality);Y(en)},_t.src=Mt})},J}(),rt=function(){},tt=function(){function J(I){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+I+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.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(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(I){return this.styleSheet===void 0&&this.addStyleSheet(),I.name=""+this.classNamePrefix+I.localName,this.classes.push(I),this.styleSheet.sheet.insertRule("."+I.name+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length),I},J.prototype.addRule=function(I){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(I),this.styleSheet.sheet.insertRule(I.selector+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var I;this.styleSheet=document.createElement("style"),((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).appendChild(this.styleSheet),this.addRule(new it("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new it("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new it("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ze("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ze("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},J.prototype.removeStyleSheet=function(){var I;this.styleSheet&&(((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),it=function(J,I){this.selector=J,this.style=I},ze=function(J,I){this.localName=J,this.style=I},Qe=function(){function J(I,R,K,ee,Y){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=I,this.displayMode=R,this.markerItems=K,this.uiStyleSettings=ee,this.styles=Y,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return J.prototype.show=function(I){var R=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=I,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",this.uiContainer.appendChild(K),this.addActionButton(K,'<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(K,'<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(K,'<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(K,'<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(K,'<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(K,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(K,'<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(K,'<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(Y){var Ee=document.createElement("div");Ee.className=""+R.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",Y.typeName),Ee.innerHTML=Y.icon,Ee.addEventListener("click",function(){R.markerToolbarButtonClicked(Ee,Y)}),R.buttons.push(Ee),R.markerButtons.push(Ee)}),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 ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<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(ee,'<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()},J.prototype.addButtonClickListener=function(I){this.buttonClickListeners.push(I)},J.prototype.removeButtonClickListener=function(I){this.buttonClickListeners.indexOf(I)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(I),1)},J.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},J.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var I=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var R=0;R<this.markerButtons.length;R++)R<I||R===I&&this.markerButtons.length-1===I?this.markerButtonBlock.appendChild(this.markerButtons[R]):(R===I&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[R]))}},J.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")},J.prototype.resetButtonStyles=function(){var I=this;this.buttons.forEach(function(R){R.className=R.className.replace(I.uiStyleSettings.toolbarButtonStyleColorsClassName?I.uiStyleSettings.toolbarButtonStyleColorsClassName:I.toolbarButtonStyleColorsClass.name,"").trim(),R.className=R.className.replace(I.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?I.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:I.toolbarActiveButtonStyleColorsClass.name,"").trim(),R.className+=" "+(I.uiStyleSettings.toolbarButtonStyleColorsClassName?I.uiStyleSettings.toolbarButtonStyleColorsClassName:I.toolbarButtonStyleColorsClass.name)})},J.prototype.addActionButton=function(I,R,K){var ee=this,Y=document.createElement("div");switch(Y.className=""+this.toolbarButtonStyleClass.name,Y.innerHTML=R,Y.setAttribute("data-action",K),Y.addEventListener("click",function(){ee.actionToolbarButtonClicked(Y,K)}),K){case"select":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Y.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Y.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Y.style.fill=this.uiStyleSettings.closeButtonColor}I.appendChild(Y),this.buttons.push(Y)},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ze("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 ze("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ze("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ze("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 ze("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ze("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
padding: `+I+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new it("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new it("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},J.prototype.markerToolbarButtonClicked=function(I,R){this.setActiveButton(I),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("marker",R)}),this.markerButtonOverflowBlock.style.display="none"},J.prototype.actionToolbarButtonClicked=function(I,R){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("action",R)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},J.prototype.setActiveButton=function(I){this.resetButtonStyles(),I.className=I.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),I.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},J.prototype.setActiveMarkerButton=function(I){var R=this.markerButtons.find(function(K){return K.getAttribute("data-type-name")===I});R&&this.setActiveButton(R)},J.prototype.setCurrentMarker=function(I){var R=this;this.currentMarker=I,this.buttons.filter(function(K){return/delete|notes/.test(K.getAttribute("data-action"))}).forEach(function(K){R.currentMarker===void 0?(K.style.fillOpacity="0.4",K.style.pointerEvents="none"):(K.style.fillOpacity="1",K.style.pointerEvents="all")})},J}(),at=function(){function J(I,R,K,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=I,this.displayMode=R,this.uiStyleSettings=K,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return J.prototype.addStyles=function(){var I;this.toolboxStyleClass=this.styles.addClass(new ze("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 ze("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var R=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ze("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ze("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ze("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 ze("toolbox-panel-row_colors",`
background-color: `+((I=this.uiStyleSettings.toolboxBackgroundColor)!==null&&I!==void 0?I:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ze("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
padding: `+R+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new it("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new it("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},J.prototype.show=function(I){var R;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=I,this.uiContainer.className=this.toolboxStyleClass.name+" "+((R=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},J.prototype.setPanelButtons=function(I){var R,K,ee=this;this.panels=I,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((R=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Y){var Ee;Y.uiStyleSettings=ee.uiStyleSettings;var Ye=document.createElement("div");Ye.className=ee.toolboxButtonStyleClass.name+" "+((Ee=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:ee.toolboxButtonStyleColorsClass.name),Ye.innerHTML=Y.icon,Ye.title=Y.title,Ye.addEventListener("click",function(){ee.panelButtonClick(Y)}),ee.panelButtons.push(Ye),ee.buttonRow.appendChild(Ye)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},J.prototype.panelButtonClick=function(I){var R=this,K=-1;if(I!==this.activePanel){K=this.panels.indexOf(I),this.panelRow.innerHTML="";var ee=I.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),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=I}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){R.displayMode==="inline"?R.panelRow.style.display="none":R.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Y,Ee){var Ye,lt;Y.className=R.toolboxButtonStyleClass.name+" "+(Ee===K?""+((Ye=R.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ye!==void 0?Ye:R.toolboxActiveButtonStyleColorsClass.name):""+((lt=R.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&lt!==void 0?lt:R.toolboxButtonStyleColorsClass.name))})},J}(),he=function(J,I){this.title=J,this.icon=I},Se=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<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 Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=K,Ee.currentColor=ee,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var Y=R.getColorBox(ee);K.appendChild(Y),R.colorBoxes.push(Y)}),K},I.prototype.getColorBox=function(R){var K=this,ee=this.uiStyleSettings.toolbarHeight/4,Y=this.uiStyleSettings.toolbarHeight-ee,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=Y-2+"px",Ee.style.height=Y-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=(Y+2)/2+"px",Ee.style.borderColor=R===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){K.setCurrentColor(R,Ee)});var Ye=document.createElement("div");return Ye.style.display="inline-block",Ye.style.width=Y-2+"px",Ye.style.height=Y-2+"px",Ye.style.backgroundColor=R,Ye.style.borderRadius=Y/2+"px",R==="transparent"&&(Ye.style.fill=this.uiStyleSettings.toolboxAccentColor,Ye.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>`),Ee.appendChild(Ye),Ee},I.prototype.setCurrentColor=function(R,K){var ee=this;this.currentColor=R,this.colorBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(R)},I}(he),Le=function(){function J(I,R,K){this._state="new",this._isSelected=!1,this._container=I,this._overlayContainer=R,this.globalSettings=K,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(J.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),J.prototype.ownsTarget=function(I){return!1},Object.defineProperty(J.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),J.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},J.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},J.prototype.pointerDown=function(I,R){},J.prototype.dblClick=function(I,R){},J.prototype.manipulate=function(I){},J.prototype.pointerUp=function(I){this.stateChanged()},J.prototype.dispose=function(){},J.prototype.addMarkerVisualToContainer=function(I){this.container.childNodes.length>0?this.container.insertBefore(I,this.container.childNodes[0]):this.container.appendChild(I)},J.prototype.getState=function(){return{typeName:J.typeName,state:this.state,notes:this.notes}},J.prototype.restoreState=function(I){this._state=I.state,this.notes=I.notes},J.prototype.scale=function(I,R){},J.prototype.colorChanged=function(I){this.onColorChanged&&this.onColorChanged(I),this.stateChanged()},J.prototype.fillColorChanged=function(I){this.onFillColorChanged&&this.onFillColorChanged(I),this.stateChanged()},J.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var I=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),I.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(I)&&this.onStateChanged(this)}},J.typeName="MarkerBase",J}(),Me=function(){function J(){this.findGripByVisual=this.findGripByVisual.bind(this)}return J.prototype.findGripByVisual=function(I){return this.topLeft.ownsTarget(I)?this.topLeft:this.topCenter.ownsTarget(I)?this.topCenter:this.topRight.ownsTarget(I)?this.topRight:this.centerLeft.ownsTarget(I)?this.centerLeft:this.centerRight.ownsTarget(I)?this.centerRight:this.bottomLeft.ownsTarget(I)?this.bottomLeft:this.bottomCenter.ownsTarget(I)?this.bottomCenter:this.bottomRight.ownsTarget(I)?this.bottomRight:void 0},J}(),qe=function(){function J(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(I){return I===this.visual||I===this.visual.childNodes[0]||I===this.visual.childNodes[1]},J}(),st=function(){function J(){}return J.toITransformMatrix=function(I){return{a:I.a,b:I.b,c:I.c,d:I.d,e:I.e,f:I.f}},J.toSVGMatrix=function(I,R){return I.a=R.a,I.b=R.b,I.c=R.c,I.d=R.d,I.e=R.e,I.f=R.f,I},J}(),mt=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.left=0,Y.top=0,Y.width=0,Y.height=0,Y.defaultSize={x:50,y:20},Y.offsetX=0,Y.offsetY=0,Y.rotationAngle=0,Y.CB_DISTANCE=10,Y._suppressMarkerCreateEvent=!1,Y.container.transform.baseVal.appendItem(ue.createTransform()),Y.setupControlBox(),Y}return ve(I,J),Object.defineProperty(I.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"visual",{get:function(){return this._visual},set:function(R){this._visual=R;var K=ue.createTransform();this._visual.transform.baseVal.appendItem(K)},enumerable:!1,configurable:!0}),I.prototype.ownsTarget=function(R){return!!J.prototype.ownsTarget.call(this,R)||!!(this.controlGrips.findGripByVisual(R)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(R))},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="new"&&(this.left=R.x,this.top=R.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(R);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(K),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K)){this.activeGrip=this.rotatorGrip;var Y=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Y.x-this.width/2,this.top=Y.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},I.prototype.pointerUp=function(R){var K=this.state;J.prototype.pointerUp.call(this,R),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(R),this._state="select",K==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},I.prototype.moveVisual=function(R){this.visual.style.transform="translate("+R.x+"px, "+R.y+"px)"},I.prototype.manipulate=function(R){var K=this.unrotatePoint(R);this.state==="creating"?this.resize(R):this.state==="move"?(this.left=this.manipulationStartLeft+(K.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(K.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(K):this.state==="rotate"&&this.rotate(R)},I.prototype.resize=function(R){var K=this.manipulationStartLeft,ee=this.manipulationStartWidth,Y=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:K=this.manipulationStartLeft+R.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-K;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+R.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Y=this.manipulationStartTop+R.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-Y;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+R.y-this.manipulationStartY}ee>=0?(this.left=K,this.width=ee):(this.left=K+ee,this.width=-ee),Ee>=0?(this.top=Y,this.height=Ee):(this.top=Y+Ee,this.height=-Ee),this.setSize()},I.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},I.prototype.rotate=function(R){if(Math.abs(R.x-this.centerX)>.1){var K=Math.sign(R.x-this.centerX);this.rotationAngle=180*Math.atan((R.y-this.centerY)/(R.x-this.centerX))/Math.PI+90*K,this.applyRotation()}},I.prototype.applyRotation=function(){var R=this.container.transform.baseVal.getItem(0);R.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(R,0)},I.prototype.rotatePoint=function(R){if(this.rotationAngle===0)return R;var K=this.container.getCTM(),ee=ue.createPoint(R.x,R.y);return{x:(ee=ee.matrixTransform(K)).x,y:ee.y}},I.prototype.unrotatePoint=function(R){if(this.rotationAngle===0)return R;var K=this.container.getCTM();K=K.inverse();var ee=ue.createPoint(R.x,R.y);return{x:(ee=ee.matrixTransform(K)).x,y:ee.y}},I.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},I.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},I.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var R=ue.createTransform();R.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(R),this.container.appendChild(this.controlBox),this.controlRect=ue.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ue.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Me,this.addControlGrips(),this.controlBox.style.display="none"},I.prototype.adjustControlBox=function(){var R=this.controlBox.transform.baseVal.getItem(0);R.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(R,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()},I.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()},I.prototype.createGrip=function(){var R=new qe;return R.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(R.visual),R},I.prototype.positionGrips=function(){var R=this.controlGrips.topLeft.GRIP_SIZE,K=-R/2,ee=K,Y=(this.width+this.CB_DISTANCE)/2-R/2,Ee=(this.height+this.CB_DISTANCE)/2-R/2,Ye=this.height+this.CB_DISTANCE-R/2,lt=this.width+this.CB_DISTANCE-R/2;this.positionGrip(this.controlGrips.topLeft.visual,K,ee),this.positionGrip(this.controlGrips.topCenter.visual,Y,ee),this.positionGrip(this.controlGrips.topRight.visual,lt,ee),this.positionGrip(this.controlGrips.centerLeft.visual,K,Ee),this.positionGrip(this.controlGrips.centerRight.visual,lt,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,K,Ye),this.positionGrip(this.controlGrips.bottomCenter.visual,Y,Ye),this.positionGrip(this.controlGrips.bottomRight.visual,lt,Ye),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Y,ee-3*this.CB_DISTANCE)},I.prototype.positionGrip=function(R,K,ee){var Y=R.transform.baseVal.getItem(0);Y.setTranslate(K,ee),R.transform.baseVal.replaceItem(Y,0)},I.prototype.hideControlBox=function(){this.controlBox.style.display="none"},I.prototype.showControlBox=function(){this.controlBox.style.display=""},I.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:st.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:st.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},J.prototype.getState.call(this))},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.left=K.left,this.top=K.top,this.width=K.width,this.height=K.height,this.rotationAngle=K.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,K.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,K.containerTransformMatrix))},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K);var ee=this.rotatePoint({x:this.left,y:this.top}),Y=this.unrotatePoint({x:ee.x*R,y:ee.y*K});this.left=Y.x,this.top=Y.y,this.width=this.width*R,this.height=this.height*K,this.adjustControlBox()},I}(Le),gt=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual)},I.prototype.createVisual=function(){this.visual=ue.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},I.prototype.manipulate=function(R){J.prototype.manipulate.call(this,R)},I.prototype.resize=function(R){J.prototype.resize.call(this,R),this.setSize()},I.prototype.setSize=function(){J.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},I.prototype.pointerUp=function(R){J.prototype.pointerUp.call(this,R),this.setSize()},I.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},I.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},I.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},I.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},I.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this))},I.prototype.restoreState=function(R){var K=R;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),J.prototype.restoreState.call(this,R),this.setSize()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.setSize()},I.title="Rectangle marker",I}(mt),St=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=K,Ee.currentWidth=ee,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.widths.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.flexGrow="2",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=ee===R.currentWidth?R.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){R.setCurrentWidth(ee,Y)}),K.appendChild(Y);var Ee=document.createElement("div");Ee.innerText=ee.toString(),Ee.style.marginRight="5px",Y.appendChild(Ee);var Ye=document.createElement("div");Ye.style.minHeight="20px",Ye.style.flexGrow="2",Ye.style.display="flex",Ye.style.alignItems="center";var lt=document.createElement("hr");lt.style.minWidth="20px",lt.style.border="0px",lt.style.borderTop=ee+"px solid "+R.uiStyleSettings.toolboxColor,lt.style.flexGrow="2",Ye.appendChild(lt),Y.appendChild(Ye),R.widthBoxes.push(Y)}),K},I.prototype.setCurrentWidth=function(R,K){var ee=this;this.currentWidth=R,this.widthBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},I}(he),Et=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<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 Ee.styles=[],Ee.styleBoxes=[],Ee.styles=K,Ee.currentStyle=ee,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.styles.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/R.styles.length-5+"%",Y.style.borderColor=ee===R.currentStyle?R.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){R.setCurrentStyle(ee,Y)}),K.appendChild(Y);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var Ye=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+R.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
</svg>`;Ee.innerHTML=Ye,Y.appendChild(Ee),R.styleBoxes.push(Y)}),K},I.prototype.setCurrentStyle=function(R,K){var ee=this;this.currentStyle=R,this.styleBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},I}(he),Ae=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Se("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new St("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new Et("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ve(I,J),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.typeName="FrameMarker",I.title="Frame marker",I.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',I}(gt),Ce=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},Xe=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.x1=0,Y.y1=0,Y.x2=0,Y.y2=0,Y.defaultLength=50,Y.manipulationStartX=0,Y.manipulationStartY=0,Y.manipulationStartX1=0,Y.manipulationStartY1=0,Y.manipulationStartX2=0,Y.manipulationStartY2=0,Y.setupControlBox(),Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!!J.prototype.ownsTarget.call(this,R)||!(!this.grip1.ownsTarget(R)&&!this.grip2.ownsTarget(R))},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.manipulationStartX=R.x,this.manipulationStartY=R.y,this.state==="new"&&(this.x1=R.x,this.y1=R.y,this.x2=R.x,this.y2=R.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(K)?this.activeGrip=this.grip1:this.grip2.ownsTarget(K)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},I.prototype.pointerUp=function(R){var K=this.state;J.prototype.pointerUp.call(this,R),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(R),this._state="select",K==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},I.prototype.adjustVisual=function(){},I.prototype.manipulate=function(R){this.state==="creating"?this.resize(R):this.state==="move"?(this.x1=this.manipulationStartX1+R.x-this.manipulationStartX,this.y1=this.manipulationStartY1+R.y-this.manipulationStartY,this.x2=this.manipulationStartX2+R.x-this.manipulationStartX,this.y2=this.manipulationStartY2+R.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(R)},I.prototype.resize=function(R){switch(this.activeGrip){case this.grip1:this.x1=R.x,this.y1=R.y;break;case this.grip2:case void 0:this.x2=R.x,this.y2=R.y}this.adjustVisual(),this.adjustControlBox()},I.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},I.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},I.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},I.prototype.adjustControlBox=function(){this.positionGrips()},I.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},I.prototype.createGrip=function(){var R=new qe;return R.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(R.visual),R},I.prototype.positionGrips=function(){var R=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-R/2,this.y1-R/2),this.positionGrip(this.grip2.visual,this.x2-R/2,this.y2-R/2)},I.prototype.positionGrip=function(R,K,ee){var Y=R.transform.baseVal.getItem(0);Y.setTranslate(K,ee),R.transform.baseVal.replaceItem(Y,0)},I.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},J.prototype.getState.call(this))},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.x1=K.x1,this.y1=K.y1,this.x2=K.x2,this.y2=K.y2},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.x1=this.x1*R,this.y1=this.y1*K,this.x2=this.x2*R,this.y2=this.y2*K,this.adjustVisual(),this.adjustControlBox()},I}(Le),Je=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Se("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new St("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new Et("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorLine&&R!==this.visibleLine)},I.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},I.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},I.prototype.setStrokeColor=function(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},I.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},I.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.adjustVisual(),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.createVisual(),this.adjustVisual()},I.typeName="LineMarker",I.title="Line marker",I.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',I}(Xe),ke=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<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 Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=K,Ee.currentFont=ee,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.flexGrow="2",this.fonts.forEach(function(ee){var Y=document.createElement("div");Y.style.display="inline-block",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/R.fonts.length-5+"%",Y.style.borderColor=ee===R.currentFont?R.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){R.setCurrentFont(ee,Y)}),K.appendChild(Y);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=ee,Ee.style.overflow="hidden";var Ye=document.createElement("div");Ye.style.whiteSpace="nowrap",Ye.style.overflow="hidden",Ye.style.textOverflow="ellipsis",Ye.innerHTML="The quick brown fox jumps over the lazy dog",Ee.appendChild(Ye),Y.appendChild(Ee),R.fontBoxes.push(Y)}),K},I.prototype.setCurrentFont=function(R,K){var ee=this;this.currentFont=R,this.fontBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},I}(he),Ke=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.color="transparent",Y.padding=5,Y.DEFAULT_TEXT="your text here",Y.text=Y.DEFAULT_TEXT,Y.isMoved=!1,Y.color=ee.defaultColor,Y.fontFamily=ee.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setColor=Y.setColor.bind(Y),Y.setFont=Y.setFont.bind(Y),Y.renderText=Y.renderText.bind(Y),Y.sizeText=Y.sizeText.bind(Y),Y.textEditDivClicked=Y.textEditDivClicked.bind(Y),Y.showTextEditor=Y.showTextEditor.bind(Y),Y.setSize=Y.setSize.bind(Y),Y.positionTextEditor=Y.positionTextEditor.bind(Y),Y.colorPanel=new Se("Color",ee.defaultColorSet,ee.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.fontFamilyPanel=new ke("Font",ee.defaultFontFamilies,ee.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y}return ve(I,J),I.prototype.ownsTarget=function(R){if(J.prototype.ownsTarget.call(this,R)||R===this.visual||R===this.textElement||R===this.bgRectangle)return!0;var K=!1;return this.textElement.childNodes.forEach(function(ee){ee===R&&(K=!0)}),K},I.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.isMoved=!1,this.pointerDownPoint=R,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},I.prototype.renderText=function(){var R=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(K){R.textElement.appendChild(ue.createTSpan(K.trim()===""?" ":K.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},I.prototype.getTextScale=function(){var R=this.textElement.getBBox(),K=1;if(R.width>0&&R.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/R.width,Y=(1*this.height-this.height*this.padding*2/100)/R.height;K=Math.min(ee,Y)}return K},I.prototype.getTextPosition=function(R){var K=this.textElement.getBBox(),ee=0,Y=0;return K.width>0&&K.height>0&&(ee=(this.width-K.width*R)/2,Y=this.height/2-K.height*R/2),{x:ee,y:Y}},I.prototype.sizeText=function(){var R=this.textElement.getBBox(),K=this.getTextScale(),ee=this.getTextPosition(K);ee.y-=R.y*K,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+K+", "+K+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(K,K))},I.prototype.manipulate=function(R){J.prototype.manipulate.call(this,R),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(R.x-this.pointerDownPoint.x)>5||Math.abs(R.y-this.pointerDownPoint.y)>5)},I.prototype.resize=function(R){J.prototype.resize.call(this,R),this.isMoved=!0,this.setSize(),this.sizeText()},I.prototype.setSize=function(){J.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},I.prototype.pointerUp=function(R){var K=this.state;K==="creating"&&(this._suppressMarkerCreateEvent=!0),J.prototype.pointerUp.call(this,R),this.setSize(),(K==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},I.prototype.showTextEditor=function(){var R=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(K){K.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var K=Number.parseFloat(R.textEditor.style.fontSize);R.textEditor.clientWidth>=Number.parseInt(R.textEditor.style.maxWidth)&&K>.9;)K-=.1,R.textEditor.style.fontSize=Math.max(K,.9)+"em"}),this.textEditor.addEventListener("keyup",function(K){K.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(K){if(K.clipboardData){var ee=K.clipboardData.getData("text"),Y=window.getSelection();if(!Y.rangeCount)return!1;Y.deleteFromDocument(),Y.getRangeAt(0).insertNode(document.createTextNode(ee)),K.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){R.textEditDivClicked(R.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},I.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var R=this.getTextScale(),K=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),Y={x:ee.width*R,y:ee.height*R};K.x-=Y.x/2,K.y-=Y.y/2,this.textEditor.style.top=K.y+"px",this.textEditor.style.left=K.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-K.x+"px",this.textEditor.style.fontSize=Math.max(16*R,12)+"px",this.textElement.style.display="none"}},I.prototype.textEditDivClicked=function(R){this.text=R.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},I.prototype.select=function(){J.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},I.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),J.prototype.deselect.call(this)},I.prototype.dblClick=function(R,K){J.prototype.dblClick.call(this,R,K),this.showTextEditor()},I.prototype.setColor=function(R){this.textElement&&ue.setAttributes(this.textElement,[["fill",R]]),this.color=R,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(R)},I.prototype.setFont=function(R){this.textElement&&ue.setAttributes(this.textElement,[["font-family",R]]),this.fontFamily=R,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},I.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},I.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){var K=R;this.color=K.color,this.fontFamily=K.fontFamily,this.padding=K.padding,this.text=K.text,this.createVisual(),J.prototype.restoreState.call(this,R),this.setSize()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.setSize(),this.sizeText(),this.positionTextEditor()},I.typeName="TextMarker",I.title="Text marker",I.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>',I}(mt),ye=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.color="transparent",Y.lineWidth=3,Y.drawing=!1,Y.pixelRatio=1,Y.color=ee.defaultColor,Y.lineWidth=ee.defaultStrokeWidth,Y.pixelRatio=ee.freehandPixelRatio,Y.setColor=Y.setColor.bind(Y),Y.addCanvas=Y.addCanvas.bind(Y),Y.finishCreation=Y.finishCreation.bind(Y),Y.setLineWidth=Y.setLineWidth.bind(Y),Y.colorPanel=new Se("Color",ee.defaultColorSet,ee.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.lineWidthPanel=new St("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.lineWidthPanel.onWidthChanged=Y.setLineWidth,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.drawingImage)},I.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var R=ue.createTransform();this.visual.transform.baseVal.appendItem(R),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(R,K){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(R.x,R.y),this.drawing=!0):J.prototype.pointerDown.call(this,R,K)},I.prototype.manipulate=function(R){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(R.x,R.y),this.canvasContext.stroke()):J.prototype.manipulate.call(this,R)},I.prototype.resize=function(R){J.prototype.resize.call(this,R),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},I.prototype.pointerUp=function(R){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):J.prototype.pointerUp.call(this,R)},I.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)},I.prototype.select=function(){this.state==="creating"&&this.finishCreation(),J.prototype.select.call(this)},I.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),J.prototype.deselect.call(this)},I.prototype.finishCreation=function(){for(var R=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),K=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=K[0],Y=K[1],Ee=K[2],Ye=K[3],lt=!1,vt=0;vt<this.canvasElement.height;vt++)for(var We=0;We<this.canvasElement.width;We++)R.data[vt*this.canvasElement.width*4+4*We+3]>0&&(lt=!0,vt<Y&&(Y=vt),We<ee&&(ee=We),vt>Ye&&(Ye=vt),We>Ee&&(Ee=We));if(lt){this.left=ee/this.pixelRatio,this.top=Y/this.pixelRatio,this.width=(Ee-ee)/this.pixelRatio,this.height=(Ye-Y)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=Ee-ee,_t.height=Ye-Y,_t.getContext("2d").putImageData(this.canvasContext.getImageData(ee,Y,Ee-ee,Ye-Y),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},I.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},I.prototype.setColor=function(R){this.color=R,this.colorChanged(R)},I.prototype.setLineWidth=function(R){this.lineWidth=R},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({drawingImgUrl:this.drawingImgUrl},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){this.createVisual(),J.prototype.restoreState.call(this,R),this.drawingImgUrl=R.drawingImgUrl,this.setDrawingImage()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.setDrawingImage()},I.typeName="FreehandMarker",I.title="Freehand marker",I.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>',I}(mt),ce=function(J){function I(R,K,ee){var Y=J.call(this,R,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Y.typeBoxes=[],Y.currentType=K,Y.setCurrentType=Y.setCurrentType.bind(Y),Y}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2";for(var ee=function(Ye){var lt="both";switch(Ye){case 0:lt="both";break;case 1:lt="start";break;case 2:lt="end";break;case 3:lt="none"}var vt=document.createElement("div");if(vt.style.display="flex",vt.style.flexGrow="2",vt.style.alignItems="center",vt.style.justifyContent="space-between",vt.style.padding="5px",vt.style.borderWidth="2px",vt.style.borderStyle="solid",vt.style.borderColor=lt===Y.currentType?Y.uiStyleSettings.toolboxAccentColor:"transparent",vt.addEventListener("click",function(){R.setCurrentType(lt,vt)}),K.appendChild(vt),lt==="both"||lt==="start"){var We=document.createElement("div");We.style.display="flex",We.style.alignItems="center",We.style.minHeight="20px",We.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="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,We.style.marginLeft="5px",vt.appendChild(We)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var Lt=document.createElement("hr");if(Lt.style.minWidth="20px",Lt.style.border="0px",Lt.style.borderTop="3px solid "+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee"),Lt.style.flexGrow="2",_t.appendChild(Lt),vt.appendChild(_t),lt==="both"||lt==="end"){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.alignItems="center",Mt.style.minHeight="20px",Mt.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="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Mt.style.marginRight="5px",vt.appendChild(Mt)}Y.typeBoxes.push(vt)},Y=this,Ee=0;Ee<4;Ee++)ee(Ee);return K},I.prototype.setCurrentType=function(R,K){var ee=this;this.currentType=R,this.typeBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},I}(he),pe=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.arrowType="end",Y.arrowBaseHeight=10,Y.arrowBaseWidth=10,Y.getArrowPoints=Y.getArrowPoints.bind(Y),Y.setArrowType=Y.setArrowType.bind(Y),Y.arrowTypePanel=new ce("Arrow type","end"),Y.arrowTypePanel.onArrowTypeChanged=Y.setArrowType,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.arrow1&&R!==this.arrow2)},I.prototype.getArrowPoints=function(R,K){var ee=this.arrowBaseWidth+2*this.strokeWidth,Y=this.arrowBaseHeight+2*this.strokeWidth;return R-ee/2+","+(K+Y/2)+" "+R+","+(K-Y/2)+" "+(R+ee/2)+","+(K+Y/2)},I.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="creating"&&this.createTips()},I.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.arrow1.transform.baseVal.getItem(0);K.setRotate(R,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(K,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(R+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},I.prototype.setArrowType=function(R){this.arrowType=R,this.adjustVisual(),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({arrowType:this.arrowType},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.arrowType=K.arrowType,this.createTips(),this.adjustVisual()},I.typeName="ArrowMarker",I.title="Arrow marker",I.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',I}(Je),ie=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.fillColor=ee.defaultFillColor,Y.strokeWidth=0,Y.fillPanel=new Se("Color",ee.defaultColorSet,ee.defaultFillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y}return ve(I,J),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.typeName="CoverMarker",I.title="Cover marker",I.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',I}(gt),ae=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<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 Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=K,Ee.currentOpacity=ee,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",K.style.justifyContent="space-between",this.opacities.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="center",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=ee===R.currentOpacity?R.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){R.setCurrentOpacity(ee,Y)}),K.appendChild(Y);var Ee=document.createElement("div");Ee.innerText=100*ee+"%",Y.appendChild(Ee),R.opacityBoxes.push(Y)}),K},I.prototype.setCurrentOpacity=function(R,K){var ee=this;this.currentOpacity=R,this.opacityBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},I}(he),de=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.setOpacity=Y.setOpacity.bind(Y),Y.fillColor=ee.defaultHighlightColor,Y.strokeWidth=0,Y.opacity=ee.defaultHighlightOpacity,Y.fillPanel=new Se("Color",ee.defaultColorSet,Y.fillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y.opacityPanel=new ae("Opacity",ee.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return ve(I,J),I.prototype.setOpacity=function(R){this.opacity=R,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.typeName="HighlightMarker",I.title="Highlight marker",I.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>',I}(ie),ge='<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>',Te=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.bgColor="transparent",Y.tipPosition={x:0,y:0},Y.tipBase1Position={x:0,y:0},Y.tipBase2Position={x:0,y:0},Y.tipMoving=!1,Y.color=ee.defaultStrokeColor,Y.bgColor=ee.defaultFillColor,Y.fontFamily=ee.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setBgColor=Y.setBgColor.bind(Y),Y.getTipPoints=Y.getTipPoints.bind(Y),Y.positionTip=Y.positionTip.bind(Y),Y.setTipPoints=Y.setTipPoints.bind(Y),Y.colorPanel=new Se("Text color",ee.defaultColorSet,Y.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>'),Y.colorPanel.onColorChanged=Y.setColor,Y.bgColorPanel=new Se("Fill color",ee.defaultColorSet,Y.bgColor,ge),Y.bgColorPanel.onColorChanged=Y.setBgColor,Y.fontFamilyPanel=new ke("Font",ee.defaultFontFamilies,ee.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y.tipGrip=new qe,Y.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),Y.controlBox.appendChild(Y.tipGrip.visual),Y}return ve(I,J),I.prototype.ownsTarget=function(R){return J.prototype.ownsTarget.call(this,R)||this.tipGrip.ownsTarget(R)||this.tip===R},I.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},I.prototype.pointerDown=function(R,K){this.state==="new"&&J.prototype.pointerDown.call(this,R,K),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(K)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):J.prototype.pointerDown.call(this,R,K)},I.prototype.pointerUp=function(R){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,J.prototype.pointerUp.call(this,R);else{var K=this.state==="creating";J.prototype.pointerUp.call(this,R),this.setTipPoints(K),this.positionTip()}},I.prototype.manipulate=function(R){if(this.tipMoving){var K=this.unrotatePoint(R);this.tipPosition={x:K.x-this.manipulationStartLeft,y:K.y-this.manipulationStartTop},this.positionTip()}else J.prototype.manipulate.call(this,R)},I.prototype.setBgColor=function(R){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",R]]),ue.setAttributes(this.tip,[["fill",R]])),this.bgColor=R,this.fillColorChanged(R)},I.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},I.prototype.setTipPoints=function(R){R===void 0&&(R=!1);var K=Math.min(this.height/2,15),ee=this.height/5;R&&(this.tipPosition={x:K+ee/2,y:this.height+20});var Y=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:0},this.tipBase2Position={x:K+ee,y:0}):(this.tipBase1Position={x:0,y:K},this.tipBase2Position={x:0,y:K+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-ee,y:0},this.tipBase2Position={x:this.width-K,y:0}):(this.tipBase1Position={x:this.width,y:K},this.tipBase2Position={x:this.width,y:K+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Y<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-ee,y:this.height},this.tipBase2Position={x:this.width-K,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-K-ee},this.tipBase2Position={x:this.width,y:this.height-K}):Y<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:this.height},this.tipBase2Position={x:K+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-K},this.tipBase2Position={x:0,y:this.height-K-ee})},I.prototype.resize=function(R){J.prototype.resize.call(this,R),this.positionTip()},I.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var R=this.tipGrip.visual.transform.baseVal.getItem(0);R.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(R,0)},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),I.prototype.select=function(){this.positionTip(),J.prototype.select.call(this)},I.prototype.getState=function(){var R=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){var K=R;this.bgColor=K.bgColor,this.tipPosition=K.tipPosition,J.prototype.restoreState.call(this,R),this.createTip(),this.setTipPoints()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.tipPosition={x:this.tipPosition.x*R,y:this.tipPosition.y*K},this.positionTip()},I.typeName="CalloutMarker",I.title="Callout marker",I.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>',I}(Ke),De=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.fillColor=ee.defaultFillColor,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.setOpacity=Y.setOpacity.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y.strokePanel=new Se("Line color",fe(ee.defaultColorSet,["transparent"]),ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.fillPanel=new Se("Fill color",fe(ee.defaultColorSet,["transparent"]),Y.fillColor,ge),Y.fillPanel.onColorChanged=Y.setFillColor,Y.strokeWidthPanel=new St("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new Et("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y.opacityPanel=new ae("Opacity",ee.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual)},I.prototype.createVisual=function(){this.visual=ue.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},I.prototype.manipulate=function(R){J.prototype.manipulate.call(this,R)},I.prototype.resize=function(R){J.prototype.resize.call(this,R),this.setSize()},I.prototype.setSize=function(){J.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},I.prototype.pointerUp=function(R){J.prototype.pointerUp.call(this,R),this.setSize()},I.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},I.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(R),this.stateChanged()},I.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},I.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},I.prototype.setOpacity=function(R){this.opacity=R,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){var K=R;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),J.prototype.restoreState.call(this,R),this.setSize()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.setSize()},I.typeName="EllipseMarker",I.title="Ellipse marker",I.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>',I}(mt),Ze=function(J){function I(R,K,ee){return J.call(this,R,K,ee)||this}return ve(I,J),Object.defineProperty(I.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.tip1&&R!==this.tip2)},I.prototype.createTips=function(){this.tip1=ue.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip2)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="creating"&&this.createTips()},I.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.tip1.transform.baseVal.getItem(0);K.setRotate(R,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(K,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(R+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R),this.createTips(),this.adjustVisual()},I.typeName="MeasurementMarker",I.title="Measurement marker",I.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>',I}(Je),pt=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.strokePanel.colors=ee.defaultColorSet,Y.fillColor="transparent",Y}return ve(I,J),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.typeName="EllipseFrameMarker",I.title="Ellipse frame marker",I.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>',I}(De),Ot=function(){function J(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),J.prototype.addUndoStep=function(I){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(I)||(this.undoStack.push(I),JSON.stringify(this.lastRedoStep)!==JSON.stringify(I)&&this.redoStack.splice(0,this.redoStack.length))},J.prototype.replaceLastUndoStep=function(I){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=I)},J.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},J.prototype.undo=function(){if(this.undoStack.length>1){var I=this.undoStack.pop();return I!==void 0&&this.redoStack.push(I),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},J.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},J}(),yt=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.curveX=0,Y.curveY=0,Y.manipulationStartCurveX=0,Y.manipulationStartCurveY=0,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.positionGrips=Y.positionGrips.bind(Y),Y.addControlGrips=Y.addControlGrips.bind(Y),Y.adjustVisual=Y.adjustVisual.bind(Y),Y.setupControlBox=Y.setupControlBox.bind(Y),Y.resize=Y.resize.bind(Y),Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Se("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new St("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new Et("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorCurve&&R!==this.visibleCurve&&!this.curveGrip.ownsTarget(R))},I.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},I.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=R.x,this.curveY=R.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(K)&&(this.activeGrip=this.curveGrip,this._state="resize")},I.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},I.prototype.setupControlBox=function(){J.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},I.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,J.prototype.addControlGrips.call(this)},I.prototype.positionGrips=function(){J.prototype.positionGrips.call(this);var R=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-R/2,this.curveY-R/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()))},I.prototype.manipulate=function(R){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+R.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+R.y-this.manipulationStartY),J.prototype.manipulate.call(this,R)},I.prototype.resize=function(R){this.activeGrip===this.curveGrip&&(this.curveX=R.x,this.curveY=R.y),J.prototype.resize.call(this,R),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},I.prototype.setStrokeColor=function(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},I.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},I.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.adjustVisual()},I.prototype.scale=function(R,K){this.curveX=this.curveX*R,this.curveY=this.curveY*K,J.prototype.scale.call(this,R,K)},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.curveX=K.curveX,this.curveY=K.curveY,this.createVisual(),this.adjustVisual()},I.typeName="CurveMarker",I.title="Curve marker",I.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>',I}(Xe),ot=function(){function J(I,R){R===void 0&&(R=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=I,this.cancelable=R}return Object.defineProperty(J.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),J.prototype.preventDefault=function(){this._defaultPrevented=!0},J}(),He=function(J){function I(R,K,ee){var Y=J.call(this,R,!1)||this;return Y.dataUrl=K,Y.state=ee,Y}return ve(I,J),I}(ot),Ge=function(J){function I(R,K,ee){ee===void 0&&(ee=!1);var Y=J.call(this,R,ee)||this;return Y.marker=K,Y}return ve(I,J),I}(ot),Ue=function(){function J(){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 J.prototype.addEventListener=function(I,R){this[I].push(R)},J.prototype.removeEventListener=function(I,R){var K=this[I].indexOf(R);K>-1&&this[I].splice(K,1)},J}(),le=function(){function J(I){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ce,this._isOpen=!1,this.undoRedoManager=new Ot,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 Ue,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=J.instanceCounter++,this.styles=new tt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=I,this.targetRoot=document.body,this.width=I.clientWidth,this.height=I.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(J.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ae,ye,pe,Ke,pt,De,de,Te,Ze,ie,Je,yt]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ae,ye,pe,Ke,De,de,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ae,ye,pe,Ke,de]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(I){var R=this;this._availableMarkerTypes.splice(0),I.forEach(function(K){if(typeof K=="string"){var ee=R.ALL_MARKER_TYPES.find(function(Y){return Y.typeName===K});ee!==void 0&&R._availableMarkerTypes.push(ee)}else R._availableMarkerTypes.push(K)})},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(I){this._zoomLevel=I,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(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Pe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},J.prototype.show=function(){var I=this;this.styles.styleSheetRoot===void 0&&rt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=rt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(R){return R(new ot(I))})},J.prototype.render=function(){return Oe(this,void 0,void 0,function(){var I;return Re(this,function(R){switch(R.label){case 0:return this.setCurrentMarker(),(I=new et).naturalSize=this.renderAtNaturalSize,I.imageType=this.renderImageType,I.imageQuality=this.renderImageQuality,I.markersOnly=this.renderMarkersOnly,I.width=this.renderWidth,I.height=this.renderHeight,[4,I.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return R.sent(),[4,I.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,R.sent()]}})})},J.prototype.close=function(I){var R=this;if(I===void 0&&(I=!1),this.isOpen){var K=!1;I||this.eventListeners.beforeclose.forEach(function(ee){var Y=new ot(R,!0);ee(Y),Y.defaultPrevented&&(K=!0)}),K||(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(ee){return ee(new ot(R))}),this.detachEvents(),this._isOpen=!1)}},J.prototype.addMarkersToToolbar=function(){for(var I,R=[],K=0;K<arguments.length;K++)R[K]=arguments[K];(I=this._availableMarkerTypes).push.apply(I,R)},J.prototype.addRenderEventListener=function(I){this.addEventListener("render",function(R){I(R.dataUrl,R.state)})},J.prototype.removeRenderEventListener=function(I){},J.prototype.addCloseEventListener=function(I){this.addEventListener("close",function(){I()})},J.prototype.removeCloseEventListener=function(I){},J.prototype.setupResizeObserver=function(){var I=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){I.resize(I.target.clientWidth,I.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return I.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},J.prototype.onPopupTargetResize=function(){var I=1*this.target.clientWidth/this.target.clientHeight,R=this.editorCanvas.clientWidth/I>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*I:this.editorCanvas.clientWidth,K=R<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/I;this.resize(R,K)},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.prototype.resize=function(I,R){this._isResizing=!0;var K=I/this.imageWidth,ee=R/this.imageHeight;this.imageWidth=Math.round(I),this.imageHeight=Math.round(R),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(K,ee),this._isResizing=!1},J.prototype.scaleMarkers=function(I,R){var K,ee=this;this._currentMarker&&this._currentMarker instanceof Ke?this._currentMarker.scale(I,R):(K=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Y){Y!==ee._currentMarker&&Y.scale(I,R)}),K!==void 0&&this.setCurrentMarker(K)},J.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"},J.prototype.setTopLeft=function(){var I=this.editingTarget.getBoundingClientRect(),R=this.editorCanvas.getBoundingClientRect();this.left=I.left-R.left,this.top=I.top-R.top},J.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)},J.prototype.addDefs=function(){for(var I,R=[],K=0;K<arguments.length;K++)R[K]=arguments[K];this.defs=ue.createDefs(),this.addDefsToImage(),(I=this.defs).append.apply(I,R)},J.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},J.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)},J.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},J.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},J.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)},J.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},J.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)},J.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 I=document.createElement("a");I.href="https://markerjs.com/",I.target="_blank",I.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>',I.title="Powered by marker.js",I.style.display="grid",I.style.alignItems="center",I.style.justifyItems="center",I.style.padding="3px",I.style.width="20px",I.style.height="20px",this.logoUI.appendChild(I),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},J.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")},J.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"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.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 I=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=I+"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 Qe(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 at(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},J.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.removeMarker=function(I){this.markerImage.removeChild(I.container),this.markers.indexOf(I)>-1&&this.markers.splice(this.markers.indexOf(I),1),I.dispose()},J.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())},J.prototype.toolbarButtonClicked=function(I,R){if(I==="marker"&&R!==void 0)this.createNewMarker(R);else if(I==="action")switch(R){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()}},J.prototype.deleteSelectedMarker=function(){var I=this;if(this._currentMarker!==void 0){var R=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var Y=new Ge(I,I._currentMarker,!0);ee(Y),Y.defaultPrevented&&(R=!0)}),!R){var K=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(ee){return ee(new Ge(I,K))})}}},J.prototype.clear=function(){var I=this,R=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var Ye=new Ge(I,void 0,!0);Ee(Ye),Ye.defaultPrevented&&(R=!0)}),!R)){this.setCurrentMarker();for(var K=function(Ee){var Ye=ee.markers[Ee];ee.setCurrentMarker(ee.markers[Ee]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(lt){return lt(new Ge(I,Ye))})},ee=this,Y=this.markers.length-1;Y>=0;Y--)K(Y);this.addUndoStep()}},Object.defineProperty(J.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),J.prototype.showNotesEditor=function(){var I;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=(I=this._currentMarker.notes)!==null&&I!==void 0?I:"",this.overlayContainer.appendChild(this.notesArea))},J.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)},J.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},J.prototype.addUndoStep=function(){var I=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var R=this.getState(),K=this.undoRedoManager.getLastUndoStep();if(!K||K.width===R.width&&K.height===R.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(R),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Y){return Y(new ot(I))})}else this.undoRedoManager.replaceLastUndoStep(R),this.eventListeners.statechange.forEach(function(Y){return Y(new ot(I))})}},J.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},J.prototype.undoStep=function(){var I=this,R=this.undoRedoManager.undo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new ot(I))}))},J.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},J.prototype.redoStep=function(){var I=this,R=this.undoRedoManager.redo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new ot(I))}))},J.prototype.stepZoom=function(){var I=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=I<this.zoomSteps.length-1?this.zoomSteps[I+1]:this.zoomSteps[0]},J.prototype.panTo=function(I){this.contentDiv.scrollBy({left:this.prevPanPoint.x-I.x,top:this.prevPanPoint.y-I.y}),this.prevPanPoint=I},J.prototype.startRenderAndClose=function(){return Oe(this,void 0,void 0,function(){var I,R,K=this;return Re(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return I=ee.sent(),R=this.getState(),this.eventListeners.render.forEach(function(Y){return Y(new He(K,I,R))}),this.close(!0),[2]}})})},J.prototype.getState=function(I){I===!0&&this.setCurrentMarker();var R={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(K){return R.markers.push(K.getState())}),R},J.prototype.restoreState=function(I){var R=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);I.markers.forEach(function(K){var ee=R._availableMarkerTypes.find(function(Ee){return Ee.typeName===K.typeName});if(ee!==void 0){var Y=R.addNewMarker(ee);Y.restoreState(K),R.markers.push(Y)}}),I.width&&I.height&&(I.width!==this.imageWidth||I.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/I.width,this.imageHeight/I.height),this.eventListeners.restorestate.forEach(function(K){return K(new ot(R))})},J.prototype.addNewMarker=function(I){var R=ue.createGroup();return this.markerImage.appendChild(R),new I(R,this.overlayContainer,this.settings)},J.prototype.createNewMarker=function(I){var R,K=this;(R=typeof I=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===I}):I)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(R),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(R.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new Ge(K,K._currentMarker))}))},J.prototype.markerCreated=function(I){var R=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(I),this.setCurrentMarker(I),I instanceof ye&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ye):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(K){return K(new Ge(R,R._currentMarker))})},J.prototype.colorChanged=function(I){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=I,this.settings.defaultStrokeColor=I)},J.prototype.fillColorChanged=function(I){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=I)},J.prototype.markerStateChanged=function(I){var R=this;this.eventListeners.markerchange.forEach(function(K){return K(new Ge(R,I))})},J.prototype.setCurrentMarker=function(I){var R=this;this._currentMarker!==I&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(K){return K(new Ge(R,R._currentMarker))})),this._currentMarker=I,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(K){return K(new Ge(R,R._currentMarker))}))},J.prototype.onPointerDown=function(I){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||I.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var R=this.markers.find(function(K){return K.ownsTarget(I.target)});R!==void 0?(this.setCurrentMarker(R),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(I.clientX,I.clientY),I.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:I.clientX,y:I.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(I.clientX,I.clientY))},J.prototype.onDblClick=function(I){if(this._isFocused||this.focus(),this.mode==="select"){var R=this.markers.find(function(K){return K.ownsTarget(I.target)});R!==void 0&&R!==this._currentMarker&&this.setCurrentMarker(R),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(I.clientX,I.clientY),I.target):this.setCurrentMarker()}},J.prototype.onPointerMove=function(I){this.touchPoints!==1&&I.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||I.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(I.clientX,I.clientY)):this.zoomLevel>1&&this.panTo({x:I.clientX,y:I.clientY}))},J.prototype.onPointerUp=function(I){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(I.clientX,I.clientY)),this.isDragging=!1,this.addUndoStep()},J.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},J.prototype.onKeyUp=function(I){this._currentMarker===void 0||this.notesArea!==void 0||I.key!=="Delete"&&I.key!=="Backspace"||this.deleteSelectedMarker()},J.prototype.clientToLocalCoordinates=function(I,R){var K=this.markerImage.getBoundingClientRect();return{x:(I-K.left)/this.zoomLevel,y:(R-K.top)/this.zoomLevel}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var I=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=I+"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()},J.prototype.addLicenseKey=function(I){Pe.addKey(I)},J.prototype.addEventListener=function(I,R){this.eventListeners.addEventListener(I,R)},J.prototype.removeEventListener=function(I,R){this.eventListeners.removeEventListener(I,R)},J.prototype.renderState=function(I){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(I),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(J.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),J.prototype.focus=function(){var I=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(R){return R(new ot(I))}))},J.prototype.blur=function(){var I=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(R){return R(new ot(I))}))},J.instanceCounter=0,J}();/* **********************************
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 _e=function(J,I){return(_e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,K){R.__proto__=K}||function(R,K){for(var ee in K)Object.prototype.hasOwnProperty.call(K,ee)&&(R[ee]=K[ee])})(J,I)};function Ve(J,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function R(){this.constructor=J}_e(J,I),J.prototype=I===null?Object.create(I):(R.prototype=I.prototype,new R)}function je(J,I,R,K){return new(R||(R=Promise))(function(ee,Y){function Ee(vt){try{lt(K.next(vt))}catch(We){Y(We)}}function Ye(vt){try{lt(K.throw(vt))}catch(We){Y(We)}}function lt(vt){var We;vt.done?ee(vt.value):(We=vt.value,We instanceof R?We:new R(function(_t){_t(We)})).then(Ee,Ye)}lt((K=K.apply(J,I||[])).next())})}function ht(J,I){var R,K,ee,Y,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return Y={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function Ye(lt){return function(vt){return function(We){if(R)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(R=1,K&&(ee=2&We[0]?K.return:We[0]?K.throw||((ee=K.return)&&ee.call(K),0):K.next)&&!(ee=ee.call(K,We[1])).done)return ee;switch(K=0,ee&&(We=[2&We[0],ee.value]),We[0]){case 0:case 1:ee=We;break;case 4:return Ee.label++,{value:We[1],done:!1};case 5:Ee.label++,K=We[1],We=[0];continue;case 7:We=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||We[0]!==6&&We[0]!==2)){Ee=0;continue}if(We[0]===3&&(!ee||We[1]>ee[0]&&We[1]<ee[3])){Ee.label=We[1];break}if(We[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=We;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(We);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}We=I.call(J,Ee)}catch(_t){We=[6,_t],K=0}finally{R=ee=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([lt,vt])}}}var ft=function(){function J(){}return J.addKey=function(I){J.key=I},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),Ie=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(I,R){for(var K=0,ee=R;K<ee.length;K++){var Y=ee[K],Ee=Y[0],Ye=Y[1];I.setAttribute(Ee,Ye)}},J.createRect=function(I,R,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",I.toString()),ee.setAttribute("height",R.toString()),K&&J.setAttributes(ee,K),ee},J.createLine=function(I,R,K,ee,Y){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",I.toString()),Ee.setAttribute("y1",R.toString()),Ee.setAttribute("x2",K.toString()),Ee.setAttribute("y2",ee.toString()),Y&&J.setAttributes(Ee,Y),Ee},J.createPolygon=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",I),R&&J.setAttributes(K,R),K},J.createCircle=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(I/2).toString()),K.setAttribute("cy",(I/2).toString()),K.setAttribute("r",I.toString()),R&&J.setAttributes(K,R),K},J.createEllipse=function(I,R,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(I/2).toString()),ee.setAttribute("cy",(R/2).toString()),ee.setAttribute("rx",(I/2).toString()),ee.setAttribute("ry",(R/2).toString()),K&&J.setAttributes(ee,K),ee},J.createGroup=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","g");return I&&J.setAttributes(R,I),R},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(I,R,K,ee,Y,Ee,Ye){var lt=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(lt,[["id",I],["orient",R],["markerWidth",K.toString()],["markerHeight",ee.toString()],["refX",Y.toString()],["refY",Ee.toString()]]),lt.appendChild(Ye),lt},J.createText=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","text");return R.setAttribute("x","0"),R.setAttribute("y","0"),I&&J.setAttributes(R,I),R},J.createTSpan=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=I,R&&J.setAttributes(K,R),K},J.createImage=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","image");return I&&J.setAttributes(R,I),R},J.createPoint=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=I,K.y=R,K},J.createPath=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",I),R&&J.setAttributes(K,R),K},J.createElement=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg",I);return R&&J.setAttributes(K,R),K},J.getHollowRectanglePath=function(I,R,K,ee,Y,Ee,Ye,lt){return"M"+I+","+R+"V"+(R+ee)+"H"+(I+K)+"V"+R+"H"+Y+"V"+Ee+"H"+(Y+Ye)+"V"+(Ee+lt)+"H"+Y+"V"+R+"Z"},J}(),$e=function(){function J(I){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+I+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.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(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(I){return this.styleSheet===void 0&&this.addStyleSheet(),I.name=""+this.classNamePrefix+I.localName,this.classes.push(I),this.styleSheet.sheet.insertRule("."+I.name+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length),I},J.prototype.addRule=function(I){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(I),this.styleSheet.sheet.insertRule(I.selector+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var I;this.styleSheet=document.createElement("style"),((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).appendChild(this.styleSheet),this.addRule(new xt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new xt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new xt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ft("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ft("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},J.prototype.removeStyleSheet=function(){var I;this.styleSheet&&(((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),xt=function(J,I){this.selector=J,this.style=I},Ft=function(J,I){this.localName=J,this.style=I},ct=function(){function J(){this.blocks=[],this.display=""}return J.prototype.addButtonBlock=function(I){I.className=this.blockClassName,I.buttonClassName=this.buttonClassName,I.buttonColorsClassName=this.buttonColorsClassName,I.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(I)},J.prototype.addElementBlock=function(I){I.className===void 0&&(I.className=this.blockClassName),this.blocks.push(I)},J.prototype.getUI=function(){var I=document.createElement("div");return I.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,I.style.display=this.display,this.blocks.forEach(function(R){return I.appendChild(R.getUI())}),I},J}(),Ut=function(){function J(){}return J.prototype.getUI=function(){var I=document.createElement("div");if(I.className=this.className,this.minWidth!==void 0&&(I.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":I.style.justifyContent="flex-start";break;case"center":I.style.justifyContent="center";break;case"end":I.style.justifyContent="flex-end"}return I.style.whiteSpace="nowrap",I},J}(),$t=function(J){function I(){var R=J!==null&&J.apply(this,arguments)||this;return R.buttons=[],R}return Ve(I,J),I.prototype.addButton=function(R){R.className=this.buttonClassName,R.colorsClassName=this.buttonColorsClassName,R.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(R)},I.prototype.getUI=function(){var R=J.prototype.getUI.call(this);return this.buttons.forEach(function(K){return R.appendChild(K.getUI())}),R},I}(Ut),Vt=function(){function J(I,R){this._isActive=!1,this._isHidden=!1,this._icon=I,this.title=R,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(J.prototype,"icon",{get:function(){return this._icon},set:function(I){this._icon=I,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isActive",{get:function(){return this._isActive},set:function(I){this._isActive=I,this.adjustClassName()},enumerable:!1,configurable:!0}),J.prototype.getUI=function(){var I=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 I.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},J.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,"")))},J.prototype.hide=function(){this._isHidden=!0},J}(),At=function(J){function I(){var R=J!==null&&J.apply(this,arguments)||this;return R.elements=[],R}return Ve(I,J),I.prototype.addElement=function(R){this.elements.push(R)},I.prototype.getUI=function(){var R=J.prototype.getUI.call(this);return this.elements.forEach(function(K){return R.appendChild(K)}),R},I}(Ut),Tn=function(){function J(I,R){this.horizontal=I,this.vertical=R}return Object.defineProperty(J.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),J.prototype.getVerticalLength=function(I){return I/this.ratio},J.prototype.getHorizontalLength=function(I){return I*this.ratio},J}(),Fn=function(){function J(){}return J.getIcon=function(I,R){if(I>0&&R>0){var K=new Tn(I,R),ee=K.ratio>=1?20:K.getHorizontalLength(20),Y=K.ratio<1?20:K.getVerticalLength(20),Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ee);var Ye=Ie.createDefs();Ee.appendChild(Ye);var lt=Ie.createElement("clipPath",[["id","text-bg-clip"]]);Ye.appendChild(lt);var vt=Ie.createPath(Ie.getHollowRectanglePath((24-ee)/2,(24-Y)/2,ee,Y,(24-ee)/2+2,(24-Y)/2+2,ee-4,Y-4));Ee.appendChild(vt);var We=Ie.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);We.appendChild(Ie.createTSpan(I+":"+R)),Ee.appendChild(We);var _t=We.getBBox();Ie.setAttributes(We,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var Lt=Ie.createPath(Ie.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return lt.appendChild(Lt),Ie.setAttributes(vt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ee),Ee.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>'},J}(),Sn=function(J){function I(R,K,ee){var Y=J.call(this,R,K)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=ee,Y}return Ve(I,J),I.prototype.setupDropdown=function(){var R=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(K){K.className=R.className,K.colorsClassName=R.colorsClassName,R.dropdownBlock.appendChild(K.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},I.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},I.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},I.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},I.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},I.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},I}(Vt),Wt=function(){function J(I,R){this.GRIP_SIZE=10,this.color=I,this.fillColor=R,this.visual=Ie.createGroup(),this.visual.appendChild(Ie.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ie.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(I){return I===this.visual||I===this.visual.childNodes[0]||I===this.visual.childNodes[1]},J.prototype.setCenter=function(I,R){this.visual.childNodes.forEach(function(K){return Ie.setAttributes(K,[["cx",I.toString()],["cy",R.toString()]])})},J}(),hn=function(){function J(I,R,K,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=I,this.canvasHeight=R,this.margin=K,this.container=ee,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(J.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(I){this._aspectRatio=I,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(I){this._isGridVisible=I,this.gridContainer&&Ie.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(I){this._zoomFactor=I,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),J.prototype.open=function(){var I=this;this.cropShadeElement=Ie.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ie.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var R=0;R<this.numberOfGridLines;R++)this.horizontalGridLines.push(Ie.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ie.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(K){return I.gridContainer.appendChild(K)}),this.verticalGridLines.forEach(function(K){return I.gridContainer.appendChild(K)}),this.cropRectElement=Ie.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Wt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Wt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Wt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Wt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},J.prototype.setCropRectangle=function(I){this.cropRect=I;var R=Object.assign({},this.cropRect);this.zoomFactor!==1&&(R.width=this.cropRect.width*this.zoomFactor,R.height=this.cropRect.height*this.zoomFactor,R.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-R.width/2,R.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-R.height/2),Ie.setAttributes(this.cropRectElement,[["x",R.x.toString()],["y",R.y.toString()],["width",R.width.toString()],["height",R.height.toString()]]);var K=R.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,Ee){var Ye=R.y+K*(Ee+1);Ie.setAttributes(Y,[["x1",""+R.x],["y1",""+Ye],["x2",""+(R.x+R.width)],["y2",""+Ye]])});var ee=R.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,Ee){var Ye=R.x+ee*(Ee+1);Ie.setAttributes(Y,[["x1",""+Ye],["y1",""+R.y],["x2",""+Ye],["y2",""+(R.y+R.height)]])}),Ie.setAttributes(this.cropShadeElement,[["d",Ie.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,R.x,R.y,R.width,R.height)]]),this.topLeftGrip.setCenter(R.x,R.y),this.topRightGrip.setCenter(R.x+R.width,R.y),this.bottomLeftGrip.setCenter(R.x,R.y+R.height),this.bottomRightGrip.setCenter(R.x+R.width,R.y+R.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},J.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)},J.prototype.clientToLocalCoordinates=function(I,R){var K=this.container.getBoundingClientRect();return{x:I-K.left+this.margin,y:R-K.top+this.margin}},J.prototype.onPointerDown=function(I){this.container.setPointerCapture(I.pointerId),this.previousPoint=this.clientToLocalCoordinates(I.clientX,I.clientY),this.cropRectElement===I.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(I.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(I.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(I.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(I.target)&&(this.activeGrip=this.bottomRightGrip)},J.prototype.onPointerMove=function(I){if(this.isMoving)this.move(this.clientToLocalCoordinates(I.clientX,I.clientY));else if(this.activeGrip){var R=this.clientToLocalCoordinates(I.clientX,I.clientY);this.resize(R)}I.preventDefault()},J.prototype.onPointerUp=function(I){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(I.pointerId)},J.prototype.move=function(I){var R=I.x-this.previousPoint.x,K=I.y-this.previousPoint.y;this.zoomFactor!==1&&(R=-R/this.zoomFactor,K=-K/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+R),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+K),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=I},J.prototype.resize=function(I){var R=Object.assign({},this.cropRect),K=I.x-this.previousPoint.x,ee=I.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:R.x+K<this.margin&&(K=this.margin-R.x),R.x+=K,R.width=this.cropRect.x+this.cropRect.width-R.x;break;case this.bottomRightGrip:case this.topRightGrip:R.width+K>this.canvasWidth*this.zoomFactor&&(K=this.canvasWidth*this.zoomFactor-R.width),R.width+=K}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(R.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(K),R.height=this.aspectRatio.getVerticalLength(R.width)):(R.y+=ee,R.height=this.cropRect.y+this.cropRect.height-R.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?R.height=this.aspectRatio.getVerticalLength(R.width):R.height+=ee}R.width<10&&(R.x=this.cropRect.x,R.width=10),R.height<10&&(R.y=this.cropRect.y,R.height=10),this.previousPoint=I,R.x>=this.margin&&R.y>=this.margin&&R.x-this.margin+R.width<=this.canvasWidth&&R.y-this.margin+R.height<=this.canvasHeight&&(this.cropRect=R,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},J.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var I=this.cropRect.x+this.cropRect.width/2,R=this.cropRect.y+this.cropRect.height/2,K=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);K/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=K:this.cropRect.height=ee,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=I-this.cropRect.width/2,this.cropRect.y=R-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)}},J.prototype.getRescaledRect=function(I,R,K,ee,Y,Ee){var Ye=K/I,lt=ee/R;return{x:(Y.x-Ee)*Ye+Ee,y:(Y.y-Ee)*lt+Ee,width:Y.width*Ye,height:Y.height*lt}},J.prototype.scaleCanvas=function(I,R){var K=this.getRescaledRect(this.canvasWidth,this.canvasHeight,I,R,this.cropRect,this.margin);this.canvasWidth=I,this.canvasHeight=R,this.onCropChange&&this.onCropChange(K),this.setCropRectangle(K)},J}(),Mn=function(){function J(I){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=I,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(J.prototype,"angle",{get:function(){return this._angle},set:function(I){this._angle=I,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),J.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},J.prototype.onPointerDown=function(I){this.controlContainer.setPointerCapture(I.pointerId),this.isDragging=!0,this.previousPoint={x:I.clientX,y:I.clientY}},J.prototype.onPointerMove=function(I){this.isDragging&&(this.onAngleChange&&this.onAngleChange((I.clientX-this.previousPoint.x)/5),this.previousPoint.x=I.clientX)},J.prototype.onPointerUp=function(I){this.isDragging&&this.onAngleChange&&this.onAngleChange((I.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(I.pointerId)},J.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var I=this.angleLabelText.getBBox();Ie.setAttributes(this.angleLabelElement,[["x",((this.width-I.width)/2).toString()],["y",(this.height/2).toString()]])}},J.prototype.positionScaleShape=function(){if(this.scaleShape){var I=this.scaleShape.transform.baseVal.getItem(0);I.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(I,0)}},J.prototype.getVisual=function(){var I=document.createElementNS("http://www.w3.org/2000/svg","svg");I.setAttribute("xmlns","http://www.w3.org/2000/svg"),I.setAttribute("width",this.width+"px"),I.setAttribute("height",this.height+"px"),I.setAttribute("viewBox","0 0 "+this.width+" "+this.height),I.style.flexShrink="0",document.body.appendChild(I);for(var R="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,K=1;K<=this.width/5+10;K++){var ee=K%5==0?this.height/3:this.height/6;R+="h4v"+-ee+"h1v"+ee}R+="v1H0Z",this.scaleShape=Ie.createPath(R);var Y=Ie.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),I.appendChild(this.scaleShape),this.angleLabelElement=Ie.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ie.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ee=Ie.createTSpan("");return Ee.innerHTML="&deg;",this.angleLabelElement.appendChild(Ee),I.appendChild(this.angleLabelElement),document.body.removeChild(I),I},J}(),Bn=function(){function J(){this.naturalSize=!1,this.imageType="image/png"}return J.prototype.rasterize=function(I,R,K,ee,Y,Ee,Ye){var lt=this;return new Promise(function(vt){var We=document.createElement("canvas");We.width=I.width.baseVal.value-2*ee,We.height=I.height.baseVal.value-2*ee;var _t=1,Lt=1;lt.naturalSize===!0?(_t=R.naturalWidth/(I.width.baseVal.value-2*ee)/Ee,Lt=R.naturalHeight/(I.height.baseVal.value-2*ee)/Ye,We.width=R.naturalWidth/Ee,We.height=R.naturalHeight/Ye):lt.width!==void 0&&lt.height!==void 0&&(_t=lt.width/K.width,Lt=lt.height/K.height,We.width*=_t,We.height*=Lt);var Mt=We.getContext("2d");Mt.translate(We.width/2,We.height/2),Mt.rotate(Y*Math.PI/180),Mt.scale(Ee,Ye),Mt.translate(-We.width/2,-We.height/2),Mt.drawImage(R,0,0,We.width,We.height);var en=document.createElement("canvas");en.width=K.width*_t,en.height=K.height*Lt,en.getContext("2d").putImageData(Mt.getImageData((K.x-ee)*_t,(K.y-ee)*Lt,K.width*_t,K.height*Lt),0,0),vt(en.toDataURL(lt.imageType,lt.imageQuality))})},J}(),ut=function(){function J(I){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=J.instanceCounter++,this.styles=new $e(this.instanceNo),this.target=I,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(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(I){this._zoomToCropEnabled=I,I?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(I){this._isGridVisible=I,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"gridLines",{get:function(){return this._gridLines},set:function(I){this._gridLines=I,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(I){this._rotationAngle=I,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"aspectRatio",{get:function(){var I;return(I=this._aspectRatio)!==null&&I!==void 0?I:this.aspectRatios[0]},set:function(I){this._aspectRatio=I},enumerable:!1,configurable:!0}),J.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},J.prototype.show=function(){this.showUI(),this.open()},J.prototype.close=function(I){I===void 0&&(I=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),I||this.closeEventListeners.forEach(function(R){return R()}),this._isOpen=!1)},J.prototype.addRenderEventListener=function(I){this.renderEventListeners.push(I)},J.prototype.removeRenderEventListener=function(I){this.renderEventListeners.indexOf(I)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(I),1)},J.prototype.addCloseEventListener=function(I){this.closeEventListeners.push(I)},J.prototype.removeCloseEventListener=function(I){this.closeEventListeners.indexOf(I)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(I),1)},J.prototype.setupResizeObserver=function(){var I=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){I.resize(I.target.clientWidth,I.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))},J.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var I=1*this.target.clientWidth/this.target.clientHeight,R=this.contentDiv.clientWidth/I>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*I:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,K=R+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/I;this.resize(R,K)}},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.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",Ie.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},J.prototype.resize=function(I,R){this.imageWidth=Math.round(I),this.imageHeight=Math.round(R),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()},J.prototype.setEditingTarget=function(){var I=document.createElement("canvas");I.width=this.target.naturalWidth,I.height=this.target.naturalHeight,I.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var R=I.toDataURL();Ie.setAttributes(this.editingTarget,[["href",R]]),this.setEditingTargetSize()},J.prototype.setTopLeft=function(){var I=this.target.getBoundingClientRect(),R=this.editorCanvas.getBoundingClientRect();this.left=I.left-R.left-this.CANVAS_MARGIN,this.top=I.top-R.top-this.CANVAS_MARGIN},J.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=Ie.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ie.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ie.createGroup(),this.editingTargetRotationScaleContainer=Ie.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var I=Ie.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(I);var R=Ie.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(R),this.editingTargetContainer=Ie.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)},J.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},J.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ie.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new hn(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()},J.prototype.zoomToCrop=function(){if(this.cropRect){var I=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,R=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=I+"px "+R+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-I+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-R+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},J.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)},J.prototype.cropRectChanged=function(I){this.cropRect=I,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},J.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},J.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"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.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 I=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,R=this.target.offsetTop>I+this.CANVAS_MARGIN?this.target.offsetTop-(I+this.CANVAS_MARGIN):0;this.coverDiv.style.top=R+"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},J.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},J.prototype.addTopToolbar=function(){var I=this;this.topToolbar=new ct,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 R=new $t;R.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(R);var K=[];this.aspectRatios.forEach(function(Lt){var Mt=new Vt(Fn.getIcon(Lt.horizontal,Lt.vertical),Lt.horizontal===0&&Lt.vertical===0?"FREE":Lt.horizontal+":"+Lt.vertical);Mt.onClick=function(){return I.ratioButtonClicked(Lt)},K.push(Mt)}),this.aspectRatioButton=new Sn(Fn.getIcon(0,0),"Aspect ratio",K),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,R.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Vt('<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");ee.isActive=this.isGridVisible,ee.onClick=function(){I.isGridVisible=!I.isGridVisible,ee.isActive=I.isGridVisible},R.addButton(ee);var Y=new Vt('<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(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){I.zoomToCropEnabled=!I.zoomToCropEnabled,Y.isActive=I.zoomToCropEnabled},R.addButton(Y),!ft.isLicensed){var Ee=new At;this.topToolbar.addElementBlock(Ee);var Ye=document.createElement("div");Ye.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var lt=document.createElement("a");lt.style.color="currentColor",lt.href="https://markerjs.com/products/cropro",lt.target="_blank",lt.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>',Ye.appendChild(lt),Ee.addElement(Ye)}var vt=new $t;vt.minWidth=3*this.toolbarHeight+"px",vt.contentAlign="end",this.topToolbar.addButtonBlock(vt);var We=new Vt('<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");We.onClick=this.startRenderAndClose,vt.addButton(We),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(We.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Vt('<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");_t.onClick=this.close,vt.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},J.prototype.addBottomToolbar=function(){var I=this;this.bottomToolbar=new ct,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 R=new $t;R.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(R);var K=new Vt('<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");K.onClick=this.rotateLeftButtonClicked,R.addButton(K);var ee=new Vt('<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");ee.onClick=this.rotateRightButtonClicked,R.addButton(ee);var Y=new At;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new Mn("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(vt){I.rotateBy(vt),I.straightener.angle=I.rotationAngle},Y.addElement(this.straightener.getUI());var Ee=new $t;Ee.minWidth=2*this.toolbarHeight+"px",Ee.contentAlign="end",this.bottomToolbar.addButtonBlock(Ee);var Ye=new Vt('<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");Ye.onClick=this.flipHorizontallyButtonClicked,Ee.addButton(Ye);var lt=new Vt('<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");lt.onClick=this.flipVerticallyButtonClicked,Ee.addButton(lt)},J.prototype.ratioButtonClicked=function(I){this.aspectRatio=I,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},J.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Fn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},J.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Tn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},J.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},J.prototype.restoreState=function(I){if(I){var R=this.cropLayer.getRescaledRect(I.width,I.height,this.imageWidth,this.imageHeight,I.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(R),this.cropRectChanged(R),this.flippedHorizontally=I.flippedHorizontally,this.flippedVertically=I.flippedVertically,this.applyFlip(),this.rotationAngle=I.rotationAngle,this.applyRotation()}},J.prototype.clientToLocalCoordinates=function(I,R){var K=this.cropImage.getBoundingClientRect();return{x:I-K.left,y:R-K.top}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var I=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=I+"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()},J.prototype.rotateLeftButtonClicked=function(){var I=this.rotationAngle-90;this.rotationAngle%90!=0&&(I+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(I)},J.prototype.rotateRightButtonClicked=function(){var I=this.rotationAngle+90;this.rotationAngle%90!=0&&(I-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(I)},J.prototype.rotateTo=function(I){I=(I=I>180?I-360:I)<=-180?I+360:I,this.rotationAngle=I,this.applyRotation()},J.prototype.rotateBy=function(I){this.rotateTo((this.rotationAngle+I)%360)},J.prototype.applyRotation=function(){var I=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var R=this.editingTargetRotationContainer.transform.baseVal.getItem(0);R.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(R,0);var K=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/K.width,this.imageHeight/K.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=I},J.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},J.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},J.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},J.prototype.startRenderAndClose=function(){return je(this,void 0,void 0,function(){var I,R;return ht(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return I=K.sent(),R=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(I,R)}),this.close(!0),[2]}})})},J.prototype.render=function(){return je(this,void 0,void 0,function(){var I;return ht(this,function(R){switch(R.label){case 0:return(I=new Bn).naturalSize=this.renderAtNaturalSize,I.imageType=this.renderImageType,I.imageQuality=this.renderImageQuality,I.width=this.renderWidth,I.height=this.renderHeight,this.unzoomFromCrop(),Ie.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,I.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 R.sent(),[4,I.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,R.sent()]}})})},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ft("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 Ft("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ft("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var I=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ft("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*I)+`px;
height: `+(this.toolbarHeight-2*I)+`px;
padding: `+I+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ft("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ft("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ft("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 Ft("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ft("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 Ft("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*I)+`px;
padding: `+I+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ft("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},J.instanceCounter=0,J}(),Ct=k("8hTe"),Hn=k.n(Ct),pr=/<pre[^>]*>/g;function ur(J){var I=document.createElement("div");return I.innerHTML=J,I.childNodes.length===0?"":I.childNodes[0].nodeValue}var kr=oe.a=function(J){var I=J.value,R=I===void 0?"":I,K=J.edit,ee=K===void 0?!1:K,Y=J.className,Ee=J.showTextOnly,Ye=J.showLines,lt=J.replaces,vt=J.zoomImg,We=J.hasMask,_t=J.style,Lt=_t===void 0?{}:_t,Mt=J.stylesPrev,en=Mt===void 0?{}:Mt,Rt=String(R),nn=Object(D.useRef)(),tn=Object(D.useRef)(),Pn=Object(D.useState)(""),Xt=Object(G.a)(Pn,2),On=Xt[0],An=Xt[1],Ln=Object(D.useState)("office"),wn=Object(G.a)(Ln,2),In=wn[0],Gn=wn[1],ar=function(){var Tt=new ut(tn.current);Tt.displayMode="popup",Tt.addRenderEventListener(function(){var Kt=Object(M.a)(n.a.mark(function bt(qt){var kt;return n.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return nn.current.style.display="none",un.next=3,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:qt}});case 3:kt=un.sent,kt!=null&&kt.id&&lt(tn.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(kt==null?void 0:kt.id,"?type=").concat(kt.content_type));case 5:case"end":return un.stop()}},bt)}));return function(bt){return Kt.apply(this,arguments)}}()),Tt.show()},Xn=function(){var Tt=new le(tn.current);Tt.settings.displayMode="popup",Tt.addEventListener("render",function(){var Kt=Object(M.a)(n.a.mark(function bt(qt){var kt;return n.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:if(nn.current.style.display="none",!tn.current){un.next=6;break}return un.next=4,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:qt.dataUrl}});case 4:kt=un.sent,kt!=null&&kt.id&&lt(tn.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(kt==null?void 0:kt.id,"?type=").concat(kt.content_type));case 6:case"end":return un.stop()}},bt)}));return function(bt){return Kt.apply(this,arguments)}}()),Tt.show(),window.markerArea=Tt},_n=Object(D.useMemo)(function(){nn.current&&(nn.current.style.zIndex=-1);try{var Yt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Tt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Kt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Rt=Rt.replace(Yt,"("+Q.a.API_SERVER+"/api/attachments/").replace(Tt,'"'+Q.a.API_SERVER+"/api/attachments/").replace(Kt,'"'+Q.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(Yn){}var bt=H(Rt),qt=C();if(Rt.match(/\[TOC\]/)&&(bt=bt.replace("<p>[TOC]</p>",L()),S()),bt=bt.replace(/(__special_katext_id_\d+__)/g,function(Yn,un){var Qn=qt[un],Kr=Qn.type,wr=Qn.expression;return Object(ne.renderToString)(ur(wr)||"",{displayMode:Kr==="block",throwOnError:!1,output:"html"})}),bt=bt.replace(/▁/g,"\u2581\u2581\u2581"),E(),Ee){var kt=document.createElement("div");return kt.innerHTML=bt,kt.innerText}return setTimeout(function(){return gn()},500),bt},[Rt]),Wn=Object(D.useRef)();w.WebkitLineClamp=Ye,Ye&&(Lt=Object(j.a)(Object(j.a)({},Lt),w));function fn(Yt){var Tt=Yt.target;if(Tt.tagName.toUpperCase()==="IMG"){if(vt){var Kt=Tt.getAttribute("src");An(Kt),Gn("image")}}else if(Tt.tagName.toUpperCase()==="A"){var bt=Tt.getAttribute("href");if(bt.indexOf("office")>-1)Yt.preventDefault(),An(bt),Gn("office");else if(bt.indexOf("application/pdf")>-1)Yt.preventDefault(),An(bt),Gn("pdf");else if(bt.indexOf("text/html")>-1)Yt.preventDefault(),An(bt),Gn("html");else if(bt.startsWith("#")){Yt.preventDefault();var qt=document.getElementById(bt.replace("#",""));qt&&qt.scrollIntoView(!0)}}}var gn=function(){var Tt,Kt=(Tt=Wn.current)===null||Tt===void 0?void 0:Tt.querySelectorAll("video");Kt==null||Kt.forEach(function(bt){if(bt.oncontextmenu=function(){return!1},bt.src.indexOf(".m3u8")>-1&&!bt.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var qt=new z.a;qt.loadSource(bt.src),qt.attachMedia(bt)}}})};Object(D.useEffect)(function(){if(Wn.current&&_n&&(_n.match(pr)&&window.PR.prettyPrint()),Wn.current)return Wn.current.addEventListener("click",fn),function(){Wn.current.removeEventListener("click",fn),E(),S()}},[_n,Wn.current,fn]);var vn=function(Tt){if(!ee)return;Tt.target.nodeName==="IMG"?(nn.current.style.zIndex=1,nn.current.style.display="flex",nn.current.style.width=Tt.target.clientWidth+"px",nn.current.style.height=Tt.target.clientHeight+"px",nn.current.style.top=Tt.target.offsetTop+"px",nn.current.style.left=Tt.target.offsetLeft+"px",tn.current.src=Tt.target.getAttribute("src")):nn.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:Wn,style:Object(j.a)({},Lt),className:"".concat(Y||""," markdown-body ").concat(Hn.a.mdBody),onMouseOver:vn,dangerouslySetInnerHTML:{__html:_n}}),m.a.createElement("div",{ref:nn,className:Hn.a.button},m.a.createElement(X.a,null,m.a.createElement(V.a,{onClick:function(){return ar()}},"\u88C1\u526A"),m.a.createElement(V.a,{onClick:function(){return Xn()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:tn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(se.a,{close:!0,data:On,type:On!=null&&On.length?In:"",style:Object(j.a)({},en),onClose:function(){return An("")}}))}},"9VGf":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return P});var Z=k("q1tI"),X=k.n(Z);function P(V,j){var M=Object(Z.useRef)();Object(Z.useEffect)(function(){M.current=V}),Object(Z.useEffect)(function(){function G(){M.current()}if(j!==null){var W=setInterval(G,j);return function(){return clearInterval(W)}}},[j])}},AMnG:function(Fe,oe,k){"use strict";var Z=k("miYZ"),X=k("tsqr"),P=k("tJVT"),V=k("q1tI"),j=k.n(V),M=k("nWbc"),G=k.n(M),W=k("Ot1p");oe.a=function(n){var D=n.id,m=n.activeDiscussIndex,p=n.onReplyDiscuss,h=Object(V.useState)(""),c=Object(P.a)(h,2),o=c[0],d=c[1];function i(r){d(r)}function a(){if(!o){X.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}p(D,o),d("")}return j.a.createElement("div",{key:D,className:"discuss-item-editor",style:{display:m===D?"block":"none",width:"100%"}},j.a.createElement(W.a,{miniToolbar:!0,startInit:m===D,defaultValue:o,id:D,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),j.a.createElement("a",{onClick:a,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return M});var Z=k("MNnm"),X="rc-util-key";function P(G){if(G.attachTo)return G.attachTo;var W=document.querySelector("head");return W||document.body}function V(G){var W,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Z.a)())return null;var D=document.createElement("style");if((W=n.csp)===null||W===void 0?void 0:W.nonce){var m;D.nonce=(m=n.csp)===null||m===void 0?void 0:m.nonce}D.innerHTML=G;var p=P(n),h=p.firstChild;return n.prepend&&p.prepend?p.prepend(D):n.prepend&&h?p.insertBefore(D,h):p.appendChild(D),D}var j=new Map;function M(G,W){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=P(n);if(!j.has(D)){var m=V("",n),p=m.parentNode;j.set(D,p),p.removeChild(m)}var h=Array.from(j.get(D).children).find(function(a){return a.tagName==="STYLE"&&a[X]===W});if(h){var c,o;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&h.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var d;h.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return h.innerHTML!==G&&(h.innerHTML=G),h}var i=V(G,n);return i[X]=W,i}},Bd2K:function(Fe,oe,k){(function(Z){Z(k("VrN/"),k("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(n,D,m){if(m!=Z.Init&&m&&n.removeKeyMap("autoCloseTags"),!D)return;var p={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(p["'/'"]=function(h){return M(h)}),(typeof D!="object"||D.whenOpening!==!1)&&(p["'>'"]=function(h){return V(h)}),n.addKeyMap(p)});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(n){if(n.getOption("disableInput"))return Z.Pass;for(var D=n.listSelections(),m=[],p=n.getOption("autoCloseTags"),h=0;h<D.length;h++){if(!D[h].empty())return Z.Pass;var c=D[h].head,o=n.getTokenAt(c),d=Z.innerMode(n.getMode(),o.state),i=d.state,a=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(i),r=a&&a.name;if(!r)return Z.Pass;var s=d.mode.configuration=="html",S=typeof p=="object"&&p.dontCloseTags||s&&X,w=typeof p=="object"&&p.indentTags||s&&P;o.end>c.ch&&(r=r.slice(0,r.length-o.end+c.ch));var x=r.toLowerCase();if(!r||o.type=="string"&&(o.end!=c.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&a.close||o.string.indexOf("/")==c.ch-o.start-1||S&&G(S,x)>-1||W(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(i)||[],r,c,!0))return Z.Pass;var L=typeof p=="object"&&p.emptyTags;if(L&&G(L,r)>-1){m[h]={text:"/>",newPos:Z.Pos(c.line,c.ch+2)};continue}var O=w&&G(w,x)>-1;m[h]={indent:O,text:">"+(O?`
`:"")+"</"+r+">",newPos:O?Z.Pos(c.line+1,0):Z.Pos(c.line,c.ch+1)}}for(var _=typeof p=="object"&&p.dontIndentOnAutoClose,h=D.length-1;h>=0;h--){var b=m[h];n.replaceRange(b.text,D[h].head,D[h].anchor,"+insert");var g=n.listSelections().slice(0);g[h]={head:b.newPos,anchor:b.newPos},n.setSelections(g),!_&&b.indent&&(n.indentLine(b.newPos.line,null,!0),n.indentLine(b.newPos.line+1,null,!0))}}function j(n,D){for(var m=n.listSelections(),p=[],h=D?"/":"</",c=n.getOption("autoCloseTags"),o=typeof c=="object"&&c.dontIndentOnSlash,d=0;d<m.length;d++){if(!m[d].empty())return Z.Pass;var i=m[d].head,a=n.getTokenAt(i),r=Z.innerMode(n.getMode(),a.state),s=r.state;if(D&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=i.ch-1))return Z.Pass;var S,w=r.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(w&&r.mode.name=="javascript")S=h+"script";else if(w&&r.mode.name=="css")S=h+"style";else{var x=r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(s);if(!x||x.length&&W(n,x,x[x.length-1],i))return Z.Pass;S=h+x[x.length-1]}n.getLine(i.line).charAt(a.end)!=">"&&(S+=">"),p[d]=S}if(n.replaceSelections(p),m=n.listSelections(),!o)for(var d=0;d<m.length;d++)(d==m.length-1||m[d].head.line<m[d+1].head.line)&&n.indentLine(m[d].head.line)}function M(n){return n.getOption("disableInput")?Z.Pass:j(n,!0)}Z.commands.closeTag=function(n){return j(n)};function G(n,D){if(n.indexOf)return n.indexOf(D);for(var m=0,p=n.length;m<p;++m)if(n[m]==D)return m;return-1}function W(n,D,m,p,h){if(!Z.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,p.line+500),o=Z.scanForClosingTag(n,p,null,c);if(!o||o.tag!=m)return!1;for(var d=h?1:0,i=D.length-1;i>=0&&D[i]==m;i--)++d;p=o.to;for(var i=1;i<d;i++){var a=Z.scanForClosingTag(n,p,null,c);if(!a||a.tag!=m)return!1;p=a.to}return!0}})},BdwD:function(Fe,oe,k){"use strict";var Z=k("+L6B"),X=k("2/Rp"),P=k("0Owb"),V=k("k1fw"),j=k("q1tI"),M=k.n(j),G=k("FOrL"),W=k.n(G),n=function(m){var p=m.buttonProps,h=p===void 0?{}:p,c=m.styles,o=c===void 0?{}:c,d=m.customText,i=m.ButtonText,a=m.ButtonClick,r=m.Buttonclass,s=m.ButtonTwo;return M.a.createElement("section",{className:"tc animated fadeIn",style:Object(V.a)(Object(V.a)({},{color:"#999",margin:"200px auto"}),o)},M.a.createElement("img",{src:W.a}),M.a.createElement("p",{className:"mt20 font14"},d||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&M.a.createElement(X.a,Object(P.a)({className:r,onClick:a},h),i),s&&s)};oe.a=n},BjJ7:function(Fe,oe,k){"use strict";k.d(oe,"d",function(){return X}),k.d(oe,"c",function(){return P}),k.d(oe,"e",function(){return V}),k.d(oe,"b",function(){return j}),k.d(oe,"a",function(){return G});var Z=k("m3rI");function X(W){var n=!0;if(W.length>0){for(var D=0;D<W.length;D++)if(W[D].compile_success==0||!W[D].compile_success){n=!1;break}}else n=!1;return n}function P(W){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],m=0;m<W.length;m++){var p=W[m],h=n?"".concat(n,"/").concat(p.name):"".concat(p.name);D.push({title:p.name,isLeaf:!(p.type==="tree"),key:h})}return D}function V(W,n,D){for(var m=0;m<W.length;m++){var p=W[m];if(p.key===n){p.children=D;break}p.children&&V(p.children,n,D)}return W}function j(W,n,D){var m;return function(){var p=this,h=arguments,c=function(){m=null,D||W.apply(p,h)},o=D&&!m;clearTimeout(m),m=setTimeout(c,n),o&&W.apply(p,h)}}var M=!0,G=Z.a.API_SERVER},"C+DQ":function(Fe,oe,k){},"C/vA":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return Z});function Z(X){const P=this;let V=!1,j;return function(){return V||(V=!0,j=X.apply(P,arguments)),j}}},"Cg/j":function(Fe,oe,k){"use strict";k.d(oe,"b",function(){return Z}),k.d(oe,"a",function(){return X}),k.d(oe,"c",function(){return V}),k.d(oe,"d",function(){return j});var Z;(function(M){M.serviceIds=new Map,M.DI_TARGET="$di$target",M.DI_DEPENDENCIES="$di$dependencies";function G(W){return W[M.DI_DEPENDENCIES]||[]}M.getServiceDependencies=G})(Z||(Z={}));const X=V("instantiationService");function P(M,G,W,n){G[Z.DI_TARGET]===G?G[Z.DI_DEPENDENCIES].push({id:M,index:W,optional:n}):(G[Z.DI_DEPENDENCIES]=[{id:M,index:W,optional:n}],G[Z.DI_TARGET]=G)}function V(M){if(Z.serviceIds.has(M))return Z.serviceIds.get(M);const G=function(W,n,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(G,W,D,!1)};return G.toString=()=>M,Z.serviceIds.set(M,G),G}function j(M){return function(G,W,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(M,G,n,!0)}}},CrYA:function(Fe,oe,k){var Z=k("MFOe"),X=Z.Global;Fe.exports={name:"sessionStorage",read:V,write:j,each:M,remove:G,clearAll:W};function P(){return X.sessionStorage}function V(n){return P().getItem(n)}function j(n,D){return P().setItem(n,D)}function M(n){for(var D=P().length-1;D>=0;D--){var m=P().key(D);n(V(m),m)}}function G(n){return P().removeItem(n)}function W(){return P().clear()}},DlQD:function(Fe,oe,k){(function(Z,X){Fe.exports=X()})(this,function(){"use strict";function Z(ye,ce){for(var pe=0;pe<ce.length;pe++){var ie=ce[pe];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(ye,ie.key,ie)}}function X(ye,ce,pe){return ce&&Z(ye.prototype,ce),pe&&Z(ye,pe),ye}function P(ye,ce){if(!ye)return;if(typeof ye=="string")return V(ye,ce);var pe=Object.prototype.toString.call(ye).slice(8,-1);if(pe==="Object"&&ye.constructor&&(pe=ye.constructor.name),pe==="Map"||pe==="Set")return Array.from(ye);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return V(ye,ce)}function V(ye,ce){(ce==null||ce>ye.length)&&(ce=ye.length);for(var pe=0,ie=new Array(ce);pe<ce;pe++)ie[pe]=ye[pe];return ie}function j(ye,ce){var pe;if(typeof Symbol=="undefined"||ye[Symbol.iterator]==null){if(Array.isArray(ye)||(pe=P(ye))||ce&&ye&&typeof ye.length=="number"){pe&&(ye=pe);var ie=0;return function(){return ie>=ye.length?{done:!0}:{done:!1,value:ye[ie++]}}}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 pe=ye[Symbol.iterator](),pe.next.bind(pe)}function M(ye,ce){return ce={exports:{}},ye(ce,ce.exports),ce.exports}var G=M(function(ye){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 pe(ie){ye.exports.defaults=ie}ye.exports={defaults:ce(),getDefaults:ce,changeDefaults:pe}}),W=G.defaults,n=G.getDefaults,D=G.changeDefaults,m=/[&<>"']/,p=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},d=function(ce){return o[ce]};function i(ye,ce){if(ce){if(m.test(ye))return ye.replace(p,d)}else if(h.test(ye))return ye.replace(c,d);return ye}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(ye){return ye.replace(a,function(ce,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var s=/(^|[^\[])\^/g;function S(ye,ce){ye=ye.source||ye,ce=ce||"";var pe={replace:function(ae,de){return de=de.source||de,de=de.replace(s,"$1"),ye=ye.replace(ae,de),pe},getRegex:function(){return new RegExp(ye,ce)}};return pe}var w=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(ye,ce,pe){if(ye){var ie;try{ie=decodeURIComponent(r(pe)).replace(w,"").toLowerCase()}catch(ae){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}ce&&!x.test(pe)&&(pe=f(ce,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(ae){return null}return pe}var O={},_=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(ye,ce){O[" "+ye]||(_.test(ye)?O[" "+ye]=ye+"/":O[" "+ye]=N(ye,"/",!0)),ye=O[" "+ye];var pe=ye.indexOf(":")===-1;return ce.substring(0,2)==="//"?pe?ce:ye.replace(b,"$1")+ce:ce.charAt(0)==="/"?pe?ce:ye.replace(g,"$1")+ce:ye+ce}var C={exec:function(){}};function E(ye){for(var ce=1,pe,ie;ce<arguments.length;ce++){pe=arguments[ce];for(ie in pe)Object.prototype.hasOwnProperty.call(pe,ie)&&(ye[ie]=pe[ie])}return ye}function v(ye,ce){var pe=ye.replace(/\|/g,function(de,ge,Te){for(var De=!1,Ze=ge;--Ze>=0&&Te[Ze]==="\\";)De=!De;return De?"|":" |"}),ie=pe.split(/ \|/),ae=0;if(ie.length>ce)ie.splice(ce);else for(;ie.length<ce;)ie.push("");for(;ae<ie.length;ae++)ie[ae]=ie[ae].trim().replace(/\\\|/g,"|");return ie}function N(ye,ce,pe){var ie=ye.length;if(ie===0)return"";for(var ae=0;ae<ie;){var de=ye.charAt(ie-ae-1);if(de===ce&&!pe)ae++;else if(de!==ce&&pe)ae++;else break}return ye.substr(0,ie-ae)}function U(ye,ce){if(ye.indexOf(ce[1])===-1)return-1;for(var pe=ye.length,ie=0,ae=0;ae<pe;ae++)if(ye[ae]==="\\")ae++;else if(ye[ae]===ce[0])ie++;else if(ye[ae]===ce[1]&&(ie--,ie<0))return ae;return-1}function A(ye){ye&&ye.sanitize&&!ye.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 H={escape:i,unescape:r,edit:S,cleanUrl:L,resolveUrl:f,noopTest:C,merge:E,splitCells:v,rtrim:N,findClosingBracket:U,checkSanitizeDeprecation:A},F=G.defaults,T=H.rtrim,z=H.splitCells,Q=H.escape,ne=H.findClosingBracket;function se(ye,ce,pe){var ie=ce.href,ae=ce.title?Q(ce.title):null,de=ye[1].replace(/\\([\[\]])/g,"$1");return ye[0].charAt(0)!=="!"?{type:"link",raw:pe,href:ie,title:ae,text:de}:{type:"image",raw:pe,href:ie,title:ae,text:Q(de)}}function xe(ye,ce){var pe=ye.match(/^(\s+)(?:```)/);if(pe===null)return ce;var ie=pe[1];return ce.split(`
`).map(function(ae){var de=ae.match(/^\s+/);if(de===null)return ae;var ge=de[0];return ge.length>=ie.length?ae.slice(ie.length):ae}).join(`
`)}var me=function(){function ye(pe){this.options=pe||F}var ce=ye.prototype;return ce.space=function(ie){var ae=this.rules.block.newline.exec(ie);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
`}},ce.code=function(ie,ae){var de=this.rules.block.code.exec(ie);if(de){var ge=ae[ae.length-1];if(ge&&ge.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var Te=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?Te:T(Te,`
`)}}},ce.fences=function(ie){var ae=this.rules.block.fences.exec(ie);if(ae){var de=ae[0],ge=xe(de,ae[3]||"");return{type:"code",raw:de,lang:ae[2]?ae[2].trim():ae[2],text:ge}}},ce.heading=function(ie){var ae=this.rules.block.heading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},ce.nptable=function(ie){var ae=this.rules.block.nptable.exec(ie);if(ae){var de={type:"table",header:z(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[],raw:ae[0]};if(de.header.length===de.align.length){var ge=de.align.length,Te;for(Te=0;Te<ge;Te++)/^ *-+: *$/.test(de.align[Te])?de.align[Te]="right":/^ *:-+: *$/.test(de.align[Te])?de.align[Te]="center":/^ *:-+ *$/.test(de.align[Te])?de.align[Te]="left":de.align[Te]=null;for(ge=de.cells.length,Te=0;Te<ge;Te++)de.cells[Te]=z(de.cells[Te],de.header.length);return de}}},ce.hr=function(ie){var ae=this.rules.block.hr.exec(ie);if(ae)return{type:"hr",raw:ae[0]}},ce.blockquote=function(ie){var ae=this.rules.block.blockquote.exec(ie);if(ae){var de=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:de}}},ce.list=function(ie){var ae=this.rules.block.list.exec(ie);if(ae){for(var de=ae[0],ge=ae[2],Te=ge.length>1,De=ge[ge.length-1]===")",Ze={type:"list",raw:de,ordered:Te,start:Te?+ge.slice(0,-1):"",loose:!1,items:[]},pt=ae[0].match(this.rules.block.item),Ot=!1,yt,ot,He,Ge,Ue,le,_e,Ve=pt.length,je=0;je<Ve;je++)yt=pt[je],de=yt,ot=yt.length,yt=yt.replace(/^ *([*+-]|\d+[.)]) */,""),~yt.indexOf(`
`)&&(ot-=yt.length,yt=this.options.pedantic?yt.replace(/^ {1,4}/gm,""):yt.replace(new RegExp("^ {1,"+ot+"}","gm"),"")),je!==Ve-1&&(He=this.rules.block.bullet.exec(pt[je+1])[0],(Te?He.length===1||!De&&He[He.length-1]===")":He.length>1||this.options.smartLists&&He!==ge)&&(Ge=pt.slice(je+1).join(`
`),Ze.raw=Ze.raw.substring(0,Ze.raw.length-Ge.length),je=Ve-1)),Ue=Ot||/\n\n(?!\s*$)/.test(yt),je!==Ve-1&&(Ot=yt.charAt(yt.length-1)===`
`,Ue||(Ue=Ot)),Ue&&(Ze.loose=!0),le=/^\[[ xX]\] /.test(yt),_e=void 0,le&&(_e=yt[1]!==" ",yt=yt.replace(/^\[[ xX]\] +/,"")),Ze.items.push({type:"list_item",raw:de,task:le,checked:_e,loose:Ue,text:yt});return Ze}},ce.html=function(ie){var ae=this.rules.block.html.exec(ie);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):Q(ae[0]):ae[0]}},ce.def=function(ie){var ae=this.rules.block.def.exec(ie);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var de=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:ae[0],href:ae[2],title:ae[3]}}},ce.table=function(ie){var ae=this.rules.block.table.exec(ie);if(ae){var de={type:"table",header:z(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[]};if(de.header.length===de.align.length){de.raw=ae[0];var ge=de.align.length,Te;for(Te=0;Te<ge;Te++)/^ *-+: *$/.test(de.align[Te])?de.align[Te]="right":/^ *:-+: *$/.test(de.align[Te])?de.align[Te]="center":/^ *:-+ *$/.test(de.align[Te])?de.align[Te]="left":de.align[Te]=null;for(ge=de.cells.length,Te=0;Te<ge;Te++)de.cells[Te]=z(de.cells[Te].replace(/^ *\| *| *\| *$/g,""),de.header.length);return de}}},ce.lheading=function(ie){var ae=this.rules.block.lheading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},ce.paragraph=function(ie){var ae=this.rules.block.paragraph.exec(ie);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
`?ae[1].slice(0,-1):ae[1]}},ce.text=function(ie,ae){var de=this.rules.block.text.exec(ie);if(de){var ge=ae[ae.length-1];return ge&&ge.type==="text"?{raw:de[0],text:de[0]}:{type:"text",raw:de[0],text:de[0]}}},ce.escape=function(ie){var ae=this.rules.inline.escape.exec(ie);if(ae)return{type:"escape",raw:ae[0],text:Q(ae[1])}},ce.tag=function(ie,ae,de){var ge=this.rules.inline.tag.exec(ie);if(ge)return!ae&&/^<a /i.test(ge[0])?ae=!0:ae&&/^<\/a>/i.test(ge[0])&&(ae=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:ae,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):Q(ge[0]):ge[0]}},ce.link=function(ie){var ae=this.rules.inline.link.exec(ie);if(ae){var de=ne(ae[2],"()");if(de>-1){var ge=ae[0].indexOf("!")===0?5:4,Te=ge+ae[1].length+de;ae[2]=ae[2].substring(0,de),ae[0]=ae[0].substring(0,Te).trim(),ae[3]=""}var De=ae[2],Ze="";if(this.options.pedantic){var pt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(De);pt?(De=pt[1],Ze=pt[3]):Ze=""}else Ze=ae[3]?ae[3].slice(1,-1):"";De=De.trim().replace(/^<([\s\S]*)>$/,"$1");var Ot=se(ae,{href:De&&De.replace(this.rules.inline._escapes,"$1"),title:Ze&&Ze.replace(this.rules.inline._escapes,"$1")},ae[0]);return Ot}},ce.reflink=function(ie,ae){var de;if((de=this.rules.inline.reflink.exec(ie))||(de=this.rules.inline.nolink.exec(ie))){var ge=(de[2]||de[1]).replace(/\s+/g," ");if(ge=ae[ge.toLowerCase()],!ge||!ge.href){var Te=de[0].charAt(0);return{type:"text",raw:Te,text:Te}}var De=se(de,ge,de[0]);return De}},ce.strong=function(ie,ae,de){de===void 0&&(de="");var ge=this.rules.inline.strong.start.exec(ie);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ae=ae.slice(-1*ie.length);var Te=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Te.lastIndex=0;for(var De;(ge=Te.exec(ae))!=null;)if(De=this.rules.inline.strong.middle.exec(ae.slice(0,ge.index+3)),De)return{type:"strong",raw:ie.slice(0,De[0].length),text:ie.slice(2,De[0].length-2)}}},ce.em=function(ie,ae,de){de===void 0&&(de="");var ge=this.rules.inline.em.start.exec(ie);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ae=ae.slice(-1*ie.length);var Te=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Te.lastIndex=0;for(var De;(ge=Te.exec(ae))!=null;)if(De=this.rules.inline.em.middle.exec(ae.slice(0,ge.index+2)),De)return{type:"em",raw:ie.slice(0,De[0].length),text:ie.slice(1,De[0].length-1)}}},ce.codespan=function(ie){var ae=this.rules.inline.code.exec(ie);if(ae){var de=ae[2].replace(/\n/g," "),ge=/[^ ]/.test(de),Te=de.startsWith(" ")&&de.endsWith(" ");return ge&&Te&&(de=de.substring(1,de.length-1)),de=Q(de,!0),{type:"codespan",raw:ae[0],text:de}}},ce.br=function(ie){var ae=this.rules.inline.br.exec(ie);if(ae)return{type:"br",raw:ae[0]}},ce.del=function(ie){var ae=this.rules.inline.del.exec(ie);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},ce.autolink=function(ie,ae){var de=this.rules.inline.autolink.exec(ie);if(de){var ge,Te;return de[2]==="@"?(ge=Q(this.options.mangle?ae(de[1]):de[1]),Te="mailto:"+ge):(ge=Q(de[1]),Te=ge),{type:"link",raw:de[0],text:ge,href:Te,tokens:[{type:"text",raw:ge,text:ge}]}}},ce.url=function(ie,ae){var de;if(de=this.rules.inline.url.exec(ie)){var ge,Te;if(de[2]==="@")ge=Q(this.options.mangle?ae(de[0]):de[0]),Te="mailto:"+ge;else{var De;do De=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(De!==de[0]);ge=Q(de[0]),de[1]==="www."?Te="http://"+ge:Te=ge}return{type:"link",raw:de[0],text:ge,href:Te,tokens:[{type:"text",raw:ge,text:ge}]}}},ce.inlineText=function(ie,ae,de){var ge=this.rules.inline.text.exec(ie);if(ge){var Te;return ae?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):Q(ge[0]):ge[0]:Te=Q(this.options.smartypants?de(ge[0]):ge[0]),{type:"text",raw:ge[0],text:Te}}},ye}(),ve=H.noopTest,Oe=H.edit,Re=H.merge,fe={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:ve,table:ve,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};fe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,fe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,fe.def=Oe(fe.def).replace("label",fe._label).replace("title",fe._title).getRegex(),fe.bullet=/(?:[*+-]|\d{1,9}[.)])/,fe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,fe.item=Oe(fe.item,"gm").replace(/bull/g,fe.bullet).getRegex(),fe.list=Oe(fe.list).replace(/bull/g,fe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+fe.def.source+")").getRegex(),fe._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",fe._comment=/<!--(?!-?>)[\s\S]*?-->/,fe.html=Oe(fe.html,"i").replace("comment",fe._comment).replace("tag",fe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fe.paragraph=Oe(fe._paragraph).replace("hr",fe.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",fe._tag).getRegex(),fe.blockquote=Oe(fe.blockquote).replace("paragraph",fe.paragraph).getRegex(),fe.normal=Re({},fe),fe.gfm=Re({},fe.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*|$)"}),fe.gfm.nptable=Oe(fe.gfm.nptable).replace("hr",fe.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",fe._tag).getRegex(),fe.gfm.table=Oe(fe.gfm.table).replace("hr",fe.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",fe._tag).getRegex(),fe.pedantic=Re({},fe.normal,{html:Oe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fe._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:ve,paragraph:Oe(fe.normal._paragraph).replace("hr",fe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",fe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ve,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:ve,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=Oe(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=Oe(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=Oe(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=Oe(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=Oe(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=Oe(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=Oe(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=Oe(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=Oe(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=Oe(ue._blockSkip,"g").getRegex(),ue.overlapSkip=Oe(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ue.autolink=Oe(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=Oe(ue.tag).replace("comment",fe._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=Oe(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=Oe(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=Oe(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=Re({},ue),ue.pedantic=Re({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Oe(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:Oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=Re({},ue.normal,{escape:Oe(ue.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=Oe(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=Re({},ue.gfm,{br:Oe(ue.br).replace("{2,}","*").getRegex(),text:Oe(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Pe={block:fe,inline:ue},et=G.defaults,rt=Pe.block,tt=Pe.inline;function it(ye){return ye.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 ze(ye){var ce="",pe,ie,ae=ye.length;for(pe=0;pe<ae;pe++)ie=ye.charCodeAt(pe),Math.random()>.5&&(ie="x"+ie.toString(16)),ce+="&#"+ie+";";return ce}var Qe=function(){function ye(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||et,this.options.tokenizer=this.options.tokenizer||new me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:rt.normal,inline:tt.normal};this.options.pedantic?(ie.block=rt.pedantic,ie.inline=tt.pedantic):this.options.gfm&&(ie.block=rt.gfm,this.options.breaks?ie.inline=tt.breaks:ie.inline=tt.gfm),this.tokenizer.rules=ie}ye.lex=function(ie,ae){var de=new ye(ae);return de.lex(ie)};var ce=ye.prototype;return ce.lex=function(ie){return ie=ie.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ie,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(ie,ae,de){ae===void 0&&(ae=[]),de===void 0&&(de=!0),ie=ie.replace(/^ +$/gm,"");for(var ge,Te,De,Ze;ie;){if(ge=this.tokenizer.space(ie)){ie=ie.substring(ge.raw.length),ge.type&&ae.push(ge);continue}if(ge=this.tokenizer.code(ie,ae)){ie=ie.substring(ge.raw.length),ge.type?ae.push(ge):(Ze=ae[ae.length-1],Ze.raw+=`
`+ge.raw,Ze.text+=`
`+ge.text);continue}if(ge=this.tokenizer.fences(ie)){ie=ie.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.heading(ie)){ie=ie.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.nptable(ie)){ie=ie.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.hr(ie)){ie=ie.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.blockquote(ie)){ie=ie.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],de),ae.push(ge);continue}if(ge=this.tokenizer.list(ie)){for(ie=ie.substring(ge.raw.length),De=ge.items.length,Te=0;Te<De;Te++)ge.items[Te].tokens=this.blockTokens(ge.items[Te].text,[],!1);ae.push(ge);continue}if(ge=this.tokenizer.html(ie)){ie=ie.substring(ge.raw.length),ae.push(ge);continue}if(de&&(ge=this.tokenizer.def(ie))){ie=ie.substring(ge.raw.length),this.tokens.links[ge.tag]||(this.tokens.links[ge.tag]={href:ge.href,title:ge.title});continue}if(ge=this.tokenizer.table(ie)){ie=ie.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.lheading(ie)){ie=ie.substring(ge.raw.length),ae.push(ge);continue}if(de&&(ge=this.tokenizer.paragraph(ie))){ie=ie.substring(ge.raw.length),ae.push(ge);continue}if(ge=this.tokenizer.text(ie,ae)){ie=ie.substring(ge.raw.length),ge.type?ae.push(ge):(Ze=ae[ae.length-1],Ze.raw+=`
`+ge.raw,Ze.text+=`
`+ge.text);continue}if(ie){var pt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(pt);break}else throw new Error(pt)}}return ae},ce.inline=function(ie){var ae,de,ge,Te,De,Ze,pt=ie.length;for(ae=0;ae<pt;ae++){Ze=ie[ae];switch(Ze.type){case"paragraph":case"text":case"heading":{Ze.tokens=[],this.inlineTokens(Ze.text,Ze.tokens);break}case"table":{for(Ze.tokens={header:[],cells:[]},Te=Ze.header.length,de=0;de<Te;de++)Ze.tokens.header[de]=[],this.inlineTokens(Ze.header[de],Ze.tokens.header[de]);for(Te=Ze.cells.length,de=0;de<Te;de++)for(De=Ze.cells[de],Ze.tokens.cells[de]=[],ge=0;ge<De.length;ge++)Ze.tokens.cells[de][ge]=[],this.inlineTokens(De[ge],Ze.tokens.cells[de][ge]);break}case"blockquote":{this.inline(Ze.tokens);break}case"list":{for(Te=Ze.items.length,de=0;de<Te;de++)this.inline(Ze.items[de].tokens);break}}}return ie},ce.inlineTokens=function(ie,ae,de,ge,Te){ae===void 0&&(ae=[]),de===void 0&&(de=!1),ge===void 0&&(ge=!1),Te===void 0&&(Te="");var De,Ze=ie,pt;if(this.tokens.links){var Ot=Object.keys(this.tokens.links);if(Ot.length>0)for(;(pt=this.tokenizer.rules.inline.reflinkSearch.exec(Ze))!=null;)Ot.includes(pt[0].slice(pt[0].lastIndexOf("[")+1,-1))&&(Ze=Ze.slice(0,pt.index)+"["+"a".repeat(pt[0].length-2)+"]"+Ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(pt=this.tokenizer.rules.inline.blockSkip.exec(Ze))!=null;)Ze=Ze.slice(0,pt.index)+"["+"a".repeat(pt[0].length-2)+"]"+Ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(De=this.tokenizer.escape(ie)){ie=ie.substring(De.raw.length),ae.push(De);continue}if(De=this.tokenizer.tag(ie,de,ge)){ie=ie.substring(De.raw.length),de=De.inLink,ge=De.inRawBlock,ae.push(De);continue}if(De=this.tokenizer.link(ie)){ie=ie.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,ge)),ae.push(De);continue}if(De=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,ge)),ae.push(De);continue}if(De=this.tokenizer.strong(ie,Ze,Te)){ie=ie.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],de,ge),ae.push(De);continue}if(De=this.tokenizer.em(ie,Ze,Te)){ie=ie.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],de,ge),ae.push(De);continue}if(De=this.tokenizer.codespan(ie)){ie=ie.substring(De.raw.length),ae.push(De);continue}if(De=this.tokenizer.br(ie)){ie=ie.substring(De.raw.length),ae.push(De);continue}if(De=this.tokenizer.del(ie)){ie=ie.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],de,ge),ae.push(De);continue}if(De=this.tokenizer.autolink(ie,ze)){ie=ie.substring(De.raw.length),ae.push(De);continue}if(!de&&(De=this.tokenizer.url(ie,ze))){ie=ie.substring(De.raw.length),ae.push(De);continue}if(De=this.tokenizer.inlineText(ie,ge,it)){ie=ie.substring(De.raw.length),Te=De.raw.slice(-1),ae.push(De);continue}if(ie){var yt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return ae},X(ye,null,[{key:"rules",get:function(){return{block:rt,inline:tt}}}]),ye}(),at=G.defaults,he=H.cleanUrl,Se=H.escape,Le=function(){function ye(pe){this.options=pe||at}var ce=ye.prototype;return ce.code=function(ie,ae,de){var ge=(ae||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(ie,ge);Te!=null&&Te!==ie&&(de=!0,ie=Te)}return ge?'<pre><code class="'+this.options.langPrefix+Se(ge,!0)+'">'+(de?ie:Se(ie,!0))+`</code></pre>
`:"<pre><code>"+(de?ie:Se(ie,!0))+`</code></pre>
`},ce.blockquote=function(ie){return`<blockquote>
`+ie+`</blockquote>
`},ce.html=function(ie){return ie},ce.heading=function(ie,ae,de,ge){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+ge.slug(de)+'">'+ie+"</h"+ae+`>
`:"<h"+ae+">"+ie+"</h"+ae+`>
`},ce.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ce.list=function(ie,ae,de){var ge=ae?"ol":"ul",Te=ae&&de!==1?' start="'+de+'"':"";return"<"+ge+Te+`>
`+ie+"</"+ge+`>
`},ce.listitem=function(ie){return"<li>"+ie+`</li>
`},ce.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(ie){return"<p>"+ie+`</p>
`},ce.table=function(ie,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
<thead>
`+ie+`</thead>
`+ae+`</table>
`},ce.tablerow=function(ie){return`<tr>
`+ie+`</tr>
`},ce.tablecell=function(ie,ae){var de=ae.header?"th":"td",ge=ae.align?"<"+de+' align="'+ae.align+'">':"<"+de+">";return ge+ie+"</"+de+`>
`},ce.strong=function(ie){return"<strong>"+ie+"</strong>"},ce.em=function(ie){return"<em>"+ie+"</em>"},ce.codespan=function(ie){return"<code>"+ie+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(ie){return"<del>"+ie+"</del>"},ce.link=function(ie,ae,de){if(ie=he(this.options.sanitize,this.options.baseUrl,ie),ie===null)return de;var ge='<a href="'+Se(ie)+'"';return ae&&(ge+=' title="'+ae+'"'),ge+=">"+de+"</a>",ge},ce.image=function(ie,ae,de){if(ie=he(this.options.sanitize,this.options.baseUrl,ie),ie===null)return de;var ge='<img src="'+ie+'" alt="'+de+'"';return ae&&(ge+=' title="'+ae+'"'),ge+=this.options.xhtml?"/>":">",ge},ce.text=function(ie){return ie},ye}(),Me=function(){function ye(){}var ce=ye.prototype;return ce.strong=function(ie){return ie},ce.em=function(ie){return ie},ce.codespan=function(ie){return ie},ce.del=function(ie){return ie},ce.html=function(ie){return ie},ce.text=function(ie){return ie},ce.link=function(ie,ae,de){return""+de},ce.image=function(ie,ae,de){return""+de},ce.br=function(){return""},ye}(),qe=function(){function ye(){this.seen={}}var ce=ye.prototype;return ce.slug=function(ie){var ae=ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var de=ae;do this.seen[de]++,ae=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},ye}(),st=G.defaults,mt=H.unescape,gt=function(){function ye(pe){this.options=pe||st,this.options.renderer=this.options.renderer||new Le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Me,this.slugger=new qe}ye.parse=function(ie,ae){var de=new ye(ae);return de.parse(ie)};var ce=ye.prototype;return ce.parse=function(ie,ae){ae===void 0&&(ae=!0);var de="",ge,Te,De,Ze,pt,Ot,yt,ot,He,Ge,Ue,le,_e,Ve,je,ht,ft,Ie,$e=ie.length;for(ge=0;ge<$e;ge++){Ge=ie[ge];switch(Ge.type){case"space":continue;case"hr":{de+=this.renderer.hr();continue}case"heading":{de+=this.renderer.heading(this.parseInline(Ge.tokens),Ge.depth,mt(this.parseInline(Ge.tokens,this.textRenderer)),this.slugger);continue}case"code":{de+=this.renderer.code(Ge.text,Ge.lang,Ge.escaped);continue}case"table":{for(ot="",yt="",Ze=Ge.header.length,Te=0;Te<Ze;Te++)yt+=this.renderer.tablecell(this.parseInline(Ge.tokens.header[Te]),{header:!0,align:Ge.align[Te]});for(ot+=this.renderer.tablerow(yt),He="",Ze=Ge.cells.length,Te=0;Te<Ze;Te++){for(Ot=Ge.tokens.cells[Te],yt="",pt=Ot.length,De=0;De<pt;De++)yt+=this.renderer.tablecell(this.parseInline(Ot[De]),{header:!1,align:Ge.align[De]});He+=this.renderer.tablerow(yt)}de+=this.renderer.table(ot,He);continue}case"blockquote":{He=this.parse(Ge.tokens),de+=this.renderer.blockquote(He);continue}case"list":{for(Ue=Ge.ordered,le=Ge.start,_e=Ge.loose,Ze=Ge.items.length,He="",Te=0;Te<Ze;Te++)je=Ge.items[Te],ht=je.checked,ft=je.task,Ve="",je.task&&(Ie=this.renderer.checkbox(ht),_e?je.tokens.length>0&&je.tokens[0].type==="text"?(je.tokens[0].text=Ie+" "+je.tokens[0].text,je.tokens[0].tokens&&je.tokens[0].tokens.length>0&&je.tokens[0].tokens[0].type==="text"&&(je.tokens[0].tokens[0].text=Ie+" "+je.tokens[0].tokens[0].text)):je.tokens.unshift({type:"text",text:Ie}):Ve+=Ie),Ve+=this.parse(je.tokens,_e),He+=this.renderer.listitem(Ve,ft,ht);de+=this.renderer.list(He,Ue,le);continue}case"html":{de+=this.renderer.html(Ge.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(Ge.tokens));continue}case"text":{for(He=Ge.tokens?this.parseInline(Ge.tokens):Ge.text;ge+1<$e&&ie[ge+1].type==="text";)Ge=ie[++ge],He+=`
`+(Ge.tokens?this.parseInline(Ge.tokens):Ge.text);de+=ae?this.renderer.paragraph(He):He;continue}default:{var xt='Token with "'+Ge.type+'" type was not found.';if(this.options.silent){console.error(xt);return}else throw new Error(xt)}}}return de},ce.parseInline=function(ie,ae){ae=ae||this.renderer;var de="",ge,Te,De=ie.length;for(ge=0;ge<De;ge++){Te=ie[ge];switch(Te.type){case"escape":{de+=ae.text(Te.text);break}case"html":{de+=ae.html(Te.text);break}case"link":{de+=ae.link(Te.href,Te.title,this.parseInline(Te.tokens,ae));break}case"image":{de+=ae.image(Te.href,Te.title,Te.text);break}case"strong":{de+=ae.strong(this.parseInline(Te.tokens,ae));break}case"em":{de+=ae.em(this.parseInline(Te.tokens,ae));break}case"codespan":{de+=ae.codespan(Te.text);break}case"br":{de+=ae.br();break}case"del":{de+=ae.del(this.parseInline(Te.tokens,ae));break}case"text":{de+=ae.text(Te.text);break}default:{var Ze='Token with "'+Te.type+'" type was not found.';if(this.options.silent){console.error(Ze);return}else throw new Error(Ze)}}}return de},ye}(),St=H.merge,Et=H.checkSanitizeDeprecation,Ae=H.escape,Ce=G.getDefaults,Xe=G.changeDefaults,Je=G.defaults;function ke(ye,ce,pe){if(typeof ye=="undefined"||ye===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ye!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ye)+", string expected");if(typeof ce=="function"&&(pe=ce,ce=null),ce=St({},ke.defaults,ce||{}),Et(ce),pe){var ie=ce.highlight,ae;try{ae=Qe.lex(ye,ce)}catch(De){return pe(De)}var de=function(Ze){var pt;if(!Ze)try{pt=gt.parse(ae,ce)}catch(Ot){Ze=Ot}return ce.highlight=ie,Ze?pe(Ze):pe(null,pt)};if(!ie||ie.length<3)return de();if(delete ce.highlight,!ae.length)return de();var ge=0;ke.walkTokens(ae,function(De){De.type==="code"&&(ge++,setTimeout(function(){ie(De.text,De.lang,function(Ze,pt){if(Ze)return de(Ze);pt!=null&&pt!==De.text&&(De.text=pt,De.escaped=!0),ge--,ge===0&&de()})},0))}),ge===0&&de();return}try{var Te=Qe.lex(ye,ce);return ce.walkTokens&&ke.walkTokens(Te,ce.walkTokens),gt.parse(Te,ce)}catch(De){if(De.message+=`
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+Ae(De.message+"",!0)+"</pre>";throw De}}ke.options=ke.setOptions=function(ye){return St(ke.defaults,ye),Xe(ke.defaults),ke},ke.getDefaults=Ce,ke.defaults=Je,ke.use=function(ye){var ce=St({},ye);if(ye.renderer&&function(){var ie=ke.defaults.renderer||new Le,ae=function(Te){var De=ie[Te];ie[Te]=function(){for(var Ze=arguments.length,pt=new Array(Ze),Ot=0;Ot<Ze;Ot++)pt[Ot]=arguments[Ot];var yt=ye.renderer[Te].apply(ie,pt);return yt===!1&&(yt=De.apply(ie,pt)),yt}};for(var de in ye.renderer)ae(de);ce.renderer=ie}(),ye.tokenizer&&function(){var ie=ke.defaults.tokenizer||new me,ae=function(Te){var De=ie[Te];ie[Te]=function(){for(var Ze=arguments.length,pt=new Array(Ze),Ot=0;Ot<Ze;Ot++)pt[Ot]=arguments[Ot];var yt=ye.tokenizer[Te].apply(ie,pt);return yt===!1&&(yt=De.apply(ie,pt)),yt}};for(var de in ye.tokenizer)ae(de);ce.tokenizer=ie}(),ye.walkTokens){var pe=ke.defaults.walkTokens;ce.walkTokens=function(ie){ye.walkTokens(ie),pe&&pe(ie)}}ke.setOptions(ce)},ke.walkTokens=function(ye,ce){for(var pe=j(ye),ie;!(ie=pe()).done;){var ae=ie.value;ce(ae);switch(ae.type){case"table":{for(var de=j(ae.tokens.header),ge;!(ge=de()).done;){var Te=ge.value;ke.walkTokens(Te,ce)}for(var De=j(ae.tokens.cells),Ze;!(Ze=De()).done;)for(var pt=Ze.value,Ot=j(pt),yt;!(yt=Ot()).done;){var ot=yt.value;ke.walkTokens(ot,ce)}break}case"list":{ke.walkTokens(ae.items,ce);break}default:ae.tokens&&ke.walkTokens(ae.tokens,ce)}}},ke.Parser=gt,ke.parser=gt.parse,ke.Renderer=Le,ke.TextRenderer=Me,ke.Lexer=Qe,ke.lexer=Qe.lex,ke.Tokenizer=me,ke.Slugger=qe,ke.parse=ke;var Ke=ke;return Ke})},"DlR+":function(Fe,oe,k){var Z=k("MFOe"),X=Z.Global,P=Z.trim;Fe.exports={name:"cookieStorage",read:j,write:G,each:M,remove:W,clearAll:n};var V=X.document;function j(m){if(!m||!D(m))return null;var p="(?:^|.*;\\s*)"+escape(m).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(V.cookie.replace(new RegExp(p),"$1"))}function M(m){for(var p=V.cookie.split(/; ?/g),h=p.length-1;h>=0;h--){if(!P(p[h]))continue;var c=p[h].split("="),o=unescape(c[0]),d=unescape(c[1]);m(d,o)}}function G(m,p){if(!m)return;V.cookie=escape(m)+"="+escape(p)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function W(m){if(!m||!D(m))return;V.cookie=escape(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function n(){M(function(m,p){W(p)})}function D(m){return new RegExp("(?:^|;\\s*)"+escape(m).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(V.cookie)}},EHPI:function(Fe,oe,k){"use strict";var Z=k("bbsP"),X=k("/wGt"),P=k("tJVT"),V=k("k1fw"),j=k("q1tI"),M=k.n(j),G=k("ZW9T"),W=k("ZD9Y"),n=k("M8RZ"),D=k("bCnd"),m=k("fcyK"),p=k.n(m),h={theme:Object(D.a)("cmCodeMode","vs-dark"),fontSize:Object(D.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(D.a)("cmTabToSpace",!0)},c;(function(i){i[i.set_font_size=0]="set_font_size",i[i.set_theme=1]="set_theme",i[i.on_tab_to_space=2]="on_tab_to_space",i[i.set_show_editor_setting=3]="set_show_editor_setting"})(c||(c={}));function o(i,a){switch(a.type){case c.set_show_editor_setting:return Object(V.a)(Object(V.a)({},i),{},{showEditorSetting:a.payload});case c.set_theme:return Object(V.a)(Object(V.a)({},i),{},{theme:a.payload});case c.set_font_size:return Object(V.a)(Object(V.a)({},i),{},{fontSize:a.payload});case c.on_tab_to_space:return Object(V.a)(Object(V.a)({},i),{},{tabToSpace:a.payload});default:throw new Error}}oe.a=function(i){var a=i.isLoading,r=i.value,s=i.onChange,S=i.language,w=i.ActionBarRender,x=w===void 0?function(H){return M.a.createElement(d,{onShowCodeSetting:H})}:w,L=Object(j.useReducer)(o,h),O=Object(P.a)(L,2),_=O[0],b=O[1],g=_.theme,f=_.fontSize,C=_.showEditorSetting,E=_.tabToSpace,v={onFontSizeChange:function(F){b({type:c.set_font_size,payload:F}),Object(D.b)("cmFontSize",F)},tabToSpace:E,cmFontSize:f,className:"oj",cmCodeMode:g,onTabToSpace:function(F){b({type:c.on_tab_to_space,payload:F}),Object(D.b)("cmTabToSpace",F)},onCodeModeChange:function(F){b({type:c.set_theme,payload:F}),Object(D.b)("cmCodeMode",F)}};function N(){b({type:c.set_show_editor_setting,payload:!1})}function U(){b({type:c.set_show_editor_setting,payload:!0})}var A={value:r,language:S,onChange:s,theme:g,height:"calc(100% - 56px)",options:{fontSize:f,insertSpaces:E}};return M.a.createElement(j.Fragment,null,M.a.createElement("div",{className:"code-panel-container"},x(U),!a&&M.a.createElement(G.b,A)),M.a.createElement(n.a,null,M.a.createElement(X.a,{className:"oj",title:null,placement:"right",closable:!1,visible:C,onClose:N},M.a.createElement(W.a,v))))};function d(i){var a=i.onShowCodeSetting;return M.a.createElement("div",{className:"action-bar"},M.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),M.a.createElement("a",{onClick:a},M.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(Fe,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){var X={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(o,d,i){i&&i!=Z.Init&&(o.removeKeyMap(j),o.state.closeBrackets=null),d&&(M(V(d,"pairs")),o.state.closeBrackets=d,o.addKeyMap(j))});function V(o,d){return d=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[d]!=null?o[d]:X[d]}var j={Backspace:n,Enter:D};function M(o){for(var d=0;d<o.length;d++){var i=o.charAt(d),a="'"+i+"'";j[a]||(j[a]=G(i))}}M(X.pairs+"`");function G(o){return function(d){return p(d,o)}}function W(o){var d=o.state.closeBrackets;if(!d||d.override)return d;var i=o.getModeAt(o.getCursor());return i.closeBrackets||d}function n(o){var d=W(o);if(!d||o.getOption("disableInput"))return Z.Pass;for(var i=V(d,"pairs"),a=o.listSelections(),r=0;r<a.length;r++){if(!a[r].empty())return Z.Pass;var s=h(o,a[r].head);if(!s||i.indexOf(s)%2!=0)return Z.Pass}for(var r=a.length-1;r>=0;r--){var S=a[r].head;o.replaceRange("",P(S.line,S.ch-1),P(S.line,S.ch+1),"+delete")}}function D(o){var d=W(o),i=d&&V(d,"explode");if(!i||o.getOption("disableInput"))return Z.Pass;for(var a=o.listSelections(),r=0;r<a.length;r++){if(!a[r].empty())return Z.Pass;var s=h(o,a[r].head);if(!s||i.indexOf(s)%2!=0)return Z.Pass}o.operation(function(){var S=o.lineSeparator()||`
`;o.replaceSelection(S+S,null),o.execCommand("goCharLeft"),a=o.listSelections();for(var w=0;w<a.length;w++){var x=a[w].head.line;o.indentLine(x,null,!0),o.indentLine(x+1,null,!0)}})}function m(o){var d=Z.cmpPos(o.anchor,o.head)>0;return{anchor:new P(o.anchor.line,o.anchor.ch+(d?-1:1)),head:new P(o.head.line,o.head.ch+(d?1:-1))}}function p(o,d){var i=W(o);if(!i||o.getOption("disableInput"))return Z.Pass;var a=V(i,"pairs"),r=a.indexOf(d);if(r==-1)return Z.Pass;for(var s=V(i,"closeBefore"),S=V(i,"triples"),w=a.charAt(r+1)==d,x=o.listSelections(),L=r%2==0,O,_=0;_<x.length;_++){var b=x[_],g=b.head,f,C=o.getRange(g,P(g.line,g.ch+1));if(L&&!b.empty())f="surround";else if((w||!L)&&C==d)w&&c(o,g)?f="both":S.indexOf(d)>=0&&o.getRange(g,P(g.line,g.ch+3))==d+d+d?f="skipThree":f="skip";else if(w&&g.ch>1&&S.indexOf(d)>=0&&o.getRange(P(g.line,g.ch-2),g)==d+d){if(g.ch>2&&/\bstring/.test(o.getTokenTypeAt(P(g.line,g.ch-2))))return Z.Pass;f="addFour"}else if(w){var E=g.ch==0?" ":o.getRange(P(g.line,g.ch-1),g);if(!Z.isWordChar(C)&&E!=d&&!Z.isWordChar(E))f="both";else return Z.Pass}else if(L&&(C.length===0||/\s/.test(C)||s.indexOf(C)>-1))f="both";else return Z.Pass;if(!O)O=f;else if(O!=f)return Z.Pass}var v=r%2?a.charAt(r-1):d,N=r%2?d:a.charAt(r+1);o.operation(function(){if(O=="skip")o.execCommand("goCharRight");else if(O=="skipThree")for(var U=0;U<3;U++)o.execCommand("goCharRight");else if(O=="surround"){for(var A=o.getSelections(),U=0;U<A.length;U++)A[U]=v+A[U]+N;o.replaceSelections(A,"around"),A=o.listSelections().slice();for(var U=0;U<A.length;U++)A[U]=m(A[U]);o.setSelections(A)}else O=="both"?(o.replaceSelection(v+N,null),o.triggerElectric(v+N),o.execCommand("goCharLeft")):O=="addFour"&&(o.replaceSelection(v+v+v+v,"before"),o.execCommand("goCharRight"))})}function h(o,d){var i=o.getRange(P(d.line,d.ch-1),P(d.line,d.ch+1));return i.length==2?i:null}function c(o,d){var i=o.getTokenAt(P(d.line,d.ch+1));return/\bstring/.test(i.type)&&i.start==d.ch&&(d.ch==0||!/\bstring/.test(o.getTokenTypeAt(d)))}})},FOrL:function(Fe,oe,k){Fe.exports=k.p+"static/nodata.a6b3f948.png"},FWmy:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return Z});function Z(X,P){if(!X)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},Gytx:function(Fe,oe){Fe.exports=function(Z,X,P,V){var j=P?P.call(V,Z,X):void 0;if(j!==void 0)return!!j;if(Z===X)return!0;if(typeof Z!="object"||!Z||typeof X!="object"||!X)return!1;var M=Object.keys(Z),G=Object.keys(X);if(M.length!==G.length)return!1;for(var W=Object.prototype.hasOwnProperty.bind(X),n=0;n<M.length;n++){var D=M[n];if(!W(D))return!1;var m=Z[D],p=X[D];if(j=P?P.call(V,m,p,D):void 0,j===!1||j===void 0&&m!==p)return!1}return!0}},H2Ag:function(Fe,oe,k){Fe.exports={flex_box_center:"flex_box_center___2pJkw",flex_space_between:"flex_space_between___2XyGR",flex_box_vertical_center:"flex_box_vertical_center___3RcdW",flex_box_center_end:"flex_box_center_end___ELbjB",flex_box_column:"flex_box_column___1nxOL","left-panel":"left-panel___19pOi","tab-panel-body":"tab-panel-body___1Wa4B",b1:"b1___rOGbM","oj-width-input":"oj-width-input___1L1MS","oj-mr":"oj-mr___2FJRu","s-navs":"s-navs___Rtxdn","bg-white":"bg-white___3Or1a",active:"active___x-fRG",list:"list___2RvQV",btns:"btns___FcbS4",drawer:"drawer___2L-f8"}},HmJG:function(Fe,oe,k){},I8Z2:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return V}),k.d(oe,"b",function(){return h}),k.d(oe,"c",function(){return o});var Z=k("q1tI"),X=function(){var d=function(i,a){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var S in s)s.hasOwnProperty(S)&&(r[S]=s[S])},d(i,a)};return function(i,a){d(i,a);function r(){this.constructor=i}i.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}(),P=Z.createContext(null),V=function(d){X(i,d);function i(){return d!==null&&d.apply(this,arguments)||this}return i.prototype.render=function(){return Z.createElement(P.Provider,{value:this.props.store},this.props.children)},i}(Z.Component),j=k("Gytx"),M=k.n(j),G=k("2mql"),W=k.n(G),n=function(){var d=function(i,a){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var S in s)s.hasOwnProperty(S)&&(r[S]=s[S])},d(i,a)};return function(i,a){d(i,a);function r(){this.constructor=i}i.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}(),D=function(){return D=Object.assign||function(d){for(var i,a=1,r=arguments.length;a<r;a++){i=arguments[a];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(d[s]=i[s])}return d},D.apply(this,arguments)};function m(d){return d.displayName||d.name||"Component"}var p=function(){return{}};function h(d,i){i===void 0&&(i={});var a=!!d,r=d||p;return function(S){var w=function(L){n(O,L);function O(_,b){var g=L.call(this,_,b)||this;return g.unsubscribe=null,g.handleChange=function(){if(!g.unsubscribe)return;var f=r(g.store.getState(),g.props);g.setState({subscribed:f})},g.store=g.context,g.state={subscribed:r(g.store.getState(),_),store:g.store,props:_},g}return O.getDerivedStateFromProps=function(_,b){return d&&d.length===2&&_!==b.props?{subscribed:r(b.store.getState(),_),props:_}:{props:_}},O.prototype.componentDidMount=function(){this.trySubscribe()},O.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},O.prototype.shouldComponentUpdate=function(_,b){return!M()(this.props,_)||!M()(this.state.subscribed,b.subscribed)},O.prototype.trySubscribe=function(){a&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},O.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},O.prototype.render=function(){var _=D(D(D({},this.props),this.state.subscribed),{store:this.store});return Z.createElement(S,D({},_,{ref:this.props.miniStoreForwardedRef}))},O.displayName="Connect("+m(S)+")",O.contextType=P,O}(Z.Component);if(i.forwardRef){var x=Z.forwardRef(function(L,O){return Z.createElement(w,D({},L,{miniStoreForwardedRef:O}))});return W()(x,S)}return W()(w,S)}}var c=function(){return c=Object.assign||function(d){for(var i,a=1,r=arguments.length;a<r;a++){i=arguments[a];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(d[s]=i[s])}return d},c.apply(this,arguments)};function o(d){var i=d,a=[];function r(w){i=c(c({},i),w);for(var x=0;x<a.length;x++)a[x]()}function s(){return i}function S(w){return a.push(w),function(){var L=a.indexOf(w);a.splice(L,1)}}return{setState:r,getState:s,subscribe:S}}},IBYe:function(Fe,oe,k){"use strict";function Z(X){return null}oe.a=Z},IxHN:function(Fe,oe,k){"use strict";var Z=k("q1tI"),X=k.n(Z),P=k("07cG"),V=k.n(P);oe.a=function(j){var M=j.message,G=j.className,W=j.children,n=j.style,D=n===void 0?{}:n;return X.a.createElement("div",{className:"".concat(V.a.idsRingWrapper," ").concat(G)},X.a.createElement("div",{className:V.a.ldsRing},X.a.createElement("div",null),X.a.createElement("div",null),X.a.createElement("div",null),X.a.createElement("div",null)),M?X.a.createElement("p",{style:D},M):null,W)}},J66h:function(Fe,oe,k){(function(Z){var X,P;(function(V,j){Fe.exports=j(V)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Z!="undefined"?Z:this,function(V){"use strict";V=V||{};var j=V.Base64,M="2.6.4",G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",W=function(v){for(var N={},U=0,A=v.length;U<A;U++)N[v.charAt(U)]=U;return N}(G),n=String.fromCharCode,D=function(v){if(v.length<2){var N=v.charCodeAt(0);return N<128?v:N<2048?n(192|N>>>6)+n(128|N&63):n(224|N>>>12&15)+n(128|N>>>6&63)+n(128|N&63)}else{var N=65536+(v.charCodeAt(0)-55296)*1024+(v.charCodeAt(1)-56320);return n(240|N>>>18&7)+n(128|N>>>12&63)+n(128|N>>>6&63)+n(128|N&63)}},m=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(v){return v.replace(m,D)},h=function(v){var N=[0,2,1][v.length%3],U=v.charCodeAt(0)<<16|(v.length>1?v.charCodeAt(1):0)<<8|(v.length>2?v.charCodeAt(2):0),A=[G.charAt(U>>>18),G.charAt(U>>>12&63),N>=2?"=":G.charAt(U>>>6&63),N>=1?"=":G.charAt(U&63)];return A.join("")},c=V.btoa&&typeof V.btoa=="function"?function(v){return V.btoa(v)}:function(v){if(v.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return v.replace(/[\s\S]{1,3}/g,h)},o=function(v){return c(p(String(v)))},d=function(v){return v.replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,"")},i=function(v,N){return N?d(o(v)):o(v)},a=function(v){return i(v,!0)},r;V.Uint8Array&&(r=function(v,N){for(var U="",A=0,H=v.length;A<H;A+=3){var F=v[A],T=v[A+1],z=v[A+2],Q=F<<16|T<<8|z;U+=G.charAt(Q>>>18)+G.charAt(Q>>>12&63)+(typeof T!="undefined"?G.charAt(Q>>>6&63):"=")+(typeof z!="undefined"?G.charAt(Q&63):"=")}return N?d(U):U});var s=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=function(v){switch(v.length){case 4:var N=(7&v.charCodeAt(0))<<18|(63&v.charCodeAt(1))<<12|(63&v.charCodeAt(2))<<6|63&v.charCodeAt(3),U=N-65536;return n((U>>>10)+55296)+n((U&1023)+56320);case 3:return n((15&v.charCodeAt(0))<<12|(63&v.charCodeAt(1))<<6|63&v.charCodeAt(2));default:return n((31&v.charCodeAt(0))<<6|63&v.charCodeAt(1))}},w=function(v){return v.replace(s,S)},x=function(v){var N=v.length,U=N%4,A=(N>0?W[v.charAt(0)]<<18:0)|(N>1?W[v.charAt(1)]<<12:0)|(N>2?W[v.charAt(2)]<<6:0)|(N>3?W[v.charAt(3)]:0),H=[n(A>>>16),n(A>>>8&255),n(A&255)];return H.length-=[0,0,2,1][U],H.join("")},L=V.atob&&typeof V.atob=="function"?function(v){return V.atob(v)}:function(v){return v.replace(/\S{1,4}/g,x)},O=function(v){return L(String(v).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(v){return w(L(v))},b=function(v){return String(v).replace(/[-_]/g,function(N){return N=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},g=function(v){return _(b(v))},f;V.Uint8Array&&(f=function(v){return Uint8Array.from(O(b(v)),function(N){return N.charCodeAt(0)})});var C=function(){var v=V.Base64;return V.Base64=j,v};if(V.Base64={VERSION:M,atob:O,btoa:c,fromBase64:g,toBase64:i,utob:p,encode:i,encodeURI:a,btou:w,decode:g,noConflict:C,fromUint8Array:r,toUint8Array:f},typeof Object.defineProperty=="function"){var E=function(v){return{value:v,enumerable:!1,writable:!0,configurable:!0}};V.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",E(function(){return g(this)})),Object.defineProperty(String.prototype,"toBase64",E(function(v){return i(this,v)})),Object.defineProperty(String.prototype,"toBase64URI",E(function(){return i(this,!0)}))}}return V.Meteor&&(Base64=V.Base64),Fe.exports?Fe.exports.Base64=V.Base64:!(X=[],P=function(){return V.Base64}.apply(oe,X),P!==void 0&&(Fe.exports=P)),{Base64:V.Base64}})}).call(this,k("IyRk"))},JB8y:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return Z});var Z;(function(X){X[X.NOMATCH=-1]="NOMATCH",X[X.OK=0]="OK",X[X.TIMEOUT=2]="TIMEOUT",X[X.PODFAILURE=3]="PODFAILURE",X[X.COMPILEFAILURE=4]="COMPILEFAILURE",X[X.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(Z||(Z={}))},JPnl:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return b}),k.d(oe,"c",function(){return C});var Z=k("+L6B"),X=k("2/Rp"),P=k("tJVT"),V=k("9og8"),j=k("k1fw"),M=k("jrin"),G=k("5NDa"),W=k("5rEg"),n=k("WmNS"),D=k.n(n),m=k("q1tI"),p=k.n(m),h=k("8Skl"),c=k("y3Kf"),o=k("JB8y"),d=k("J66h"),i=k.n(d),a=k("a4uL"),r=k.n(a),s=k("IxHN"),S=k("9Bee"),w=k("1vsH"),x=k("ErOA"),L,O=W.a.TextArea,_={visible:!1,tabIndex:"0"},b=(L={},Object(M.a)(L,o.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(M.a)(L,o.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(M.a)(L,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(M.a)(L,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(M.a)(L,4,"\u7F16\u8BD1\u5931\u8D25"),Object(M.a)(L,5,"\u6267\u884C\u5931\u8D25"),L),g;(function(v){v[v.SET_VISIBLE=0]="SET_VISIBLE",v[v.SET_TABINDEX=1]="SET_TABINDEX"})(g||(g={}));function f(v,N){switch(N.type){case g.SET_VISIBLE:return Object(j.a)(Object(j.a)({},v),{},{visible:N.payload});case g.SET_TABINDEX:return Object(j.a)(Object(j.a)({},v),{},{tabIndex:N.payload});default:throw new Error}}function C(v){var N=v.status,U=v.error_msg,A=v.output,H=v.input,F=v.expected_output,T=v.is_file,z=v.input_file_url,Q=v.output_file_url,ne=v.expected_output_file_url,se=v.setMonacoValue,xe=v.setData,me=null,ve={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(N){case o.a.NOMATCH:me=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!T&&p.a.createElement(S.a,{value:H,style:ve}),T&&p.a.createElement("div",{style:ve},p.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(D.a.mark(function Oe(){var Re;return D.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,fetch(z,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return Re=ue.sent,ue.t0=se,ue.next=6,Re.text();case 6:ue.t1=ue.sent,(0,ue.t0)(ue.t1),setTimeout(function(){xe(z)},200);case 9:case"end":return ue.stop()}},Oe)}))},H)),p.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!T&&p.a.createElement(S.a,{value:A&&d.Base64.decode(A)||"",style:ve}),T&&p.a.createElement("div",{style:ve},p.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(D.a.mark(function Oe(){var Re;return D.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,Object(x.a)(Q,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:Re=ue.sent,se(Re),setTimeout(function(){xe(Q)},200);case 5:case"end":return ue.stop()}},Oe)}))},A)),p.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!T&&p.a.createElement(S.a,{value:F&&d.Base64.decode(F)||"",style:ve}),T&&p.a.createElement("div",{style:ve},p.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(D.a.mark(function Oe(){var Re;return D.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,fetch(ne,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return Re=ue.sent,ue.t0=se,ue.next=6,Re.text();case 6:ue.t1=ue.sent,(0,ue.t0)(ue.t1),setTimeout(function(){xe(ne)},200);case 9:case"end":return ue.stop()}},Oe)}))},F)));break;case o.a.EXECUTEFAILURE:me=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!T&&p.a.createElement(S.a,{value:H,style:ve}),T&&p.a.createElement("div",{style:ve},p.a.createElement("a",{onClick:function(){return Object(w.A)(z,H)}},H)),p.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.a.createElement("pre",{className:"error"},d.Base64.decode(U)));break;case o.a.COMPILEFAILURE:me=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!T&&p.a.createElement(S.a,{value:H,style:ve}),T&&p.a.createElement("div",{style:ve},p.a.createElement("a",{onClick:function(){return Object(w.A)(z,H)}},H)),p.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.a.createElement("pre",{className:"error"},d.Base64.decode(U)));break;case o.a.PODFAILURE:me=p.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:me=p.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return p.a.createElement(p.a.Fragment,null," ",me," ")}function E(v){var N=v.status,U=v.error_msg,A=v.execute_time,H=v.output,F=v.input,T=v.expected_output,z=v.is_file,Q=v.input_file_url,ne=v.output_file_url,se=v.expected_output_file_url,xe=null;switch(N){case o.a.OK:xe=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",A,"ms"),p.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),p.a.createElement("pre",null,d.Base64.decode(H)));break;case o.a.NOMATCH:xe=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u8F93\u5165\uFF1A",p.a.createElement("pre",null,F)),p.a.createElement("p",null,"\u8F93\u51FA\uFF1A",H&&d.Base64.decode(H)),p.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",T&&d.Base64.decode(T)));break;case o.a.EXECUTEFAILURE:xe=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",p.a.createElement("pre",null,F)),p.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.a.createElement("pre",{className:"error"},d.Base64.decode(U)));break;case o.a.COMPILEFAILURE:xe=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",p.a.createElement("pre",null,F)),p.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.a.createElement("pre",{className:"error"},d.Base64.decode(U)));break;case o.a.PODFAILURE:xe=p.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:xe=p.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return p.a.createElement(p.a.Fragment,null," ",xe," ")}oe.b=function(v){var N=v.input,U=v.debuging,A=v.submitting,H=v.executingMessage,F=v.debugResult,T=v.onChangeInput,z=v.onDebugCode,Q=v.onSubmitCode,ne=v.hack,se=v.user,xe=Object(m.useReducer)(f,_),me=Object(P.a)(xe,2),ve=me[0],Oe=me[1],Re=ve.visible,fe=ve.tabIndex;function ue(it){var ze=it.target.id;Oe({type:g.SET_TABINDEX,payload:ze})}function Pe(){Oe({type:g.SET_VISIBLE,payload:!Re})}var et=Object(m.useMemo)(function(){if(F){var it=F.status;return p.a.createElement(p.a.Fragment,null,E(F))}return null},[F]);function rt(){Oe({type:g.SET_VISIBLE,payload:!0}),Oe({type:g.SET_TABINDEX,payload:"1"}),z()}var tt=function(){var it=Object(V.a)(D.a.mark(function ze(Qe){var at;return D.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,Object(x.a)("/api/problems/".concat(Qe,"/start.json"),{method:"get",params:{hack_user_id:se==null?void 0:se.user_id}});case 2:at=Se.sent,at&&(window.location.href="/myproblems/".concat(at==null?void 0:at.identifier,"?type=1"));case 4:case"end":return Se.stop()}},ze)}));return function(Qe){return it.apply(this,arguments)}}();return p.a.createElement("div",{className:"test-case-panel"},p.a.createElement("div",{className:"test-case-panel-body ".concat(Re?"active":"")},p.a.createElement("ul",{className:"s-navs"},p.a.createElement("li",null,p.a.createElement("a",{className:fe==="0"?"active":"",id:"0",onClick:ue},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),p.a.createElement("li",null,p.a.createElement("a",{className:fe==="1"?"active":"",id:"1",onClick:ue},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),p.a.createElement("div",{className:"tab-panel-body ".concat(fe==="0"?"":"hide")},p.a.createElement(O,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:N,onChange:T})),p.a.createElement("div",{className:"tab-panel-body ".concat(fe==="1"?"":"hide")},U?p.a.createElement(s.a,{message:H}):F?p.a.createElement("section",{style:{height:200}}," ",et," "):p.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),p.a.createElement("a",{className:"btn-collapse ".concat(Re?"up":""),onClick:Pe},Re?p.a.createElement(h.a,null):p.a.createElement(c.a,null)),p.a.createElement("footer",{className:"footer"},p.a.createElement("span",null,"\u63A7\u5236\u53F0"),p.a.createElement("div",{className:"flex-container"},(ne==null?void 0:ne.is_program)&&(ne==null?void 0:ne.above_question)&&p.a.createElement(X.a,{onClick:function(){return tt(ne==null?void 0:ne.above_question)},id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),(ne==null?void 0:ne.is_program)&&(ne==null?void 0:ne.under_question)&&p.a.createElement(X.a,{onClick:function(){return tt(ne==null?void 0:ne.under_question)},id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),p.a.createElement(X.a,{className:"btn-green",type:"ghost",loading:U,onClick:rt},"\u8C03\u8BD5\u4EE3\u7801"),p.a.createElement(X.a,{type:"primary",loading:A,disabled:A,onClick:function(){Oe({type:g.SET_VISIBLE,payload:!1}),Q()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},JYp7:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return Z});var Z;(function(X){function P(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}X.is=P;const V=Object.freeze([]);function j(){return V}X.empty=j;function*M(s){yield s}X.single=M;function G(s){return s||V}X.from=G;function W(s){return!s||s[Symbol.iterator]().next().done===!0}X.isEmpty=W;function n(s){return s[Symbol.iterator]().next().value}X.first=n;function D(s,S){for(const w of s)if(S(w))return!0;return!1}X.some=D;function m(s,S){for(const w of s)if(S(w))return w;return}X.find=m;function*p(s,S){for(const w of s)S(w)&&(yield w)}X.filter=p;function*h(s,S){let w=0;for(const x of s)yield S(x,w++)}X.map=h;function*c(...s){for(const S of s)for(const w of S)yield w}X.concat=c;function*o(s){for(const S of s)for(const w of S)yield w}X.concatNested=o;function d(s,S,w){let x=w;for(const L of s)x=S(x,L);return x}X.reduce=d;function*i(s,S,w=s.length){for(S<0&&(S+=s.length),w<0?w+=s.length:w>s.length&&(w=s.length);S<w;S++)yield s[S]}X.slice=i;function a(s,S=Number.POSITIVE_INFINITY){const w=[];if(S===0)return[w,s];const x=s[Symbol.iterator]();for(let L=0;L<S;L++){const O=x.next();if(O.done)return[w,X.empty()];w.push(O.value)}return[w,{[Symbol.iterator](){return x}}]}X.consume=a;function r(s,S,w=(x,L)=>x===L){const x=s[Symbol.iterator](),L=S[Symbol.iterator]();for(;;){const O=x.next(),_=L.next();if(O.done!==_.done)return!1;if(O.done)return!0;if(!w(O.value,_.value))return!1}}X.equals=r})(Z||(Z={}))},LdHM:function(Fe,oe,k){"use strict";k.d(oe,"b",function(){return s}),k.d(oe,"a",function(){return w});var Z=k("1OyB"),X=k("vuIU"),P=k("Ji7U"),V=k("LK+K"),j=k("q1tI"),M=k("rePB"),G=k("Ff2n"),W=k("ODXe"),n=k("4IlW"),D=k("bX4T"),m=k("YrtM"),p=k("TSYQ"),h=k.n(p),c=k("+nKL"),o=k("8OUc"),d=function(z,Q){var ne=z.prefixCls,se=z.id,xe=z.flattenOptions,me=z.childrenAsData,ve=z.values,Oe=z.searchValue,Re=z.multiple,fe=z.defaultActiveFirstOption,ue=z.height,Pe=z.itemHeight,et=z.notFoundContent,rt=z.open,tt=z.menuItemSelectedIcon,it=z.virtual,ze=z.onSelect,Qe=z.onToggleOpen,at=z.onActiveValue,he=z.onScroll,Se=z.onMouseEnter,Le="".concat(ne,"-item"),Me=Object(m.a)(function(){return xe},[rt,xe],function(Ke,ye){return ye[0]&&Ke[1]!==ye[1]}),qe=j.useRef(null),st=function(ye){ye.preventDefault()},mt=function(ye){qe.current&&qe.current.scrollTo({index:ye})},gt=function(ye){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,pe=Me.length,ie=0;ie<pe;ie+=1){var ae=(ye+ie*ce+pe)%pe,de=Me[ae],ge=de.group,Te=de.data;if(!ge&&!Te.disabled)return ae}return-1},St=j.useState(function(){return gt(0)}),Et=Object(W.a)(St,2),Ae=Et[0],Ce=Et[1],Xe=function(ye){Ce(ye);var ce=Me[ye];if(!ce){at(null,-1);return}at(ce.data.value,ye)};j.useEffect(function(){Xe(fe!==!1?gt(0):-1)},[Me.length,Oe]),j.useEffect(function(){var Ke=setTimeout(function(){if(!Re&&rt&&ve.size===1){var ye=Array.from(ve)[0],ce=Me.findIndex(function(pe){var ie=pe.data;return ie.value===ye});Xe(ce),mt(ce)}});return function(){return clearTimeout(Ke)}},[rt]);var Je=function(ye){ye!==void 0&&ze(ye,{selected:!ve.has(ye)}),Re||Qe(!1)};if(j.useImperativeHandle(Q,function(){return{onKeyDown:function(ye){var ce=ye.which;switch(ce){case n.a.UP:case n.a.DOWN:{var pe=0;if(ce===n.a.UP?pe=-1:ce===n.a.DOWN&&(pe=1),pe!==0){var ie=gt(Ae+pe,pe);mt(ie),Xe(ie)}break}case n.a.ENTER:{var ae=Me[Ae];ae&&!ae.data.disabled?Je(ae.data.value):Je(void 0),rt&&ye.preventDefault();break}case n.a.ESC:Qe(!1)}},onKeyUp:function(){},scrollTo:function(ye){mt(ye)}}}),Me.length===0)return j.createElement("div",{role:"listbox",id:"".concat(se,"_list"),className:"".concat(Le,"-empty"),onMouseDown:st},et);function ke(Ke){var ye=Me[Ke];if(!ye)return null;var ce=ye.data||{},pe=ce.value,ie=ce.label,ae=ce.children,de=Object(D.a)(ce,!0),ge=me?ae:ie;return ye?j.createElement("div",Object.assign({"aria-label":typeof ge=="string"?ge:null},de,{key:Ke,role:"option",id:"".concat(se,"_list_").concat(Ke),"aria-selected":ve.has(pe)}),pe):null}return j.createElement(j.Fragment,null,j.createElement("div",{role:"listbox",id:"".concat(se,"_list"),style:{height:0,width:0,overflow:"hidden"}},ke(Ae-1),ke(Ae),ke(Ae+1)),j.createElement(c.a,{itemKey:"key",ref:qe,data:Me,height:ue,itemHeight:Pe,fullHeight:!1,onMouseDown:st,onScroll:he,virtual:it,onMouseEnter:Se},function(Ke,ye){var ce,pe=Ke.group,ie=Ke.groupOption,ae=Ke.data,de=ae.label,ge=ae.key;if(pe)return j.createElement("div",{className:h()(Le,"".concat(Le,"-group"))},de!==void 0?de:ge);var Te=ae.disabled,De=ae.value,Ze=ae.title,pt=ae.children,Ot=ae.style,yt=ae.className,ot=Object(G.a)(ae,["disabled","value","title","children","style","className"]),He=ve.has(De),Ge="".concat(Le,"-option"),Ue=h()(Le,Ge,yt,(ce={},Object(M.a)(ce,"".concat(Ge,"-grouped"),ie),Object(M.a)(ce,"".concat(Ge,"-active"),Ae===ye&&!Te),Object(M.a)(ce,"".concat(Ge,"-disabled"),Te),Object(M.a)(ce,"".concat(Ge,"-selected"),He),ce)),le=me?pt:de,_e=!tt||typeof tt=="function"||He;return j.createElement("div",Object.assign({},ot,{"aria-selected":He,className:Ue,title:Ze,onMouseMove:function(){if(Ae===ye||Te)return;Xe(ye)},onClick:function(){Te||Je(De)},style:Ot}),j.createElement("div",{className:"".concat(Ge,"-content")},le||De),j.isValidElement(tt)||He,_e&&j.createElement(o.a,{className:"".concat(Le,"-option-state"),customizeIcon:tt,customizeIconProps:{isSelected:He}},He?"\u2713":null))}))},i=j.forwardRef(d);i.displayName="OptionList";var a=i,r=function(){return null};r.isSelectOption=!0;var s=r,S=function(){return null};S.isSelectOptGroup=!0;var w=S,x=k("VTBJ"),L=k("Zm9Q");function O(T){var z=T.key,Q=T.props,ne=Q.children,se=Q.value,xe=Object(G.a)(Q,["children","value"]);return Object(x.a)({key:z,value:se!==void 0?se:z,children:ne},xe)}function _(T){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(T).map(function(Q,ne){if(!j.isValidElement(Q)||!Q.type)return null;var se=Q.type.isSelectOptGroup,xe=Q.key,me=Q.props,ve=me.children,Oe=Object(G.a)(me,["children"]);return z||!se?O(Q):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(xe===null?ne:xe,"__"),label:xe},Oe),{},{options:_(ve)})}).filter(function(Q){return Q})}var b=k("2Qr1"),g=k("qNPg"),f=k("U8pU"),C=k("Kwbf"),E=k("WKfj");function v(T){var z=T.mode,Q=T.options,ne=T.children,se=T.backfill,xe=T.allowClear,me=T.placeholder,ve=T.getInputElement,Oe=T.showSearch,Re=T.onSearch,fe=T.defaultOpen,ue=T.autoFocus,Pe=T.labelInValue,et=T.value,rt=T.inputValue,tt=T.optionLabelProp,it=z==="multiple"||z==="tags",ze=Oe!==void 0?Oe:it||z==="combobox",Qe=Q||_(ne);if(Object(C.a)(z!=="tags"||Qe.every(function(Le){return!Le.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var at=Qe.some(function(Le){return Le.options?Le.options.some(function(Me){return typeof("value"in Me?Me.value:Me.key)=="number"}):typeof("value"in Le?Le.value:Le.key)=="number"});Object(C.a)(!at,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(z!=="combobox"||!tt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(z==="combobox"||!se,"`backfill` only works with `combobox` mode."),Object(C.a)(z==="combobox"||!ve,"`getInputElement` only work with `combobox` mode."),Object(C.b)(z!=="combobox"||!ve||!xe||!me,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Re&&!ze&&z!=="combobox"&&z!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!fe||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),et!=null){var he=Object(E.d)(et);Object(C.a)(!Pe||he.every(function(Le){return Object(f.a)(Le)==="object"&&("key"in Le||"value"in Le)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!it||Array.isArray(et),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var Se=null;Object(L.a)(ne).some(function(Le){if(!j.isValidElement(Le)||!Le.type)return!1;var Me=Le.type;if(Me.isSelectOption)return!1;if(Me.isSelectOptGroup){var qe=Object(L.a)(Le.props.children).every(function(st){return!j.isValidElement(st)||!Le.type||st.type.isSelectOption?!0:(Se=st.type,!1)});return!qe}return Se=Me,!0}),Se&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Se.displayName||Se.name||Se,"`.")),Object(C.a)(rt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=v,U=Object(g.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:_,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:N,fillOptionsWithMissingValue:b.a}),A=function(T){Object(P.a)(Q,T);var z=Object(V.a)(Q);function Q(){var ne;return Object(Z.a)(this,Q),ne=z.apply(this,arguments),ne.selectRef=j.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(X.a)(Q,[{key:"render",value:function(){return j.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),Q}(j.Component);A.Option=s,A.OptGroup=w;var H=A,F=oe.c=H},M8RZ:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return n});var Z=k("fWQN"),X=k("mtLc"),P=k("yKVA"),V=k("879j"),j=k("q1tI"),M=k.n(j),G=k("i8i4"),W=k.n(G),n=function(D){Object(P.a)(p,D);var m=Object(V.a)(p);function p(h){var c;Object(Z.a)(this,p),c=m.call(this,h);var o=window.document;return c.node=o.createElement("div"),o.body.appendChild(c.node),c}return Object(X.a)(p,[{key:"render",value:function(){var c=this.props.children;return Object(G.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(M.a.Component)},MFOe:function(Fe,oe,k){(function(Z){var X=M(),P=G(),V=W(),j=typeof window!="undefined"?window:Z;Fe.exports={assign:X,create:P,trim:V,bind:n,slice:D,each:m,map:p,pluck:h,isList:c,isFunction:o,isObject:d,Global:j};function M(){return Object.assign?Object.assign:function(a,r,s,S){for(var w=1;w<arguments.length;w++)m(Object(arguments[w]),function(x,L){a[L]=x});return a}}function G(){if(Object.create)return function(r,s,S,w){var x=D(arguments,1);return X.apply(this,[Object.create(r)].concat(x))};{function i(){}return function(r,s,S,w){var x=D(arguments,1);return i.prototype=r,X.apply(this,[new i].concat(x))}}}function W(){return String.prototype.trim?function(a){return String.prototype.trim.call(a)}:function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function n(i,a){return function(){return a.apply(i,Array.prototype.slice.call(arguments,0))}}function D(i,a){return Array.prototype.slice.call(i,a||0)}function m(i,a){h(i,function(r,s){return a(r,s),!1})}function p(i,a){var r=c(i)?[]:{};return h(i,function(s,S){return r[S]=a(s,S),!1}),r}function h(i,a){if(c(i)){for(var r=0;r<i.length;r++)if(a(i[r],r))return i[r]}else for(var s in i)if(i.hasOwnProperty(s)&&a(i[s],s))return i[s]}function c(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function o(i){return i&&{}.toString.call(i)==="[object Function]"}function d(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,k("IyRk"))},MI8n:function(Fe,oe,k){"use strict";k.d(oe,"c",function(){return j}),k.d(oe,"b",function(){return n}),k.d(oe,"e",function(){return D}),k.d(oe,"a",function(){return m}),k.d(oe,"d",function(){return p}),k.d(oe,"f",function(){return h});var Z=k("/cxE"),X=k("pmY6"),P=k("24hK"),V=k("5Y4S"),j;(function(c){c.None=()=>X.a.None;function o(v){return(N,U=null,A)=>{let H=!1,F;return F=v(T=>H?void 0:(F?F.dispose():H=!0,N.call(U,T)),null,A),H&&F.dispose(),F}}c.once=o;function d(v,N){return w((U,A=null,H)=>v(F=>U.call(A,N(F)),null,H))}c.map=d;function i(v,N){return w((U,A=null,H)=>v(F=>{N(F),U.call(A,F)},null,H))}c.forEach=i;function a(v,N){return w((U,A=null,H)=>v(F=>N(F)&&U.call(A,F),null,H))}c.filter=a;function r(v){return v}c.signal=r;function s(...v){return(N,U=null,A)=>Object(X.e)(...v.map(H=>H(F=>N.call(U,F),null,A)))}c.any=s;function S(v,N,U){let A=U;return d(v,H=>(A=N(A,H),A))}c.reduce=S;function w(v){let N;const U=new n({onFirstListenerAdd(){N=v(U.fire,U)},onLastListenerRemove(){N.dispose()}});return U.event}function x(v,N,U=100,A=!1,H){let F,T,z,Q=0;const ne=new n({leakWarningThreshold:H,onFirstListenerAdd(){F=v(se=>{Q++,T=N(T,se),A&&!z&&(ne.fire(T),T=void 0),clearTimeout(z),z=setTimeout(()=>{const xe=T;T=void 0,z=void 0,(!A||Q>1)&&ne.fire(xe),Q=0},U)})},onLastListenerRemove(){F.dispose()}});return ne.event}c.debounce=x;function L(v,N=(U,A)=>U===A){let U=!0,A;return a(v,H=>{const F=U||!N(H,A);return U=!1,A=H,F})}c.latch=L;function O(v,N){return[c.filter(v,N),c.filter(v,U=>!N(U))]}c.split=O;function _(v,N=!1,U=[]){let A=U.slice(),H=v(z=>{A?A.push(z):T.fire(z)});const F=()=>{A&&A.forEach(z=>T.fire(z)),A=null},T=new n({onFirstListenerAdd(){H||(H=v(z=>T.fire(z)))},onFirstListenerDidAdd(){A&&(N?setTimeout(F):F())},onLastListenerRemove(){H&&H.dispose(),H=null}});return T.event}c.buffer=_;class b{constructor(v){this.event=v}map(v){return new b(d(this.event,v))}forEach(v){return new b(i(this.event,v))}filter(v){return new b(a(this.event,v))}reduce(v,N){return new b(S(this.event,v,N))}latch(){return new b(L(this.event))}debounce(v,N=100,U=!1,A){return new b(x(this.event,v,N,U,A))}on(v,N,U){return this.event(v,N,U)}once(v,N,U){return o(this.event)(v,N,U)}}function g(v){return new b(v)}c.chain=g;function f(v,N,U=A=>A){const A=(...z)=>T.fire(U(...z)),H=()=>v.on(N,A),F=()=>v.removeListener(N,A),T=new n({onFirstListenerAdd:H,onLastListenerRemove:F});return T.event}c.fromNodeEventEmitter=f;function C(v,N,U=A=>A){const A=(...z)=>T.fire(U(...z)),H=()=>v.addEventListener(N,A),F=()=>v.removeEventListener(N,A),T=new n({onFirstListenerAdd:H,onLastListenerRemove:F});return T.event}c.fromDOMEventEmitter=C;function E(v){return new Promise(N=>o(v)(N))}c.toPromise=E})(j||(j={}));class M{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${M._idPool++}`}start(c){this._stopWatch=new V.a(!0),this._listenerCount=c}stop(){if(this._stopWatch){const c=this._stopWatch.elapsed();this._elapsedOverall+=c,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${c.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}M._idPool=0;let G=-1;class W{constructor(c,o=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let o=G;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||c<o)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
`).slice(3).join(`
`),i=this._stacks.get(d)||0;if(this._stacks.set(d,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let a,r=0;for(const[s,S]of this._stacks)(!a||r<S)&&(a=s,r=S);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${r}):`),console.warn(a)}return()=>{const a=this._stacks.get(d)||0;this._stacks.set(d,a-1)}}}class n{constructor(c){var o;this._disposed=!1,this._options=c,this._leakageMon=G>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new M(this._options._profName):void 0}get event(){return this._event||(this._event=(c,o,d)=>{var i;this._listeners||(this._listeners=new P.a);const a=this._listeners.isEmpty();a&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(o?[c,o]:c);a&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,o);const s=(i=this._leakageMon)===null||i===void 0?void 0:i.check(this._listeners.size),S=Object(X.i)(()=>{if(s&&s(),!this._disposed&&(r(),this._options&&this._options.onLastListenerRemove)){const w=this._listeners&&!this._listeners.isEmpty();w||this._options.onLastListenerRemove(this)}});return d instanceof X.b?d.add(S):Array.isArray(d)&&d.push(S),S}),this._event}fire(c){var o,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let i of this._listeners)this._deliveryQueue.push([i,c]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,a]=this._deliveryQueue.shift();try{typeof i=="function"?i.call(void 0,a):i[0].call(i[1],a)}catch(r){Object(Z.f)(r)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var c,o,d,i,a;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(i=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||i===void 0||i.call(d),(a=this._leakageMon)===null||a===void 0||a.dispose())}}class D extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=c==null?void 0:c.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const c=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(c))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(c){this._listeners&&(this._isPaused!==0?this._eventQueue.push(c):super.fire(c))}}class m extends D{constructor(c){var o;super(c);this._delay=(o=c.delay)!==null&&o!==void 0?o:100}fire(c){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(c)}}class p{constructor(){this.buffers=[]}wrapEvent(c){return(o,d,i)=>c(a=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>o.call(d,a)):o.call(d,a)},void 0,i)}bufferEvents(c){const o=[];this.buffers.push(o);const d=c();return this.buffers.pop(),o.forEach(i=>i()),d}}class h{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=X.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(c){this.inputEvent=c,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=c(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Fe,oe,k){"use strict";(function(Z,X){k.d(oe,"b",function(){return d}),k.d(oe,"i",function(){return s}),k.d(oe,"f",function(){return S}),k.d(oe,"d",function(){return w}),k.d(oe,"g",function(){return x}),k.d(oe,"h",function(){return L}),k.d(oe,"c",function(){return O}),k.d(oe,"k",function(){return _}),k.d(oe,"j",function(){return b}),k.d(oe,"a",function(){return g}),k.d(oe,"e",function(){return E});var P;const V="en";let j=!1,M=!1,G=!1,W=!1,n=!1,D=!1,m=!1,p,h=V,c,o;const d=typeof self=="object"?self:typeof Z=="object"?Z:{};let i;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?i=d.vscode.process:typeof X!="undefined"&&(i=X);const a=typeof((P=i==null?void 0:i.versions)===null||P===void 0?void 0:P.electron)=="string"&&i.type==="renderer";if(typeof navigator=="object"&&!a)o=navigator.userAgent,j=o.indexOf("Windows")>=0,M=o.indexOf("Macintosh")>=0,m=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=o.indexOf("Linux")>=0,D=!0,p=navigator.language,h=p;else if(typeof i=="object"){j=i.platform==="win32",M=i.platform==="darwin",G=i.platform==="linux",W=G&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,p=V,h=V;const v=i.env.VSCODE_NLS_CONFIG;if(v)try{const N=JSON.parse(v),U=N.availableLanguages["*"];p=N.locale,h=U||V,c=N._translationsConfigFile}catch(N){}n=!0}else console.error("Unable to resolve platform.");let r=0;M?r=1:j?r=3:G&&(r=2);const s=j,S=M,w=G,x=n,L=D,O=m,_=o,b=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let U=[];d.addEventListener("message",H=>{if(H.data&&H.data.vscodeSetImmediateId)for(let F=0,T=U.length;F<T;F++){const z=U[F];if(z.id===H.data.vscodeSetImmediateId){U.splice(F,1),z.callback();return}}});let A=0;return H=>{const F=++A;U.push({id:F,callback:H}),d.postMessage({vscodeSetImmediateId:F},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const N=Promise.resolve();return U=>N.then(U)}(),g=M||m?2:j?1:3;let f=!0,C=!1;function E(){if(!C){C=!0;const v=new Uint8Array(2);v[0]=1,v[1]=2;const N=new Uint16Array(v.buffer);f=N[0]===(2<<8)+1}return f}}).call(this,k("IyRk"),k("Q2Ig"))},N0LK:function(Fe,oe,k){"use strict";k.d(oe,"C",function(){return Z}),k.d(oe,"v",function(){return P}),k.d(oe,"s",function(){return V}),k.d(oe,"t",function(){return j}),k.d(oe,"U",function(){return M}),k.d(oe,"J",function(){return G}),k.d(oe,"O",function(){return W}),k.d(oe,"p",function(){return n}),k.d(oe,"T",function(){return D}),k.d(oe,"q",function(){return m}),k.d(oe,"N",function(){return p}),k.d(oe,"M",function(){return h}),k.d(oe,"Q",function(){return c}),k.d(oe,"u",function(){return o}),k.d(oe,"x",function(){return d}),k.d(oe,"I",function(){return i}),k.d(oe,"f",function(){return a}),k.d(oe,"h",function(){return r}),k.d(oe,"g",function(){return s}),k.d(oe,"i",function(){return S}),k.d(oe,"G",function(){return w}),k.d(oe,"H",function(){return x}),k.d(oe,"r",function(){return L}),k.d(oe,"R",function(){return O}),k.d(oe,"d",function(){return _}),k.d(oe,"e",function(){return b}),k.d(oe,"E",function(){return g}),k.d(oe,"F",function(){return f}),k.d(oe,"j",function(){return C}),k.d(oe,"z",function(){return E}),k.d(oe,"K",function(){return N}),k.d(oe,"L",function(){return U}),k.d(oe,"m",function(){return H}),k.d(oe,"k",function(){return T}),k.d(oe,"A",function(){return Q}),k.d(oe,"a",function(){return ne}),k.d(oe,"n",function(){return se}),k.d(oe,"l",function(){return xe}),k.d(oe,"D",function(){return me}),k.d(oe,"B",function(){return ve}),k.d(oe,"b",function(){return Oe}),k.d(oe,"S",function(){return Re}),k.d(oe,"o",function(){return fe}),k.d(oe,"P",function(){return ue}),k.d(oe,"w",function(){return Pe}),k.d(oe,"c",function(){return et}),k.d(oe,"y",function(){return it});function Z(he){return!he||typeof he!="string"?!0:he.trim().length===0}const X=/{(\d+)}/g;function P(he,...Se){return Se.length===0?he:he.replace(X,function(Le,Me){const qe=parseInt(Me,10);return isNaN(qe)||qe<0||qe>=Se.length?Le:Se[qe]})}function V(he){return he.replace(/[<>&]/g,function(Se){switch(Se){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Se}})}function j(he){return he.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function M(he,Se=" "){const Le=G(he,Se);return W(Le,Se)}function G(he,Se){if(!he||!Se)return he;const Le=Se.length;if(Le===0||he.length===0)return he;let Me=0;for(;he.indexOf(Se,Me)===Me;)Me=Me+Le;return he.substring(Me)}function W(he,Se){if(!he||!Se)return he;const Le=Se.length,Me=he.length;if(Le===0||Me===0)return he;let qe=Me,st=-1;for(;!(st=he.lastIndexOf(Se,qe-1),st===-1||st+Le!==qe);){if(st===0)return"";qe=st}return he.substring(0,qe)}function n(he){return he.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(he){return he.replace(/\*/g,"")}function m(he,Se,Le={}){if(!he)throw new Error("Cannot create regex from empty string");Se||(he=j(he)),Le.wholeWord&&(/\B/.test(he.charAt(0))||(he="\\b"+he),/\B/.test(he.charAt(he.length-1))||(he=he+"\\b"));let Me="";return Le.global&&(Me+="g"),Le.matchCase||(Me+="i"),Le.multiline&&(Me+="m"),Le.unicode&&(Me+="u"),new RegExp(he,Me)}function p(he){if(he.source==="^"||he.source==="^$"||he.source==="$"||he.source==="^\\s*$")return!1;const Se=he.exec("");return!!(Se&&he.lastIndex===0)}function h(he){return(he.global?"g":"")+(he.ignoreCase?"i":"")+(he.multiline?"m":"")+(he.unicode?"u":"")}function c(he){return he.split(/\r\n|\r|\n/)}function o(he){for(let Se=0,Le=he.length;Se<Le;Se++){const Me=he.charCodeAt(Se);if(Me!==32&&Me!==9)return Se}return-1}function d(he,Se=0,Le=he.length){for(let Me=Se;Me<Le;Me++){const qe=he.charCodeAt(Me);if(qe!==32&&qe!==9)return he.substring(Se,Me)}return he.substring(Se,Le)}function i(he,Se=he.length-1){for(let Le=Se;Le>=0;Le--){const Me=he.charCodeAt(Le);if(Me!==32&&Me!==9)return Le}return-1}function a(he,Se){return he<Se?-1:he>Se?1:0}function r(he,Se,Le=0,Me=he.length,qe=0,st=Se.length){for(;Le<Me&&qe<st;Le++,qe++){let St=he.charCodeAt(Le),Et=Se.charCodeAt(qe);if(St<Et)return-1;if(St>Et)return 1}const mt=Me-Le,gt=st-qe;return mt<gt?-1:mt>gt?1:0}function s(he,Se){return S(he,Se,0,he.length,0,Se.length)}function S(he,Se,Le=0,Me=he.length,qe=0,st=Se.length){for(;Le<Me&&qe<st;Le++,qe++){let St=he.charCodeAt(Le),Et=Se.charCodeAt(qe);if(St===Et)continue;if(St>=128||Et>=128)return r(he.toLowerCase(),Se.toLowerCase(),Le,Me,qe,st);w(St)&&(St-=32),w(Et)&&(Et-=32);const Ae=St-Et;if(Ae===0)continue;return Ae}const mt=Me-Le,gt=st-qe;return mt<gt?-1:mt>gt?1:0}function w(he){return he>=97&&he<=122}function x(he){return he>=65&&he<=90}function L(he,Se){return he.length===Se.length&&S(he,Se)===0}function O(he,Se){const Le=Se.length;return Se.length>he.length?!1:S(he,Se,0,Le)===0}function _(he,Se){let Le,Me=Math.min(he.length,Se.length);for(Le=0;Le<Me;Le++)if(he.charCodeAt(Le)!==Se.charCodeAt(Le))return Le;return Me}function b(he,Se){let Le,Me=Math.min(he.length,Se.length);const qe=he.length-1,st=Se.length-1;for(Le=0;Le<Me;Le++)if(he.charCodeAt(qe-Le)!==Se.charCodeAt(st-Le))return Le;return Me}function g(he){return 55296<=he&&he<=56319}function f(he){return 56320<=he&&he<=57343}function C(he,Se){return(he-55296<<10)+(Se-56320)+65536}function E(he,Se,Le){const Me=he.charCodeAt(Le);if(g(Me)&&Le+1<Se){const qe=he.charCodeAt(Le+1);if(f(qe))return C(Me,qe)}return Me}function v(he,Se){const Le=he.charCodeAt(Se-1);if(f(Le)&&Se>1){const Me=he.charCodeAt(Se-2);if(g(Me))return C(Me,Le)}return Le}function N(he,Se){const Le=rt.getInstance(),Me=Se,qe=he.length,st=E(he,qe,Se);Se+=st>=65536?2:1;let mt=Le.getGraphemeBreakType(st);for(;Se<qe;){const gt=E(he,qe,Se),St=Le.getGraphemeBreakType(gt);if(et(mt,St))break;Se+=gt>=65536?2:1,mt=St}return Se-Me}function U(he,Se){const Le=rt.getInstance(),Me=Se,qe=v(he,Se);Se-=qe>=65536?2:1;let st=Le.getGraphemeBreakType(qe);for(;Se>0;){const mt=v(he,Se),gt=Le.getGraphemeBreakType(mt);if(et(gt,st))break;Se-=mt>=65536?2:1,st=gt}return Me-Se}const A=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function H(he){return A.test(he)}const F=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function T(he){return F.test(he)}const z=/^[\t\n\r\x20-\x7E]*$/;function Q(he){return z.test(he)}const ne=/[\u2028\u2029]/;function se(he){return ne.test(he)}function xe(he){for(let Se=0,Le=he.length;Se<Le;Se++)if(me(he.charCodeAt(Se)))return!0;return!1}function me(he){return he=+he,he>=11904&&he<=55215||he>=63744&&he<=64255||he>=65281&&he<=65374}function ve(he){return he>=127462&&he<=127487||he===8986||he===8987||he===9200||he===9203||he>=9728&&he<=10175||he===11088||he===11093||he>=127744&&he<=128591||he>=128640&&he<=128764||he>=128992&&he<=129003||he>=129280&&he<=129535||he>=129648&&he<=129750}const Oe=String.fromCharCode(65279);function Re(he){return!!(he&&he.length>0&&he.charCodeAt(0)===65279)}function fe(he,Se=!1){return he?(Se&&(he=he.replace(/\\./g,"")),he.toLowerCase()!==he):!1}function ue(he){const Se=90-65+1;return he=he%(2*Se),he<Se?String.fromCharCode(97+he):String.fromCharCode(65+he-Se)}function Pe(he){const Se=rt.getInstance();return Se.getGraphemeBreakType(he)}function et(he,Se){return he===0?Se!==5&&Se!==7:he===2&&Se===3?!1:he===4||he===2||he===3||(Se===4||Se===2||Se===3)?!0:he===8&&(Se===8||Se===9||Se===11||Se===12)||((he===11||he===9)&&(Se===9||Se===10)||((he===12||he===10)&&Se===10||(Se===5||Se===13||(Se===7||(he===1||he===13&&Se===14)))))?!1:!(he===6&&Se===6)}class rt{constructor(){this._data=tt()}static getInstance(){return rt._INSTANCE||(rt._INSTANCE=new rt),rt._INSTANCE}getGraphemeBreakType(he){if(he<32)return he===10?3:he===13?2:4;if(he<127)return 0;const Se=this._data,Le=Se.length/3;let Me=1;for(;Me<=Le;)if(he<Se[3*Me])Me=2*Me;else if(he>Se[3*Me+1])Me=2*Me+1;else return Se[3*Me+2];return 0}}rt._INSTANCE=null;function tt(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function it(he,Se){if(he===0)return 0;const Le=ze(he,Se);if(Le!==void 0)return Le;const Me=v(Se,he);return he-=Qe(Me),he}function ze(he,Se){let Le=v(Se,he);for(he-=Qe(Le);at(Le)||Le===65039||Le===8419;){if(he===0)return;Le=v(Se,he),he-=Qe(Le)}if(!ve(Le))return;if(he>=0){const Me=v(Se,he);Me===8205&&(he-=Qe(Me))}return he}function Qe(he){return he>=65536?2:1}function at(he){return 127995<=he&&he<=127999}},NvD2:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return M});var Z=k("Kwbf");function X(G,W){var n=new Set;return G.forEach(function(D){W.has(D)||n.add(D)}),n}function P(G){var W=G||{},n=W.disabled,D=W.disableCheckbox,m=W.checkable;return!!(n||D)||m===!1}function V(G,W,n,D){for(var m=new Set(G),p=new Set,h=0;h<=n;h+=1){var c=W.get(h)||new Set;c.forEach(function(a){var r=a.key,s=a.node,S=a.children,w=S===void 0?[]:S;m.has(r)&&!D(s)&&w.filter(function(x){return!D(x.node)}).forEach(function(x){m.add(x.key)})})}for(var o=new Set,d=n;d>=0;d-=1){var i=W.get(d)||new Set;i.forEach(function(a){var r=a.parent,s=a.node;if(D(s)||!a.parent||o.has(a.parent.key))return;if(D(a.parent.node)){o.add(r.key);return}var S=!0,w=!1;(r.children||[]).filter(function(x){return!D(x.node)}).forEach(function(x){var L=x.key,O=m.has(L);S&&!O&&(S=!1),!w&&(O||p.has(L))&&(w=!0)}),S&&m.add(r.key),w&&p.add(r.key),o.add(r.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(X(p,m))}}function j(G,W,n,D,m){for(var p=new Set(G),h=new Set(W),c=0;c<=D;c+=1){var o=n.get(c)||new Set;o.forEach(function(r){var s=r.key,S=r.node,w=r.children,x=w===void 0?[]:w;!p.has(s)&&!h.has(s)&&!m(S)&&x.filter(function(L){return!m(L.node)}).forEach(function(L){p.delete(L.key)})})}h=new Set;for(var d=new Set,i=D;i>=0;i-=1){var a=n.get(i)||new Set;a.forEach(function(r){var s=r.parent,S=r.node;if(m(S)||!r.parent||d.has(r.parent.key))return;if(m(r.parent.node)){d.add(s.key);return}var w=!0,x=!1;(s.children||[]).filter(function(L){return!m(L.node)}).forEach(function(L){var O=L.key,_=p.has(O);w&&!_&&(w=!1),!x&&(_||h.has(O))&&(x=!0)}),w||p.delete(s.key),x&&h.add(s.key),d.add(s.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(X(h,p))}}function M(G,W,n,D){var m=[],p;D?p=D:p=P;var h=new Set(G.filter(function(i){var a=!!n[i];return a||m.push(i),a})),c=new Map,o=0;Object.keys(n).forEach(function(i){var a=n[i],r=a.level,s=c.get(r);s||(s=new Set,c.set(r,s)),s.add(a),o=Math.max(o,r)}),Object(Z.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var d;return W===!0?d=V(h,c,o,p):d=j(h,W.halfCheckedKeys,c,o,p),d}},OJz4:function(Fe,oe,k){"use strict";k.d(oe,"d",function(){return X}),k.d(oe,"h",function(){return P}),k.d(oe,"b",function(){return V}),k.d(oe,"f",function(){return j}),k.d(oe,"e",function(){return M}),k.d(oe,"c",function(){return G}),k.d(oe,"a",function(){return W}),k.d(oe,"g",function(){return n}),k.d(oe,"i",function(){return D}),k.d(oe,"k",function(){return m}),k.d(oe,"j",function(){return p});var Z=k("ErOA");function X(h){return Object(Z.c)("myproblems/".concat(h,".json"),{hidePopLogin:!0})}function P(h,c){return Object(Z.f)("myproblems/".concat(h,"/code_submit.json"),c)}function V(h,c){return Object(Z.c)("myproblems/".concat(h,"/code_debug.json"),c)}function j(h,c){return Object(Z.c)("myproblems/".concat(h,"/submit_records.json"),c)}function M(h){return Object(Z.c)("myproblems/record_detail.json",{id:h})}function G(h,c){return Object(Z.c)("myproblems/".concat(h,"/result.json"),{mode:c})}function W(h,c){return Object(Z.f)("myproblems/".concat(h,"/add_notes.json"),c)}function n(h){return Object(Z.f)("myproblems/".concat(h,"/restore_initial_code.json"))}function D(h){return Object(Z.f)("myproblems/".concat(h,"/sync_code.json"))}function m(h,c){return Object(Z.f)("myproblems/".concat(h,"/update_code.json"),c)}function p(h,c){return Object(Z.f)("discusses/".concat(h,"/plus.json"),c)}},OLES:function(Fe,oe,k){"use strict";var Z=k("U8pU"),X=k("VTBJ"),P=k("Ff2n"),V=k("q1tI"),j=k("uciX"),M=k("7ixt"),G=function(h){var c=h.overlay,o=h.prefixCls,d=h.id,i=h.overlayInnerStyle;return V.createElement("div",{className:"".concat(o,"-inner"),id:d,role:"tooltip",style:i},typeof c=="function"?c():c)},W=G,n=function(h,c){var o=h.overlayClassName,d=h.trigger,i=d===void 0?["hover"]:d,a=h.mouseEnterDelay,r=a===void 0?0:a,s=h.mouseLeaveDelay,S=s===void 0?.1:s,w=h.overlayStyle,x=h.prefixCls,L=x===void 0?"rc-tooltip":x,O=h.children,_=h.onVisibleChange,b=h.afterVisibleChange,g=h.transitionName,f=h.animation,C=h.placement,E=C===void 0?"right":C,v=h.align,N=v===void 0?{}:v,U=h.destroyTooltipOnHide,A=U===void 0?!1:U,H=h.defaultVisible,F=h.getTooltipContainer,T=h.overlayInnerStyle,z=Object(P.a)(h,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Q=Object(V.useRef)(null);Object(V.useImperativeHandle)(c,function(){return Q.current});var ne=Object(X.a)({},z);"visible"in h&&(ne.popupVisible=h.visible);var se=function(){var Re=h.arrowContent,fe=Re===void 0?null:Re,ue=h.overlay,Pe=h.id;return[V.createElement("div",{className:"".concat(L,"-arrow"),key:"arrow"},fe),V.createElement(W,{key:"content",prefixCls:L,id:Pe,overlay:ue,overlayInnerStyle:T})]},xe=!1,me=!1;if(typeof A=="boolean")xe=A;else if(A&&Object(Z.a)(A)==="object"){var ve=A.keepParent;xe=ve===!0,me=ve===!1}return V.createElement(j.a,Object.assign({popupClassName:o,prefixCls:L,popup:se,action:i,builtinPlacements:M.a,popupPlacement:E,ref:Q,popupAlign:N,getPopupContainer:F,onPopupVisibleChange:_,afterPopupVisibleChange:b,popupTransitionName:g,popupAnimation:f,defaultPopupVisible:H,destroyPopupOnHide:xe,autoDestroy:me,mouseLeaveDelay:S,popupStyle:w,mouseEnterDelay:r},ne),O)},D=Object(V.forwardRef)(n),m=oe.a=D},OZM5:function(Fe,oe,k){"use strict";k.d(oe,"b",function(){return D}),k.d(oe,"a",function(){return m}),k.d(oe,"k",function(){return p}),k.d(oe,"h",function(){return h}),k.d(oe,"i",function(){return c}),k.d(oe,"g",function(){return o}),k.d(oe,"c",function(){return d}),k.d(oe,"d",function(){return i}),k.d(oe,"j",function(){return s}),k.d(oe,"e",function(){return S}),k.d(oe,"f",function(){return w});var Z=k("KQm4"),X=k("U8pU"),P=k("Ff2n"),V=k("q1tI"),j=k.n(V),M=k("Kwbf"),G=k("WaYH"),W=.25,n=2;function D(x,L){var O=x.slice(),_=O.indexOf(L);return _>=0&&O.splice(_,1),O}function m(x,L){var O=x.slice();return O.indexOf(L)===-1&&O.push(L),O}function p(x){return x.split("-")}function h(x,L){return"".concat(x,"-").concat(L)}function c(x){return x&&x.type&&x.type.isTreeNode}function o(x,L){var O=[x],_=L[x];function b(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];g.forEach(function(f){var C=f.key,E=f.children;O.push(C),b(E)})}return b(_.children),O}function d(x,L){var O=x.clientY,_=L.selectHandle.getBoundingClientRect(),b=_.top,g=_.bottom,f=_.height,C=Math.max(f*W,n);return O<=b+C?-1:O>=g-C?1:0}function i(x,L){if(!x)return;var O=L.multiple;return O?x.slice():x.length?[x[0]]:x}var a=function(L){return L};function r(x,L){if(!x)return[];var O=L||{},_=O.processProps,b=_===void 0?a:_,g=Array.isArray(x)?x:[x];return g.map(function(f){var C=f.children,E=Object(P.a)(f,["children"]),v=r(C,L);return j.a.createElement(G.a,Object.assign({},b(E)),v)})}function s(x){if(!x)return null;var L;if(Array.isArray(x))L={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(X.a)(x)==="object")L={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return L}function S(x,L){var O=new Set;function _(b){if(O.has(b))return;var g=L[b];if(!g)return;O.add(b);var f=g.parent,C=g.node;if(C.disabled)return;f&&_(f.key)}return(x||[]).forEach(function(b){_(b)}),Object(Z.a)(O)}function w(x){var L={};return Object.keys(x).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(L[O]=x[O])}),L}},Ot1p:function(Fe,oe,k){"use strict";var Z=k("2qtc"),X=k("kLXV"),P=k("rAM+"),V=k("miYZ"),j=k("tsqr"),M=k("9og8"),G=k("tJVT"),W=k("jrin"),n=k("WmNS"),D=k.n(n),m=k("q1tI"),p=k.n(m),h=k("VrN/"),c=k.n(h),o=k("bdgK"),d=k("p77/"),i=k("Bd2K"),a=k("ELLl"),r=k("19Vz"),s=k("lZu9"),S=k("+NIl"),w=k("kSUc"),x=k("9Bee"),L=function(Te){var De=Te.value,Ze=De===void 0?"":De,pt=Te.className,Ot=Te.showTextOnly,yt=Te.showLines,ot=Te.style,He=ot===void 0?{}:ot,Ge=Object(m.useMemo)(function(){return""},[Ze]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ge}}))},O=k("0Owb"),_=k("dejd"),b=k("C+DQ"),g=k("1vsH"),f=k("m3rI"),C=[{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 E(Te){var De=Te.onActionCallback,Ze=Te.title,pt=Te.icon,Ot=Te.actionName,yt=Te.className,ot=yt===void 0?"":yt,He=Te.children;function Ge(){De(Ot)}return p.a.createElement("a",{title:Ze,className:ot,onClick:Ge},p.a.createElement("i",{className:"md-iconfont ".concat(pt)}),He)}var v=function(Te){var De=Te.watch,Ze=Te.showNullButton,pt=Te.onActionCallback,Ot=Te.fullScreen,yt=Te.insertTemp,ot=Te.hidetoolBar,He=Te.uuid,Ge=Te.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(g.H)("_educoder_session_login"),"&_educoder_session=").concat(Object(g.H)("_educoder_session"),"&key=").concat(He,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Ue=[].concat(C,[{title:"".concat(De?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(De?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!ot&&Ue.map(function(le,_e){return p.a.createElement("li",{key:_e},le.actionName?p.a.createElement(E,Object(O.a)({},le,{onActionCallback:pt})):p.a.createElement("span",{className:"v-line"}))}),Ze?p.a.createElement("li",null,p.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:pt},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,yt&&p.a.createElement("li",null,p.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(yt),onActionCallback:pt},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(E,{icon:"".concat(Ot?"icon-shrink":"icon-enlarge"),title:Ot?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:pt})))},N=k("M8RZ"),U=k("+L6B"),A=k("2/Rp"),H=k("y8nQ"),F=k("Vl3Y"),T=k("5NDa"),z=k("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},ne=function(Te){var De=Te.callback,Ze=Te.onCancel;function pt(Ot){De(Ot)}return p.a.createElement(F.a,Object(O.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:pt}),p.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(z.a,null)),p.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(z.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:Ze},"\u53D6\u6D88")))},se=k("7ahc"),xe=k("HmJG"),me=k("BjJ7"),ve=F.a.useForm,Oe={width:280,marginRight:10},Re={labelCol:{span:5},wrapperCol:{span:19}},fe=function(Te){var De=Te.callback,Ze=Te.onCancel,pt=ve(),Ot=Object(G.a)(pt,1),yt=Ot[0];function ot(Ue){De(Ue)}function He(Ue,le){if(Ue.status===-1){j.b.error(Ue.message);return}yt.setFieldsValue({src:"/api/attachments/".concat(Ue.id),type:le.type})}function Ge(Ue){var le=Ue.target.files[0];Pe(le,He)}return p.a.createElement(F.a,Object(O.a)({form:yt},Re,{className:"upload-image-panel",onFinish:ot}),p.a.createElement(F.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(F.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(z.a,{style:Oe})),p.a.createElement(ue,{onFileChange:Ge}))),p.a.createElement(F.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(z.a,{style:{width:264}})),p.a.createElement(F.a.Item,{style:{textAlign:"right"}},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:Ze},"\u53D6\u6D88")))};function ue(Te){var De=Te.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:De}))}function Pe(Te,De){if(!Te)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ze=new FormData;Ze.append("editormd-image-file",Te),Ze.append("file_param_name","editormd-image-file"),Ze.append("byxhr","true");var pt=new window.XMLHttpRequest;pt.withCredentials=!0,pt.addEventListener("load",function(Ot){De(JSON.parse(Ot.target.responseText),Te)},!1),pt.addEventListener("error",function(Ot){console.error(Ot)},!1),pt.open("POST","".concat(me.a,"/api/attachments.json")),pt.send(Ze)}var et=k("giR+"),rt=k("fyUT"),tt=k("7Kak"),it=k("9yH6"),ze=it.a.Group,Qe={margin:"0 8px"},at=function(Te){var De=Te.callback,Ze=Te.onCancel;function pt(Ot){De(Ot)}return p.a.createElement(F.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:pt},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Qe},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Qe},"\u884C\u6570"),p.a.createElement(F.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(rt.a,null)),p.a.createElement("span",{style:Qe},"\u5217\u6570"),p.a.createElement(F.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(rt.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Qe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(F.a.Item,{name:"align"},p.a.createElement(ze,null,p.a.createElement(it.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(it.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(it.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(it.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:Ze},"\u53D6\u6D88")))},he=k("ErOA"),Se=k("7Cbv"),Le="link",Me="upload-image",qe="code-block",st="add-table",mt="------------",gt={default:mt,left:":".concat(mt),center:":".concat(mt,":"),right:"".concat(mt,":")},St=k("9VGf"),Et,Ae;function Ce(){}var Xe=0,Je=1e4,ke="\u2581",Ke=`
**\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 ye(Te){return/^\d+$/.test(Te)?"".concat(Te,"px"):Te}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=ce?"Cmd":"Ctrl",ie=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ae=(Et={},Object(W.a)(Et,pe+"-B","bold"),Object(W.a)(Et,pe+"-I","italic"),Et),de=(Ae={},Object(W.a)(Ae,Le,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Ae,qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Ae,Me,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Ae,st,"\u6DFB\u52A0\u8868\u683C"),Ae),ge=oe.a=function(Te){var De=Te.defaultValue,Ze=De===void 0?"":De,pt=Te.onChange,Ot=Te.width,yt=Ot===void 0?"100%":Ot,ot=Te.height,He=ot===void 0?400:ot,Ge=Te.miniToolbar,Ue=Ge===void 0?!1:Ge,le=Te.isFocus,_e=le===void 0?!1:le,Ve=Te.watch,je=Te.insertTemp,ht=Te.mode,ft=ht===void 0?"markdown":ht,Ie=Te.id,$e=Ie===void 0?"markdown-editor-id":Ie,xt=Te.showResizeBar,Ft=xt===void 0?!1:xt,ct=Te.noStorage,Ut=ct===void 0?!1:ct,$t=Te.showNullButton,Vt=$t===void 0?!1:$t,At=Te.hidetoolBar,Tn=At===void 0?!1:At,Fn=Te.fullScreen,Sn=Fn===void 0?!1:Fn,Wt=Te.onBlur,hn=Te.onCMBeforeChange,Mn=Te.onFullScreen,Bn=Te.className,ut=Bn===void 0?"":Bn,Ct=Te.disablePaste,Hn=Ct===void 0?!1:Ct,pr=Te.placeholder,ur=pr===void 0?"":pr,kr=Te.values,J=kr===void 0?"":kr,I=Object(m.useState)(null),R=Object(G.a)(I,2),K=R[0],ee=R[1],Y=Object(m.useState)(Ze),Ee=Object(G.a)(Y,2),Ye=Ee[0],lt=Ee[1],vt=Object(m.useState)(Ve),We=Object(G.a)(vt,2),_t=We[0],Lt=We[1],Mt=Object(m.useState)(Sn),en=Object(G.a)(Mt,2),Rt=en[0],nn=en[1],tn=Object(m.useState)(""),Pn=Object(G.a)(tn,2),Xt=Pn[0],On=Pn[1],An=Object(m.useState)(0),Ln=Object(G.a)(An,2),wn=Ln[0],In=Ln[1],Gn=Object(m.useState)(He),ar=Object(G.a)(Gn,2),Xn=ar[0],_n=ar[1],Wn=Object(m.useState)(!1),fn=Object(G.a)(Wn,2),gn=fn[0],vn=fn[1],Yt=Object(m.useRef)(Object(Se.a)()),Tt=Object(m.useRef)(!1),Kt=Object(m.useRef)(),bt=Object(m.useRef)(),qt=Object(m.useRef)(),kt=Object(m.useRef)(),Yn=Object(m.useRef)(),un=function(){var Bt=Object(M.a)(D.a.mark(function Zt(){var zt,rn;return D.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return Cn.next=2,Object(he.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Yt.current}});case 2:rn=Cn.sent,rn!=null&&(zt=rn.attachments)!==null&&zt!==void 0&&zt.length&&(console.log("cm:",K,bt),rn.attachments.map(function(cn){cn.content_type.indexOf("image")>-1?K.replaceSelection("![,](/api/attachments/".concat(cn.id,"?type=").concat(cn.content_type,")")):cn.content_type.indexOf("video")>-1?K.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):cn.content_type.indexOf("pdf")>-1?K.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(cn.id,"?type=").concat(cn.content_type,'&disposition=inline" target="_blank">').concat(cn.name,"</a>")):K.replaceSelection("[".concat(cn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(cn.id,"?type=").concat(cn.content_type,")"))}));case 4:case"end":return Cn.stop()}},Zt)}));return function(){return Bt.apply(this,arguments)}}();Object(m.useEffect)(function(){lt(J),K==null||K.setValue(J)},[J]),Object(m.useEffect)(function(){Mn==null||Mn(Rt)},[Rt]),Object(m.useEffect)(function(){if(bt.current){var Bt=c.a.fromTextArea(bt.current,{mode:ft,lineNumbers:!Ue,lineWrapping:!0,value:Ze,autoCloseTags:!0,autoCloseBrackets:!0});_e&&Bt.focus();function Zt(zt,rn){if(Hn){rn.preventDefault();return}var on=rn.clipboardData;if(on){var Cn=on.types.toString(),cn=on.items;if(Cn==="Files"||on.types.indexOf("Files")>-1){if(rn.preventDefault(),ft=="stex")return;try{var jn,or=cn[1];((jn=cn[0])===null||jn===void 0?void 0:jn.kind)==="file"&&(or=cn[0]);var an=or.getAsFile(),_r=an.name.split(".").pop();Pe(an,function(En){if(En.id){var qn,er,mr;(an==null||((qn=an.type)===null||qn===void 0)?void 0:qn.indexOf("image"))>-1?Bt.replaceSelection("![,](/api/attachments/".concat(En.id,"?type=").concat(En.content_type,")")):(an==null||((er=an.type)===null||er===void 0)?void 0:er.indexOf("video"))>-1?Bt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(En.id,'"></video>')):(an==null||((mr=an.type)===null||mr===void 0)?void 0:mr.indexOf("pdf"))>-1?Bt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(an.type,'&disposition=inline" target="_blank">').concat(an.name,"</a>")):ie.includes(_r)?Bt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(En.id,'?type=office&disposition=inline" target="_blank">').concat(an.name,"</a>")):Bt.replaceSelection("[".concat(an.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(En.content_type,")"))}else(En==null?void 0:En.status)===401&&(document.location.href="/user/login")})}catch(En){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Bt.on("paste",Zt),Bt.on("dragleave",function(zt,rn){qt.current.classList.remove("mouse-hover-md")}),Bt.on("dragover",function(zt,rn){qt.current.classList.add("mouse-hover-md")}),Bt.on("drop",function(zt,rn){qt.current.classList.add("mouse-hover-md");var on;if(on=rn.dataTransfer.files,on.length>0){rn.preventDefault(),rn.stopPropagation();for(var Cn=function(or){var an=on[or],_r=an.name.split(".").pop();Pe(an,function(En){if(En.id){var qn,er,mr;(an==null||((qn=an.type)===null||qn===void 0)?void 0:qn.indexOf("image"))>-1?Bt.replaceSelection("![,](/api/attachments/".concat(En.id,"?type=").concat(En.content_type,")")):(an==null||((er=an.type)===null||er===void 0)?void 0:er.indexOf("video"))>-1?Bt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(En.id,'"></video>')):(an==null||((mr=an.type)===null||mr===void 0)?void 0:mr.indexOf("pdf"))>-1?Bt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(an.type,'&disposition=inline" target="_blank">').concat(an.name,"</a>")):ie.includes(_r)?Bt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(En.id,'?type=office&disposition=inline" target="_blank">').concat(an.name,"</a>")):Bt.replaceSelection("[".concat(an.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(En.content_type,")"))}else(En==null?void 0:En.status)===401&&(document.location.href="/user/login")})},cn=0;cn<on.length;cn++)Cn(cn)}}),ee(Bt),function(){Bt.off("paste",Zt)}}},[]);var Qn=Object(m.useCallback)(function(){if(qt.current)try{}catch(Bt){console.log(Bt,"---- to set md editor body height")}},[Xn,qt,Rt]);Object(m.useEffect)(function(){function Bt(){var zt=new o.default(function(rn){var on=Object(P.a)(rn),Cn;try{for(on.s();!(Cn=on.n()).done;){var cn=Cn.value;(cn.target.offsetHeight>0||cn.target.offsetWidth>0)&&(Qn(),K.setSize("100%","100%"),K.refresh())}}catch(jn){on.e(jn)}finally{on.f()}});return zt.observe(bt.current.parentElement),zt}if(K){var Zt=Bt();return function(){Zt.unobserve(bt.current.parentElement)}}},[K,Qn]),Object(m.useEffect)(function(){if(K){for(var Bt=[],Zt=function(){var cn=rn[zt];on=Object(G.a)(cn,2);var jn=on[0],or=on[1],an=Object(W.a)({},jn,function(){Kr(or)});Bt.push(an),K.addKeyMap(an)},zt=0,rn=Object.entries(ae);zt<rn.length;zt++){var on;Zt()}return Kt.current=setInterval(function(){Tt.current&&un()},4e3),function(){clearInterval(Kt.current);var Cn=Object(P.a)(Bt),cn;try{for(Cn.s();!(cn=Cn.n()).done;){var jn=cn.value;K.removeKeyMap(jn)}}catch(or){Cn.e(or)}finally{Cn.f()}}}},[K]),Object(m.useEffect)(function(){Sn!==Rt&&nn(Sn)},[Sn]),Object(St.a)(function(){if(!Ut&&wn>0){var Bt=new Date().getTime(),Zt=window.sessionStorage.getItem($e);Bt>=wn+Je&&(!Zt||Zt!==Ye)&&(window.sessionStorage.setItem($e,Ye),vn(!0))}},Je),Object(m.useEffect)(function(){Lt(Ve)},[K,Ve]),Object(m.useEffect)(function(){K&&(_e&&K.focus())},[K,_e]),Object(m.useEffect)(function(){if(_t&&K){var Bt=K.getScrollerElement();function Zt(zt){var rn=zt.target;if(Yn.current){var on=rn.scrollTop/rn.scrollHeight;Yn.current.scrollTop=Yn.current.scrollHeight*on}}return Bt.addEventListener("scroll",Zt),function(){Bt.removeEventListener("scroll",Zt)}}},[K,_t]),Object(m.useEffect)(function(){if(K&&hn){function Bt(Zt,zt){hn(Zt,zt)}return K.on("beforeChange",Bt),function(){K.off("beforeChange",Bt)}}},[K,hn]),Object(m.useEffect)(function(){if(K&&Wt){function Bt(){Wt(K.getValue())}return K.on("blur",Bt),function(){K.off("blur",Bt)}}},[K,Wt]),Object(m.useEffect)(function(){if(K){function Bt(Zt){var zt=Zt.getValue();lt(zt),In(new Date().getTime()),Zt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),pt&&pt(zt)}return K.on("change",Bt),function(){K.off("change",Bt)}}},[K,pt]),Object(m.useEffect)(function(){K&&(Ze==null?(K.setValue(""),lt("")):Ze!==K.getValue()&&(K.setValue(Ze),lt(Ze),K.setCursor(K.lineCount(),0)))},[K,Ze]);var Kr=Object(m.useCallback)(function(Bt){var Zt=K.getCursor(),zt=K.getSelection(),rn=zt.split(`
`);switch(Bt){case"bold":return K.replaceSelection("**"+zt+"**"),zt===""&&K.setCursor(Zt.line,Zt.ch+2),K.focus();case"italic":return K.replaceSelection("*"+zt+"*"),zt===""&&K.setCursor(Zt.line,Zt.ch+1),K.focus();case"code":return K.replaceSelection("`"+zt+"`"),zt===""&&K.setCursor(Zt.line,Zt.ch+1),K.focus();case"inline-latex":return K.replaceSelection("`$$"+zt+"$$`"),zt===""&&K.setCursor(Zt.line,Zt.ch+3),K.focus();case"latex":return K.replaceSelection("```latex\n"+zt+"\n```"),K.setCursor(Zt.line+1,zt.length+1),K.focus();case"line-break":return K.replaceSelection(`<br/>
`),K.focus();case"list-ul":return zt===""?K.replaceSelection("- "+zt):K.replaceSelection(rn.map(function(on){return on===""?"":"- ".concat(on)}).join(`
`)),K.focus();case"list-ol":return zt===""?K.replaceSelection("1. "+zt):K.replaceSelection(rn.map(function(on,Cn){return on===""?"":"".concat(Cn+1,". ").concat(on)}).join(`
`)),K.focus();case"add-null-ch":return zt===""&&K.setCursor(Zt.line,Zt.ch+1),K.replaceSelection(ke),K.focus();case"inster-template-1":return zt===""&&K.setCursor(Zt.line,Zt.ch),K.replaceSelection(Ke),K.focus();case"eraser":return K.setValue(""),K.focus();case"trigger-watch":return Lt(!_t),K.focus();case"trigger-full-screen":return nn(!Rt),K.focus();case Le:On(Le);return;case qe:On(qe);return;case Me:On(Me);return;case st:On(st);return;default:throw new Error}},[K,_t,Rt]),wr=Object(m.useCallback)(function(Bt){On("");switch(Xt){case Le:var Zt=Bt.title,zt=Bt.link;return K.replaceSelection("[".concat(Zt,"](").concat(zt,")")),K.focus();case qe:var rn=Bt.language,on=Bt.content;return K.replaceSelection(["```"+rn,on,"```"].join(`
`)),K.focus();case Me:var Cn=Bt.src,cn=Bt.alt;return cn?K.replaceSelection("![ ".concat(cn," ]( ").concat(Cn,' "').concat(cn,'" )')):K.replaceSelection("![,](".concat(Cn,")")),K.focus();case st:for(var jn=Bt.row,or=Bt.col,an=Bt.align,_r=`
`,En=0;En<jn;En++){for(var qn=[],er=[],mr=0;mr<or;mr++)En===1&&er.push(gt[an]),qn.push(" ");En===1&&(_r+="| ".concat(er.join(" | "),` |
`)),_r+="| ".concat(qn.join(or===1?"":" | "),` |
`)}return K.replaceSelection(_r+`
`),K.focus();default:throw new Error}},[K,Xt]),Vr=Object(m.useMemo)(function(){switch(Xt){case Le:return p.a.createElement(ne,{callback:wr,onCancel:Nr});case qe:return p.a.createElement(se.b,{callback:wr,onCancel:Nr});case Me:return p.a.createElement(fe,{callback:wr,onCancel:Nr});case st:return p.a.createElement(at,{callback:wr,onCancel:Nr});default:return null}},[Xt]);function Nr(){On("")}Object(m.useEffect)(function(){if(kt.current){var Bt=kt.current,Zt=!1,zt=0;function rn(cn){Zt=!0,zt=cn.pageY}function on(){Zt=!1}function Cn(cn){if(Zt){var jn=cn.pageY-zt;jn<0&&(jn=0),jn>300&&(jn=300);var or=He+jn+"px";_n(or)}}return Bt.addEventListener("mousedown",rn),document.addEventListener("mousemove",Cn),document.addEventListener("mouseup",on),function(){Bt.removeEventListener("mousedown",rn),document.removeEventListener("mousemove",Cn),document.removeEventListener("mouseup",on)}}},[K,kt]),Object(m.useEffect)(function(){_n(He)},[He]);var Rr=ye(yt),Gr=ye(Xn),zn={width:Rr,height:Gr},Gt=Object(m.useMemo)(function(){if(wn){var Bt=new Date(wn),Zt=Bt.getHours(),zt=Bt.getMinutes(),rn=Bt.getSeconds();return Zt=Zt<10?"0"+Zt:Zt,zt=zt<10?"0"+zt:zt,rn=rn<10?"0"+rn:rn,"".concat(Zt,":").concat(zt,":").concat(rn)}return 0},[wn]);function Xr(){window.sessionStorage.removeItem($e),vn(!1),In(0)}function br(){vn(!1),In(0),K.setValue(window.sessionStorage.getItem($e))}function ni(Bt,Zt){var zt=K.getValue();zt=zt.replace(Bt,Zt),lt(zt),K==null||K.setValue(zt)}return p.a.createElement(m.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:qt},p.a.createElement("div",{className:"markdown-editor-container ".concat(ut," ").concat(_t?"on-preview":""," ").concat(Ue?"mini":""," ").concat(Rt?"full-screen":""),style:zn},p.a.createElement(v,{insertTemp:je,watch:_t,fullScreen:Rt,showNullButton:Vt,onActionCallback:Kr,hidetoolBar:Tn,uuid:Yt.current,setOpenPhones:function(){Tt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:bt,placeholder:ur})),_t?p.a.createElement("div",{ref:Yn,className:"preview-container"},ft==="stex"&&p.a.createElement(L,{value:Ye}),ft!=="stex"&&p.a.createElement(x.a,{edit:!0,value:Ye,replaces:ni})):null))),Ft?p.a.createElement("a",{ref:kt,className:"editor-resize"}):null,p.a.createElement(N.a,null,de[Xt]?p.a.createElement(X.a,{centered:!0,title:de[Xt],visible:!0,onCancel:Nr,footer:null,className:"markdown-popup-form"},Vr):null))}},PD8m:function(Fe,oe){Fe.exports={name:"memoryStorage",read:Z,write:X,each:P,remove:V,clearAll:j};var k={};function Z(M){return k[M]}function X(M,G){k[M]=G}function P(M){for(var G in k)k.hasOwnProperty(G)&&M(k[G],G)}function V(M){delete k[M]}function j(M){k={}}},QUZ3:function(Fe,oe,k){"use strict";k.r(oe);var Z=k("0Owb"),X=k("PpiC"),P=k("OaEy"),V=k("2fM7"),j=k("T2oS"),M=k("W9HT"),G=k("+L6B"),W=k("2/Rp"),n=k("9og8"),D=k("2qtc"),m=k("kLXV"),p=k("tJVT"),h=k("k1fw"),c=k("aHsQ"),o=k("sGsY"),d=k("WmNS"),i=k.n(d),a=k("q1tI"),r=k.n(a),s=k("Icgb"),S=k("Fvcw"),w=k("GIiI"),x=k("Ty5D"),L=k("55Ip"),O=k("OJz4"),_=k("V0Rq"),b=k("bntm"),g=k("cDPC"),f=k("m3rI"),C=k("RCxd"),E=k("EHPI"),v=k("S+dL"),N=k.n(v),U=k("J66h"),A=k("uMZB"),H=k.n(A),F=k("p/48"),T=k("JPnl"),z=k("y8nQ"),Q=k("Vl3Y"),ne=k("5NDa"),se=k("5rEg"),xe=se.a.TextArea,me=5e3,ve=function(R){var K=R.callback,ee=R.onCancel,Y=R.notes;function Ee(Ye){K(Ye)}return r.a.createElement(Q.a,{className:"note-form-panel",onFinish:Ee,initialValues:{notes:Y}},r.a.createElement(Q.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:me,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(me)}]},r.a.createElement(xe,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),r.a.createElement(Q.a.Item,{style:{textAlign:"right"}},r.a.createElement(W.a,{type:"ghost",onClick:ee,style:{marginRight:10}}," ","\u53D6\u6D88"," "),r.a.createElement(W.a,{type:"primary",htmlType:"submit"}," ","\u63D0\u4EA4"," ")))},Oe=k("bbsP"),Re=k("/wGt"),fe=k("DjyN"),ue=k("NUBc"),Pe=k("H2Ag"),et=k.n(Pe),rt=k("miYZ"),tt=k("tsqr"),it=k("g9YV"),ze=k("wCAj"),Qe=k("+k/U"),at=k.n(Qe),he=k("ye1Q"),Se=k("lfch"),Le=k("JB8y"),Me=k("p5ED"),qe=k("ErOA"),st=k("wd/R"),mt=k.n(st),gt=ze.a.Column,St=function(R){var K,ee=R.submitResult,Y=R.submitting,Ee=R.submitRecords,Ye=R.page,lt=R.onPageChange,vt=R.topicId,We=ee||{},_t=We.status,Lt=We.id,Mt=We.input,en=We.output,Rt=We.expected_output,nn=We.is_file,tn=We.input_file_url,Pn=We.output_file_url,Xt=We.expected_output_file_url,On=We.error_msg,An=Ee||{},Ln=An.records,wn=An.records_count,In=Object(a.useState)(""),Gn=Object(p.a)(In,2),ar=Gn[0],Xn=Gn[1],_n=Object(a.useState)(""),Wn=Object(p.a)(_n,2),fn=Wn[0],gn=Wn[1],vn=Object(x.h)(),Yt=(vn==null||((K=vn.query)===null||K===void 0)?void 0:K.type)==="1";function Tt(){nn?navigator.clipboard.writeText(U.Base64.decode(On)).then(function(){tt.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(U.Base64.decode(en)).then(function(){tt.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return r.a.createElement(M.a,{spinning:Y,tip:"\u8BC4\u6D4B\u4E2D...",indicator:r.a.createElement(he.a,{style:{fontSize:24},spin:!0})},Lt?r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:at.a.info},r.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",r.a.createElement("span",{className:_t===Le.a.OK?"c-green":"c-red"},T.a[_t])),r.a.createElement("li",{className:at.a.error},r.a.createElement("a",{onClick:Tt},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",r.a.createElement(Se.a,null)," ")),r.a.createElement("li",null,r.a.createElement(L.a,{to:"/myproblems/".concat(vt,"/record-detail/").concat(Lt)},"\u663E\u793A\u8BE6\u60C5 >"," "))),_t!==Le.a.OK?r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),r.a.createElement("pre",null,!nn&&Mt,nn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function Kt(){var bt;return i.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,fetch(tn,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return bt=kt.sent,kt.t0=gn,kt.next=6,bt.text();case 6:kt.t1=kt.sent,(0,kt.t0)(kt.t1),setTimeout(function(){Xn(tn)},200);case 9:case"end":return kt.stop()}},Kt)}))},Mt)),r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,(_t===4||_t===5)&&U.Base64.decode(On),_t!=4&&_t!=5&&(nn?r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function Kt(){var bt;return i.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(qe.a)(Pn,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:bt=kt.sent;try{gn(bt)}catch(Yn){gn("")}setTimeout(function(){Xn(Pn)},200);case 5:case"end":return kt.stop()}},Kt)}))},en):U.Base64.decode(en))),r.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,!nn&&U.Base64.decode(Rt),nn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function Kt(){var bt;return i.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,fetch(Xt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return bt=kt.sent,kt.t0=gn,kt.next=6,bt.text();case 6:kt.t1=kt.sent,(0,kt.t0)(kt.t1),setTimeout(function(){Xn(Xt)},200);case 9:case"end":return kt.stop()}},Kt)}))},Rt))):null):null,(Ln==null?void 0:Ln.length)>0?r.a.createElement(ze.a,{dataSource:Ln,rowKey:"id",pagination:!1},r.a.createElement(gt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(bt,qt){return r.a.createElement("span",null," ",mt()(bt).format("YYYY-MM-DD HH:mm:ss"))}}),r.a.createElement(gt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(bt,qt){var kt;return r.a.createElement(L.a,{className:bt===0?"c-green":"c-red",to:"/myproblems/".concat(vt,"/record-detail/").concat(qt.id)},(kt=T.a[bt])===null||kt===void 0?void 0:kt.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),r.a.createElement(gt,{title:"\u6267\u884C\u7528\u65F6 (".concat(Yt?"MS":"S",")"),dataIndex:"execute_time",key:"execute_time",render:function(bt){return bt?Yt?bt:bt/1e3:""}}),r.a.createElement(gt,{title:"\u5185\u5B58\u6D88\u8017\uFF08".concat(Yt?"KB":"MB","\uFF09"),dataIndex:"execute_memory",key:"execute_memory",render:function(bt){return bt?Yt?bt:parseFloat((bt/1024).toFixed(2)):""}}),r.a.createElement(gt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"}),r.a.createElement(gt,{title:"\u64CD\u4F5C",dataIndex:"status",key:"status",render:function(bt,qt){return r.a.createElement(L.a,{className:"c-light-primary",to:"/myproblems/".concat(vt,"/record-detail/").concat(qt.id)},"\u67E5\u770B")}})):r.a.createElement("div",{style:{height:300,width:"100%"}}),wn>15?r.a.createElement(ue.a,{className:at.a.pagination,current:Ye,pageSize:15,total:wn,onChange:lt}):null,r.a.createElement(Me.a,{close:!0,data:ar,type:ar.length?"txt":"",onClose:function(){return Xn("")},monacoEditor:{value:fn,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}}))},Et=k("BdwD"),Ae=k("DYRE"),Ce=k("zeV3"),Xe=k("+BJd"),Je=k("mr32"),ke=k("pPuO"),Ke=k.n(ke),ye=k("9Bee"),ce={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u4E2D\u7B49",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},pe=function(R){var K=R.hack,ee=R.onTriggerPraise,Y=R.toDiscuss,Ee=K.language,Ye=K.difficult,lt=K.time_limit,vt=K.username,We=K.user_path,_t=K.user_praise,Lt=K.comments_count,Mt=K.praises_count,en=K.description,Rt=K.pass_count,nn=K.submit_count,tn=Object(x.h)(),Pn=ce[Ye];return r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:Ke.a.info},r.a.createElement("li",null,"\u7F16\u7A0B\u8BED\uFF1A",r.a.createElement("b",null,Ee)),r.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",r.a.createElement(Je.a,{color:Pn.color},Pn.name)),r.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",r.a.createElement("b",null,lt,"\u79D2"))),r.a.createElement(ye.a,{value:en,className:Ke.a.desc}),r.a.createElement("ul",{className:Ke.a["commit-info"]},r.a.createElement("li",null,r.a.createElement(Ce.a,{size:4},r.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",r.a.createElement("b",null,Rt))),r.a.createElement("li",null,r.a.createElement(Ce.a,{size:4},r.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",r.a.createElement("b",null,nn))," "),r.a.createElement("li",{style:{flex:"1 0 0"}}),tn.query.type!=="exercises"&&r.a.createElement("li",null,r.a.createElement(Ce.a,{size:4},r.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Y})," ",r.a.createElement("b",null,Lt))," ")))},ie=k("dhSg"),ae=k("oBTY"),de=k("M8RZ"),ge=k("qJ4+");function Te(R,K){return Object(qe.c)("/problems/".concat(R,"/comments.json?page=").concat(K,"&limit=10"))}function De(R){return Object(qe.f)("/discusses/".concat(R,"/plus.json"),{container_type:"Discuss",type:1})}function Ze(R,K,ee){return Object(qe.f)("/problems/".concat(R,"/comments/reply.json"),{comments:{content:ee,parent_id:K}})}function pt(R,K){return Object(qe.f)("/problems/".concat(R,"/comments.json"),{comments:{content:K}})}function Ot(R,K,ee){return Object(qe.f)("/problems/".concat(R,"/comments/").concat(K,"/hidden.json"),ee)}function yt(R,K){return Object(qe.b)("/problems/".concat(R,"/comments/").concat(K))}var ot=k("U7T7"),He=k("AMnG");function Ge(R){var K=R.author;return r.a.createElement("a",{href:"/users/".concat(K.login),target:"_blank"},r.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(f.a.IMG_SERVER,"/images/").concat(K.image_url),width:"50"}))}function Ue(R){var K=R.data,ee=R.index,Y=R.parentDiscussIndex,Ee=R.user,Ye=R.onSetActionType,lt=K.author,vt=K.can_delete,We=K.content,_t=K.id,Lt=K.time;function Mt(){Ye({id:_t,index:ee,type:"delete-discuss",parentDiscussIndex:Y,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var en=Ee.admin||vt||lt.user_id===Ee.user_id;return r.a.createElement("div",{className:"discuss-item-container second-discuss "},r.a.createElement(Ge,{author:lt}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(lt.login),target:"_blank"},lt.name),r.a.createElement("span",{className:"grey"},Lt),r.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},en?r.a.createElement("a",{onClick:Mt,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),r.a.createElement(ye.a,{className:"discuss-content",value:We})))}var le=function(R){var K=R.user,ee=R.data,Y=R.index,Ee=R.onPlusDiscuss,Ye=R.onSetActionType,lt=R.activeDiscussIndex,vt=R.onReplyDiscuss,We=R.onSetActiveDiscussIndex,_t=ee.content,Lt=ee.children,Mt=ee.hidden,en=ee.id,Rt=ee.praise_count,nn=ee.time,tn=ee.user_praise,Pn=ee.can_delete,Xt=ee.author;function On(){We(en)}function An(){Ee(en,!tn,Y)}function Ln(){Ye({id:en,index:Y,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function wn(){Ye({id:en,index:Y,params:{hidden:Mt?"0":"1"},type:"hidden-discuss",message:Mt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var In=K.admin||K.user_id===Xt.user_id;return r.a.createElement("div",{className:"discuss-item-container",key:en},r.a.createElement(Ge,{author:Xt}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(Xt.login),target:"_blank"}," ",Xt.name," "),r.a.createElement("span",{className:"grey"},nn)),r.a.createElement(ye.a,{className:"discuss-content",value:_t}),Lt&&Lt.length>0?r.a.createElement("div",{className:"reply-discuss-container"},Lt.map(function(Gn,ar){return r.a.createElement(Ue,{key:Gn.id,data:Gn,index:ar,user:K,onSetActionType:Ye,parentDiscussIndex:Y})})):null,r.a.createElement("div",{className:"btn-group"},In?r.a.createElement("a",{onClick:wn,title:Mt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},r.a.createElement("i",{className:Mt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Pn&&(!Lt||Lt.length==0)?r.a.createElement("a",{onClick:Ln,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null,r.a.createElement("a",{onClick:On,title:"\u56DE\u590D"}," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," "),r.a.createElement("a",{onClick:An,className:tn?"c-orange":""},r.a.createElement("i",{className:tn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),r.a.createElement("span",null,Rt||""))),r.a.createElement(He.a,{id:en,activeDiscussIndex:lt,onReplyDiscuss:vt})))},_e=k("kaH+"),Ve=k("uD2n"),je=k.n(Ve),ht=k("Ot1p"),ft=function(R){var K=R.user_praise,ee=R.praise_count,Y=R.praisePlus,Ee=R.onCreateDiscuss,Ye=R.discuss_count,lt=Object(a.useState)(!1),vt=Object(p.a)(lt,2),We=vt[0],_t=vt[1],Lt=Object(a.useState)(""),Mt=Object(p.a)(Lt,2),en=Mt[0],Rt=Mt[1];function nn(An){Rt(An)}function tn(){_t(!0)}function Pn(){_t(!1)}function Xt(){return On.apply(this,arguments)}function On(){return On=Object(n.a)(i.a.mark(function An(){return i.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:Ee(en),Rt(""),_t(!1);case 3:case"end":return wn.stop()}},An)})),On.apply(this,arguments)}return r.a.createElement("div",{className:"".concat(je.a["dis-input-editor-container"]," ").concat(We?je.a.active:""," "),style:{paddingLeft:"100px"}},r.a.createElement("div",{className:We?"hide ".concat(je.a["text-area"]):je.a["text-area"]},r.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:tn}),r.a.createElement("a",null," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Ye," "),r.a.createElement("a",{className:"c-light-black",onClick:Y,title:K?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},r.a.createElement("i",{className:"mr3 ".concat(K?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),ee?r.a.createElement("span",null,ee):"")),We?r.a.createElement("div",{className:je.a["input-mask"],onClick:Pn}):null,r.a.createElement("div",{className:We?je.a["md-container"]:"".concat(je.a["md-container"]," hide")},r.a.createElement(ht.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:en,height:240,onChange:nn}),r.a.createElement("div",{className:je.a["tip-container"],onClick:Pn},r.a.createElement("a",{className:je.a["btn-send"],onClick:Xt}," ","\u53D1\u9001"," "))))},Ie={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},$e;(function(R){R[R.GET_DISCUSSES=0]="GET_DISCUSSES",R[R.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",R[R.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",R[R.PLUS_DISCUSS=3]="PLUS_DISCUSS",R[R.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",R[R.SET_PAGE=5]="SET_PAGE",R[R.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})($e||($e={}));function xt(R,K){switch(K.type){case $e.SHOW_DISCUSSES_LOADING:return Object(h.a)(Object(h.a)({},R),{},{loading:!0});case $e.GET_DISCUSSES:return Object(h.a)(Object(h.a)({},R),K.payload);case $e.TOP_OR_DOWN_DISCUSS:return Object(h.a)(Object(h.a)({},R),K.payload);case $e.SET_ACTION_TYPE:return Object(h.a)(Object(h.a)({},R),K.payload);case $e.PLUS_DISCUSS:return Object(h.a)(Object(h.a)({},R),K.payload);case $e.SET_PAGE:return Object(h.a)(Object(h.a)({},R),{},{page:K.payload});case $e.ACTIVE_DISCUSS_INDEX:return Object(h.a)(Object(h.a)({},R),K.payload);default:throw new Error}}var Ft=function(R){var K=R.user,ee=R.identifier,Y=R.hack,Ee=R.onTriggerPraise,Ye=Object(a.useReducer)(xt,Ie),lt=Object(p.a)(Ye,2),vt=lt[0],We=lt[1],_t=vt.loading,Lt=vt.page,Mt=vt.data,en=vt.count,Rt=vt.actionType,nn=vt.activeDiscussIndex,tn=Object(a.useCallback)(Object(n.a)(i.a.mark(function fn(){var gn,vn,Yt;return i.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return We({type:$e.SHOW_DISCUSSES_LOADING}),Kt.next=3,Te(ee,Lt);case 3:gn=Kt.sent,vn=gn.comments,Yt=gn.disscuss_count,We({type:$e.GET_DISCUSSES,payload:{data:vn,count:Yt,loading:!1}});case 6:case"end":return Kt.stop()}},fn)})),[Lt,ee]);Object(a.useEffect)(function(){tn()},[ee,Lt]);function Pn(fn){We({type:$e.SET_PAGE,page:fn})}function Xt(fn){We({type:$e.SET_ACTION_TYPE,payload:{actionType:fn}})}function On(fn){nn===fn?We({type:$e.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):We({type:$e.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:fn}})}function An(fn,gn,vn){return Ln.apply(this,arguments)}function Ln(){return Ln=Object(n.a)(i.a.mark(function fn(gn,vn,Yt){var Tt;return i.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.prev=0,bt.next=3,De(gn);case 3:Tt=bt.sent,Mt[Yt].user_praise=vn,Mt[Yt].praise_count=Tt.praise_count,We({type:$e.PLUS_DISCUSS,payload:{data:Object(ae.a)(Mt)}}),bt.next=12;break;case 9:bt.prev=9,bt.t0=bt.catch(0),console.log(bt.t0);case 12:case"end":return bt.stop()}},fn,null,[[0,9]])})),Ln.apply(this,arguments)}function wn(){return In.apply(this,arguments)}function In(){return In=Object(n.a)(i.a.mark(function fn(){var gn,vn,Yt,Tt,Kt,bt,qt,kt;return i.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:if(gn=Rt.id,vn=Rt.params,Yt=Rt.type,Tt=Rt.index,Kt=Rt.parentDiscussIndex,!(Yt==="hidden-discuss")){un.next=6;break}return un.next=4,Ot(ee,gn,vn);case 4:Kt?Mt[Kt].children[Tt].hidden=vn.hidden==1:Mt[Tt].hidden=vn.hidden==1,We({type:$e.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ae.a)(Mt)}});case 6:if(!(Yt==="delete-discuss")){un.next=31;break}return un.next=9,yt(ee,gn);case 9:if(!(Kt||Kt===0)){un.next=22;break}bt=Mt[Kt].children,qt=bt.length-1;case 12:if(!(qt>=0)){un.next=19;break}if(!(bt[qt].id===gn)){un.next=16;break}return bt.splice(qt,1),un.abrupt("break",19);case 16:qt--,un.next=12;break;case 19:Mt[Kt].children=bt,un.next=30;break;case 22:kt=Mt.length-1;case 23:if(!(kt>=0)){un.next=30;break}if(!(Mt[kt].id===gn)){un.next=27;break}return Mt.splice(kt,1),un.abrupt("break",30);case 27:kt--,un.next=23;break;case 30:We({type:$e.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ae.a)(Mt)}});case 31:case"end":return un.stop()}},fn)})),In.apply(this,arguments)}function Gn(){We({type:$e.SET_ACTION_TYPE,payload:{actionType:null}})}function ar(fn,gn){return Xn.apply(this,arguments)}function Xn(){return Xn=Object(n.a)(i.a.mark(function fn(gn,vn){return i.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.prev=0,Tt.next=3,Ze(ee,gn,vn);case 3:tn(),Tt.next=9;break;case 6:Tt.prev=6,Tt.t0=Tt.catch(0),console.log(Tt.t0);case 9:case"end":return Tt.stop()}},fn,null,[[0,6]])})),Xn.apply(this,arguments)}function _n(fn){return Wn.apply(this,arguments)}function Wn(){return Wn=Object(n.a)(i.a.mark(function fn(gn){return i.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return We({type:$e.SHOW_DISCUSSES_LOADING}),Yt.next=3,pt(ee,gn);case 3:tn();case 4:case"end":return Yt.stop()}},fn)})),Wn.apply(this,arguments)}return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"discuss-panel"},Mt.length===0?r.a.createElement(Et.a,null):Mt.map(function(fn,gn){return r.a.createElement(le,{onReplyDiscuss:ar,onPlusDiscuss:An,onSetActiveDiscussIndex:On,onSetActionType:Xt,data:fn,index:gn,user:K,activeDiscussIndex:nn})}),en>10?r.a.createElement("div",{className:"pagination-container"},r.a.createElement(ue.a,{showQuickJumper:!0,onChange:Pn,current:Lt,total:en})):null),r.a.createElement(ft,{user_praise:Y.user_praise,praise_count:Y.praises_count,praisePlus:Ee,discuss_count:Y.comments_count,onCreateDiscuss:_n}),r.a.createElement(de.a,null,r.a.createElement(m.a,{centered:!0,title:"\u63D0\u793A",visible:!!Rt,onOk:wn,onCancel:Gn},r.a.createElement("p",null,Rt?Rt.message:"")),r.a.createElement(_e.a,null)))},ct=k("9kvl"),Ut={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},$t={1:"#2fa34f",2:"#0152d9",3:"#fa6400"},Vt=function(R){var K,ee=R.hack,Y=R.onTriggerPraise,Ee=R.topicId,Ye=R.page,lt=R.onPageChange,vt=R.user,We=R.submitRecords,_t=R.submitting,Lt=R.submitResult,Mt=Object(a.useState)("0"),en=Object(p.a)(Mt,2),Rt=en[0],nn=en[1],tn=Object(x.h)(),Pn=Object(a.useState)(!1),Xt=Object(p.a)(Pn,2),On=Xt[0],An=Xt[1],Ln=Object(a.useState)([]),wn=Object(p.a)(Ln,2),In=wn[0],Gn=wn[1],ar=Object(a.useState)(Object(h.a)(Object(h.a)({},Object(x.i)()),{},{page:1,per_page:20,name:""})),Xn=Object(p.a)(ar,2),_n=Xn[0],Wn=Xn[1];function fn(Tt){var Kt=Tt.target.id;nn(Kt)}Object(a.useEffect)(function(){var Tt=ie.a.subscribe("to-commit-info",function(){nn("1")});return Tt},[]);function gn(){nn("2")}function vn(){return Yt.apply(this,arguments)}function Yt(){return Yt=Object(n.a)(i.a.mark(function Tt(){var Kt;return i.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Object(qe.a)("/api/problems/my_hack_list.json",{method:"get",params:Object(h.a)({identifier:_n==null?void 0:_n.id},_n)});case 2:Kt=qt.sent,Gn(Kt);case 4:case"end":return qt.stop()}},Tt)})),Yt.apply(this,arguments)}return console.log(We,"submitRecords"),r.a.createElement("div",{className:et.a["left-panel"]},r.a.createElement("ul",{className:"".concat(et.a["s-navs"]," ").concat(et.a["bg-white"]," ").concat(et.a.b1)},r.a.createElement("li",null,r.a.createElement("a",{className:Rt==="0"?et.a.active:"",id:"0",onClick:fn},"\u4EFB\u52A1\u63CF\u8FF0")),r.a.createElement("li",null,r.a.createElement("a",{className:Rt==="1"?et.a.active:"",id:"1",onClick:fn},"\u63D0\u4EA4\u8BB0\u5F55")),tn.query.type!=="exercises"&&r.a.createElement("li",null,r.a.createElement("a",{className:Rt==="2"?et.a.active:"",id:"2",onClick:fn},"\u8BC4\u8BBA"))),r.a.createElement("div",{className:"".concat(et.a["tab-panel-body"]," ").concat(Rt==="0"?"":"hide")},r.a.createElement(pe,{hack:ee,onTriggerPraise:Y,toDiscuss:gn})),r.a.createElement("div",{style:{padding:"0 12px"},className:"".concat(et.a["tab-panel-body"]," ").concat(Rt==="1"?"":"hide")},!!(We!=null&&We.records_count)||_t?r.a.createElement(St,{page:Ye,onPageChange:lt,topicId:Ee,submitting:_t,submitRecords:We,submitResult:Lt}):r.a.createElement(Et.a,null)),r.a.createElement("div",{className:"".concat(et.a["tab-panel-body"]," ").concat(Rt==="2"?"":"hide"),style:{padding:0}},r.a.createElement(Ft,{user:vt,identifier:ee.identifier,hack:ee,onTriggerPraise:Y})),r.a.createElement(Re.a,{className:et.a.drawer,headerStyle:{background:"#000",border:0},closable:!1,title:r.a.createElement("div",{style:{display:"flex",alignItems:"center"}},r.a.createElement("span",{style:{color:"#fff"}},"\u9898\u76EE\u5217\u8868"),r.a.createElement(se.a.Search,{onSearch:function(Kt){_n.name=Kt,_n.page=1,Wn(Object(h.a)({},_n)),vn()},style:{width:180,margin:"0px 20px",marginLeft:"auto"},placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22"}),r.a.createElement(V.a,{style:{width:100},placeholder:"\u8BF7\u9009\u62E9\u96BE\u5EA6",onChange:function(Kt){_n.page=1,_n.difficult=Kt||null,Wn(Object(h.a)({},_n)),vn()}},r.a.createElement(V.a.Option,{value:0},"\u5168\u90E8"),r.a.createElement(V.a.Option,{value:1},"\u7B80\u5355"),r.a.createElement(V.a.Option,{value:2},"\u9002\u4E2D"),r.a.createElement(V.a.Option,{value:3},"\u56F0\u96BE"))),bodyStyle:{background:"#0f1e31",padding:"20px 0px"},footerStyle:{background:"#0f1e31",border:0,textAlign:"center"},footer:r.a.createElement("div",null,r.a.createElement(ue.a,{current:_n.page,className:"mt10 mb10",hideOnSinglePage:!0,total:In==null?void 0:In.count,pageSize:_n.per_page,onChange:function(Kt,bt){_n.page=Kt,_n.per_page=bt,vn()}})),width:530,placement:"left",onClose:function(){return An(!1)},visible:On},In==null||((K=In.data)===null||K===void 0)?void 0:K.map(function(Tt,Kt){return r.a.createElement("div",{onClick:Object(n.a)(i.a.mark(function bt(){var qt;return i.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:return Yn.next=2,Object(qe.a)("/api/problems/".concat(Tt==null?void 0:Tt.identifier,"/start.json"),{method:"get",params:{hack_user_id:vt==null?void 0:vt.user_id}});case 2:qt=Yn.sent,qt&&(ct.d.replace("/myproblems/".concat(qt==null?void 0:qt.identifier,"?type=1")),window.location.reload());case 4:case"end":return Yn.stop()}},bt)})),className:"".concat(et.a.list," ").concat(Tt!=null&&Tt.checked?et.a.active:"")},r.a.createElement("div",null,(Tt==null?void 0:Tt.opened)&&(Tt==null?void 0:Tt.passed)&&r.a.createElement("i",{className:"iconfont icon-wancheng1 c-green-29b"}),(Tt==null?void 0:Tt.opened)&&!(Tt!=null&&Tt.passed)&&r.a.createElement("i",{className:"iconfont icon-cuowu c-red"}),r.a.createElement("span",{style:{color:"rgb(186, 196, 205)",fontWeight:400,fontSize:14,marginLeft:10}},Tt.name)),r.a.createElement("span",{style:{color:$t[Tt.difficult]}},Ut[Tt.difficult]))})),(ee==null?void 0:ee.is_program)&&r.a.createElement("div",{onClick:function(){vn(),An(!0)},className:et.a.btns},r.a.createElement("i",{className:"iconfont icon-timuliebiao"}),r.a.createElement("span",null,"\u9898\u76EE\u5217\u8868")))},At=k("oFv4"),Tn=k.n(At),Fn=k("+aKw"),Sn=k("S/kP"),Wt=k.n(Sn),hn=k("t/PP"),Mn=k.n(hn),Bn=o.a.Countdown,ut={Java:"java",C:"c",Python:"py","C++":"c"},Ct;(function(R){R[R.SET_LOADING=0]="SET_LOADING",R[R.GET_DATA=1]="GET_DATA",R[R.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",R[R.SET_DATA=3]="SET_DATA",R[R.SET_DEBUGING=4]="SET_DEBUGING",R[R.SET_SUBMITING=5]="SET_SUBMITING",R[R.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",R[R.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",R[R.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",R[R.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",R[R.SET_PAGE=10]="SET_PAGE"})(Ct||(Ct={}));function Hn(){return new Date().getTime()}var pr={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function ur(R,K){switch(K.type){case Ct.GET_DATA:return Object(h.a)(Object(h.a)({},R),K.payload);case Ct.SET_DATA:return Object(h.a)(Object(h.a)({},R),{},{data:K.payload});case Ct.SET_LOADING:return Object(h.a)(Object(h.a)({},R),{},{loading:K.payload});case Ct.SET_SHOW_NOTE:return Object(h.a)(Object(h.a)({},R),{},{showNote:K.payload});case Ct.SET_DEBUGING:return Object(h.a)(Object(h.a)({},R),{},{debuging:K.payload});case Ct.SET_SUBMITING:return Object(h.a)(Object(h.a)({},R),{},{submitting:K.payload});case Ct.GET_SUBMIT_RECORDS:return Object(h.a)(Object(h.a)({},R),{},{submitRecords:K.payload});case Ct.SET_PAGE:return Object(h.a)(Object(h.a)({},R),{},{submitRecordPage:K.payload});case Ct.SET_EXECUTE_MESSAGE:return Object(h.a)(Object(h.a)({},R),{},{executingMessage:K.payload});case Ct.SET_EXECUTE_RESULT:return Object(h.a)(Object(h.a)({},R),K.payload);case Ct.SET_SUBMIT_RESULT:return Object(h.a)(Object(h.a)({},R),K.payload);default:throw new Error}}var kr=oe.default=function(R){var K,ee,Y,Ee,Ye=R.children,lt=Object(a.useReducer)(ur,pr),vt=Object(p.a)(lt,2),We=vt[0],_t=vt[1],Lt=Object(x.i)(),Mt=Lt.id,en=Object(x.g)(),Rt=Object(x.h)(),nn=We.loading,tn=We.data,Pn=We.debugResult,Xt=We.submitResult,On=We.submitRecords,An=We.submitRecordPage,Ln=We.showNote,wn=We.debuging,In=We.submitting,Gn=We.executingMessage,ar=Object(a.useState)("#FFF"),Xn=Object(p.a)(ar,2),_n=Xn[0],Wn=Xn[1],fn=Object(a.useState)(null),gn=Object(p.a)(fn,2),vn=gn[0],Yt=gn[1],Tt=Object(a.useState)({}),Kt=Object(p.a)(Tt,2),bt=Kt[0],qt=Kt[1],kt=Object(a.useState)(!0),Yn=Object(p.a)(kt,2),un=Yn[0],Qn=Yn[1],Kr=Object(a.useState)(!1),wr=Object(p.a)(Kr,2),Vr=wr[0],Nr=wr[1],Rr=Object(a.useRef)(null),Gr=Object(a.useRef)(0),zn=tn==null?void 0:tn.user,Gt=tn==null?void 0:tn.hack,Xr=Object(a.useRef)(),br=Object(a.useRef)();Object(a.useEffect)(function(){var ln;if(clearTimeout(Xr.current),clearTimeout(br.current),bt!=null&&(ln=bt.exercise)!==null&&ln!==void 0&&ln.left_time){var Ht,sn;if((bt==null||((Ht=bt.exercise)===null||Ht===void 0)?void 0:Ht.left_time)>1800){var Pt;br.current=setTimeout(function(){m.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670930\u5206\u949F",icon:r.a.createElement(s.a,null),okText:"\u77E5\u9053\u4E86"})},((bt==null||((Pt=bt.exercise)===null||Pt===void 0)?void 0:Pt.left_time)-1800)*1e3)}if((bt==null||((sn=bt.exercise)===null||sn===void 0)?void 0:sn.left_time)>900){var mn;Xr.current=setTimeout(function(){m.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670915\u5206\u949F",icon:r.a.createElement(s.a,null),okText:"\u77E5\u9053\u4E86"})},((bt==null||((mn=bt.exercise)===null||mn===void 0)?void 0:mn.left_time)-900)*1e3)}}},[bt]),Object(a.useEffect)(function(){function ln(){return Ht.apply(this,arguments)}function Ht(){return Ht=Object(n.a)(i.a.mark(function sn(){var Pt,mn,kn,tr,Sr,nr,bn,Nn,Yr,jr,Jn,vr;return i.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return Qn(!0),sr.next=3,Object(O.d)(Mt);case 3:if(Pt=sr.sent,setTimeout(function(){Qn(!1)},800),Pt.status===401)document.location.href="/user/login";else{try{Pt.hack.code=U.Base64.decode(Pt.hack.code)}catch(zr){console.log(zr)}Pt.hack=Object(h.a)(Object(h.a)({},Pt.hack),{},{is_program:(Rt==null||((mn=Rt.query)===null||mn===void 0)?void 0:mn.type)==="1"}),_t({type:Ct.GET_DATA,payload:{loading:!1,data:Pt}})}if(!(Rt.query.type==="exercises")){sr.next=18;break}if(!(Rt.query.coursesId=="coursesId")){sr.next=13;break}return sr.next=10,Object(_.Z)({categoryId:Rt.query.exercisesId,login:Rt.query.login});case 10:nr=sr.sent,sr.next=16;break;case 13:return sr.next=15,Object(_.z)({categoryId:Rt.query.exercisesId,login:Rt.query.login});case 15:nr=sr.sent;case 16:qt(Object(h.a)({},nr)),(kn=nr)!==null&&kn!==void 0&&kn.left_banner_id&&(tr=nr)!==null&&tr!==void 0&&(Sr=tr.exercise)!==null&&Sr!==void 0&&Sr.left_time&&(Yt(Date.now()+((bn=nr)===null||bn===void 0||((Nn=bn.exercise)===null||Nn===void 0)?void 0:Nn.left_time)*1e3),setTimeout(function(){Wn("red")},(((Yr=nr)===null||Yr===void 0||((jr=Yr.exercise)===null||jr===void 0)?void 0:jr.left_time)-300>0?((Jn=nr)===null||Jn===void 0||((vr=Jn.exercise)===null||vr===void 0)?void 0:vr.left_time)-300:0)*1e3));case 18:case"end":return sr.stop()}},sn)})),Ht.apply(this,arguments)}Mt&&ln()},[Mt]),Object(a.useEffect)(function(){return Rt.query.type==="exercises"&&(window.addEventListener(Object(b.c)(),Bt),window.focus(),window.onblur=function(){Object(b.a)()&&Object(b.b)()}),function(){document.removeEventListener(Object(b.c)(),Bt)}},[Mt]),Object(a.useEffect)(function(){Mt&&Gt!==null&&Gt!==void 0&&Gt.language&&Zt()},[Mt,An,Gt==null?void 0:Gt.language]),Object(a.useEffect)(function(){return Gt!=null&&Gt.is_program&&(Gr.current=0,Rr.current=setInterval(function(){ni()},15e3)),function(){clearInterval(Rr.current)}},[Gt==null?void 0:Gt.is_program]);var ni=function(){var ln=Object(n.a)(i.a.mark(function Ht(){var sn;return i.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Object(qe.a)("/api/myproblems/".concat(Mt,"/save_long_time.json"),{method:"get",params:{answer_long_time:Gr.current}});case 2:sn=mn.sent;case 3:case"end":return mn.stop()}},Ht)}));return function(){return ln.apply(this,arguments)}}(),Bt=function(){window.parent.postMessage("backExercise","*")};function Zt(){return zt.apply(this,arguments)}function zt(){return zt=Object(n.a)(i.a.mark(function ln(){var Ht;return i.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.prev=0,Pt.next=3,Object(O.f)(Mt,{limit:15,page:An,language:Gt==null?void 0:Gt.language});case 3:Ht=Pt.sent,_t({type:Ct.GET_SUBMIT_RECORDS,payload:Ht}),Pt.next=10;break;case 7:Pt.prev=7,Pt.t0=Pt.catch(0),console.log(Pt.t0);case 10:case"end":return Pt.stop()}},ln,null,[[0,7]])})),zt.apply(this,arguments)}function rn(ln){_t({type:Ct.SET_PAGE,payload:ln})}function on(){return Cn.apply(this,arguments)}function Cn(){return Cn=Object(n.a)(i.a.mark(function ln(){var Ht;return i.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(O.k)(Mt,{code:U.Base64.encode(Gt.code),language:Gt==null?void 0:Gt.language});case 2:return Ht=Pt.sent,Pt.abrupt("return",Ht);case 4:case"end":return Pt.stop()}},ln)})),Cn.apply(this,arguments)}function cn(){return jn.apply(this,arguments)}function jn(){return jn=Object(n.a)(i.a.mark(function ln(){var Ht,sn,Pt,mn,kn,tr,Sr,nr;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:if(!In){Nn.next=2;break}return Nn.abrupt("return");case 2:return _t({type:Ct.SET_SUBMITING,payload:!0}),Nn.prev=3,ie.a.publish("to-commit-info"),Nn.next=7,on();case 7:if(Ht=Nn.sent,console.log(Ht,1),!(Ht.status===0)){Nn.next=23;break}return nr=function(){return nr=Object(n.a)(i.a.mark(function jr(){var Jn,vr,Cr,sr,zr,wi,Br;return i.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,Object(O.c)(Mt,"submit");case 2:if(Jn=Er.sent,vr=Jn.status,Cr=Jn.data,sr=Hn(),zr=sr-tr>(kn+3)*1e3,vr!==0&&!zr&&setTimeout(Sr,1e3),!zr){Er.next=12;break}return m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),_t({type:Ct.SET_SUBMITING,payload:!1}),Er.abrupt("return");case 12:if(!(vr===0)){Er.next=19;break}return Cr.status===2&&m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),(Cr==null?void 0:Cr.status)===0&&(Rt==null||((wi=Rt.query)===null||wi===void 0)?void 0:wi.type)==="1"&&Nr(!0),Er.next=17,Object(O.f)(Mt,{limit:15,page:An,language:Gt==null?void 0:Gt.language});case 17:Br=Er.sent,_t({type:Ct.SET_SUBMIT_RESULT,payload:Object(h.a)(Object(h.a)({},We),{},{submitResult:Cr,submitting:!1,submitRecords:Br})});case 19:case"end":return Er.stop()}},jr)})),nr.apply(this,arguments)},Sr=function(){return nr.apply(this,arguments)},Pt={},Rt.query.type==="exercises"&&(Pt.extras={exercise_id:Rt.query.exercisesId,question_id:Rt.query.questionId}),Nn.next=16,Object(O.h)(Mt,Pt);case 16:if(mn=Nn.sent,!(mn.status===-1&&Rt!==null&&Rt!==void 0&&(sn=Rt.query)!==null&&sn!==void 0&&sn.coursesId)){Nn.next=20;break}return window.parent.location.href="/classrooms/".concat(Rt.query.coursesId,"/exercise/").concat(Rt.query.exercisesId,"/detail"),Nn.abrupt("return");case 20:kn=Gt.time_limit,tr=Hn(),Sr();case 23:Nn.next=29;break;case 25:Nn.prev=25,Nn.t0=Nn.catch(3),console.log(Nn.t0),_t({type:Ct.SET_SUBMITING,payload:!1});case 29:case"end":return Nn.stop()}},ln,null,[[3,25]])})),jn.apply(this,arguments)}function or(){return an.apply(this,arguments)}function an(){return an=Object(n.a)(i.a.mark(function ln(){var Ht,sn,Pt,mn,kn,tr,Sr;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return We.debuging=!0,_t({type:Ct.SET_DEBUGING,payload:!0}),bn.prev=2,bn.next=5,on();case 5:if(Ht=bn.sent,!(Ht.status===0)){bn.next=22;break}return Sr=function(){return Sr=Object(n.a)(i.a.mark(function Yr(){var jr,Jn,vr,Cr,sr,zr;return i.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:return Br.next=2,Object(O.c)(Mt,"debug");case 2:if(jr=Br.sent,Jn=jr.status,vr=jr.message,Cr=jr.data,sr=Hn(),zr=sr-kn>(sn+3)*1e3,Jn!==0&&!zr&&(_t({type:Ct.SET_EXECUTE_MESSAGE,payload:vr}),setTimeout(tr,1e3)),!zr){Br.next=13;break}return m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:Ct.SET_DEBUGING,payload:!1}),Br.abrupt("return");case 13:Jn===0&&(_t({type:Ct.SET_DEBUGING,payload:!1}),Cr.status===2&&m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Cr.status===2&&m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:Ct.SET_EXECUTE_RESULT,payload:Object(h.a)(Object(h.a)({},We),{},{debugResult:Cr,debuging:!1})}));case 14:case"end":return Br.stop()}},Yr)})),Sr.apply(this,arguments)},tr=function(){return Sr.apply(this,arguments)},sn=Gt.time_limit,Pt={input:encodeURIComponent(tn.test_case.input)},Rt.query.type==="exercises"&&(Pt.exercise_id=Rt.query.exercisesId),bn.next=14,Object(O.b)(Mt,Pt);case 14:if(mn=bn.sent,!(mn.status===-1&&Rt.query.coursesId)){bn.next=18;break}return window.parent.location.href="/classrooms/".concat(Rt.query.coursesId,"/exercise/").concat(Rt.query.exercisesId,"/detail"),bn.abrupt("return");case 18:kn=Hn(),tr(),bn.next=23;break;case 22:_t({type:Ct.SET_DEBUGING,payload:!1});case 23:bn.next=28;break;case 25:bn.prev=25,bn.t0=bn.catch(2),console.log(bn.t0);case 28:return bn.prev=28,bn.finish(28);case 30:case"end":return bn.stop()}},ln,null,[[2,25,28,30]])})),an.apply(this,arguments)}function _r(ln){_t({type:Ct.SET_DATA,payload:Object(h.a)(Object(h.a)({},tn),{},{hack:Object(h.a)(Object(h.a)({},Gt),{},{code:ln})})})}var En=function(){var ln=Object(n.a)(i.a.mark(function Ht(sn){var Pt,mn;return i.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,Object(qe.a)("/api/problems/".concat(Gt==null?void 0:Gt.identifier,"/start.json"),{method:"get",params:{language:sn==="C++"||sn==="c++"?encodeURIComponent(sn):sn,hack_user_id:zn==null?void 0:zn.user_id}});case 2:Pt=tr.sent,Pt.status!==-1&&en.replace("/myproblems/".concat(Pt==null?void 0:Pt.identifier,"?type=").concat(Rt==null||((mn=Rt.query)===null||mn===void 0)?void 0:mn.type));case 4:case"end":return tr.stop()}},Ht)}));return function(sn){return ln.apply(this,arguments)}}();function qn(ln){var Ht=ln.target.value;_t({type:Ct.SET_DATA,payload:Object(h.a)(Object(h.a)({},tn),{},{test_case:{input:Ht}})})}function er(){return mr.apply(this,arguments)}function mr(){return mr=Object(n.a)(i.a.mark(function ln(){var Ht;return i.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.prev=0,Pt.next=3,Object(O.g)(Mt);case 3:Ht=Pt.sent,Ht.status===401?en.replace("/login",{from:Rt.pathname}):_r(U.Base64.decode(Ht.code)),Pt.next=10;break;case 7:Pt.prev=7,Pt.t0=Pt.catch(0),console.log(Pt.t0);case 10:case"end":return Pt.stop()}},ln,null,[[0,7]])})),mr.apply(this,arguments)}function Wi(){m.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:r.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",r.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(n.a)(i.a.mark(function Ht(){var sn;return i.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Object(O.i)(Mt);case 2:sn=mn.sent,sn.status===401?en.replace("/login",{from:Rt.pathname}):_r(U.Base64.decode(sn.code));case 4:case"end":return mn.stop()}},Ht)}))()}})}function xn(){_t({type:Ct.SET_SHOW_NOTE,payload:!0})}function pn(){_t({type:Ct.SET_SHOW_NOTE,payload:!1})}function yn(ln){return gr.apply(this,arguments)}function gr(){return gr=Object(n.a)(i.a.mark(function ln(Ht){return i.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(O.a)(Mt,Ht);case 2:_t({type:Ct.GET_DATA,payload:{showNote:!1,data:Object(h.a)(Object(h.a)({},tn),{},{hack:Object(h.a)(Object(h.a)({},Gt),{},{notes:Ht.notes})})}});case 3:case"end":return Pt.stop()}},ln)})),gr.apply(this,arguments)}var Qr={hack:Gt,isLoading:un,input:tn==null||((K=tn.test_case)===null||K===void 0)?void 0:K.input,language:Gt==null?void 0:Gt.language,code:Gt==null?void 0:Gt.code,title:"main."+ut[Gt==null?void 0:Gt.language],modify_code:Gt==null?void 0:Gt.modify_code,notes:Gt==null?void 0:Gt.notes,debugResult:Pn,debuging:wn,submitting:In,executingMessage:Gn,onCancelNote:pn,onAddNote:yn,showNote:Ln,user:zn,onShowNote:xn,onSubmitCode:cn,onChangeCode:_r,onChangeInput:qn,onDebugCode:or,onResetCode:er,onSyncCode:Wi,onUpdateCode:on,onChangeLanguage:En};function qr(){return ri.apply(this,arguments)}function ri(){return ri=Object(n.a)(i.a.mark(function ln(){var Ht,sn,Pt;return i.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(O.j)(Gt.id,{container_type:"Hack",type:1});case 2:Ht=kn.sent,sn=Ht.praise_count,Pt=Object(h.a)(Object(h.a)({},tn),{},{hack:Object(h.a)(Object(h.a)({},Gt),{},{praises_count:sn,user_praise:!Gt.user_praise})}),_t({type:Ct.SET_DATA,payload:Pt});case 6:case"end":return kn.stop()}},ln)})),ri.apply(this,arguments)}var Ti={topicId:Mt,submitResult:Xt,submitRecords:On,submitting:In,page:An,onPageChange:rn,hack:Gt,user:tn==null?void 0:tn.user,onTriggerPraise:qr};return r.a.createElement(r.a.Fragment,null,r.a.createElement(M.a,{spinning:nn,delay:500},tn?r.a.createElement(r.a.Fragment,null,r.a.createElement("header",{className:H.a.header},Rt.query.type!=="exercises"&&r.a.createElement("div",null,r.a.createElement("img",{src:"".concat(f.a.IMG_SERVER,"/images/").concat(zn.image_url),alt:"user",width:30}),r.a.createElement("span",null,zn.name)),r.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},r.a.createElement("div",null,Gt.name),(Gt==null?void 0:Gt.is_program)&&r.a.createElement(Fn.a,{defaultValue:Gt==null?void 0:Gt.answer_long_time,onChange:function(Ht){console.log(Ht),Gr.current=Ht},className:"font12 c-grey-999"})),zn.hack_manager?r.a.createElement(L.a,{className:H.a.btn_back,to:(Rt==null||((ee=Rt.query)===null||ee===void 0)?void 0:ee.type)==="1"?"/problems/".concat(Gt.identifier,"/edit?type=1"):"/problems/".concat(Gt.identifier,"/edit"),style:{marginRight:10}}," ",r.a.createElement(S.a,null)," \u7F16\u8F91"):null,(bt==null||((Y=bt.exercise)===null||Y===void 0)?void 0:Y.left_time)&&r.a.createElement(r.a.Fragment,null,r.a.createElement("span",{style:{color:_n},className:"iconfont icon-kaoshishichang mr5"}),r.a.createElement("span",{className:"c-white mr20"},r.a.createElement(Bn,{valueStyle:{color:_n,fontSize:16,fontWeight:"normal"},title:r.a.createElement("span",{style:{color:_n,fontSize:16}},"\u5269\u4F59\u65F6\u95F4\uFF1A"),value:vn,onFinish:Object(n.a)(i.a.mark(function ln(){var Ht,sn;return i.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Object(_.ab)({categoryId:Rt.query.exercisesId,commit_method:2});case 2:Ht=mn.sent,(Ht==null?void 0:Ht.status)===0&&(on(),m.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:r.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",r.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var kn=Object(n.a)(i.a.mark(function Sr(){return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:window.parent.location.href="/classrooms/".concat(Rt.query.coursesId,"/exercise/").concat(Rt.query.exercisesId,"/detail");case 1:case"end":return bn.stop()}},Sr)}));function tr(){return kn.apply(this,arguments)}return tr}()})),(Ht==null?void 0:Ht.status)===-3&&(sn=parseInt(Ht==null?void 0:Ht.message),Yt(Date.now()+sn*1e3));case 5:case"end":return mn.stop()}},ln)}))}))),(Rt==null||((Ee=Rt.query)===null||Ee===void 0)?void 0:Ee.type)==="exercises"?r.a.createElement(W.a,{type:"primary",onClick:function(){on(),m.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc"},"\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"),onOk:function(){Bt()}})}},r.a.createElement("span",{className:"iconfont icon-yiguanbi mr5 font14"})," ","\u8FD4\u56DE\u8BD5\u5377"):r.a.createElement("span",{className:H.a.btn_back,onClick:function(){var Ht;if((Rt==null||((Ht=Rt.query)===null||Ht===void 0)?void 0:Ht.type)==="1"){var sn,Pt=(sn=localStorage.getItem("program_homework"))===null||sn===void 0?void 0:sn.split(",");en.push("/classrooms/".concat(Pt==null?void 0:Pt[0],"/program_homework/").concat(Pt==null?void 0:Pt[1],"/detail"))}else en.push("/problemset")}}," ",r.a.createElement(w.a,null),"\u9000\u51FA")),r.a.createElement(M.a,{size:"large",spinning:un},r.a.createElement(g.a,{className:"my-problems",leftChild:r.a.createElement(Vt,Ti),rightChild:r.a.createElement(I,Qr)}))):null,r.a.createElement(m.a,{centered:!0,closable:!1,width:680,footer:null,visible:Vr,className:"oj-modal"},r.a.createElement("section",{className:"oj-modal-content"},r.a.createElement("div",{className:"oj-modal-head"},r.a.createElement("img",{src:Tn.a,alt:""}),r.a.createElement("i",{onClick:function(){return Nr(!1)},className:"iconfont icon-guanbi1"})),r.a.createElement("aside",null,r.a.createElement("img",{className:"mr30",src:Mn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",r.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Xt==null?void 0:Xt.execute_time,"ms"),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Xt==null?void 0:Xt.time_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("aside",{className:"mb50"},r.a.createElement("img",{src:Wt.a,className:"mr30"}),r.a.createElement("span",{className:"oj-modal-tt"},r.a.createElement("span",null,r.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),r.a.createElement("span",{className:"c-light-primary"},Xt==null?void 0:Xt.execute_memory,"kb")),r.a.createElement("span",null,r.a.createElement("span",null))),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Xt==null?void 0:Xt.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("div",{id:"oj-modal-next",onClick:Object(n.a)(i.a.mark(function ln(){var Ht,sn,Pt;return i.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(!(Xt!=null&&Xt.next_identifier)){kn.next=7;break}return kn.next=3,Object(qe.a)("/api/problems/".concat(Xt==null?void 0:Xt.next_identifier,"/start.json"),{method:"get",params:{hack_user_id:zn==null?void 0:zn.user_id}});case 3:Ht=kn.sent,Ht&&(en.replace("/myproblems/".concat(Ht==null?void 0:Ht.identifier,"?type=1")),window.location.reload()),kn.next=9;break;case 7:Pt=(sn=localStorage.getItem("program_homework"))===null||sn===void 0?void 0:sn.split(","),en.push("/classrooms/".concat(Pt==null?void 0:Pt[0],"/program_homework/").concat(Pt==null?void 0:Pt[1],"/detail"));case 9:case"end":return kn.stop()}},ln)})),className:"oj-modal-btn"},Xt!=null&&Xt.next_identifier?"\u8FDB\u5165\u4E0B\u4E00\u9898":"\u56DE\u5230\u4F5C\u4E1A\u8BE6\u60C5\u9875")))))};function J(R){var K,ee=R.title,Y=R.modify_code,Ee=R.onSyncCode,Ye=R.onShowCodeSetting,lt=R.onResetCode,vt=R.hack,We=R.onChangeLanguage,_t=function(){m.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:r.a.createElement(C.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:lt})};return console.log(vt,"hack"),r.a.createElement("div",{className:"action-bar",style:{paddingLeft:0}},(vt==null?void 0:vt.is_program)&&r.a.createElement(V.a,{className:"oj-select",value:vt==null?void 0:vt.language,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:We},vt==null||((K=vt.all_language)===null||K===void 0)?void 0:K.map(function(Lt){return r.a.createElement(V.a.Option,{key:Lt,value:Lt},Lt)})),r.a.createElement("span",null),Y?r.a.createElement("a",{title:"\u66F4\u65B0\u901A\u77E5",onClick:Ee},r.a.createElement("img",{src:N.a,alt:"notice"})):null,r.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:_t},r.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),r.a.createElement("a",{onClick:Ye},r.a.createElement("i",{className:"iconfont icon-shezhi"})))}function I(R){var K=R.input,ee=R.showNote,Y=R.onShowNote,Ee=R.notes,Ye=R.onCancelNote,lt=R.onAddNote,vt=R.debugResult,We=R.language,_t=R.debuging,Lt=R.submitting,Mt=R.executingMessage,en=R.code,Rt=R.onSubmitCode,nn=R.onDebugCode,tn=R.onChangeCode,Pn=R.onChangeInput,Xt=R.onUpdateCode,On=R.user,An=R.isLoading,Ln=Object(X.a)(R,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode","user","isLoading"]);function wn(Gn){return r.a.createElement(J,Object(Z.a)({},Ln,{onShowCodeSetting:Gn}))}var In=Object(h.a)({input:K,debugResult:vt,debuging:_t,submitting:Lt,executingMessage:Mt,onDebugCode:nn,onChangeCode:tn,onSubmitCode:Rt,onChangeInput:Pn,user:On},Ln);return r.a.createElement("div",{className:"right-panel"},r.a.createElement(E.a,{isLoading:An,language:We,value:en,onChange:tn,ActionBarRender:wn}),r.a.createElement("div",{className:"note-form-area ".concat(ee?"active":"")},r.a.createElement(ve,{onCancel:Ye,notes:Ee,callback:lt})),r.a.createElement(T.b,In))}},RELg:function(Fe,oe,k){var Z=k("MFOe"),X=Z.Global;Fe.exports={name:"oldIE-userDataStorage",write:G,read:W,each:n,remove:D,clearAll:m};var P="storejs",V=X.document,j=c(),M=(X.navigator?X.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function G(o,d){if(M)return;var i=h(o);j(function(a){a.setAttribute(i,d),a.save(P)})}function W(o){if(M)return;var d=h(o),i=null;return j(function(a){i=a.getAttribute(d)}),i}function n(o){j(function(d){for(var i=d.XMLDocument.documentElement.attributes,a=i.length-1;a>=0;a--){var r=i[a];o(d.getAttribute(r.name),r.name)}})}function D(o){var d=h(o);j(function(i){i.removeAttribute(d),i.save(P)})}function m(){j(function(o){var d=o.XMLDocument.documentElement.attributes;o.load(P);for(var i=d.length-1;i>=0;i--)o.removeAttribute(d[i].name);o.save(P)})}var p=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function h(o){return o.replace(/^\d/,"___$&").replace(p,"___")}function c(){if(!V||!V.documentElement||!V.documentElement.addBehavior)return null;var o="script",d,i,a;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+o+">document.w=window</"+o+'><iframe src="/favicon.ico"></iframe>'),i.close(),d=i.w.frames[0].document,a=d.createElement("div")}catch(r){a=V.createElement("div"),d=V.body}return function(r){var s=[].slice.call(arguments,0);s.unshift(a),d.appendChild(a),a.addBehavior("#default#userData"),a.load(P),r.apply(this,s),d.removeChild(a);return}}},"S+dL":function(Fe,oe){Fe.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0U3Nzk1NkY5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0U3Nzk1NzA5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RTc3OTU2RDlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"S/kP":function(Fe,oe,k){Fe.exports=k.p+"static/time.a3dc82f3.svg"},"SA+Z":function(Fe,oe,k){var Z=k("wTVA"),X=k("EbDI"),P=k("ZhPi"),V=k("wkBT");function j(M){return Z(M)||X(M)||P(M)||V()}Fe.exports=j,Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports},SJMd:function(Fe,oe){/**
* @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 k,Z,X,P=!1,V,j;window.PR_SHOULD_USE_CONTINUATION=!0;var M,G;(function(){var W=window,n=["break,continue,do,else,for,if,return,while"],D=[n,"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"],m=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[m,"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"],h=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[m,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",d=[m,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",a=[n,"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"],r=[n,"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"],s=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[p,c,h,d,i,a,r,s],w=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",L="kwd",O="com",_="typ",b="lit",g="pun",f="pln",C="tag",E="dec",v="src",N="atn",U="atv",A="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function F(ze){for(var Qe=0,at=!1,he=!1,Se=0,Le=ze.length;Se<Le;++Se){var Me=ze[Se];if(Me.ignoreCase)he=!0;else if(/[a-z]/i.test(Me.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){at=!0,he=!1;break}}var qe={b:8,t:9,n:10,v:11,f:12,r:13};function st(Ae){var Ce=Ae.charCodeAt(0);if(Ce!==92)return Ce;var Xe=Ae.charAt(1);return Ce=qe[Xe],Ce||("0"<=Xe&&Xe<="7"?parseInt(Ae.substring(1),8):Xe==="u"||Xe==="x"?parseInt(Ae.substring(2),16):Ae.charCodeAt(1))}function mt(Ae){if(Ae<32)return(Ae<16?"\\x0":"\\x")+Ae.toString(16);var Ce=String.fromCharCode(Ae);return Ce==="\\"||Ce==="-"||Ce==="]"||Ce==="^"?"\\"+Ce:Ce}function gt(Ae){var Ce=Ae.substring(1,Ae.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Xe=[],Je=Ce[0]==="^",ke=["["];Je&&ke.push("^");for(var Ke=Je?1:0,ye=Ce.length;Ke<ye;++Ke){var ce=Ce[Ke];if(/\\[bdsw]/i.test(ce))ke.push(ce);else{var pe=st(ce),ie;Ke+2<ye&&Ce[Ke+1]==="-"?(ie=st(Ce[Ke+2]),Ke+=2):ie=pe,Xe.push([pe,ie]),ie<65||pe>122||(ie<65||pe>90||Xe.push([Math.max(65,pe)|32,Math.min(ie,90)|32]),ie<97||pe>122||Xe.push([Math.max(97,pe)&~32,Math.min(ie,122)&~32]))}}Xe.sort(function(Te,De){return Te[0]-De[0]||De[1]-Te[1]});for(var ae=[],de=[],Ke=0;Ke<Xe.length;++Ke){var ge=Xe[Ke];ge[0]<=de[1]+1?de[1]=Math.max(de[1],ge[1]):ae.push(de=ge)}for(var Ke=0;Ke<ae.length;++Ke){var ge=ae[Ke];ke.push(mt(ge[0])),ge[1]>ge[0]&&(ge[1]+1>ge[0]&&ke.push("-"),ke.push(mt(ge[1])))}return ke.push("]"),ke.join("")}function St(Ae){for(var Ce=Ae.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Xe=Ce.length,Je=[],ke=0,Ke=0;ke<Xe;++ke){var ye=Ce[ke];if(ye==="(")++Ke;else if(ye.charAt(0)==="\\"){var ce=+ye.substring(1);ce&&(ce<=Ke?Je[ce]=-1:Ce[ke]=mt(ce))}}for(var ke=1;ke<Je.length;++ke)Je[ke]===-1&&(Je[ke]=++Qe);for(var ke=0,Ke=0;ke<Xe;++ke){var ye=Ce[ke];if(ye==="(")++Ke,Je[Ke]||(Ce[ke]="(?:");else if(ye.charAt(0)==="\\"){var ce=+ye.substring(1);ce&&ce<=Ke&&(Ce[ke]="\\"+Je[ce])}}for(var ke=0;ke<Xe;++ke)Ce[ke]==="^"&&Ce[ke+1]!=="^"&&(Ce[ke]="");if(Ae.ignoreCase&&at)for(var ke=0;ke<Xe;++ke){var ye=Ce[ke],pe=ye.charAt(0);ye.length>=2&&pe==="["?Ce[ke]=gt(ye):pe!=="\\"&&(Ce[ke]=ye.replace(/[a-zA-Z]/g,function(de){var ge=de.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Ce.join("")}for(var Et=[],Se=0,Le=ze.length;Se<Le;++Se){var Me=ze[Se];if(Me.global||Me.multiline)throw new Error(""+Me);Et.push("(?:"+St(Me)+")")}return new RegExp(Et.join("|"),he?"gi":"g")}function T(ze,Qe){var at=/(?:^|\s)nocode(?:\s|$)/,he=[],Se=0,Le=[],Me=0;function qe(st){var mt=st.nodeType;if(mt==1){if(at.test(st.className))return;for(var gt=st.firstChild;gt;gt=gt.nextSibling)qe(gt);var St=st.nodeName.toLowerCase();(St==="br"||St==="li")&&(he[Me]=`
`,Le[Me<<1]=Se++,Le[Me++<<1|1]=st)}else if(mt==3||mt==4){var Et=st.nodeValue;Et.length&&(Qe?Et=Et.replace(/\r\n?/g,`
`):Et=Et.replace(/[ \t\r\n]+/g," "),he[Me]=Et,Le[Me<<1]=Se,Se+=Et.length,Le[Me++<<1|1]=st)}}return qe(ze),{sourceCode:he.join("").replace(/\n$/,""),spans:Le}}function z(ze,Qe,at,he,Se){if(!at)return;var Le={sourceNode:ze,pre:1,langExtension:null,numberLines:null,sourceCode:at,spans:null,basePos:Qe,decorations:null};he(Le),Se.push.apply(Se,Le.decorations)}var Q=/\S/;function ne(ze){for(var Qe=void 0,at=ze.firstChild;at;at=at.nextSibling){var he=at.nodeType;Qe=he===1?Qe?ze:at:he===3&&Q.test(at.nodeValue)?ze:Qe}return Qe===ze?void 0:Qe}function se(ze,Qe){var at={},he;(function(){for(var Me=ze.concat(Qe),qe=[],st={},mt=0,gt=Me.length;mt<gt;++mt){var St=Me[mt],Et=St[3];if(Et)for(var Ae=Et.length;--Ae>=0;)at[Et.charAt(Ae)]=St;var Ce=St[1],Xe=""+Ce;st.hasOwnProperty(Xe)||(qe.push(Ce),st[Xe]=null)}qe.push(/[\0-\uffff]/),he=F(qe)})();var Se=Qe.length,Le=function(Me){for(var qe=Me.sourceCode,st=Me.basePos,mt=Me.sourceNode,gt=[st,f],St=0,Et=qe.match(he)||[],Ae={},Ce=0,Xe=Et.length;Ce<Xe;++Ce){var Je=Et[Ce],ke=Ae[Je],Ke=void 0,ye;if(typeof ke=="string")ye=!1;else{var ce=at[Je.charAt(0)];if(ce)Ke=Je.match(ce[1]),ke=ce[0];else{for(var pe=0;pe<Se;++pe)if(ce=Qe[pe],Ke=Je.match(ce[1]),Ke){ke=ce[0];break}Ke||(ke=f)}ye=ke.length>=5&&ke.substring(0,5)==="lang-",ye&&!(Ke&&typeof Ke[1]=="string")&&(ye=!1,ke=v),ye||(Ae[Je]=ke)}var ie=St;if(St+=Je.length,!ye)gt.push(st+ie,ke);else{var ae=Ke[1],de=Je.indexOf(ae),ge=de+ae.length;Ke[2]&&(ge=Je.length-Ke[2].length,de=ge-ae.length);var Te=ke.substring(5);z(mt,st+ie,Je.substring(0,de),Le,gt),z(mt,st+ie+de,ae,ue(Te,ae),gt),z(mt,st+ie+ge,Je.substring(ge),Le,gt)}}Me.decorations=gt};return Le}function xe(ze){var Qe=[],at=[];ze.tripleQuotedStrings?Qe.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ze.multiLineStrings?Qe.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Qe.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ze.verbatimStrings&&at.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var he=ze.hashComments;he&&(ze.cStyleComments?(he>1?Qe.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Qe.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),at.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Qe.push([O,/^#[^\r\n]*/,null,"#"])),ze.cStyleComments&&(at.push([O,/^\/\/[^\r\n]*/,null]),at.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Se=ze.regexLiterals;if(Se){var Le=Se>1?"":`
\r`,Me=Le?".":"[\\S\\s]",qe="/(?=[^/*"+Le+"])(?:[^/\\x5B\\x5C"+Le+"]|\\x5C"+Me+"|\\x5B(?:[^\\x5C\\x5D"+Le+"]|\\x5C"+Me+")*(?:\\x5D|$))+/";at.push(["lang-regex",RegExp("^"+H+"("+qe+")")])}var st=ze.types;st&&at.push([_,st]);var mt=(""+ze.keywords).replace(/^ | $/g,"");mt.length&&at.push([L,new RegExp("^(?:"+mt.replace(/[\s,]+/g,"|")+")\\b"),null]),Qe.push([f,/^\s+/,null,` \r
\xA0`]);var gt="^.[^\\s\\w.$@'\"`/\\\\]*";return ze.regexLiterals&&(gt+="(?!s*/)"),at.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[g,new RegExp(gt),null]),se(Qe,at)}var me=xe({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ve(ze,Qe,at){for(var he=/(?:^|\s)nocode(?:\s|$)/,Se=/\r\n?|\n/,Le=ze.ownerDocument,Me=Le.createElement("li");ze.firstChild;)Me.appendChild(ze.firstChild);var qe=[Me];function st(Ce){var Xe=Ce.nodeType;if(Xe==1&&!he.test(Ce.className))if(Ce.nodeName==="br")mt(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var Je=Ce.firstChild;Je;Je=Je.nextSibling)st(Je);else if((Xe==3||Xe==4)&&at){var ke=Ce.nodeValue,Ke=ke.match(Se);if(Ke){var ye=ke.substring(0,Ke.index);Ce.nodeValue=ye;var ce=ke.substring(Ke.index+Ke[0].length);if(ce){var pe=Ce.parentNode;pe.insertBefore(Le.createTextNode(ce),Ce.nextSibling)}mt(Ce),ye||Ce.parentNode.removeChild(Ce)}}}function mt(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function Xe(Ke,ye){var ce=ye?Ke.cloneNode(!1):Ke,pe=Ke.parentNode;if(pe){var ie=Xe(pe,1),ae=Ke.nextSibling;ie.appendChild(ce);for(var de=ae;de;de=ae)ae=de.nextSibling,ie.appendChild(de)}return ce}for(var Je=Xe(Ce.nextSibling,0),ke;(ke=Je.parentNode)&&ke.nodeType===1;)Je=ke;qe.push(Je)}for(var gt=0;gt<qe.length;++gt)st(qe[gt]);Qe===(Qe|0)&&qe[0].setAttribute("value",Qe);var St=Le.createElement("ol");St.className="linenums";for(var Et=Math.max(0,Qe-1|0)||0,gt=0,Ae=qe.length;gt<Ae;++gt)Me=qe[gt],Me.className="L"+(gt+Et)%10,Me.firstChild||Me.appendChild(Le.createTextNode("\xA0")),St.appendChild(Me);ze.appendChild(St)}function Oe(ze){var Qe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Qe=Qe&&+Qe[1]<=8;var at=/\n/g,he=ze.sourceCode,Se=he.length,Le=0,Me=ze.spans,qe=Me.length,st=0,mt=ze.decorations,gt=mt.length,St=0;mt[gt]=Se;var Et,Ae;for(Ae=Et=0;Ae<gt;)mt[Ae]!==mt[Ae+2]?(mt[Et++]=mt[Ae++],mt[Et++]=mt[Ae++]):Ae+=2;for(gt=Et,Ae=Et=0;Ae<gt;){for(var Ce=mt[Ae],Xe=mt[Ae+1],Je=Ae+2;Je+2<=gt&&mt[Je+1]===Xe;)Je+=2;mt[Et++]=Ce,mt[Et++]=Xe,Ae=Je}gt=mt.length=Et;var ke=ze.sourceNode,Ke="";ke&&(Ke=ke.style.display,ke.style.display="none");try{for(var ye=null;st<qe;){var ce=Me[st],pe=Me[st+2]||Se,ie=mt[St+2]||Se,Je=Math.min(pe,ie),ae=Me[st+1],de;if(ae.nodeType!==1&&(de=he.substring(Le,Je))){Qe&&(de=de.replace(at,"\r")),ae.nodeValue=de;var ge=ae.ownerDocument,Te=ge.createElement("span");Te.className=mt[St+1];var De=ae.parentNode;De.replaceChild(Te,ae),Te.appendChild(ae),Le<pe&&(Me[st+1]=ae=ge.createTextNode(he.substring(Je,pe)),De.insertBefore(ae,Te.nextSibling))}Le=Je,Le>=pe&&(st+=2),Le>=ie&&(St+=2)}}finally{ke&&(ke.style.display=Ke)}}var Re={};function fe(ze,Qe){for(var at=Qe.length;--at>=0;){var he=Qe[at];Re.hasOwnProperty(he)?W.console&&console.warn("cannot override language handler %s",he):Re[he]=ze}}function ue(ze,Qe){return ze&&Re.hasOwnProperty(ze)||(ze=/^\s*</.test(Qe)?"default-markup":"default-code"),Re[ze]}fe(me,["default-code"]),fe(se([],[[f,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[g,/^(?:<[%?]|[%?]>)/],["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"]),fe(se([[f,/^[\s]+/,null,` \r
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[g,/^[=<>\/]+/],["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"]),fe(se([],[[U,/^[\s\S]+/]]),["uq.val"]),fe(xe({keywords:p,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),fe(xe({keywords:"null,true,false"}),["json"]),fe(xe({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),fe(xe({keywords:h,cStyleComments:!0}),["java"]),fe(xe({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),fe(xe({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),fe(xe({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),fe(xe({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),fe(xe({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),fe(xe({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),fe(se([],[[x,/^[\s\S]+/]]),["regex"]);function Pe(ze){var Qe=ze.langExtension;try{var at=T(ze.sourceNode,ze.pre),he=at.sourceCode;ze.sourceCode=he,ze.spans=at.spans,ze.basePos=0,ue(Qe,he)(ze),Oe(ze)}catch(Se){W.console&&console.log(Se&&Se.stack||Se)}}function et(ze,Qe,at){var he=at||!1,Se=Qe||null,Le=document.createElement("div");Le.innerHTML="<pre>"+ze+"</pre>",Le=Le.firstChild,he&&ve(Le,he,!0);var Me={langExtension:Se,numberLines:he,sourceNode:Le,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Pe(Me),Le.innerHTML}function rt(ze,Qe){var at=Qe||document.body,he=at.ownerDocument||document;function Se(ce){return at.getElementsByTagName(ce)}for(var Le=[Se("pre"),Se("code"),Se("xmp")],Me=[],qe=0;qe<Le.length;++qe)for(var st=0,mt=Le[qe].length;st<mt;++st)Me.push(Le[qe][st]);Le=null;var gt=Date;gt.now||(gt={now:function(){return+new Date}});var St=0,Et=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ae=/\bprettyprint\b/,Ce=/\bprettyprinted\b/,Xe=/pre|xmp/i,Je=/^code$/i,ke=/^(?:pre|code|xmp)$/i,Ke={};function ye(){for(var ce=W.PR_SHOULD_USE_CONTINUATION?gt.now()+250:Infinity;St<Me.length&&gt.now()<ce;St++){for(var pe=Me[St],ie=Ke,ae=pe;ae=ae.previousSibling;){var de=ae.nodeType,ge=(de===7||de===8)&&ae.nodeValue;if(ge?!/^\??prettify\b/.test(ge):de!==3||/\S/.test(ae.nodeValue))break;if(ge){ie={},ge.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ve,je,ht){ie[je]=ht});break}}var Te=pe.className;if((ie!==Ke||Ae.test(Te))&&!Ce.test(Te)){for(var De=!1,Ze=pe.parentNode;Ze;Ze=Ze.parentNode){var pt=Ze.tagName;if(ke.test(pt)&&Ze.className&&Ae.test(Ze.className)){De=!0;break}}if(!De){pe.className+=" prettyprinted";var Ot=ie.lang;if(!Ot){Ot=Te.match(Et);var yt;!Ot&&(yt=ne(pe))&&Je.test(yt.tagName)&&(Ot=yt.className.match(Et)),Ot&&(Ot=Ot[1])}var ot;if(Xe.test(pe.tagName))ot=1;else{var He=pe.currentStyle,Ge=he.defaultView,Ue=He?He.whiteSpace:Ge&&Ge.getComputedStyle?Ge.getComputedStyle(pe,null).getPropertyValue("white-space"):0;ot=Ue&&Ue.substring(0,3)==="pre"}var le=ie.linenums;(le=le==="true"||+le)||(le=Te.match(/\blinenums\b(?::(\d+))?/),le=le?le[1]&&le[1].length?+le[1]:!0:!1),le&&ve(pe,le,ot);var _e={langExtension:Ot,sourceNode:pe,numberLines:le,pre:ot,sourceCode:null,basePos:null,spans:null,decorations:null};Pe(_e)}}}St<Me.length?W.setTimeout(ye,250):typeof ze=="function"&&ze()}ye()}var tt=W.PR={createSimpleLexer:se,registerLangHandler:fe,sourceDecorator:xe,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:U,PR_COMMENT:O,PR_DECLARATION:E,PR_KEYWORD:L,PR_LITERAL:b,PR_NOCODE:A,PR_PLAIN:f,PR_PUNCTUATION:g,PR_SOURCE:v,PR_STRING:x,PR_TAG:C,PR_TYPE:_,prettyPrintOne:P?W.prettyPrintOne=et:M=et,prettyPrint:G=P?W.prettyPrint=rt:G=rt},it=W.define;typeof it=="function"&&it.amd&&it("google-code-prettify",[],function(){return tt})})()},T8No:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return G}),k.d(oe,"e",function(){return W}),k.d(oe,"c",function(){return g}),k.d(oe,"b",function(){return f}),k.d(oe,"d",function(){return C}),k.d(oe,"f",function(){return N});var Z=k("MNsG"),X=k("N0LK"),P=k("Cg/j");let V=Z.k||"";const j=new Map;j.set("false",!1),j.set("true",!0),j.set("isMac",Z.f),j.set("isLinux",Z.d),j.set("isWindows",Z.i),j.set("isWeb",Z.h),j.set("isMacNative",Z.f&&!Z.h),j.set("isEdge",V.indexOf("Edg/")>=0),j.set("isFirefox",V.indexOf("Firefox")>=0),j.set("isChrome",V.indexOf("Chrome")>=0),j.set("isSafari",V.indexOf("Safari")>=0);const M=Object.prototype.hasOwnProperty;class G{static has(A){return p.create(A)}static equals(A,H){return h.create(A,H)}static regex(A,H){return x.create(A,H)}static not(A){return i.create(A)}static and(...A){return _.create(A,null)}static or(...A){return b.create(A,null,!0)}static deserialize(A,H=!1){return A?this._deserializeOrExpression(A,H):void 0}static _deserializeOrExpression(A,H){let F=A.split("||");return b.create(F.map(T=>this._deserializeAndExpression(T,H)),null,!0)}static _deserializeAndExpression(A,H){let F=A.split("&&");return _.create(F.map(T=>this._deserializeOne(T,H)),null)}static _deserializeOne(A,H){if(A=A.trim(),A.indexOf("!=")>=0){let F=A.split("!=");return d.create(F[0].trim(),this._deserializeValue(F[1],H))}if(A.indexOf("==")>=0){let F=A.split("==");return h.create(F[0].trim(),this._deserializeValue(F[1],H))}if(A.indexOf("=~")>=0){let F=A.split("=~");return x.create(F[0].trim(),this._deserializeRegexValue(F[1],H))}if(A.indexOf(" in ")>=0){let F=A.split(" in ");return c.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const F=A.split(">=");return s.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const F=A.split(">");return r.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const F=A.split("<=");return w.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const F=A.split("<");return S.create(F[0].trim(),F[1].trim())}return/^\!\s*/.test(A)?i.create(A.substr(1).trim()):p.create(A)}static _deserializeValue(A,H){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let F=/^'([^']*)'$/.exec(A);return F?F[1].trim():A}static _deserializeRegexValue(A,H){if(Object(X.C)(A)){if(H)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let F=A.indexOf("/"),T=A.lastIndexOf("/");if(F===T||F<0){if(H)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let z=A.slice(F+1,T),Q=A[T+1]==="i"?"i":"";try{return new RegExp(z,Q)}catch(ne){if(H)throw new Error(`bad regexp-value '${A}', parse error: ${ne}`);return console.warn(`bad regexp-value '${A}', parse error: ${ne}`),null}}}function W(A,H){const F=A?A.substituteConstants():void 0,T=H?H.substituteConstants():void 0;return!F&&!T?!0:!F||!T?!1:F.equals(T)}function n(A,H){return A.cmp(H)}class D{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return m.INSTANCE}}D.INSTANCE=new D;class m{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}m.INSTANCE=new m;class p{constructor(A,H){this.key=A,this.negated=H,this.type=2}static create(A,H=null){const F=j.get(A);return typeof F=="boolean"?F?m.INSTANCE:D.INSTANCE:new p(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:E(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=j.get(this.key);return typeof A=="boolean"?A?m.INSTANCE:D.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this)),this.negated}}class h{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=4}static create(A,H,F=null){if(typeof H=="boolean")return H?p.create(A,F):i.create(A,F);const T=j.get(A);if(typeof T=="boolean"){const z=T?"true":"false";return H===z?m.INSTANCE:D.INSTANCE}return new h(A,H,F)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=j.get(this.key);if(typeof A=="boolean"){const H=A?"true":"false";return this.value===H?m.INSTANCE:D.INSTANCE}return this}evaluate(A){return A.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class c{constructor(A,H){this.key=A,this.valueKey=H,this.type=10,this.negated=null}static create(A,H){return new c(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const H=A.getValue(this.valueKey),F=A.getValue(this.key);return Array.isArray(H)?H.indexOf(F)>=0:typeof F=="string"&&typeof H=="object"&&H!==null?M.call(H,F):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(A){this._actual=A,this.type=11}static create(A){return new o(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=5}static create(A,H,F=null){if(typeof H=="boolean")return H?i.create(A,F):p.create(A,F);const T=j.get(A);if(typeof T=="boolean"){const z=T?"true":"false";return H===z?D.INSTANCE:m.INSTANCE}return new d(A,H,F)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=j.get(this.key);if(typeof A=="boolean"){const H=A?"true":"false";return this.value===H?D.INSTANCE:m.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class i{constructor(A,H){this.key=A,this.negated=H,this.type=3}static create(A,H=null){const F=j.get(A);return typeof F=="boolean"?F?D.INSTANCE:m.INSTANCE:new i(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:E(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=j.get(this.key);return typeof A=="boolean"?A?D.INSTANCE:m.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function a(A,H){if(typeof A=="string"){const F=parseFloat(A);isNaN(F)||(A=F)}return typeof A=="string"||typeof A=="number"?H(A):D.INSTANCE}class r{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=12}static create(A,H,F=null){return a(H,T=>new r(A,T,F))}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class s{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=13}static create(A,H,F=null){return a(H,T=>new s(A,T,F))}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=S.create(this.key,this.value,this)),this.negated}}class S{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=14}static create(A,H,F=null){return a(H,T=>new S(A,T,F))}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class w{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=15}static create(A,H,F=null){return a(H,T=>new w(A,T,F))}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class x{constructor(A,H){this.key=A,this.regexp=H,this.type=7,this.negated=null}static create(A,H){return new x(A,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const H=this.regexp?this.regexp.source:"",F=A.regexp?A.regexp.source:"";return H<F?-1:H>F?1:0}equals(A){if(A.type===this.type){const H=this.regexp?this.regexp.source:"",F=A.regexp?A.regexp.source:"";return this.key===A.key&&H===F}return!1}substituteConstants(){return this}evaluate(A){let H=A.getValue(this.key);return this.regexp?this.regexp.test(H):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(A){this._actual=A,this.type=8}static create(A){return new L(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(A){let H=null;for(let F=0,T=A.length;F<T;F++){const z=A[F].substituteConstants();if(A[F]!==z&&H===null){H=[];for(let Q=0;Q<F;Q++)H[Q]=A[Q]}H!==null&&(H[F]=z)}return H===null?A:H}class _{constructor(A,H){this.expr=A,this.negated=H,this.type=6}static create(A,H){return _._normalizeArr(A,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let H=0,F=this.expr.length;H<F;H++){const T=n(this.expr[H],A.expr[H]);if(T!==0)return T}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let H=0,F=this.expr.length;H<F;H++)if(!this.expr[H].equals(A.expr[H]))return!1;return!0}return!1}substituteConstants(){const A=O(this.expr);return A===this.expr?this:_.create(A,this.negated)}evaluate(A){for(let H=0,F=this.expr.length;H<F;H++)if(!this.expr[H].evaluate(A))return!1;return!0}static _normalizeArr(A,H){const F=[];let T=!1;for(const z of A){if(!z)continue;if(z.type===1){T=!0;continue}if(z.type===0)return D.INSTANCE;if(z.type===6){F.push(...z.expr);continue}F.push(z)}if(F.length===0&&T)return m.INSTANCE;if(F.length===0)return;if(F.length===1)return F[0];F.sort(n);for(let z=1;z<F.length;z++)F[z-1].equals(F[z])&&(F.splice(z,1),z--);if(F.length===1)return F[0];for(;F.length>1;){const z=F[F.length-1];if(z.type!==9)break;F.pop();const Q=F.pop(),ne=F.length===0,se=b.create(z.expr.map(xe=>_.create([xe,Q],null)),null,ne);se&&(F.push(se),F.sort(n))}return F.length===1?F[0]:new _(F,H)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let H of this.expr)A.push(...H.keys());return A}negate(){if(!this.negated){const A=[];for(let H of this.expr)A.push(H.negate());this.negated=b.create(A,this,!0)}return this.negated}}class b{constructor(A,H){this.expr=A,this.negated=H,this.type=9}static create(A,H,F){return b._normalizeArr(A,H,F)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let H=0,F=this.expr.length;H<F;H++){const T=n(this.expr[H],A.expr[H]);if(T!==0)return T}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let H=0,F=this.expr.length;H<F;H++)if(!this.expr[H].equals(A.expr[H]))return!1;return!0}return!1}substituteConstants(){const A=O(this.expr);return A===this.expr?this:b.create(A,this.negated,!1)}evaluate(A){for(let H=0,F=this.expr.length;H<F;H++)if(this.expr[H].evaluate(A))return!0;return!1}static _normalizeArr(A,H,F){let T=[],z=!1;if(A){for(let Q=0,ne=A.length;Q<ne;Q++){const se=A[Q];if(!se)continue;if(se.type===0){z=!0;continue}if(se.type===1)return m.INSTANCE;if(se.type===9){T=T.concat(se.expr);continue}T.push(se)}if(T.length===0&&z)return D.INSTANCE;T.sort(n)}if(T.length===0)return;if(T.length===1)return T[0];for(let Q=1;Q<T.length;Q++)T[Q-1].equals(T[Q])&&(T.splice(Q,1),Q--);if(T.length===1)return T[0];if(F){for(let Q=0;Q<T.length;Q++)for(let ne=Q+1;ne<T.length;ne++)N(T[Q],T[ne])&&(T.splice(ne,1),ne--);if(T.length===1)return T[0]}return new b(T,H)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let H of this.expr)A.push(...H.keys());return A}negate(){if(!this.negated){let A=[];for(let H of this.expr)A.push(H.negate());for(;A.length>1;){const H=A.shift(),F=A.shift(),T=[];for(const Q of U(H))for(const ne of U(F))T.push(_.create([Q,ne],null));const z=A.length===0;A.unshift(b.create(T,null,z))}this.negated=A[0]}return this.negated}}class g extends p{constructor(A,H,F){super(A,null);this._defaultValue=H,typeof F=="object"?g._info.push(Object.assign(Object.assign({},F),{key:A})):F!==!0&&g._info.push({key:A,description:F,type:H!=null?typeof H:void 0})}static all(){return g._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return h.create(this.key,A)}}g._info=[];const f=Object(P.c)("contextKeyService"),C="setContext";function E(A,H){return A<H?-1:A>H?1:0}function v(A,H,F,T){return A<F?-1:A>F?1:H<T?-1:H>T?1:0}function N(A,H){if(H.type===6&&A.type!==9&&A.type!==6){for(const z of H.expr)if(A.equals(z))return!0}const F=A.negate(),T=U(F).concat(U(H));T.sort(n);for(let z=0;z<T.length;z++){const Q=T[z],ne=Q.negate();for(let se=z+1;se<T.length;se++){const xe=T[se];if(ne.equals(xe))return!0}}return!1}function U(A){return A.type===9?A.expr:[A]}},TXwP:function(Fe,oe,k){var Z,X;(function(){var P;(function(){"use strict";var j=[,,function(n){function D(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var h=new D(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},D.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},D.prototype.has_match=function(h){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(h))return!0;return!1},D.prototype.set_indent=function(h,c){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(h){this.__items.push(h);var c=h.lastIndexOf(`
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},D.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function m(h,c){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),c=c||"",h.indent_level>0&&(c=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}m.prototype.get_indent_size=function(h,c){var o=this.__base_string_length;return c=c||0,h<0&&(o=0),o+=h*this.__indent_size,o+=c,o},m.prototype.get_indent_string=function(h,c){var o=this.__base_string;return c=c||0,h<0&&(h=0,o=""),c+=h*this.__indent_size,this.__ensure_cache(c),o+=this.__cache[c],o},m.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var h=this.__cache.length,c=0,o="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,o=new Array(c+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function p(h,c){this.__indent_cache=new m(h,c),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(h,c){return this.__indent_cache.get_indent_string(h,c)},p.prototype.get_indent_size=function(h,c){return this.__indent_cache.get_indent_size(h,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(h){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 o=this.__lines.join(`
`);return h!==`
`&&(o=o.replace(/[\n]/g,h)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(h,c){return h=h||0,c=c||0,this.next_line.set_indent(h,c),this.__lines.length>1?(this.current_line.set_indent(h,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(h){for(var c=0;c<h.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.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(" "))},p.prototype.remove_indent=function(h){for(var c=this.__lines.length;h<c;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(h,c){for(var o=this.__lines.length-2;o>=0;){var d=this.__lines[o];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=p},,,,function(n){function D(h,c){this.raw_options=m(h,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"])}D.prototype._get_array=function(h,c){var o=this.raw_options[h],d=c||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(d=o.concat()):typeof o=="string"&&(d=o.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(h,c){var o=this.raw_options[h],d=o===void 0?!!c:!!o;return d},D.prototype._get_characters=function(h,c){var o=this.raw_options[h],d=c||"";return typeof o=="string"&&(d=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},D.prototype._get_number=function(h,c){var o=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(o,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(h,c,o){var d=this._get_selection_list(h,c,o);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[h]+"'");return d[0]},D.prototype._get_selection_list=function(h,c,o){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[c[0]],!this._is_valid_selection(o,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,o);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[h]+"'");return d},D.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(o){return c.indexOf(o)===-1})};function m(h,c){var o={};h=p(h);var d;for(d in h)d!==c&&(o[d]=h[d]);if(c&&h[c])for(d in h[c])o[d]=h[c][d];return o}function p(h){var c={},o;for(o in h){var d=o.replace(/-/g,"_");c[d]=h[o]}return c}n.exports.Options=D,n.exports.normalizeOpts=p,n.exports.mergeOpts=m},,function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function m(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},m.prototype.peek=function(p){var h=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(h=this.__input.charAt(p)),h},m.prototype.__match=function(p,h){p.lastIndex=h;var c=p.exec(this.__input);return c&&!(D&&p.sticky)&&(c.index!==h&&(c=null)),c},m.prototype.test=function(p,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(p,h):!1},m.prototype.testChar=function(p,h){var c=this.peek(h);return p.lastIndex=0,c!==null&&p.test(c)},m.prototype.match=function(p){var h=this.__match(p,this.__position);return h?this.__position+=h[0].length:h=null,h},m.prototype.read=function(p,h,c){var o="",d;return p&&(d=this.match(p),d&&(o+=d[0])),h&&(d||!p)&&(o+=this.readUntil(h,c)),o},m.prototype.readUntil=function(p,h){var c="",o=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(o=d.index,h&&(o+=d[0].length)):o=this.__input_length,c=this.__input.substring(this.__position,o),this.__position=o,c},m.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},m.prototype.get_regexp=function(p,h){var c=null,o="g";return h&&D&&(o="y"),typeof p=="string"&&p!==""?c=new RegExp(p,o):p&&(c=new RegExp(p.source,o)),c},m.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(p){var h=this.__position,c=this.readUntilAfter(p);return this.__position=h,c},m.prototype.lookBack=function(p){var h=this.__position-1;return h>=p.length&&this.__input.substring(h-p.length,h).toLowerCase()===p},n.exports.InputScanner=m},,,,,function(n){function D(m,p){m=typeof m=="string"?m:m.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+p,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(m);h;)p[h[1]]=h[2],h=this.__directive_pattern.exec(m);return p},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},,function(n,D,m){var p=m(16).Beautifier,h=m(17).Options;function c(o,d){var i=new p(o,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,D,m){var p=m(17).Options,h=m(2).Output,c=m(8).InputScanner,o=m(13).Directives,d=new o(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,r=/\s/,s=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(L,O){this._source_text=L||"",this._options=new p(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}x.prototype.eatString=function(L){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return O},x.prototype.eatWhitespace=function(L){for(var O=r.test(this._input.peek()),_=0;r.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===`
`&&((_===0||_<this._options.max_preserve_newlines)&&(_++,this._output.add_new_line(!0)));return O},x.prototype.foundNestedPseudoClass=function(){for(var L=0,O=1,_=this._input.peek(O);_;){if(_==="{")return!0;if(_==="(")L+=1;else if(_===")"){if(L===0)return!1;L-=1}else if(_===";"||_==="}")return!1;O++,_=this._input.peek(O)}return!1},x.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},x.prototype.preserveSingleSpace=function(L){L&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,O=this._options.eol;O==="auto"&&(O=`
`,L&&i.test(L||"")&&(O=L.match(i)[0])),L=L.replace(a,`
`);var _=L.match(/^[\t ]*/)[0];this._output=new h(this._options,_),this._input=new c(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,g=!1,f=!1,C=!1,E=!1,v=!1,N=!1,U=this._ch,A=!1,H,F,T;H=this._input.read(s),F=H!=="",T=U,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),U=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(S),Q=d.get_directives(z);Q&&Q.ignore==="start"&&(z+=d.readIgnored(this._input)),this.print_string(z),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(w)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(F),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ne=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ne.match(/[ :]$/)&&(ne=this.eatString(": ").replace(/\s$/,""),this.print_string(ne),this._output.space_before_token=!0),ne=ne.replace(/\s$/,""),ne==="extend"?E=!0:ne==="import"&&(v=!0),ne in this.NESTED_AT_RULE?(this._nestedLevel+=1,ne in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!g&&b===0&&ne.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(F),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),C?(C=!1,g=this._indentLevel>=this._nestedLevel):g=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&g&&(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)):(T==="("?this._output.space_before_token=!1:T!==","&&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(),T==="{"&&this._output.trim(!0),v=!1,E=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),g=!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 se=0;se<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;se++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[se])){A=!0;break}(g||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&b===0?(this.print_string(":"),f||(f=!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 xe=T==='"'||T==="'";this.preserveSingleSpace(xe||F),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,b===0?(f&&(this.outdent(),f=!1),E=!1,v=!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(),b++,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(")")),b&&(b--,this.outdent()));else{var me=!1;this._input.lookBack("with")&&(me=!0),this.preserveSingleSpace(F||me),this.print_string(this._ch),f&&T==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,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&&(!f||N)&&b===0&&!v&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&b===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&&r.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(F),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),r.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 ve=T==='"'||T==="'";this.preserveSingleSpace(ve||F),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&A&&this._output.add_new_line()}var Oe=this._output.get_code(O);return Oe},n.exports.Beautifier=x},function(n,D,m){var p=m(6).Options;function h(c){p.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 o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<d.length;i++)d[i]!=="expand"?this.brace_style="collapse":this.brace_style=d[i]}h.prototype=new p,n.exports.Options=h}],M={};function G(n){var D=M[n];if(D!==void 0)return D.exports;var m=M[n]={exports:{}};return j[n](m,m.exports,G),m.exports}var W=G(15);P=W})();var V=P;!(Z=[],X=function(){return{css_beautify:V}}.apply(oe,Z),X!==void 0&&(Fe.exports=X))})()},U7T7:function(Fe,oe,k){},UZu5:function(Fe,oe,k){},Vhoy:function(Fe,oe,k){"use strict";k.d(oe,"d",function(){return V}),k.d(oe,"e",function(){return j}),k.d(oe,"c",function(){return M}),k.d(oe,"b",function(){return G}),k.d(oe,"a",function(){return W});var Z=k("MI8n");class X{constructor(){this._icons=new Map,this._onDidRegister=new Z.b}add(n){const D=this._icons.get(n.id);D?n.description?D.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const P=new X,V=P;function j(n,D){return new G(n,D)}function M(n){return n?n.replace(/\$\((.*?)\)/g,(D,m)=>` ${m} `).trim():""}class G{constructor(n,D,m){this.id=n,this.definition=D,this.description=m,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var W;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const D=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function m(c){if(c instanceof G)return["codicon","codicon-"+c.id];const o=D.exec(c.id);if(!o)return m(G.error);let[,d,i]=o;const a=["codicon","codicon-"+d];return i&&a.push("codicon-modifier-"+i.substr(1)),a}n.asClassNameArray=m;function p(c){return m(c).join(" ")}n.asClassName=p;function h(c){return"."+m(c).join(".")}n.asCSSSelector=h})(W||(W={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(G||(G={}))},"VrN/":function(Fe,oe,k){(function(Z,X){Fe.exports=X()})(this,function(){"use strict";var Z=navigator.userAgent,X=navigator.platform,P=/gecko\/\d/i.test(Z),V=/MSIE \d/.test(Z),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),M=/Edge\/(\d+)/.exec(Z),G=V||j||M,W=G&&(V?document.documentMode||6:+(M||j)[1]),n=!M&&/WebKit\//.test(Z),D=n&&/Qt\/\d+\.\d+/.test(Z),m=!M&&/Chrome\//.test(Z),p=/Opera\//.test(Z),h=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),o=/PhantomJS/.test(Z),d=!M&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),i=/Android/.test(Z),a=d||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),r=d||/Mac/.test(X),s=/\bCrOS\b/.test(Z),S=/win/i.test(X),w=p&&Z.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(p=!1,n=!0);var x=r&&(D||p&&(w==null||w<12.11)),L=P||G&&W>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,t){var u=e.className,l=O(t).exec(u);if(l){var y=u.slice(l.index+l[0].length);e.className=u.slice(0,l.index)+(y?l[1]+y:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function g(e,t){return b(e).appendChild(t)}function f(e,t,u,l){var y=document.createElement(e);if(u&&(y.className=u),l&&(y.style.cssText=l),typeof t=="string")y.appendChild(document.createTextNode(t));else if(t)for(var B=0;B<t.length;++B)y.appendChild(t[B]);return y}function C(e,t,u,l){var y=f(e,t,u,l);return y.setAttribute("role","presentation"),y}var E;document.createRange?E=function(e,t,u,l){var y=document.createRange();return y.setEnd(l||e,u),y.setStart(e,t),y}:E=function(e,t,u){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(y){return l}return l.collapse(!0),l.moveEnd("character",u),l.moveStart("character",t),l};function v(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 U(e,t){var u=e.className;O(t).test(u)||(e.className+=(u?" ":"")+t)}function A(e,t){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!O(u[l]).test(t)&&(t+=" "+u[l]);return t}var H=function(e){e.select()};d?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(H=function(e){try{e.select()}catch(t){}});function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function T(e,t,u){t||(t={});for(var l in e)e.hasOwnProperty(l)&&(u!==!1||!t.hasOwnProperty(l))&&(t[l]=e[l]);return t}function z(e,t,u,l,y){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=l||0,$=y||0;;){var q=e.indexOf(" ",B);if(q<0||q>=t)return $+(t-B);$+=q-B,$+=u-$%u,B=q+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};Q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Q.prototype.set=function(e,t){this.f=t;var u=+new Date+e;(!this.id||u<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=u)};function ne(e,t){for(var u=0;u<e.length;++u)if(e[u]==t)return u;return-1}var se=50,xe={toString:function(){return"CodeMirror.Pass"}},me={scroll:!1},ve={origin:"*mouse"},Oe={origin:"+move"};function Re(e,t,u){for(var l=0,y=0;;){var B=e.indexOf(" ",l);B==-1&&(B=e.length);var $=B-l;if(B==e.length||y+$>=t)return l+Math.min($,t-y);if(y+=B-l,y+=u-y%u,l=B+1,y>=t)return l}}var fe=[""];function ue(e){for(;fe.length<=e;)fe.push(Pe(fe)+" ");return fe[e]}function Pe(e){return e[e.length-1]}function et(e,t){for(var u=[],l=0;l<e.length;l++)u[l]=t(e[l],l);return u}function rt(e,t,u){for(var l=0,y=u(t);l<e.length&&u(e[l])<=y;)l++;e.splice(l,0,t)}function tt(){}function it(e,t){var u;return Object.create?u=Object.create(e):(tt.prototype=e,u=new tt),t&&T(t,u),u}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Qe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function at(e,t){return t?t.source.indexOf("\\w")>-1&&Qe(e)?!0:t.test(e):Qe(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Se=/[\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 Le(e){return e.charCodeAt(0)>=768&&Se.test(e)}function Me(e,t,u){for(;(u<0?t>0:t<e.length)&&Le(e.charAt(t));)t+=u;return t}function qe(e,t,u){for(var l=t>u?-1:1;;){if(t==u)return t;var y=(t+u)/2,B=l<0?Math.ceil(y):Math.floor(y);if(B==t)return e(B)?t:u;e(B)?u=B:t=B+l}}function st(e,t,u,l){if(!e)return l(t,u,"ltr",0);for(var y=!1,B=0;B<e.length;++B){var $=e[B];($.from<u&&$.to>t||t==u&&$.to==t)&&(l(Math.max($.from,t),Math.min($.to,u),$.level==1?"rtl":"ltr",B),y=!0)}y||l(t,u,"ltr")}var mt=null;function gt(e,t,u){var l;mt=null;for(var y=0;y<e.length;++y){var B=e[y];if(B.from<t&&B.to>t)return y;B.to==t&&(B.from!=B.to&&u=="before"?l=y:mt=y),B.from==t&&(B.from!=B.to&&u!="before"?l=y:mt=y)}return l!=null?l:mt}var St=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(re){return re<=247?e.charAt(re):1424<=re&&re<=1524?"R":1536<=re&&re<=1785?t.charAt(re-1536):1774<=re&&re<=2220?"r":8192<=re&&re<=8203?"w":re==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,B=/[LRr]/,$=/[Lb1n]/,q=/[1n]/;function te(re,be,we){this.level=re,this.from=be,this.to=we}return function(re,be){var we=be=="ltr"?"L":"R";if(re.length==0||be=="ltr"&&!l.test(re))return!1;for(var Be=re.length,Ne=[],nt=0;nt<Be;++nt)Ne.push(u(re.charCodeAt(nt)));for(var dt=0,wt=we;dt<Be;++dt){var It=Ne[dt];It=="m"?Ne[dt]=wt:wt=It}for(var Nt=0,Dt=we;Nt<Be;++Nt){var jt=Ne[Nt];jt=="1"&&Dt=="r"?Ne[Nt]="n":B.test(jt)&&(Dt=jt,jt=="r"&&(Ne[Nt]="R"))}for(var Qt=1,Jt=Ne[0];Qt<Be-1;++Qt){var dn=Ne[Qt];dn=="+"&&Jt=="1"&&Ne[Qt+1]=="1"?Ne[Qt]="1":dn==","&&Jt==Ne[Qt+1]&&(Jt=="1"||Jt=="n")&&(Ne[Qt]=Jt),Jt=dn}for(var Un=0;Un<Be;++Un){var hr=Ne[Un];if(hr==",")Ne[Un]="N";else if(hr=="%"){var Vn=void 0;for(Vn=Un+1;Vn<Be&&Ne[Vn]=="%";++Vn);for(var Fr=Un&&Ne[Un-1]=="!"||Vn<Be&&Ne[Vn]=="1"?"1":"N",Dr=Un;Dr<Vn;++Dr)Ne[Dr]=Fr;Un=Vn-1}}for(var rr=0,Mr=we;rr<Be;++rr){var yr=Ne[rr];Mr=="L"&&yr=="1"?Ne[rr]="L":B.test(yr)&&(Mr=yr)}for(var lr=0;lr<Be;++lr)if(y.test(Ne[lr])){var ir=void 0;for(ir=lr+1;ir<Be&&y.test(Ne[ir]);++ir);for(var $n=(lr?Ne[lr-1]:we)=="L",Pr=(ir<Be?Ne[ir]:we)=="L",ji=$n==Pr?$n?"L":"R":we,fi=lr;fi<ir;++fi)Ne[fi]=ji;lr=ir-1}for(var Tr=[],ti,fr=0;fr<Be;)if($.test(Ne[fr])){var co=fr;for(++fr;fr<Be&&$.test(Ne[fr]);++fr);Tr.push(new te(0,co,fr))}else{var ai=fr,Ei=Tr.length,xi=be=="rtl"?1:0;for(++fr;fr<Be&&Ne[fr]!="L";++fr);for(var Ar=ai;Ar<fr;)if(q.test(Ne[Ar])){ai<Ar&&(Tr.splice(Ei,0,new te(1,ai,Ar)),Ei+=xi);var Bi=Ar;for(++Ar;Ar<fr&&q.test(Ne[Ar]);++Ar);Tr.splice(Ei,0,new te(2,Bi,Ar)),Ei+=xi,ai=Ar}else++Ar;ai<fr&&Tr.splice(Ei,0,new te(1,ai,fr))}return be=="ltr"&&(Tr[0].level==1&&(ti=re.match(/^\s+/))&&(Tr[0].from=ti[0].length,Tr.unshift(new te(0,0,ti[0].length))),Pe(Tr).level==1&&(ti=re.match(/\s+$/))&&(Pe(Tr).to-=ti[0].length,Tr.push(new te(0,Be-ti[0].length,Be)))),be=="rtl"?Tr.reverse():Tr}}();function Et(e,t){var u=e.order;return u==null&&(u=e.order=St(e.text,t)),u}var Ae=[],Ce=function(e,t,u){if(e.addEventListener)e.addEventListener(t,u,!1);else if(e.attachEvent)e.attachEvent("on"+t,u);else{var l=e._handlers||(e._handlers={});l[t]=(l[t]||Ae).concat(u)}};function Xe(e,t){return e._handlers&&e._handlers[t]||Ae}function Je(e,t,u){if(e.removeEventListener)e.removeEventListener(t,u,!1);else if(e.detachEvent)e.detachEvent("on"+t,u);else{var l=e._handlers,y=l&&l[t];if(y){var B=ne(y,u);B>-1&&(l[t]=y.slice(0,B).concat(y.slice(B+1)))}}}function ke(e,t){var u=Xe(e,t);if(!u.length)return;for(var l=Array.prototype.slice.call(arguments,2),y=0;y<u.length;++y)u[y].apply(null,l)}function Ke(e,t,u){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,u||t.type,e,t),de(t)||t.codemirrorIgnore}function ye(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var u=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<t.length;++l)ne(u,t[l])==-1&&u.push(t[l])}function ce(e,t){return Xe(e,t).length>0}function pe(e){e.prototype.on=function(t,u){Ce(this,t,u)},e.prototype.off=function(t,u){Je(this,t,u)}}function ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ge(e){ie(e),ae(e)}function Te(e){return e.target||e.srcElement}function De(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),r&&e.ctrlKey&&t==1&&(t=3),t}var Ze=function(){if(G&&W<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),pt;function Ot(e){if(pt==null){var t=f("span","\u200B");g(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&W<8))}var u=pt?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var yt;function ot(e){if(yt!=null)return yt;var t=g(e,document.createTextNode("A\u062EA")),u=E(t,0,1).getBoundingClientRect(),l=E(t,1,2).getBoundingClientRect();return b(e),!u||u.left==u.right?!1:yt=l.right-u.right<3}var He=`
b`.split(/\n/).length!=3?function(e){for(var t=0,u=[],l=e.length;t<=l;){var y=e.indexOf(`
`,t);y==-1&&(y=e.length);var B=e.slice(t,e.charAt(y-1)=="\r"?y-1:y),$=B.indexOf("\r");$!=-1?(u.push(B.slice(0,$)),t+=$+1):(u.push(B),t=y+1)}return u}:function(e){return e.split(/\r\n?|\n/)},Ge=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(u){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ue=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),le=null;function _e(e){if(le!=null)return le;var t=g(e,f("span","x")),u=t.getBoundingClientRect(),l=E(t,0,1).getBoundingClientRect();return le=Math.abs(u.left-l.left)>1}var Ve={},je={};function ht(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ve[e]=t}function ft(e,t){je[e]=t}function Ie(e){if(typeof e=="string"&&je.hasOwnProperty(e))e=je[e];else if(e&&typeof e.name=="string"&&je.hasOwnProperty(e.name)){var t=je[e.name];typeof t=="string"&&(t={name:t}),e=it(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ie("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ie("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $e(e,t){t=Ie(t);var u=Ve[t.name];if(!u)return $e(e,"text/plain");var l=u(e,t);if(xt.hasOwnProperty(t.name)){var y=xt[t.name];for(var B in y){if(!y.hasOwnProperty(B))continue;l.hasOwnProperty(B)&&(l["_"+B]=l[B]),l[B]=y[B]}}if(l.name=t.name,t.helperType&&(l.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)l[$]=t.modeProps[$];return l}var xt={};function Ft(e,t){var u=xt.hasOwnProperty(e)?xt[e]:xt[e]={};T(t,u)}function ct(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var u={};for(var l in t){var y=t[l];y instanceof Array&&(y=y.concat([])),u[l]=y}return u}function Ut(e,t){for(var u;e.innerMode&&!(u=e.innerMode(t),!u||u.mode==e);)t=u.state,e=u.mode;return u||{mode:e,state:t}}function $t(e,t,u){return e.startState?e.startState(t,u):!0}var Vt=function(e,t,u){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};Vt.prototype.eol=function(){return this.pos>=this.string.length},Vt.prototype.sol=function(){return this.pos==this.lineStart},Vt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Vt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Vt.prototype.eat=function(e){var t=this.string.charAt(this.pos),u;if(typeof e=="string"?u=t==e:u=t&&(e.test?e.test(t):e(t)),u)return++this.pos,t},Vt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Vt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Vt.prototype.skipToEnd=function(){this.pos=this.string.length},Vt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Vt.prototype.backUp=function(e){this.pos-=e},Vt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.match=function(e,t,u){if(typeof e=="string"){var l=function($){return u?$.toLowerCase():$},y=this.string.substr(this.pos,e.length);if(l(y)==l(e))return t!==!1&&(this.pos+=e.length),!0}else{var B=this.string.slice(this.pos).match(e);return B&&B.index>0?null:(B&&t!==!1&&(this.pos+=B[0].length),B)}},Vt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Vt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Vt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Vt.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 u=e;!u.lines;)for(var l=0;;++l){var y=u.children[l],B=y.chunkSize();if(t<B){u=y;break}t-=B}return u.lines[t]}function Tn(e,t,u){var l=[],y=t.line;return e.iter(t.line,u.line+1,function(B){var $=B.text;y==u.line&&($=$.slice(0,u.ch)),y==t.line&&($=$.slice(t.ch)),l.push($),++y}),l}function Fn(e,t,u){var l=[];return e.iter(t,u,function(y){l.push(y.text)}),l}function Sn(e,t){var u=t-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function Wt(e){if(e.parent==null)return null;for(var t=e.parent,u=ne(t.lines,e),l=t.parent;l;t=l,l=l.parent)for(var y=0;!(l.children[y]==t);++y)u+=l.children[y].chunkSize();return u+t.first}function hn(e,t){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var y=e.children[l],B=y.height;if(t<B){e=y;continue e}t-=B,u+=y.chunkSize()}return u}while(!e.lines);for(var $=0;$<e.lines.length;++$){var q=e.lines[$],te=q.height;if(t<te)break;t-=te}return u+$}function Mn(e,t){return t>=e.first&&t<e.first+e.size}function Bn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ut(e,t,u){if(u===void 0&&(u=null),!(this instanceof ut))return new ut(e,t,u);this.line=e,this.ch=t,this.sticky=u}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function Hn(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function pr(e){return ut(e.line,e.ch)}function ur(e,t){return Ct(e,t)<0?t:e}function kr(e,t){return Ct(e,t)<0?e:t}function J(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function I(e,t){if(t.line<e.first)return ut(e.first,0);var u=e.first+e.size-1;return t.line>u?ut(u,At(e,u).text.length):R(t,At(e,t.line).text.length)}function R(e,t){var u=e.ch;return u==null||u>t?ut(e.line,t):u<0?ut(e.line,0):e}function K(e,t){for(var u=[],l=0;l<t.length;l++)u[l]=I(e,t[l]);return u}var ee=function(e,t){this.state=e,this.lookAhead=t},Y=function(e,t,u,l){this.state=t,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Y.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Y.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}},Y.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Y.fromSaved=function(e,t,u){return t instanceof ee?new Y(e,ct(e.mode,t.state),u,t.lookAhead):new Y(e,ct(e.mode,t),u)},Y.prototype.save=function(e){var t=e!==!1?ct(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function Ee(e,t,u,l){var y=[e.state.modeGen],B={};Rt(e,t.text,e.doc.mode,u,function(re,be){return y.push(re,be)},B,l);for(var $=u.state,q=function(re){u.baseTokens=y;var be=e.state.overlays[re],we=1,Be=0;u.state=!0,Rt(e,t.text,be.mode,u,function(Ne,nt){for(var dt=we;Be<Ne;){var wt=y[we];wt>Ne&&y.splice(we,1,Ne,y[we+1],wt),we+=2,Be=Math.min(Ne,wt)}if(!nt)return;if(be.opaque)y.splice(dt,we-dt,Ne,"overlay "+nt),we=dt+2;else for(;dt<we;dt+=2){var It=y[dt+1];y[dt+1]=(It?It+" ":"")+"overlay "+nt}},B),u.state=$,u.baseTokens=null,u.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)q(te);return{styles:y,classes:B.bgClass||B.textClass?B:null}}function Ye(e,t,u){if(!t.styles||t.styles[0]!=e.state.modeGen){var l=lt(e,Wt(t)),y=t.text.length>e.options.maxHighlightLength&&ct(e.doc.mode,l.state),B=Ee(e,t,l);y&&(l.state=y),t.stateAfter=l.save(!y),t.styles=B.styles,B.classes?t.styleClasses=B.classes:t.styleClasses&&(t.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function lt(e,t,u){var l=e.doc,y=e.display;if(!l.mode.startState)return new Y(l,!0,t);var B=nn(e,t,u),$=B>l.first&&At(l,B-1).stateAfter,q=$?Y.fromSaved(l,$,B):new Y(l,$t(l.mode),B);return l.iter(B,t,function(te){vt(e,te.text,q);var re=q.line;te.stateAfter=re==t-1||re%5==0||re>=y.viewFrom&&re<y.viewTo?q.save():null,q.nextLine()}),u&&(l.modeFrontier=q.line),q}function vt(e,t,u,l){var y=e.doc.mode,B=new Vt(t,e.options.tabSize,u);for(B.start=B.pos=l||0,t==""&&We(y,u.state);!B.eol();)_t(y,B,u.state),B.start=B.pos}function We(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var u=Ut(e,t);if(u.mode.blankLine)return u.mode.blankLine(u.state)}function _t(e,t,u,l){for(var y=0;y<10;y++){l&&(l[0]=Ut(e,u).mode);var B=e.token(t,u);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var Lt=function(e,t,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=u};function Mt(e,t,u,l){var y=e.doc,B=y.mode,$;t=I(y,t);var q=At(y,t.line),te=lt(e,t.line,u),re=new Vt(q.text,e.options.tabSize,te),be;for(l&&(be=[]);(l||re.pos<t.ch)&&!re.eol();)re.start=re.pos,$=_t(B,re,te.state),l&&be.push(new Lt(re,$,ct(y.mode,te.state)));return l?be:new Lt(re,$,te.state)}function en(e,t){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var l=u[1]?"bgClass":"textClass";t[l]==null?t[l]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(t[l])||(t[l]+=" "+u[2])}return e}function Rt(e,t,u,l,y,B,$){var q=u.flattenSpans;q==null&&(q=e.options.flattenSpans);var te=0,re=null,be=new Vt(t,e.options.tabSize,l),we,Be=e.options.addModeClass&&[null];for(t==""&&en(We(u,l.state),B);!be.eol();){if(be.pos>e.options.maxHighlightLength?(q=!1,$&&vt(e,t,l,be.pos),be.pos=t.length,we=null):we=en(_t(u,be,l.state,Be),B),Be){var Ne=Be[0].name;Ne&&(we="m-"+(we?Ne+" "+we:Ne))}if(!q||re!=we){for(;te<be.start;)te=Math.min(be.start,te+5e3),y(te,re);re=we}be.start=be.pos}for(;te<be.pos;){var nt=Math.min(be.pos,te+5e3);y(nt,re),te=nt}}function nn(e,t,u){for(var l,y,B=e.doc,$=u?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>$;--q){if(q<=B.first)return B.first;var te=At(B,q-1),re=te.stateAfter;if(re&&(!u||q+(re instanceof ee?re.lookAhead:0)<=B.modeFrontier))return q;var be=z(te.text,null,e.options.tabSize);(y==null||l>be)&&(y=q-1,l=be)}return y}function tn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var u=e.first,l=t-1;l>u;l--){var y=At(e,l).stateAfter;if(y&&(!(y instanceof ee)||l+y.lookAhead<t)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}var Pn=!1,Xt=!1;function On(){Pn=!0}function An(){Xt=!0}function Ln(e,t,u){this.marker=e,this.from=t,this.to=u}function wn(e,t){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==t)return l}}function In(e,t){for(var u,l=0;l<e.length;++l)e[l]!=t&&(u||(u=[])).push(e[l]);return u}function Gn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ar(e,t,u){var l;if(e)for(var y=0;y<e.length;++y){var B=e[y],$=B.marker,q=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);if(q||B.from==t&&$.type=="bookmark"&&(!u||!B.marker.insertLeft)){var te=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);(l||(l=[])).push(new Ln($,B.from,te?null:B.to))}}return l}function Xn(e,t,u){var l;if(e)for(var y=0;y<e.length;++y){var B=e[y],$=B.marker,q=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);if(q||B.from==t&&$.type=="bookmark"&&(!u||B.marker.insertLeft)){var te=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);(l||(l=[])).push(new Ln($,te?null:B.from-t,B.to==null?null:B.to-t))}}return l}function _n(e,t){if(t.full)return null;var u=Mn(e,t.from.line)&&At(e,t.from.line).markedSpans,l=Mn(e,t.to.line)&&At(e,t.to.line).markedSpans;if(!u&&!l)return null;var y=t.from.ch,B=t.to.ch,$=Ct(t.from,t.to)==0,q=ar(u,y,$),te=Xn(l,B,$),re=t.text.length==1,be=Pe(t.text).length+(re?y:0);if(q)for(var we=0;we<q.length;++we){var Be=q[we];if(Be.to==null){var Ne=wn(te,Be.marker);Ne?re&&(Be.to=Ne.to==null?null:Ne.to+be):Be.to=y}}if(te)for(var nt=0;nt<te.length;++nt){var dt=te[nt];if(dt.to!=null&&(dt.to+=be),dt.from==null){var wt=wn(q,dt.marker);wt||(dt.from=be,re&&(q||(q=[])).push(dt))}else dt.from+=be,re&&(q||(q=[])).push(dt)}q&&(q=Wn(q)),te&&te!=q&&(te=Wn(te));var It=[q];if(!re){var Nt=t.text.length-2,Dt;if(Nt>0&&q)for(var jt=0;jt<q.length;++jt)q[jt].to==null&&(Dt||(Dt=[])).push(new Ln(q[jt].marker,null,null));for(var Qt=0;Qt<Nt;++Qt)It.push(Dt);It.push(te)}return It}function Wn(e){for(var t=0;t<e.length;++t){var u=e[t];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function fn(e,t,u){var l=null;if(e.iter(t.line,u.line+1,function(Ne){if(Ne.markedSpans)for(var nt=0;nt<Ne.markedSpans.length;++nt){var dt=Ne.markedSpans[nt].marker;dt.readOnly&&(!l||ne(l,dt)==-1)&&(l||(l=[])).push(dt)}}),!l)return null;for(var y=[{from:t,to:u}],B=0;B<l.length;++B)for(var $=l[B],q=$.find(0),te=0;te<y.length;++te){var re=y[te];if(Ct(re.to,q.from)<0||Ct(re.from,q.to)>0)continue;var be=[te,1],we=Ct(re.from,q.from),Be=Ct(re.to,q.to);(we<0||!$.inclusiveLeft&&!we)&&be.push({from:re.from,to:q.from}),(Be>0||!$.inclusiveRight&&!Be)&&be.push({from:q.to,to:re.to}),y.splice.apply(y,be),te+=be.length-3}return y}function gn(e){var t=e.markedSpans;if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.detachLine(e);e.markedSpans=null}function vn(e,t){if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.attachLine(e);e.markedSpans=t}function Yt(e){return e.inclusiveLeft?-1:0}function Tt(e){return e.inclusiveRight?1:0}function Kt(e,t){var u=e.lines.length-t.lines.length;if(u!=0)return u;var l=e.find(),y=t.find(),B=Ct(l.from,y.from)||Yt(e)-Yt(t);if(B)return-B;var $=Ct(l.to,y.to)||Tt(e)-Tt(t);return $||t.id-e.id}function bt(e,t){var u=Xt&&e.markedSpans,l;if(u)for(var y=void 0,B=0;B<u.length;++B)y=u[B],y.marker.collapsed&&(t?y.from:y.to)==null&&(!l||Kt(l,y.marker)<0)&&(l=y.marker);return l}function qt(e){return bt(e,!0)}function kt(e){return bt(e,!1)}function Yn(e,t){var u=Xt&&e.markedSpans,l;if(u)for(var y=0;y<u.length;++y){var B=u[y];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!l||Kt(l,B.marker)<0)&&(l=B.marker)}return l}function un(e,t,u,l,y){var B=At(e,t),$=Xt&&B.markedSpans;if($)for(var q=0;q<$.length;++q){var te=$[q];if(!te.marker.collapsed)continue;var re=te.marker.find(0),be=Ct(re.from,u)||Yt(te.marker)-Yt(y),we=Ct(re.to,l)||Tt(te.marker)-Tt(y);if(be>=0&&we<=0||be<=0&&we>=0)continue;if(be<=0&&(te.marker.inclusiveRight&&y.inclusiveLeft?Ct(re.to,u)>=0:Ct(re.to,u)>0)||be>=0&&(te.marker.inclusiveRight&&y.inclusiveLeft?Ct(re.from,l)<=0:Ct(re.from,l)<0))return!0}}function Qn(e){for(var t;t=qt(e);)e=t.find(-1,!0).line;return e}function Kr(e){for(var t;t=kt(e);)e=t.find(1,!0).line;return e}function wr(e){for(var t,u;t=kt(e);)e=t.find(1,!0).line,(u||(u=[])).push(e);return u}function Vr(e,t){var u=At(e,t),l=Qn(u);return u==l?t:Wt(l)}function Nr(e,t){if(t>e.lastLine())return t;var u=At(e,t),l;if(!Rr(e,u))return t;for(;l=kt(u);)u=l.find(1,!0).line;return Wt(u)+1}function Rr(e,t){var u=Xt&&t.markedSpans;if(u)for(var l=void 0,y=0;y<u.length;++y){if(l=u[y],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&Gr(e,t,l))return!0}}function Gr(e,t,u){if(u.to==null){var l=u.marker.find(1,!0);return Gr(e,l.line,wn(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==t.text.length)return!0;for(var y=void 0,B=0;B<t.markedSpans.length;++B)if(y=t.markedSpans[B],y.marker.collapsed&&!y.marker.widgetNode&&y.from==u.to&&(y.to==null||y.to!=u.from)&&(y.marker.inclusiveLeft||u.marker.inclusiveRight)&&Gr(e,t,y))return!0}function zn(e){e=Qn(e);for(var t=0,u=e.parent,l=0;l<u.lines.length;++l){var y=u.lines[l];if(y==e)break;t+=y.height}for(var B=u.parent;B;u=B,B=u.parent)for(var $=0;$<B.children.length;++$){var q=B.children[$];if(q==u)break;t+=q.height}return t}function Gt(e){if(e.height==0)return 0;for(var t=e.text.length,u,l=e;u=qt(l);){var y=u.find(0,!0);l=y.from.line,t+=y.from.ch-y.to.ch}for(l=e;u=kt(l);){var B=u.find(0,!0);t-=l.text.length-B.from.ch,l=B.to.line,t+=l.text.length-B.to.ch}return t}function Xr(e){var t=e.display,u=e.doc;t.maxLine=At(u,u.first),t.maxLineLength=Gt(t.maxLine),t.maxLineChanged=!0,u.iter(function(l){var y=Gt(l);y>t.maxLineLength&&(t.maxLineLength=y,t.maxLine=l)})}var br=function(e,t,u){this.text=e,vn(this,t),this.height=u?u(this):1};br.prototype.lineNo=function(){return Wt(this)},pe(br);function ni(e,t,u,l){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),gn(e),vn(e,u);var y=l?l(e):1;y!=e.height&&Sn(e,y)}function Bt(e){e.parent=null,gn(e)}var Zt={},zt={};function rn(e,t){if(!e||/^\s*$/.test(e))return null;var u=t.addModeClass?zt:Zt;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function on(e,t){var u=C("span",null,null,n?"padding-right: .1px":null),l={pre:C("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var y=0;y<=(t.rest?t.rest.length:0);y++){var B=y?t.rest[y-1]:t.line,$=void 0;l.pos=0,l.addToken=cn,ot(e.display.measure)&&($=Et(B,e.doc.direction))&&(l.addToken=or(l.addToken,$)),l.map=[];var q=t!=e.display.externalMeasured&&Wt(B);_r(B,l,Ye(e,B,q)),B.styleClasses&&(B.styleClasses.bgClass&&(l.bgClass=A(B.styleClasses.bgClass,l.bgClass||"")),B.styleClasses.textClass&&(l.textClass=A(B.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Ot(e.display.measure))),y==0?(t.measure.map=l.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(l.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var te=l.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return ke(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=A(l.pre.className,l.textClass||"")),l}function Cn(e){var t=f("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function cn(e,t,u,l,y,B,$){if(!t)return;var q=e.splitSpaces?jn(t,e.trailingSpace):t,te=e.cm.state.specialChars,re=!1,be;if(!te.test(t))e.col+=t.length,be=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,be),G&&W<9&&(re=!0),e.pos+=t.length;else{be=document.createDocumentFragment();for(var we=0;;){te.lastIndex=we;var Be=te.exec(t),Ne=Be?Be.index-we:t.length-we;if(Ne){var nt=document.createTextNode(q.slice(we,we+Ne));G&&W<9?be.appendChild(f("span",[nt])):be.appendChild(nt),e.map.push(e.pos,e.pos+Ne,nt),e.col+=Ne,e.pos+=Ne}if(!Be)break;we+=Ne+1;var dt=void 0;if(Be[0]==" "){var wt=e.cm.options.tabSize,It=wt-e.col%wt;dt=be.appendChild(f("span",ue(It),"cm-tab")),dt.setAttribute("role","presentation"),dt.setAttribute("cm-text"," "),e.col+=It}else Be[0]=="\r"||Be[0]==`
`?(dt=be.appendChild(f("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]),G&&W<9?be.appendChild(f("span",[dt])):be.appendChild(dt),e.col+=1);e.map.push(e.pos,e.pos+1,dt),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,u||l||y||re||B||$){var Nt=u||"";l&&(Nt+=l),y&&(Nt+=y);var Dt=f("span",[be],Nt,B);if($)for(var jt in $)$.hasOwnProperty(jt)&&jt!="style"&&jt!="class"&&Dt.setAttribute(jt,$[jt]);return e.content.appendChild(Dt)}e.content.appendChild(be)}function jn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var u=t,l="",y=0;y<e.length;y++){var B=e.charAt(y);B==" "&&u&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(B="\xA0"),l+=B,u=B==" "}return l}function or(e,t){return function(u,l,y,B,$,q,te){y=y?y+" cm-force-border":"cm-force-border";for(var re=u.pos,be=re+l.length;;){for(var we=void 0,Be=0;Be<t.length&&!(we=t[Be],we.to>re&&we.from<=re);Be++);if(we.to>=be)return e(u,l,y,B,$,q,te);e(u,l.slice(0,we.to-re),y,B,null,q,te),B=null,l=l.slice(we.to-re),re=we.to}}}function an(e,t,u,l){var y=!l&&u.widgetNode;y&&e.map.push(e.pos,e.pos+t,y),!l&&e.cm.display.input.needsContentAttribute&&(y||(y=e.content.appendChild(document.createElement("span"))),y.setAttribute("cm-marker",u.id)),y&&(e.cm.display.input.setUneditable(y),e.content.appendChild(y)),e.pos+=t,e.trailingSpace=!1}function _r(e,t,u){var l=e.markedSpans,y=e.text,B=0;if(!l){for(var $=1;$<u.length;$+=2)t.addToken(t,y.slice(B,B=u[$]),rn(u[$+1],t.cm.options));return}for(var q=y.length,te=0,re=1,be="",we,Be,Ne=0,nt,dt,wt,It,Nt;;){if(Ne==te){nt=dt=wt=Be="",Nt=null,It=null,Ne=Infinity;for(var Dt=[],jt=void 0,Qt=0;Qt<l.length;++Qt){var Jt=l[Qt],dn=Jt.marker;if(dn.type=="bookmark"&&Jt.from==te&&dn.widgetNode)Dt.push(dn);else if(Jt.from<=te&&(Jt.to==null||Jt.to>te||dn.collapsed&&Jt.to==te&&Jt.from==te)){if(Jt.to!=null&&Jt.to!=te&&Ne>Jt.to&&(Ne=Jt.to,dt=""),dn.className&&(nt+=" "+dn.className),dn.css&&(Be=(Be?Be+";":"")+dn.css),dn.startStyle&&Jt.from==te&&(wt+=" "+dn.startStyle),dn.endStyle&&Jt.to==Ne&&(jt||(jt=[])).push(dn.endStyle,Jt.to),dn.title&&((Nt||(Nt={})).title=dn.title),dn.attributes)for(var Un in dn.attributes)(Nt||(Nt={}))[Un]=dn.attributes[Un];dn.collapsed&&(!It||Kt(It.marker,dn)<0)&&(It=Jt)}else Jt.from>te&&Ne>Jt.from&&(Ne=Jt.from)}if(jt)for(var hr=0;hr<jt.length;hr+=2)jt[hr+1]==Ne&&(dt+=" "+jt[hr]);if(!It||It.from==te)for(var Vn=0;Vn<Dt.length;++Vn)an(t,0,Dt[Vn]);if(It&&(It.from||0)==te){if(an(t,(It.to==null?q+1:It.to)-te,It.marker,It.from==null),It.to==null)return;It.to==te&&(It=!1)}}if(te>=q)break;for(var Fr=Math.min(q,Ne);;){if(be){var Dr=te+be.length;if(!It){var rr=Dr>Fr?be.slice(0,Fr-te):be;t.addToken(t,rr,we?we+nt:nt,wt,te+rr.length==Ne?dt:"",Be,Nt)}if(Dr>=Fr){be=be.slice(Fr-te),te=Fr;break}te=Dr,wt=""}be=y.slice(B,B=u[re++]),we=rn(u[re++],t.cm.options)}}}function En(e,t,u){this.line=t,this.rest=wr(t),this.size=this.rest?Wt(Pe(this.rest))-u+1:1,this.node=this.text=null,this.hidden=Rr(e,t)}function qn(e,t,u){for(var l=[],y,B=t;B<u;B=y){var $=new En(e.doc,At(e.doc,B),B);y=B+$.size,l.push($)}return l}var er=null;function mr(e){er?er.ops.push(e):e.ownsGroup=er={ops:[e],delayedCallbacks:[]}}function Wi(e){var t=e.delayedCallbacks,u=0;do{for(;u<t.length;u++)t[u].call(null);for(var l=0;l<e.ops.length;l++){var y=e.ops[l];if(y.cursorActivityHandlers)for(;y.cursorActivityCalled<y.cursorActivityHandlers.length;)y.cursorActivityHandlers[y.cursorActivityCalled++].call(null,y.cm)}}while(u<t.length)}function xn(e,t){var u=e.ownsGroup;if(!u)return;try{Wi(u)}finally{er=null,t(u)}}var pn=null;function yn(e,t){var u=Xe(e,t);if(!u.length)return;var l=Array.prototype.slice.call(arguments,2),y;er?y=er.delayedCallbacks:pn?y=pn:(y=pn=[],setTimeout(gr,0));for(var B=function(q){y.push(function(){return u[q].apply(null,l)})},$=0;$<u.length;++$)B($)}function gr(){var e=pn;pn=null;for(var t=0;t<e.length;++t)e[t]()}function Qr(e,t,u,l){for(var y=0;y<t.changes.length;y++){var B=t.changes[y];B=="text"?ln(e,t):B=="gutter"?sn(e,t,u,l):B=="class"?Ht(e,t):B=="widget"&&Pt(e,t,l)}t.changes=null}function qr(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&W<8&&(e.node.style.zIndex=2)),e.node}function ri(e,t){var u=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),t.background)u?t.background.className=u:(t.background.parentNode.removeChild(t.background),t.background=null);else if(u){var l=qr(t);t.background=l.insertBefore(f("div",null,u),l.firstChild),e.display.input.setUneditable(t.background)}}function Ti(e,t){var u=e.display.externalMeasured;return u&&u.line==t.line?(e.display.externalMeasured=null,t.measure=u.measure,u.built):on(e,t)}function ln(e,t){var u=t.text.className,l=Ti(e,t);t.text==t.node&&(t.node=l.pre),t.text.parentNode.replaceChild(l.pre,t.text),t.text=l.pre,l.bgClass!=t.bgClass||l.textClass!=t.textClass?(t.bgClass=l.bgClass,t.textClass=l.textClass,Ht(e,t)):u&&(t.text.className=u)}function Ht(e,t){ri(e,t),t.line.wrapClass?qr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var u=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=u||""}function sn(e,t,u,l){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 y=qr(t);t.gutterBackground=f("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),y.insertBefore(t.gutterBackground,t.text)}var B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var $=qr(t),q=t.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),$.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(f("div",Bn(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var te=0;te<e.display.gutterSpecs.length;++te){var re=e.display.gutterSpecs[te].className,be=B.hasOwnProperty(re)&&B[re];be&&q.appendChild(f("div",[be],"CodeMirror-gutter-elt","left: "+l.gutterLeft[re]+"px; width: "+l.gutterWidth[re]+"px"))}}}function Pt(e,t,u){t.alignable&&(t.alignable=null);for(var l=O("CodeMirror-linewidget"),y=t.node.firstChild,B=void 0;y;y=B)B=y.nextSibling,l.test(y.className)&&t.node.removeChild(y);kn(e,t,u)}function mn(e,t,u,l){var y=Ti(e,t);return t.text=t.node=y.pre,y.bgClass&&(t.bgClass=y.bgClass),y.textClass&&(t.textClass=y.textClass),Ht(e,t),sn(e,t,u,l),kn(e,t,l),t.node}function kn(e,t,u){if(tr(e,t.line,t,u,!0),t.rest)for(var l=0;l<t.rest.length;l++)tr(e,t.rest[l],t,u,!1)}function tr(e,t,u,l,y){if(!t.widgets)return;for(var B=qr(u),$=0,q=t.widgets;$<q.length;++$){var te=q[$],re=f("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||re.setAttribute("cm-ignore-events","true"),Sr(te,re,u,l),e.display.input.setUneditable(re),y&&te.above?B.insertBefore(re,u.gutter||u.text):B.appendChild(re),yn(te,"redraw")}}function Sr(e,t,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(t);var y=l.wrapperWidth;t.style.left=l.fixedPos+"px",e.coverGutter||(y-=l.gutterTotalWidth,t.style.paddingLeft=l.gutterTotalWidth+"px"),t.style.width=y+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-l.gutterTotalWidth+"px"))}function nr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!v(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+t.display.wrapper.clientWidth+"px;"),g(t.display.measure,f("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function bn(e,t){for(var u=Te(t);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function Nn(e){return e.lineSpace.offsetTop}function Yr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function jr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=g(e.measure,f("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,l={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Jn(e){return se-e.display.nativeBarWidth}function vr(e){return e.display.scroller.clientWidth-Jn(e)-e.display.barWidth}function Cr(e){return e.display.scroller.clientHeight-Jn(e)-e.display.barHeight}function sr(e,t,u){var l=e.options.lineWrapping,y=l&&vr(e);if(!t.measure.heights||l&&t.measure.width!=y){var B=t.measure.heights=[];if(l){t.measure.width=y;for(var $=t.text.firstChild.getClientRects(),q=0;q<$.length-1;q++){var te=$[q],re=$[q+1];Math.abs(te.bottom-re.bottom)>2&&B.push((te.bottom+re.top)/2-u.top)}}B.push(u.bottom-u.top)}}function zr(e,t,u){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==t)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var y=0;y<e.rest.length;y++)if(Wt(e.rest[y])>u)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function wi(e,t){t=Qn(t);var u=Wt(t),l=e.display.externalMeasured=new En(e.doc,t,u);l.lineN=u;var y=l.built=on(e,l);return l.text=y.pre,g(e.display.lineMeasure,y.pre),l}function Br(e,t,u,l){return ei(e,Er(e,t),u,l)}function ca(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[gi(e,t)];var u=e.display.externalMeasured;if(u&&t>=u.lineN&&t<u.lineN+u.size)return u}function Er(e,t){var u=Wt(t),l=ca(e,u);l&&!l.text?l=null:l&&l.changes&&(Qr(e,l,u,Ua(e)),e.curOp.forceUpdate=!0),l||(l=wi(e,t));var y=zr(l,t,u);return{line:t,view:l,rect:null,map:y.map,cache:y.cache,before:y.before,hasHeights:!1}}function ei(e,t,u,l,y){t.before&&(u=-1);var B=u+(l||""),$;return t.cache.hasOwnProperty(B)?$=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(sr(e,t.view,t.rect),t.hasHeights=!0),$=Ws(e,t,u,l),$.bogus||(t.cache[B]=$)),{left:$.left,right:$.right,top:y?$.rtop:$.top,bottom:y?$.rbottom:$.bottom}}var fo={left:0,right:0,top:0,bottom:0};function po(e,t,u){for(var l,y,B,$,q,te,re=0;re<e.length;re+=3)if(q=e[re],te=e[re+1],t<q?(y=0,B=1,$="left"):t<te?(y=t-q,B=y+1):(re==e.length-3||t==te&&e[re+3]>t)&&(B=te-q,y=B-1,t>=te&&($="right")),y!=null){if(l=e[re+2],q==te&&u==(l.insertLeft?"left":"right")&&($=u),u=="left"&&y==0)for(;re&&e[re-2]==e[re-3]&&e[re-1].insertLeft;)l=e[(re-=3)+2],$="left";if(u=="right"&&y==te-q)for(;re<e.length-3&&e[re+3]==e[re+4]&&!e[re+5].insertLeft;)l=e[(re+=3)+2],$="right";break}return{node:l,start:y,end:B,collapse:$,coverStart:q,coverEnd:te}}function Bs(e,t){var u=fo;if(t=="left")for(var l=0;l<e.length&&!((u=e[l]).left!=u.right);l++);else for(var y=e.length-1;y>=0&&!((u=e[y]).left!=u.right);y--);return u}function Ws(e,t,u,l){var y=po(t.map,u,l),B=y.node,$=y.start,q=y.end,te=y.collapse,re;if(B.nodeType==3){for(var be=0;be<4;be++){for(;$&&Le(t.line.text.charAt(y.coverStart+$));)--$;for(;y.coverStart+q<y.coverEnd&&Le(t.line.text.charAt(y.coverStart+q));)++q;if(G&&W<9&&$==0&&q==y.coverEnd-y.coverStart?re=B.parentNode.getBoundingClientRect():re=Bs(E(B,$,q).getClientRects(),l),re.left||re.right||$==0)break;q=$,$=$-1,te="right"}G&&W<11&&(re=Hs(e.display.measure,re))}else{$>0&&(te=l="right");var we;e.options.lineWrapping&&(we=B.getClientRects()).length>1?re=we[l=="right"?we.length-1:0]:re=B.getBoundingClientRect()}if(G&&W<9&&!$&&(!re||!re.left&&!re.right)){var Be=B.parentNode.getClientRects()[0];Be?re={left:Be.left,right:Be.left+Ci(e.display),top:Be.top,bottom:Be.bottom}:re=fo}for(var Ne=re.top-t.rect.top,nt=re.bottom-t.rect.top,dt=(Ne+nt)/2,wt=t.view.measure.heights,It=0;It<wt.length-1&&!(dt<wt[It]);It++);var Nt=It?wt[It-1]:0,Dt=wt[It],jt={left:(te=="right"?re.right:re.left)-t.rect.left,right:(te=="left"?re.left:re.right)-t.rect.left,top:Nt,bottom:Dt};return!re.left&&!re.right&&(jt.bogus=!0),e.options.singleCursorHeightPerLine||(jt.rtop=Ne,jt.rbottom=nt),jt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!_e(e))return t;var u=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*u,right:t.right*u,top:t.top*l,bottom:t.bottom*l}}function mo(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 go(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)mo(e.display.view[t])}function Hi(e){go(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function vo(){return m&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function yo(){return m&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Da(e){var t=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(t+=nr(e.widgets[u]));return t}function da(e,t,u,l,y){if(!y){var B=Da(t);u.top+=B,u.bottom+=B}if(l=="line")return u;l||(l="local");var $=zn(t);if(l=="local"?$+=Nn(e.display):$-=e.display.viewOffset,l=="page"||l=="window"){var q=e.display.lineSpace.getBoundingClientRect();$+=q.top+(l=="window"?0:yo());var te=q.left+(l=="window"?0:vo());u.left+=te,u.right+=te}return u.top+=$,u.bottom+=$,u}function bo(e,t,u){if(u=="div")return t;var l=t.left,y=t.top;if(u=="page")l-=vo(),y-=yo();else if(u=="local"||!u){var B=e.display.sizer.getBoundingClientRect();l+=B.left,y+=B.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:l-$.left,top:y-$.top}}function Ma(e,t,u,l,y){return l||(l=At(e.doc,t.line)),da(e,l,Br(e,l,t.ch,y),u)}function $r(e,t,u,l,y,B){l=l||At(e.doc,t.line),y||(y=Er(e,l));function $(nt,dt){var wt=ei(e,y,nt,dt?"right":"left",B);return dt?wt.left=wt.right:wt.right=wt.left,da(e,l,wt,u)}var q=Et(l,e.doc.direction),te=t.ch,re=t.sticky;if(te>=l.text.length?(te=l.text.length,re="before"):te<=0&&(te=0,re="after"),!q)return $(re=="before"?te-1:te,re=="before");function be(nt,dt,wt){var It=q[dt],Nt=It.level==1;return $(wt?nt-1:nt,Nt!=wt)}var we=gt(q,te,re),Be=mt,Ne=be(te,we,re=="before");return Be!=null&&(Ne.other=be(te,Be,re!="before")),Ne}function _o(e,t){var u=0;t=I(e.doc,t),e.options.lineWrapping||(u=Ci(e.display)*t.ch);var l=At(e.doc,t.line),y=zn(l)+Nn(e.display);return{left:u,right:u,top:y,bottom:y+l.height}}function Pa(e,t,u,l,y){var B=ut(e,t,u);return B.xRel=y,l&&(B.outside=l),B}function ka(e,t,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return Pa(l.first,0,null,-1,-1);var y=hn(l,u),B=l.first+l.size-1;if(y>B)return Pa(l.first+l.size-1,At(l,B).text.length,null,1,1);t<0&&(t=0);for(var $=At(l,y);;){var q=Ks(e,$,y,t,u),te=Yn($,q.ch+(q.xRel>0||q.outside>0?1:0));if(!te)return q;var re=te.find(1);if(re.line==y)return re;$=At(l,y=re.line)}}function Eo(e,t,u,l){l-=Da(t);var y=t.text.length,B=qe(function($){return ei(e,u,$-1).bottom<=l},y,0);return y=qe(function($){return ei(e,u,$).top>l},B,y),{begin:B,end:y}}function xo(e,t,u,l){u||(u=Er(e,t));var y=da(e,t,ei(e,u,l),"line").top;return Eo(e,t,u,y)}function Na(e,t,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>t}function Ks(e,t,u,l,y){y-=zn(t);var B=Er(e,t),$=Da(t),q=0,te=t.text.length,re=!0,be=Et(t,e.doc.direction);if(be){var we=(e.options.lineWrapping?zs:Gs)(e,t,u,B,be,l,y);re=we.level!=1,q=re?we.from:we.to-1,te=re?we.to:we.from-1}var Be=null,Ne=null,nt=qe(function(Qt){var Jt=ei(e,B,Qt);return Jt.top+=$,Jt.bottom+=$,Na(Jt,l,y,!1)?(Jt.top<=y&&Jt.left<=l&&(Be=Qt,Ne=Jt),!0):!1},q,te),dt,wt,It=!1;if(Ne){var Nt=l-Ne.left<Ne.right-l,Dt=Nt==re;nt=Be+(Dt?0:1),wt=Dt?"after":"before",dt=Nt?Ne.left:Ne.right}else{!re&&(nt==te||nt==q)&&nt++,wt=nt==0?"after":nt==t.text.length?"before":ei(e,B,nt-(re?1:0)).bottom+$<=y==re?"after":"before";var jt=$r(e,ut(u,nt,wt),"line",t,B);dt=jt.left,It=y<jt.top?-1:y>=jt.bottom?1:0}return nt=Me(t.text,nt,1),Pa(u,nt,wt,It,l-dt)}function Gs(e,t,u,l,y,B,$){var q=qe(function(we){var Be=y[we],Ne=Be.level!=1;return Na($r(e,ut(u,Ne?Be.to:Be.from,Ne?"before":"after"),"line",t,l),B,$,!0)},0,y.length-1),te=y[q];if(q>0){var re=te.level!=1,be=$r(e,ut(u,re?te.from:te.to,re?"after":"before"),"line",t,l);Na(be,B,$,!0)&&be.top>$&&(te=y[q-1])}return te}function zs(e,t,u,l,y,B,$){var q=Eo(e,t,l,$),te=q.begin,re=q.end;/\s/.test(t.text.charAt(re-1))&&re--;for(var be=null,we=null,Be=0;Be<y.length;Be++){var Ne=y[Be];if(Ne.from>=re||Ne.to<=te)continue;var nt=Ne.level!=1,dt=ei(e,l,nt?Math.min(re,Ne.to)-1:Math.max(te,Ne.from)).right,wt=dt<B?B-dt+1e9:dt-B;(!be||we>wt)&&(be=Ne,we=wt)}return be||(be=y[y.length-1]),be.from<te&&(be={from:te,to:be.to,level:be.level}),be.to>re&&(be={from:be.from,to:re,level:be.level}),be}var pi;function Si(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(pi==null){pi=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)pi.appendChild(document.createTextNode("x")),pi.appendChild(f("br"));pi.appendChild(document.createTextNode("x"))}g(e.measure,pi);var u=pi.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),b(e.measure),u||1}function Ci(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),u=f("pre",[t],"CodeMirror-line-like");g(e.measure,u);var l=t.getBoundingClientRect(),y=(l.right-l.left)/10;return y>2&&(e.cachedCharWidth=y),y||10}function Ua(e){for(var t=e.display,u={},l={},y=t.gutters.clientLeft,B=t.gutters.firstChild,$=0;B;B=B.nextSibling,++$){var q=e.display.gutterSpecs[$].className;u[q]=B.offsetLeft+B.clientLeft+y,l[q]=B.clientWidth}return{fixedPos:Fa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:t.wrapper.clientWidth}}function Fa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function To(e){var t=Si(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/Ci(e.display)-3);return function(y){if(Rr(e.doc,y))return 0;var B=0;if(y.widgets)for(var $=0;$<y.widgets.length;$++)y.widgets[$].height&&(B+=y.widgets[$].height);return u?B+(Math.ceil(y.text.length/l)||1)*t:B+t}}function ja(e){var t=e.doc,u=To(e);t.iter(function(l){var y=u(l);y!=l.height&&Sn(l,y)})}function mi(e,t,u,l){var y=e.display;if(!u&&Te(t).getAttribute("cm-not-content")=="true")return null;var B,$,q=y.lineSpace.getBoundingClientRect();try{B=t.clientX-q.left,$=t.clientY-q.top}catch(we){return null}var te=ka(e,B,$),re;if(l&&te.xRel>0&&(re=At(e.doc,te.line).text).length==te.ch){var be=z(re,re.length,e.options.tabSize)-re.length;te=ut(te.line,Math.max(0,Math.round((B-jr(e.display).left)/Ci(e.display))-be))}return te}function gi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var u=e.display.view,l=0;l<u.length;l++)if(t-=u[l].size,t<0)return l}function Lr(e,t,u,l){t==null&&(t=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var y=e.display;if(l&&u<y.viewTo&&(y.updateLineNumbers==null||y.updateLineNumbers>t)&&(y.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=y.viewTo)Xt&&Vr(e.doc,t)<y.viewTo&&si(e);else if(u<=y.viewFrom)Xt&&Nr(e.doc,u+l)>y.viewFrom?si(e):(y.viewFrom+=l,y.viewTo+=l);else if(t<=y.viewFrom&&u>=y.viewTo)si(e);else if(t<=y.viewFrom){var B=ha(e,u,u+l,1);B?(y.view=y.view.slice(B.index),y.viewFrom=B.lineN,y.viewTo+=l):si(e)}else if(u>=y.viewTo){var $=ha(e,t,t,-1);$?(y.view=y.view.slice(0,$.index),y.viewTo=$.lineN):si(e)}else{var q=ha(e,t,t,-1),te=ha(e,u,u+l,1);q&&te?(y.view=y.view.slice(0,q.index).concat(qn(e,q.lineN,te.lineN)).concat(y.view.slice(te.index)),y.viewTo+=l):si(e)}var re=y.externalMeasured;re&&(u<re.lineN?re.lineN+=l:t<re.lineN+re.size&&(y.externalMeasured=null))}function oi(e,t,u){e.curOp.viewChanged=!0;var l=e.display,y=e.display.externalMeasured;if(y&&t>=y.lineN&&t<y.lineN+y.size&&(l.externalMeasured=null),t<l.viewFrom||t>=l.viewTo)return;var B=l.view[gi(e,t)];if(B.node==null)return;var $=B.changes||(B.changes=[]);ne($,u)==-1&&$.push(u)}function si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ha(e,t,u,l){var y=gi(e,t),B,$=e.display.view;if(!Xt||u==e.doc.first+e.doc.size)return{index:y,lineN:u};for(var q=e.display.viewFrom,te=0;te<y;te++)q+=$[te].size;if(q!=t){if(l>0){if(y==$.length-1)return null;B=q+$[y].size-t,y++}else B=q-t;t+=B,u+=B}for(;Vr(e.doc,u)!=u;){if(y==(l<0?0:$.length-1))return null;u+=l*$[y-(l<0?1:0)].size,y+=l}return{index:y,lineN:u}}function Vs(e,t,u){var l=e.display,y=l.view;y.length==0||t>=l.viewTo||u<=l.viewFrom?(l.view=qn(e,t,u),l.viewFrom=t):(l.viewFrom>t?l.view=qn(e,t,l.viewFrom).concat(l.view):l.viewFrom<t&&(l.view=l.view.slice(gi(e,t))),l.viewFrom=t,l.viewTo<u?l.view=l.view.concat(qn(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,gi(e,u)))),l.viewTo=u}function wo(e){for(var t=e.display.view,u=0,l=0;l<t.length;l++){var y=t[l];!y.hidden&&(!y.node||y.changes)&&++u}return u}function Ki(e){e.display.input.showSelection(e.display.input.prepareSelection())}function So(e,t){t===void 0&&(t=!0);for(var u=e.doc,l={},y=l.cursors=document.createDocumentFragment(),B=l.selection=document.createDocumentFragment(),$=0;$<u.sel.ranges.length;$++){if(!t&&$==u.sel.primIndex)continue;var q=u.sel.ranges[$];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var te=q.empty();(te||e.options.showCursorWhenSelecting)&&Co(e,q.head,y),te||Xs(e,q,B)}return l}function Co(e,t,u){var l=$r(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),y=u.appendChild(f("div","\xA0","CodeMirror-cursor"));if(y.style.left=l.left+"px",y.style.top=l.top+"px",y.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var B=u.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=l.other.left+"px",B.style.top=l.other.top+"px",B.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function fa(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,u){var l=e.display,y=e.doc,B=document.createDocumentFragment(),$=jr(e.display),q=$.left,te=Math.max(l.sizerWidth,vr(e)-l.sizer.offsetLeft)-$.right,re=y.direction=="ltr";function be(Dt,jt,Qt,Jt){jt<0&&(jt=0),jt=Math.round(jt),Jt=Math.round(Jt),B.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+Dt+`px;
top: `+jt+"px; width: "+(Qt==null?te-Dt:Qt)+`px;
height: `+(Jt-jt)+"px"))}function we(Dt,jt,Qt){var Jt=At(y,Dt),dn=Jt.text.length,Un,hr;function Vn(rr,Mr){return Ma(e,ut(Dt,rr),"div",Jt,Mr)}function Fr(rr,Mr,yr){var lr=xo(e,Jt,null,rr),ir=Mr=="ltr"==(yr=="after")?"left":"right",$n=yr=="after"?lr.begin:lr.end-(/\s/.test(Jt.text.charAt(lr.end-1))?2:1);return Vn($n,ir)[ir]}var Dr=Et(Jt,y.direction);return st(Dr,jt||0,Qt==null?dn:Qt,function(rr,Mr,yr,lr){var ir=yr=="ltr",$n=Vn(rr,ir?"left":"right"),Pr=Vn(Mr-1,ir?"right":"left"),ji=jt==null&&rr==0,fi=Qt==null&&Mr==dn,Tr=lr==0,ti=!Dr||lr==Dr.length-1;if(Pr.top-$n.top<=3){var fr=(re?ji:fi)&&Tr,co=(re?fi:ji)&&ti,ai=fr?q:(ir?$n:Pr).left,Ei=co?te:(ir?Pr:$n).right;be(ai,$n.top,Ei-ai,$n.bottom)}else{var xi,Ar,Bi,ho;ir?(xi=re&&ji&&Tr?q:$n.left,Ar=re?te:Fr(rr,yr,"before"),Bi=re?q:Fr(Mr,yr,"after"),ho=re&&fi&&ti?te:Pr.right):(xi=re?Fr(rr,yr,"before"):q,Ar=!re&&ji&&Tr?te:$n.right,Bi=!re&&fi&&ti?q:Pr.left,ho=re?Fr(Mr,yr,"after"):te),be(xi,$n.top,Ar-xi,$n.bottom),$n.bottom<Pr.top&&be(q,$n.bottom,null,Pr.top),be(Bi,Pr.top,ho-Bi,Pr.bottom)}(!Un||fa($n,Un)<0)&&(Un=$n),fa(Pr,Un)<0&&(Un=Pr),(!hr||fa($n,hr)<0)&&(hr=$n),fa(Pr,hr)<0&&(hr=Pr)}),{start:Un,end:hr}}var Be=t.from(),Ne=t.to();if(Be.line==Ne.line)we(Be.line,Be.ch,Ne.ch);else{var nt=At(y,Be.line),dt=At(y,Ne.line),wt=Qn(nt)==Qn(dt),It=we(Be.line,Be.ch,wt?nt.text.length+1:null).end,Nt=we(Ne.line,wt?0:null,Ne.ch).start;wt&&(It.top<Nt.top-2?(be(It.right,It.top,null,It.bottom),be(q,Nt.top,Nt.left,Nt.bottom)):be(It.right,It.top,Nt.left-It.right,It.bottom)),It.bottom<Nt.top&&be(q,It.bottom,null,Nt.top)}u.appendChild(B)}function Ba(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var u=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Oi(e),t.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Oo(e){e.state.focused||(e.display.input.focus(),Wa(e))}function Ao(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Oi(e))},100)}function Wa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ba(e)}function Oi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function pa(e){for(var t=e.display,u=t.lineDiv.offsetTop,l=0;l<t.view.length;l++){var y=t.view[l],B=e.options.lineWrapping,$=void 0,q=0;if(y.hidden)continue;if(G&&W<8){var te=y.node.offsetTop+y.node.offsetHeight;$=te-u,u=te}else{var re=y.node.getBoundingClientRect();$=re.bottom-re.top,!B&&y.text.firstChild&&(q=y.text.firstChild.getBoundingClientRect().right-re.left-1)}var be=y.line.height-$;if((be>.005||be<-.005)&&(Sn(y.line,$),Ro(y.line),y.rest))for(var we=0;we<y.rest.length;we++)Ro(y.rest[we]);if(q>e.display.sizerWidth){var Be=Math.ceil(q/Ci(e.display));Be>e.display.maxLineLength&&(e.display.maxLineLength=Be,e.display.maxLine=y.line,e.display.maxLineChanged=!0)}}}function Ro(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var u=e.widgets[t],l=u.node.parentNode;l&&(u.height=l.offsetHeight)}}function ma(e,t,u){var l=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;l=Math.floor(l-Nn(e));var y=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,B=hn(t,l),$=hn(t,y);if(u&&u.ensure){var q=u.ensure.from.line,te=u.ensure.to.line;q<B?(B=q,$=hn(t,zn(At(t,q))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=$&&(B=hn(t,zn(At(t,te))-e.wrapper.clientHeight),$=te)}return{from:B,to:Math.max($,B+1)}}function Ys(e,t){if(Ke(e,"scrollCursorIntoView"))return;var u=e.display,l=u.sizer.getBoundingClientRect(),y=null;if(t.top+l.top<0?y=!0:t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(y=!1),y!=null&&!o){var B=f("div","\u200B",null,`position: absolute;
top: `+(t.top-u.viewOffset-Nn(e.display))+`px;
height: `+(t.bottom-t.top+Jn(e)+u.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(y),e.display.lineSpace.removeChild(B)}}function $s(e,t,u,l){l==null&&(l=0);var y;!e.options.lineWrapping&&t==u&&(t=t.ch?ut(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,u=t.sticky=="before"?ut(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var $=!1,q=$r(e,t),te=!u||u==t?q:$r(e,u);y={left:Math.min(q.left,te.left),top:Math.min(q.top,te.top)-l,right:Math.max(q.left,te.left),bottom:Math.max(q.bottom,te.bottom)+l};var re=Ha(e,y),be=e.doc.scrollTop,we=e.doc.scrollLeft;if(re.scrollTop!=null&&(zi(e,re.scrollTop),Math.abs(e.doc.scrollTop-be)>1&&($=!0)),re.scrollLeft!=null&&(vi(e,re.scrollLeft),Math.abs(e.doc.scrollLeft-we)>1&&($=!0)),!$)break}return y}function Js(e,t){var u=Ha(e,t);u.scrollTop!=null&&zi(e,u.scrollTop),u.scrollLeft!=null&&vi(e,u.scrollLeft)}function Ha(e,t){var u=e.display,l=Si(e.display);t.top<0&&(t.top=0);var y=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,B=Cr(e),$={};t.bottom-t.top>B&&(t.bottom=t.top+B);var q=e.doc.height+Yr(u),te=t.top<l,re=t.bottom>q-l;if(t.top<y)$.scrollTop=te?0:t.top;else if(t.bottom>y+B){var be=Math.min(t.top,(re?q:t.bottom)-B);be!=y&&($.scrollTop=be)}var we=e.options.fixedGutter?0:u.gutters.offsetWidth,Be=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-we,Ne=vr(e)-u.gutters.offsetWidth,nt=t.right-t.left>Ne;return nt&&(t.right=t.left+Ne),t.left<10?$.scrollLeft=0:t.left<Be?$.scrollLeft=Math.max(0,t.left+we-(nt?0:10)):t.right>Ne+Be-3&&($.scrollLeft=t.right+(nt?0:10)-Ne),$}function Ka(e,t){if(t==null)return;ga(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ai(e){ga(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Gi(e,t,u){(t!=null||u!=null)&&ga(e),t!=null&&(e.curOp.scrollLeft=t),u!=null&&(e.curOp.scrollTop=u)}function Zs(e,t){ga(e),e.curOp.scrollToPos=t}function ga(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var u=_o(e,t.from),l=_o(e,t.to);Lo(e,u,l,t.margin)}}function Lo(e,t,u,l){var y=Ha(e,{left:Math.min(t.left,u.left),top:Math.min(t.top,u.top)-l,right:Math.max(t.right,u.right),bottom:Math.max(t.bottom,u.bottom)+l});Gi(e,y.scrollLeft,y.scrollTop)}function zi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||za(e,{top:t}),Io(e,t,!0),P&&za(e),Yi(e,100)}function Io(e,t,u){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!u)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function vi(e,t,u,l){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(u?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!l)return;e.doc.scrollLeft=t,No(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Vi(e){var t=e.display,u=t.gutters.offsetWidth,l=Math.round(e.doc.height+Yr(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?u:0,docHeight:l,scrollHeight:l+Jn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:u}}var yi=function(e,t,u){this.cm=u;var l=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),y=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=y.tabIndex=-1,e(l),e(y),Ce(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),Ce(y,"scroll",function(){y.clientWidth&&t(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};yi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=t?l+"px":"0";var y=e.viewHeight-(t?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+y)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var B=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+B)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?l:0,bottom:t?l:0}},yi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},yi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},yi.prototype.zeroWidthHack=function(){var e=r&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Q,this.disableVert=new Q},yi.prototype.enableZeroWidthBar=function(e,t,u){e.style.pointerEvents="auto";function l(){var y=e.getBoundingClientRect(),B=u=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);B!=e?e.style.pointerEvents="none":t.set(1e3,l)}t.set(1e3,l)},yi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Xi=function(){};Xi.prototype.update=function(){return{bottom:0,right:0}},Xi.prototype.setScrollLeft=function(){},Xi.prototype.setScrollTop=function(){},Xi.prototype.clear=function(){};function Ri(e,t){t||(t=Vi(e));var u=e.display.barWidth,l=e.display.barHeight;Do(e,t);for(var y=0;y<4&&u!=e.display.barWidth||l!=e.display.barHeight;y++)u!=e.display.barWidth&&e.options.lineWrapping&&pa(e),Do(e,Vi(e)),u=e.display.barWidth,l=e.display.barHeight}function Do(e,t){var u=e.display,l=u.scrollbars.update(t);u.sizer.style.paddingRight=(u.barWidth=l.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=l.bottom)+"px",u.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=l.bottom+"px",u.scrollbarFiller.style.width=l.right+"px"):u.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=l.bottom+"px",u.gutterFiller.style.width=t.gutterWidth+"px"):u.gutterFiller.style.display=""}var Mo={native:yi,null:Xi};function Po(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Mo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ce(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,u){u=="horizontal"?vi(e,t):zi(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function bi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},mr(e.curOp)}function _i(e){var t=e.curOp;t&&xn(t,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;qs(u)})}function qs(e){for(var t=e.ops,u=0;u<t.length;u++)el(t[u]);for(var l=0;l<t.length;l++)tl(t[l]);for(var y=0;y<t.length;y++)nl(t[y]);for(var B=0;B<t.length;B++)rl(t[B]);for(var $=0;$<t.length;$++)il(t[$])}function el(e){var t=e.cm,u=t.display;ol(t),e.updateMaxLine&&Xr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new va(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ga(e.cm,e.update)}function nl(e){var t=e.cm,u=t.display;e.updatedDisplay&&pa(t),e.barMeasure=Vi(t),u.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Br(t,u.maxLine,u.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+Jn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-vr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&vi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var u=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ri(t,e.barMeasure),e.updatedDisplay&&Xa(t,e.barMeasure),e.selectionChanged&&Ba(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),u&&Oo(e.cm)}function il(e){var t=e.cm,u=t.display,l=t.doc;if(e.updatedDisplay&&ko(t,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&Io(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&vi(t,e.scrollLeft,!0,!0),e.scrollToPos){var y=$s(t,I(l,e.scrollToPos.from),I(l,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,y)}var B=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(B)for(var q=0;q<B.length;++q)B[q].lines.length||ke(B[q],"hide");if($)for(var te=0;te<$.length;++te)$[te].lines.length&&ke($[te],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ur(e,t){if(e.curOp)return t();bi(e);try{return t()}finally{_i(e)}}function cr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bi(e);try{return t.apply(e,arguments)}finally{_i(e)}}}function Or(e){return function(){if(this.curOp)return e.apply(this,arguments);bi(this);try{return e.apply(this,arguments)}finally{_i(this)}}}function dr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);bi(t);try{return e.apply(this,arguments)}finally{_i(t)}}}function Yi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var u=+new Date+e.options.workTime,l=lt(e,t.highlightFrontier),y=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(l.line>=e.display.viewFrom){var $=B.styles,q=B.text.length>e.options.maxHighlightLength?ct(t.mode,l.state):null,te=Ee(e,B,l,!0);q&&(l.state=q),B.styles=te.styles;var re=B.styleClasses,be=te.classes;be?B.styleClasses=be:re&&(B.styleClasses=null);for(var we=!$||$.length!=B.styles.length||re!=be&&(!re||!be||re.bgClass!=be.bgClass||re.textClass!=be.textClass),Be=0;!we&&Be<$.length;++Be)we=$[Be]!=B.styles[Be];we&&y.push(l.line),B.stateAfter=l.save(),l.nextLine()}else B.text.length<=e.options.maxHighlightLength&&vt(e,B.text,l),B.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return Yi(e,e.options.workDelay),!0}),t.highlightFrontier=l.line,t.modeFrontier=Math.max(t.modeFrontier,l.line),y.length&&Ur(e,function(){for(var B=0;B<y.length;B++)oi(e,y[B],"text")})}var va=function(e,t,u){var l=e.display;this.viewport=t,this.visible=ma(l,e.doc,t),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=vr(e),this.force=u,this.dims=Ua(e),this.events=[]};va.prototype.signal=function(e,t){ce(e,t)&&this.events.push(arguments)},va.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Jn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Jn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=N();if(!t||!v(e.display.lineDiv,t))return null;var u={activeElt:t};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&v(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function ll(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&v(document.body,e.anchorNode)&&v(document.body,e.focusNode)){var t=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),t.removeAllRanges(),t.addRange(u),t.extend(e.focusNode,e.focusOffset)}}function Ga(e,t){var u=e.display,l=e.doc;if(t.editorIsHidden)return si(e),!1;if(!t.force&&t.visible.from>=u.viewFrom&&t.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&wo(e)==0)return!1;Uo(e)&&(si(e),t.dims=Ua(e));var y=l.first+l.size,B=Math.max(t.visible.from-e.options.viewportMargin,l.first),$=Math.min(y,t.visible.to+e.options.viewportMargin);u.viewFrom<B&&B-u.viewFrom<20&&(B=Math.max(l.first,u.viewFrom)),u.viewTo>$&&u.viewTo-$<20&&($=Math.min(y,u.viewTo)),Xt&&(B=Vr(e.doc,B),$=Nr(e.doc,$));var q=B!=u.viewFrom||$!=u.viewTo||u.lastWrapHeight!=t.wrapperHeight||u.lastWrapWidth!=t.wrapperWidth;Vs(e,B,$),u.viewOffset=zn(At(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var te=wo(e);if(!q&&te==0&&!t.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var re=sl(e);return te>4&&(u.lineDiv.style.display="none"),ul(e,u.updateLineNumbers,t.dims),te>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,ll(re),b(u.cursorDiv),b(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,q&&(u.lastWrapHeight=t.wrapperHeight,u.lastWrapWidth=t.wrapperWidth,Yi(e,400)),u.updateLineNumbers=null,!0}function ko(e,t){for(var u=t.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||t.oldDisplayWidth==vr(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Yr(e.display)-Cr(e),u.top)}),t.visible=ma(e.display,e.doc,u),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else l&&(t.visible=ma(e.display,e.doc,u));if(!Ga(e,t))break;pa(e);var y=Vi(e);Ki(e),Ri(e,y),Xa(e,y),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 za(e,t){var u=new va(e,t);if(Ga(e,u)){pa(e),ko(e,u);var l=Vi(e);Ki(e),Ri(e,l),Xa(e,l),u.finish()}}function ul(e,t,u){var l=e.display,y=e.options.lineNumbers,B=l.lineDiv,$=B.firstChild;function q(nt){var dt=nt.nextSibling;return n&&r&&e.display.currentWheelTarget==nt?nt.style.display="none":nt.parentNode.removeChild(nt),dt}for(var te=l.view,re=l.viewFrom,be=0;be<te.length;be++){var we=te[be];if(!we.hidden)if(!we.node||we.node.parentNode!=B){var Be=mn(e,we,re,u);B.insertBefore(Be,$)}else{for(;$!=we.node;)$=q($);var Ne=y&&t!=null&&t<=re&&we.lineNumber;we.changes&&(ne(we.changes,"gutter")>-1&&(Ne=!1),Qr(e,we,re,u)),Ne&&(b(we.lineNumber),we.lineNumber.appendChild(document.createTextNode(Bn(e.options,re)))),$=we.node.nextSibling}re+=we.size}for(;$;)$=q($)}function Va(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Xa(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+Jn(e)+"px"}function No(e){var t=e.display,u=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var l=Fa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,y=t.gutters.offsetWidth,B=l+"px",$=0;$<u.length;$++)if(!u[$].hidden){e.options.fixedGutter&&(u[$].gutter&&(u[$].gutter.style.left=B),u[$].gutterBackground&&(u[$].gutterBackground.style.left=B));var q=u[$].alignable;if(q)for(var te=0;te<q.length;te++)q[te].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=l+y+"px")}function Uo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,u=Bn(e.options,t.first+t.size-1),l=e.display;if(u.length!=l.lineNumChars){var y=l.measure.appendChild(f("div",[f("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),B=y.firstChild.offsetWidth,$=y.offsetWidth-B;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(B,l.lineGutter.offsetWidth-$)+1,l.lineNumWidth=l.lineNumInnerWidth+$,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",Va(e.display),!0}return!1}function Ya(e,t){for(var u=[],l=!1,y=0;y<e.length;y++){var B=e[y],$=null;if(typeof B!="string"&&($=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)l=!0;else continue;u.push({className:B,style:$})}return t&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Fo(e){var t=e.gutters,u=e.gutterSpecs;b(t),e.lineGutter=null;for(var l=0;l<u.length;++l){var y=u[l],B=y.className,$=y.style,q=t.appendChild(f("div",null,"CodeMirror-gutter "+B));$&&(q.style.cssText=$),B=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=u.length?"":"none",Va(e)}function $i(e){Fo(e.display),Lr(e),No(e)}function cl(e,t,u,l){var y=this;this.input=u,y.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),y.scrollbarFiller.setAttribute("cm-not-content","true"),y.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),y.gutterFiller.setAttribute("cm-not-content","true"),y.lineDiv=C("div",null,"CodeMirror-code"),y.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),y.cursorDiv=f("div",null,"CodeMirror-cursors"),y.measure=f("div",null,"CodeMirror-measure"),y.lineMeasure=f("div",null,"CodeMirror-measure"),y.lineSpace=C("div",[y.measure,y.lineMeasure,y.selectionDiv,y.cursorDiv,y.lineDiv],null,"position: relative; outline: none");var B=C("div",[y.lineSpace],"CodeMirror-lines");y.mover=f("div",[B],null,"position: relative"),y.sizer=f("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=f("div",null,null,"position: absolute; height: "+se+"px; width: 1px;"),y.gutters=f("div",null,"CodeMirror-gutters"),y.lineGutter=null,y.scroller=f("div",[y.sizer,y.heightForcer,y.gutters],"CodeMirror-scroll"),y.scroller.setAttribute("tabIndex","-1"),y.wrapper=f("div",[y.scrollbarFiller,y.gutterFiller,y.scroller],"CodeMirror"),G&&W<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!n&&!(P&&a)&&(y.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(y.wrapper):e(y.wrapper)),y.viewFrom=y.viewTo=t.first,y.reportedViewFrom=y.reportedViewTo=t.first,y.view=[],y.renderedView=null,y.externalMeasured=null,y.viewOffset=0,y.lastWrapHeight=y.lastWrapWidth=0,y.updateLineNumbers=null,y.nativeBarWidth=y.barHeight=y.barWidth=0,y.scrollbarsClipped=!1,y.lineNumWidth=y.lineNumInnerWidth=y.lineNumChars=null,y.alignWidgets=!1,y.cachedCharWidth=y.cachedTextHeight=y.cachedPaddingH=null,y.maxLine=null,y.maxLineLength=0,y.maxLineChanged=!1,y.wheelDX=y.wheelDY=y.wheelStartX=y.wheelStartY=null,y.shift=!1,y.selForContextMenu=null,y.activeTouch=null,y.gutterSpecs=Ya(l.gutters,l.lineNumbers),Fo(y),u.init(y)}var ya=0,Wr=null;G?Wr=-.53:P?Wr=15:m?Wr=-.7:h&&(Wr=-1/3);function jo(e){var t=e.wheelDeltaX,u=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:t,y:u}}function dl(e){var t=jo(e);return t.x*=Wr,t.y*=Wr,t}function Bo(e,t){var u=jo(t),l=u.x,y=u.y,B=e.display,$=B.scroller,q=$.scrollWidth>$.clientWidth,te=$.scrollHeight>$.clientHeight;if(!(l&&q||y&&te))return;if(y&&r&&n){e:for(var re=t.target,be=B.view;re!=$;re=re.parentNode)for(var we=0;we<be.length;we++)if(be[we].node==re){e.display.currentWheelTarget=re;break e}}if(l&&!P&&!p&&Wr!=null){y&&te&&zi(e,Math.max(0,$.scrollTop+y*Wr)),vi(e,Math.max(0,$.scrollLeft+l*Wr)),(!y||y&&te)&&ie(t),B.wheelStartX=null;return}if(y&&Wr!=null){var Be=y*Wr,Ne=e.doc.scrollTop,nt=Ne+B.wrapper.clientHeight;Be<0?Ne=Math.max(0,Ne+Be-50):nt=Math.min(e.doc.height,nt+Be+50),za(e,{top:Ne,bottom:nt})}ya<20&&(B.wheelStartX==null?(B.wheelStartX=$.scrollLeft,B.wheelStartY=$.scrollTop,B.wheelDX=l,B.wheelDY=y,setTimeout(function(){if(B.wheelStartX==null)return;var dt=$.scrollLeft-B.wheelStartX,wt=$.scrollTop-B.wheelStartY,It=wt&&B.wheelDY&&wt/B.wheelDY||dt&&B.wheelDX&&dt/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!It)return;Wr=(Wr*ya+It)/(ya+1),++ya},200)):(B.wheelDX+=l,B.wheelDY+=y))}var Hr=function(e,t){this.ranges=e,this.primIndex=t};Hr.prototype.primary=function(){return this.ranges[this.primIndex]},Hr.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 u=this.ranges[t],l=e.ranges[t];if(!Hn(u.anchor,l.anchor)||!Hn(u.head,l.head))return!1}return!0},Hr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Rn(pr(this.ranges[t].anchor),pr(this.ranges[t].head));return new Hr(e,this.primIndex)},Hr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Hr.prototype.contains=function(e,t){t||(t=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(Ct(t,l.from())>=0&&Ct(e,l.to())<=0)return u}return-1};var Rn=function(e,t){this.anchor=e,this.head=t};Rn.prototype.from=function(){return kr(this.anchor,this.head)},Rn.prototype.to=function(){return ur(this.anchor,this.head)},Rn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Jr(e,t,u){var l=e&&e.options.selectionsMayTouch,y=t[u];t.sort(function(Be,Ne){return Ct(Be.from(),Ne.from())}),u=ne(t,y);for(var B=1;B<t.length;B++){var $=t[B],q=t[B-1],te=Ct(q.to(),$.from());if(l&&!$.empty()?te>0:te>=0){var re=kr(q.from(),$.from()),be=ur(q.to(),$.to()),we=q.empty()?$.from()==$.head:q.from()==q.head;B<=u&&--u,t.splice(--B,2,new Rn(we?be:re,we?re:be))}}return new Hr(t,u)}function li(e,t){return new Hr([new Rn(e,t||e)],0)}function ui(e){return e.text?ut(e.from.line+e.text.length-1,Pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Wo(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return ui(t);var u=e.line+t.text.length-(t.to.line-t.from.line)-1,l=e.ch;return e.line==t.to.line&&(l+=ui(t).ch-t.to.ch),ut(u,l)}function $a(e,t){for(var u=[],l=0;l<e.sel.ranges.length;l++){var y=e.sel.ranges[l];u.push(new Rn(Wo(y.anchor,t),Wo(y.head,t)))}return Jr(e.cm,u,e.sel.primIndex)}function Ho(e,t,u){return e.line==t.line?ut(u.line,e.ch-t.ch+u.ch):ut(u.line+(e.line-t.line),e.ch)}function hl(e,t,u){for(var l=[],y=ut(e.first,0),B=y,$=0;$<t.length;$++){var q=t[$],te=Ho(q.from,y,B),re=Ho(ui(q),y,B);if(y=q.to,B=re,u=="around"){var be=e.sel.ranges[$],we=Ct(be.head,be.anchor)<0;l[$]=new Rn(we?re:te,we?te:re)}else l[$]=new Rn(te,te)}return new Hr(l,e.sel.primIndex)}function Ja(e){e.doc.mode=$e(e.options,e.doc.modeOption),Ji(e)}function Ji(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,Yi(e,100),e.state.modeGen++,e.curOp&&Lr(e)}function Ko(e,t){return t.from.ch==0&&t.to.ch==0&&Pe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Za(e,t,u,l){function y(Nt){return u?u[Nt]:null}function B(Nt,Dt,jt){ni(Nt,Dt,jt,l),yn(Nt,"change",Nt,t)}function $(Nt,Dt){for(var jt=[],Qt=Nt;Qt<Dt;++Qt)jt.push(new br(re[Qt],y(Qt),l));return jt}var q=t.from,te=t.to,re=t.text,be=At(e,q.line),we=At(e,te.line),Be=Pe(re),Ne=y(re.length-1),nt=te.line-q.line;if(t.full)e.insert(0,$(0,re.length)),e.remove(re.length,e.size-re.length);else if(Ko(e,t)){var dt=$(0,re.length-1);B(we,we.text,Ne),nt&&e.remove(q.line,nt),dt.length&&e.insert(q.line,dt)}else if(be==we)if(re.length==1)B(be,be.text.slice(0,q.ch)+Be+be.text.slice(te.ch),Ne);else{var wt=$(1,re.length-1);wt.push(new br(Be+be.text.slice(te.ch),Ne,l)),B(be,be.text.slice(0,q.ch)+re[0],y(0)),e.insert(q.line+1,wt)}else if(re.length==1)B(be,be.text.slice(0,q.ch)+re[0]+we.text.slice(te.ch),y(0)),e.remove(q.line+1,nt);else{B(be,be.text.slice(0,q.ch)+re[0],y(0)),B(we,Be+we.text.slice(te.ch),Ne);var It=$(1,re.length-1);nt>1&&e.remove(q.line+1,nt-1),e.insert(q.line+1,It)}yn(e,"change",e,t)}function ci(e,t,u){function l(y,B,$){if(y.linked)for(var q=0;q<y.linked.length;++q){var te=y.linked[q];if(te.doc==B)continue;var re=$&&te.sharedHist;if(u&&!re)continue;t(te.doc,re),l(te.doc,y,re)}}l(e,null,!0)}function Go(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ja(e),Ja(e),zo(e),e.options.lineWrapping||Xr(e),e.options.mode=t.modeOption,Lr(e)}function zo(e){(e.doc.direction=="rtl"?U:_)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ur(e,function(){zo(e),Lr(e)})}function ba(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 Qa(e,t){var u={from:pr(t.from),to:ui(t),text:Tn(e,t.from,t.to)};return Yo(e,u,t.from.line,t.to.line+1),ci(e,function(l){return Yo(l,u,t.from.line,t.to.line+1)},!0),u}function Vo(e){for(;e.length;){var t=Pe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Vo(e.done),Pe(e.done);if(e.done.length&&!Pe(e.done).ranges)return Pe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Pe(e.done)}function Xo(e,t,u,l){var y=e.history;y.undone.length=0;var B=+new Date,$,q;if((y.lastOp==l||y.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&y.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(y,y.lastOp==l)))q=Pe($.changes),Ct(t.from,t.to)==0&&Ct(t.from,q.to)==0?q.to=ui(t):$.changes.push(Qa(e,t));else{var te=Pe(y.done);for((!te||!te.ranges)&&_a(e.sel,y.done),$={changes:[Qa(e,t)],generation:y.generation},y.done.push($);y.done.length>y.undoDepth;)y.done.shift(),y.done[0].ranges||y.done.shift()}y.done.push(u),y.generation=++y.maxGeneration,y.lastModTime=y.lastSelTime=B,y.lastOp=y.lastSelOp=l,y.lastOrigin=y.lastSelOrigin=t.origin,q||ke(e,"historyAdded")}function ml(e,t,u,l){var y=t.charAt(0);return y=="*"||y=="+"&&u.ranges.length==l.ranges.length&&u.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,u,l){var y=e.history,B=l&&l.origin;u==y.lastSelOp||B&&y.lastSelOrigin==B&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==B||ml(e,B,Pe(y.done),t))?y.done[y.done.length-1]=t:_a(t,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=B,y.lastSelOp=u,l&&l.clearRedo!==!1&&Vo(y.undone)}function _a(e,t){var u=Pe(t);u&&u.ranges&&u.equals(e)||t.push(e)}function Yo(e,t,u,l){var y=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function($){$.markedSpans&&((y||(y=t["spans_"+e.id]={}))[B]=$.markedSpans),++B})}function vl(e){if(!e)return null;for(var t,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?t||(t=e.slice(0,u)):t&&t.push(e[u]);return t?t.length?t:null:e}function yl(e,t){var u=t["spans_"+e.id];if(!u)return null;for(var l=[],y=0;y<t.text.length;++y)l.push(vl(u[y]));return l}function $o(e,t){var u=yl(e,t),l=_n(e,t);if(!u)return l;if(!l)return u;for(var y=0;y<u.length;++y){var B=u[y],$=l[y];if(B&&$){e:for(var q=0;q<$.length;++q){for(var te=$[q],re=0;re<B.length;++re)if(B[re].marker==te.marker)continue e;B.push(te)}}else $&&(u[y]=$)}return u}function Li(e,t,u){for(var l=[],y=0;y<e.length;++y){var B=e[y];if(B.ranges){l.push(u?Hr.prototype.deepCopy.call(B):B);continue}var $=B.changes,q=[];l.push({changes:q});for(var te=0;te<$.length;++te){var re=$[te],be=void 0;if(q.push({from:re.from,to:re.to,text:re.text}),t)for(var we in re)(be=we.match(/^spans_(\d+)$/))&&(ne(t,Number(be[1]))>-1&&(Pe(q)[we]=re[we],delete re[we]))}}return l}function qa(e,t,u,l){if(l){var y=e.anchor;if(u){var B=Ct(t,y)<0;B!=Ct(u,y)<0?(y=t,t=u):B!=Ct(t,u)<0&&(t=u)}return new Rn(y,t)}else return new Rn(u||t,t)}function Ea(e,t,u,l,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),xr(e,new Hr([qa(e.sel.primary(),t,u,y)],0),l)}function Jo(e,t,u){for(var l=[],y=e.cm&&(e.cm.display.shift||e.extend),B=0;B<e.sel.ranges.length;B++)l[B]=qa(e.sel.ranges[B],t[B],null,y);var $=Jr(e.cm,l,e.sel.primIndex);xr(e,$,u)}function eo(e,t,u,l){var y=e.sel.ranges.slice(0);y[t]=u,xr(e,Jr(e.cm,y,e.sel.primIndex),l)}function Zo(e,t,u,l){xr(e,li(t,u),l)}function bl(e,t,u){var l={ranges:t.ranges,update:function(y){this.ranges=[];for(var B=0;B<y.length;B++)this.ranges[B]=new Rn(I(e,y[B].anchor),I(e,y[B].head))},origin:u&&u.origin};return ke(e,"beforeSelectionChange",e,l),e.cm&&ke(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=t.ranges?Jr(e.cm,l.ranges,l.ranges.length-1):t}function Qo(e,t,u){var l=e.history.done,y=Pe(l);y&&y.ranges?(l[l.length-1]=t,xa(e,t,u)):xr(e,t,u)}function xr(e,t,u){xa(e,t,u),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function xa(e,t,u){(ce(e,"beforeSelectionChange")||e.cm&&ce(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,u));var l=u&&u.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);qo(e,ts(e,t,l,!0)),!(u&&u.scroll===!1)&&e.cm&&Ai(e.cm)}function qo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ye(e.cm)),yn(e,"cursorActivity",e)}function es(e){qo(e,ts(e,e.sel,null,!1))}function ts(e,t,u,l){for(var y,B=0;B<t.ranges.length;B++){var $=t.ranges[B],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],te=Ta(e,$.anchor,q&&q.anchor,u,l),re=Ta(e,$.head,q&&q.head,u,l);(y||te!=$.anchor||re!=$.head)&&(y||(y=t.ranges.slice(0,B)),y[B]=new Rn(te,re))}return y?Jr(e.cm,y,t.primIndex):t}function Ii(e,t,u,l,y){var B=At(e,t.line);if(B.markedSpans)for(var $=0;$<B.markedSpans.length;++$){var q=B.markedSpans[$],te=q.marker,re="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,be="selectRight"in te?!te.selectRight:te.inclusiveRight;if((q.from==null||(re?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(be?q.to>=t.ch:q.to>t.ch))){if(y&&(ke(te,"beforeCursorEnter"),te.explicitlyCleared))if(B.markedSpans){--$;continue}else break;if(!te.atomic)continue;if(u){var we=te.find(l<0?1:-1),Be=void 0;if((l<0?be:re)&&(we=ns(e,we,-l,we&&we.line==t.line?B:null)),we&&we.line==t.line&&(Be=Ct(we,u))&&(l<0?Be<0:Be>0))return Ii(e,we,t,l,y)}var Ne=te.find(l<0?-1:1);return(l<0?re:be)&&(Ne=ns(e,Ne,l,Ne.line==t.line?B:null)),Ne?Ii(e,Ne,t,l,y):null}}return t}function Ta(e,t,u,l,y){var B=l||1,$=Ii(e,t,u,B,y)||!y&&Ii(e,t,u,B,!0)||Ii(e,t,u,-B,y)||!y&&Ii(e,t,u,-B,!0);return $||(e.cantEdit=!0,ut(e.first,0))}function ns(e,t,u,l){return u<0&&t.ch==0?t.line>e.first?I(e,ut(t.line-1)):null:u>0&&t.ch==(l||At(e,t.line)).text.length?t.line<e.first+e.size-1?ut(t.line+1,0):null:new ut(t.line,t.ch+u)}function rs(e){e.setSelection(ut(e.firstLine(),0),ut(e.lastLine()),me)}function is(e,t,u){var l={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return l.canceled=!0}};return u&&(l.update=function(y,B,$,q){y&&(l.from=I(e,y)),B&&(l.to=I(e,B)),$&&(l.text=$),q!==void 0&&(l.origin=q)}),ke(e,"beforeChange",e,l),e.cm&&ke(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function Di(e,t,u){if(e.cm){if(!e.cm.curOp)return cr(e.cm,Di)(e,t,u);if(e.cm.state.suppressEdits)return}if((ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"))&&(t=is(e,t,!0),!t))return;var l=Pn&&!u&&fn(e,t.from,t.to);if(l)for(var y=l.length-1;y>=0;--y)as(e,{from:l[y].from,to:l[y].to,text:y?[""]:t.text,origin:t.origin});else as(e,t)}function as(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var u=$a(e,t);Xo(e,t,u,e.cm?e.cm.curOp.id:NaN),Zi(e,t,u,_n(e,t));var l=[];ci(e,function(y,B){!B&&ne(l,y.history)==-1&&(us(y.history,t),l.push(y.history)),Zi(y,t,null,_n(y,t))})}function wa(e,t,u){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!u)return;for(var y=e.history,B,$=e.sel,q=t=="undo"?y.done:y.undone,te=t=="undo"?y.undone:y.done,re=0;re<q.length&&!(B=q[re],u?B.ranges&&!B.equals(e.sel):!B.ranges);re++);if(re==q.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(B=q.pop(),B.ranges){if(_a(B,te),u&&!B.equals(e.sel)){xr(e,B,{clearRedo:!1});return}$=B}else if(l){q.push(B);return}else break;var be=[];_a($,te),te.push({changes:be,generation:y.generation}),y.generation=B.generation||++y.maxGeneration;for(var we=ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"),Be=function(dt){var wt=B.changes[dt];if(wt.origin=t,we&&!is(e,wt,!1))return q.length=0,{};be.push(Qa(e,wt));var It=dt?$a(e,wt):Pe(q);Zi(e,wt,It,$o(e,wt)),!dt&&e.cm&&e.cm.scrollIntoView({from:wt.from,to:ui(wt)});var Nt=[];ci(e,function(Dt,jt){!jt&&ne(Nt,Dt.history)==-1&&(us(Dt.history,wt),Nt.push(Dt.history)),Zi(Dt,wt,null,$o(Dt,wt))})},Ne=B.changes.length-1;Ne>=0;--Ne){var nt=Be(Ne);if(nt)return nt.v}}function os(e,t){if(t==0)return;if(e.first+=t,e.sel=new Hr(et(e.sel.ranges,function(y){return new Rn(ut(y.anchor.line+t,y.anchor.ch),ut(y.head.line+t,y.head.ch))}),e.sel.primIndex),e.cm){Lr(e.cm,e.first,e.first-t,t);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)oi(e.cm,l,"gutter")}}function Zi(e,t,u,l){if(e.cm&&!e.cm.curOp)return cr(e.cm,Zi)(e,t,u,l);if(t.to.line<e.first){os(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 y=t.text.length-1-(e.first-t.from.line);os(e,y),t={from:ut(e.first,0),to:ut(t.to.line+y,t.to.ch),text:[Pe(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:ut(B,At(e,B).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Tn(e,t.from,t.to),u||(u=$a(e,t)),e.cm?_l(e.cm,t,l):Za(e,t,l),xa(e,u,me),e.cantEdit&&Ta(e,ut(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,u){var l=e.doc,y=e.display,B=t.from,$=t.to,q=!1,te=B.line;e.options.lineWrapping||(te=Wt(Qn(At(l,B.line))),l.iter(te,$.line+1,function(Ne){if(Ne==y.maxLine)return q=!0,!0})),l.sel.contains(t.from,t.to)>-1&&ye(e),Za(l,t,u,To(e)),e.options.lineWrapping||(l.iter(te,B.line+t.text.length,function(Ne){var nt=Gt(Ne);nt>y.maxLineLength&&(y.maxLine=Ne,y.maxLineLength=nt,y.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),tn(l,B.line),Yi(e,400);var re=t.text.length-($.line-B.line)-1;t.full?Lr(e):B.line==$.line&&t.text.length==1&&!Ko(e.doc,t)?oi(e,B.line,"text"):Lr(e,B.line,$.line+1,re);var be=ce(e,"changes"),we=ce(e,"change");if(we||be){var Be={from:B,to:$,text:t.text,removed:t.removed,origin:t.origin};we&&yn(e,"change",e,Be),be&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Be)}e.display.selForContextMenu=null}function Mi(e,t,u,l,y){var B;l||(l=u),Ct(l,u)<0&&(B=[l,u],u=B[0],l=B[1]),typeof t=="string"&&(t=e.splitLines(t)),Di(e,{from:u,to:l,text:t,origin:y})}function ss(e,t,u,l){u<e.line?e.line+=l:t<e.line&&(e.line=t,e.ch=0)}function ls(e,t,u,l){for(var y=0;y<e.length;++y){var B=e[y],$=!0;if(B.ranges){B.copied||(B=e[y]=B.deepCopy(),B.copied=!0);for(var q=0;q<B.ranges.length;q++)ss(B.ranges[q].anchor,t,u,l),ss(B.ranges[q].head,t,u,l);continue}for(var te=0;te<B.changes.length;++te){var re=B.changes[te];if(u<re.from.line)re.from=ut(re.from.line+l,re.from.ch),re.to=ut(re.to.line+l,re.to.ch);else if(t<=re.to.line){$=!1;break}}$||(e.splice(0,y+1),y=0)}}function us(e,t){var u=t.from.line,l=t.to.line,y=t.text.length-(l-u)-1;ls(e.done,u,l,y),ls(e.undone,u,l,y)}function Qi(e,t,u,l){var y=t,B=t;return typeof t=="number"?B=At(e,J(e,t)):y=Wt(t),y==null?null:(l(B,y)&&e.cm&&oi(e.cm,y,u),B)}function qi(e){this.lines=e,this.parent=null;for(var t=0,u=0;u<e.length;++u)e[u].parent=this,t+=e[u].height;this.height=t}qi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var u=e,l=e+t;u<l;++u){var y=this.lines[u];this.height-=y.height,Bt(y),yn(y,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var l=0;l<t.length;++l)t[l].parent=this},iterN:function(e,t,u){for(var l=e+t;e<l;++e)if(u(this.lines[e]))return!0}};function ea(e){this.children=e;for(var t=0,u=0,l=0;l<e.length;++l){var y=e[l];t+=y.chunkSize(),u+=y.height,y.parent=this}this.size=t,this.height=u,this.parent=null}ea.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var u=0;u<this.children.length;++u){var l=this.children[u],y=l.chunkSize();if(e<y){var B=Math.min(t,y-e),$=l.height;if(l.removeInner(e,B),this.height-=$-l.height,y==B&&(this.children.splice(u--,1),l.parent=null),(t-=B)==0)break;e=0}else e-=y}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof qi))){var q=[];this.collapse(q),this.children=[new qi(q)],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,u){this.size+=t.length,this.height+=u;for(var l=0;l<this.children.length;++l){var y=this.children[l],B=y.chunkSize();if(e<=B){if(y.insertInner(e,t,u),y.lines&&y.lines.length>50){for(var $=y.lines.length%25+25,q=$;q<y.lines.length;){var te=new qi(y.lines.slice(q,q+=25));y.height-=te.height,this.children.splice(++l,0,te),te.parent=this}y.lines=y.lines.slice(0,$),this.maybeSpill()}break}e-=B}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),u=new ea(t);if(e.parent){e.size-=u.size,e.height-=u.height;var y=ne(e.parent.children,e);e.parent.children.splice(y+1,0,u)}else{var l=new ea(e.children);l.parent=e,e.children=[l,u],e=l}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,u){for(var l=0;l<this.children.length;++l){var y=this.children[l],B=y.chunkSize();if(e<B){var $=Math.min(t,B-e);if(y.iterN(e,$,u))return!0;if((t-=$)==0)break;e=0}else e-=B}}};var ta=function(e,t,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=t};ta.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,u=this.line,l=Wt(u);if(l==null||!t)return;for(var y=0;y<t.length;++y)t[y]==this&&t.splice(y--,1);t.length||(u.widgets=null);var B=nr(this);Sn(u,Math.max(0,u.height-B)),e&&(Ur(e,function(){cs(e,u,-B),oi(e,l,"widget")}),yn(e,"lineWidgetCleared",e,this,l))},ta.prototype.changed=function(){var e=this,t=this.height,u=this.doc.cm,l=this.line;this.height=null;var y=nr(this)-t;if(!y)return;Rr(this.doc,l)||Sn(l,l.height+y),u&&Ur(u,function(){u.curOp.forceUpdate=!0,cs(u,l,y),yn(u,"lineWidgetChanged",u,e,Wt(l))})},pe(ta);function cs(e,t,u){zn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ka(e,u)}function El(e,t,u,l){var y=new ta(e,u,l),B=e.cm;return B&&y.noHScroll&&(B.display.alignWidgets=!0),Qi(e,t,"widget",function($){var q=$.widgets||($.widgets=[]);if(y.insertAt==null?q.push(y):q.splice(Math.min(q.length-1,Math.max(0,y.insertAt)),0,y),y.line=$,B&&!Rr(e,$)){var te=zn($)<e.scrollTop;Sn($,$.height+nr(y)),te&&Ka(B,y.height),B.curOp.forceUpdate=!0}return!0}),B&&yn(B,"lineWidgetAdded",B,y,typeof t=="number"?t:Wt(t)),y}var ds=0,di=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ds};di.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&bi(e),ce(this,"clear")){var u=this.find();u&&yn(this,"clear",u.from,u.to)}for(var l=null,y=null,B=0;B<this.lines.length;++B){var $=this.lines[B],q=wn($.markedSpans,this);e&&!this.collapsed?oi(e,Wt($),"text"):e&&(q.to!=null&&(y=Wt($)),q.from!=null&&(l=Wt($))),$.markedSpans=In($.markedSpans,q),q.from==null&&this.collapsed&&!Rr(this.doc,$)&&e&&Sn($,Si(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var re=Qn(this.lines[te]),be=Gt(re);be>e.display.maxLineLength&&(e.display.maxLine=re,e.display.maxLineLength=be,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Lr(e,l,y+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&es(e.doc)),e&&yn(e,"markerCleared",e,this,l,y),t&&_i(e),this.parent&&this.parent.clear()},di.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var u,l,y=0;y<this.lines.length;++y){var B=this.lines[y],$=wn(B.markedSpans,this);if($.from!=null&&(u=ut(t?B:Wt(B),$.from),e==-1))return u;if($.to!=null&&(l=ut(t?B:Wt(B),$.to),e==1))return l}return u&&{from:u,to:l}},di.prototype.changed=function(){var e=this,t=this.find(-1,!0),u=this,l=this.doc.cm;if(!t||!l)return;Ur(l,function(){var y=t.line,B=Wt(t.line),$=ca(l,B);if($&&(mo($),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Rr(u.doc,y)&&u.height!=null){var q=u.height;u.height=null;var te=nr(u)-q;te&&Sn(y,y.height+te)}yn(l,"markerChanged",l,e)})},di.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ne(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},di.prototype.detachLine=function(e){if(this.lines.splice(ne(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},pe(di);function Pi(e,t,u,l,y){if(l&&l.shared)return xl(e,t,u,l,y);if(e.cm&&!e.cm.curOp)return cr(e.cm,Pi)(e,t,u,l,y);var B=new di(e,y),$=Ct(t,u);if(l&&T(l,B,!1),$>0||$==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=C("span",[B.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(un(e,t.line,t,u,B)||t.line!=u.line&&un(e,u.line,t,u,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");An()}B.addToHistory&&Xo(e,{from:t,to:u,origin:"markText"},e.sel,NaN);var q=t.line,te=e.cm,re;if(e.iter(q,u.line+1,function(we){te&&B.collapsed&&!te.options.lineWrapping&&Qn(we)==te.display.maxLine&&(re=!0),B.collapsed&&q!=t.line&&Sn(we,0),Gn(we,new Ln(B,q==t.line?t.ch:null,q==u.line?u.ch:null)),++q}),B.collapsed&&e.iter(t.line,u.line+1,function(we){Rr(e,we)&&Sn(we,0)}),B.clearOnEnter&&Ce(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(On(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++ds,B.atomic=!0),te){if(re&&(te.curOp.updateMaxLine=!0),B.collapsed)Lr(te,t.line,u.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var be=t.line;be<=u.line;be++)oi(te,be,"text");B.atomic&&es(te.doc),yn(te,"markerAdded",te,B)}return B}var na=function(e,t){this.markers=e,this.primary=t;for(var u=0;u<e.length;++u)e[u].parent=this};na.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();yn(this,"clear")},na.prototype.find=function(e,t){return this.primary.find(e,t)},pe(na);function xl(e,t,u,l,y){l=T(l),l.shared=!1;var B=[Pi(e,t,u,l,y)],$=B[0],q=l.widgetNode;return ci(e,function(te){q&&(l.widgetNode=q.cloneNode(!0)),B.push(Pi(te,I(te,t),I(te,u),l,y));for(var re=0;re<te.linked.length;++re)if(te.linked[re].isParent)return;$=Pe(B)}),new na(B,$)}function hs(e){return e.findMarks(ut(e.first,0),e.clipPos(ut(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var u=0;u<t.length;u++){var l=t[u],y=l.find(),B=e.clipPos(y.from),$=e.clipPos(y.to);if(Ct(B,$)){var q=Pi(e,B,$,l.primary,l.primary.type);l.markers.push(q),q.parent=l}}}function wl(e){for(var t=function(l){var y=e[l],B=[y.primary.doc];ci(y.primary.doc,function(te){return B.push(te)});for(var $=0;$<y.markers.length;$++){var q=y.markers[$];ne(B,q.doc)==-1&&(q.parent=null,y.markers.splice($--,1))}},u=0;u<e.length;u++)t(u)}var Sl=0,Ir=function(e,t,u,l,y){if(!(this instanceof Ir))return new Ir(e,t,u,l,y);u==null&&(u=0),ea.call(this,[new qi([new br("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var B=ut(u,0);this.sel=li(B),this.history=new ba(null),this.id=++Sl,this.modeOption=t,this.lineSep=l,this.direction=y=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Za(this,{from:B,to:B,text:e}),xr(this,li(B),me)};Ir.prototype=it(ea.prototype,{constructor:Ir,iter:function(e,t,u){u?this.iterN(e-this.first,t-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var u=0,l=0;l<t.length;++l)u+=t[l].height;this.insertInner(e-this.first,t,u)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Fn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:dr(function(e){var t=ut(this.first,0),u=this.first+this.size-1;Di(this,{from:t,to:ut(u,At(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Gi(this.cm,0,0),xr(this,li(t),me)}),replaceRange:function(e,t,u,l){t=I(this,t),u=u?I(this,u):t,Mi(this,e,t,u,l)},getRange:function(e,t,u){var l=Tn(this,I(this,e),I(this,t));return u===!1?l:l.join(u||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Mn(this,e))return At(this,e)},getLineNumber:function(e){return Wt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=At(this,e)),Qn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return I(this,e)},getCursor:function(e){var t=this.sel.primary(),u;return e==null||e=="head"?u=t.head:e=="anchor"?u=t.anchor:e=="end"||e=="to"||e===!1?u=t.to():u=t.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:dr(function(e,t,u){Zo(this,I(this,typeof e=="number"?ut(e,t||0):e),null,u)}),setSelection:dr(function(e,t,u){Zo(this,I(this,e),I(this,t||e),u)}),extendSelection:dr(function(e,t,u){Ea(this,I(this,e),t&&I(this,t),u)}),extendSelections:dr(function(e,t){Jo(this,K(this,e),t)}),extendSelectionsBy:dr(function(e,t){var u=et(this.sel.ranges,e);Jo(this,K(this,u),t)}),setSelections:dr(function(e,t,u){if(!e.length)return;for(var l=[],y=0;y<e.length;y++)l[y]=new Rn(I(this,e[y].anchor),I(this,e[y].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),xr(this,Jr(this.cm,l,t),u)}),addSelection:dr(function(e,t,u){var l=this.sel.ranges.slice(0);l.push(new Rn(I(this,e),I(this,t||e))),xr(this,Jr(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var t=this.sel.ranges,u,l=0;l<t.length;l++){var y=Tn(this,t[l].from(),t[l].to());u=u?u.concat(y):y}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],u=this.sel.ranges,l=0;l<u.length;l++){var y=Tn(this,u[l].from(),u[l].to());e!==!1&&(y=y.join(e||this.lineSeparator())),t[l]=y}return t},replaceSelection:function(e,t,u){for(var l=[],y=0;y<this.sel.ranges.length;y++)l[y]=e;this.replaceSelections(l,t,u||"+input")},replaceSelections:dr(function(e,t,u){for(var l=[],y=this.sel,B=0;B<y.ranges.length;B++){var $=y.ranges[B];l[B]={from:$.from(),to:$.to(),text:this.splitLines(e[B]),origin:u}}for(var q=t&&t!="end"&&hl(this,l,t),te=l.length-1;te>=0;te--)Di(this,l[te]);q?Qo(this,q):this.cm&&Ai(this.cm)}),undo:dr(function(){wa(this,"undo")}),redo:dr(function(){wa(this,"redo")}),undoSelection:dr(function(){wa(this,"undo",!0)}),redoSelection:dr(function(){wa(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,u=0,l=0;l<e.done.length;l++)e.done[l].ranges||++t;for(var y=0;y<e.undone.length;y++)e.undone[y].ranges||++u;return{undo:t,redo:u}},clearHistory:function(){var e=this;this.history=new ba(this.history.maxGeneration),ci(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:Li(this.history.done),undone:Li(this.history.undone)}},setHistory:function(e){var t=this.history=new ba(this.history.maxGeneration);t.done=Li(e.done.slice(0),null,!0),t.undone=Li(e.undone.slice(0),null,!0)},setGutterMarker:dr(function(e,t,u){return Qi(this,e,"gutter",function(l){var y=l.gutterMarkers||(l.gutterMarkers={});return y[t]=u,!u&&he(y)&&(l.gutterMarkers=null),!0})}),clearGutter:dr(function(e){var t=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&Qi(t,u,"gutter",function(){return u.gutterMarkers[e]=null,he(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Mn(this,e))return null;if(t=e,e=At(this,e),!e)return null}else if(t=Wt(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:dr(function(e,t,u){return Qi(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!l[y])l[y]=u;else{if(O(u).test(l[y]))return!1;l[y]+=" "+u}return!0})}),removeLineClass:dr(function(e,t,u){return Qi(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",B=l[y];if(B)if(u==null)l[y]=null;else{var $=B.match(O(u));if(!$)return!1;var q=$.index+$[0].length;l[y]=B.slice(0,$.index)+(!$.index||q==B.length?"":" ")+B.slice(q)||null}else return!1;return!0})}),addLineWidget:dr(function(e,t,u){return El(this,e,t,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,u){return Pi(this,I(this,e),I(this,t),u,u&&u.type||"range")},setBookmark:function(e,t){var u={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=I(this,e),Pi(this,e,e,u,"bookmark")},findMarksAt:function(e){e=I(this,e);var t=[],u=At(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var y=u[l];(y.from==null||y.from<=e.ch)&&(y.to==null||y.to>=e.ch)&&t.push(y.marker.parent||y.marker)}return t},findMarks:function(e,t,u){e=I(this,e),t=I(this,t);var l=[],y=e.line;return this.iter(e.line,t.line+1,function(B){var $=B.markedSpans;if($)for(var q=0;q<$.length;q++){var te=$[q];!(te.to!=null&&y==e.line&&e.ch>=te.to||te.from==null&&y!=e.line||te.from!=null&&y==t.line&&te.from>=t.ch)&&(!u||u(te.marker))&&l.push(te.marker.parent||te.marker)}++y}),l},getAllMarks:function(){var e=[];return this.iter(function(t){var u=t.markedSpans;if(u)for(var l=0;l<u.length;++l)u[l].from!=null&&e.push(u[l].marker)}),e},posFromIndex:function(e){var t,u=this.first,l=this.lineSeparator().length;return this.iter(function(y){var B=y.text.length+l;if(B>e)return t=e,!0;e-=B,++u}),I(this,ut(u,t))},indexFromPos:function(e){e=I(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){t+=l.text.length+u}),t},copy:function(e){var t=new Ir(Fn(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,u=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<u&&(u=e.to);var l=new Ir(Fn(this,t,u),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(l,hs(this)),l},unlinkDoc:function(e){if(e instanceof Kn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var u=this.linked[t];if(u.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(hs(this));break}if(e.history==this.history){var l=[e.id];ci(e,function(y){return l.push(y.id)},!0),e.history=new ba(null),e.history.done=Li(this.history.done,l),e.history.undone=Li(this.history.undone,l)}},iterLinkedDocs:function(e){ci(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):He(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:dr(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)})}),Ir.prototype.eachLine=Ir.prototype.iter;var fs=0;function Cl(e){var t=this;if(ps(t),Ke(t,e)||bn(t.display,e))return;ie(e),G&&(fs=+new Date);var u=mi(t,e,!0),l=e.dataTransfer.files;if(!u||t.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var y=l.length,B=Array(y),$=0,q=function(){++$==y&&cr(t,function(){u=I(t.doc,u);var Ne={from:u,to:u,text:t.doc.splitLines(B.filter(function(nt){return nt!=null}).join(t.doc.lineSeparator())),origin:"paste"};Di(t.doc,Ne),Qo(t.doc,li(I(t.doc,u),I(t.doc,ui(Ne))))})()},te=function(Ne,nt){if(t.options.allowDropFileTypes&&ne(t.options.allowDropFileTypes,Ne.type)==-1){q();return}var dt=new FileReader;dt.onerror=function(){return q()},dt.onload=function(){var wt=dt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(wt)){q();return}B[nt]=wt,q()},dt.readAsText(Ne)},re=0;re<l.length;re++)te(l[re],re);else{if(t.state.draggingText&&t.doc.sel.contains(u)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var be=e.dataTransfer.getData("Text");if(be){var we;if(t.state.draggingText&&!t.state.draggingText.copy&&(we=t.listSelections()),xa(t.doc,li(u,u)),we)for(var Be=0;Be<we.length;++Be)Mi(t.doc,"",we[Be].anchor,we[Be].head,"drag");t.replaceSelection(be,"around","paste"),t.display.input.focus()}}catch(Ne){}}}function Ol(e,t){if(G&&(!e.state.draggingText||+new Date-fs<100)){ge(t);return}if(Ke(e,t)||bn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h){var u=f("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),t.dataTransfer.setDragImage(u,0,0),p&&u.parentNode.removeChild(u)}}function Al(e,t){var u=mi(e,t);if(!u)return;var l=document.createDocumentFragment();Co(e,u,l),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),g(e.display.dragCursor,l)}function ps(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ms(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),u=[],l=0;l<t.length;l++){var y=t[l].CodeMirror;y&&u.push(y)}u.length&&u[0].operation(function(){for(var B=0;B<u.length;B++)e(u[B])})}var gs=!1;function Rl(){if(gs)return;Ll(),gs=!0}function Ll(){var e;Ce(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ms(Il)},100))}),Ce(window,"blur",function(){return ms(Oi)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var hi={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"},ra=0;ra<10;ra++)hi[ra+48]=hi[ra+96]=String(ra);for(var Sa=65;Sa<=90;Sa++)hi[Sa]=String.fromCharCode(Sa);for(var ia=1;ia<=12;ia++)hi[ia+111]=hi[ia+63235]="F"+ia;var ii={};ii.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"},ii.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"},ii.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"},ii.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"]},ii.default=r?ii.macDefault:ii.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var u,l,y,B,$=0;$<t.length-1;$++){var q=t[$];if(/^(cmd|meta|m)$/i.test(q))B=!0;else if(/^a(lt)?$/i.test(q))u=!0;else if(/^(c|ctrl|control)$/i.test(q))l=!0;else if(/^s(hift)?$/i.test(q))y=!0;else throw new Error("Unrecognized modifier name: "+q)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),B&&(e="Cmd-"+e),y&&(e="Shift-"+e),e}function Ml(e){var t={};for(var u in e)if(e.hasOwnProperty(u)){var l=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(l=="..."){delete e[u];continue}for(var y=et(u.split(" "),Dl),B=0;B<y.length;B++){var $=void 0,q=void 0;B==y.length-1?(q=y.join(" "),$=l):(q=y.slice(0,B+1).join(" "),$="...");var te=t[q];if(!te)t[q]=$;else if(te!=$)throw new Error("Inconsistent bindings for "+q)}delete e[u]}for(var re in t)e[re]=t[re];return e}function ki(e,t,u,l){t=Ca(t);var y=t.call?t.call(e,l):t[e];if(y===!1)return"nothing";if(y==="...")return"multi";if(y!=null&&u(y))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ki(e,t.fallthrough,u,l);for(var B=0;B<t.fallthrough.length;B++){var $=ki(e,t.fallthrough[B],u,l);if($)return $}}}function vs(e){var t=typeof e=="string"?e:hi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ys(e,t,u){var l=e;return t.altKey&&l!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&t.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function bs(e,t){if(p&&e.keyCode==34&&e.char)return!1;var u=hi[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),ys(u,e,t))}function Ca(e){return typeof e=="string"?ii[e]:e}function Ni(e,t){for(var u=e.doc.sel.ranges,l=[],y=0;y<u.length;y++){for(var B=t(u[y]);l.length&&Ct(B.from,Pe(l).to)<=0;){var $=l.pop();if(Ct($.from,B.from)<0){B.from=$.from;break}}l.push(B)}Ur(e,function(){for(var q=l.length-1;q>=0;q--)Mi(e.doc,"",l[q].from,l[q].to,"+delete");Ai(e)})}function to(e,t,u){var l=Me(e.text,t+u,u);return l<0||l>e.text.length?null:l}function no(e,t,u){var l=to(e,t.ch,u);return l==null?null:new ut(t.line,l,u<0?"after":"before")}function ro(e,t,u,l,y){if(e){t.doc.direction=="rtl"&&(y=-y);var B=Et(u,t.doc.direction);if(B){var $=y<0?Pe(B):B[0],q=y<0==($.level==1),te=q?"after":"before",re;if($.level>0||t.doc.direction=="rtl"){var be=Er(t,u);re=y<0?u.text.length-1:0;var we=ei(t,be,re).top;re=qe(function(Be){return ei(t,be,Be).top==we},y<0==($.level==1)?$.from:$.to-1,re),te=="before"&&(re=to(u,re,1))}else re=y<0?$.to:$.from;return new ut(l,re,te)}}return new ut(l,y<0?u.text.length:0,y<0?"before":"after")}function Pl(e,t,u,l){var y=Et(t,e.doc.direction);if(!y)return no(t,u,l);u.ch>=t.text.length?(u.ch=t.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var B=gt(y,u.ch,u.sticky),$=y[B];if(e.doc.direction=="ltr"&&$.level%2==0&&(l>0?$.to>u.ch:$.from<u.ch))return no(t,u,l);var q=function(It,Nt){return to(t,It instanceof ut?It.ch:It,Nt)},te,re=function(It){return e.options.lineWrapping?(te=te||Er(e,t),xo(e,t,te,It)):{begin:0,end:t.text.length}},be=re(u.sticky=="before"?q(u,-1):u.ch);if(e.doc.direction=="rtl"||$.level==1){var we=$.level==1==l<0,Be=q(u,we?1:-1);if(Be!=null&&(we?Be<=$.to&&Be<=be.end:Be>=$.from&&Be>=be.begin)){var Ne=we?"before":"after";return new ut(u.line,Be,Ne)}}var nt=function(It,Nt,Dt){for(var jt=function(Un,hr){return hr?new ut(u.line,q(Un,1),"before"):new ut(u.line,Un,"after")};It>=0&&It<y.length;It+=Nt){var Qt=y[It],Jt=Nt>0==(Qt.level!=1),dn=Jt?Dt.begin:q(Dt.end,-1);if(Qt.from<=dn&&dn<Qt.to)return jt(dn,Jt);if(dn=Jt?Qt.from:q(Qt.to,-1),Dt.begin<=dn&&dn<Dt.end)return jt(dn,Jt)}},dt=nt(B+l,l,be);if(dt)return dt;var wt=l>0?be.end:q(be.begin,-1);return wt!=null&&!(l>0&&wt==t.text.length)&&(dt=nt(l>0?0:y.length-1,l,re(wt)),dt)?dt:null}var aa={selectAll:rs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),me)},killLine:function(e){return Ni(e,function(t){if(t.empty()){var u=At(e.doc,t.head.line).text.length;return t.head.ch==u&&t.head.line<e.lastLine()?{from:t.head,to:ut(t.head.line+1,0)}:{from:t.head,to:ut(t.head.line,u)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ni(e,function(t){return{from:ut(t.from().line,0),to:I(e.doc,ut(t.to().line+1,0))}})},delLineLeft:function(e){return Ni(e,function(t){return{from:ut(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ni(e,function(t){var u=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return{from:l,to:t.from()}})},delWrappedLineRight:function(e){return Ni(e,function(t){var u=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:t.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ut(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ut(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return _s(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Es(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return kl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},Oe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},Oe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return l.ch<e.getLine(l.line).search(/\S/)?Es(e,t.head):l},Oe)},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=[],u=e.listSelections(),l=e.options.tabSize,y=0;y<u.length;y++){var B=u[y].from(),$=z(e.getLine(B.line),B.ch,l);t.push(ue(l-$%l))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ur(e,function(){for(var t=e.listSelections(),u=[],l=0;l<t.length;l++){if(!t[l].empty())continue;var y=t[l].head,B=At(e.doc,y.line).text;if(B){if(y.ch==B.length&&(y=new ut(y.line,y.ch-1)),y.ch>0)y=new ut(y.line,y.ch+1),e.replaceRange(B.charAt(y.ch-1)+B.charAt(y.ch-2),ut(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var $=At(e.doc,y.line-1).text;$&&(y=new ut(y.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),ut(y.line-1,$.length-1),y,"+transpose"))}}u.push(new Rn(y,y))}e.setSelections(u)})},newlineAndIndent:function(e){return Ur(e,function(){for(var t=e.listSelections(),u=t.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),t[u].anchor,t[u].head,"+input");t=e.listSelections();for(var l=0;l<t.length;l++)e.indentLine(t[l].from().line,null,!0);Ai(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function _s(e,t){var u=At(e.doc,t),l=Qn(u);return l!=u&&(t=Wt(l)),ro(!0,e,l,t,1)}function kl(e,t){var u=At(e.doc,t),l=Kr(u);return l!=u&&(t=Wt(l)),ro(!0,e,u,t,-1)}function Es(e,t){var u=_s(e,t.line),l=At(e.doc,u.line),y=Et(l,e.doc.direction);if(!y||y[0].level==0){var B=Math.max(u.ch,l.text.search(/\S/)),$=t.line==u.line&&t.ch<=B&&t.ch;return ut(u.line,$?0:B,u.sticky)}return u}function Oa(e,t,u){if(typeof t=="string"&&(t=aa[t],!t))return!1;e.display.input.ensurePolled();var l=e.display.shift,y=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),y=t(e)!=xe}finally{e.display.shift=l,e.state.suppressEdits=!1}return y}function Nl(e,t,u){for(var l=0;l<e.state.keyMaps.length;l++){var y=ki(t,e.state.keyMaps[l],u,e);if(y)return y}return e.options.extraKeys&&ki(t,e.options.extraKeys,u,e)||ki(t,e.options.keyMap,u,e)}var Ul=new Q;function oa(e,t,u,l){var y=e.state.keySeq;if(y){if(vs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==y&&(e.state.keySeq=null,e.display.input.reset())}),xs(e,y+" "+t,u,l))return!0}return xs(e,t,u,l)}function xs(e,t,u,l){var y=Nl(e,t,l);return y=="multi"&&(e.state.keySeq=t),y=="handled"&&yn(e,"keyHandled",e,t,u),(y=="handled"||y=="multi")&&(ie(u),Ba(e)),!!y}function Ts(e,t){var u=bs(t,!0);return u?t.shiftKey&&!e.state.keySeq?oa(e,"Shift-"+u,t,function(l){return Oa(e,l,!0)})||oa(e,u,t,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return Oa(e,l)}):oa(e,u,t,function(l){return Oa(e,l)}):!1}function Fl(e,t,u){return oa(e,"'"+u+"'",t,function(l){return Oa(e,l,!0)})}var io=null;function ws(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),Ke(t,e))return;G&&W<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;t.display.shift=u==16||e.shiftKey;var l=Ts(t,e);p&&(io=l?u:null,!l&&u==88&&!Ue&&(r?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!r&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&jl(t)}function jl(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(_(t,"CodeMirror-crosshair"),Je(document,"keyup",u),Je(document,"mouseover",u))}Ce(document,"keyup",u),Ce(document,"mouseover",u)}function Ss(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ke(this,e)}function Cs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(bn(t.display,e)||Ke(t,e)||e.ctrlKey&&!e.altKey||r&&e.metaKey)return;var u=e.keyCode,l=e.charCode;if(p&&u==io){io=null,ie(e);return}if(p&&(!e.which||e.which<10)&&Ts(t,e))return;var y=String.fromCharCode(l==null?u:l);if(y=="\b")return;if(Fl(t,e,y))return;t.display.input.onKeyPress(e)}var Bl=400,ao=function(e,t,u){this.time=e,this.pos=t,this.button=u};ao.prototype.compare=function(e,t,u){return this.time+Bl>e&&Ct(t,this.pos)==0&&u==this.button};var sa,la;function Wl(e,t){var u=+new Date;return la&&la.compare(u,e,t)?(sa=la=null,"triple"):sa&&sa.compare(u,e,t)?(la=new ao(u,e,t),sa=null,"double"):(sa=new ao(u,e,t),la=null,"single")}function Os(e){var t=this,u=t.display;if(Ke(t,e)||u.activeTouch&&u.input.supportsTouch())return;if(u.input.ensurePolled(),u.shift=e.shiftKey,bn(u,e)){n||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(oo(t,e))return;var l=mi(t,e),y=De(e),B=l?Wl(l,y):"single";if(window.focus(),y==1&&t.state.selectingText&&t.state.selectingText(e),l&&Hl(t,y,l,B,e))return;y==1?l?Gl(t,l,B,e):Te(e)==u.scroller&&ie(e):y==2?(l&&Ea(t.doc,l),setTimeout(function(){return u.input.focus()},20)):y==3&&(L?t.display.input.onContextMenu(e):Ao(t))}function Hl(e,t,u,l,y){var B="Click";return l=="double"?B="Double"+B:l=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,oa(e,ys(B,y),y,function($){if(typeof $=="string"&&($=aa[$]),!$)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=$(e,u)!=xe}finally{e.state.suppressEdits=!1}return q})}function Kl(e,t,u){var l=e.getOption("configureMouse"),y=l?l(e,t,u):{};if(y.unit==null){var B=s?u.shiftKey&&u.metaKey:u.altKey;y.unit=B?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(y.extend==null||e.doc.extend)&&(y.extend=e.doc.extend||u.shiftKey),y.addNew==null&&(y.addNew=r?u.metaKey:u.ctrlKey),y.moveOnDrag==null&&(y.moveOnDrag=!(r?u.altKey:u.ctrlKey)),y}function Gl(e,t,u,l){G?setTimeout(F(Oo,e),0):e.curOp.focus=N();var y=Kl(e,u,l),B=e.doc.sel,$;e.options.dragDrop&&Ze&&!e.isReadOnly()&&u=="single"&&($=B.contains(t))>-1&&(Ct(($=B.ranges[$]).from(),t)<0||t.xRel>0)&&(Ct($.to(),t)>0||t.xRel<0)?zl(e,l,t,y):Vl(e,l,t,y)}function zl(e,t,u,l){var y=e.display,B=!1,$=cr(e,function(re){n&&(y.scroller.draggable=!1),e.state.draggingText=!1,Je(y.wrapper.ownerDocument,"mouseup",$),Je(y.wrapper.ownerDocument,"mousemove",q),Je(y.scroller,"dragstart",te),Je(y.scroller,"drop",$),B||(ie(re),l.addNew||Ea(e.doc,u,null,null,l.extend),n&&!h||G&&W==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),q=function(re){B=B||Math.abs(t.clientX-re.clientX)+Math.abs(t.clientY-re.clientY)>=10},te=function(){return B=!0};n&&(y.scroller.draggable=!0),e.state.draggingText=$,$.copy=!l.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),Ce(y.wrapper.ownerDocument,"mouseup",$),Ce(y.wrapper.ownerDocument,"mousemove",q),Ce(y.scroller,"dragstart",te),Ce(y.scroller,"drop",$),Ao(e),setTimeout(function(){return y.input.focus()},20)}function As(e,t,u){if(u=="char")return new Rn(t,t);if(u=="word")return e.findWordAt(t);if(u=="line")return new Rn(ut(t.line,0),I(e.doc,ut(t.line+1,0)));var l=u(e,t);return new Rn(l.from,l.to)}function Vl(e,t,u,l){var y=e.display,B=e.doc;ie(t);var $,q,te=B.sel,re=te.ranges;if(l.addNew&&!l.extend?(q=B.sel.contains(u),q>-1?$=re[q]:$=new Rn(u,u)):($=B.sel.primary(),q=B.sel.primIndex),l.unit=="rectangle")l.addNew||($=new Rn(u,u)),u=mi(e,t,!0,!0),q=-1;else{var be=As(e,u,l.unit);l.extend?$=qa($,be.anchor,be.head,l.extend):$=be}l.addNew?q==-1?(q=re.length,xr(B,Jr(e,re.concat([$]),q),{scroll:!1,origin:"*mouse"})):re.length>1&&re[q].empty()&&l.unit=="char"&&!l.extend?(xr(B,Jr(e,re.slice(0,q).concat(re.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),te=B.sel):eo(B,q,$,ve):(q=0,xr(B,new Hr([$],0),ve),te=B.sel);var we=u;function Be(Dt){if(Ct(we,Dt)==0)return;if(we=Dt,l.unit=="rectangle"){for(var jt=[],Qt=e.options.tabSize,Jt=z(At(B,u.line).text,u.ch,Qt),dn=z(At(B,Dt.line).text,Dt.ch,Qt),Un=Math.min(Jt,dn),hr=Math.max(Jt,dn),Vn=Math.min(u.line,Dt.line),Fr=Math.min(e.lastLine(),Math.max(u.line,Dt.line));Vn<=Fr;Vn++){var Dr=At(B,Vn).text,rr=Re(Dr,Un,Qt);Un==hr?jt.push(new Rn(ut(Vn,rr),ut(Vn,rr))):Dr.length>rr&&jt.push(new Rn(ut(Vn,rr),ut(Vn,Re(Dr,hr,Qt))))}jt.length||jt.push(new Rn(u,u)),xr(B,Jr(e,te.ranges.slice(0,q).concat(jt),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Dt)}else{var Mr=$,yr=As(e,Dt,l.unit),lr=Mr.anchor,ir;Ct(yr.anchor,lr)>0?(ir=yr.head,lr=kr(Mr.from(),yr.anchor)):(ir=yr.anchor,lr=ur(Mr.to(),yr.head));var $n=te.ranges.slice(0);$n[q]=Xl(e,new Rn(I(B,lr),ir)),xr(B,Jr(e,$n,q),ve)}}var Ne=y.wrapper.getBoundingClientRect(),nt=0;function dt(Dt){var jt=++nt,Qt=mi(e,Dt,!0,l.unit=="rectangle");if(!Qt)return;if(Ct(Qt,we)!=0){e.curOp.focus=N(),Be(Qt);var Jt=ma(y,B);(Qt.line>=Jt.to||Qt.line<Jt.from)&&setTimeout(cr(e,function(){nt==jt&&dt(Dt)}),150)}else{var dn=Dt.clientY<Ne.top?-20:Dt.clientY>Ne.bottom?20:0;dn&&setTimeout(cr(e,function(){if(nt!=jt)return;y.scroller.scrollTop+=dn,dt(Dt)}),50)}}function wt(Dt){e.state.selectingText=!1,nt=Infinity,Dt&&(ie(Dt),y.input.focus()),Je(y.wrapper.ownerDocument,"mousemove",It),Je(y.wrapper.ownerDocument,"mouseup",Nt),B.history.lastSelOrigin=null}var It=cr(e,function(Dt){Dt.buttons===0||!De(Dt)?wt(Dt):dt(Dt)}),Nt=cr(e,wt);e.state.selectingText=Nt,Ce(y.wrapper.ownerDocument,"mousemove",It),Ce(y.wrapper.ownerDocument,"mouseup",Nt)}function Xl(e,t){var u=t.anchor,l=t.head,y=At(e.doc,u.line);if(Ct(u,l)==0&&u.sticky==l.sticky)return t;var B=Et(y);if(!B)return t;var $=gt(B,u.ch,u.sticky),q=B[$];if(q.from!=u.ch&&q.to!=u.ch)return t;var te=$+(q.from==u.ch==(q.level!=1)?0:1);if(te==0||te==B.length)return t;var re;if(l.line!=u.line)re=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var be=gt(B,l.ch,l.sticky),we=be-$||(l.ch-u.ch)*(q.level==1?-1:1);be==te-1||be==te?re=we<0:re=we>0}var Be=B[te+(re?-1:0)],Ne=re==(Be.level==1),nt=Ne?Be.from:Be.to,dt=Ne?"after":"before";return u.ch==nt&&u.sticky==dt?t:new Rn(new ut(u.line,nt,dt),l)}function Rs(e,t,u,l){var y,B;if(t.touches)y=t.touches[0].clientX,B=t.touches[0].clientY;else try{y=t.clientX,B=t.clientY}catch(Be){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ie(t);var $=e.display,q=$.lineDiv.getBoundingClientRect();if(B>q.bottom||!ce(e,u))return de(t);B-=q.top-$.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var re=$.gutters.childNodes[te];if(re&&re.getBoundingClientRect().right>=y){var be=hn(e.doc,B),we=e.display.gutterSpecs[te];return ke(e,u,e,be,we.className,t),de(t)}}}function oo(e,t){return Rs(e,t,"gutterClick",!0)}function Ls(e,t){if(bn(e.display,t)||Yl(e,t))return;if(Ke(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return ce(e,"gutterContextMenu")?Rs(e,t,"gutterContextMenu",!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hi(e)}var Ui={toString:function(){return"CodeMirror.Init"}},Ds={},Aa={};function $l(e){var t=e.optionHandlers;function u(l,y,B,$){e.defaults[l]=y,B&&(t[l]=$?function(q,te,re){re!=Ui&&B(q,te,re)}:B)}e.defineOption=u,e.Init=Ui,u("value","",function(l,y){return l.setValue(y)},!0),u("mode",null,function(l,y){l.doc.modeOption=y,Ja(l)},!0),u("indentUnit",2,Ja,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){Ji(l),Hi(l),Lr(l)},!0),u("lineSeparator",null,function(l,y){if(l.doc.lineSep=y,!y)return;var B=[],$=l.doc.first;l.doc.iter(function(te){for(var re=0;;){var be=te.text.indexOf(y,re);if(be==-1)break;re=be+y.length,B.push(ut($,be))}$++});for(var q=B.length-1;q>=0;q--)Mi(l.doc,y,B[q],ut(B[q].line,B[q].ch+y.length))}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,y,B){l.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),B!=Ui&&l.refresh()}),u("specialCharPlaceholder",Cn,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(l,y){return l.getInputField().spellcheck=y},!0),u("autocorrect",!1,function(l,y){return l.getInputField().autocorrect=y},!0),u("autocapitalize",!1,function(l,y){return l.getInputField().autocapitalize=y},!0),u("rtlMoveVisually",!S),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){Is(l),$i(l)},!0),u("keyMap","default",function(l,y,B){var $=Ca(y),q=B!=Ui&&Ca(B);q&&q.detach&&q.detach(l,$),$.attach&&$.attach(l,q||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Zl,!0),u("gutters",[],function(l,y){l.display.gutterSpecs=Ya(y,l.options.lineNumbers),$i(l)},!0),u("fixedGutter",!0,function(l,y){l.display.gutters.style.left=y?Fa(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return Ri(l)},!0),u("scrollbarStyle","native",function(l){Po(l),Ri(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,y){l.display.gutterSpecs=Ya(l.options.gutters,y),$i(l)},!0),u("firstLineNumber",1,$i,!0),u("lineNumberFormatter",function(l){return l},$i,!0),u("showCursorWhenSelecting",!1,Ki,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,y){y=="nocursor"&&(Oi(l),l.display.input.blur()),l.display.input.readOnlyChanged(y)}),u("screenReaderLabel",null,function(l,y){y=y===""?null:y,l.display.input.screenReaderLabelChanged(y)}),u("disableInput",!1,function(l,y){y||l.display.input.reset()},!0),u("dragDrop",!0,Jl),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Ki,!0),u("singleCursorHeightPerLine",!0,Ki,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,Ji,!0),u("addModeClass",!1,Ji,!0),u("pollInterval",100),u("undoDepth",200,function(l,y){return l.doc.history.undoDepth=y}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,Ji,!0),u("moveInputWithCursor",!0,function(l,y){y||l.display.input.resetPosition()}),u("tabindex",null,function(l,y){return l.display.input.getField().tabIndex=y||""}),u("autofocus",null),u("direction","ltr",function(l,y){return l.doc.setDirection(y)},!0),u("phrases",null)}function Jl(e,t,u){var l=u&&u!=Ui;if(!t!=!l){var y=e.display.dragFunctions,B=t?Ce:Je;B(e.display.scroller,"dragstart",y.start),B(e.display.scroller,"dragenter",y.enter),B(e.display.scroller,"dragover",y.over),B(e.display.scroller,"dragleave",y.leave),B(e.display.scroller,"drop",y.drop)}}function Zl(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),Xr(e)),ja(e),Lr(e),Hi(e),setTimeout(function(){return Ri(e)},100)}function Kn(e,t){var u=this;if(!(this instanceof Kn))return new Kn(e,t);this.options=t=t?T(t):{},T(Ds,t,!1);var l=t.value;typeof l=="string"?l=new Ir(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var y=new Kn.inputStyles[t.inputStyle](this),B=this.display=new cl(e,l,y,t);B.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Po(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 Q,keySeq:null,specialChars:null},t.autofocus&&!a&&B.input.focus(),G&&W<11&&setTimeout(function(){return u.display.input.reset(!0)},20),Ql(this),Rl(),bi(this),this.curOp.forceUpdate=!0,Go(this,l),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&Wa(u)},20):Oi(this);for(var $ in Aa)Aa.hasOwnProperty($)&&Aa[$](this,t[$],Ui);Uo(this),t.finishInit&&t.finishInit(this);for(var q=0;q<so.length;++q)so[q](this);_i(this),n&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}Kn.defaults=Ds,Kn.optionHandlers=Aa;function Ql(e){var t=e.display;Ce(t.scroller,"mousedown",cr(e,Os)),G&&W<11?Ce(t.scroller,"dblclick",cr(e,function(te){if(Ke(e,te))return;var re=mi(e,te);if(!re||oo(e,te)||bn(e.display,te))return;ie(te);var be=e.findWordAt(re);Ea(e.doc,be.anchor,be.head)})):Ce(t.scroller,"dblclick",function(te){return Ke(e,te)||ie(te)}),Ce(t.scroller,"contextmenu",function(te){return Ls(e,te)}),Ce(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||Ls(e,te)});var u,l={end:0};function y(){t.activeTouch&&(u=setTimeout(function(){return t.activeTouch=null},1e3),l=t.activeTouch,l.end=+new Date)}function B(te){if(te.touches.length!=1)return!1;var re=te.touches[0];return re.radiusX<=1&&re.radiusY<=1}function $(te,re){if(re.left==null)return!0;var be=re.left-te.left,we=re.top-te.top;return be*be+we*we>20*20}Ce(t.scroller,"touchstart",function(te){if(!Ke(e,te)&&!B(te)&&!oo(e,te)){t.input.ensurePolled(),clearTimeout(u);var re=+new Date;t.activeTouch={start:re,moved:!1,prev:re-l.end<=300?l:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Ce(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ce(t.scroller,"touchend",function(te){var re=t.activeTouch;if(re&&!bn(t,te)&&re.left!=null&&!re.moved&&new Date-re.start<300){var be=e.coordsChar(t.activeTouch,"page"),we;!re.prev||$(re,re.prev)?we=new Rn(be,be):!re.prev.prev||$(re,re.prev.prev)?we=e.findWordAt(be):we=new Rn(ut(be.line,0),I(e.doc,ut(be.line+1,0))),e.setSelection(we.anchor,we.head),e.focus(),ie(te)}y()}),Ce(t.scroller,"touchcancel",y),Ce(t.scroller,"scroll",function(){t.scroller.clientHeight&&(zi(e,t.scroller.scrollTop),vi(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),Ce(t.scroller,"mousewheel",function(te){return Bo(e,te)}),Ce(t.scroller,"DOMMouseScroll",function(te){return Bo(e,te)}),Ce(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){Ke(e,te)||ge(te)},over:function(te){Ke(e,te)||(Al(e,te),ge(te))},start:function(te){return Ol(e,te)},drop:cr(e,Cl),leave:function(te){Ke(e,te)||ps(e)}};var q=t.input.getField();Ce(q,"keyup",function(te){return Ss.call(e,te)}),Ce(q,"keydown",cr(e,ws)),Ce(q,"keypress",cr(e,Cs)),Ce(q,"focus",function(te){return Wa(e,te)}),Ce(q,"blur",function(te){return Oi(e,te)})}var so=[];Kn.defineInitHook=function(e){return so.push(e)};function ua(e,t,u,l){var y=e.doc,B;u==null&&(u="add"),u=="smart"&&(y.mode.indent?B=lt(e,t).state:u="prev");var $=e.options.tabSize,q=At(y,t),te=z(q.text,null,$);q.stateAfter&&(q.stateAfter=null);var re=q.text.match(/^\s*/)[0],be;if(!l&&!/\S/.test(q.text))be=0,u="not";else if(u=="smart"&&(be=y.mode.indent(B,q.text.slice(re.length),q.text),be==xe||be>150)){if(!l)return;u="prev"}u=="prev"?t>y.first?be=z(At(y,t-1).text,null,$):be=0:u=="add"?be=te+e.options.indentUnit:u=="subtract"?be=te-e.options.indentUnit:typeof u=="number"&&(be=te+u),be=Math.max(0,be);var we="",Be=0;if(e.options.indentWithTabs)for(var Ne=Math.floor(be/$);Ne;--Ne)Be+=$,we+=" ";if(Be<be&&(we+=ue(be-Be)),we!=re)return Mi(y,we,ut(t,0),ut(t,re.length),"+input"),q.stateAfter=null,!0;for(var nt=0;nt<y.sel.ranges.length;nt++){var dt=y.sel.ranges[nt];if(dt.head.line==t&&dt.head.ch<re.length){var wt=ut(t,re.length);eo(y,nt,new Rn(wt,wt));break}}}var Zr=null;function Ra(e){Zr=e}function lo(e,t,u,l,y){var B=e.doc;e.display.shift=!1,l||(l=B.sel);var $=+new Date-200,q=y=="paste"||e.state.pasteIncoming>$,te=He(t),re=null;if(q&&l.ranges.length>1)if(Zr&&Zr.text.join(`
`)==t){if(l.ranges.length%Zr.text.length==0){re=[];for(var be=0;be<Zr.text.length;be++)re.push(B.splitLines(Zr.text[be]))}}else te.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(re=et(te,function(It){return[It]}));for(var we=e.curOp.updateInput,Be=l.ranges.length-1;Be>=0;Be--){var Ne=l.ranges[Be],nt=Ne.from(),dt=Ne.to();Ne.empty()&&(u&&u>0?nt=ut(nt.line,nt.ch-u):e.state.overwrite&&!q?dt=ut(dt.line,Math.min(At(B,dt.line).text.length,dt.ch+Pe(te).length)):q&&Zr&&Zr.lineWise&&Zr.text.join(`
`)==te.join(`
`)&&(nt=dt=ut(nt.line,0)));var wt={from:nt,to:dt,text:re?re[Be%re.length]:te,origin:y||(q?"paste":e.state.cutIncoming>$?"cut":"+input")};Di(e.doc,wt),yn(e,"inputRead",e,wt)}t&&!q&&Ps(e,t),Ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=we),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ms(e,t){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ur(t,function(){return lo(t,u,0,null,"paste")}),!0}function Ps(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var u=e.doc.sel,l=u.ranges.length-1;l>=0;l--){var y=u.ranges[l];if(y.head.ch>100||l&&u.ranges[l-1].head.line==y.head.line)continue;var B=e.getModeAt(y.head),$=!1;if(B.electricChars){for(var q=0;q<B.electricChars.length;q++)if(t.indexOf(B.electricChars.charAt(q))>-1){$=ua(e,y.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(At(e.doc,y.head.line).text.slice(0,y.head.ch))&&($=ua(e,y.head.line,"smart")));$&&yn(e,"electricInput",e,y.head.line)}}function ks(e){for(var t=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var y=e.doc.sel.ranges[l].head.line,B={anchor:ut(y,0),head:ut(y+1,0)};u.push(B),t.push(e.getRange(B.anchor,B.head))}return{text:t,ranges:u}}function Ns(e,t,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!t)}function Us(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),Ns(e),t}function ql(e){var t=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,y){var B=this.options,$=B[l];if(B[l]==y&&l!="mode")return;B[l]=y,t.hasOwnProperty(l)&&cr(this,t[l])(this,y,$),ke(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,y){this.state.keyMaps[y?"push":"unshift"](Ca(l))},removeKeyMap:function(l){for(var y=this.state.keyMaps,B=0;B<y.length;++B)if(y[B]==l||y[B].name==l)return y.splice(B,1),!0},addOverlay:Or(function(l,y){var B=l.token?l:e.getMode(this.options,l);if(B.startState)throw new Error("Overlays may not be stateful.");rt(this.state.overlays,{mode:B,modeSpec:l,opaque:y&&y.opaque,priority:y&&y.priority||0},function($){return $.priority}),this.state.modeGen++,Lr(this)}),removeOverlay:Or(function(l){for(var y=this.state.overlays,B=0;B<y.length;++B){var $=y[B].modeSpec;if($==l||typeof l=="string"&&$.name==l){y.splice(B,1),this.state.modeGen++,Lr(this);return}}}),indentLine:Or(function(l,y,B){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),Mn(this.doc,l)&&ua(this,l,y,B)}),indentSelection:Or(function(l){for(var y=this.doc.sel.ranges,B=-1,$=0;$<y.length;$++){var q=y[$];if(q.empty())q.head.line>B&&(ua(this,q.head.line,l,!0),B=q.head.line,$==this.doc.sel.primIndex&&Ai(this));else{var te=q.from(),re=q.to(),be=Math.max(B,te.line);B=Math.min(this.lastLine(),re.line-(re.ch?0:1))+1;for(var we=be;we<B;++we)ua(this,we,l);var Be=this.doc.sel.ranges;te.ch==0&&y.length==Be.length&&Be[$].from().ch>0&&eo(this.doc,$,new Rn(te,Be[$].to()),me)}}}),getTokenAt:function(l,y){return Mt(this,l,y)},getLineTokens:function(l,y){return Mt(this,ut(l),y,!0)},getTokenTypeAt:function(l){l=I(this.doc,l);var y=Ye(this,At(this.doc,l.line)),B=0,$=(y.length-1)/2,q=l.ch,te;if(q==0)te=y[2];else for(;;){var re=B+$>>1;if((re?y[re*2-1]:0)>=q)$=re;else if(y[re*2+1]<q)B=re+1;else{te=y[re*2+2];break}}var be=te?te.indexOf("overlay "):-1;return be<0?te:be==0?null:te.slice(0,be-1)},getModeAt:function(l){var y=this.doc.mode;return y.innerMode?e.innerMode(y,this.getTokenAt(l).state).mode:y},getHelper:function(l,y){return this.getHelpers(l,y)[0]},getHelpers:function(l,y){var B=[];if(!u.hasOwnProperty(y))return B;var $=u[y],q=this.getModeAt(l);if(typeof q[y]=="string")$[q[y]]&&B.push($[q[y]]);else if(q[y])for(var te=0;te<q[y].length;te++){var re=$[q[y][te]];re&&B.push(re)}else q.helperType&&$[q.helperType]?B.push($[q.helperType]):$[q.name]&&B.push($[q.name]);for(var be=0;be<$._global.length;be++){var we=$._global[be];we.pred(q,this)&&ne(B,we.val)==-1&&B.push(we.val)}return B},getStateAfter:function(l,y){var B=this.doc;return l=J(B,l==null?B.first+B.size-1:l),lt(this,l+1,y).state},cursorCoords:function(l,y){var B,$=this.doc.sel.primary();return l==null?B=$.head:typeof l=="object"?B=I(this.doc,l):B=l?$.from():$.to(),$r(this,B,y||"page")},charCoords:function(l,y){return Ma(this,I(this.doc,l),y||"page")},coordsChar:function(l,y){return l=bo(this,l,y||"page"),ka(this,l.left,l.top)},lineAtHeight:function(l,y){return l=bo(this,{top:l,left:0},y||"page").top,hn(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,y,B){var $=!1,q;if(typeof l=="number"){var te=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>te&&(l=te,$=!0),q=At(this.doc,l)}else q=l;return da(this,q,{top:0,left:0},y||"page",B||$).top+($?this.doc.height-zn(q):0)},defaultTextHeight:function(){return Si(this.display)},defaultCharWidth:function(){return Ci(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,y,B,$,q){var te=this.display;l=$r(this,I(this.doc,l));var re=l.bottom,be=l.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),te.sizer.appendChild(y),$=="over")re=l.top;else if($=="above"||$=="near"){var we=Math.max(te.wrapper.clientHeight,this.doc.height),Be=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);($=="above"||l.bottom+y.offsetHeight>we)&&l.top>y.offsetHeight?re=l.top-y.offsetHeight:l.bottom+y.offsetHeight<=we&&(re=l.bottom),be+y.offsetWidth>Be&&(be=Be-y.offsetWidth)}y.style.top=re+"px",y.style.left=y.style.right="",q=="right"?(be=te.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(q=="left"?be=0:q=="middle"&&(be=(te.sizer.clientWidth-y.offsetWidth)/2),y.style.left=be+"px"),B&&Js(this,{left:be,top:re,right:be+y.offsetWidth,bottom:re+y.offsetHeight})},triggerOnKeyDown:Or(ws),triggerOnKeyPress:Or(Cs),triggerOnKeyUp:Ss,triggerOnMouseDown:Or(Os),execCommand:function(l){if(aa.hasOwnProperty(l))return aa[l].call(null,this)},triggerElectric:Or(function(l){Ps(this,l)}),findPosH:function(l,y,B,$){var q=1;y<0&&(q=-1,y=-y);for(var te=I(this.doc,l),re=0;re<y&&!(te=uo(this.doc,te,q,B,$),te.hitSide);++re);return te},moveH:Or(function(l,y){var B=this;this.extendSelectionsBy(function($){return B.display.shift||B.doc.extend||$.empty()?uo(B.doc,$.head,l,y,B.options.rtlMoveVisually):l<0?$.from():$.to()},Oe)}),deleteH:Or(function(l,y){var B=this.doc.sel,$=this.doc;B.somethingSelected()?$.replaceSelection("",null,"+delete"):Ni(this,function(q){var te=uo($,q.head,l,y,!1);return l<0?{from:te,to:q.head}:{from:q.head,to:te}})}),findPosV:function(l,y,B,$){var q=1,te=$;y<0&&(q=-1,y=-y);for(var re=I(this.doc,l),be=0;be<y;++be){var we=$r(this,re,"div");if(te==null?te=we.left:we.left=te,re=Fs(this,we,q,B),re.hitSide)break}return re},moveV:Or(function(l,y){var B=this,$=this.doc,q=[],te=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(be){if(te)return l<0?be.from():be.to();var we=$r(B,be.head,"div");be.goalColumn!=null&&(we.left=be.goalColumn),q.push(we.left);var Be=Fs(B,we,l,y);return y=="page"&&be==$.sel.primary()&&Ka(B,Ma(B,Be,"div").top-we.top),Be},Oe),q.length)for(var re=0;re<$.sel.ranges.length;re++)$.sel.ranges[re].goalColumn=q[re]}),findWordAt:function(l){var y=this.doc,B=At(y,l.line).text,$=l.ch,q=l.ch;if(B){var te=this.getHelper(l,"wordChars");(l.sticky=="before"||q==B.length)&&$?--$:++q;for(var re=B.charAt($),be=at(re,te)?function(we){return at(we,te)}:/\s/.test(re)?function(we){return/\s/.test(we)}:function(we){return!/\s/.test(we)&&!at(we)};$>0&&be(B.charAt($-1));)--$;for(;q<B.length&&be(B.charAt(q));)++q}return new Rn(ut(l.line,$),ut(l.line,q))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Or(function(l,y){Gi(this,l,y)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Jn(this)-this.display.barHeight,width:l.scrollWidth-Jn(this)-this.display.barWidth,clientHeight:Cr(this),clientWidth:vr(this)}},scrollIntoView:Or(function(l,y){l==null?(l={from:this.doc.sel.primary().head,to:null},y==null&&(y=this.options.cursorScrollMargin)):typeof l=="number"?l={from:ut(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=y||0,l.from.line!=null?Zs(this,l):Lo(this,l.from,l.to,l.margin)}),setSize:Or(function(l,y){var B=this,$=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};l!=null&&(this.display.wrapper.style.width=$(l)),y!=null&&(this.display.wrapper.style.height=$(y)),this.options.lineWrapping&&go(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(te){if(te.widgets){for(var re=0;re<te.widgets.length;re++)if(te.widgets[re].noHScroll){oi(B,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,ke(this,"refresh",this)}),operation:function(l){return Ur(this,l)},startOperation:function(){return bi(this)},endOperation:function(){return _i(this)},refresh:Or(function(){var l=this.display.cachedTextHeight;Lr(this),this.curOp.forceUpdate=!0,Hi(this),Gi(this,this.doc.scrollLeft,this.doc.scrollTop),Va(this.display),(l==null||Math.abs(l-Si(this.display))>.5||this.options.lineWrapping)&&ja(this),ke(this,"refresh",this)}),swapDoc:Or(function(l){var y=this.doc;return y.cm=null,this.state.selectingText&&this.state.selectingText(),Go(this,l),Hi(this),this.display.input.reset(),Gi(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,yn(this,"swapDoc",this,y),y}),phrase:function(l){var y=this.options.phrases;return y&&Object.prototype.hasOwnProperty.call(y,l)?y[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},pe(e),e.registerHelper=function(l,y,B){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][y]=B},e.registerGlobalHelper=function(l,y,B,$){e.registerHelper(l,y,$),u[l]._global.push({pred:B,val:$})}}function uo(e,t,u,l,y){var B=t,$=u,q=At(e,t.line),te=y&&e.direction=="rtl"?-u:u;function re(){var Nt=t.line+te;return Nt<e.first||Nt>=e.first+e.size?!1:(t=new ut(Nt,t.ch,t.sticky),q=At(e,Nt))}function be(Nt){var Dt;if(l=="codepoint"){var jt=q.text.charCodeAt(t.ch+(l>0?0:-1));isNaN(jt)?Dt=null:Dt=new ut(t.line,Math.max(0,Math.min(q.text.length,t.ch+u*(jt>=55296&&jt<56320?2:1))),-u)}else y?Dt=Pl(e.cm,q,t,u):Dt=no(q,t,u);if(Dt==null)if(!Nt&&re())t=ro(y,e.cm,q,t.line,te);else return!1;else t=Dt;return!0}if(l=="char"||l=="codepoint")be();else if(l=="column")be(!0);else if(l=="word"||l=="group")for(var we=null,Be=l=="group",Ne=e.cm&&e.cm.getHelper(t,"wordChars"),nt=!0;!(u<0&&!be(!nt));nt=!1){var dt=q.text.charAt(t.ch)||`
`,wt=at(dt,Ne)?"w":Be&&dt==`
`?"n":!Be||/\s/.test(dt)?null:"p";if(Be&&!nt&&!wt&&(wt="s"),we&&we!=wt){u<0&&(u=1,be(),t.sticky="after");break}if(wt&&(we=wt),u>0&&!be(!nt))break}var It=Ta(e,t,B,$,!0);return Hn(B,It)&&(It.hitSide=!0),It}function Fs(e,t,u,l){var y=e.doc,B=t.left,$;if(l=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(q-.5*Si(e.display),3);$=(u>0?t.bottom:t.top)+u*te}else l=="line"&&($=u>0?t.bottom+3:t.top-3);for(var re;!(re=ka(e,B,$),!re.outside);){if(u<0?$<=0:$>=y.height){re.hitSide=!0;break}$+=u*5}return re}var Dn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Dn.prototype.init=function(e){var t=this,u=this,l=u.cm,y=u.div=e.lineDiv;Ns(y,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function B(q){for(var te=q.target;te;te=te.parentNode){if(te==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Ce(y,"paste",function(q){if(!B(q)||Ke(l,q)||Ms(q,l))return;W<=11&&setTimeout(cr(l,function(){return t.updateFromDOM()}),20)}),Ce(y,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Ce(y,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Ce(y,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ce(y,"touchstart",function(){return u.forceCompositionEnd()}),Ce(y,"input",function(){t.composing||t.readFromDOMSoon()});function $(q){if(!B(q)||Ke(l,q))return;if(l.somethingSelected())Ra({lineWise:!1,text:l.getSelections()}),q.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var te=ks(l);Ra({lineWise:!0,text:te.text}),q.type=="cut"&&l.operation(function(){l.setSelections(te.ranges,0,me),l.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var re=Zr.text.join(`
`);if(q.clipboardData.setData("Text",re),q.clipboardData.getData("Text")==re){q.preventDefault();return}}var be=Us(),we=be.firstChild;l.display.lineSpace.insertBefore(be,l.display.lineSpace.firstChild),we.value=Zr.text.join(`
`);var Be=document.activeElement;H(we),setTimeout(function(){l.display.lineSpace.removeChild(be),Be.focus(),Be==y&&u.showPrimarySelection()},50)}Ce(y,"copy",$),Ce(y,"cut",$)},Dn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Dn.prototype.prepareSelection=function(){var e=So(this.cm,!1);return e.focus=document.activeElement==this.div,e},Dn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Dn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Dn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,u=t.doc.sel.primary(),l=u.from(),y=u.to();if(t.display.viewTo==t.display.viewFrom||l.line>=t.display.viewTo||y.line<t.display.viewFrom){e.removeAllRanges();return}var B=La(t,e.anchorNode,e.anchorOffset),$=La(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&$&&!$.bad&&Ct(kr(B,$),l)==0&&Ct(ur(B,$),y)==0)return;var q=t.display.view,te=l.line>=t.display.viewFrom&&js(t,l)||{node:q[0].measure.map[2],offset:0},re=y.line<t.display.viewTo&&js(t,y);if(!re){var be=q[q.length-1].measure,we=be.maps?be.maps[be.maps.length-1]:be.map;re={node:we[we.length-1],offset:we[we.length-2]-we[we.length-3]}}if(!te||!re){e.removeAllRanges();return}var Be=e.rangeCount&&e.getRangeAt(0),Ne;try{Ne=E(te.node,te.offset,re.offset,re.node)}catch(nt){}Ne&&(!P&&t.state.focused?(e.collapse(te.node,te.offset),Ne.collapsed||(e.removeAllRanges(),e.addRange(Ne))):(e.removeAllRanges(),e.addRange(Ne)),Be&&e.anchorNode==null?e.addRange(Be):P&&this.startGracePeriod()),this.rememberSelection()},Dn.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)},Dn.prototype.showMultipleSelections=function(e){g(this.cm.display.cursorDiv,e.cursors),g(this.cm.display.selectionDiv,e.selection)},Dn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Dn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return v(this.div,t)},Dn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Dn.prototype.blur=function(){this.div.blur()},Dn.prototype.getField=function(){return this.div},Dn.prototype.supportsTouch=function(){return!0},Dn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ur(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)},Dn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Dn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(i&&m&&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 u=La(t,e.anchorNode,e.anchorOffset),l=La(t,e.focusNode,e.focusOffset);u&&l&&Ur(t,function(){xr(t.doc,li(u,l),me),(u.bad||l.bad)&&(t.curOp.selectionChanged=!0)})},Dn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,u=e.doc.sel.primary(),l=u.from(),y=u.to();if(l.ch==0&&l.line>e.firstLine()&&(l=ut(l.line-1,At(e.doc,l.line-1).length)),y.ch==At(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=ut(y.line+1,0)),l.line<t.viewFrom||y.line>t.viewTo-1)return!1;var B,$,q;l.line==t.viewFrom||(B=gi(e,l.line))==0?($=Wt(t.view[0].line),q=t.view[0].node):($=Wt(t.view[B].line),q=t.view[B-1].node.nextSibling);var te=gi(e,y.line),re,be;if(te==t.view.length-1?(re=t.viewTo-1,be=t.lineDiv.lastChild):(re=Wt(t.view[te+1].line)-1,be=t.view[te+1].node.previousSibling),!q)return!1;for(var we=e.doc.splitLines(tu(e,q,be,$,re)),Be=Tn(e.doc,ut($,0),ut(re,At(e.doc,re).text.length));we.length>1&&Be.length>1;)if(Pe(we)==Pe(Be))we.pop(),Be.pop(),re--;else if(we[0]==Be[0])we.shift(),Be.shift(),$++;else break;for(var Ne=0,nt=0,dt=we[0],wt=Be[0],It=Math.min(dt.length,wt.length);Ne<It&&dt.charCodeAt(Ne)==wt.charCodeAt(Ne);)++Ne;for(var Nt=Pe(we),Dt=Pe(Be),jt=Math.min(Nt.length-(we.length==1?Ne:0),Dt.length-(Be.length==1?Ne:0));nt<jt&&Nt.charCodeAt(Nt.length-nt-1)==Dt.charCodeAt(Dt.length-nt-1);)++nt;if(we.length==1&&Be.length==1&&$==l.line)for(;Ne&&Ne>l.ch&&Nt.charCodeAt(Nt.length-nt-1)==Dt.charCodeAt(Dt.length-nt-1);)Ne--,nt++;we[we.length-1]=Nt.slice(0,Nt.length-nt).replace(/^\u200b+/,""),we[0]=we[0].slice(Ne).replace(/\u200b+$/,"");var Qt=ut($,Ne),Jt=ut(re,Be.length?Pe(Be).length-nt:0);if(we.length>1||we[0]||Ct(Qt,Jt))return Mi(e.doc,we,Qt,Jt,"+input"),!0},Dn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Dn.prototype.reset=function(){this.forceCompositionEnd()},Dn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Dn.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)},Dn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ur(this.cm,function(){return Lr(e.cm)})},Dn.prototype.setUneditable=function(e){e.contentEditable="false"},Dn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||cr(this.cm,lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Dn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Dn.prototype.onContextMenu=function(){},Dn.prototype.resetPosition=function(){},Dn.prototype.needsContentAttribute=!0;function js(e,t){var u=ca(e,t.line);if(!u||u.hidden)return null;var l=At(e.doc,t.line),y=zr(u,l,t.line),B=Et(l,e.doc.direction),$="left";if(B){var q=gt(B,t.ch);$=q%2?"right":"left"}var te=po(y.map,t.ch,$);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fi(e,t){return t&&(e.bad=!0),e}function tu(e,t,u,l,y){var B="",$=!1,q=e.doc.lineSeparator(),te=!1;function re(Ne){return function(nt){return nt.id==Ne}}function be(){$&&(B+=q,te&&(B+=q),$=te=!1)}function we(Ne){Ne&&(be(),B+=Ne)}function Be(Ne){if(Ne.nodeType==1){var nt=Ne.getAttribute("cm-text");if(nt){we(nt);return}var dt=Ne.getAttribute("cm-marker"),wt;if(dt){var It=e.findMarks(ut(l,0),ut(y+1,0),re(+dt));It.length&&(wt=It[0].find(0))&&we(Tn(e.doc,wt.from,wt.to).join(q));return}if(Ne.getAttribute("contenteditable")=="false")return;var Nt=/^(pre|div|p|li|table|br)$/i.test(Ne.nodeName);if(!/^br$/i.test(Ne.nodeName)&&Ne.textContent.length==0)return;Nt&&be();for(var Dt=0;Dt<Ne.childNodes.length;Dt++)Be(Ne.childNodes[Dt]);/^(pre|p)$/i.test(Ne.nodeName)&&(te=!0),Nt&&($=!0)}else Ne.nodeType==3&&we(Ne.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Be(t),t==u);)t=t.nextSibling,te=!1;return B}function La(e,t,u){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return Fi(e.clipPos(ut(e.display.viewTo-1)),!0);t=null,u=0}else for(l=t;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var y=0;y<e.display.view.length;y++){var B=e.display.view[y];if(B.node==l)return nu(B,t,u)}}function nu(e,t,u){var l=e.text.firstChild,y=!1;if(!t||!v(l,t))return Fi(ut(Wt(e.line),0),!0);if(t==l&&(y=!0,t=l.childNodes[u],u=0,!t)){var B=e.rest?Pe(e.rest):e.line;return Fi(ut(Wt(B),B.text.length),y)}var $=t.nodeType==3?t:null,q=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,u&&(u=$.nodeValue.length));q.parentNode!=l;)q=q.parentNode;var te=e.measure,re=te.maps;function be(wt,It,Nt){for(var Dt=-1;Dt<(re?re.length:0);Dt++)for(var jt=Dt<0?te.map:re[Dt],Qt=0;Qt<jt.length;Qt+=3){var Jt=jt[Qt+2];if(Jt==wt||Jt==It){var dn=Wt(Dt<0?e.line:e.rest[Dt]),Un=jt[Qt]+Nt;return(Nt<0||Jt!=wt)&&(Un=jt[Qt+(Nt?1:0)]),ut(dn,Un)}}}var we=be($,q,u);if(we)return Fi(we,y);for(var Be=q.nextSibling,Ne=$?$.nodeValue.length-u:0;Be;Be=Be.nextSibling){if(we=be(Be,Be.firstChild,0),we)return Fi(ut(we.line,we.ch-Ne),y);Ne+=Be.textContent.length}for(var nt=q.previousSibling,dt=u;nt;nt=nt.previousSibling){if(we=be(nt,nt.firstChild,-1),we)return Fi(ut(we.line,we.ch+dt),y);dt+=nt.textContent.length}}var Zn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null};Zn.prototype.init=function(e){var t=this,u=this,l=this.cm;this.createField(e);var y=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(y.style.width="0px"),Ce(y,"input",function(){G&&W>=9&&t.hasSelection&&(t.hasSelection=null),u.poll()}),Ce(y,"paste",function($){if(Ke(l,$)||Ms($,l))return;l.state.pasteIncoming=+new Date,u.fastPoll()});function B($){if(Ke(l,$))return;if(l.somethingSelected())Ra({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var q=ks(l);Ra({lineWise:!0,text:q.text}),$.type=="cut"?l.setSelections(q.ranges,null,me):(u.prevInput="",y.value=q.text.join(`
`),H(y))}else return;$.type=="cut"&&(l.state.cutIncoming=+new Date)}Ce(y,"cut",B),Ce(y,"copy",B),Ce(e.scroller,"paste",function($){if(bn(e,$)||Ke(l,$))return;if(!y.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var q=new Event("paste");q.clipboardData=$.clipboardData,y.dispatchEvent(q)}),Ce(e.lineSpace,"selectstart",function($){bn(e,$)||ie($)}),Ce(y,"compositionstart",function(){var $=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:$,range:l.markText($,l.getCursor("to"),{className:"CodeMirror-composing"})}}),Ce(y,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Zn.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},Zn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Zn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,u=e.doc,l=So(e);if(e.options.moveInputWithCursor){var y=$r(e,u.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,y.top+$.top-B.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,y.left+$.left-B.left))}return l},Zn.prototype.showSelection=function(e){var t=this.cm,u=t.display;g(u.cursorDiv,e.cursors),g(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Zn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var u=t.getSelection();this.textarea.value=u,t.state.focused&&H(this.textarea),G&&W>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",G&&W>=9&&(this.hasSelection=null))},Zn.prototype.getField=function(){return this.textarea},Zn.prototype.supportsTouch=function(){return!1},Zn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Zn.prototype.blur=function(){this.textarea.blur()},Zn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Zn.prototype.receivedFocus=function(){this.slowPoll()},Zn.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()})},Zn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function u(){var l=t.poll();!l&&!e?(e=!0,t.polling.set(60,u)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,u)},Zn.prototype.poll=function(){var e=this,t=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ge(u)&&!l&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var y=u.value;if(y==l&&!t.somethingSelected())return!1;if(G&&W>=9&&this.hasSelection===y||r&&/[\uf700-\uf7ff]/.test(y))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=y.charCodeAt(0);if(B==8203&&!l&&(l="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,q=Math.min(l.length,y.length);$<q&&l.charCodeAt($)==y.charCodeAt($);)++$;return Ur(t,function(){lo(t,y.slice($),l.length-$,null,e.composing?"*compose":null),y.length>1e3||y.indexOf(`
`)>-1?u.value=e.prevInput="":e.prevInput=y,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Zn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Zn.prototype.onKeyPress=function(){G&&W>=9&&(this.hasSelection=null),this.fastPoll()},Zn.prototype.onContextMenu=function(e){var t=this,u=t.cm,l=u.display,y=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=mi(u,e),$=l.scroller.scrollTop;if(!B||p)return;var q=u.options.resetSelectionOnContextMenu;q&&u.doc.sel.contains(B)==-1&&cr(u,xr)(u.doc,li(B),me);var te=y.style.cssText,re=t.wrapper.style.cssText,be=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",y.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: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var we;n&&(we=window.scrollY),l.input.focus(),n&&window.scrollTo(null,we),l.input.reset(),u.somethingSelected()||(y.value=t.prevInput=" "),t.contextMenuPending=Ne,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function Be(){if(y.selectionStart!=null){var dt=u.somethingSelected(),wt="\u200B"+(dt?y.value:"");y.value="\u21DA",y.value=wt,t.prevInput=dt?"":"\u200B",y.selectionStart=1,y.selectionEnd=wt.length,l.selForContextMenu=u.doc.sel}}function Ne(){if(t.contextMenuPending!=Ne)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=re,y.style.cssText=te,G&&W<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=$),y.selectionStart!=null){(!G||G&&W<9)&&Be();var dt=0,wt=function(){l.selForContextMenu==u.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&t.prevInput=="\u200B"?cr(u,rs)(u):dt++<10?l.detectingSelectAll=setTimeout(wt,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(wt,200)}}if(G&&W>=9&&Be(),L){ge(e);var nt=function(){Je(window,"mouseup",nt),setTimeout(Ne,20)};Ce(window,"mouseup",nt)}else setTimeout(Ne,50)},Zn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Zn.prototype.setUneditable=function(){},Zn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?T(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 u=N();t.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=q.getValue()}var y;if(e.form&&(Ce(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var B=e.form;y=B.submit;try{var $=B.submit=function(){l(),B.submit=y,B.submit(),B.submit=$}}catch(te){}}t.finishInit=function(te){te.save=l,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,l(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(Je(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var q=Kn(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return q}function iu(e){e.off=Je,e.on=Ce,e.wheelEventPixels=dl,e.Doc=Ir,e.splitLines=He,e.countColumn=z,e.findColumn=Re,e.isWordChar=Qe,e.Pass=xe,e.signal=ke,e.Line=br,e.changeEnd=ui,e.scrollbarModel=Mo,e.Pos=ut,e.cmpPos=Ct,e.modes=Ve,e.mimeModes=je,e.resolveMode=Ie,e.getMode=$e,e.modeExtensions=xt,e.extendMode=Ft,e.copyState=ct,e.startState=$t,e.innerMode=Ut,e.commands=aa,e.keyMap=ii,e.keyName=bs,e.isModifierKey=vs,e.lookupKey=ki,e.normalizeKeyMap=Ml,e.StringStream=Vt,e.SharedTextMarker=na,e.TextMarker=di,e.LineWidget=ta,e.e_preventDefault=ie,e.e_stopPropagation=ae,e.e_stop=ge,e.addClass=U,e.contains=v,e.rmClass=_,e.keyNames=hi}$l(Kn),ql(Kn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ia in Ir.prototype)Ir.prototype.hasOwnProperty(Ia)&&ne(au,Ia)<0&&(Kn.prototype[Ia]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ir.prototype[Ia]));return pe(Ir),Kn.inputStyles={textarea:Zn,contenteditable:Dn},Kn.defineMode=function(e){!Kn.defaults.mode&&e!="null"&&(Kn.defaults.mode=e),ht.apply(this,arguments)},Kn.defineMIME=ft,Kn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Kn.defineMIME("text/plain","null"),Kn.defineExtension=function(e,t){Kn.prototype[e]=t},Kn.defineDocExtension=function(e,t){Ir.prototype[e]=t},Kn.fromTextArea=ru,iu(Kn),Kn.version="5.58.2",Kn})},WaYH:function(Fe,oe,k){"use strict";var Z=k("rePB"),X=k("Ff2n"),P=k("VTBJ"),V=k("1OyB"),j=k("vuIU"),M=k("JX7q"),G=k("Ji7U"),W=k("LK+K"),n=k("q1tI"),D=k("TSYQ"),m=k.n(D),p=k("sboe"),h=k("OZM5"),c=function(L){var O=L.prefixCls,_=L.level,b=L.isStart,g=L.isEnd;if(!_)return null;for(var f="".concat(O,"-indent-unit"),C=[],E=0;E<_;E+=1){var v;C.push(n.createElement("span",{key:E,className:m()(f,(v={},Object(Z.a)(v,"".concat(f,"-start"),b[E+1]),Object(Z.a)(v,"".concat(f,"-end"),g[E+1]),Object(Z.a)(v,"".concat(f,"-end-first-level"),!E&&g[0]),v))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},C)},o=c,d=k("815F"),i="open",a="close",r="---",s=function(x){Object(G.a)(O,x);var L=Object(W.a)(O);function O(){var _;return Object(V.a)(this,O),_=L.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(b){var g=_.props.context.onNodeClick;g(b,Object(d.b)(_.props)),_.isSelectable()?_.onSelect(b):_.onCheck(b)},_.onSelectorDoubleClick=function(b){var g=_.props.context.onNodeDoubleClick;g(b,Object(d.b)(_.props))},_.onSelect=function(b){if(_.isDisabled())return;var g=_.props.context.onNodeSelect;b.preventDefault(),g(b,Object(d.b)(_.props))},_.onCheck=function(b){if(_.isDisabled())return;var g=_.props,f=g.disableCheckbox,C=g.checked,E=_.props.context.onNodeCheck;if(!_.isCheckable()||f)return;b.preventDefault();var v=!C;E(b,Object(d.b)(_.props),v)},_.onMouseEnter=function(b){var g=_.props.context.onNodeMouseEnter;g(b,Object(d.b)(_.props))},_.onMouseLeave=function(b){var g=_.props.context.onNodeMouseLeave;g(b,Object(d.b)(_.props))},_.onContextMenu=function(b){var g=_.props.context.onNodeContextMenu;g(b,Object(d.b)(_.props))},_.onDragStart=function(b){var g=_.props.context.onNodeDragStart;b.stopPropagation(),_.setState({dragNodeHighlight:!0}),g(b,Object(M.a)(_));try{b.dataTransfer.setData("text/plain","")}catch(f){}},_.onDragEnter=function(b){var g=_.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),g(b,Object(M.a)(_))},_.onDragOver=function(b){var g=_.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),g(b,Object(M.a)(_))},_.onDragLeave=function(b){var g=_.props.context.onNodeDragLeave;b.stopPropagation(),g(b,Object(M.a)(_))},_.onDragEnd=function(b){var g=_.props.context.onNodeDragEnd;b.stopPropagation(),_.setState({dragNodeHighlight:!1}),g(b,Object(M.a)(_))},_.onDrop=function(b){var g=_.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),_.setState({dragNodeHighlight:!1}),g(b,Object(M.a)(_))},_.onExpand=function(b){var g=_.props.context.onNodeExpand;g(b,Object(d.b)(_.props))},_.setSelectHandle=function(b){_.selectHandle=b},_.getNodeState=function(){var b=_.props.expanded;return _.isLeaf()?null:b?i:a},_.hasChildren=function(){var b=_.props.eventKey,g=_.props.context.keyEntities,f=g[b]||{},C=f.children;return!!(C||[]).length},_.isLeaf=function(){var b=_.props,g=b.isLeaf,f=b.loaded,C=_.props.context.loadData,E=_.hasChildren();return g===!1?!1:g||!C&&!E||C&&f&&!E},_.isDisabled=function(){var b=_.props.disabled,g=_.props.context.disabled;return!!(g||b)},_.isCheckable=function(){var b=_.props.checkable,g=_.props.context.checkable;return!g||b===!1?!1:g},_.syncLoadData=function(b){var g=b.expanded,f=b.loading,C=b.loaded,E=_.props.context,v=E.loadData,N=E.onNodeLoad;if(f)return;v&&g&&!_.isLeaf()&&(!_.hasChildren()&&!C&&N(Object(d.b)(_.props)))},_.renderSwitcher=function(){var b=_.props,g=b.expanded,f=b.switcherIcon,C=_.props.context,E=C.prefixCls,v=C.switcherIcon,N=f||v;if(_.isLeaf())return n.createElement("span",{className:m()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof N=="function"?N(Object(P.a)(Object(P.a)({},_.props),{},{isLeaf:!0})):N);var U=m()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(g?i:a));return n.createElement("span",{onClick:_.onExpand,className:U},typeof N=="function"?N(Object(P.a)(Object(P.a)({},_.props),{},{isLeaf:!1})):N)},_.renderCheckbox=function(){var b=_.props,g=b.checked,f=b.halfChecked,C=b.disableCheckbox,E=_.props.context.prefixCls,v=_.isDisabled(),N=_.isCheckable();if(!N)return null;var U=typeof N!="boolean"?N:null;return n.createElement("span",{className:m()("".concat(E,"-checkbox"),g&&"".concat(E,"-checkbox-checked"),!g&&f&&"".concat(E,"-checkbox-indeterminate"),(v||C)&&"".concat(E,"-checkbox-disabled")),onClick:_.onCheck},U)},_.renderIcon=function(){var b=_.props.loading,g=_.props.context.prefixCls;return n.createElement("span",{className:m()("".concat(g,"-iconEle"),"".concat(g,"-icon__").concat(_.getNodeState()||"docu"),b&&"".concat(g,"-icon_loading"))})},_.renderSelector=function(){var b=_.state.dragNodeHighlight,g=_.props,f=g.title,C=g.selected,E=g.icon,v=g.loading,N=g.data,U=_.props.context,A=U.prefixCls,H=U.showIcon,F=U.icon,T=U.draggable,z=U.loadData,Q=U.titleRender,ne=_.isDisabled(),se="".concat(A,"-node-content-wrapper"),xe;if(H){var me=E||F;xe=me?n.createElement("span",{className:m()("".concat(A,"-iconEle"),"".concat(A,"-icon__customize"))},typeof me=="function"?me(_.props):me):_.renderIcon()}else z&&v&&(xe=_.renderIcon());var ve;typeof f=="function"?ve=f(N):Q?ve=Q(N):ve=f;var Oe=n.createElement("span",{className:"".concat(A,"-title")},ve);return n.createElement("span",{ref:_.setSelectHandle,title:typeof f=="string"?f:"",className:m()("".concat(se),"".concat(se,"-").concat(_.getNodeState()||"normal"),!ne&&(C||b)&&"".concat(A,"-node-selected"),!ne&&T&&"draggable"),draggable:!ne&&T||void 0,"aria-grabbed":!ne&&T||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:T?_.onDragStart:void 0},xe,Oe)},_}return Object(j.a)(O,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,g=this.props.context.selectable;return typeof b=="boolean"?b:g}},{key:"render",value:function(){var b,g=this.props,f=g.eventKey,C=g.className,E=g.style,v=g.dragOver,N=g.dragOverGapTop,U=g.dragOverGapBottom,A=g.isLeaf,H=g.isStart,F=g.isEnd,T=g.expanded,z=g.selected,Q=g.checked,ne=g.halfChecked,se=g.loading,xe=g.domRef,me=g.active,ve=g.onMouseMove,Oe=Object(X.a)(g,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Re=this.props.context,fe=Re.prefixCls,ue=Re.filterTreeNode,Pe=Re.draggable,et=Re.keyEntities,rt=this.isDisabled(),tt=Object(h.f)(Oe),it=et[f]||{},ze=it.level,Qe=F[F.length-1];return n.createElement("div",Object.assign({ref:xe,className:m()(C,"".concat(fe,"-treenode"),(b={},Object(Z.a)(b,"".concat(fe,"-treenode-disabled"),rt),Object(Z.a)(b,"".concat(fe,"-treenode-switcher-").concat(T?"open":"close"),!A),Object(Z.a)(b,"".concat(fe,"-treenode-checkbox-checked"),Q),Object(Z.a)(b,"".concat(fe,"-treenode-checkbox-indeterminate"),ne),Object(Z.a)(b,"".concat(fe,"-treenode-selected"),z),Object(Z.a)(b,"".concat(fe,"-treenode-loading"),se),Object(Z.a)(b,"".concat(fe,"-treenode-active"),me),Object(Z.a)(b,"".concat(fe,"-treenode-leaf-last"),Qe),Object(Z.a)(b,"drag-over",!rt&&v),Object(Z.a)(b,"drag-over-gap-top",!rt&&N),Object(Z.a)(b,"drag-over-gap-bottom",!rt&&U),Object(Z.a)(b,"filter-node",ue&&ue(Object(d.b)(this.props))),b)),style:E,onDragEnter:Pe?this.onDragEnter:void 0,onDragOver:Pe?this.onDragOver:void 0,onDragLeave:Pe?this.onDragLeave:void 0,onDrop:Pe?this.onDrop:void 0,onDragEnd:Pe?this.onDragEnd:void 0,onMouseMove:ve},tt),n.createElement(o,{prefixCls:fe,level:ze,isStart:H,isEnd:F}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(n.Component),S=function(L){return n.createElement(p.a.Consumer,null,function(O){return n.createElement(s,Object.assign({},L,{context:O}))})};S.displayName="TreeNode",S.defaultProps={title:r},S.isTreeNode=1;var w=oe.a=S},XIdC:function(Fe,oe,k){"use strict";var Z=k("rePB"),X=k("ODXe"),P=k("Ff2n"),V=k("q1tI"),j=k.n(V),M=k("TSYQ"),G=k.n(M),W=k("6cGi"),n=k("4IlW"),D=V.forwardRef(function(m,p){var h,c=m.prefixCls,o=c===void 0?"rc-switch":c,d=m.className,i=m.checked,a=m.defaultChecked,r=m.disabled,s=m.loadingIcon,S=m.checkedChildren,w=m.unCheckedChildren,x=m.onClick,L=m.onChange,O=m.onKeyDown,_=Object(P.a)(m,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),b=Object(W.a)(!1,{value:i,defaultValue:a}),g=Object(X.a)(b,2),f=g[0],C=g[1];function E(A,H){var F=f;return r||(F=A,C(F),L==null||L(F,H)),F}function v(A){A.which===n.a.LEFT?E(!1,A):A.which===n.a.RIGHT&&E(!0,A),O==null||O(A)}function N(A){var H=E(!f,A);x==null||x(H,A)}var U=G()(o,d,(h={},Object(Z.a)(h,"".concat(o,"-checked"),f),Object(Z.a)(h,"".concat(o,"-disabled"),r),h));return V.createElement("button",Object.assign({},_,{type:"button",role:"switch","aria-checked":f,disabled:r,className:U,ref:p,onKeyDown:v,onClick:N}),s,V.createElement("span",{className:"".concat(o,"-inner")},f?S:w))});D.displayName="Switch",oe.a=D},Y1PL:function(Fe,oe,k){"use strict";k.r(oe),k.d(oe,"ResizableTextArea",function(){return ne});var Z=k("wx14"),X=k("1OyB"),P=k("vuIU"),V=k("Ji7U"),j=k("LK+K"),M=k("q1tI"),G=k("VTBJ"),W=k("rePB"),n=k("Zm9Q"),D=k("Kwbf"),m=k("c+Xe"),p=k("m+aA"),h=k("bdgK"),c=new Map;function o(me){me.forEach(function(ve){var Oe,Re=ve.target;(Oe=c.get(Re))===null||Oe===void 0||Oe.forEach(function(fe){return fe(Re)})})}var d=new h.default(o),i=null,a=null;function r(me,ve){c.has(me)||(c.set(me,new Set),d.observe(me)),c.get(me).add(ve)}function s(me,ve){c.has(me)&&(c.get(me).delete(ve),c.get(me).size||(d.unobserve(me),c.delete(me)))}var S=function(me){Object(V.a)(Oe,me);var ve=Object(j.a)(Oe);function Oe(){return Object(X.a)(this,Oe),ve.apply(this,arguments)}return Object(P.a)(Oe,[{key:"render",value:function(){return this.props.children}}]),Oe}(M.Component),w=M.createContext(null);function x(me){var ve=me.children,Oe=me.onBatchResize,Re=M.useRef(0),fe=M.useRef([]),ue=M.useContext(w),Pe=M.useCallback(function(et,rt,tt){Re.current+=1;var it=Re.current;fe.current.push({size:et,element:rt,data:tt}),Promise.resolve().then(function(){it===Re.current&&(Oe==null||Oe(fe.current),fe.current=[])}),ue==null||ue(et,rt,tt)},[Oe,ue]);return M.createElement(w.Provider,{value:Pe},ve)}function L(me){var ve=me.children,Oe=me.disabled,Re=M.useRef(null),fe=M.useRef(null),ue=M.useContext(w),Pe=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),et=M.isValidElement(ve)&&Object(m.c)(ve),rt=et?ve.ref:null,tt=M.useMemo(function(){return Object(m.a)(rt,Re)},[rt,Re]),it=M.useRef(me);it.current=me;var ze=M.useCallback(function(Qe){var at=it.current,he=at.onResize,Se=at.data,Le=Qe.getBoundingClientRect(),Me=Le.width,qe=Le.height,st=Qe.offsetWidth,mt=Qe.offsetHeight,gt=Math.floor(Me),St=Math.floor(qe);if(Pe.current.width!==gt||Pe.current.height!==St||Pe.current.offsetWidth!==st||Pe.current.offsetHeight!==mt){var Et={width:gt,height:St,offsetWidth:st,offsetHeight:mt};Pe.current=Et;var Ae=st===Math.round(Me)?Me:st,Ce=mt===Math.round(qe)?qe:mt,Xe=Object(G.a)(Object(G.a)({},Et),{},{offsetWidth:Ae,offsetHeight:Ce});ue==null||ue(Xe,Qe,Se),he&&Promise.resolve().then(function(){he(Xe,Qe)})}},[]);return M.useEffect(function(){var Qe=Object(p.a)(Re.current)||Object(p.a)(fe.current);return Qe&&!Oe&&r(Qe,ze),function(){return s(Qe,ze)}},[Re.current,Oe]),M.createElement(S,{ref:fe},et?M.cloneElement(ve,{ref:tt}):ve)}var O="rc-observer-key";function _(me){var ve=me.children,Oe=Object(n.a)(ve);return Oe.map(function(Re,fe){var ue=(Re==null?void 0:Re.key)||"".concat(O,"-").concat(fe);return M.createElement(L,Object(Z.a)({},me,{key:ue}),Re)})}_.Collection=x;var b=_,g=k("bT9E"),f=k("TSYQ"),C=k.n(f),E=`
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
`,v=["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={},U;function A(me){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=me.getAttribute("id")||me.getAttribute("data-reactid")||me.getAttribute("name");if(ve&&N[Oe])return N[Oe];var Re=window.getComputedStyle(me),fe=Re.getPropertyValue("box-sizing")||Re.getPropertyValue("-moz-box-sizing")||Re.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(Re.getPropertyValue("padding-bottom"))+parseFloat(Re.getPropertyValue("padding-top")),Pe=parseFloat(Re.getPropertyValue("border-bottom-width"))+parseFloat(Re.getPropertyValue("border-top-width")),et=v.map(function(tt){return"".concat(tt,":").concat(Re.getPropertyValue(tt))}).join(";"),rt={sizingStyle:et,paddingSize:ue,borderSize:Pe,boxSizing:fe};return ve&&Oe&&(N[Oe]=rt),rt}function H(me){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),me.getAttribute("wrap")?U.setAttribute("wrap",me.getAttribute("wrap")):U.removeAttribute("wrap");var fe=A(me,ve),ue=fe.paddingSize,Pe=fe.borderSize,et=fe.boxSizing,rt=fe.sizingStyle;U.setAttribute("style","".concat(rt,";").concat(E)),U.value=me.value||me.placeholder||"";var tt=Number.MIN_SAFE_INTEGER,it=Number.MAX_SAFE_INTEGER,ze=U.scrollHeight,Qe;if(et==="border-box"?ze+=Pe:et==="content-box"&&(ze-=ue),Oe!==null||Re!==null){U.value=" ";var at=U.scrollHeight-ue;Oe!==null&&(tt=at*Oe,et==="border-box"&&(tt=tt+ue+Pe),ze=Math.max(tt,ze)),Re!==null&&(it=at*Re,et==="border-box"&&(it=it+ue+Pe),Qe=ze>it?"":"hidden",ze=Math.min(it,ze))}return{height:ze,minHeight:tt,maxHeight:it,overflowY:Qe,resize:"none"}}var F=k("Gytx"),T=k.n(F),z;(function(me){me[me.NONE=0]="NONE",me[me.RESIZING=1]="RESIZING",me[me.RESIZED=2]="RESIZED"})(z||(z={}));var Q=function(me){Object(V.a)(Oe,me);var ve=Object(j.a)(Oe);function Oe(Re){var fe;return Object(X.a)(this,Oe),fe=ve.call(this,Re),fe.nextFrameActionId=void 0,fe.resizeFrameId=void 0,fe.textArea=void 0,fe.saveTextArea=function(ue){fe.textArea=ue},fe.handleResize=function(ue){var Pe=fe.state.resizeStatus,et=fe.props,rt=et.autoSize,tt=et.onResize;if(Pe!==z.NONE)return;typeof tt=="function"&&tt(ue),rt&&fe.resizeOnNextFrame()},fe.resizeOnNextFrame=function(){cancelAnimationFrame(fe.nextFrameActionId),fe.nextFrameActionId=requestAnimationFrame(fe.resizeTextarea)},fe.resizeTextarea=function(){var ue=fe.props.autoSize;if(!ue||!fe.textArea)return;var Pe=ue.minRows,et=ue.maxRows,rt=H(fe.textArea,!1,Pe,et);fe.setState({textareaStyles:rt,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(fe.resizeFrameId),fe.resizeFrameId=requestAnimationFrame(function(){fe.setState({resizeStatus:z.RESIZED},function(){fe.resizeFrameId=requestAnimationFrame(function(){fe.setState({resizeStatus:z.NONE}),fe.fixFirefoxAutoScroll()})})})})},fe.renderTextArea=function(){var ue=fe.props,Pe=ue.prefixCls,et=Pe===void 0?"rc-textarea":Pe,rt=ue.autoSize,tt=ue.onResize,it=ue.className,ze=ue.disabled,Qe=fe.state,at=Qe.textareaStyles,he=Qe.resizeStatus,Se=Object(g.a)(fe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Le=C()(et,it,Object(W.a)({},"".concat(et,"-disabled"),ze));"value"in Se&&(Se.value=Se.value||"");var Me=Object(G.a)(Object(G.a)(Object(G.a)({},fe.props.style),at),he===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(b,{onResize:fe.handleResize,disabled:!(rt||tt)},M.createElement("textarea",Object(Z.a)({},Se,{className:Le,style:Me,ref:fe.saveTextArea})))},fe.state={textareaStyles:{},resizeStatus:z.NONE},fe}return Object(P.a)(Oe,[{key:"componentDidUpdate",value:function(fe){(fe.value!==this.props.value||!T()(fe.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 fe=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(fe,ue)}}catch(Pe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Oe}(M.Component),ne=Q,se=function(me){Object(V.a)(Oe,me);var ve=Object(j.a)(Oe);function Oe(Re){var fe;Object(X.a)(this,Oe),fe=ve.call(this,Re),fe.resizableTextArea=void 0,fe.focus=function(){fe.resizableTextArea.textArea.focus()},fe.saveTextArea=function(Pe){fe.resizableTextArea=Pe},fe.handleChange=function(Pe){var et=fe.props.onChange;fe.setValue(Pe.target.value,function(){fe.resizableTextArea.resizeTextarea()}),et&&et(Pe)},fe.handleKeyDown=function(Pe){var et=fe.props,rt=et.onPressEnter,tt=et.onKeyDown;Pe.keyCode===13&&rt&&rt(Pe),tt&&tt(Pe)};var ue=typeof Re.value=="undefined"||Re.value===null?Re.defaultValue:Re.value;return fe.state={value:ue},fe}return Object(P.a)(Oe,[{key:"setValue",value:function(fe,ue){"value"in this.props||this.setState({value:fe},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(ne,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(fe){return"value"in fe?{value:fe.value}:null}}]),Oe}(M.Component),xe=oe.default=se},ZD9Y:function(Fe,oe,k){"use strict";var Z=k("BoS7"),X=k("Sdc0"),P=k("OaEy"),V=k("2fM7"),j=k("q1tI"),M=k.n(j),G=k("lOMy"),W=k.n(G),n=V.a.Option;oe.a=function(D){var m=D.onFontSizeChange,p=D.cmFontSize,h=D.cmCodeMode,c=D.onCodeModeChange,o=D.onTabToSpace,d=D.className,i=d===void 0?"":d,a=D.tabToSpace,r=D.children;return M.a.createElement("div",{className:"tpi-code-setting ".concat(i)},M.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),M.a.createElement("section",null,M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),M.a.createElement(V.a,{bordered:!1,size:"small",value:h,onChange:c},M.a.createElement(n,{value:"vs"},"\u767D\u8272\u80CC\u666F"),M.a.createElement(n,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),M.a.createElement(V.a,{bordered:!1,size:"small",value:p,onChange:m},M.a.createElement(n,{value:12},"12px"),M.a.createElement(n,{value:14},"14px"),M.a.createElement(n,{value:16},"16px"),M.a.createElement(n,{value:18},"18px"),M.a.createElement(n,{value:20},"20px"),M.a.createElement(n,{value:22},"22px"))),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"Tab\u8F6C\u6362"),M.a.createElement(X.a,{checked:a,onChange:o}))),M.a.createElement("h3",null,"\u5FEB\u6377\u952E"),M.a.createElement("section",null,M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),M.a.createElement("span",null,"Ctrl + S")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),M.a.createElement("span",null,"F1 / Alt + F1")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),M.a.createElement("span",null,"Ctrl + ]/[")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),M.a.createElement("span",null,"Ctrl + Shift + \\")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),M.a.createElement("span",null,"Home")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),M.a.createElement("span",null,"End"))),r)}},ZW9T:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return F});var Z=k("k1fw"),X=k("oBTY"),P=k("miYZ"),V=k("tsqr"),j=k("rAM+"),M=k("tJVT"),G=k("PpiC"),W=k("q1tI"),n=k.n(W),D=k("bdgK"),m=k("9og8"),p=k("WmNS"),h=k.n(p),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"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},d={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","friend","gcnew","generic","goto","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:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $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 <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},i={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=k("5VLF"),r=k.n(a),s={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"]}},S=function(z,Q){return Q.map(function(ne){return{label:ne,kind:z.languages.CompletionItemKind.Keyword,insertText:ne}})},w=function(z){return Object.keys(s.tables).map(function(Q){return{label:Q,kind:z.languages.CompletionItemKind.Variable,insertText:Q}})},x=function(z,Q){var ne=s.tables[z];return ne?ne.map(function(se){return{label:se,kind:Q.languages.CompletionItemKind.Field,insertText:se}}):[]};function L(T,z,Q,ne,se){var xe=z.getWordUntilPosition(Q),me={startLineNumber:Q.lineNumber,endLineNumber:Q.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},ve=ne.map(function(Oe){return{label:Oe,kind:T.languages.CompletionItemKind.Keyword,insertText:Oe,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:me}});return se.map(function(Oe){ve.push(Object(Z.a)(Object(Z.a)({},Oe),{},{range:me}))}),ve}var O=function(T){s.languages.map(function(se){return T.languages.registerDocumentFormattingEditProvider(se,{provideDocumentFormattingEdits:function(me,ve,Oe){return Object(m.a)(h.a.mark(function Re(){var fe;return h.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return fe=r()(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}),Pe.abrupt("return",[{range:me.getFullModelRange(),text:fe}]);case 2:case"end":return Pe.stop()}},Re)}))()}}),se});var z=d.quickKey.map(function(se){return{label:se.label,kind:T.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=i.quickKey.map(function(se){return{label:se.label,kind:T.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=o.quickKey.map(function(se){return{label:se.label,kind:T.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet}});T.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(xe,me){var ve=xe.getWordUntilPosition(me),Oe={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Re=xe.getLineContent(me.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[].concat(Object(X.a)(d.keywords.map(function(fe){return{label:fe,kind:T.languages.CompletionItemKind.Function,documentation:fe,insertText:fe,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})),Object(X.a)(d.quickKey.map(function(fe){return{label:fe.label,kind:T.languages.CompletionItemKind.Function,documentation:fe.content,insertText:Re.startsWith("#")?fe.content.replace(/#/,""):fe.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})))}}}),T.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(xe,me){var ve=xe.getWordUntilPosition(me),Oe={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn};return{suggestions:Object(X.a)(c.keywords.map(function(Re){return{label:Re,kind:T.languages.CompletionItemKind.Function,documentation:Re,insertText:Re,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}}))}}}),T.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(xe,me){var ve=xe.getWordUntilPosition(me),Oe={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Re=xe.getLineContent(me.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[].concat(Object(X.a)(o.keywords.map(function(fe){return{label:fe,kind:T.languages.CompletionItemKind.Function,documentation:fe,insertText:fe,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})),Object(X.a)(o.quickKey.map(function(fe){return{label:fe.label,kind:T.languages.CompletionItemKind.Function,documentation:fe.content,insertText:Re.startsWith("#")?fe.content.replace(/#/,""):fe.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})))}}}),T.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(xe,me){var ve=xe.getWordUntilPosition(me),Oe={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Re=xe.getLineContent(me.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[].concat(Object(X.a)(i.keywords.map(function(fe){return{label:fe,kind:T.languages.CompletionItemKind.Function,documentation:fe,insertText:fe,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})),Object(X.a)(i.quickKey.map(function(fe){return{label:fe.label,kind:T.languages.CompletionItemKind.Function,documentation:fe.content,insertText:Re.startsWith("#")?fe.content.replace(/#/,""):fe.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})))}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=k("fjLI"),g=k("LvDl"),f=k("+ua5");function C(T){return/^\d+$/.test(T)?"".concat(T,"px"):T}function E(){}var v=!1,N={"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 U(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],z=T;if(Array.isArray(T)){for(var Q=0;Q<T.length;Q++){var ne=N[T[Q]];if(ne)return ne}return z[0]}return N[z]||z}var A=null,H=oe.b=function(T){var z=T.width,Q=z===void 0?"100%":z,ne=T.height,se=ne===void 0?"100%":ne,xe=T.value,me=T.language,ve=me===void 0?"javascript":me,Oe=T.style,Re=Oe===void 0?{}:Oe,fe=T.options,ue=fe===void 0?{}:fe,Pe=T.overrideServices,et=Pe===void 0?{}:Pe,rt=T.theme,tt=rt===void 0?"vs-dark":rt,it=T.onEditBlur,ze=T.onSave,Qe=T.autoHeight,at=Qe===void 0?!1:Qe,he=T.forbidCopy,Se=he===void 0?!1:he,Le=T.onChange,Me=Le===void 0?E:Le,qe=T.editorDidMount,st=qe===void 0?E:qe,mt=T.onFocus,gt=mt===void 0?E:mt,St=T.filename,Et=St===void 0?"educoder.txt":St,Ae=T.errorLine,Ce=T.errorContent,Xe=Ce===void 0?"":Ce,Je=T.customTheme,ke=Je===void 0?null:Je,Ke=Object(G.a)(T,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent","customTheme"]),ye=Object(W.useRef)(),ce=Object(W.useRef)({}),pe=Object(W.useRef)(),ie=Object(W.useRef)(),ae=Object(W.useRef)(!1),de=Object(W.useRef)(),ge=Object(W.useState)(!1),Te=Object(M.a)(ge,2),De=Te[0],Ze=Te[1];function pt(){var ct;return ye.current&&(ct=new D.default(function(Ut){var $t=Object(j.a)(Ut),Vt;try{for($t.s();!(Vt=$t.n()).done;){var At=Vt.value;(At.target.offsetHeight>0||At.target.offsetWidth>0)&&ce.current.instance.layout()}}catch(Tn){$t.e(Tn)}finally{$t.f()}}),ct.observe(ye.current)),ct}function Ot(){V.b.warn(decodeURIComponent(_))}var yt=function(){var Ut=ce.current.instance;if(xe!=null&&Ut&&De){var $t=Ut.getModel();$t&&xe!==$t.getValue()&&(v=!0,$t.setValue(xe),Ut.layout(),v=!1)}};Object(W.useEffect)(function(){ie.current&&clearTimeout(ie.current),ie.current=setTimeout(function(){yt()},500)},[xe,De,ce.current]),Object(W.useEffect)(function(){if(Ae&&ce.current&&ce.current.instance){var ct=ce.current.instance;ct.changeViewZones(function($t){var Vt=document.createElement("div");Vt.style.padding="10px 20px",Vt.style.width="calc(100% - 20px)",Vt.className="my-error-line-wrp",Vt.innerHTML=Xe,$t.addZone({afterLineNumber:Ae||11,heightInLines:3,domNode:Vt})});var Ut={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}};ct.addOverlayWidget(Ut),ct.revealPositionInCenter({lineNumber:20,column:1})}},[Ae,ce.current,De]);function ot(){var ct=ce.current.instance;if(ct){var Ut=ct.getSelection(),$t=ce.current.pastePos||{},Vt=new A.Range($t.startLineNumber||Ut.endLineNumber,$t.startColumn||Ut.endColumn,$t.endLineNumber||Ut.endLineNumber,$t.endColumn||Ut.endColumn);setTimeout(function(){ct.executeEdits("",[{range:Vt,text:""}])},300)}}function He(ct){(window.navigator.platform.match("Mac")?ct.metaKey:ct.ctrlKey)&&ct.keyCode==83&&(ct.preventDefault(),ze())}var Ge=function(){if(at&&ce.current.instance){var Ut=ce.current.instance.getContentHeight();xt(Ut<se?se:Ut)}else xt(se)};function Ue(ct){var Ut=document.createEvent("MouseEvents");Ut.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),ct.dispatchEvent(Ut)}function le(ct,Ut){var $t=window.URL||window.webkitURL||window,Vt=new Blob([Ut]),At=document.createElementNS("http://www.w3.org/1999/xhtml","a");At.href=$t.createObjectURL(Vt),At.download=ct,Ue(At)}Object(W.useEffect)(function(){Ge()},[Ge]),Object(W.useEffect)(function(){ye.current&&!De&&Promise.all([k.e(16),k.e(29)]).then(k.t.bind(null,"M/lh",7)).then(function(ct){try{A=ct,ce.current.instance=A.editor.create(ye.current,{value:xe,language:U(ve),theme:tt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},et);var Ut=ce.current.instance,$t=b.d._menuItems,Vt=Object(X.a)($t).find(function(Wt){return Wt[0]._debugName=="EditorContext"}),At=Vt[1],Tn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Fn=function(hn,Mn){var Bn=hn._first;do{var ut,Ct,Hn=Mn.includes((ut=Bn.element)===null||ut===void 0||((Ct=ut.command)===null||Ct===void 0)?void 0:Ct.id);Hn&&hn._remove(Bn)}while(Bn=Bn.next)};if(st(Ut,A),setTimeout(function(){Ge(),ce.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){le(Et||"educoder.txt",Ut.getValue())}}),Ut.getDomNode().addEventListener("input",function(){pe.current.autoFormat&&Ut.getAction("editor.action.formatDocument").run()})},500),ce.current.subscription=Ut.onDidChangeModelContent(function(Wt){ae.current?clearTimeout(de.current):(Ge(),Me(Ut.getValue(),Wt)),de.current=setTimeout(function(){ae.current=!1},500)}),window.Monaco||O(A,U(ve)),Se&&(Fn(At,Tn),ye.current.classList.add("noCopyPaste"),Ut.onKeyDown(function(Wt){var hn=Wt.keyCode,Mn=Wt.ctrlKey,Bn=Wt.metaKey;(hn===33||hn===52)&&(Bn||Mn)&&(Ot(),Wt.preventDefault())})),window.Monaco=A,it&&Ut.onDidBlurEditorWidget(function(){it(Ut.getValue())}),gt&&Ut.onDidFocusEditorText(function(){gt(Ut.getValue())}),Se){Ut.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return Ot(),null}),Ut.onDidPaste(function(Wt){ce.current.pastePos=Wt});try{window.addEventListener("paste",ot)}catch(Wt){}}var Sn=pt();return Ze(!0),function(){var Wt=ce.current.instance;Wt.dispose();var hn=Wt.getModel();hn&&hn.dispose(),ce.current.subscription&&ce.current.subscription.dispose(),Se&&window.removeEventListener("paste",ot),Sn.unobserve(ye.current)}}catch(Wt){}})},[]),Object(W.useEffect)(function(){var ct=ce.current.instance;if(ct&&De)return document.addEventListener("keydown",He,!1),function(){document.removeEventListener("keydown",He)}},[ze,De]),Object(W.useEffect)(function(){var ct=ce.current.instance;if(ct&&De){var Ut=U(ve);A.editor.setModelLanguage(ct.getModel(),Ut),console.log("language:",ve,ct.getModel(),Ut)}},[ve,De]),Object(W.useEffect)(function(){var ct=ce.current.instance;ct&&De&&(ke?(A.editor.defineTheme("customTheme",ke),A.editor.setTheme("customTheme")):A.editor.setTheme(tt))},[tt,De,ke]),Object(W.useEffect)(function(){var ct=ce.current.instance;pe.current=ue,ct&&De&&(ct.updateOptions(Object(Z.a)({},ue)),setTimeout(function(){ct.getModel().updateOptions(Object(Z.a)({},ue))},200))},[JSON.stringify(ue),De]),Object(W.useEffect)(function(){var ct=ce.current.instance;ct&&De&&ct.layout()},[Q,se,De]);var _e=Object(W.useState)(C(Q)),Ve=Object(M.a)(_e,2),je=Ve[0],ht=Ve[1],ft=Object(W.useState)(C(se)),Ie=Object(M.a)(ft,2),$e=Ie[0],xt=Ie[1],Ft=Object(Z.a)(Object(Z.a)({},Re),{},{width:je,height:$e});return n.a.createElement("div",{className:"my-monaco-editor",ref:ye,style:Ft})};function F(T){var z=T.width,Q=z===void 0?"100%":z,ne=T.height,se=ne===void 0?"100%":ne,xe=T.original,me=T.modified,ve=T.language,Oe=T.options,Re=Oe===void 0?{}:Oe,fe=Object(W.useRef)(),ue=Object(W.useState)(null),Pe=Object(M.a)(ue,2),et=Pe[0],rt=Pe[1];function tt(at){var he;return fe.current&&(he=new D.default(function(Se){var Le=Object(j.a)(Se),Me;try{for(Le.s();!(Me=Le.n()).done;){var qe=Me.value;(qe.target.offsetHeight>0||qe.target.offsetWidth>0)&&at.layout()}}catch(st){Le.e(st)}finally{Le.f()}}),he.observe(fe.current)),he}Object(W.useEffect)(function(){fe.current&&Promise.all([k.e(16),k.e(29)]).then(k.t.bind(null,"M/lh",7)).then(function(at){A=at;var he=A.editor.createDiffEditor(fe.current,Object(Z.a)(Object(Z.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},Re),{},{wordWrap:!0}));rt(he);var Se=tt(he);return function(){he.dispose();var Le=he.getModel();Le&&Le.dispose(),Se.unobserve(fe.current)}})},[]),Object(W.useEffect)(function(){et&&et.setModel({original:A.editor.createModel(xe,ve),modified:A.editor.createModel(me,ve)})},[xe,me,ve,et]);var it=C(Q),ze=C(se),Qe={width:it,height:ze};return n.a.createElement("div",{className:"my-diff-editor",ref:fe,style:Qe})}},ZpRC:function(Fe,oe,k){"use strict";function Z(m){return typeof m=="object"&&m!=null&&m.nodeType===1}function X(m,p){return(!p||m!=="hidden")&&m!=="visible"&&m!=="clip"}function P(m,p){if(m.clientHeight<m.scrollHeight||m.clientWidth<m.scrollWidth){var h=getComputedStyle(m,null);return X(h.overflowY,p)||X(h.overflowX,p)||function(c){var o=function(d){if(!d.ownerDocument||!d.ownerDocument.defaultView)return null;try{return d.ownerDocument.defaultView.frameElement}catch(i){return null}}(c);return!!o&&(o.clientHeight<c.scrollHeight||o.clientWidth<c.scrollWidth)}(m)}return!1}function V(m,p,h,c,o,d,i,a){return d<m&&i>p||d>m&&i<p?0:d<=m&&a<=h||i>=p&&a>=h?d-m-c:i>p&&a<h||d<m&&a>h?i-p+o:0}var j=function(m,p){var h=window,c=p.scrollMode,o=p.block,d=p.inline,i=p.boundary,a=p.skipOverflowHiddenElements,r=typeof i=="function"?i:function(at){return at!==i};if(!Z(m))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,S=[],w=m;Z(w)&&r(w);){if((w=w.parentElement)===s){S.push(w);break}w!=null&&w===document.body&&P(w)&&!P(document.documentElement)||w!=null&&P(w,a)&&S.push(w)}for(var x=h.visualViewport?h.visualViewport.width:innerWidth,L=h.visualViewport?h.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,b=m.getBoundingClientRect(),g=b.height,f=b.width,C=b.top,E=b.right,v=b.bottom,N=b.left,U=o==="start"||o==="nearest"?C:o==="end"?v:C+g/2,A=d==="center"?N+f/2:d==="end"?E:N,H=[],F=0;F<S.length;F++){var T=S[F],z=T.getBoundingClientRect(),Q=z.height,ne=z.width,se=z.top,xe=z.right,me=z.bottom,ve=z.left;if(c==="if-needed"&&C>=0&&N>=0&&v<=L&&E<=x&&C>=se&&v<=me&&N>=ve&&E<=xe)return H;var Oe=getComputedStyle(T),Re=parseInt(Oe.borderLeftWidth,10),fe=parseInt(Oe.borderTopWidth,10),ue=parseInt(Oe.borderRightWidth,10),Pe=parseInt(Oe.borderBottomWidth,10),et=0,rt=0,tt="offsetWidth"in T?T.offsetWidth-T.clientWidth-Re-ue:0,it="offsetHeight"in T?T.offsetHeight-T.clientHeight-fe-Pe:0;if(s===T)et=o==="start"?U:o==="end"?U-L:o==="nearest"?V(_,_+L,L,fe,Pe,_+U,_+U+g,g):U-L/2,rt=d==="start"?A:d==="center"?A-x/2:d==="end"?A-x:V(O,O+x,x,Re,ue,O+A,O+A+f,f),et=Math.max(0,et+_),rt=Math.max(0,rt+O);else{et=o==="start"?U-se-fe:o==="end"?U-me+Pe+it:o==="nearest"?V(se,me,Q,fe,Pe+it,U,U+g,g):U-(se+Q/2)+it/2,rt=d==="start"?A-ve-Re:d==="center"?A-(ve+ne/2)+tt/2:d==="end"?A-xe+ue+tt:V(ve,xe,ne,Re,ue+tt,A,A+f,f);var ze=T.scrollLeft,Qe=T.scrollTop;U+=Qe-(et=Math.max(0,Math.min(Qe+et,T.scrollHeight-Q+it))),A+=ze-(rt=Math.max(0,Math.min(ze+rt,T.scrollWidth-ne+tt)))}H.push({el:T,top:et,left:rt})}return H};function M(m){return m===Object(m)&&Object.keys(m).length!==0}function G(m,p){p===void 0&&(p="auto");var h="scrollBehavior"in document.body.style;m.forEach(function(c){var o=c.el,d=c.top,i=c.left;o.scroll&&h?o.scroll({top:d,left:i,behavior:p}):(o.scrollTop=d,o.scrollLeft=i)})}function W(m){return m===!1?{block:"end",inline:"nearest"}:M(m)?m:{block:"start",inline:"nearest"}}function n(m,p){var h=!m.ownerDocument.documentElement.contains(m);if(M(p)&&typeof p.behavior=="function")return p.behavior(h?[]:j(m,p));if(h)return;var c=W(p);return G(j(m,c),c.behavior)}var D=oe.a=n},a4uL:function(Fe,oe,k){},bCnd:function(Fe,oe,k){"use strict";k.d(oe,"b",function(){return V}),k.d(oe,"a",function(){return j});var Z=k("je13"),X=k.n(Z),P=!1;function V(M,G){var W=X.a.get("__ec");W||(W={}),W[M]=G,X.a.set("__ec",W)}function j(M,G){var W=X.a.get("__ec");return W?W[M]===void 0?G:W[M]:G}},bT9E:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return X});var Z=k("VTBJ");function X(P,V){var j=Object(Z.a)({},P);return Array.isArray(V)&&V.forEach(function(M){delete j[M]}),j}},biw7:function(Fe,oe,k){"use strict";var Z=k("q1tI"),X=k.n(Z),P=Z.createContext(null);oe.a=P},c5Ni:function(Fe,oe,k){},cDPC:function(Fe,oe,k){"use strict";var Z=k("tJVT"),X=k("q1tI"),P=k.n(X),V=k("i3hx"),j=k.n(V);oe.a=function(M){var G=M.defaultX,W=G===void 0?"40%":G,n=M.leftChild,D=M.rightChild,m=M.className,p=M.hideResize,h=p===void 0?!1:p,c=Object(X.useState)(W),o=Object(Z.a)(c,2),d=o[0],i=o[1],a=Object(X.useRef)();function r(){a.current=!0}Object(X.useEffect)(function(){function w(L){a.current&&i(L.pageX)}function x(){a.current=!1}return window.addEventListener("mousemove",w),window.addEventListener("mouseup",x),function(){window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",x)}},[]);var s=typeof d=="number"&&d!==.01?"".concat(d,"px"):W,S="calc(100% - ".concat(h?"0px":"4px"," - ").concat(s,")");return P.a.createElement("div",{className:"split-panel-container ".concat(m)},P.a.createElement("section",{style:{width:s,display:d===.01?"none":""}},n),P.a.createElement("section",{className:"resize-x-bar",onMouseDown:r},P.a.createElement("a",{className:"btn-resize"},P.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},P.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),P.a.createElement("section",{style:{width:S}},D))}},dejd:function(Fe,oe,k){},dmUQ:function(Fe,oe,k){"use strict";var Z=k("Ff2n"),X=k("rePB"),P=k("1OyB"),V=k("vuIU"),j=k("Ji7U"),M=k("md7G"),G=k("foSv"),W=k("q1tI"),n=k.n(W),D=k("TSYQ"),m=k.n(D),p=k("4IlW");function h(g,f){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(g);f&&(E=E.filter(function(v){return Object.getOwnPropertyDescriptor(g,v).enumerable})),C.push.apply(C,E)}return C}function c(g){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?h(Object(C),!0).forEach(function(E){Object(X.a)(g,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):h(Object(C)).forEach(function(E){Object.defineProperty(g,E,Object.getOwnPropertyDescriptor(C,E))})}return g}function o(g){var f=d();return function(){var E=Object(G.a)(g),v;if(f){var N=Object(G.a)(this).constructor;v=Reflect.construct(E,arguments,N)}else v=E.apply(this,arguments);return Object(M.a)(this,v)}}function d(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(g){return!1}}function i(){}function a(g){g.preventDefault()}var r=function(f){return f.replace(/[^\w.-]+/g,"")},s=200,S=600,w=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(f){return f!=null},L=function(f,C){return C===f||typeof C=="number"&&typeof f=="number"&&isNaN(C)&&isNaN(f)},O=function(g){Object(j.a)(C,g);var f=o(C);function C(E){var v;Object(P.a)(this,C),v=f.call(this,E),v.onKeyDown=function(A){var H=v.props,F=H.onKeyDown,T=H.onPressEnter;if(A.keyCode===p.a.UP){var z=v.getRatio(A);v.up(A,z,null),v.stop()}else if(A.keyCode===p.a.DOWN){var Q=v.getRatio(A);v.down(A,Q,null),v.stop()}else A.keyCode===p.a.ENTER&&T&&T(A);if(v.recordCursorPosition(),v.lastKeyCode=A.keyCode,F){for(var ne=arguments.length,se=new Array(ne>1?ne-1:0),xe=1;xe<ne;xe++)se[xe-1]=arguments[xe];F.apply(void 0,[A].concat(se))}},v.onKeyUp=function(A){var H=v.props.onKeyUp;if(v.stop(),v.recordCursorPosition(),H){for(var F=arguments.length,T=new Array(F>1?F-1:0),z=1;z<F;z++)T[z-1]=arguments[z];H.apply(void 0,[A].concat(T))}},v.onChange=function(A){var H=v.props.onChange;v.state.focused&&(v.inputting=!0),v.rawInput=v.props.parser(v.getValueFromEvent(A)),v.setState({inputValue:v.rawInput}),H(v.toNumber(v.rawInput))},v.onMouseUp=function(){var A=v.props.onMouseUp;v.recordCursorPosition(),A&&A.apply(void 0,arguments)},v.onFocus=function(){var A;v.setState({focused:!0}),(A=v.props).onFocus.apply(A,arguments)},v.onBlur=function(){var A=v.props.onBlur;v.inputting=!1,v.setState({focused:!1});var H=v.getCurrentValidValue(v.state.inputValue),F=v.setValue(H,i);if(A){var T=v.input.value,z=v.getInputDisplayValue({focus:!1,value:F});v.input.value=z&&Number(z),A.apply(void 0,arguments),v.input.value=T}},v.getRatio=function(A){var H=1;return A.metaKey||A.ctrlKey?H=.1:A.shiftKey&&(H=10),H},v.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},v.getPrecision=function(A){if(x(v.props.precision))return v.props.precision;var H=String(A);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var F=0;return H.indexOf(".")>=0&&(F=H.length-H.indexOf(".")-1),F},v.getInputDisplayValue=function(A){var H=A||v.state,F=H.focused,T=H.inputValue,z=H.value,Q;F?Q=T:Q=v.toPrecisionAsStep(z),Q==null&&(Q="");var ne=v.formatWrapper(Q);return x(v.props.decimalSeparator)&&(ne=ne.toString().replace(".",v.props.decimalSeparator)),ne},v.recordCursorPosition=function(){try{v.cursorStart=v.input.selectionStart,v.cursorEnd=v.input.selectionEnd,v.currentValue=v.input.value,v.cursorBefore=v.input.value.substring(0,v.cursorStart),v.cursorAfter=v.input.value.substring(v.cursorEnd)}catch(A){}},v.restoreByAfter=function(A){if(A===void 0)return!1;var H=v.input.value,F=H.lastIndexOf(A);if(F===-1)return!1;var T=v.cursorBefore.length;return v.lastKeyCode===p.a.DELETE&&v.cursorBefore.charAt(T-1)===A[0]?(v.fixCaret(T,T),!0):F+A.length===H.length?(v.fixCaret(F,F),!0):!1},v.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(H,F){var T=A.substring(F);return v.restoreByAfter(T)})},v.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},v.stop=function(){v.autoStepTimer&&clearTimeout(v.autoStepTimer)},v.down=function(A,H,F){v.pressingUpOrDown=!0,v.step("down",A,H,F)},v.up=function(A,H,F){v.pressingUpOrDown=!0,v.step("up",A,H,F)},v.saveInput=function(A){v.input=A};var N=E.value;N===void 0&&(N=E.defaultValue),v.state={focused:E.autoFocus};var U=v.getValidValue(v.toNumber(N));return v.state=c(c({},v.state),{},{inputValue:v.toPrecisionAsStep(U),value:U}),v}return Object(V.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(v){var N=this.props,U=N.value,A=N.onChange,H=N.max,F=N.min,T=this.state.focused;if(v){if(!L(v.value,U)||!L(v.max,H)||!L(v.min,F)){var z=T?U:this.getValidValue(U),Q;this.pressingUpOrDown?Q=z:this.inputting?Q=this.rawInput:Q=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:Q})}var ne="value"in this.props?U:this.state.value;"max"in this.props&&v.max!==H&&typeof ne=="number"&&ne>H&&A&&A(H),"min"in this.props&&v.min!==F&&typeof ne=="number"&&ne<F&&A&&A(F)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var se=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?se=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(se=this.cursorStart):se=this.input.value.length,this.fixCaret(se,se)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(xe){}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(v){var N=v;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(v){var N=v.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(v);return isNaN(A)?v:(A<N&&(A=N),A>U&&(A=U),A)}},{key:"setValue",value:function(v,N){var U=this.props.precision,A=this.isNotCompleteNumber(parseFloat(v))?null:parseFloat(v),H=this.state.value,F=H===void 0?null:H,T=this.state.inputValue,z=T===void 0?null:T,Q=typeof A=="number"?A.toFixed(U):"".concat(A),ne=A!==F||Q!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},N)):this.setState({value:A,inputValue:this.toPrecisionAsStep(v)},N),ne&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,A=U.precision,H=U.step;if(x(A))return A;var F=this.getPrecision(N),T=this.getPrecision(H),z=this.getPrecision(v);return v?Math.max(z,F+T):F+T}},{key:"getPrecisionFactor",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(v,N);return Math.pow(10,U)}},{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(v){return this.props.formatter?this.props.formatter(v):v}},{key:"toPrecisionAsStep",value:function(v){if(this.isNotCompleteNumber(v)||v==="")return v;var N=Math.abs(this.getMaxPrecision(v));return isNaN(N)?v.toString():Number(v).toFixed(N)}},{key:"toNumber",value:function(v){var N=this.props.precision,U=this.state.focused,A=v&&v.length>16&&U;return this.isNotCompleteNumber(v)||A?v:x(N)?Math.round(v*Math.pow(10,N))/Math.pow(10,N):Number(v)}},{key:"upStep",value:function(v,N){var U=this.props.step,A=this.getPrecisionFactor(v,N),H=Math.abs(this.getMaxPrecision(v,N)),F=((A*v+A*U*N)/A).toFixed(H);return this.toNumber(F)}},{key:"downStep",value:function(v,N){var U=this.props.step,A=this.getPrecisionFactor(v,N),H=Math.abs(this.getMaxPrecision(v,N)),F=((A*v-A*U*N)/A).toFixed(H);return this.toNumber(F)}},{key:"step",value:function(v,N){var U=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var F=this.props;if(F.disabled)return;var T=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(T))return;var z=this["".concat(v,"Step")](T,A),Q=z>F.max||z<F.min;if(z>F.max?z=F.max:z<F.min&&(z=F.min),this.setValue(z,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),Q)return;this.autoStepTimer=setTimeout(function(){U[v](N,A,!0)},H?s:S)}},{key:"fixCaret",value:function(v,N){if(v===void 0||N===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,A=this.input.selectionEnd;(v!==U||N!==A)&&this.input.setSelectionRange(v,N)}catch(H){}}},{key:"render",value:function(){var v,N=this.props,U=N.prefixCls,A=N.disabled,H=N.readOnly,F=N.useTouch,T=N.autoComplete,z=N.upHandler,Q=N.downHandler,ne=N.className,se=N.max,xe=N.min,me=N.style,ve=N.title,Oe=N.onMouseEnter,Re=N.onMouseLeave,fe=N.onMouseOver,ue=N.onMouseOut,Pe=N.required,et=N.onClick,rt=N.tabIndex,tt=N.type,it=N.placeholder,ze=N.id,Qe=N.inputMode,at=N.pattern,he=N.step,Se=N.maxLength,Le=N.autoFocus,Me=N.name,qe=N.onPaste,st=N.onInput,mt=Object(Z.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"]),gt=this.state,St=gt.value,Et=gt.focused,Ae=m()(U,(v={},Object(X.a)(v,ne,!!ne),Object(X.a)(v,"".concat(U,"-disabled"),A),Object(X.a)(v,"".concat(U,"-focused"),Et),v)),Ce={};Object.keys(mt).forEach(function(ge){(ge.substr(0,5)==="data-"||ge.substr(0,5)==="aria-"||ge==="role")&&(Ce[ge]=mt[ge])});var Xe=!H&&!A,Je=this.getInputDisplayValue(null),ke=(St||St===0)&&(isNaN(St)||Number(St)>=se),Ke=(St||St===0)&&(isNaN(St)||Number(St)<=xe),ye=ke||A||H,ce=Ke||A||H,pe=m()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(X.a)({},"".concat(U,"-handler-up-disabled"),ye)),ie=m()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(X.a)({},"".concat(U,"-handler-down-disabled"),ce)),ae=F?{onTouchStart:ye?i:this.up,onTouchEnd:this.stop}:{onMouseDown:ye?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=F?{onTouchStart:ce?i:this.down,onTouchEnd:this.stop}:{onMouseDown:ce?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ae,style:me,title:ve,onMouseEnter:Oe,onMouseLeave:Re,onMouseOver:fe,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(U,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":ye,className:pe}),z||n.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:a})),n.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":ce,className:ie}),Q||n.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:a}))),n.a.createElement("div",{className:"".concat(U,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":xe,"aria-valuemax":se,"aria-valuenow":St,required:Pe,type:tt,placeholder:it,onPaste:qe,onClick:et,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:rt,autoComplete:T,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Xe?this.onKeyDown:i,onKeyUp:Xe?this.onKeyUp:i,autoFocus:Le,maxLength:Se,readOnly:H,disabled:A,max:se,min:xe,step:he,name:Me,title:ve,id:ze,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Je),pattern:at,inputMode:Qe,onInput:st},Ce))))}}]),C}(n.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:r,required:!1,autoComplete:"off"};var _=O,b=oe.a=_},fcSX:function(Fe,oe,k){"use strict";var Z=k("Ff2n"),X=k("1OyB"),P=k("vuIU"),V=k("Ji7U"),j=k("md7G"),M=k("foSv"),G=k("1W/9"),W=k("q1tI"),n=k("rePB"),D=k("JX7q"),m=k("TSYQ"),p=k.n(m),h=k("qx4F"),c=k("4IlW");function o(A){return Array.isArray(A)?A:[A]}var d={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(d).filter(function(A){if(typeof document=="undefined")return!1;var H=document.getElementsByTagName("html")[0];return A in(H?H.style:{})})[0],a=d[i];function r(A,H,F,T){A.addEventListener?A.addEventListener(H,F,T):A.attachEvent&&A.attachEvent("on".concat(H),F)}function s(A,H,F,T){A.removeEventListener?A.removeEventListener(H,F,T):A.attachEvent&&A.detachEvent("on".concat(H),F)}function S(A,H){var F=typeof A=="function"?A(H):A;return Array.isArray(F)?F.length===2?F:[F[0],F[1]]:[F]}var w=function(H){return!isNaN(parseFloat(H))&&isFinite(H)},x=!(typeof window!="undefined"&&window.document&&window.document.createElement),L=function A(H,F,T,z){if(!F||F===document||F instanceof Document)return!1;if(F===H.parentNode)return!0;var Q=Math.max(Math.abs(T),Math.abs(z))===Math.abs(z),ne=Math.max(Math.abs(T),Math.abs(z))===Math.abs(T),se=F.scrollHeight-F.clientHeight,xe=F.scrollWidth-F.clientWidth,me=document.defaultView.getComputedStyle(F),ve=me.overflowY==="auto"||me.overflowY==="scroll",Oe=me.overflowX==="auto"||me.overflowX==="scroll",Re=se&&ve,fe=xe&&Oe;return Q&&(!Re||Re&&(F.scrollTop>=se&&z<0||F.scrollTop<=0&&z>0))||ne&&(!fe||fe&&(F.scrollLeft>=xe&&T<0||F.scrollLeft<=0&&T>0))?A(H,F.parentNode,T,z):!1};function O(A){var H=_();return function(){var T=Object(M.a)(A),z;if(H){var Q=Object(M.a)(this).constructor;z=Reflect.construct(T,arguments,Q)}else z=T.apply(this,arguments);return Object(j.a)(this,z)}}function _(){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(A){return!1}}var b={},g=function(A){Object(V.a)(F,A);var H=O(F);function F(T){var z;return Object(X.a)(this,F),z=H.call(this,T),z.domFocus=function(){z.dom&&z.dom.focus()},z.removeStartHandler=function(Q){if(Q.touches.length>1)return;z.startPos={x:Q.touches[0].clientX,y:Q.touches[0].clientY}},z.removeMoveHandler=function(Q){if(Q.changedTouches.length>1)return;var ne=Q.currentTarget,se=Q.changedTouches[0].clientX-z.startPos.x,xe=Q.changedTouches[0].clientY-z.startPos.y;(ne===z.maskDom||ne===z.handlerDom||ne===z.contentDom&&L(ne,Q.target,se,xe))&&Q.cancelable&&Q.preventDefault()},z.transitionEnd=function(Q){var ne=Q.target;s(ne,a,z.transitionEnd),ne.style.transition=""},z.onKeyDown=function(Q){if(Q.keyCode===c.a.ESC){var ne=z.props.onClose;Q.stopPropagation(),ne&&ne(Q)}},z.onWrapperTransitionEnd=function(Q){var ne=z.props,se=ne.open,xe=ne.afterVisibleChange;Q.target===z.contentWrapper&&Q.propertyName.match(/transform$/)&&(z.dom.style.transition="",!se&&z.getCurrentDrawerSome()&&(document.body.style.overflowX="",z.maskDom&&(z.maskDom.style.left="",z.maskDom.style.width="")),xe&&xe(!!se))},z.openLevelTransition=function(){var Q=z.props,ne=Q.open,se=Q.width,xe=Q.height,me=z.getHorizontalBoolAndPlacementName(),ve=me.isHorizontal,Oe=me.placementName,Re=z.contentDom?z.contentDom.getBoundingClientRect()[ve?"width":"height"]:0,fe=(ve?se:xe)||Re;z.setLevelAndScrolling(ne,Oe,fe)},z.setLevelTransform=function(Q,ne,se,xe){var me=z.props,ve=me.placement,Oe=me.levelMove,Re=me.duration,fe=me.ease,ue=me.showMask;z.levelDom.forEach(function(Pe){Pe.style.transition="transform ".concat(Re," ").concat(fe),r(Pe,a,z.transitionEnd);var et=Q?se:0;if(Oe){var rt=S(Oe,{target:Pe,open:Q});et=Q?rt[0]:rt[1]||0}var tt=typeof et=="number"?"".concat(et,"px"):et,it=ve==="left"||ve==="top"?tt:"-".concat(tt);it=ue&&ve==="right"&&xe?"calc(".concat(it," + ").concat(xe,"px)"):it,Pe.style.transform=et?"".concat(ne,"(").concat(it,")"):""})},z.setLevelAndScrolling=function(Q,ne,se){var xe=z.props.onChange;if(!x){var me=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(h.a)(!0):0;z.setLevelTransform(Q,ne,se,me),z.toggleScrollingToDrawerAndBody(me)}xe&&xe(Q)},z.toggleScrollingToDrawerAndBody=function(Q){var ne=z.props,se=ne.getOpenCount,xe=ne.getContainer,me=ne.showMask,ve=ne.open,Oe=xe&&xe(),Re=se&&se();if(Oe&&Oe.parentNode===document.body&&me){var fe=["touchstart"],ue=[document.body,z.maskDom,z.handlerDom,z.contentDom];ve&&document.body.style.overflow!=="hidden"?(Q&&z.addScrollingEffect(Q),Re===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ue.forEach(function(Pe,et){if(!Pe)return;r(Pe,fe[et]||"touchmove",et?z.removeMoveHandler:z.removeStartHandler,z.passive)})):z.getCurrentDrawerSome()&&(Re||(document.body.style.overflow=""),document.body.style.touchAction="",Q&&z.remScrollingEffect(Q),ue.forEach(function(Pe,et){if(!Pe)return;s(Pe,fe[et]||"touchmove",et?z.removeMoveHandler:z.removeStartHandler,z.passive)}))}},z.addScrollingEffect=function(Q){var ne=z.props,se=ne.placement,xe=ne.duration,me=ne.ease,ve=ne.getOpenCount,Oe=ne.switchScrollingEffect,Re=ve&&ve();Re===1&&Oe();var fe="width ".concat(xe," ").concat(me),ue="transform ".concat(xe," ").concat(me);z.dom.style.transition="none";switch(se){case"right":z.dom.style.transform="translateX(-".concat(Q,"px)");break;case"top":case"bottom":z.dom.style.width="calc(100% - ".concat(Q,"px)"),z.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(ue,",").concat(fe),z.dom.style.width="",z.dom.style.transform="")})},z.remScrollingEffect=function(Q){var ne=z.props,se=ne.placement,xe=ne.duration,me=ne.ease,ve=ne.getOpenCount,Oe=ne.switchScrollingEffect,Re=ve&&ve();Re||Oe(!0),i&&(document.body.style.overflowX="hidden"),z.dom.style.transition="none";var fe,ue="width ".concat(xe," ").concat(me),Pe="transform ".concat(xe," ").concat(me);switch(se){case"left":{z.dom.style.width="100%",ue="width 0s ".concat(me," ").concat(xe);break}case"right":{z.dom.style.transform="translateX(".concat(Q,"px)"),z.dom.style.width="100%",ue="width 0s ".concat(me," ").concat(xe),z.maskDom&&(z.maskDom.style.left="-".concat(Q,"px"),z.maskDom.style.width="calc(100% + ".concat(Q,"px)"));break}case"top":case"bottom":{z.dom.style.width="calc(100% + ".concat(Q,"px)"),z.dom.style.height="100%",z.dom.style.transform="translateZ(0)",fe="height 0s ".concat(me," ").concat(xe);break}default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(Pe,",").concat(fe?"".concat(fe,","):"").concat(ue),z.dom.style.transform="",z.dom.style.width="",z.dom.style.height="")})},z.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(Q){return b[Q]})},z.getLevelDom=function(Q){var ne=Q.level,se=Q.getContainer;if(x)return;var xe=se&&se(),me=xe?xe.parentNode:null;if(z.levelDom=[],ne==="all"){var ve=me?Array.prototype.slice.call(me.children):[];ve.forEach(function(Oe){Oe.nodeName!=="SCRIPT"&&Oe.nodeName!=="STYLE"&&Oe.nodeName!=="LINK"&&Oe!==xe&&z.levelDom.push(Oe)})}else ne&&o(ne).forEach(function(Oe){document.querySelectorAll(Oe).forEach(function(Re){z.levelDom.push(Re)})})},z.getHorizontalBoolAndPlacementName=function(){var Q=z.props.placement,ne=Q==="left"||Q==="right",se="translate".concat(ne?"X":"Y");return{isHorizontal:ne,placementName:se}},z.state={_self:Object(D.a)(z)},z}return Object(P.a)(F,[{key:"componentDidMount",value:function(){var z=this;if(!x){var Q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Q=!0,null}}))}catch(ve){}this.passive=Q?{passive:!1}:!1}var ne=this.props,se=ne.open,xe=ne.getContainer,me=xe&&xe();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),se&&(me&&me.parentNode===document.body&&(b[this.drawerId]=se),this.openLevelTransition(),this.forceUpdate(function(){z.domFocus()}))}},{key:"componentDidUpdate",value:function(z){var Q=this.props,ne=Q.open,se=Q.getContainer,xe=se&&se();ne!==z.open&&(ne&&this.domFocus(),xe&&xe.parentNode===document.body&&(b[this.drawerId]=!!ne),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var z=this.props,Q=z.getOpenCount,ne=z.open,se=z.switchScrollingEffect,xe=typeof Q=="function"&&Q();delete b[this.drawerId],ne&&(this.setLevelTransform(!1),document.body.style.touchAction=""),xe||(document.body.style.overflow="",se(!0))}},{key:"render",value:function(){var z,Q=this,ne=this.props,se=ne.className,xe=ne.children,me=ne.style,ve=ne.width,Oe=ne.height,Re=ne.defaultOpen,fe=ne.open,ue=ne.prefixCls,Pe=ne.placement,et=ne.level,rt=ne.levelMove,tt=ne.ease,it=ne.duration,ze=ne.getContainer,Qe=ne.handler,at=ne.onChange,he=ne.afterVisibleChange,Se=ne.showMask,Le=ne.maskClosable,Me=ne.maskStyle,qe=ne.onClose,st=ne.onHandleClick,mt=ne.keyboard,gt=ne.getOpenCount,St=ne.switchScrollingEffect,Et=Object(Z.a)(ne,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Ae=this.dom?fe:!1,Ce=p()(ue,(z={},Object(n.a)(z,"".concat(ue,"-").concat(Pe),!0),Object(n.a)(z,"".concat(ue,"-open"),Ae),Object(n.a)(z,se||"",!!se),Object(n.a)(z,"no-mask",!Se),z)),Xe=this.getHorizontalBoolAndPlacementName(),Je=Xe.placementName,ke=Pe==="left"||Pe==="top"?"-100%":"100%",Ke=Ae?"":"".concat(Je,"(").concat(ke,")"),ye=Qe&&W.cloneElement(Qe,{onClick:function(pe){Qe.props.onClick&&Qe.props.onClick(),st&&st(pe)},ref:function(pe){Q.handlerDom=pe}});return W.createElement("div",Object.assign({},Et,{tabIndex:-1,className:Ce,style:me,ref:function(pe){Q.dom=pe},onKeyDown:Ae&&mt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Se&&W.createElement("div",{className:"".concat(ue,"-mask"),onClick:Le?qe:void 0,style:Me,ref:function(pe){Q.maskDom=pe}}),W.createElement("div",{className:"".concat(ue,"-content-wrapper"),style:{transform:Ke,msTransform:Ke,width:w(ve)?"".concat(ve,"px"):ve,height:w(Oe)?"".concat(Oe,"px"):Oe},ref:function(pe){Q.contentWrapper=pe}},W.createElement("div",{className:"".concat(ue,"-content"),ref:function(pe){Q.contentDom=pe},onTouchStart:Ae&&Se?this.removeStartHandler:void 0,onTouchMove:Ae&&Se?this.removeMoveHandler:void 0},xe),ye))}}],[{key:"getDerivedStateFromProps",value:function(z,Q){var ne=Q.prevProps,se=Q._self,xe={prevProps:z};if(ne!==void 0){var me=z.placement,ve=z.level;me!==ne.placement&&(se.contentDom=null),ve!==ne.level&&se.getLevelDom(z)}return xe}}]),F}(W.Component);g.defaultProps={switchScrollingEffect:function(){}};var f=g;function C(A){var H=E();return function(){var T=Object(M.a)(A),z;if(H){var Q=Object(M.a)(this).constructor;z=Reflect.construct(T,arguments,Q)}else z=T.apply(this,arguments);return Object(j.a)(this,z)}}function E(){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(A){return!1}}var v=function(A){Object(V.a)(F,A);var H=C(F);function F(T){var z;Object(X.a)(this,F),z=H.call(this,T),z.onHandleClick=function(ne){var se=z.props,xe=se.onHandleClick,me=se.open;if(xe&&xe(ne),typeof me=="undefined"){var ve=z.state.open;z.setState({open:!ve})}},z.onClose=function(ne){var se=z.props,xe=se.onClose,me=se.open;xe&&xe(ne),typeof me=="undefined"&&z.setState({open:!1})};var Q=typeof T.open!="undefined"?T.open:!!T.defaultOpen;return z.state={open:Q},"onMaskClick"in T&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),z}return Object(P.a)(F,[{key:"render",value:function(){var z=this,Q=this.props,ne=Q.defaultOpen,se=Q.getContainer,xe=Q.wrapperClassName,me=Q.forceRender,ve=Q.handler,Oe=Object(Z.a)(Q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Re=this.state.open;if(!se)return W.createElement("div",{className:xe,ref:function(Pe){z.dom=Pe}},W.createElement(f,Object.assign({},Oe,{open:Re,handler:ve,getContainer:function(){return z.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var fe=!!ve||me;return W.createElement(G.a,{visible:Re,forceRender:fe,getContainer:se,wrapperClassName:xe},function(ue){var Pe=ue.visible,et=ue.afterClose,rt=Object(Z.a)(ue,["visible","afterClose"]);return W.createElement(f,Object.assign({},Oe,rt,{open:Pe!==void 0?Pe:Re,afterVisibleChange:et!==void 0?et:Oe.afterVisibleChange,handler:ve,onClose:z.onClose,onHandleClick:z.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(z,Q){var ne=Q.prevProps,se={prevProps:z};return typeof ne!="undefined"&&z.open!==ne.open&&(se.open=z.open),se}}]),F}(W.Component);v.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:W.createElement("div",{className:"drawer-handle"},W.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var N=v,U=oe.a=N},fcyK:function(Fe,oe,k){},fjLI:function(Fe,oe,k){"use strict";k.d(oe,"f",function(){return h}),k.d(oe,"b",function(){return c}),k.d(oe,"a",function(){return o}),k.d(oe,"d",function(){return d}),k.d(oe,"e",function(){return i}),k.d(oe,"c",function(){return a});var Z=k("8HAY"),X=k("Vhoy"),P=k("MI8n"),V=k("JYp7"),j=k("pmY6"),M=k("24hK"),G=k("nnTU"),W=k("T8No"),n=k("Cg/j"),D=k("t9D7"),m=function(r,s,S,w){var x=arguments.length,L=x<3?s:w===null?w=Object.getOwnPropertyDescriptor(s,S):w,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(r,s,S,w);else for(var _=r.length-1;_>=0;_--)(O=r[_])&&(L=(x<3?O(L):x>3?O(s,S,L):O(s,S))||L);return x>3&&L&&Object.defineProperty(s,S,L),L},p=function(r,s){return function(S,w){s(S,w,r)}};function h(r){return r.command!==void 0}class c{constructor(r){this.id=c._idPool++,this._debugName=r}}c._idPool=0,c.CommandPalette=new c("CommandPalette"),c.EditorContext=new c("EditorContext"),c.SimpleEditorContext=new c("SimpleEditorContext"),c.EditorContextCopy=new c("EditorContextCopy"),c.EditorContextPeek=new c("EditorContextPeek"),c.MenubarEditMenu=new c("MenubarEditMenu"),c.MenubarCopy=new c("MenubarCopy"),c.MenubarGoMenu=new c("MenubarGoMenu"),c.MenubarSelectionMenu=new c("MenubarSelectionMenu"),c.InlineCompletionsActions=new c("InlineCompletionsActions");const o=Object(n.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:r=>r===c.CommandPalette}}addCommand(r){return this.addCommands(V.a.single(r))}addCommands(r){for(const s of r)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(j.i)(()=>{let s=!1;for(const S of r)s=this._commands.delete(S.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(r){return this._commands.get(r)}getCommands(){const r=new Map;return this._commands.forEach((s,S)=>r.set(S,s)),r}appendMenuItem(r,s){return this.appendMenuItems(V.a.single({id:r,item:s}))}appendMenuItems(r){const s=new Set,S=new M.a;for(const{id:w,item:x}of r){let L=this._menuItems.get(w);L||(L=new M.a,this._menuItems.set(w,L)),S.push(L.push(x)),s.add(w)}return this._onDidChangeMenu.fire(s),Object(j.i)(()=>{if(S.size>0){for(let w of S)w();this._onDidChangeMenu.fire(s),S.clear()}})}getMenuItems(r){let s;return this._menuItems.has(r)?s=[...this._menuItems.get(r)]:s=[],r===c.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(r){const s=new Set;for(const S of r)h(S)&&(s.add(S.command.id),S.alt&&s.add(S.alt.id));this._commands.forEach((S,w)=>{s.has(w)||r.push({command:S})})}};class i extends Z.e{constructor(r,s,S,w){super(`submenuitem.${r.submenu.id}`,typeof r.title=="string"?r.title:r.title.value,[],"submenu");this.item=r,this._menuService=s,this._contextKeyService=S,this._options=w}get actions(){const r=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),S=s.getActions(this._options);s.dispose();for(const[,w]of S)w.length>0&&(r.push(...w),r.push(new Z.d));return r.length&&r.pop(),r}}let a=class r{constructor(s,S,w,x,L){var O,_;if(this._commandService=L,this.id=s.id,this.label=(w==null?void 0:w.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(_=typeof s.tooltip=="string"?s.tooltip:(O=s.tooltip)===null||O===void 0?void 0:O.value)!==null&&_!==void 0?_:"",this.enabled=!s.precondition||x.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const b=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=x.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=s,this.alt=S?new r(S,void 0,w,x,L):void 0,this._options=w,D.d.isThemeIcon(s.icon)&&(this.class=X.a.asClassName(s.icon))}dispose(){}run(...s){var S,w;let x=[];return((S=this._options)===null||S===void 0?void 0:S.arg)&&(x=[...x,this._options.arg]),((w=this._options)===null||w===void 0?void 0:w.shouldForwardArgs)&&(x=[...x,...s]),this._commandService.executeCommand(this.id,...x)}};a=m([p(3,W.b),p(4,G.b)],a)},fyJ8:function(Fe,oe,k){"use strict";var Z=k("rePB"),X=k("VTBJ"),P=k("Ff2n"),V=k("U8pU"),j=k("q1tI"),M=k.n(j),G=k("TSYQ"),W=k.n(G),n=k("c+Xe"),D=k("sR1s");function m(d){return d&&Object(V.a)(d)==="object"&&!Array.isArray(d)&&!j.isValidElement(d)}function p(d){return typeof d=="string"?!0:Object(n.c)(d)}function h(d,i){var a,r=d.prefixCls,s=d.className,S=d.record,w=d.index,x=d.dataIndex,L=d.render,O=d.children,_=d.component,b=_===void 0?"td":_,g=d.colSpan,f=d.rowSpan,C=d.fixLeft,E=d.fixRight,v=d.firstFixLeft,N=d.lastFixLeft,U=d.firstFixRight,A=d.lastFixRight,H=d.appendNode,F=d.additionalProps,T=F===void 0?{}:F,z=d.ellipsis,Q=d.align,ne=d.rowType,se=d.isSticky,xe="".concat(r,"-cell"),me,ve;if(O)ve=O;else{var Oe=Object(D.b)(S,x);if(ve=Oe,L){var Re=L(Oe,S,w);m(Re)?(ve=Re.children,me=Re.props):ve=Re}}Object(V.a)(ve)==="object"&&!Array.isArray(ve)&&!j.isValidElement(ve)&&(ve=null),z&&(N||U)&&(ve=j.createElement("span",{className:"".concat(xe,"-content")},ve));var fe=me||{},ue=fe.colSpan,Pe=fe.rowSpan,et=fe.style,rt=fe.className,tt=Object(P.a)(fe,["colSpan","rowSpan","style","className"]),it=ue!==void 0?ue:g,ze=Pe!==void 0?Pe:f;if(it===0||ze===0)return null;var Qe={},at=typeof C=="number",he=typeof E=="number";at&&(Qe.position="sticky",Qe.left=C),he&&(Qe.position="sticky",Qe.right=E);var Se={};Q&&(Se.textAlign=Q);var Le,Me=z===!0?{showTitle:!0}:z;Me&&(Me.showTitle||ne==="header")&&(typeof ve=="string"||typeof ve=="number"?Le=ve.toString():j.isValidElement(ve)&&typeof ve.props.children=="string"&&(Le=ve.props.children));var qe=Object(X.a)(Object(X.a)(Object(X.a)({title:Le},tt),T),{},{colSpan:it&&it!==1?it:null,rowSpan:ze&&ze!==1?ze:null,className:W()(xe,s,(a={},Object(Z.a)(a,"".concat(xe,"-fix-left"),at),Object(Z.a)(a,"".concat(xe,"-fix-left-first"),v),Object(Z.a)(a,"".concat(xe,"-fix-left-last"),N),Object(Z.a)(a,"".concat(xe,"-fix-right"),he),Object(Z.a)(a,"".concat(xe,"-fix-right-first"),U),Object(Z.a)(a,"".concat(xe,"-fix-right-last"),A),Object(Z.a)(a,"".concat(xe,"-ellipsis"),z),Object(Z.a)(a,"".concat(xe,"-with-append"),H),Object(Z.a)(a,"".concat(xe,"-fix-sticky"),(at||he)&&se),a),T.className,rt),style:Object(X.a)(Object(X.a)(Object(X.a)(Object(X.a)({},T.style),Se),Qe),et),ref:p(b)?i:null});return j.createElement(b,Object.assign({},qe),H,ve)}var c=j.forwardRef(h);c.displayName="Cell";var o=j.memo(c,function(d,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,d.record):!1});oe.a=o},gRFJ:function(Fe,oe,k){Fe.exports=[k("rdUC"),k("ynwM"),k("RELg"),k("DlR+"),k("CrYA"),k("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(Fe){return Fe<10?"0"+Fe:Fe}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(Fe){return rx_escapable.lastIndex=0,rx_escapable.test(Fe)?'"'+Fe.replace(rx_escapable,function(oe){var k=meta[oe];return typeof k=="string"?k:"\\u"+("0000"+oe.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Fe+'"'}function str(Fe,oe){var k,Z,X,P,V=gap,j,M=oe[Fe];M&&typeof M=="object"&&typeof M.toJSON=="function"&&(M=M.toJSON(Fe)),typeof rep=="function"&&(M=rep.call(oe,Fe,M));switch(typeof M){case"string":return quote(M);case"number":return isFinite(M)?String(M):"null";case"boolean":case"null":return String(M);case"object":if(!M)return"null";if(gap+=indent,j=[],Object.prototype.toString.apply(M)==="[object Array]"){for(P=M.length,k=0;k<P;k+=1)j[k]=str(k,M)||"null";return X=j.length===0?"[]":gap?`[
`+gap+j.join(`,
`+gap)+`
`+V+"]":"["+j.join(",")+"]",gap=V,X}if(rep&&typeof rep=="object")for(P=rep.length,k=0;k<P;k+=1)typeof rep[k]=="string"&&(Z=rep[k],X=str(Z,M),X&&j.push(quote(Z)+(gap?": ":":")+X));else for(Z in M)Object.prototype.hasOwnProperty.call(M,Z)&&(X=str(Z,M),X&&j.push(quote(Z)+(gap?": ":":")+X));return X=j.length===0?"{}":gap?`{
`+gap+j.join(`,
`+gap)+`
`+V+"}":"{"+j.join(",")+"}",gap=V,X}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(Fe,oe,k){var Z;if(gap="",indent="",typeof k=="number")for(Z=0;Z<k;Z+=1)indent+=" ";else typeof k=="string"&&(indent=k);if(rep=oe,oe&&typeof oe!="function"&&(typeof oe!="object"||typeof oe.length!="number"))throw new Error("JSON.stringify");return str("",{"":Fe})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(Fe,oe){var k,Z,X=Fe[oe];if(X&&typeof X=="object")for(k in X)Object.prototype.hasOwnProperty.call(X,k)&&(Z=walk(X,k),Z!==void 0?X[k]=Z:delete X[k]);return reviver.call(Fe,oe,X)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(Fe){return"\\u"+("0000"+Fe.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},hW8S:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return V}),k.d(oe,"c",function(){return j}),k.d(oe,"b",function(){return M});var Z=k("VTBJ"),X=k("Ff2n"),P=k("Kwbf"),V="RC_TABLE_INTERNAL_COL_DEFINE";function j(G){var W=G.expandable,n=Object(X.a)(G,["expandable"]);return"expandable"in G?Object(Z.a)(Object(Z.a)({},n),W):n}function M(G){return Object.keys(G).reduce(function(W,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(W[n]=G[n]),W},{})}},i3hx:function(Fe,oe,k){},ic2d:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return V});var Z=k("FWmy"),X=k("746U");class P{constructor(){this.data=new Map}add(j,M){Z.a(X.l(j)),Z.a(X.k(M)),Z.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,M)}as(j){return this.data.get(j)||null}}const V=new P},je13:function(Fe,oe,k){var Z=k("5nXd"),X=k("gRFJ"),P=[k("uQRt")];Fe.exports=Z.createStore(X,P)},kSUc:function(Fe,oe,k){},"kaH+":function(Fe,oe,k){"use strict";var Z=k("+L6B"),X=k("2/Rp"),P=k("tJVT"),V=k("q1tI"),j=k.n(V),M=k("UZu5"),G=k.n(M),W=k("dhSg"),n=k("rLCj"),D=k("dF/Y"),m=k("4i/N");oe.a=function(){var p=Object(V.useState)(""),h=Object(P.a)(p,2),c=h[0],o=h[1],d=Object(V.useState)(0),i=Object(P.a)(d,2),a=i[0],r=i[1],s=Object(V.useRef)("");Object(V.useEffect)(function(){var b=W.a.subscribe("preview-image",function(g){o(g),document.body.style.overflow="hidden"});return b},[]),Object(V.useEffect)(function(){return document.addEventListener("keydown",S),function(){document.removeEventListener("keydown",S)}},[]),Object(V.useEffect)(function(){s.current=c},[c]);function S(b){b.keyCode==27&&s.current&&w()}function w(){document.body.style.overflow="auto",o("")}function x(){r(a+90)}var L=Object(V.useRef)(),O=Object(V.useRef)(),_=function(g){(g.nativeEvent.target===L.current||g.nativeEvent.target===O.current)&&w()};return j.a.createElement(V.Fragment,null,c?j.a.createElement("div",{className:"image-preview-container",ref:L,onClick:_},j.a.createElement("div",{className:"button-group"},j.a.createElement(X.a,{onClick:x},"\u65CB\u8F6C",j.a.createElement(n.a,null)),j.a.createElement(X.a,{href:c},"\u4E0B\u8F7D",j.a.createElement(D.a,null)),j.a.createElement(X.a,{onClick:w},"\u5173\u95ED",j.a.createElement(m.a,null))),j.a.createElement("div",{className:"preview-wrp-group",ref:O},j.a.createElement("img",{className:"image-preview",src:c,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(a,"deg)")}}))):null)}},lOMy:function(Fe,oe,k){},lZu9:function(Fe,oe,k){(function(Z){Z(k("VrN/"),k("1eCo"),k("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(X,P){var V=Z.getMode(X,"text/html"),j=V.name=="null";function M(F){if(Z.findModeByName){var T=Z.findModeByName(F);T&&(F=T.mime||T.mimes[0])}var z=Z.getMode(X,F);return z.name=="null"?null:z}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 G={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 W in G)G.hasOwnProperty(W)&&P.tokenTypeOverrides[W]&&(G[W]=P.tokenTypeOverrides[W]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,m=/^\[(x| )\](?=\s)/i,p=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,a=" ";function r(F,T,z){return T.f=T.inline=z,z(F,T)}function s(F,T,z){return T.f=T.block=z,z(F,T)}function S(F){return!F||!/\S/.test(F.string)}function w(F){if(F.linkTitle=!1,F.linkHref=!1,F.linkText=!1,F.em=!1,F.strong=!1,F.strikethrough=!1,F.quote=0,F.indentedCode=!1,F.f==L){var T=j;if(!T){var z=Z.innerMode(V,F.htmlState);T=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}T&&(F.f=g,F.block=x,F.htmlState=null)}return F.trailingSpace=0,F.trailingSpaceNewLine=!1,F.prevLine=F.thisLine,F.thisLine={stream:null},null}function x(F,T){var z=F.column()===T.indentation,Q=S(T.prevLine.stream),ne=T.indentedCode,se=T.prevLine.hr,xe=T.list!==!1,me=(T.listStack[T.listStack.length-1]||0)+3;T.indentedCode=!1;var ve=T.indentation;if(T.indentationDiff===null&&(T.indentationDiff=T.indentation,xe)){for(T.list=null;ve<T.listStack[T.listStack.length-1];)T.listStack.pop(),T.listStack.length?T.indentation=T.listStack[T.listStack.length-1]:T.list=!1;T.list!==!1&&(T.indentationDiff=ve-T.listStack[T.listStack.length-1])}var Oe=!Q&&!se&&!T.prevLine.header&&(!xe||!ne)&&!T.prevLine.fencedCodeEnd,Re=(T.list===!1||se||Q)&&T.indentation<=me&&F.match(n),fe=null;if(T.indentationDiff>=4&&(ne||T.prevLine.fencedCodeEnd||T.prevLine.header||Q))return F.skipToEnd(),T.indentedCode=!0,G.code;if(F.eatSpace())return null;if(z&&T.indentation<=me&&(fe=F.match(p))&&fe[1].length<=6)return T.quote=0,T.header=fe[1].length,T.thisLine.header=!0,P.highlightFormatting&&(T.formatting="header"),T.f=T.inline,_(T);if(T.indentation<=me&&F.eat(">"))return T.quote=z?1:T.quote+1,P.highlightFormatting&&(T.formatting="quote"),F.eatSpace(),_(T);if(!Re&&!T.setext&&z&&T.indentation<=me&&(fe=F.match(D))){var ue=fe[1]?"ol":"ul";return T.indentation=ve+F.current().length,T.list=!0,T.quote=0,T.listStack.push(T.indentation),T.em=!1,T.strong=!1,T.code=!1,T.strikethrough=!1,P.taskLists&&F.match(m,!1)&&(T.taskList=!0),T.f=T.inline,P.highlightFormatting&&(T.formatting=["list","list-"+ue]),_(T)}else{if(z&&T.indentation<=me&&(fe=F.match(o,!0)))return T.quote=0,T.fencedEndRE=new RegExp(fe[1]+"+ *$"),T.localMode=P.fencedCodeBlockHighlighting&&M(fe[2]||P.fencedCodeBlockDefaultMode),T.localMode&&(T.localState=Z.startState(T.localMode)),T.f=T.block=O,P.highlightFormatting&&(T.formatting="code-block"),T.code=-1,_(T);if(T.setext||(!Oe||!xe)&&!T.quote&&T.list===!1&&!T.code&&!Re&&!d.test(F.string)&&(fe=F.lookAhead(1))&&(fe=fe.match(h)))return T.setext?(T.header=T.setext,T.setext=0,F.skipToEnd(),P.highlightFormatting&&(T.formatting="header")):(T.header=fe[0].charAt(0)=="="?1:2,T.setext=T.header),T.thisLine.header=!0,T.f=T.inline,_(T);if(Re)return F.skipToEnd(),T.hr=!0,T.thisLine.hr=!0,G.hr;if(F.peek()==="[")return r(F,T,N)}return r(F,T,T.inline)}function L(F,T){var z=V.token(F,T.htmlState);if(!j){var Q=Z.innerMode(V,T.htmlState);(Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText||T.md_inside&&F.current().indexOf(">")>-1)&&(T.f=g,T.block=x,T.htmlState=null)}return z}function O(F,T){var z=T.listStack[T.listStack.length-1]||0,Q=T.indentation<z,ne=z+3;if(T.fencedEndRE&&T.indentation<=ne&&(Q||F.match(T.fencedEndRE))){P.highlightFormatting&&(T.formatting="code-block");var se;return Q||(se=_(T)),T.localMode=T.localState=null,T.block=x,T.f=g,T.fencedEndRE=null,T.code=0,T.thisLine.fencedCodeEnd=!0,Q?s(F,T,T.block):se}else return T.localMode?T.localMode.token(F,T.localState):(F.skipToEnd(),G.code)}function _(F){var T=[];if(F.formatting){T.push(G.formatting),typeof F.formatting=="string"&&(F.formatting=[F.formatting]);for(var z=0;z<F.formatting.length;z++)T.push(G.formatting+"-"+F.formatting[z]),F.formatting[z]==="header"&&T.push(G.formatting+"-"+F.formatting[z]+"-"+F.header),F.formatting[z]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=F.quote?T.push(G.formatting+"-"+F.formatting[z]+"-"+F.quote):T.push("error"))}if(F.taskOpen)return T.push("meta"),T.length?T.join(" "):null;if(F.taskClosed)return T.push("property"),T.length?T.join(" "):null;if(F.linkHref?T.push(G.linkHref,"url"):(F.strong&&T.push(G.strong),F.em&&T.push(G.em),F.strikethrough&&T.push(G.strikethrough),F.emoji&&T.push(G.emoji),F.linkText&&T.push(G.linkText),F.code&&T.push(G.code),F.image&&T.push(G.image),F.imageAltText&&T.push(G.imageAltText,"link"),F.imageMarker&&T.push(G.imageMarker)),F.header&&T.push(G.header,G.header+"-"+F.header),F.quote&&(T.push(G.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=F.quote?T.push(G.quote+"-"+F.quote):T.push(G.quote+"-"+P.maxBlockquoteDepth)),F.list!==!1){var Q=(F.listStack.length-1)%3;Q?Q===1?T.push(G.list2):T.push(G.list3):T.push(G.list1)}return F.trailingSpaceNewLine?T.push("trailing-space-new-line"):F.trailingSpace&&T.push("trailing-space-"+(F.trailingSpace%2?"a":"b")),T.length?T.join(" "):null}function b(F,T){return F.match(c,!0)?_(T):void 0}function g(F,T){var z=T.text(F,T);if(typeof z!="undefined")return z;if(T.list)return T.list=null,_(T);if(T.taskList){var Q=F.match(m,!0)[1]===" ";return Q?T.taskOpen=!0:T.taskClosed=!0,P.highlightFormatting&&(T.formatting="task"),T.taskList=!1,_(T)}if(T.taskOpen=!1,T.taskClosed=!1,T.header&&F.match(/^#+$/,!0))return P.highlightFormatting&&(T.formatting="header"),_(T);var ne=F.next();if(T.linkTitle){T.linkTitle=!1;var se=ne;ne==="("&&(se=")"),se=(se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var xe="^\\s*(?:[^"+se+"\\\\]+|\\\\\\\\|\\\\.)"+se;if(F.match(new RegExp(xe),!0))return G.linkHref}if(ne==="`"){var me=T.formatting;P.highlightFormatting&&(T.formatting="code"),F.eatWhile("`");var ve=F.current().length;if(T.code==0&&(!T.quote||ve==1))return T.code=ve,_(T);if(ve==T.code){var Oe=_(T);return T.code=0,Oe}else return T.formatting=me,_(T)}else if(T.code)return _(T);if(ne==="\\"&&(F.next(),P.highlightFormatting)){var Re=_(T),fe=G.formatting+"-escape";return Re?Re+" "+fe:fe}if(ne==="!"&&F.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return T.imageMarker=!0,T.image=!0,P.highlightFormatting&&(T.formatting="image"),_(T);if(ne==="["&&T.imageMarker&&F.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return T.imageMarker=!1,T.imageAltText=!0,P.highlightFormatting&&(T.formatting="image"),_(T);if(ne==="]"&&T.imageAltText){P.highlightFormatting&&(T.formatting="image");var Re=_(T);return T.imageAltText=!1,T.image=!1,T.inline=T.f=C,Re}if(ne==="["&&!T.image)return T.linkText&&F.match(/^.*?\]/)||(T.linkText=!0,P.highlightFormatting&&(T.formatting="link")),_(T);if(ne==="]"&&T.linkText){P.highlightFormatting&&(T.formatting="link");var Re=_(T);return T.linkText=!1,T.inline=T.f=F.match(/\(.*?\)| ?\[.*?\]/,!1)?C:g,Re}if(ne==="<"&&F.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){T.f=T.inline=f,P.highlightFormatting&&(T.formatting="link");var Re=_(T);return Re?Re+=" ":Re="",Re+G.linkInline}if(ne==="<"&&F.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){T.f=T.inline=f,P.highlightFormatting&&(T.formatting="link");var Re=_(T);return Re?Re+=" ":Re="",Re+G.linkEmail}if(P.xml&&ne==="<"&&F.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=F.string.indexOf(">",F.pos);if(ue!=-1){var Pe=F.string.substring(F.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Pe)&&(T.md_inside=!0)}return F.backUp(1),T.htmlState=Z.startState(V),s(F,T,L)}if(P.xml&&ne==="<"&&F.match(/^\/\w*?>/))return T.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var et=1,rt=F.pos==1?" ":F.string.charAt(F.pos-2);et<3&&F.eat(ne);)et++;var tt=F.peek()||" ",it=!/\s/.test(tt)&&(!i.test(tt)||/\s/.test(rt)||i.test(rt)),ze=!/\s/.test(rt)&&(!i.test(rt)||/\s/.test(tt)||i.test(tt)),Qe=null,at=null;if(et%2&&(!T.em&&it&&(ne==="*"||!ze||i.test(rt))?Qe=!0:T.em==ne&&ze&&(ne==="*"||!it||i.test(tt))&&(Qe=!1)),et>1&&(!T.strong&&it&&(ne==="*"||!ze||i.test(rt))?at=!0:T.strong==ne&&ze&&(ne==="*"||!it||i.test(tt))&&(at=!1)),at!=null||Qe!=null){P.highlightFormatting&&(T.formatting=Qe==null?"strong":at==null?"em":"strong em"),Qe===!0&&(T.em=ne),at===!0&&(T.strong=ne);var Oe=_(T);return Qe===!1&&(T.em=!1),at===!1&&(T.strong=!1),Oe}}else if(ne===" "&&(F.eat("*")||F.eat("_"))){if(F.peek()===" ")return _(T);F.backUp(1)}if(P.strikethrough){if(ne==="~"&&F.eatWhile(ne)){if(T.strikethrough){P.highlightFormatting&&(T.formatting="strikethrough");var Oe=_(T);return T.strikethrough=!1,Oe}else if(F.match(/^[^\s]/,!1))return T.strikethrough=!0,P.highlightFormatting&&(T.formatting="strikethrough"),_(T)}else if(ne===" "&&F.match(/^~~/,!0)){if(F.peek()===" ")return _(T);F.backUp(2)}}if(P.emoji&&ne===":"&&F.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){T.emoji=!0,P.highlightFormatting&&(T.formatting="emoji");var he=_(T);return T.emoji=!1,he}return ne===" "&&(F.match(/^ +$/,!1)?T.trailingSpace++:T.trailingSpace&&(T.trailingSpaceNewLine=!0)),_(T)}function f(F,T){var z=F.next();if(z===">"){T.f=T.inline=g,P.highlightFormatting&&(T.formatting="link");var Q=_(T);return Q?Q+=" ":Q="",Q+G.linkInline}return F.match(/^[^>]+/,!0),G.linkInline}function C(F,T){if(F.eatSpace())return null;var z=F.next();return z==="("||z==="["?(T.f=T.inline=v(z==="("?")":"]"),P.highlightFormatting&&(T.formatting="link-string"),T.linkHref=!0,_(T)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function v(F){return function(T,z){var Q=T.next();if(Q===F){z.f=z.inline=g,P.highlightFormatting&&(z.formatting="link-string");var ne=_(z);return z.linkHref=!1,ne}return T.match(E[F]),z.linkHref=!0,_(z)}}function N(F,T){return F.match(/^([^\]\\]|\\.)*\]:/,!1)?(T.f=U,F.next(),P.highlightFormatting&&(T.formatting="link"),T.linkText=!0,_(T)):r(F,T,g)}function U(F,T){if(F.match(/^\]:/,!0)){T.f=T.inline=A,P.highlightFormatting&&(T.formatting="link");var z=_(T);return T.linkText=!1,z}return F.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function A(F,T){return F.eatSpace()?null:(F.match(/^[^\s]+/,!0),F.peek()===void 0?T.linkTitle=!0:F.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),T.f=T.inline=g,G.linkHref+" url")}var H={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:g,text:b,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(F){return{f:F.f,prevLine:F.prevLine,thisLine:F.thisLine,block:F.block,htmlState:F.htmlState&&Z.copyState(V,F.htmlState),indentation:F.indentation,localMode:F.localMode,localState:F.localMode?Z.copyState(F.localMode,F.localState):null,inline:F.inline,text:F.text,formatting:!1,linkText:F.linkText,linkTitle:F.linkTitle,linkHref:F.linkHref,code:F.code,em:F.em,strong:F.strong,strikethrough:F.strikethrough,emoji:F.emoji,header:F.header,setext:F.setext,hr:F.hr,taskList:F.taskList,list:F.list,listStack:F.listStack.slice(0),quote:F.quote,indentedCode:F.indentedCode,trailingSpace:F.trailingSpace,trailingSpaceNewLine:F.trailingSpaceNewLine,md_inside:F.md_inside,fencedEndRE:F.fencedEndRE}},token:function(F,T){if(T.formatting=!1,F!=T.thisLine.stream){if(T.header=0,T.hr=!1,F.match(/^\s*$/,!0))return w(T),null;if(T.prevLine=T.thisLine,T.thisLine={stream:F},T.taskList=!1,T.trailingSpace=0,T.trailingSpaceNewLine=!1,!T.localState&&(T.f=T.block,T.f!=L)){var z=F.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(T.indentation=z,T.indentationDiff=null,z>0)return null}}return T.f(F,T)},innerMode:function(F){return F.block==L?{state:F.htmlState,mode:V}:F.localState?{state:F.localState,mode:F.localMode}:{state:F,mode:H}},indent:function(F,T,z){return F.block==L&&V.indent?V.indent(F.htmlState,T,z):F.localState&&F.localMode.indent?F.localMode.indent(F.localState,T,z):Z.Pass},blankLine:w,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return W});var Z=k("q1tI"),X=k("biw7"),P=k("fyJ8");function V(n){var D=n.className,m=n.index,p=n.children,h=n.colSpan,c=n.rowSpan,o=Z.useContext(X.a),d=o.prefixCls,i=o.fixedInfoList,a=i[m];return Z.createElement(P.a,Object.assign({className:D,index:m,component:"td",prefixCls:d,record:null,dataIndex:null,render:function(){return{children:p,props:{colSpan:h,rowSpan:c}}}},a))}function j(n){return Z.createElement("tr",Object.assign({},n))}function M(n){var D=n.children,m=Z.useContext(X.a),p=m.prefixCls;return Z.createElement("tfoot",{className:"".concat(p,"-summary")},D)}var G=oe.b=M,W={Cell:V,Row:j}},nEHx:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return Z});var Z;(function(X){X.DARK="dark",X.LIGHT="light",X.HIGH_CONTRAST="hc"})(Z||(Z={}))},nWbc:function(Fe,oe,k){},nnTU:function(Fe,oe,k){"use strict";k.d(oe,"b",function(){return G}),k.d(oe,"a",function(){return W});var Z=k("MI8n"),X=k("JYp7"),P=k("pmY6"),V=k("24hK"),j=k("746U"),M=k("Cg/j");const G=Object(M.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Z.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,D){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:n,handler:D})}if(n.description){const o=[];for(let i of n.description.args)o.push(i.constraint);const d=n.handler;n.handler=function(i,...a){return Object(j.o)(a,o),d(i,...a)}}const{id:m}=n;let p=this._commands.get(m);p||(p=new V.a,this._commands.set(m,p));let h=p.unshift(n),c=Object(P.i)(()=>{h();const o=this._commands.get(m);(o==null?void 0:o.isEmpty())&&this._commands.delete(m)});return this._onDidRegisterCommand.fire(m),c}registerCommandAlias(n,D){return W.registerCommand(n,(m,...p)=>m.get(G).executeCommand(D,...p))}getCommand(n){const D=this._commands.get(n);return!D||D.isEmpty()?void 0:X.a.first(D)}getCommands(){const n=new Map;for(const D of this._commands.keys()){const m=this.getCommand(D);m&&n.set(D,m)}return n}};W.registerCommand("noop",()=>{})},oFv4:function(Fe,oe,k){Fe.exports=k.p+"static/internal.da228387.png"},osHv:function(Fe,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){"use strict";var X=Z.Pos;function P(i,a){return i.line-a.line||i.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",j=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+V+"]["+j+"]*)","g");function G(i,a,r,s){this.line=a,this.ch=r,this.cm=i,this.text=i.getLine(a),this.min=s?Math.max(s.from,i.firstLine()):i.firstLine(),this.max=s?Math.min(s.to-1,i.lastLine()):i.lastLine()}function W(i,a){var r=i.cm.getTokenTypeAt(X(i.line,a));return r&&/\btag\b/.test(r)}function n(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function D(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function m(i){for(;;){var a=i.text.indexOf(">",i.ch);if(a==-1){if(n(i))continue;return}if(!W(i,a+1)){i.ch=a+1;continue}var r=i.text.lastIndexOf("/",a),s=r>-1&&!/\S/.test(i.text.slice(r+1,a));return i.ch=a+1,s?"selfClose":"regular"}}function p(i){for(;;){var a=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(a==-1){if(D(i))continue;return}if(!W(i,a+1)){i.ch=a;continue}M.lastIndex=a,i.ch=a;var r=M.exec(i.text);if(r&&r.index==a)return r}}function h(i){for(;;){M.lastIndex=i.ch;var a=M.exec(i.text);if(!a){if(n(i))continue;return}if(!W(i,a.index+1)){i.ch=a.index+1;continue}return i.ch=a.index+a[0].length,a}}function c(i){for(;;){var a=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(a==-1){if(D(i))continue;return}if(!W(i,a+1)){i.ch=a;continue}var r=i.text.lastIndexOf("/",a),s=r>-1&&!/\S/.test(i.text.slice(r+1,a));return i.ch=a+1,s?"selfClose":"regular"}}function o(i,a){for(var r=[];;){var s=h(i),S,w=i.line,x=i.ch-(s?s[0].length:0);if(!s||!(S=m(i)))return;if(S=="selfClose")continue;if(s[1]){for(var L=r.length-1;L>=0;--L)if(r[L]==s[2]){r.length=L;break}if(L<0&&(!a||a==s[2]))return{tag:s[2],from:X(w,x),to:X(i.line,i.ch)}}else r.push(s[2])}}function d(i,a){for(var r=[];;){var s=c(i);if(!s)return;if(s=="selfClose"){p(i);continue}var S=i.line,w=i.ch,x=p(i);if(!x)return;if(x[1])r.push(x[2]);else{for(var L=r.length-1;L>=0;--L)if(r[L]==x[2]){r.length=L;break}if(L<0&&(!a||a==x[2]))return{tag:x[2],from:X(i.line,i.ch),to:X(S,w)}}}}Z.registerHelper("fold","xml",function(i,a){for(var r=new G(i,a.line,0);;){var s=h(r);if(!s||r.line!=a.line)return;var S=m(r);if(!S)return;if(!s[1]&&S!="selfClose"){var w=X(r.line,r.ch),x=o(r,s[2]);return x&&P(x.from,w)>0?{from:w,to:x.from}:null}}}),Z.findMatchingTag=function(i,a,r){var s=new G(i,a.line,a.ch,r);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var S=m(s),w=S&&X(s.line,s.ch),x=S&&p(s);if(!S||!x||P(s,a)>0)return;var L={from:X(s.line,s.ch),to:w,tag:x[2]};return S=="selfClose"?{open:L,close:null,at:"open"}:x[1]?{open:d(s,x[2]),close:L,at:"close"}:(s=new G(i,w.line,w.ch,r),{open:L,close:o(s,x[2]),at:"open"})},Z.findEnclosingTag=function(i,a,r,s){for(var S=new G(i,a.line,a.ch,r);;){var w=d(S,s);if(!w)break;var x=new G(i,a.line,a.ch,r),L=o(x,w.tag);if(L)return{open:w,close:L}}},Z.scanForClosingTag=function(i,a,r,s){var S=new G(i,a.line,a.ch,s?{from:0,to:s}:null);return o(S,r)}})},"p/48":function(Fe,oe,k){},p5ED:function(Fe,oe,k){"use strict";var Z=k("+L6B"),X=k("2/Rp"),P=k("5Dmo"),V=k("3S7+"),j=k("k1fw"),M=k("9og8"),G=k("tJVT"),W=k("WmNS"),n=k.n(W),D=k("q1tI"),m=k.n(D),p=k("vHTk"),h=k.n(p),c=k("yEEn"),o=k("ZW9T"),d=k("1vsH"),i=k("V0Rq"),a=k("m3rI");oe.a=function(r){var s,S,w,x,L,O,_,b=r.editOffice,g=b===void 0?"view":b,f=r.data,C=r.theme,E=r.type,v=r.filename,N=r.monacoEditor,U=r.className,A=r.style,H=r.close,F=r.onClose,T=r.hasMask,z=r.disabledDownload,Q=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ne=Object(G.a)(Q,2),se=ne[0],xe=ne[1],me=Object(D.useState)(""),ve=Object(G.a)(me,2),Oe=ve[0],Re=ve[1],fe=Object(D.useState)(),ue=Object(G.a)(fe,2),Pe=ue[0],et=ue[1],rt=window.ENV==="build"?"/react/build":"",tt=a.a.PROXY_SERVER||location.origin,it,ze=1024*1024,Qe=10*ze,at=Object(D.useRef)();(s=f)!==null&&s!==void 0&&s.startsWith("/api")&&E!=="txt"&&(f=a.a.API_SERVER+f),E==="office"&&(it=Object(d.V)(f).filesize,it>Qe&&(E="other")),v&&N&&(N.filename=v),Object(D.useEffect)(function(){var Me,qe,st=(Me=document.cookie)===null||Me===void 0||((qe=Me.replace(/\s/g,""))===null||qe===void 0)?void 0:qe.split(";");st==null||st.map(function(mt){var gt=mt.split("=");gt[0]==="_educoder_session"&&Re(gt[1])})},[]),Object(D.useEffect)(function(){E==="office"&&he()},[E,f]);var he=function(){var Me=Object(M.a)(n.a.mark(function qe(){var st,mt,gt;return n.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return console.log("data:",f),st=f,f.startsWith("http")||(st=location.origin+st),mt=new URL(st).pathname.split("/").pop(),Et.next=6,Object(i.V)({attachment_id:mt});case 6:gt=Et.sent,et(gt);case 8:case"end":return Et.stop()}},qe)}));return function(){return Me.apply(this,arguments)}}(),Se=function(){if(f.startsWith("http")||f.startsWith("blob:")){Le();return}Object(d.B)(v||"educoder",f,v)},Le=function(){Object(d.z)(v||"educoder",decodeURIComponent(f))};return m.a.createElement("div",{style:Object(j.a)({},A||{}),className:"".concat(T&&h.a.bgBlack," ").concat(E?h.a.wrp:"hide")},H&&m.a.createElement("div",{className:h.a.close,ref:at},!z&&m.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return at.current}},m.a.createElement("span",{onClick:Le},m.a.createElement("i",{className:"icon-quxiaozhiding"}))),m.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return at.current}},m.a.createElement("span",{className:"",onClick:F},m.a.createElement("i",{className:"icon-guanbi1"})))),m.a.createElement("div",{className:"".concat(h.a[U]," ").concat(U," ").concat(h.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&m.a.createElement(o.b,N)),E==="audio"&&m.a.createElement("audio",{src:"".concat(((S=f)===null||S===void 0?void 0:S.indexOf("http://"))>-1||((w=f)===null||w===void 0?void 0:w.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),E==="video"&&m.a.createElement(m.a.Fragment,null,((x=f)===null||x===void 0?void 0:x.indexOf("http"))>-1?m.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):m.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),E==="office"&&Pe&&m.a.createElement("iframe",{src:"".concat(rt,"/office.html?key=").concat(Pe.key,"&url=").concat(tt+Pe.url,"&callbackUrl=").concat(tt+Pe.callbackUrl,"&fileType=").concat(Pe.fileType,"&title=").concat(Pe.title,"&model=").concat(g,"&officeServer=").concat(a.a.OFFICE_SERVER,"&disabledDownload=").concat(!!z)}),E==="html"&&m.a.createElement("iframe",{src:f+"&disposition=inline"}),E==="pdf"&&m.a.createElement("iframe",{src:"".concat(rt,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!z)}),E==="image"&&m.a.createElement("img",{src:"".concat(((L=f)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((O=f)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(_=f)!==null&&_!==void 0&&_.startsWith("/api")?"":"data:image/png;base64,").concat(f)}),E==="other"&&m.a.createElement("div",null,m.a.createElement(X.a,{type:"primary",size:"large",onClick:Se},m.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&m.a.createElement(X.a,{type:"primary",size:"large",onClick:Se},m.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Fe,oe,k){},pPuO:function(Fe,oe,k){Fe.exports={desc:"desc___2o_2w",info:"info___Uro3x","commit-info":"commit-info___o2-Ex"}},pmY6:function(Fe,oe,k){"use strict";k.d(oe,"h",function(){return D}),k.d(oe,"g",function(){return p}),k.d(oe,"f",function(){return h}),k.d(oe,"e",function(){return c}),k.d(oe,"i",function(){return o}),k.d(oe,"b",function(){return d}),k.d(oe,"a",function(){return i}),k.d(oe,"d",function(){return a}),k.d(oe,"c",function(){return r});var Z=k("C/vA"),X=k("JYp7");const P=!1;let V=null;function j(s){V=s}if(P){const s="__is_disposable_tracked__";j(new class{trackDisposable(S){const w=new Error("Potentially leaked disposable").stack;setTimeout(()=>{S[s]||console.log(w)},3e3)}setParent(S,w){if(S&&S!==i.None)try{S[s]=!0}catch(x){}}markAsDisposed(S){if(S&&S!==i.None)try{S[s]=!0}catch(w){}}markAsSingleton(S){}})}function M(s){return V==null||V.trackDisposable(s),s}function G(s){V==null||V.markAsDisposed(s)}function W(s,S){V==null||V.setParent(s,S)}function n(s,S){if(!V)return;for(const w of s)V.setParent(w,S)}function D(s){return V==null||V.markAsSingleton(s),s}class m extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function p(s){return typeof s.dispose=="function"&&s.dispose.length===0}function h(s){if(X.a.is(s)){let S=[];for(const w of s)if(w)try{w.dispose()}catch(x){S.push(x)}if(S.length===1)throw S[0];if(S.length>1)throw new m(S);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function c(...s){const S=o(()=>h(s));return n(s,S),S}function o(s){const S=M({dispose:Object(Z.a)(()=>{G(S),s()})});return S}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,M(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{h(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return W(s,this),this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(s),s}}d.DISABLE_DISPOSED_WARNING=!1;class i{constructor(){this._store=new d,M(this),W(this._store,this)}dispose(){G(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}i.None=Object.freeze({dispose(){}});class a{constructor(){this._isDisposed=!1,M(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var S;if(this._isDisposed||s===this._value)return;(S=this._value)===null||S===void 0||S.dispose(),s&&W(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,G(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&W(s,null),s}}class r{constructor(s){this.object=s}dispose(){}}},psGv:function(Fe,oe,k){var Z,X;(function(){var P;(function(){"use strict";var G=[,,function(m){function p(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var o=new p(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},p.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},p.prototype.has_match=function(o){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(o))return!0;return!1},p.prototype.set_indent=function(o,d){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.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)},p.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},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(o){this.__items.push(o);var d=o.lastIndexOf(`
`);d!==-1?this.__character_count=o.length-d:this.__character_count+=o.length},p.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function h(o,d){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),d=d||"",o.indent_level>0&&(d=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}h.prototype.get_indent_size=function(o,d){var i=this.__base_string_length;return d=d||0,o<0&&(i=0),i+=o*this.__indent_size,i+=d,i},h.prototype.get_indent_string=function(o,d){var i=this.__base_string;return d=d||0,o<0&&(o=0,i=""),d+=o*this.__indent_size,this.__ensure_cache(d),i+=this.__cache[d],i},h.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},h.prototype.__add_column=function(){var o=this.__cache.length,d=0,i="";this.__indent_size&&o>=this.__indent_size&&(d=Math.floor(o/this.__indent_size),o-=d*this.__indent_size,i=new Array(d+1).join(this.__indent_string)),o&&(i+=new Array(o+1).join(" ")),this.__cache.push(i)};function c(o,d){this.__indent_cache=new h(o,d),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(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(o,d){return this.__indent_cache.get_indent_string(o,d)},c.prototype.get_indent_size=function(o,d){return this.__indent_cache.get_indent_size(o,d)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(o){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return o!==`
`&&(i=i.replace(/[\n]/g,o)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(o,d){return o=o||0,d=d||0,this.next_line.set_indent(o,d),this.__lines.length>1?(this.current_line.set_indent(o,d),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(o){for(var d=0;d<o.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},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(o){for(var d=this.__lines.length;o<d;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(o,d){for(var i=this.__lines.length-2;i>=0;){var a=this.__lines[i];if(a.is_empty())break;if(a.item(0).indexOf(o)!==0&&a.item(-1)!==d){this.__lines.splice(i+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},m.exports.Output=c},function(m){function p(h,c,o,d){this.type=h,this.text=c,this.comments_before=null,this.newlines=o||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}m.exports.Token=p},,,function(m){function p(o,d){this.raw_options=h(o,d),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"])}p.prototype._get_array=function(o,d){var i=this.raw_options[o],a=d||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(a=i.concat()):typeof i=="string"&&(a=i.split(/[^a-zA-Z0-9_\/\-]+/)),a},p.prototype._get_boolean=function(o,d){var i=this.raw_options[o],a=i===void 0?!!d:!!i;return a},p.prototype._get_characters=function(o,d){var i=this.raw_options[o],a=d||"";return typeof i=="string"&&(a=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},p.prototype._get_number=function(o,d){var i=this.raw_options[o];d=parseInt(d,10),isNaN(d)&&(d=0);var a=parseInt(i,10);return isNaN(a)&&(a=d),a},p.prototype._get_selection=function(o,d,i){var a=this._get_selection_list(o,d,i);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[o]+"'");return a[0]},p.prototype._get_selection_list=function(o,d,i){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[d[0]],!this._is_valid_selection(i,d))throw new Error("Invalid Default Value!");var a=this._get_array(o,i);if(!this._is_valid_selection(a,d))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[o]+"'");return a},p.prototype._is_valid_selection=function(o,d){return o.length&&d.length&&!o.some(function(i){return d.indexOf(i)===-1})};function h(o,d){var i={};o=c(o);var a;for(a in o)a!==d&&(i[a]=o[a]);if(d&&o[d])for(a in o[d])i[a]=o[d][a];return i}function c(o){var d={},i;for(i in o){var a=i.replace(/-/g,"_");d[a]=o[i]}return d}m.exports.Options=p,m.exports.normalizeOpts=c,m.exports.mergeOpts=h},,function(m){var p=RegExp.prototype.hasOwnProperty("sticky");function h(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}h.prototype.restart=function(){this.__position=0},h.prototype.back=function(){this.__position>0&&(this.__position-=1)},h.prototype.hasNext=function(){return this.__position<this.__input_length},h.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},h.prototype.peek=function(c){var o=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(o=this.__input.charAt(c)),o},h.prototype.__match=function(c,o){c.lastIndex=o;var d=c.exec(this.__input);return d&&!(p&&c.sticky)&&(d.index!==o&&(d=null)),d},h.prototype.test=function(c,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(c,o):!1},h.prototype.testChar=function(c,o){var d=this.peek(o);return c.lastIndex=0,d!==null&&c.test(d)},h.prototype.match=function(c){var o=this.__match(c,this.__position);return o?this.__position+=o[0].length:o=null,o},h.prototype.read=function(c,o,d){var i="",a;return c&&(a=this.match(c),a&&(i+=a[0])),o&&(a||!c)&&(i+=this.readUntil(o,d)),i},h.prototype.readUntil=function(c,o){var d="",i=this.__position;c.lastIndex=this.__position;var a=c.exec(this.__input);return a?(i=a.index,o&&(i+=a[0].length)):i=this.__input_length,d=this.__input.substring(this.__position,i),this.__position=i,d},h.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},h.prototype.get_regexp=function(c,o){var d=null,i="g";return o&&p&&(i="y"),typeof c=="string"&&c!==""?d=new RegExp(c,i):c&&(d=new RegExp(c.source,i)),d},h.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},h.prototype.peekUntilAfter=function(c){var o=this.__position,d=this.readUntilAfter(c);return this.__position=o,d},h.prototype.lookBack=function(c){var o=this.__position-1;return o>=c.length&&this.__input.substring(o-c.length,o).toLowerCase()===c},m.exports.InputScanner=h},function(m,p,h){var c=h(8).InputScanner,o=h(3).Token,d=h(10).TokenStream,i=h(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(s,S){this._input=new c(s),this._options=S||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var s,S=new o(a.START,""),w=null,x=[],L=new d;S.type!==a.EOF;){for(s=this._get_next_token(S,w);this._is_comment(s);)L.add(s),s=this._get_next_token(S,w);L.isEmpty()||(s.comments_before=L,L=new d),s.parent=w,this._is_opening(s)?(x.push(w),w=s):w&&this._is_closing(s,w)&&(s.opened=w,w.closed=s,w=x.pop(),s.parent=w),s.previous=S,S.next=s,this.__tokens.add(s),S=s}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(s,S){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(a.RAW,w):this._create_token(a.EOF,"")},r.prototype._is_comment=function(s){return!1},r.prototype._is_opening=function(s){return!1},r.prototype._is_closing=function(s,S){return!1},r.prototype._create_token=function(s,S){var w=new o(s,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},m.exports.Tokenizer=r,m.exports.TOKEN=a},function(m){function p(h){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=h}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__tokens[this.__position],this.__position+=1),h},p.prototype.peek=function(h){var c=null;return h=h||0,h+=this.__position,h>=0&&h<this.__tokens_length&&(c=this.__tokens[h]),c},p.prototype.add=function(h){this.__parent_token&&(h.parent=this.__parent_token),this.__tokens.push(h),this.__tokens_length+=1},m.exports.TokenStream=p},function(m,p,h){var c=h(12).Pattern;function o(d,i){c.call(this,d,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new c,o.prototype.__set_whitespace_patterns=function(d,i){d+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var i=this.__split(this._newline_regexp,d);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return d},o.prototype.matching=function(d,i){var a=this._create();return a.__set_whitespace_patterns(d,i),a._update(),a},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(d,i){d.lastIndex=0;for(var a=0,r=[],s=d.exec(i);s;)r.push(i.substring(a,s.index)),a=s.index+s[0].length,s=d.exec(i);return a<i.length?r.push(i.substring(a,i.length)):r.push(""),r},m.exports.WhitespacePattern=o},function(m){function p(h,c){this._input=h,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)}p.prototype.read=function(){var h=this._input.read(this._starting_pattern);return(!this._starting_pattern||h)&&(h+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),h},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(h){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(h),c._update(),c},p.prototype.until=function(h){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(h),c._update(),c},p.prototype.starting_with=function(h){var c=this._create();return c._starting_pattern=this._input.get_regexp(h,!0),c._update(),c},p.prototype.matching=function(h){var c=this._create();return c._match_pattern=this._input.get_regexp(h,!0),c._update(),c},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},m.exports.Pattern=p},function(m){function p(h,c){h=typeof h=="string"?h:h.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(h+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(h+/\sbeautify\signore:end\s/.source+c,"g")}p.prototype.get_directives=function(h){if(!h.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(h);o;)c[o[1]]=o[2],o=this.__directive_pattern.exec(h);return c},p.prototype.readIgnored=function(h){return h.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=p},function(m,p,h){var c=h(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(i,a){c.call(this,i,a),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var r=new c(i);this.__patterns={handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:r.starting_with(/{{{/).until_after(/}}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),php:r.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new c,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(i){var a=this._create();return a._disabled[i]=!0,a._update(),a},d.prototype.read_options=function(i){var a=this._create();for(var r in o)a._disabled[r]=i.templating.indexOf(r)===-1;return a._update(),a},d.prototype.exclude=function(i){var a=this._create();return a._excluded[i]=!0,a._update(),a},d.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=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),i+=a,a=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},d.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},d.prototype._read_template=function(){var i="",a=this._input.peek();if(a==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(i=i||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},m.exports.TemplatablePattern=d},,,,function(m,p,h){var c=h(19).Beautifier,o=h(20).Options;function d(i,a,r,s){var S=new c(i,a,r,s);return S.beautify()}m.exports=d,m.exports.defaultOptions=function(){return new o}},function(m,p,h){var c=h(20).Options,o=h(2).Output,d=h(21).Tokenizer,i=h(21).TOKEN,a=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,s=function(C,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new o(C,E)};s.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},s.prototype.set_space_before_token=function(C,E){this._output.space_before_token=C,this._output.non_breaking_space=E},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},s.prototype.print_preserved_newlines=function(C){var E=0;C.type!==i.TEXT&&C.previous.type!==i.TEXT&&(E=C.newlines?1:0),this.preserve_newlines&&(E=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var v=0;v<E;v++)this.print_newline(v>0);return E!==0},s.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(C){this._output.add_new_line(C)},s.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var S=function(C){for(var E=null,v=C.next;v.type!==i.EOF&&C.closed!==v;){if(v.type===i.ATTRIBUTE&&v.text==="type"){v.next&&v.next.type===i.EQUALS&&v.next.next&&v.next.next.type===i.VALUE&&(E=v.next.next.text);break}v=v.next}return E},w=function(C,E){var v=null,N=null;return E.closed?(C==="script"?v="text/javascript":C==="style"&&(v="text/css"),v=S(E)||v,v.search("text/css")>-1?N="css":v.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":v.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":v.search(/test\/null/)>-1&&(N="null"),N):null};function x(C,E){return E.indexOf(C)!==-1}function L(C,E,v){this.parent=C||null,this.tag=E?E.tag_name:"",this.indent_level=v||0,this.parser_token=E||null}function O(C){this._printer=C,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(C){var E=new L(this._current_frame,C,this._printer.indent_level);this._current_frame=E},O.prototype._try_pop_frame=function(C){var E=null;return C&&(E=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),E},O.prototype._get_frame=function(C,E){for(var v=this._current_frame;v&&!(C.indexOf(v.tag)!==-1);){if(E&&E.indexOf(v.tag)!==-1){v=null;break}v=v.parent}return v},O.prototype.try_pop=function(C,E){var v=this._get_frame([C],E);return this._try_pop_frame(v)},O.prototype.indent_to_tag=function(C){var E=this._get_frame(C);E&&(this._printer.indent_level=E.indent_level)};function _(C,E,v,N){this._source_text=C||"",E=E||{},this._js_beautify=v,this._css_beautify=N,this._tag_stack=null;var U=new c(E,"html");this._options=U,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"}_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
`,C&&a.test(C)&&(E=C.match(a)[0])),C=C.replace(r,`
`);var v=C.match(/^[\t ]*/)[0],N={text:"",type:""},U=new b,A=new s(this._options,v),H=new d(C,this._options).tokenize();this._tag_stack=new O(A);for(var F=null,T=H.next();T.type!==i.EOF;)T.type===i.TAG_OPEN||T.type===i.COMMENT?(F=this._handle_tag_open(A,T,U,N),U=F):T.type===i.ATTRIBUTE||T.type===i.EQUALS||T.type===i.VALUE||T.type===i.TEXT&&!U.tag_complete?F=this._handle_inside_tag(A,T,U,H):T.type===i.TAG_CLOSE?F=this._handle_tag_close(A,T,U):T.type===i.TEXT?F=this._handle_text(A,T,U):A.add_raw_token(T),N=F,T=H.next();var z=A._output.get_code(E);return z},_.prototype._handle_tag_close=function(C,E,v){var N={text:E.text,type:E.type};return C.alignment_size=0,v.tag_complete=!0,C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),v.is_unformatted?C.add_raw_token(E):(v.tag_start_char==="<"&&(C.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&v.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(E)),v.indent_content&&!(v.is_unformatted||v.is_content_unformatted)&&(C.indent(),v.indent_content=!1),!v.is_inline_element&&!(v.is_unformatted||v.is_content_unformatted)&&C.set_wrap_point(),N},_.prototype._handle_inside_tag=function(C,E,v,N){var U=v.has_wrapped_attrs,A={text:E.text,type:E.type};if(C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),v.is_unformatted)C.add_raw_token(E);else if(v.tag_start_char==="{"&&E.type===i.TEXT)C.print_preserved_newlines(E)?(E.newlines=0,C.add_raw_token(E)):C.print_token(E);else{if(E.type===i.ATTRIBUTE?(C.set_space_before_token(!0),v.attr_count+=1):(E.type===i.EQUALS||E.type===i.VALUE&&E.previous.type===i.EQUALS)&&C.set_space_before_token(!1),E.type===i.ATTRIBUTE&&v.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(E),U=U||E.newlines!==0),this._is_wrap_attributes_force)){var H=v.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&v.attr_count===1){var F=!0,T=0,z;do{if(z=N.peek(T),z.type===i.ATTRIBUTE){F=!1;break}T+=1}while(T<4&&z.type!==i.EOF&&z.type!==i.TAG_CLOSE);H=!F}H&&(C.print_newline(!1),U=!0)}C.print_token(E),U=U||C.previous_token_wrapped(),v.has_wrapped_attrs=U}return A},_.prototype._handle_text=function(C,E,v){var N={text:E.text,type:"TK_CONTENT"};return v.custom_beautifier_name?this._print_custom_beatifier_text(C,E,v):v.is_unformatted||v.is_content_unformatted?C.add_raw_token(E):(C.traverse_whitespace(E),C.print_token(E)),N},_.prototype._print_custom_beatifier_text=function(C,E,v){var N=this;if(E.text!==""){var U=E.text,A,H=1,F="",T="";v.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:v.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:v.custom_beautifier_name==="html"&&(A=function(me,ve){var Oe=new _(me,ve,N._js_beautify,N._css_beautify);return Oe.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-C.indent_level);var z=C.get_full_indent(H);if(U=U.replace(/\n[ \t]*$/,""),v.custom_beautifier_name!=="html"&&U[0]==="<"&&U.match(/^(<!--|<!\[CDATA\[)/)){var Q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(U);if(!Q){C.add_raw_token(E);return}F=z+Q[1]+`
`,U=Q[4],Q[5]&&(T=z+Q[5]),U=U.replace(/\n[ \t]*$/,""),(Q[2]||Q[3].indexOf(`
`)!==-1)&&(Q=Q[3].match(/[ \t]+$/),Q&&(E.whitespace_before=Q[0]))}if(U)if(A){var ne=function(){this.eol=`
`};ne.prototype=this._options.raw_options;var se=new ne;U=A(z+U,se)}else{var xe=E.whitespace_before;xe&&(U=U.replace(new RegExp(`
(`+xe+")?","g"),`
`)),U=z+U.replace(/\n/g,`
`+z)}F&&(U?U=F+U+`
`+T:U=F+T),C.print_newline(!1),U&&(E.text=U,E.whitespace_before="",E.newlines=0,C.add_raw_token(E),C.print_newline(!0))}},_.prototype._handle_tag_open=function(C,E,v,N){var U=this._get_tag_open_token(E);return(v.is_unformatted||v.is_content_unformatted)&&!v.is_empty_element&&E.type===i.TAG_OPEN&&E.text.indexOf("</")===0?(C.add_raw_token(E),U.start_tag_token=this._tag_stack.try_pop(U.tag_name)):(C.traverse_whitespace(E),this._set_tag_position(C,E,U,v,N),U.is_inline_element||C.set_wrap_point(),C.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(U.alignment_size=E.text.length+1),!U.tag_complete&&!U.is_unformatted&&(C.alignment_size=U.alignment_size),U};var b=function(C,E){if(this.parent=C||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="",!E)this.tag_complete=!0;else{var v;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(v=E.text.match(/^<([^\s>]*)/),this.tag_check=v?v[1]:""):(v=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=v?v[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.type===i.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||E.closed&&E.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)))}};_.prototype._get_tag_open_token=function(C){var E=new b(this._tag_stack.get_parser_token(),C);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||x(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&x(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&x(E.tag_check,this._options.content_unformatted),E.is_inline_element=x(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},_.prototype._set_tag_position=function(C,E,v,N,U){if(v.is_empty_element||(v.is_end_tag?v.start_tag_token=this._tag_stack.try_pop(v.tag_name):(this._do_optional_end_element(v)&&(v.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(v),(v.tag_name==="script"||v.tag_name==="style")&&!(v.is_unformatted||v.is_content_unformatted)&&(v.custom_beautifier_name=w(v.tag_check,E)))),x(v.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),v.is_empty_element){if(v.tag_start_char==="{"&&v.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),v.indent_content=!0;var A=C.current_line_has_match(/{{#if/);A||C.print_newline(!1)}v.tag_name==="!--"&&U.type===i.TAG_CLOSE&&N.is_end_tag&&v.text.indexOf(`
`)===-1||(v.is_inline_element||v.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,v))}else if(v.is_end_tag){var H=!1;H=v.start_tag_token&&v.start_tag_token.multiline_content,H=H||!v.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(U.type===i.TAG_CLOSE&&v.start_tag_token===N)&&U.type!=="TK_CONTENT",(v.is_content_unformatted||v.is_unformatted)&&(H=!1),H&&C.print_newline(!1)}else v.indent_content=!v.custom_beautifier_name,v.tag_start_char==="<"&&(v.tag_name==="html"?v.indent_content=this._options.indent_inner_html:v.tag_name==="head"?v.indent_content=this._options.indent_head_inner_html:v.tag_name==="body"&&(v.indent_content=this._options.indent_body_inner_html)),!(v.is_inline_element||v.is_unformatted)&&(U.type!=="TK_CONTENT"||v.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,v)},_.prototype._calcluate_parent_multiline=function(C,E){E.parent&&C._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var g=["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"],f=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(C){var E=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(C.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&g.indexOf(C.tag_name)!==-1){var v=C.parent.parent;(!v||f.indexOf(v.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),E},m.exports.Beautifier=_},function(m,p,h){var c=h(6).Options;function o(d){c.call(this,d,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new c,m.exports.Options=o},function(m,p,h){var c=h(9).Tokenizer,o=h(9).TOKEN,d=h(13).Directives,i=h(14).TemplatablePattern,a=h(12).Pattern,r={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},s=new d(/<\!--/,/-->/),S=function(w,x){c.call(this,w,x),this._current_tag_name="";var L=new i(this._input).read_options(this._options),O=new a(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var _=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(_).until_after(_)}};S.prototype=new c,S.prototype._is_comment=function(w){return!1},S.prototype._is_opening=function(w){return w.type===r.TAG_OPEN},S.prototype._is_closing=function(w,x){return w.type===r.TAG_CLOSE&&x&&((w.text===">"||w.text==="/>")&&x.text[0]==="<"||w.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(w,x){var L=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(r.EOF,""):(L=L||this._read_open_handlebars(O,x),L=L||this._read_attribute(O,w,x),L=L||this._read_close(O,x),L=L||this._read_raw_content(O,w,x),L=L||this._read_content_word(O),L=L||this._read_comment_or_cdata(O),L=L||this._read_processing(O),L=L||this._read_open(O,x),L=L||this._create_token(r.UNKNOWN,this._input.next()),L)},S.prototype._read_comment_or_cdata=function(w){var x=null,L=null,O=null;if(w==="<"){var _=this._input.peek(1);_==="!"&&(L=this.__patterns.comment.read(),L?(O=s.get_directives(L),O&&O.ignore==="start"&&(L+=s.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(x=this._create_token(r.COMMENT,L),x.directives=O)}return x},S.prototype._read_processing=function(w){var x=null,L=null,O=null;if(w==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(x=this._create_token(r.COMMENT,L),x.directives=O)}return x},S.prototype._read_open=function(w,x){var L=null,O=null;return x||w==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),O=this._create_token(r.TAG_OPEN,L)),O},S.prototype._read_open_handlebars=function(w,x){var L=null,O=null;return x||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),O=this._create_token(r.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),O=this._create_token(r.TAG_OPEN,L))),O},S.prototype._read_close=function(w,x){var L=null,O=null;return x&&(x.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(L=this._input.next(),w==="/"&&(L+=this._input.next()),O=this._create_token(r.TAG_CLOSE,L)):x.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(r.TAG_CLOSE,"}}"))),O},S.prototype._read_attribute=function(w,x,L){var O=null,_="";if(L&&L.text[0]==="<")if(w==="=")O=this._create_token(r.EQUALS,this._input.next());else if(w==='"'||w==="'"){var b=this._input.next();w==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),O=this._create_token(r.VALUE,b)}else _=this.__patterns.attribute.read(),_&&(x.type===r.EQUALS?O=this._create_token(r.VALUE,_):O=this._create_token(r.ATTRIBUTE,_));return O},S.prototype._is_content_unformatted=function(w){return this._options.void_elements.indexOf(w)===-1&&(this._options.content_unformatted.indexOf(w)!==-1||this._options.unformatted.indexOf(w)!==-1)},S.prototype._read_raw_content=function(w,x,L){var O="";if(L&&L.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(x.type===r.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var _=x.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var b=this._read_comment_or_cdata(w);if(b)return b.type=r.TEXT,b;O=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(_)&&(O=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(r.TEXT,O):null},S.prototype._read_content_word=function(w){var x="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(r.TEXT,x)},m.exports.Tokenizer=S,m.exports.TOKEN=r}],W={};function n(m){var p=W[m];if(p!==void 0)return p.exports;var h=W[m]={exports:{}};return G[m](h,h.exports,n),h.exports}var D=n(18);P=D})();var V=P;if(!0)!(Z=[k,k("6UM0"),k("TXwP")],X=function(G){var W=k("6UM0"),n=k("TXwP");return{html_beautify:function(D,m){return V(D,m,W.js_beautify,n.css_beautify)}}}.apply(oe,Z),X!==void 0&&(Fe.exports=X));else var j,M})()},"qJ4+":function(Fe,oe,k){},rUJ1:function(Fe,oe){const k=/[&<>"']/,Z=/[&<>"']/g,X=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,V={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},j=O=>V[O];function M(O,_){if(_){if(k.test(O))return O.replace(Z,j)}else if(X.test(O))return O.replace(P,j);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(O){return O.replace(G,(_,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const n=/(^|[^\[])\^/g;function D(O,_){O=O.source||O,_=_||"";const b={replace:(g,f)=>(f=f.source||f,f=f.replace(n,"$1"),O=O.replace(g,f),b),getRegex:()=>new RegExp(O,_)};return b}const m=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(O,_,b){if(O){let g;try{g=decodeURIComponent(W(b)).replace(m,"").toLowerCase()}catch(f){return null}if(g.indexOf("javascript:")===0||g.indexOf("vbscript:")===0||g.indexOf("data:")===0)return null}_&&!p.test(b)&&(b=a(_,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(g){return null}return b}const c={},o=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(O,_){c[" "+O]||(o.test(O)?c[" "+O]=O+"/":c[" "+O]=w(O,"/",!0)),O=c[" "+O];const b=O.indexOf(":")===-1;return _.substring(0,2)==="//"?b?_:O.replace(d,"$1")+_:_.charAt(0)==="/"?b?_:O.replace(i,"$1")+_:O+_}const r={exec:function(){}};function s(O){let _=1,b,g;for(;_<arguments.length;_++){b=arguments[_];for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(O[g]=b[g])}return O}function S(O,_){const b=O.replace(/\|/g,(C,E,v)=>{let N=!1,U=E;for(;--U>=0&&v[U]==="\\";)N=!N;return N?"|":" |"}),g=b.split(/ \|/);let f=0;if(g.length>_)g.splice(_);else for(;g.length<_;)g.push("");for(;f<g.length;f++)g[f]=g[f].trim().replace(/\\\|/g,"|");return g}function w(O,_,b){const g=O.length;if(g===0)return"";let f=0;for(;f<g;){const C=O.charAt(g-f-1);if(C===_&&!b)f++;else if(C!==_&&b)f++;else break}return O.substr(0,g-f)}function x(O,_){if(O.indexOf(_[1])===-1)return-1;const b=O.length;let g=0,f=0;for(;f<b;f++)if(O[f]==="\\")f++;else if(O[f]===_[0])g++;else if(O[f]===_[1]&&(g--,g<0))return f;return-1}function L(O){O&&O.sanitize&&!O.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Fe.exports={escape:M,unescape:W,edit:D,cleanUrl:h,resolveUrl:a,noopTest:r,merge:s,splitCells:S,rtrim:w,findClosingBracket:x,checkSanitizeDeprecation:L}},rdUC:function(Fe,oe,k){var Z=k("MFOe"),X=Z.Global;Fe.exports={name:"localStorage",read:V,write:j,each:M,remove:G,clearAll:W};function P(){return X.localStorage}function V(n){return P().getItem(n)}function j(n,D){return P().setItem(n,D)}function M(n){for(var D=P().length-1;D>=0;D--){var m=P().key(D);n(V(m),m)}}function G(n){return P().removeItem(n)}function W(){return P().clear()}},sR1s:function(Fe,oe,k){"use strict";k.d(oe,"b",function(){return V}),k.d(oe,"a",function(){return j}),k.d(oe,"c",function(){return M}),k.d(oe,"d",function(){return G});var Z=k("U8pU"),X="RC_TABLE_KEY";function P(W){return W==null?[]:Array.isArray(W)?W:[W]}function V(W,n){if(!n&&typeof n!="number")return W;for(var D=P(n),m=W,p=0;p<D.length;p+=1){if(!m)return null;var h=D[p];m=m[h]}return m}function j(W){var n=[],D={};return W.forEach(function(m){for(var p=m||{},h=p.key,c=p.dataIndex,o=h||P(c).join("-")||X;D[o];)o="".concat(o,"_next");D[o]=!0,n.push(o)}),n}function M(){var W={};function n(h,c){c&&Object.keys(c).forEach(function(o){var d=c[o];d&&Object(Z.a)(d)==="object"?(h[o]=h[o]||{},n(h[o],d)):h[o]=d})}for(var D=arguments.length,m=new Array(D),p=0;p<D;p++)m[p]=arguments[p];return m.forEach(function(h){n(W,h)}),W}function G(W){return W!=null}},sboe:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return P});var Z=k("q1tI"),X=k.n(Z),P=Z.createContext(null)},"t/PP":function(Fe,oe,k){Fe.exports=k.p+"static/title.dd3b799f.svg"},t23M:function(Fe,oe,k){"use strict";var Z=k("VTBJ"),X=k("1OyB"),P=k("vuIU"),V=k("Ji7U"),j=k("LK+K"),M=k("q1tI"),G=k.n(M),W=k("m+aA"),n=k("Zm9Q"),D=k("Kwbf"),m=k("c+Xe"),p=k("bdgK"),h="rc-observer-key",c=function(o){Object(V.a)(i,o);var d=Object(j.a)(i);function i(){var a;return Object(X.a)(this,i),a=d.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(r){var s=a.props.onResize,S=r[0].target,w=S.getBoundingClientRect(),x=w.width,L=w.height,O=S.offsetWidth,_=S.offsetHeight,b=Math.floor(x),g=Math.floor(L);if(a.state.width!==b||a.state.height!==g||a.state.offsetWidth!==O||a.state.offsetHeight!==_){var f={width:b,height:g,offsetWidth:O,offsetHeight:_};a.setState(f),s&&Promise.resolve().then(function(){s(Object(Z.a)(Object(Z.a)({},f),{},{offsetWidth:O,offsetHeight:_}))})}},a.setChildNode=function(r){a.childNode=r},a}return Object(P.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var r=this.props.disabled;if(r){this.destroyObserver();return}var s=Object(W.a)(this.childNode||this),S=s!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=s),!this.resizeObserver&&s&&(this.resizeObserver=new p.default(this.onResize),this.resizeObserver.observe(s))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var r=this.props.children,s=Object(n.a)(r);if(s.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(s.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=s[0];if(M.isValidElement(S)&&Object(m.c)(S)){var w=S.ref;s[0]=M.cloneElement(S,{ref:Object(m.a)(w,this.setChildNode)})}return s.length===1?s[0]:s.map(function(x,L){return!M.isValidElement(x)||"key"in x&&x.key!==null?x:M.cloneElement(x,{key:"".concat(h,"-").concat(L)})})}}]),i}(M.Component);c.displayName="ResizeObserver",oe.a=c},t9D7:function(Fe,oe,k){"use strict";k.d(oe,"b",function(){return G}),k.d(oe,"g",function(){return n}),k.d(oe,"d",function(){return D}),k.d(oe,"e",function(){return m}),k.d(oe,"a",function(){return p}),k.d(oe,"f",function(){return o}),k.d(oe,"c",function(){return d});var Z=k("Vhoy"),X=k("MI8n"),P=k("pmY6"),V=k("Cg/j"),j=k("ic2d"),M=k("nEHx");const G=Object(V.c)("themeService");var W;(function(i){function a(r){return r&&typeof r=="object"&&typeof r.id=="string"}i.isThemeColor=a})(W||(W={}));function n(i){return{id:i}}var D;(function(i){function a(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||W.isThemeColor(L.color))}i.isThemeIcon=a;const r=new RegExp(`^\\$\\((${Z.a.iconNameExpression}(?:${Z.a.iconModifierExpression})?)\\)$`);function s(L){const O=r.exec(L);if(!O)return;let[,_]=O;return{id:_}}i.fromString=s;function S(L,O){let _=L.id;const b=_.lastIndexOf("~");return b!==-1&&(_=_.substring(0,b)),O&&(_=`${_}~${O}`),{id:_}}i.modify=S;function w(L,O){var _,b;return L.id===O.id&&((_=L.color)===null||_===void 0?void 0:_.id)===((b=O.color)===null||b===void 0?void 0:b.id)}i.isEqual=w;function x(L,O){return{id:L.id,color:O?n(O):void 0}}i.asThemeIcon=x,i.asClassNameArray=Z.a.asClassNameArray,i.asClassName=Z.a.asClassName,i.asCSSSelector=Z.a.asCSSSelector})(D||(D={}));function m(i){switch(i){case M.a.DARK:return"vs-dark";case M.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class h{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new X.b}onColorThemeChange(i){return this.themingParticipants.push(i),this.onThemingParticipantAddedEmitter.fire(i),Object(P.i)(()=>{const a=this.themingParticipants.indexOf(i);this.themingParticipants.splice(a,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new h;j.a.add(p.ThemingContribution,c);function o(i){return c.onColorThemeChange(i)}class d extends P.a{constructor(i){super();this.themeService=i,this.theme=i.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(a=>this.onThemeChange(a)))}onThemeChange(i){this.theme=i,this.updateStyles()}updateStyles(){}}},uD2n:function(Fe,oe,k){Fe.exports={"dis-input-editor-container":"dis-input-editor-container___3uf7A",active:"active___20tmT","input-mask":"input-mask___1kijM","text-area":"text-area___2gTEA","tip-container":"tip-container___2tKkE",hide:"hide___3jIwM","md-container":"md-container___14zRI","btn-send":"btn-send___3TabT"}},uMZB:function(Fe,oe,k){Fe.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(Fe,oe,k){Fe.exports=Z;function Z(){return k("gaXo"),{}}},ulZh:function(Fe,oe,k){typeof window!="undefined"&&function(X,P){Fe.exports=P()}(this,function(){return function(Z){var X={};function P(V){if(X[V])return X[V].exports;var j=X[V]={i:V,l:!1,exports:{}};return Z[V].call(j.exports,j,j.exports,P),j.l=!0,j.exports}return P.m=Z,P.c=X,P.d=function(V,j,M){P.o(V,j)||Object.defineProperty(V,j,{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,j){if(j&1&&(V=P(V)),j&8)return V;if(j&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}),j&2&&typeof V!="string")for(var G in V)P.d(M,G,function(W){return V[W]}.bind(null,G));return M},P.n=function(V){var j=V&&V.__esModule?function(){return V.default}:function(){return V};return P.d(j,"a",j),j},P.o=function(V,j){return Object.prototype.hasOwnProperty.call(V,j)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,X,P){"use strict";var V=Object.prototype.hasOwnProperty,j="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(j=!1));function G(m,p,h){this.fn=m,this.context=p,this.once=h||!1}function W(m,p,h,c,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var d=new G(h,c||m,o),i=j?j+p:p;return m._events[i]?m._events[i].fn?m._events[i]=[m._events[i],d]:m._events[i].push(d):(m._events[i]=d,m._eventsCount++),m}function n(m,p){--m._eventsCount===0?m._events=new M:delete m._events[p]}function D(){this._events=new M,this._eventsCount=0}D.prototype.eventNames=function(){var p=[],h,c;if(this._eventsCount===0)return p;for(c in h=this._events)V.call(h,c)&&p.push(j?c.slice(1):c);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(h)):p},D.prototype.listeners=function(p){var h=j?j+p:p,c=this._events[h];if(!c)return[];if(c.fn)return[c.fn];for(var o=0,d=c.length,i=new Array(d);o<d;o++)i[o]=c[o].fn;return i},D.prototype.listenerCount=function(p){var h=j?j+p:p,c=this._events[h];return c?c.fn?1:c.length:0},D.prototype.emit=function(p,h,c,o,d,i){var a=j?j+p:p;if(!this._events[a])return!1;var r=this._events[a],s=arguments.length,S,w;if(r.fn){r.once&&this.removeListener(p,r.fn,void 0,!0);switch(s){case 1:return r.fn.call(r.context),!0;case 2:return r.fn.call(r.context,h),!0;case 3:return r.fn.call(r.context,h,c),!0;case 4:return r.fn.call(r.context,h,c,o),!0;case 5:return r.fn.call(r.context,h,c,o,d),!0;case 6:return r.fn.call(r.context,h,c,o,d,i),!0}for(w=1,S=new Array(s-1);w<s;w++)S[w-1]=arguments[w];r.fn.apply(r.context,S)}else{var x=r.length,L;for(w=0;w<x;w++){r[w].once&&this.removeListener(p,r[w].fn,void 0,!0);switch(s){case 1:r[w].fn.call(r[w].context);break;case 2:r[w].fn.call(r[w].context,h);break;case 3:r[w].fn.call(r[w].context,h,c);break;case 4:r[w].fn.call(r[w].context,h,c,o);break;default:if(!S)for(L=1,S=new Array(s-1);L<s;L++)S[L-1]=arguments[L];r[w].fn.apply(r[w].context,S)}}}return!0},D.prototype.on=function(p,h,c){return W(this,p,h,c,!1)},D.prototype.once=function(p,h,c){return W(this,p,h,c,!0)},D.prototype.removeListener=function(p,h,c,o){var d=j?j+p:p;if(!this._events[d])return this;if(!h)return n(this,d),this;var i=this._events[d];if(i.fn)i.fn===h&&(!o||i.once)&&(!c||i.context===c)&&n(this,d);else{for(var a=0,r=[],s=i.length;a<s;a++)(i[a].fn!==h||o&&!i[a].once||c&&i[a].context!==c)&&r.push(i[a]);r.length?this._events[d]=r.length===1?r[0]:r:n(this,d)}return this},D.prototype.removeAllListeners=function(p){var h;return p?(h=j?j+p:p,this._events[h]&&n(this,h)):(this._events=new M,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=j,D.EventEmitter=D,Z.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(Z,X,P){(function(V){var j=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(D,m,p){if(p=p||{},D=D.trim(),m=m.trim(),!m){if(!p.alwaysNormalize)return D;var h=n.parseURL(D);if(!h)throw new Error("Error trying to parse base URL.");return h.path=n.normalizePath(h.path),n.buildURLFromParts(h)}var c=n.parseURL(m);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return p.alwaysNormalize?(c.path=n.normalizePath(c.path),n.buildURLFromParts(c)):m;var o=n.parseURL(D);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var d=M.exec(o.path);o.netLoc=d[1],o.path=d[2]}o.netLoc&&!o.path&&(o.path="/");var i={scheme:o.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(i.netLoc=o.netLoc,c.path[0]!=="/"))if(!c.path)i.path=o.path,c.params||(i.params=o.params,c.query||(i.query=o.query));else{var a=o.path,r=a.substring(0,a.lastIndexOf("/")+1)+c.path;i.path=n.normalizePath(r)}return i.path===null&&(i.path=p.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(i)},parseURL:function(D){var m=j.exec(D);return m?{scheme:m[1]||"",netLoc:m[2]||"",path:m[3]||"",params:m[4]||"",query:m[5]||"",fragment:m[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(G,"");D.length!==(D=D.replace(W,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};Z.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(Z,X,P){function V(p){var h={};function c(d){if(h[d])return h[d].exports;var i=h[d]={i:d,l:!1,exports:{}};return p[d].call(i.exports,i,i.exports,c),i.l=!0,i.exports}c.m=p,c.c=h,c.i=function(d){return d},c.d=function(d,i,a){c.o(d,i)||Object.defineProperty(d,i,{configurable:!1,enumerable:!0,get:a})},c.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},c.n=function(d){var i=d&&d.__esModule?function(){return d.default}:function(){return d};return c.d(i,"a",i),i},c.o=function(d,i){return Object.prototype.hasOwnProperty.call(d,i)},c.p="/",c.oe=function(d){throw console.error(d),d};var o=c(c.s=ENTRY_MODULE);return o.default||o}var j="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+j+").*?\\)";function G(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(p){return!isNaN(1*p)}function n(p,h,c){var o={};o[c]=[];var d=h.toString(),i=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return o;for(var a=i[1],r=new RegExp("(\\\\n|\\W)"+G(a)+M,"g"),s;s=r.exec(d);){if(s[3]==="dll-reference")continue;o[c].push(s[3])}for(r=new RegExp("\\("+G(a)+'\\("(dll-reference\\s('+j+'))"\\)\\)'+M,"g");s=r.exec(d);)p[s[2]]||(o[c].push(s[1]),p[s[2]]=P(s[1]).m),o[s[2]]=o[s[2]]||[],o[s[2]].push(s[4]);for(var S=Object.keys(o),w=0;w<S.length;w++)for(var x=0;x<o[S[w]].length;x++)W(o[S[w]][x])&&(o[S[w]][x]=1*o[S[w]][x]);return o}function D(p){var h=Object.keys(p);return h.reduce(function(c,o){return c||p[o].length>0},!1)}function m(p,h){for(var c={main:[h]},o={main:[]},d={main:{}};D(c);)for(var i=Object.keys(c),a=0;a<i.length;a++){var r=i[a],s=c[r],S=s.pop();if(d[r]=d[r]||{},d[r][S]||!p[r][S])continue;d[r][S]=!0,o[r]=o[r]||[],o[r].push(S);for(var w=n(p,p[r][S],r),x=Object.keys(w),L=0;L<x.length;L++)c[x[L]]=c[x[L]]||[],c[x[L]]=c[x[L]].concat(w[x[L]])}return o}Z.exports=function(p,h){h=h||{};var c={main:P.m},o=h.all?{main:Object.keys(c.main)}:m(c,p),d="";Object.keys(o).filter(function(S){return S!=="main"}).forEach(function(S){for(var w=0;o[S][w];)w++;o[S].push(w),c[S][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+S+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+o[S].map(function(x){return""+JSON.stringify(x)+": "+c[S][x].toString()}).join(",")+`});
`}),d=d+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+o.main.map(function(S){return""+JSON.stringify(S)+": "+c.main[S].toString()}).join(",")+"}))(self);";var i=new window.Blob([d],{type:"text/javascript"});if(h.bare)return i;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,r=a.createObjectURL(i),s=new window.Worker(r);return s.objectURL=r,s}},"./src/config.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"hlsDefaultConfig",function(){return L}),P.d(X,"mergeConfig",function(){return _}),P.d(X,"enableStreamingMode",function(){return b});var V=P("./src/controller/abr-controller.ts"),j=P("./src/controller/audio-stream-controller.ts"),M=P("./src/controller/audio-track-controller.ts"),G=P("./src/controller/subtitle-stream-controller.ts"),W=P("./src/controller/subtitle-track-controller.ts"),n=P("./src/controller/buffer-controller.ts"),D=P("./src/controller/timeline-controller.ts"),m=P("./src/controller/cap-level-controller.ts"),p=P("./src/controller/fps-controller.ts"),h=P("./src/controller/eme-controller.ts"),c=P("./src/controller/cmcd-controller.ts"),o=P("./src/utils/xhr-loader.ts"),d=P("./src/utils/fetch-loader.ts"),i=P("./src/utils/cues.ts"),a=P("./src/utils/mediakeys-helper.ts"),r=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(g){for(var f=1;f<arguments.length;f++){var C=arguments[f];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(g[E]=C[E])}return g},s.apply(this,arguments)}function S(g,f){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(g);f&&(E=E.filter(function(v){return Object.getOwnPropertyDescriptor(g,v).enumerable})),C.push.apply(C,E)}return C}function w(g){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?S(Object(C),!0).forEach(function(E){x(g,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):S(Object(C)).forEach(function(E){Object.defineProperty(g,E,Object.getOwnPropertyDescriptor(C,E))})}return g}function x(g,f,C){return f in g?Object.defineProperty(g,f,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[f]=C,g}var L=w(w({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:n.default,capLevelController:m.default,fpsController:p.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:W.default,timelineController:D.TimelineController,audioStreamController:j.default,audioTrackController:M.default,emeController:h.default,cmcdController:c.default});function O(){return{cueHandler:i.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function _(g,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return s({},g,f)}function b(g){var f=g.loader;if(f!==d.default&&f!==o.default)r.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),g.progressive=!1;else{var C=Object(d.fetchSupported)();C&&(g.loader=d.default,g.progressive=!0,g.enableSoftwareAES=!0,r.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),j=P("./src/utils/ewma-bandwidth-estimator.ts"),M=P("./src/events.ts"),G=P("./src/utils/buffer-helper.ts"),W=P("./src/errors.ts"),n=P("./src/types/loader.ts"),D=P("./src/utils/logger.ts");function m(c,o){for(var d=0;d<o.length;d++){var i=o[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function p(c,o,d){return o&&m(c.prototype,o),d&&m(c,d),c}var h=function(){function c(d){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=d;var i=d.config;this.bwEstimator=new j.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var o=c.prototype;return o.registerListeners=function(){var i=this.hls;i.on(M.Events.FRAG_LOADING,this.onFragLoading,this),i.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(M.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var i=this.hls;i.off(M.Events.FRAG_LOADING,this.onFragLoading,this),i.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(M.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(i,a){var r=a.frag;if(r.type===n.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=r,this.partCurrent=(s=a.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(i,a){var r=this.hls.config;a.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var i=this.fragCurrent,a=this.partCurrent,r=this.hls,s=r.autoLevelEnabled,S=r.config,w=r.media;if(!i||!w)return;var x=a?a.stats:i.stats,L=a?a.duration:i.duration;if(x.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||w.paused||!w.playbackRate||!w.readyState)return;var O=performance.now()-x.loading.start,_=Math.abs(w.playbackRate);if(O<=500*L/_)return;var b=r.levels,g=r.minAutoLevel,f=b[i.level],C=x.total||Math.max(x.loaded,Math.round(L*f.maxBitrate/8)),E=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/O),v=(C-x.loaded)/E,N=w.currentTime,U=(G.BufferHelper.bufferInfo(w,N,S.maxBufferHole).end-N)/_;if(U>=2*L/_||v<=U)return;var A=Number.POSITIVE_INFINITY,H;for(H=i.level-1;H>g;H--){var F=b[H].maxBitrate;if(A=L*F/(8*.8*E),A<U)break}if(A>=v)return;var T=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+i.sn+(a?" part "+a.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
Current BW estimate: `+(Object(V.isFiniteNumber)(T)?(T/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+v.toFixed(3)+` s
Estimated load time for the next fragment: `+A.toFixed(3)+` s
Time to underbuffer: `+U.toFixed(3)+" s"),r.nextLoadLevel=H,this.bwEstimator.sample(O,x.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),r.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:a,stats:x})},o.onFragLoaded=function(i,a){var r=a.frag,s=a.part;if(r.type===n.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(r.sn)){var S=s?s.stats:r.stats,w=s?s.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[r.level],L=(x.loaded?x.loaded.bytes:0)+S.loaded,O=(x.loaded?x.loaded.duration:0)+w;x.loaded={bytes:L,duration:O},x.realBitrate=Math.round(8*L/O)}if(r.bitrateTest){var _={stats:S,frag:r,part:s,id:r.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,_),r.bitrateTest=!1}}},o.onFragBuffered=function(i,a){var r=a.frag,s=a.part,S=s?s.stats:r.stats;if(S.aborted)return;if(r.type!==n.PlaylistLevelType.MAIN||r.sn==="initSegment")return;var w=S.parsing.end-S.loading.start;this.bwEstimator.sample(w,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},o.onError=function(i,a){switch(a.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var i=this.fragCurrent,a=this.partCurrent,r=this.hls,s=r.maxAutoLevel,S=r.config,w=r.minAutoLevel,x=r.media,L=a?a.duration:i?i.duration:0,O=x?x.currentTime:0,_=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,g=(G.BufferHelper.bufferInfo(x,O,S.maxBufferHole).end-O)/_,f=this.findBestLevel(b,w,s,g,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(f>=0)return f;D.logger.trace((g?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=L?Math.min(L,S.maxStarvationDelay):S.maxStarvationDelay,E=S.abrBandWidthFactor,v=S.abrBandWidthUpFactor;if(!g){var N=this.bitrateTestDelay;if(N){var U=L?Math.min(L,S.maxLoadingDelay):S.maxLoadingDelay;C=U-N,D.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),E=v=1}}return f=this.findBestLevel(b,w,s,g+C,E,v),Math.max(f,0)},o.findBestLevel=function(i,a,r,s,S,w){for(var x,L=this.fragCurrent,O=this.partCurrent,_=this.lastLoadedFragLevel,b=this.hls.levels,g=b[_],f=!!(g!=null&&(x=g.details)!==null&&x!==void 0&&x.live),C=g==null?void 0:g.codecSet,E=O?O.duration:L?L.duration:0,v=r;v>=a;v--){var N=b[v];if(!N||C&&N.codecSet!==C)continue;var U=N.details,A=(O?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||E,H=void 0;v<=_?H=S*i:H=w*i;var F=b[v].maxBitrate,T=F*A/H;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+v+"/"+Math.round(H)+"/"+F+"/"+A+"/"+s+"/"+T),H>F&&(!T||f&&!this.bitrateTestDelay||T<s))return v}return-1},p(c,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,a=this.bwEstimator;if(i!==-1&&(!a||!a.canEstimate()))return i;var r=this.getNextABRAutoLevel();return i!==-1&&(r=Math.min(i,r)),r},set:function(i){this._nextAutoLevel=i}}]),c}();X.default=h},"./src/controller/audio-stream-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),M=P("./src/events.ts"),G=P("./src/utils/buffer-helper.ts"),W=P("./src/controller/fragment-tracker.ts"),n=P("./src/types/level.ts"),D=P("./src/types/loader.ts"),m=P("./src/loader/fragment.ts"),p=P("./src/demux/chunk-cache.ts"),h=P("./src/demux/transmuxer-interface.ts"),c=P("./src/types/transmuxer.ts"),o=P("./src/controller/fragment-finders.ts"),d=P("./src/utils/discontinuities.ts"),i=P("./src/errors.ts"),a=P("./src/utils/logger.ts");function r(){return r=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var _=arguments[O];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(L[b]=_[b])}return L},r.apply(this,arguments)}function s(L,O){L.prototype=Object.create(O.prototype),L.prototype.constructor=L,S(L,O)}function S(L,O){return S=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},S(L,O)}var w=100,x=function(L){s(O,L);function O(b,g){var f;return f=L.call(this,b,g,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var _=O.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var g=this.hls;g.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.on(M.Events.ERROR,this.onError,this),g.on(M.Events.BUFFER_RESET,this.onBufferReset,this),g.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var g=this.hls;g.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.off(M.Events.ERROR,this.onError,this),g.off(M.Events.BUFFER_RESET,this.onBufferReset,this),g.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(g,f){var C=f.frag,E=f.id,v=f.initPTS;if(E==="main"){var N=C.cc;this.initPTS[C.cc]=v,this.log("InitPTS for cc: "+N+" found from main: "+v),this.videoTrackCC=N,this.state===j.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(g){if(!this.levels){this.startPosition=g,this.state=j.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(w),this.fragLoadError=0,f>0&&g===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()},_.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var g,f=this.levels,C=this.trackId,E=f==null||((g=f[C])===null||g===void 0)?void 0:g.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var v,N=performance.now(),U=this.retryDate;(!U||N>=U||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var H=A.frag,F=A.part,T=A.cache,z=A.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var Q=T.flush(),ne={frag:H,part:F,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(ne),z&&L.prototype._handleFragmentLoadComplete.call(this,ne)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var se=this.getLoadPosition(),xe=G.BufferHelper.bufferInfo(this.mediaBuffer,se,this.config.maxBufferHole),me=Object(o.fragmentWithinToleranceTest)(xe.end,this.config.maxFragLookUpTolerance,H);me<0&&(a.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+xe.end+" is needed"),this.clearWaitingFragment())}}else this.state=j.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var g=this.waitingData;g&&(this.fragmentTracker.removeFragment(g.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},_.onTickEnd=function(){var g=this.media;if(!g||!g.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:g,C=f.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=g.currentTime},_.doTickIdle=function(){var g,f,C=this.hls,E=this.levels,v=this.media,N=this.trackId,U=C.config;if(!E||!E[N])return;if(!v&&(this.startFragRequested||!U.startFragPrefetch))return;var A=E[N],H=A.details;if(!H||H.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(H)){this.state=j.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,m.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(F===null)return;var T=F.len,z=this.getMaxBufferLength(),Q=this.audioSwitch;if(T>=z&&!Q)return;if(!Q&&this._streamEnded(F,H)){C.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ne=H.fragments,se=ne[0].start,xe=F.end;if(Q){var me=this.getLoadPosition();xe=me,H.PTSKnown&&me<se&&((F.end>se||F.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),v.currentTime=se+.05))}var ve=this.getNextFragment(xe,H);if(!ve){this.bufferFlushed=!0;return}((g=ve.decryptdata)===null||g===void 0?void 0:g.keyFormat)==="identity"&&!((f=ve.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(ve,H):this.loadFragment(ve,H,xe)},_.getMaxBufferLength=function(){var g=L.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return f===null?g:Math.max(g,f.len)},_.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(g,f){var C=f.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new n.Level(E)})},_.onAudioTrackSwitching=function(g,f){var C=!!f.url;this.trackId=f.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(w):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=j.State.IDLE):this.state=j.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(g,f){this.mainDetails=f.details},_.onAudioTrackLoaded=function(g,f){var C,E=this.levels,v=f.details,N=f.id;if(!E){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+v.startSN+","+v.endSN+"],duration:"+v.totalduration);var U=E[N],A=0;if(v.live||(C=U.details)!==null&&C!==void 0&&C.live){var H=this.mainDetails;if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed||!H)return;!U.details&&v.hasProgramDateTime&&H.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(v,H),A=v.fragments[0].start):A=this.alignPlaylists(v,U.details)}U.details=v,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!v.live)&&this.setStartPosition(U.details,A),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(v)&&(this.state=j.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(g){var f,C=g.frag,E=g.part,v=g.payload,N=this.config,U=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var H=A[U];console.assert(H,"Audio track is defined on fragment load progress");var F=H.details;console.assert(F,"Audio track details are defined on fragment load progress");var T=N.defaultAudioCodec||H.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new h.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[C.cc],ne=(f=C.initSegment)===null||f===void 0?void 0:f.data;if(Q!==void 0){var se=!1,xe=E?E.index:-1,me=xe!==-1,ve=new c.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,v.byteLength,xe,me);z.push(v,ne,T,"",C,E,F.totalduration,se,ve,Q)}else{a.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+U);var Oe=this.waitingData=this.waitingData||{frag:C,part:E,cache:new p.default,complete:!1},Re=Oe.cache;Re.push(new Uint8Array(v)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(g){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,g)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(g,f){var C=f.tracks.audio;C&&(this.mediaBuffer=C.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},_.onFragBuffered=function(g,f){var C=f.frag,E=f.part;if(C.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(E?" p: "+E.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,E)},_.onError=function(g,f){switch(f.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,f);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==j.State.ERROR&&this.state!==j.State.STOPPED&&(this.state=f.fatal?j.State.ERROR:j.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var C=!0,E=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);E&&E.len>.5&&(C=!this.reduceMaxBufferLength(E.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(g,f){var C=f.type;C===m.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(g){var f,C="audio",E=this.hls,v=g.remuxResult,N=g.chunkMeta,U=this.getCurrentContext(N);if(!U){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 A=U.frag,H=U.part,F=v.audio,T=v.text,z=v.id3,Q=v.initSegment;if(this.fragContextChanged(A))return;if(this.state=j.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,A,N),E.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:C,tracks:Q.tracks})),F){var ne=F.startPTS,se=F.endPTS,xe=F.startDTS,me=F.endDTS;H&&(H.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:se,startDTS:xe,endDTS:me}),A.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,ne,se,xe,me),this.bufferFragmentData(F,A,H,N)}if(z!=null&&(f=z.samples)!==null&&f!==void 0&&f.length){var ve=r({frag:A,id:C},z);E.trigger(M.Events.FRAG_PARSING_METADATA,ve)}if(T){var Oe=r({frag:A,id:C},T);E.trigger(M.Events.FRAG_PARSING_USERDATA,Oe)}},_._bufferInitSegment=function(g,f,C){if(this.state!==j.State.PARSING)return;g.video&&delete g.video;var E=g.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,g);var v=E.initSegment;if(v!=null&&v.byteLength){var N={type:"audio",frag:f,part:null,chunkMeta:C,parent:f.type,data:v};this.hls.trigger(M.Events.BUFFER_APPENDING,N)}this.tick()},_.loadFragment=function(g,f,C){var E=this.fragmentTracker.getState(g);this.fragCurrent=g,(this.audioSwitch||E===W.FragmentState.NOT_LOADED||E===W.FragmentState.PARTIAL)&&(g.sn==="initSegment"?this._loadInitSegment(g):f.live&&!Object(V.isFiniteNumber)(this.initPTS[g.cc])?(this.log("Waiting for video PTS in continuity counter "+g.cc+" of live stream before loading audio fragment "+g.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,g,f,C)))},_.completeAudioSwitch=function(){var g=this.hls,f=this.media,C=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,g.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:C})},O}(j.default);X.default=x},"./src/controller/audio-track-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),j=P("./src/errors.ts"),M=P("./src/controller/base-playlist-controller.ts"),G=P("./src/types/loader.ts");function W(h,c){for(var o=0;o<c.length;o++){var d=c[o];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(h,d.key,d)}}function n(h,c,o){return c&&W(h.prototype,c),o&&W(h,o),h}function D(h,c){h.prototype=Object.create(c.prototype),h.prototype.constructor=h,m(h,c)}function m(h,c){return m=Object.setPrototypeOf||function(d,i){return d.__proto__=i,d},m(h,c)}var p=function(h){D(c,h);function c(d){var i;return i=h.call(this,d,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var o=c.prototype;return o.registerListeners=function(){var i=this.hls;i.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(V.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var i=this.hls;i.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(V.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,h.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(i,a){this.tracks=a.audioTracks||[]},o.onAudioTrackLoaded=function(i,a){var r=a.id,s=a.details,S=this.tracksInGroup[r];if(!S){this.warn("Invalid audio track id "+r);return}var w=S.details;S.details=a.details,this.log("audioTrack "+r+" loaded ["+s.startSN+"-"+s.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,a,w))},o.onLevelLoading=function(i,a){this.switchLevel(a.level)},o.onLevelSwitching=function(i,a){this.switchLevel(a.level)},o.switchLevel=function(i){var a=this.hls.levels[i];if(!(a!=null&&a.audioGroupIds))return;var r=a.audioGroupIds[a.urlId];if(this.groupId!==r){this.groupId=r;var s=this.tracks.filter(function(w){return!r||w.groupId===r});this.selectDefaultTrack&&!s.some(function(w){return w.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var S={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},o.onError=function(i,a){if(h.prototype.onError.call(this,i,a),a.fatal||!a.context)return;a.context.type===G.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},o.setAudioTrack=function(i){var a=this.tracksInGroup;if(i<0||i>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var r=a[this.trackId];this.log("Now switching to audio-track index "+i);var s=a[i],S=s.id,w=s.groupId,x=w===void 0?"":w,L=s.name,O=s.type,_=s.url;if(this.trackId=i,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:x,name:L,type:O,url:_}),s.details&&!s.details.live)return;var b=this.switchParams(s.url,r==null?void 0:r.details);this.loadPlaylist(b)},o.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,r=this.findTrackId(a)||this.findTrackId();r!==-1?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(i){for(var a=this.tracksInGroup,r=0;r<a.length;r++){var s=a[r];if((!this.selectDefaultTrack||s.default)&&(!i||i===s.name))return s.id}return-1},o.loadPlaylist=function(i){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var r=a.id,s=a.groupId,S=a.url;if(i)try{S=i.addDirectives(S)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:S,id:r,groupId:s,deliveryDirectives:i||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),c}(M.default);X.default=p},"./src/controller/base-playlist-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return n});var V=P("./src/polyfills/number.ts"),j=P("./src/types/level.ts"),M=P("./src/controller/level-helper.ts"),G=P("./src/utils/logger.ts"),W=P("./src/errors.ts"),n=function(){function D(p,h){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,h+":"),this.warn=G.logger.warn.bind(G.logger,h+":"),this.hls=p}var m=D.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(h,c){c.fatal&&c.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},m.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},m.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},m.stopLoad=function(){this.canLoad=!1,this.clearTimer()},m.switchParams=function(h,c){var o=c==null?void 0:c.renditionReports;if(o)for(var d=0;d<o.length;d++){var i=o[d],a=""+i.URI;if(a===h.substr(-a.length)){var r=parseInt(i["LAST-MSN"]),s=parseInt(i["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var S=Math.min(c.age-c.partTarget,c.targetduration);s!==void 0&&S>c.partTarget&&(s+=1)}if(Object(V.isFiniteNumber)(r))return new j.HlsUrlParameters(r,Object(V.isFiniteNumber)(s)?s:void 0,j.HlsSkip.No)}}},m.loadPlaylist=function(h){},m.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},m.playlistLoaded=function(h,c,o){var d=this,i=c.details,a=c.stats,r=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(i.advancedDateTime=Date.now()-r,i.live||o!=null&&o.live){if(i.reloaded(o),o&&this.log("live playlist "+h+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),o&&i.fragments.length>0&&Object(M.mergeDetails)(o,i),!this.canLoad||!i.live)return;var s,S=void 0,w=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var x=this.hls.config.lowLatencyMode,L=i.lastPartSn,O=i.endSN,_=i.lastPartIndex,b=_!==-1,g=L===O,f=x?0:_;b?(S=g?O+1:L,w=g?f:_+1):S=O+1;var C=i.age,E=C+i.ageHeader,v=Math.min(E-i.partTarget,i.targetduration*1.5);if(v>0){if(o&&v>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+v+" with playlist age: "+i.age),v=0;else{var N=Math.floor(v/i.targetduration);if(S+=N,w!==void 0){var U=Math.round(v%i.targetduration/i.partTarget);w+=U}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+v+" skip sn "+N+" to part "+w)}i.tuneInGoal=v}if(s=this.getDeliveryDirectives(i,c.deliveryDirectives,S,w),x||!g){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(i,c.deliveryDirectives,S,w);var A=Object(M.computeReloadInterval)(i,a);S!==void 0&&i.canBlockReload&&(A-=i.partTarget||1),this.log("reload live playlist "+h+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(s)},A)}else this.clearTimer()},m.getDeliveryDirectives=function(h,c,o,d){var i=Object(j.getSkipValue)(h,o);return c!=null&&c.skip&&h.deltaUpdateFailed&&(o=c.msn,d=c.part,i=j.HlsSkip.No),new j.HlsUrlParameters(o,d,i)},m.retryLoadingOrFail=function(h){var c=this,o=this.hls.config,d=this.retryCount<o.levelLoadingMaxRetry;if(d){var i;if(this.retryCount++,h.details.indexOf("LoadTimeOut")>-1&&(i=h.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+h.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+h.details+'"')}}else this.warn('cannot recover from error "'+h.details+'"'),this.clearTimer(),h.fatal=!0;return d},D}()},"./src/controller/base-stream-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"State",function(){return O}),P.d(X,"default",function(){return _});var V=P("./src/polyfills/number.ts"),j=P("./src/task-loop.ts"),M=P("./src/controller/fragment-tracker.ts"),G=P("./src/utils/buffer-helper.ts"),W=P("./src/utils/logger.ts"),n=P("./src/events.ts"),D=P("./src/errors.ts"),m=P("./src/types/transmuxer.ts"),p=P("./src/utils/mp4-tools.ts"),h=P("./src/utils/discontinuities.ts"),c=P("./src/controller/fragment-finders.ts"),o=P("./src/controller/level-helper.ts"),d=P("./src/loader/fragment-loader.ts"),i=P("./src/crypt/decrypter.ts"),a=P("./src/utils/time-ranges.ts"),r=P("./src/types/loader.ts");function s(b,g){for(var f=0;f<g.length;f++){var C=g[f];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(b,C.key,C)}}function S(b,g,f){return g&&s(b.prototype,g),f&&s(b,f),b}function w(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function x(b,g){b.prototype=Object.create(g.prototype),b.prototype.constructor=b,L(b,g)}function L(b,g){return L=Object.setPrototypeOf||function(C,E){return C.__proto__=E,C},L(b,g)}var O={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},_=function(b){x(g,b);function g(C,E,v){var N;return N=b.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=O.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=v,N.log=W.logger.log.bind(W.logger,v+":"),N.warn=W.logger.warn.bind(W.logger,v+":"),N.hls=C,N.fragmentLoader=new d.default(C.config),N.fragmentTracker=E,N.config=C.config,N.decrypter=new i.default(C,C.config),C.on(n.Events.KEY_LOADED,N.onKeyLoaded,w(N)),N}var f=g.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(E){},f.stopLoad=function(){this.fragmentLoader.abort();var E=this.fragCurrent;E&&this.fragmentTracker.removeFragment(E),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},f._streamEnded=function(E,v){var N=this.fragCurrent,U=this.fragmentTracker;if(!v.live&&N&&N.sn===v.endSN&&!E.nextStart){var A=U.getState(N);return A===M.FragmentState.PARTIAL||A===M.FragmentState.OK}return!1},f.onMediaAttached=function(E,v){var N=this.media=this.mediaBuffer=v.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(U.startPosition)},f.onMediaDetaching=function(){var E=this.media;E!=null&&E.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),E&&(E.removeEventListener("seeking",this.onvseeking),E.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},f.onMediaSeeking=function(){var E=this.config,v=this.fragCurrent,N=this.media,U=this.mediaBuffer,A=this.state,H=N?N.currentTime:0,F=G.BufferHelper.bufferInfo(U||N,H,E.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+A),A===O.ENDED)this.resetLoadingState();else if(v&&!F.len){var T=E.maxFragLookUpTolerance,z=v.start-T,Q=v.start+v.duration+T,ne=H>Q;(H<z||ne)&&(ne&&v.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),v.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=H),!this.loadedmetadata&&!F.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(E,v){if(this.state!==O.KEY_LOADING||v.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var N=this.levels[v.frag.level].details;N&&this.loadFragment(v.frag,N,v.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(n.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,b.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(E,v){this.log("Loading key for "+E.sn+" of ["+v.startSN+"-"+v.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=O.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(n.Events.KEY_LOADING,{frag:E})},f.loadFragment=function(E,v,N){this._loadFragForPlayback(E,v,N)},f._loadFragForPlayback=function(E,v,N){var U=this,A=function(F){if(U.fragContextChanged(E)){U.warn("Fragment "+E.sn+(F.part?" p: "+F.part.index:"")+" of level "+E.level+" was dropped during download."),U.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,U._handleFragmentLoadProgress(F)};this._doFragLoad(E,v,N,A).then(function(H){if(!H)return;U.fragLoadError=0;var F=U.state;if(U.fragContextChanged(E)){(F===O.FRAG_LOADING||F===O.BACKTRACKING||!U.fragCurrent&&F===O.PARSING)&&(U.fragmentTracker.removeFragment(E),U.state=O.IDLE);return}if("payload"in H&&(U.log("Loaded fragment "+E.sn+" of level "+E.level),U.hls.trigger(n.Events.FRAG_LOADED,H),U.state===O.BACKTRACKING)){U.fragmentTracker.backtrack(E,H),U.resetFragmentLoading(E);return}U._handleFragmentLoadComplete(H)}).catch(function(H){U.warn(H),U.resetFragmentLoading(E)})},f.flushMainBuffer=function(E,v,N){if(N===void 0&&(N=null),!(E-v))return;var U={startOffset:E,endOffset:v,type:N};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,U)},f._loadInitSegment=function(E){var v=this;this._doFragLoad(E).then(function(N){if(!N||v.fragContextChanged(E)||!v.levels)throw new Error("init load aborted");return N}).then(function(N){var U=v.hls,A=N.payload,H=E.decryptdata;if(A&&A.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var F=self.performance.now();return v.decrypter.webCryptoDecrypt(new Uint8Array(A),H.key.buffer,H.iv.buffer).then(function(T){var z=self.performance.now();return U.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:T,stats:{tstart:F,tdecrypt:z}}),N.payload=T,N})}return N}).then(function(N){var U=v.fragCurrent,A=v.hls,H=v.levels;if(!H)throw new Error("init load aborted, missing levels");var F=H[E.level].details;console.assert(F,"Level details are defined when init segment is loaded");var T=E.stats;v.state=O.IDLE,v.fragLoadError=0,E.data=new Uint8Array(N.payload),T.parsing.start=T.buffering.start=self.performance.now(),T.parsing.end=T.buffering.end=self.performance.now(),N.frag===U&&A.trigger(n.Events.FRAG_BUFFERED,{stats:T,frag:U,part:null,id:E.type}),v.tick()}).catch(function(N){v.warn(N),v.resetFragmentLoading(E)})},f.fragContextChanged=function(E){var v=this.fragCurrent;return!E||!v||E.level!==v.level||E.sn!==v.sn||E.urlId!==v.urlId},f.fragBufferedComplete=function(E,v){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(v?" part: "+v.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+a.default.toString(G.BufferHelper.getBuffered(N))),this.state=O.IDLE,this.tick()},f._handleFragmentLoadComplete=function(E){var v=this.transmuxer;if(!v)return;var N=E.frag,U=E.part,A=E.partsLoaded,H=!A||A.length===0||A.some(function(T){return!T}),F=new m.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,U?U.index:-1,!H);v.flush(F)},f._handleFragmentLoadProgress=function(E){},f._doFragLoad=function(E,v,N,U){var A=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(E.start,N||0),this.config.lowLatencyMode&&v){var H=v.partList;if(H&&U){N>E.end&&v.fragmentHint&&(E=v.fragmentHint);var F=this.getNextPart(H,E,N);if(F>-1){var T=H[F];return this.log("Loading part sn: "+E.sn+" p: "+T.index+" cc: "+E.cc+" of playlist ["+v.startSN+"-"+v.endSN+"] parts [0-"+F+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=T.start+T.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:H[F],targetBufferTime:N}),this.doFragPartsLoad(E,H,F,U).catch(function(z){return A.handleFragLoadError(z)})}else if(!E.url||this.loadedEndOfParts(H,N))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(v?"of ["+v.startSN+"-"+v.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(N.toFixed(3))),Object(V.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:N}),this.fragmentLoader.load(E,U).catch(function(z){return A.handleFragLoadError(z)})},f.doFragPartsLoad=function(E,v,N,U){var A=this;return new Promise(function(H,F){var T=[],z=function Q(ne){var se=v[ne];A.fragmentLoader.loadPart(E,se,U).then(function(xe){T[se.index]=xe;var me=xe.part;A.hls.trigger(n.Events.FRAG_LOADED,xe);var ve=v[ne+1];if(ve&&ve.fragment===E)Q(ne+1);else return H({frag:E,part:me,partsLoaded:T})}).catch(F)};z(N)})},f.handleFragLoadError=function(E){var v=E.data;return v&&v.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(v.frag,v.part):this.hls.trigger(n.Events.ERROR,v),null},f._handleTransmuxerFlush=function(E){var v=this.getCurrentContext(E);if(!v||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var N=v.frag,U=v.part,A=v.level,H=self.performance.now();N.stats.parsing.end=H,U&&(U.stats.parsing.end=H),this.updateLevelTiming(N,U,A,E.partial)},f.getCurrentContext=function(E){var v=this.levels,N=E.level,U=E.sn,A=E.part;if(!v||!v[N])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+N+". The current chunk will not be buffered."),null;var H=v[N],F=A>-1?Object(o.getPartWith)(H,U,A):null,T=F?F.fragment:Object(o.getFragmentWithSN)(H,U,this.fragCurrent);return T?{frag:T,part:F,level:H}:null},f.bufferFragmentData=function(E,v,N,U){if(!E||this.state!==O.PARSING)return;var A=E.data1,H=E.data2,F=A;if(A&&H&&(F=Object(p.appendUint8Array)(A,H)),!F||!F.length)return;var T={type:E.type,frag:v,part:N,chunkMeta:U,parent:v.type,data:F};this.hls.trigger(n.Events.BUFFER_APPENDING,T),E.dropped&&E.independent&&!N&&this.flushBufferGap(v)},f.flushBufferGap=function(E){var v=this.media;if(!v)return;if(!G.BufferHelper.isBuffered(v,v.currentTime)){this.flushMainBuffer(0,E.start);return}var N=v.currentTime,U=G.BufferHelper.bufferInfo(v,N,0),A=E.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),F=Math.max(Math.min(E.start-H,U.end-H),N+H);E.start-F>H&&this.flushMainBuffer(F,E.start)},f.getFwdBufferInfo=function(E,v){var N=this.config,U=this.getLoadPosition();if(!Object(V.isFiniteNumber)(U))return null;var A=G.BufferHelper.bufferInfo(E,U,N.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(U,v);if(H&&A.nextStart<H.end)return G.BufferHelper.bufferInfo(E,U,Math.max(A.nextStart,N.maxBufferHole))}return A},f.getMaxBufferLength=function(E){var v=this.config,N;return E?N=Math.max(8*v.maxBufferSize/E,v.maxBufferLength):N=v.maxBufferLength,Math.min(N,v.maxMaxBufferLength)},f.reduceMaxBufferLength=function(E){var v=this.config,N=E||v.maxBufferLength;return v.maxMaxBufferLength>=N?(v.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+v.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(E,v){var N,U,A=v.fragments,H=A.length;if(!H)return null;var F=this.config,T=A[0].start,z;if(v.live){var Q=F.initialLiveManifestSize;if(H<Q)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+Q+")"),null;!v.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(v,A),this.startPosition=z?this.hls.liveSyncPosition||z.start:E)}else E<=T&&(z=A[0]);if(!z){var ne=F.lowLatencyMode?v.partEnd:v.fragmentEnd;z=this.getFragmentAtPosition(E,ne,v)}return(N=z)!==null&&N!==void 0&&N.initSegment&&!((U=z)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},f.getNextPart=function(E,v,N){for(var U=-1,A=!1,H=!0,F=0,T=E.length;F<T;F++){var z=E[F];if(H=H&&!z.independent,U>-1&&N<z.start)break;var Q=z.loaded;!Q&&(A||z.independent||H)&&z.fragment===v&&(U=F),A=Q}return U},f.loadedEndOfParts=function(E,v){var N=E[E.length-1];return N&&v>N.start&&N.loaded},f.getInitialLiveFragment=function(E,v){var N=this.fragPrevious,U=null;if(N){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),U=Object(c.findFragmentByPDT)(v,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var A=N.sn+1;if(A>=E.startSN&&A<=E.endSN){var H=v[A-E.startSN];N.cc===H.cc&&(U=H,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(c.findFragWithCC)(v,N.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(U=this.getFragmentAtPosition(F,this.bitrateTest?E.fragmentEnd:E.edge,E))}return U},f.getFragmentAtPosition=function(E,v,N){var U=this.config,A=this.fragPrevious,H=N.fragments,F=N.endSN,T=N.fragmentHint,z=U.maxFragLookUpTolerance,Q=!!(U.lowLatencyMode&&N.partList&&T);Q&&T&&!this.bitrateTest&&(H=H.concat(T),F=T.sn);var ne;if(E<v){var se=E>v-z?0:z;ne=Object(c.findFragmentByPTS)(A,H,E,se)}else ne=H[H.length-1];if(ne){var xe=ne.sn-N.startSN,me=A&&ne.level===A.level,ve=H[xe+1],Oe=this.fragmentTracker.getState(ne);if(Oe===M.FragmentState.BACKTRACKED){ne=null;for(var Re=xe;H[Re]&&this.fragmentTracker.getState(H[Re])===M.FragmentState.BACKTRACKED;)A?ne=H[Re--]:ne=H[--Re];ne||(ne=ve)}else A&&ne.sn===A.sn&&!Q&&(me&&(ne.sn<F&&this.fragmentTracker.getState(ve)!==M.FragmentState.OK?(this.log("SN "+ne.sn+" just loaded, load next one: "+ve.sn),ne=ve):ne=null))}return ne},f.synchronizeToLiveEdge=function(E){var v=this.config,N=this.media;if(!N)return;var U=this.hls.liveSyncPosition,A=N.currentTime,H=E.fragments[0].start,F=E.edge,T=A>=H-v.maxFragLookUpTolerance&&A<=F;if(U!==null&&N.duration>U&&(A<U||!T)){var z=v.liveMaxLatencyDuration!==void 0?v.liveMaxLatencyDuration:v.liveMaxLatencyDurationCount*E.targetduration;(!T&&N.readyState<4||A<F-z)&&(this.loadedmetadata||(this.nextLoadPosition=U),N.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+F+", reset currentTime to : "+U.toFixed(3)),N.currentTime=U))}},f.alignPlaylists=function(E,v){var N=this.levels,U=this.levelLastLoaded,A=this.fragPrevious,H=U!==null?N[U]:null,F=E.fragments.length;if(!F)return this.warn("No fragments in live playlist"),0;var T=E.fragments[0].start,z=!v,Q=E.alignedSliding&&Object(V.isFiniteNumber)(T);if(z||!Q&&!T){Object(h.alignStream)(A,H,E);var ne=E.fragments[0].start;return this.log("Live playlist sliding: "+ne.toFixed(2)+" start-sn: "+(v?v.startSN:"na")+"->"+E.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+F),ne}return T},f.waitForCdnTuneIn=function(E){var v=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*v)},f.setStartPosition=function(E,v){var N=this.startPosition;if(N<v&&(N=-1),N===-1||this.lastCurrentTime===-1){var U=E.startTimeOffset;Object(V.isFiniteNumber)(U)?(N=v+U,U<0&&(N+=E.totalduration),N=Math.min(Math.max(v,N),v+E.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+N),this.startPosition=N):E.live?N=this.hls.liveSyncPosition||v:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},f.getLoadPosition=function(){var E=this.media,v=0;return this.loadedmetadata&&E?v=E.currentTime:this.nextLoadPosition&&(v=this.nextLoadPosition),v},f.handleFragLoadAborted=function(E,v){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(v?" part"+v.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},f.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=O.IDLE)},f.onFragmentOrKeyLoadError=function(E,v){if(v.fatal)return;var N=v.frag;if(!N||N.type!==E)return;var U=this.fragCurrent;console.assert(U&&N.sn===U.sn&&N.level===U.level&&N.urlId===U.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+E+" "+N.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else v.levelRetry?(E===r.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(W.logger.error(v.details+" reaches max retry, redispatch as fatal ..."),v.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},f.afterBufferFlushed=function(E,v,N){if(!E)return;var U=G.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(v,U,N),this.state===O.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},f.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var v=this.levels?this.levels[E].details:null;if(v!=null&&v.live)return this.startPosition=-1,this.setStartPosition(v,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(E,v,N,U){var A=this,H=N.details;console.assert(!!H,"level.details must be defined");var F=Object.keys(E.elementaryStreams).reduce(function(T,z){var Q=E.elementaryStreams[z];if(Q){var ne=Q.endPTS-Q.startPTS;if(ne<=0)return A.warn("Could not parse fragment "+E.sn+" "+z+" duration reliably ("+ne+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),T||!1;var se=U?0:Object(o.updateFragPTSDTS)(H,E,Q.startPTS,Q.endPTS,Q.startDTS,Q.endDTS);return A.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:H,level:N,drift:se,type:z,frag:E,start:Q.startPTS,end:Q.endPTS}),!0}return T},!1);F?(this.state=O.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:E,part:v})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(g,[{key:"state",get:function(){return this._state},set:function(E){var v=this._state;v!==E&&(this._state=E,this.log(v+"->"+E))}}]),g}(j.default)},"./src/controller/buffer-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c});var V=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),M=P("./src/utils/logger.ts"),G=P("./src/errors.ts"),W=P("./src/utils/buffer-helper.ts"),n=P("./src/utils/mediasource-helper.ts"),D=P("./src/loader/fragment.ts"),m=P("./src/controller/buffer-operation-queue.ts"),p=Object(n.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function o(i){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 r=a.hls,s=a.media,S=a.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),s&&(a.updateMediaElementDuration(),r.trigger(j.Events.MEDIA_ATTACHED,{media:s})),S&&S.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=i,this._initSourceBuffer(),this.registerListeners()}var d=o.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var a=this.hls;a.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(j.Events.BUFFER_RESET,this.onBufferReset,this),a.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(j.Events.BUFFER_EOS,this.onBufferEos,this),a.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(j.Events.FRAG_PARSED,this.onFragParsed,this),a.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var a=this.hls;a.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(j.Events.BUFFER_RESET,this.onBufferReset,this),a.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(j.Events.BUFFER_EOS,this.onBufferEos,this),a.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(j.Events.FRAG_PARSED,this.onFragParsed,this),a.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new m.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(a,r){var s=2;(r.audio&&!r.video||!r.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(a,r){var s=this.media=r.media;if(s&&p){var S=this.mediaSource=new p;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(S),this._objectUrl=s.src}},d.onMediaDetaching=function(){var a=this.media,r=this.mediaSource,s=this._objectUrl;if(r){if(M.logger.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(S){M.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(s&&self.URL.revokeObjectURL(s),a.src===s?(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(j.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(r){var s=a.sourceBuffer[r];try{s&&(a.removeBufferListeners(r),a.mediaSource&&a.mediaSource.removeSourceBuffer(s),a.sourceBuffer[r]=void 0)}catch(S){M.logger.warn("[buffer-controller]: Failed to reset the "+r+" buffer",S)}}),this._initSourceBuffer()},d.onBufferCodecs=function(a,r){var s=this,S=this.getSourceBufferTypes().length;if(Object.keys(r).forEach(function(w){if(S){var x=s.tracks[w];if(x&&typeof x.buffer.changeType=="function"){var L=r[w],O=L.codec,_=L.levelCodec,b=L.container,g=(x.levelCodec||x.codec).replace(h,"$1"),f=(_||O).replace(h,"$1");if(g!==f){var C=b+";codecs="+(_||O);s.appendChangeType(w,C)}}}else s.pendingTracks[w]=r[w]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(a,r){var s=this,S=this.operationQueue,w={execute:function(){var L=s.sourceBuffer[a];L&&(M.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+r),L.changeType(r)),S.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(L){M.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",L)}};S.append(w,a)},d.onBufferAppending=function(a,r){var s=this,S=this.hls,w=this.operationQueue,x=this.tracks,L=r.data,O=r.type,_=r.frag,b=r.part,g=r.chunkMeta,f=g.buffering[O],C=self.performance.now();f.start=C;var E=_.stats.buffering,v=b?b.stats.buffering:null;E.start===0&&(E.start=C),v&&v.start===0&&(v.start=C);var N=x.audio,U=O==="audio"&&g.id===1&&(N==null?void 0:N.container)==="audio/mpeg",A={execute:function(){if(f.executeStart=self.performance.now(),U){var F=s.sourceBuffer[O];if(F){var T=_.start-F.timestampOffset;Math.abs(T)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+T+") sn: "+_.sn+")"),F.timestampOffset=_.start)}}s.appendExecutor(L,O)},onStart:function(){},onComplete:function(){var F=self.performance.now();f.executeEnd=f.end=F,E.first===0&&(E.first=F),v&&v.first===0&&(v.first=F);var T=s.sourceBuffer,z={};for(var Q in T)z[Q]=W.BufferHelper.getBuffered(T[Q]);s.appendError=0,s.hls.trigger(j.Events.BUFFER_APPENDED,{type:O,frag:_,part:b,chunkMeta:g,parent:_.type,timeRanges:z})},onError:function(F){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",F);var T={type:G.ErrorTypes.MEDIA_ERROR,parent:_.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?T.details=G.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,T.details=G.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>S.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),T.fatal=!0)),S.trigger(j.Events.ERROR,T)}};w.append(A,O)},d.onBufferFlushing=function(a,r){var s=this,S=this.operationQueue,w=function(L){return{execute:s.removeExecutor.bind(s,L,r.startOffset,r.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(j.Events.BUFFER_FLUSHED,{type:L})},onError:function(_){M.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",_)}}};r.type?S.append(w(r.type),r.type):this.getSourceBufferTypes().forEach(function(x){S.append(w(x),x)})},d.onFragParsed=function(a,r){var s=this,S=r.frag,w=r.part,x=[],L=w?w.elementaryStreams:S.elementaryStreams;L[D.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(L[D.ElementaryStreamTypes.AUDIO]&&x.push("audio"),L[D.ElementaryStreamTypes.VIDEO]&&x.push("video"));var O=function(){var b=self.performance.now();S.stats.buffering.end=b,w&&(w.stats.buffering.end=b);var g=w?w.stats:S.stats;s.hls.trigger(j.Events.FRAG_BUFFERED,{frag:S,part:w,stats:g,id:S.type})};x.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(O,x)},d.onFragChanged=function(a,r){this.flushBackBuffer()},d.onBufferEos=function(a,r){var s=this,S=this.getSourceBufferTypes().reduce(function(w,x){var L=s.sourceBuffer[x];return(!r.type||r.type===x)&&(L&&!L.ended&&(L.ended=!0,M.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),w&&!!(!L||L.ended)},!0);S&&this.blockBuffers(function(){var w=s.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},d.onLevelUpdated=function(a,r){var s=r.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var a=this.hls,r=this.details,s=this.media,S=this.sourceBuffer;if(!s||r===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var x=r.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(V.isFiniteNumber)(x)||x<0)return;var L=s.currentTime,O=r.levelTargetDuration,_=Math.max(x,O),b=Math.floor(L/O)*O-_;w.forEach(function(g){var f=S[g];if(f){var C=W.BufferHelper.getBuffered(f);C.length>0&&b>C.start(0)&&(a.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),r.live&&a.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),a.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:g}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,r=this.hls,s=this.media,S=this.mediaSource,w=a.fragments[0].start+a.totalduration,x=s.duration,L=Object(V.isFiniteNumber)(S.duration)?S.duration:0;a.live&&r.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(a)):(w>L&&w>x||!Object(V.isFiniteNumber)(x))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),S.duration=w)},d.updateSeekableRange=function(a){var r=this.mediaSource,s=a.fragments,S=s.length;if(S&&a.live&&r!==null&&r!==void 0&&r.setLiveSeekableRange){var w=Math.max(0,s[0].start),x=Math.max(w,w+a.totalduration);r.setLiveSeekableRange(w,x)}},d.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,r=this.operationQueue,s=this.pendingTracks,S=Object.keys(s).length;if(S&&!a||S===2){this.createSourceBuffers(s),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(j.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}w.forEach(function(x){r.executeNext(x)})}},d.createSourceBuffers=function(a){var r=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var w in a)if(!r[w]){var x=a[w];if(!x)throw Error("source buffer exists for track "+w+", however track does not");var L=x.levelCodec||x.codec,O=x.container+";codecs="+L;M.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var _=r[w]=s.addSourceBuffer(O),b=w;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[w]={buffer:_,codec:L,container:x.container,levelCodec:x.levelCodec,id:x.id},S++}catch(g){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+g.message),this.hls.trigger(j.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:g,mimeType:O})}}S&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(a){var r=this.operationQueue,s=r.current(a);s.onStart()},d._onSBUpdateEnd=function(a){var r=this.operationQueue,s=r.current(a);s.onComplete(),r.shiftAndExecuteNext(a)},d._onSBUpdateError=function(a,r){M.logger.error("[buffer-controller]: "+a+" SourceBuffer error",r),this.hls.trigger(j.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(a);s&&s.onError(r)},d.removeExecutor=function(a,r,s){var S=this.media,w=this.mediaSource,x=this.operationQueue,L=this.sourceBuffer,O=L[a];if(!S||!w||!O){M.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(a);return}var _=Object(V.isFiniteNumber)(S.duration)?S.duration:Infinity,b=Object(V.isFiniteNumber)(w.duration)?w.duration:Infinity,g=Math.max(0,r),f=Math.min(s,_,b);f>g?(M.logger.log("[buffer-controller]: Removing ["+g+","+f+"] from the "+a+" SourceBuffer"),console.assert(!O.updating,a+" sourceBuffer must not be updating"),O.remove(g,f)):x.shiftAndExecuteNext(a)},d.appendExecutor=function(a,r){var s=this.operationQueue,S=this.sourceBuffer,w=S[r];if(!w){M.logger.warn("[buffer-controller]: Attempting to append to the "+r+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(r);return}w.ended=!1,console.assert(!w.updating,r+" sourceBuffer must not be updating"),w.appendBuffer(a)},d.blockBuffers=function(a,r){var s=this;if(r===void 0&&(r=this.getSourceBufferTypes()),!r.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var S=this.operationQueue,w=r.map(function(x){return S.appendBlocker(x)});Promise.all(w).then(function(){a(),r.forEach(function(x){var L=s.sourceBuffer[x];(!L||!L.updating)&&S.shiftAndExecuteNext(x)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(a,r,s){var S=this.sourceBuffer[a];if(!S)return;var w=s.bind(this,a);this.listeners[a].push({event:r,listener:w}),S.addEventListener(r,w)},d.removeBufferListeners=function(a){var r=this.sourceBuffer[a];if(!r)return;this.listeners[a].forEach(function(s){r.removeEventListener(s.event,s.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return j});var V=P("./src/utils/logger.ts"),j=function(){function M(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var G=M.prototype;return G.append=function(n,D){var m=this.queues[D];m.push(n),m.length===1&&this.buffers[D]&&this.executeNext(D)},G.insertAbort=function(n,D){var m=this.queues[D];m.unshift(n),this.executeNext(D)},G.appendBlocker=function(n){var D,m=new Promise(function(h){D=h}),p={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,n),m},G.executeNext=function(n){var D=this.buffers,m=this.queues,p=D[n],h=m[n];if(h.length){var c=h[0];try{c.execute()}catch(o){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(o),(!p||!p.updating)&&(h.shift(),this.executeNext(n))}}},G.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},G.current=function(n){return this.queues[n][0]},M}()},"./src/controller/cap-level-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts");function j(W,n){for(var D=0;D<n.length;D++){var m=n[D];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(W,m.key,m)}}function M(W,n,D){return n&&j(W.prototype,n),D&&j(W,D),W}var G=function(){function W(D){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=W.prototype;return n.setStreamController=function(m){this.streamController=m},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var m=this.hls;m.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var m=this.hls;m.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(m,p){W.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},n.onMediaAttaching=function(m,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},n.onManifestParsed=function(m,p){var h=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,h.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onBufferCodecs=function(m,p){var h=this.hls;h.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var m=this.hls.levels;if(m.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(m.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},n.getMaxLevel=function(m){var p=this,h=this.hls.levels;if(!h.length)return-1;var c=h.filter(function(o,d){return W.isLevelAllowed(d,p.restrictedLevels)&&d<=m});return this.clientRect=null,W.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},n.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()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var m=this.media,p={width:0,height:0};if(m){var h=m.getBoundingClientRect();p.width=h.width,p.height=h.height,!p.width&&!p.height&&(p.width=h.right-h.left||m.width||0,p.height=h.bottom-h.top||m.height||0)}return this.clientRect=p,p},W.isLevelAllowed=function(m,p){return p===void 0&&(p=[]),p.indexOf(m)===-1},W.getMaxLevelByMediaSize=function(m,p,h){if(!m||!m.length)return-1;for(var c=function(r,s){return s?r.width!==s.width||r.height!==s.height:!0},o=m.length-1,d=0;d<m.length;d+=1){var i=m[d];if((i.width>=p||i.height>=h)&&c(i,m[d+1])){o=d;break}}return o},M(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var m=1;try{m=self.devicePixelRatio}catch(p){}return m}}]),W}();X.default=G},"./src/controller/cmcd-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c});var V=P("./src/events.ts"),j=P("./src/types/cmcd.ts"),M=P("./src/utils/buffer-helper.ts"),G=P("./src/utils/logger.ts");function W(o,d){for(var i=0;i<d.length;i++){var a=d[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function n(o,d,i){return d&&W(o.prototype,d),i&&W(o,i),o}function D(o,d){var i=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(i)return(i=i.call(o)).next.bind(i);if(Array.isArray(o)||(i=m(o))||d&&o&&typeof o.length=="number"){i&&(o=i);var a=0;return function(){return a>=o.length?{done:!0}:{done:!1,value:o[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m(o,d){if(!o)return;if(typeof o=="string")return p(o,d);var i=Object.prototype.toString.call(o).slice(8,-1);if(i==="Object"&&o.constructor&&(i=o.constructor.name),i==="Map"||i==="Set")return Array.from(o);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return p(o,d)}function p(o,d){(d==null||d>o.length)&&(d=o.length);for(var i=0,a=new Array(d);i<d;i++)a[i]=o[i];return a}function h(){return h=Object.assign||function(o){for(var d=1;d<arguments.length;d++){var i=arguments[d];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])}return o},h.apply(this,arguments)}var c=function(){function o(i){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(S){try{a.apply(S,{ot:j.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(w){G.logger.warn("Could not generate manifest CMCD data.",w)}},this.applyFragmentData=function(S){try{var w=S.frag,x=a.hls.levels[w.level],L=a.getObjectType(w),O={d:w.duration*1e3,ot:L};(L===j.CMCDObjectType.VIDEO||L===j.CMCDObjectType.AUDIO||L==j.CMCDObjectType.MUXED)&&(O.br=x.bitrate/1e3,O.tb=a.getTopBandwidth(L),O.bl=a.getBufferLength(L)),a.apply(S,O)}catch(_){G.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=i;var r=this.config=i.config,s=r.cmcd;s!=null&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||o.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var d=o.prototype;return d.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)},d.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()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(a,r){this.media=r.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(a,r){var s,S;this.audioBuffer=(s=r.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(S=r.tracks.video)===null||S===void 0?void 0:S.buffer},d.createData=function(){var a;return{v:j.CMCDVersion,sf:j.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}},d.apply=function(a,r){r===void 0&&(r={}),h(r,this.createData());var s=r.ot===j.CMCDObjectType.INIT||r.ot===j.CMCDObjectType.VIDEO||r.ot===j.CMCDObjectType.MUXED;if(this.starved&&s&&(r.bs=!0,r.su=!0,this.starved=!1),r.su==null&&(r.su=this.buffering),this.useHeaders){var S=o.toHeaders(r);if(!Object.keys(S).length)return;a.headers||(a.headers={}),h(a.headers,S)}else{var w=o.toQuery(r);if(!w)return;a.url=o.appendQueryToUri(a.url,w)}},d.getObjectType=function(a){var r=a.type;return r==="subtitle"?j.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?j.CMCDObjectType.INIT:r==="audio"?j.CMCDObjectType.AUDIO:r==="main"?this.hls.audioTracks.length?j.CMCDObjectType.VIDEO:j.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(a){for(var r=0,s=a===j.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=D(s),w;!(w=S()).done;){var x=w.value;x.bitrate>r&&(r=x.bitrate)}return r>0?r:NaN},d.getBufferLength=function(a){var r=this.hls.media,s=a===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!r)return NaN;var S=M.BufferHelper.bufferInfo(s,r.currentTime,this.config.maxBufferHole);return S.len*1e3},d.createPlaylistLoader=function(){var a=this.config.pLoader,r=this.applyPlaylistData,s=a||this.config.loader;return function(){function S(x){this.loader=void 0,this.loader=new s(x)}var w=S.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,O,_){r(L),this.loader.load(L,O,_)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},d.createFragmentLoader=function(){var a=this.config.fLoader,r=this.applyFragmentData,s=a||this.config.loader;return function(){function S(x){this.loader=void 0,this.loader=new s(x)}var w=S.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,O,_){r(L),this.loader.load(L,O,_)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},o.uuid=function(){var a=URL.createObjectURL(new Blob),r=a.toString();return URL.revokeObjectURL(a),r.substr(r.lastIndexOf("/")+1)},o.serialize=function(a){for(var r=[],s=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},S=function(U){return Math.round(U)},w=function(U){return S(U/100)*100},x=function(U){return encodeURIComponent(U)},L={br:S,d:S,bl:w,dl:w,mtp:w,nor:x,rtp:w,tb:S},O=Object.keys(a||{}).sort(),_=D(O),b;!(b=_()).done;){var g=b.value,f=a[g];if(!s(f))continue;if(g==="v"&&f===1)continue;if(g=="pr"&&f===1)continue;var C=L[g];C&&(f=C(f));var E=typeof f,v=void 0;g==="ot"||g==="sf"||g==="st"?v=g+"="+f:E==="boolean"?v=g:E==="number"?v=g+"="+f:v=g+"="+JSON.stringify(f),r.push(v)}return r.join(",")},o.toHeaders=function(a){for(var r=Object.keys(a),s={},S=["Object","Request","Session","Status"],w=[{},{},{},{}],x={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},L=0,O=r;L<O.length;L++){var _=O[L],b=x[_]!=null?x[_]:1;w[b][_]=a[_]}for(var g=0;g<w.length;g++){var f=o.serialize(w[g]);f&&(s["CMCD-"+S[g]]=f)}return s},o.toQuery=function(a){return"CMCD="+encodeURIComponent(o.serialize(a))},o.appendQueryToUri=function(a,r){if(!r)return a;var s=a.includes("?")?"&":"?";return""+a+s+r},o}()},"./src/controller/eme-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),j=P("./src/errors.ts"),M=P("./src/utils/logger.ts"),G=P("./src/utils/mediakeys-helper.ts");function W(c,o){for(var d=0;d<o.length;d++){var i=o[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,o,d){return o&&W(c.prototype,o),d&&W(c,d),c}var D=3,m=function(o,d,i){var a={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(r){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+r+'"',robustness:i.audioRobustness||""})}),d.forEach(function(r){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+r+'"',robustness:i.videoRobustness||""})}),[a]},p=function(o,d,i,a){switch(o){case G.KeySystems.WIDEVINE:return m(d,i,a);default:throw new Error("Unknown key-system: "+o)}},h=function(){function c(d){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=d,this._config=d.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var o=c.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._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)},o._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)},o.getLicenseServerUrl=function(i){switch(i){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},o._attemptKeySystemAccess=function(i,a,r){var s=this,S=p(i,a,r,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var w=this.requestMediaKeySystemAccess(i,S);this.mediaKeysPromise=w.then(function(x){return s._onMediaKeySystemAccessObtained(i,x)}),w.catch(function(x){M.logger.error('Failed to obtain key-system "'+i+'" access:',x)})},o._onMediaKeySystemAccessObtained=function(i,a){var r=this;M.logger.log('Access for key-system "'+i+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:i};this._mediaKeysList.push(s);var S=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(w){return s.mediaKeys=w,M.logger.log('Media-keys created for key-system "'+i+'"'),r._onMediaKeysCreated(),w});return S.catch(function(w){M.logger.error("Failed to create media-keys:",w)}),S},o._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),i._onNewMediaKeySession(a.mediaKeysSession))})},o._onNewMediaKeySession=function(i){var a=this;M.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(r){a._onKeySessionMessage(i,r.message)},!1)},o._onKeySessionMessage=function(i,a){M.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(r){M.logger.log("Received license data (length: "+(r&&r.byteLength)+"), updating key-session"),i.update(r)})},o.onMediaEncrypted=function(i){var a=this;if(M.logger.log('Media is encrypted using "'+i.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:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var r=function(S){if(!a._media)return;a._attemptSetMediaKeys(S),a._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(r).catch(r)},o._attemptSetMediaKeys=function(i){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:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(i,a){var r=this,s=this._mediaKeysList[0];if(!s){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var S=s.mediaKeysSession;if(!S){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(V.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.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:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+i+'" init data type'),s.mediaKeysSessionInitialized=!0,S.generateRequest(i,a).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(w){M.logger.error("Error generating key-session request:",w),r.hls.trigger(V.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(i,a,r){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,i,a,r);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,s,i),S=void 0}catch(w){M.logger.error(w)}try{s.readyState||s.open("POST",i,!0),S&&S.call(this.hls,s,i)}catch(w){throw new Error("issue setting up KeySystem license XHR "+w)}return s},o._onLicenseRequestReadyStageChange=function(i,a,r,s){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var S=i.response,w=this._licenseResponseCallback;if(w)try{S=w.call(this.hls,i,a)}catch(L){M.logger.error(L)}s(S)}else{if(M.logger.error("License Request XHR failed ("+a+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(V.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=D-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(r,s)}break}},o._generateLicenseRequestChallenge=function(i,a){switch(i.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},o._requestLicense=function(i,a){M.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(r.mediaKeySystemDomain),S=this._createLicenseXhr(s,i,a);M.logger.log("Sending license request to URL: "+s);var w=this._generateLicenseRequestChallenge(r,i);S.send(w)}catch(x){M.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(V.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(i,a){if(!this._emeEnabled)return;var r=a.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var i=this._media,a=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(r){if(r.mediaKeysSession)return r.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(i,a){if(!this._emeEnabled)return;var r=a.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),s=a.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,r,s)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();X.default=h},"./src/controller/fps-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),j=P("./src/utils/logger.ts"),M=function(){function G(n){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=n,this.registerListeners()}var W=G.prototype;return W.setStreamController=function(D){this.streamController=D},W.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(D,m){var p=this.hls.config;if(p.capLevelOnFPSDrop){var h=m.media instanceof self.HTMLVideoElement?m.media:null;this.media=h,h&&typeof h.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(D,m,p){var h=performance.now();if(m){if(this.lastTime){var c=h-this.lastTime,o=p-this.lastDroppedFrames,d=m-this.lastDecodedFrames,i=1e3*o/c,a=this.hls;if(a.trigger(V.Events.FPS_DROP,{currentDropped:o,currentDecoded:d,totalDroppedFrames:p}),i>0&&o>a.config.fpsDroppedMonitoringThreshold*d){var r=a.currentLevel;j.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+r),r>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=r)&&(r=r-1,a.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:r,droppedLevel:a.currentLevel}),a.autoLevelCapping=r,this.streamController.nextLevelSwitch())}}this.lastTime=h,this.lastDroppedFrames=p,this.lastDecodedFrames=m}},W.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var m=D.getVideoPlaybackQuality();this.checkFPS(D,m.totalVideoFrames,m.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},G}();X.default=M},"./src/controller/fragment-finders.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"findFragmentByPDT",function(){return M}),P.d(X,"findFragmentByPTS",function(){return G}),P.d(X,"fragmentWithinToleranceTest",function(){return W}),P.d(X,"pdtWithinToleranceTest",function(){return n}),P.d(X,"findFragWithCC",function(){return D});var V=P("./src/polyfills/number.ts"),j=P("./src/utils/binary-search.ts");function M(m,p,h){if(p===null||!Array.isArray(m)||!m.length||!Object(V.isFiniteNumber)(p))return null;var c=m[0].programDateTime;if(p<(c||0))return null;var o=m[m.length-1].endProgramDateTime;if(p>=(o||0))return null;h=h||0;for(var d=0;d<m.length;++d){var i=m[d];if(n(p,h,i))return i}return null}function G(m,p,h,c){h===void 0&&(h=0),c===void 0&&(c=0);var o=null;if(m?o=p[m.sn-p[0].sn+1]||null:h===0&&p[0].start===0&&(o=p[0]),o&&W(h,c,o)===0)return o;var d=j.default.search(p,W.bind(null,h,c));return d||o}function W(m,p,h){m===void 0&&(m=0),p===void 0&&(p=0);var c=Math.min(p,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-c<=m?1:h.start-c>m&&h.start?-1:0}function n(m,p,h){var c=Math.min(p,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,o=h.endProgramDateTime||0;return o-c>m}function D(m,p){return j.default.search(m,function(h){return h.cc<p?1:h.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"FragmentState",function(){return M}),P.d(X,"FragmentTracker",function(){return G});var V=P("./src/events.ts"),j=P("./src/types/loader.ts"),M;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(M||(M={}));var G=function(){function D(p){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=p,this._registerListeners()}var m=D.prototype;return m._registerListeners=function(){var h=this.hls;h.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},m._unregisterListeners=function(){var h=this.hls;h.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},m.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},m.getAppendedFrag=function(h,c){if(c===j.PlaylistLevelType.MAIN){var o=this.activeFragment,d=this.activeParts;if(!o)return null;if(d)for(var i=d.length;i--;){var a=d[i],r=a?a.end:o.appendedPTS;if(a.start<=h&&r!==void 0&&h<=r)return i>9&&(this.activeParts=d.slice(i-9)),a}else if(o.start<=h&&o.appendedPTS!==void 0&&h<=o.appendedPTS)return o}return this.getBufferedFrag(h,c)},m.getBufferedFrag=function(h,c){for(var o=this.fragments,d=Object.keys(o),i=d.length;i--;){var a=o[d[i]];if((a==null?void 0:a.body.type)===c&&a.buffered){var r=a.body;if(r.start<=h&&h<=r.end)return r}}return null},m.detectEvictedFragments=function(h,c,o){var d=this;Object.keys(this.fragments).forEach(function(i){var a=d.fragments[i];if(!a)return;if(!a.buffered){a.body.type===o&&d.removeFragment(a.body);return}var r=a.range[h];if(!r)return;r.time.some(function(s){var S=!d.isTimeBuffered(s.startPTS,s.endPTS,c);return S&&d.removeFragment(a.body),S})})},m.detectPartialFragments=function(h){var c=this,o=this.timeRanges,d=h.frag,i=h.part;if(!o||d.sn==="initSegment")return;var a=n(d),r=this.fragments[a];if(!r)return;Object.keys(o).forEach(function(s){var S=d.elementaryStreams[s];if(!S)return;var w=o[s],x=i!==null||S.partial===!0;r.range[s]=c.getBufferedTimes(d,i,x,w)}),r.backtrack=r.loaded=null,Object.keys(r.range).length?r.buffered=!0:this.removeFragment(r.body)},m.fragBuffered=function(h){var c=n(h),o=this.fragments[c];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},m.getBufferedTimes=function(h,c,o,d){for(var i={time:[],partial:o},a=c?c.start:h.start,r=c?c.end:h.end,s=h.minEndPTS||r,S=h.maxStartPTS||a,w=0;w<d.length;w++){var x=d.start(w)-this.bufferPadding,L=d.end(w)+this.bufferPadding;if(S>=x&&s<=L){i.time.push({startPTS:Math.max(a,d.start(w)),endPTS:Math.min(r,d.end(w))});break}else if(a<L&&r>x)i.partial=!0,i.time.push({startPTS:Math.max(a,d.start(w)),endPTS:Math.min(r,d.end(w))});else if(r<=x)break}return i},m.getPartialFragment=function(h){var c=null,o,d,i,a=0,r=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(S){var w=s[S];if(!w)return;W(w)&&(d=w.body.start-r,i=w.body.end+r,h>=d&&h<=i&&(o=Math.min(h-d,i-h),a<=o&&(c=w.body,a=o)))}),c},m.getState=function(h){var c=n(h),o=this.fragments[c];return o?o.buffered?W(o)?M.PARTIAL:M.OK:o.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},m.backtrack=function(h,c){var o=n(h),d=this.fragments[o];if(!d||d.backtrack)return null;var i=d.backtrack=c||d.loaded;return d.loaded=null,i},m.getBacktrackData=function(h){var c=n(h),o=this.fragments[c];if(o){var d,i=o.backtrack;if(i!=null&&(d=i.payload)!==null&&d!==void 0&&d.byteLength)return i;this.removeFragment(h)}return null},m.isTimeBuffered=function(h,c,o){for(var d,i,a=0;a<o.length;a++){if(d=o.start(a)-this.bufferPadding,i=o.end(a)+this.bufferPadding,h>=d&&c<=i)return!0;if(c<=d)return!1}return!1},m.onFragLoaded=function(h,c){var o=c.frag,d=c.part;if(o.sn==="initSegment"||o.bitrateTest||d)return;var i=n(o);this.fragments[i]={body:o,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},m.onBufferAppended=function(h,c){var o=this,d=c.frag,i=c.part,a=c.timeRanges;if(d.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=d,i){var r=this.activeParts;r||(this.activeParts=r=[]),r.push(i)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(s){var S=a[s];if(o.detectEvictedFragments(s,S),!i)for(var w=0;w<S.length;w++)d.appendedPTS=Math.max(S.end(w),d.appendedPTS||0)})},m.onFragBuffered=function(h,c){this.detectPartialFragments(c)},m.hasFragment=function(h){var c=n(h);return!!this.fragments[c]},m.removeFragmentsInRange=function(h,c,o){var d=this;Object.keys(this.fragments).forEach(function(i){var a=d.fragments[i];if(!a)return;if(a.buffered){var r=a.body;r.type===o&&r.start<c&&r.end>h&&d.removeFragment(r)}})},m.removeFragment=function(h){var c=n(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),delete this.fragments[c]},m.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function W(D){var m,p;return D.buffered&&(((m=D.range.video)===null||m===void 0?void 0:m.partial)||((p=D.range.audio)===null||p===void 0?void 0:p.partial))}function n(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"STALL_MINIMUM_DURATION_MS",function(){return W}),P.d(X,"MAX_START_GAP_JUMP",function(){return n}),P.d(X,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),P.d(X,"SKIP_BUFFER_RANGE_START",function(){return m}),P.d(X,"default",function(){return p});var V=P("./src/utils/buffer-helper.ts"),j=P("./src/errors.ts"),M=P("./src/events.ts"),G=P("./src/utils/logger.ts"),W=250,n=2,D=.1,m=.05,p=function(){function h(o,d,i,a){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=o,this.media=d,this.fragmentTracker=i,this.hls=a}var c=h.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(d){var i=this.config,a=this.media,r=this.stalled,s=a.currentTime,S=a.seeking,w=this.seeking&&!S,x=!this.seeking&&S;if(this.seeking=S,s!==d){if(this.moved=!0,r!==null){if(this.stallReported){var L=self.performance.now()-r;G.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||w)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!V.BufferHelper.getBuffered(a).length)return;var O=V.BufferHelper.bufferInfo(a,s,0),_=O.len>0,b=O.nextStart||0;if(!_&&!b)return;if(S){var g=O.len>n,f=!b||b-s>n&&!this.fragmentTracker.getPartialFragment(s);if(g||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(b,O.start||0)-s,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=v==null||((C=v.details)===null||C===void 0)?void 0:C.live,U=N?v.details.targetduration*2:n;if(E>0&&E<=U){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(r===null){this.stalled=A;return}var H=A-r;!S&&H>=W&&this._reportStall(O.len);var F=V.BufferHelper.bufferInfo(a,s,i.maxBufferHole);this._tryFixBufferStall(F,H)},c._tryFixBufferStall=function(d,i){var a=this.config,r=this.fragmentTracker,s=this.media,S=s.currentTime,w=r.getPartialFragment(S);if(w){var x=this._trySkipBufferHole(w);if(x)return}d.len>a.maxBufferHole&&i>a.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(d){var i=this.hls,a=this.media,r=this.stallReported;r||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+d+")"),i.trigger(M.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},c._trySkipBufferHole=function(d){for(var i=this.config,a=this.hls,r=this.media,s=r.currentTime,S=0,w=V.BufferHelper.getBuffered(r),x=0;x<w.length;x++){var L=w.start(x);if(s+i.maxBufferHole>=S&&s<L){var O=Math.max(L+m,r.currentTime+D);return G.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+O),this.moved=!0,this.stalled=null,r.currentTime=O,d&&a.trigger(M.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+O,frag:d}),O}S=w.end(x)}return 0},c._tryNudgeBuffer=function(){var d=this.config,i=this.hls,a=this.media,r=a.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<d.nudgeMaxRetry){var S=r+s*d.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+r+" to "+S),a.currentTime=S,i.trigger(M.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+d.nudgeMaxRetry+" nudges"),i.trigger(M.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),M=P("./src/demux/id3.ts"),G=.25,W=function(){function n(m){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=m,this._registerListeners()}var D=n.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var p=this.hls;p.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var p=this.hls;p.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(p,h){this.media=h.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(j.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(p){if(!this.media)return;for(var h=0;h<p.length;h++){var c=p[h];if(c.kind==="metadata"&&c.label==="id3")return Object(j.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(p,h){if(!this.media)return;var c=h.frag,o=h.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<o.length;i++){var a=M.getID3Frames(o[i].data);if(a){var r=o[i].pts,s=i<o.length-1?o[i+1].pts:c.end,S=s-r;S<=0&&(s=r+G);for(var w=0;w<a.length;w++){var x=a[w];if(!M.isTimeStampFrame(x)){var L=new d(r,s,"");L.value=x,this.id3Track.addCue(L)}}}}},D.onBufferFlushing=function(p,h){var c=h.startOffset,o=h.endOffset,d=h.type;if(!d||d==="audio"){var i=this.id3Track;i&&Object(j.removeCuesInRange)(i,c,o)}},n}();X.default=W},"./src/controller/latency-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return n});var V=P("./src/errors.ts"),j=P("./src/events.ts"),M=P("./src/utils/logger.ts");function G(D,m){for(var p=0;p<m.length;p++){var h=m[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function W(D,m,p){return m&&G(D.prototype,m),p&&G(D,p),D}var n=function(){function D(p){var h=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 h.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var m=D.prototype;return m.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},m.registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(j.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(j.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(j.Events.ERROR,this.onError)},m.onMediaAttached=function(h,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},m.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},m.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},m.onLevelUpdated=function(h,c){var o=c.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},m.onError=function(h,c){if(c.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},m.timeupdate=function(){var h=this.media,c=this.levelDetails;if(!h||!c)return;this.currentTime=h.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var d=this.config,i=d.lowLatencyMode,a=d.maxLiveSyncPlaybackRate;if(!i||a===1)return;var r=this.targetLatency;if(r===null)return;var s=o-r,S=Math.min(this.maxLatency,r+c.targetduration),w=s<S;if(c.live&&w&&s>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,a)),L=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;h.playbackRate=Math.min(x,Math.max(1,L))}else h.playbackRate!==1&&h.playbackRate!==0&&(h.playbackRate=1)},m.estimateLiveEdge=function(){var h=this.levelDetails;return h===null?null:h.edge+h.age},m.computeLatency=function(){var h=this.estimateLiveEdge();return h===null?null:h-this.currentTime},W(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var h=this.config,c=this.levelDetails;return h.liveMaxLatencyDuration!==void 0?h.liveMaxLatencyDuration:c?h.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var h=this.levelDetails;if(h===null)return null;var c=h.holdBack,o=h.partHoldBack,d=h.targetduration,i=this.config,a=i.liveSyncDuration,r=i.liveSyncDurationCount,s=i.lowLatencyMode,S=this.hls.userConfig,w=s&&o||c;(S.liveSyncDuration||S.liveSyncDurationCount||w===0)&&(w=a!==void 0?a:r*d);var x=d,L=1;return w+Math.min(this.stallCount*L,x)}},{key:"liveSyncPosition",get:function(){var h=this.estimateLiveEdge(),c=this.targetLatency,o=this.levelDetails;if(h===null||c===null||o===null)return null;var d=o.edge,i=h-c-this.edgeStalled,a=d-o.totalduration,r=d-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(a,i),r)}},{key:"drift",get:function(){var h=this.levelDetails;return h===null?1:h.drift}},{key:"edgeStalled",get:function(){var h=this.levelDetails;if(h===null)return 0;var c=(this.config.lowLatencyMode&&h.partTarget||h.targetduration)*3;return Math.max(h.age-c,0)}},{key:"forwardBufferLength",get:function(){var h=this.media,c=this.levelDetails;if(!h||!c)return 0;var o=h.buffered.length;return o?h.buffered.end(o-1):c.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return i});var V=P("./src/types/level.ts"),j=P("./src/events.ts"),M=P("./src/errors.ts"),G=P("./src/utils/codecs.ts"),W=P("./src/controller/level-helper.ts"),n=P("./src/controller/base-playlist-controller.ts"),D=P("./src/types/loader.ts");function m(){return m=Object.assign||function(a){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var S in s)Object.prototype.hasOwnProperty.call(s,S)&&(a[S]=s[S])}return a},m.apply(this,arguments)}function p(a,r){for(var s=0;s<r.length;s++){var S=r[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,r,s){return r&&p(a.prototype,r),s&&p(a,s),a}function c(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,o(a,r)}function o(a,r){return o=Object.setPrototypeOf||function(S,w){return S.__proto__=w,S},o(a,r)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(a){c(r,a);function r(S){var w;return w=a.call(this,S,"[level-controller]")||this,w._levels=[],w._firstLevel=-1,w._startLevel=void 0,w.currentLevelIndex=-1,w.manualLevelIndex=-1,w.onParsedComplete=void 0,w._registerListeners(),w}var s=r.prototype;return s._registerListeners=function(){var w=this.hls;w.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(j.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var w=this.hls;w.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(j.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},s.startLoad=function(){var w=this._levels;w.forEach(function(x){x.loadError=0}),a.prototype.startLoad.call(this)},s.onManifestLoaded=function(w,x){var L=[],O=[],_=[],b,g={},f,C=!1,E=!1,v=!1;if(x.levels.forEach(function(H){var F=H.attrs;C=C||!!(H.width&&H.height),E=E||!!H.videoCodec,v=v||!!H.audioCodec,d&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var T=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;f=g[T],f?f.url.push(H.url):(f=new V.Level(H),g[T]=f,L.push(f)),F&&(F.AUDIO&&Object(W.addGroupId)(f,"audio",F.AUDIO),F.SUBTITLES&&Object(W.addGroupId)(f,"text",F.SUBTITLES))}),(C||E)&&v&&(L=L.filter(function(H){var F=H.videoCodec,T=H.width,z=H.height;return!!F||!!(T&&z)})),L=L.filter(function(H){var F=H.audioCodec,T=H.videoCodec;return(!F||Object(G.isCodecSupportedInMp4)(F,"audio"))&&(!T||Object(G.isCodecSupportedInMp4)(T,"video"))}),x.audioTracks&&(O=x.audioTracks.filter(function(H){return!H.audioCodec||Object(G.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(O)),x.subtitles&&(_=x.subtitles,Object(W.assignTrackIdsByGroup)(_)),L.length>0){b=L[0].bitrate,L.sort(function(H,F){return H.bitrate-F.bitrate}),this._levels=L;for(var N=0;N<L.length;N++)if(L[N].bitrate===b){this._firstLevel=N,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+b);break}var U=v&&!E,A={levels:L,audioTracks:O,subtitleTracks:_,firstLevel:this._firstLevel,stats:x.stats,audio:v,video:E,altAudio:!U&&O.some(function(H){return!!H.url})};this.hls.trigger(j.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(j.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(w,x){if(a.prototype.onError.call(this,w,x),x.fatal)return;var L=x.context,O=this._levels[this.currentLevelIndex];if(L&&(L.type===D.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&L.groupId===O.audioGroupIds[O.urlId]||L.type===D.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&L.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,b=!0,g;switch(x.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(x.frag){var f=this._levels[x.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(g=x.frag.level)):g=x.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(b=!1),g=L.level),_=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:g=x.level,_=!0;break}g!==void 0&&this.recoverLevel(x,g,_,b)},s.recoverLevel=function(w,x,L,O){var _=w.details,b=this._levels[x];if(b.loadError++,L){var g=this.retryLoadingOrFail(w);if(g)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var f=b.url.length;if(f>1&&b.loadError<f)w.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var C=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(_+": switch to "+C),w.levelRetry=!0,this.hls.nextAutoLevel=C)}}},s.redundantFailover=function(w){var x=this._levels[w],L=x.url.length;if(L>1){var O=(x.urlId+1)%L;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(_){_.urlId=O}),this.level=w}},s.onFragLoaded=function(w,x){var L=x.frag;if(L!==void 0&&L.type===D.PlaylistLevelType.MAIN){var O=this._levels[L.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},s.onLevelLoaded=function(w,x){var L,O=x.level,_=x.details,b=this._levels[O];if(!b){var g;this.warn("Invalid level index "+O),(g=x.deliveryDirectives)!==null&&g!==void 0&&g.skip&&(_.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(O,x,b.details)):(L=x.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(_.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(w,x){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var O=-1,_=this.hls.audioTracks[x.id].groupId,b=0;b<L.audioGroupIds.length;b++)if(L.audioGroupIds[b]===_){O=b;break}O!==L.urlId&&(L.urlId=O,this.startLoad())}},s.loadPlaylist=function(w){var x=this.currentLevelIndex,L=this._levels[x];if(this.canLoad&&L&&L.url.length>0){var O=L.urlId,_=L.url[O];if(w)try{_=w.addDirectives(_)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+x+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+O+" "+_),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:_,level:x,id:O,deliveryDirectives:w||null})}},s.removeLevel=function(w,x){var L=function(b,g){return g!==x},O=this._levels.filter(function(_,b){return b!==w?!0:_.url.length>1&&x!==void 0?(_.url=_.url.filter(L),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(L)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(L)),_.urlId=0,!0):!1}).map(function(_,b){var g=_.details;return g!=null&&g.fragments&&g.fragments.forEach(function(f){f.level=b}),_});this._levels=O,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:O})},h(r,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var x,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===w&&(x=L[w])!==null&&x!==void 0&&x.details)return;if(w<0||w>=L.length){var O=w<0;if(this.hls.trigger(j.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:O,reason:"invalid level idx"}),O)return;w=Math.min(w,L.length-1)}this.clearTimer();var _=this.currentLevelIndex,b=L[_],g=L[w];this.log("switching to level "+w+" from "+_),this.currentLevelIndex=w;var f=m({},g,{level:w,maxBitrate:g.maxBitrate,uri:g.uri,urlId:g.urlId});delete f._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,f);var C=g.details;if(!C||C.live){var E=this.switchParams(g.uri,b==null?void 0:b.details);this.loadPlaylist(E)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(w){this.manualLevelIndex=w,this._startLevel===void 0&&(this._startLevel=w),w!==-1&&(this.level=w)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(w){this._firstLevel=w}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var w=this.hls.config.startLevel;return w!==void 0?w:this._firstLevel}else return this._startLevel},set:function(w){this._startLevel=w}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(w){this.level=w,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=w)}}]),r}(n.default)},"./src/controller/level-helper.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"addGroupId",function(){return M}),P.d(X,"assignTrackIdsByGroup",function(){return G}),P.d(X,"updatePTS",function(){return W}),P.d(X,"updateFragPTSDTS",function(){return D}),P.d(X,"mergeDetails",function(){return m}),P.d(X,"mapPartIntersection",function(){return p}),P.d(X,"mapFragmentIntersection",function(){return h}),P.d(X,"adjustSliding",function(){return c}),P.d(X,"addSliding",function(){return o}),P.d(X,"computeReloadInterval",function(){return d}),P.d(X,"getFragmentWithSN",function(){return i}),P.d(X,"getPartWith",function(){return a});var V=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts");function M(r,s,S){switch(s){case"audio":r.audioGroupIds||(r.audioGroupIds=[]),r.audioGroupIds.push(S);break;case"text":r.textGroupIds||(r.textGroupIds=[]),r.textGroupIds.push(S);break}}function G(r){var s={};r.forEach(function(S){var w=S.groupId||"";S.id=s[w]=s[w]||0,s[w]++})}function W(r,s,S){var w=r[s],x=r[S];n(w,x)}function n(r,s){var S=s.startPTS;if(Object(V.isFiniteNumber)(S)){var w=0,x;s.sn>r.sn?(w=S-r.start,x=r):(w=r.start-S,x=s),x.duration!==w&&(x.duration=w)}else if(s.sn>r.sn){var L=r.cc===s.cc;L&&r.minEndPTS?s.start=r.start+(r.minEndPTS-r.start):s.start=r.start+r.duration}else s.start=Math.max(r.start-s.duration,0)}function D(r,s,S,w,x,L){var O=w-S;O<=0&&(j.logger.warn("Fragment should have a positive duration",s),w=S+s.duration,L=x+s.duration);var _=S,b=w,g=s.startPTS,f=s.endPTS;if(Object(V.isFiniteNumber)(g)){var C=Math.abs(g-S);Object(V.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(C,s.deltaPTS):s.deltaPTS=C,_=Math.max(S,g),S=Math.min(S,g),x=Math.min(x,s.startDTS),b=Math.min(w,f),w=Math.max(w,f),L=Math.max(L,s.endDTS)}s.duration=w-S;var E=S-s.start;s.appendedPTS=w,s.start=s.startPTS=S,s.maxStartPTS=_,s.startDTS=x,s.endPTS=w,s.minEndPTS=b,s.endDTS=L;var v=s.sn;if(!r||v<r.startSN||v>r.endSN)return 0;var N,U=v-r.startSN,A=r.fragments;for(A[U]=s,N=U;N>0;N--)n(A[N],A[N-1]);for(N=U;N<A.length-1;N++)n(A[N],A[N+1]);return r.fragmentHint&&n(A[A.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,E}function m(r,s){for(var S=null,w=r.fragments,x=w.length-1;x>=0;x--){var L=w[x].initSegment;if(L){S=L;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;var O=0,_;if(h(r,s,function(N,U){N.relurl&&(O=N.cc-U.cc),Object(V.isFiniteNumber)(N.startPTS)&&Object(V.isFiniteNumber)(N.endPTS)&&(U.start=U.startPTS=N.startPTS,U.startDTS=N.startDTS,U.appendedPTS=N.appendedPTS,U.maxStartPTS=N.maxStartPTS,U.endPTS=N.endPTS,U.endDTS=N.endDTS,U.minEndPTS=N.minEndPTS,U.duration=N.endPTS-N.startPTS,U.duration&&(_=U),s.PTSKnown=s.alignedSliding=!0),U.elementaryStreams=N.elementaryStreams,U.loader=N.loader,U.stats=N.stats,U.urlId=N.urlId,N.initSegment&&(U.initSegment=N.initSegment,S=N.initSegment)}),S){var b=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;b.forEach(function(N){var U;(!N.initSegment||N.initSegment.relurl===((U=S)===null||U===void 0?void 0:U.relurl))&&(N.initSegment=S)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(N){return!N}),s.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var g=s.skippedSegments;g--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var f=s.fragments;if(O){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<f.length;C++)f[C].cc+=O}s.skippedSegments&&(s.startCC=s.fragments[0].cc),p(r.partList,s.partList,function(N,U){U.elementaryStreams=N.elementaryStreams,U.stats=N.stats}),_?D(s,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):c(r,s),f.length&&(s.totalduration=s.edge-f[0].start),s.driftStartTime=r.driftStartTime,s.driftStart=r.driftStart;var E=s.advancedDateTime;if(s.advanced&&E){var v=s.edge;s.driftStart||(s.driftStartTime=E,s.driftStart=v),s.driftEndTime=E,s.driftEnd=v}else s.driftEndTime=r.driftEndTime,s.driftEnd=r.driftEnd,s.advancedDateTime=r.advancedDateTime}function p(r,s,S){if(r&&s)for(var w=0,x=0,L=r.length;x<=L;x++){var O=r[x],_=s[x+w];O&&_&&O.index===_.index&&O.fragment.sn===_.fragment.sn?S(O,_):w--}}function h(r,s,S){for(var w=s.skippedSegments,x=Math.max(r.startSN,s.startSN)-s.startSN,L=(r.fragmentHint?1:0)+(w?s.endSN:Math.min(r.endSN,s.endSN))-s.startSN,O=s.startSN-r.startSN,_=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,b=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,g=x;g<=L;g++){var f=b[O+g],C=_[g];w&&!C&&g<w&&(C=s.fragments[g]=f),f&&C&&S(f,C)}}function c(r,s){var S=s.startSN+s.skippedSegments-r.startSN,w=r.fragments;if(S<0||S>=w.length)return;o(s,w[S].start)}function o(r,s){if(s){for(var S=r.fragments,w=r.skippedSegments;w<S.length;w++)S[w].start+=s;r.fragmentHint&&(r.fragmentHint.start+=s)}}function d(r,s){var S=1e3*r.levelTargetDuration,w=S/2,x=r.age,L=x>0&&x<S*3,O=s.loading.end-s.loading.start,_,b=r.availabilityDelay;if(r.updated===!1)if(L){var g=333*r.misses;_=Math.max(Math.min(w,O*2),g),r.availabilityDelay=(r.availabilityDelay||0)+_}else _=w;else L?(b=Math.min(b||S/2,x),r.availabilityDelay=b,_=b+S-x):_=S-O;return Math.round(_)}function i(r,s,S){if(!r||!r.details)return null;var w=r.details,x=w.fragments[s-w.startSN];return x||(x=w.fragmentHint,x&&x.sn===s?x:s<w.startSN&&S&&S.sn===s?S:null)}function a(r,s,S){if(!r||!r.details)return null;var w=r.details.partList;if(w)for(var x=w.length;x--;){var L=w[x];if(L.index===S&&L.fragment.sn===s)return L}return null}},"./src/controller/stream-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return w});var V=P("./src/polyfills/number.ts"),j=P("./src/controller/base-stream-controller.ts"),M=P("./src/is-supported.ts"),G=P("./src/events.ts"),W=P("./src/utils/buffer-helper.ts"),n=P("./src/controller/fragment-tracker.ts"),D=P("./src/types/loader.ts"),m=P("./src/loader/fragment.ts"),p=P("./src/demux/transmuxer-interface.ts"),h=P("./src/types/transmuxer.ts"),c=P("./src/controller/gap-controller.ts"),o=P("./src/errors.ts"),d=P("./src/utils/logger.ts");function i(x,L){for(var O=0;O<L.length;O++){var _=L[O];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function a(x,L,O){return L&&i(x.prototype,L),O&&i(x,O),x}function r(x,L){x.prototype=Object.create(L.prototype),x.prototype.constructor=x,s(x,L)}function s(x,L){return s=Object.setPrototypeOf||function(_,b){return _.__proto__=b,_},s(x,L)}var S=100,w=function(x){r(L,x);function L(_,b){var g;return g=x.call(this,_,b,"[stream-controller]")||this,g.audioCodecSwap=!1,g.gapController=null,g.level=-1,g._forceStartLoad=!1,g.altAudio=!1,g.audioOnly=!1,g.fragPlaying=null,g.onvplaying=null,g.onvseeked=null,g.fragLastKbps=0,g.stalled=!1,g.couldBacktrack=!1,g.audioCodecSwitch=!1,g.videoBuffer=null,g._registerListeners(),g}var O=L.prototype;return O._registerListeners=function(){var b=this.hls;b.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(G.Events.ERROR,this.onError,this),b.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var b=this.hls;b.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(G.Events.ERROR,this.onError,this),b.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(b){if(this.levels){var g=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var C=f.startLevel;C===-1&&(f.config.testBandwidth?(C=0,this.bitrateTest=!0):C=f.nextAutoLevel),this.level=f.nextLoadLevel=C,this.loadedmetadata=!1}g>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),b=g),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var b,g=this.levels,f=this.level,C=g==null||((b=g[f])===null||b===void 0)?void 0:b.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var E,v=self.performance.now(),N=this.retryDate;(!N||v>=N||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var b,g,f=this.hls,C=this.levelLastLoaded,E=this.levels,v=this.media,N=f.config,U=f.nextLoadLevel;if(C===null||!v&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[U])return;var A=E[U];this.level=f.nextLoadLevel=U;var H=A.details;if(!H||this.state===j.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==U){this.state=j.State.WAITING_LEVEL;return}var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:v,D.PlaylistLevelType.MAIN);if(F===null)return;var T=F.len,z=this.getMaxBufferLength(A.maxBitrate);if(T>=z)return;if(this._streamEnded(F,H)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,Q),this.state=j.State.ENDED;return}var ne=F.end,se=this.getNextFragment(ne,H);if(this.couldBacktrack&&!this.fragPrevious&&se&&se.sn!=="initSegment"){var xe=se.sn-H.startSN;xe>1&&(se=H.fragments[xe-1],this.fragmentTracker.removeFragment(se))}if(se&&this.fragmentTracker.getState(se)===n.FragmentState.OK&&this.nextLoadPosition>ne){var me=this.audioOnly&&!this.altAudio?m.ElementaryStreamTypes.AUDIO:m.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(v,me,D.PlaylistLevelType.MAIN),se=this.getNextFragment(this.nextLoadPosition,H)}if(!se)return;se.initSegment&&!se.initSegment.data&&!this.bitrateTest&&(se=se.initSegment),((b=se.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((g=se.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(se,H):this.loadFragment(se,H,ne)},O.loadFragment=function(b,g,f){var C,E=this.fragmentTracker.getState(b);if(this.fragCurrent=b,E===n.FragmentState.BACKTRACKED){var v=this.fragmentTracker.getBacktrackData(b);if(v){this._handleFragmentLoadProgress(v),this._handleFragmentLoadComplete(v);return}else E=n.FragmentState.NOT_LOADED}E===n.FragmentState.NOT_LOADED||E===n.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,b,g,f)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(b){var g=this.fragmentTracker.getAppendedFrag(b,D.PlaylistLevelType.MAIN);return g&&"fragment"in g?g.fragment:g},O.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,D.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var b=this.levels,g=this.media;if(g!=null&&g.readyState){var f,C=this.getAppendedFrag(g.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!g.paused&&b){var E=this.hls.nextLoadLevel,v=b[E],N=this.fragLastKbps;N&&this.fragCurrent?f=this.fragCurrent.duration*v.maxBitrate/(1e3*N)+1:f=0}else f=0;var U=this.getBufferedFrag(g.currentTime+f);if(U){var A=this.followingBufferedFrag(U);if(A){this.abortCurrentFrag();var H=A.maxStartPTS?A.maxStartPTS:A.start,F=A.duration,T=Math.max(U.end,H+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(T,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(b,g){x.prototype.flushMainBuffer.call(this,b,g,this.altAudio?"video":null)},O.onMediaAttached=function(b,g){x.prototype.onMediaAttached.call(this,b,g);var f=g.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,f,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var b=this.media,g=b?b.currentTime:null;Object(V.isFiniteNumber)(g)&&this.log("Media seeked to "+g.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(b,g){var f=!1,C=!1,E;g.levels.forEach(function(v){E=v.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(f=!0),E.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=f&&C&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=g.levels,this.startFragRequested=!1},O.onLevelLoading=function(b,g){var f=this.levels;if(!f||this.state!==j.State.IDLE)return;var C=f[g.level];(!C.details||C.details.live&&this.levelLastLoaded!==g.level||this.waitForCdnTuneIn(C.details))&&(this.state=j.State.WAITING_LEVEL)},O.onLevelLoaded=function(b,g){var f,C=this.levels,E=g.level,v=g.details,N=v.totalduration;if(!C){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+v.startSN+","+v.endSN+"], cc ["+v.startCC+", "+v.endCC+"] duration:"+N);var U=this.fragCurrent;U&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==g.level&&U.loader&&(this.state=j.State.IDLE,U.loader.abort()));var A=C[E],H=0;if(v.live||(f=A.details)!==null&&f!==void 0&&f.live){if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed)return;H=this.alignPlaylists(v,A.details)}if(A.details=v,this.levelLastLoaded=E,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:v,level:E}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(v))return;this.state=j.State.IDLE}this.startFragRequested?v.live&&this.synchronizeToLiveEdge(v):this.setStartPosition(v,H),this.tick()},O._handleFragmentLoadProgress=function(b){var g,f=b.frag,C=b.part,E=b.payload,v=this.levels;if(!v){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var N=v[f.level],U=N.details;if(!U){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var A=N.videoCodec,H=U.PTSKnown||!U.live,F=(g=f.initSegment)===null||g===void 0?void 0:g.data,T=this._getAudioCodec(N),z=this.transmuxer=this.transmuxer||new p.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=C?C.index:-1,ne=Q!==-1,se=new h.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,E.byteLength,Q,ne),xe=this.initPTS[f.cc];z.push(E,F,T,A,f,C,U.totalduration,H,se,xe)},O.onAudioTrackSwitching=function(b,g){var f=this.altAudio,C=!!g.url,E=g.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var v=this.fragCurrent;v!=null&&v.loader&&(this.log("Switching to main audio track, cancel main fragment load"),v.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;f&&N.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:E})}},O.onAudioTrackSwitched=function(b,g){var f=g.id,C=!!this.hls.audioTracks[f].url;if(C){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=C,this.tick()},O.onBufferCreated=function(b,g){var f=g.tracks,C,E,v=!1;for(var N in f){var U=f[N];if(U.id==="main"){if(E=N,C=U,N==="video"){var A=f[N];A&&(this.videoBuffer=A.buffer)}}else v=!0}v&&C?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(b,g){var f=g.frag,C=g.part;if(f&&f.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(C?" p: "+C.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var E=C?C.stats:f.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,C)},O.onError=function(b,g){switch(g.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,g);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(g.fatal?(this.warn(""+g.details),this.state=j.State.ERROR):!g.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var f=!0,C=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);C&&C.len>.5&&(f=!this.reduceMaxBufferLength(C.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var b=this.media,g=this.gapController;if(!b||!g||!b.readyState)return;var f=W.BufferHelper.getBuffered(b);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):g.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(b,g){var f=g.type;if(f!==m.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(f===m.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,f,D.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(b,g){this.levels=g.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var b=this.media,g=b.currentTime,f=this.startPosition;if(f>=0&&g<f){if(b.seeking){d.logger.log("could not seek to "+f+", already seeking at "+g);return}var C=W.BufferHelper.getBuffered(b),E=C.length?C.start(0):0,v=E-f;v>0&&(v<this.config.maxBufferHole||v<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+v+" to match buffer start"),f+=v,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+g),b.currentTime=f}},O._getAudioCodec=function(b){var g=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&g&&(this.log("Swapping audio codec"),g.indexOf("mp4a.40.5")!==-1?g="mp4a.40.2":g="mp4a.40.5"),g},O._loadBitrateTestFrag=function(b){var g=this;this._doFragLoad(b).then(function(f){var C=g.hls;if(!f||C.nextLoadLevel||g.fragContextChanged(b))return;g.fragLoadError=0,g.state=j.State.IDLE,g.startFragRequested=!1,g.bitrateTest=!1;var E=b.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),C.trigger(G.Events.FRAG_LOADED,f)})},O._handleTransmuxComplete=function(b){var g,f="main",C=this.hls,E=b.remuxResult,v=b.chunkMeta,N=this.getCurrentContext(v);if(!N){this.warn("The loading context changed while buffering fragment "+v.sn+" of level "+v.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(v.level);return}var U=N.frag,A=N.part,H=N.level,F=E.video,T=E.text,z=E.id3,Q=E.initSegment,ne=this.altAudio?void 0:E.audio;if(this.fragContextChanged(U))return;if(this.state=j.State.PARSING,Q){Q.tracks&&(this._bufferInitSegment(H,Q.tracks,U,v),C.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:f,tracks:Q.tracks}));var se=Q.initPTS,xe=Q.timescale;Object(V.isFiniteNumber)(se)&&(this.initPTS[U.cc]=se,C.trigger(G.Events.INIT_PTS_FOUND,{frag:U,id:f,initPTS:se,timescale:xe}))}if(F&&E.independent!==!1){if(H.details){var me=F.startPTS,ve=F.endPTS,Oe=F.startDTS,Re=F.endDTS;if(A)A.elementaryStreams[F.type]={startPTS:me,endPTS:ve,startDTS:Oe,endDTS:Re};else if(F.firstKeyFrame&&F.independent&&(this.couldBacktrack=!0),F.dropped&&F.independent){var fe=this.getLoadPosition()+this.config.maxBufferHole;if(fe<me){this.backtrack(U);return}U.setElementaryStreamInfo(F.type,U.start,ve,U.start,Re,!0)}U.setElementaryStreamInfo(F.type,me,ve,Oe,Re),this.bufferFragmentData(F,U,A,v)}}else if(E.independent===!1){this.backtrack(U);return}if(ne){var ue=ne.startPTS,Pe=ne.endPTS,et=ne.startDTS,rt=ne.endDTS;A&&(A.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:Pe,startDTS:et,endDTS:rt}),U.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,ue,Pe,et,rt),this.bufferFragmentData(ne,U,A,v)}if(z!=null&&(g=z.samples)!==null&&g!==void 0&&g.length){var tt={frag:U,id:f,samples:z.samples};C.trigger(G.Events.FRAG_PARSING_METADATA,tt)}if(T){var it={frag:U,id:f,samples:T.samples};C.trigger(G.Events.FRAG_PARSING_USERDATA,it)}},O._bufferInitSegment=function(b,g,f,C){var E=this;if(this.state!==j.State.PARSING)return;this.audioOnly=!!g.audio&&!g.video,this.altAudio&&!this.audioOnly&&delete g.audio;var v=g.audio,N=g.video,U=g.audiovideo;if(v){var A=b.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),v.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(A="mp4a.40.5")),H.indexOf("android")!==-1&&v.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),b.audioCodec&&b.audioCodec!==A&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+A+'"'),v.levelCodec=A,v.id="main",this.log("Init audio buffer, container:"+v.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(b.audioCodec||"")+"/"+v.codec+"]")}N&&(N.levelCodec=b.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+N.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,g),Object.keys(g).forEach(function(F){var T=g[F],z=T.initSegment;z!=null&&z.byteLength&&E.hls.trigger(G.Events.BUFFER_APPENDING,{type:F,data:z,frag:f,part:null,chunkMeta:C,parent:f.type})}),this.tick()},O.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var g=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,g?this.resetFragmentLoading(b):this.state=j.State.BACKTRACKING},O.checkFragmentChanged=function(){var b=this.media,g=null;if(b&&b.readyState>1&&b.seeking===!1){var f=b.currentTime;if(W.BufferHelper.isBuffered(b,f)?g=this.getAppendedFrag(f):W.BufferHelper.isBuffered(b,f+.1)&&(g=this.getAppendedFrag(f+.1)),g){var C=this.fragPlaying,E=g.level;(!C||g.sn!==C.sn||C.level!==E||g.urlId!==C.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:g}),(!C||C.level!==E)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=g)}}},a(L,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var g=this.getAppendedFrag(b.currentTime);if(g)return g.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var g=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(g)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"SubtitleStreamController",function(){return r});var V=P("./src/events.ts"),j=P("./src/utils/logger.ts"),M=P("./src/utils/buffer-helper.ts"),G=P("./src/controller/fragment-finders.ts"),W=P("./src/utils/discontinuities.ts"),n=P("./src/controller/level-helper.ts"),D=P("./src/controller/fragment-tracker.ts"),m=P("./src/controller/base-stream-controller.ts"),p=P("./src/types/loader.ts"),h=P("./src/types/level.ts");function c(s,S){for(var w=0;w<S.length;w++){var x=S[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(s,x.key,x)}}function o(s,S,w){return S&&c(s.prototype,S),w&&c(s,w),s}function d(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,i(s,S)}function i(s,S){return i=Object.setPrototypeOf||function(x,L){return x.__proto__=L,x},i(s,S)}var a=500,r=function(s){d(S,s);function S(x,L){var O;return O=s.call(this,x,L,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var w=S.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var L=this.hls;L.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(V.Events.ERROR,this.onError,this),L.on(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var L=this.hls;L.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(V.Events.ERROR,this.onError,this),L.off(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.startLoad=function(){this.stopLoad(),this.state=m.State.IDLE,this.setInterval(a),this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},w.onLevelLoaded=function(L,O){this.mainDetails=O.details},w.onSubtitleFragProcessed=function(L,O){var _=O.frag,b=O.success;if(this.fragPrevious=_,this.state=m.State.IDLE,!b)return;var g=this.tracksBuffered[this.currentTrackId];if(!g)return;for(var f,C=_.start,E=0;E<g.length;E++)if(C>=g[E].start&&C<=g[E].end){f=g[E];break}var v=_.start+_.duration;f?f.end=v:(f={start:C,end:v},g.push(f)),this.fragmentTracker.fragBuffered(_)},w.onBufferFlushing=function(L,O){var _=O.startOffset,b=O.endOffset;if(_===0&&b!==Number.POSITIVE_INFINITY){var g=this.currentTrackId,f=this.levels;if(!f.length||!f[g]||!f[g].details)return;var C=f[g].details,E=C.targetduration,v=b-E;if(v<=0)return;O.endOffsetSubtitles=Math.max(0,v),this.tracksBuffered.forEach(function(N){for(var U=0;U<N.length;){if(N[U].end<=v){N.shift();continue}else if(N[U].start<v)N[U].start=v;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(_,v,p.PlaylistLevelType.SUBTITLE)}},w.onError=function(L,O){var _,b=O.frag;if(!b||b.type!==p.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=m.State.IDLE},w.onSubtitleTracksUpdated=function(L,O){var _=this,b=O.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(g){return new h.Level(g)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(g){_.tracksBuffered[g.id]=[]}),this.mediaBuffer=null},w.onSubtitleTrackSwitch=function(L,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var _=this.levels[this.currentTrackId];_!=null&&_.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,_&&this.setInterval(a)},w.onSubtitleTrackLoaded=function(L,O){var _,b=O.details,g=O.id,f=this.currentTrackId,C=this.levels;if(!C.length)return;var E=C[f];if(g>=C.length||g!==f||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(_=E.details)!==null&&_!==void 0&&_.live){var v=this.mainDetails;if(b.deltaUpdateFailed||!v)return;var N=v.fragments[0];if(!E.details)b.hasProgramDateTime&&v.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(b,v):N&&Object(n.addSliding)(b,N.start);else{var U=this.alignPlaylists(b,E.details);U===0&&N&&Object(n.addSliding)(b,N.start)}}if(E.details=b,this.levelLastLoaded=g,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var A=Object(G.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},w._handleFragmentLoadComplete=function(L){var O=L.frag,_=L.payload,b=O.decryptdata,g=this.hls;if(this.fragContextChanged(O))return;if(_&&_.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),b.key.buffer,b.iv.buffer).then(function(C){var E=performance.now();g.trigger(V.Events.FRAG_DECRYPTED,{frag:O,payload:C,stats:{tstart:f,tdecrypt:E}})})}},w.doTick=function(){if(!this.media){this.state=m.State.IDLE;return}if(this.state===m.State.IDLE){var L,O=this.currentTrackId,_=this.levels;if(!_.length||!_[O]||!_[O].details)return;var b=_[O].details,g=b.targetduration,f=this.config,C=this.media,E=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-g,f.maxBufferHole),v=E.end,N=E.len,U=this.getMaxBufferLength()+g;if(N>U)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var A=b.fragments,H=A.length,F=b.edge,T,z=this.fragPrevious;if(v<F){var Q=f.maxFragLookUpTolerance;z&&b.hasProgramDateTime&&(T=Object(G.findFragmentByPDT)(A,z.endProgramDateTime,Q)),T||(T=Object(G.findFragmentByPTS)(z,A,v,Q),!T&&z&&z.start<A[0].start&&(T=A[0]))}else T=A[H-1];(L=T)!==null&&L!==void 0&&L.encrypted?(j.logger.log("Loading key for "+T.sn),this.state=m.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:T})):T&&this.fragmentTracker.getState(T)===D.FragmentState.NOT_LOADED&&this.loadFragment(T,b,v)}},w.loadFragment=function(L,O,_){this.fragCurrent=L,s.prototype.loadFragment.call(this,L,O,_)},o(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(m.default)},"./src/controller/subtitle-track-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),j=P("./src/utils/texttrack-utils.ts"),M=P("./src/controller/base-playlist-controller.ts"),G=P("./src/types/loader.ts");function W(c,o){for(var d=0;d<o.length;d++){var i=o[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,o,d){return o&&W(c.prototype,o),d&&W(c,d),c}function D(c,o){c.prototype=Object.create(o.prototype),c.prototype.constructor=c,m(c,o)}function m(c,o){return m=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},m(c,o)}var p=function(c){D(o,c);function o(i){var a;return a=c.call(this,i,"[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 d=o.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},d.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)},d.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)},d.onMediaAttached=function(a,r){if(this.media=r.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)},d.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},d.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=h(this.media.textTracks);a.forEach(function(r){Object(j.clearCurrentCues)(r)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(a,r){this.tracks=r.subtitleTracks},d.onSubtitleTrackLoaded=function(a,r){var s=r.id,S=r.details,w=this.trackId,x=this.tracksInGroup[w];if(!x){this.warn("Invalid subtitle track id "+s);return}var L=x.details;x.details=r.details,this.log("subtitle track "+s+" loaded ["+S.startSN+"-"+S.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,r,L))},d.onLevelLoading=function(a,r){this.switchLevel(r.level)},d.onLevelSwitching=function(a,r){this.switchLevel(r.level)},d.switchLevel=function(a){var r=this.hls.levels[a];if(!(r!=null&&r.textGroupIds))return;var s=r.textGroupIds[r.urlId];if(this.groupId!==s){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(O){return!s||O.groupId===s});this.tracksInGroup=w;var x=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=s;var L={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,L),x!==-1&&this.setSubtitleTrack(x,S)}},d.findTrackId=function(a){for(var r=this.tracksInGroup,s=0;s<r.length;s++){var S=r[s];if((!this.selectDefaultTrack||S.default)&&(!a||a===S.name))return S.id}return-1},d.onError=function(a,r){if(c.prototype.onError.call(this,a,r),r.fatal||!r.context)return;r.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},d.loadPlaylist=function(a){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var s=r.id,S=r.groupId,w=r.url;if(a)try{w=a.addDirectives(w)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:w,id:s,groupId:S,deliveryDirectives:a||null})}},d.toggleTrackModes=function(a){var r=this,s=this.media,S=this.subtitleDisplay,w=this.trackId;if(!s)return;var x=h(s.textTracks),L=x.filter(function(b){return b.groupId===r.groupId});if(a===-1)[].slice.call(x).forEach(function(b){b.mode="disabled"});else{var O=L[w];O&&(O.mode="disabled")}var _=L[a];_&&(_.mode=S?"showing":"hidden")},d.setSubtitleTrack=function(a,r){var s,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(s=S[a])!==null&&s!==void 0&&s.details)||a<-1||a>=S.length)return;this.clearTimer();var w=S[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,w){var x=w.id,L=w.groupId,O=L===void 0?"":L,_=w.name,b=w.type,g=w.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:O,name:_,type:b,url:g});var f=this.switchParams(w.url,r==null?void 0:r.details);this.loadPlaylist(f)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:a})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,r=h(this.media.textTracks),s=0;s<r.length;s++)if(r[s].mode==="hidden")a=s;else if(r[s].mode==="showing"){a=s;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},n(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,r)}}]),o}(M.default);function h(c){for(var o=[],d=0;d<c.length;d++){var i=c[d];i.kind==="subtitles"&&i.label&&o.push(c[d])}return o}X.default=p},"./src/controller/timeline-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"TimelineController",function(){return h});var V=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),M=P("./src/utils/cea-608-parser.ts"),G=P("./src/utils/output-filter.ts"),W=P("./src/utils/webvtt-parser.ts"),n=P("./src/utils/texttrack-utils.ts"),D=P("./src/utils/imsc1-ttml-parser.ts"),m=P("./src/types/loader.ts"),p=P("./src/utils/logger.ts"),h=function(){function i(r){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=d(),this.captionsProperties=void 0,this.hls=r,this.config=r.config,this.Cues=r.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 s=new G.default(this,"textTrack1"),S=new G.default(this,"textTrack2"),w=new G.default(this,"textTrack3"),x=new G.default(this,"textTrack4");this.cea608Parser1=new M.default(1,s,S),this.cea608Parser2=new M.default(3,w,x)}r.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(j.Events.FRAG_LOADING,this.onFragLoading,this),r.on(j.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=i.prototype;return a.destroy=function(){var s=this.hls;s.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(j.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(j.Events.FRAG_LOADING,this.onFragLoading,this),s.off(j.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(j.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(j.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(j.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(j.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(s,S,w,x,L){for(var O=!1,_=L.length;_--;){var b=L[_],g=o(b[0],b[1],S,w);if(g>=0&&(b[0]=Math.min(b[0],S),b[1]=Math.max(b[1],w),O=!0,g/(w-S)>.5))return}if(O||L.push([S,w]),this.config.renderTextTracksNatively){var f=this.captionsTracks[s];this.Cues.newCue(f,S,w,x)}else{var C=this.Cues.newCue(null,S,w,x);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:C,track:s})}},a.onInitPtsFound=function(s,S){var w=this,x=S.frag,L=S.id,O=S.initPTS,_=S.timescale,b=this.unparsedVttFrags;L==="main"&&(this.initPTS[x.cc]=O,this.timescale[x.cc]=_),b.length&&(this.unparsedVttFrags=[],b.forEach(function(g){w.onFragLoaded(j.Events.FRAG_LOADED,g)}))},a.getExistingTrack=function(s){var S=this.media;if(S)for(var w=0;w<S.textTracks.length;w++){var x=S.textTracks[w];if(x[s])return x}return null},a.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},a.createNativeTrack=function(s){if(this.captionsTracks[s])return;var S=this.captionsProperties,w=this.captionsTracks,x=this.media,L=S[s],O=L.label,_=L.languageCode,b=this.getExistingTrack(s);if(b)w[s]=b,Object(n.clearCurrentCues)(w[s]),Object(n.sendAddTrackEvent)(w[s],x);else{var g=this.createTextTrack("captions",O,_);g&&(g[s]=!0,w[s]=g)}},a.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var S=this.captionsProperties[s];if(!S)return;var w=S.label,x={_id:s,label:w,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[s]=x,this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},a.createTextTrack=function(s,S,w){var x=this.media;return x?x.addTextTrack(s,S,w):void 0},a.onMediaAttaching=function(s,S){this.media=S.media,this._cleanTracks()},a.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(S){Object(n.clearCurrentCues)(s[S]),delete s[S]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),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 s=this.media;if(!s)return;var S=s.textTracks;if(S)for(var w=0;w<S.length;w++)Object(n.clearCurrentCues)(S[w])},a.onSubtitleTracksUpdated=function(s,S){var w=this;this.textTracks=[];var x=S.subtitleTracks||[],L=x.some(function(g){return g.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var O=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(g,f){var C;if(f<_.length){for(var E=null,v=0;v<_.length;v++)if(c(_[v],g)){E=_[v];break}E&&(C=E)}C?Object(n.clearCurrentCues)(C):(C=w.createTextTrack("subtitles",g.name,g.lang),C&&(C.mode="disabled")),C&&(C.groupId=g.groupId,w.textTracks.push(C))})}else if(!O&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(g){return{label:g.name,kind:g.type.toLowerCase(),default:g.default,subtitleTrack:g}});this.hls.trigger(j.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},a.onManifestLoaded=function(s,S){var w=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(x){var L=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!L)return;var O="textTrack"+L[1],_=w.captionsProperties[O];if(!_)return;_.label=x.name,x.lang&&(_.languageCode=x.lang),_.media=x})},a.onFragLoading=function(s,S){var w=this.cea608Parser1,x=this.cea608Parser2,L=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(w&&x))return;if(S.frag.type===m.PlaylistLevelType.MAIN){var _,b,g=S.frag.sn,f=(_=S==null||((b=S.part)===null||b===void 0)?void 0:b.index)!=null?_:-1;g===L+1||g===L&&f===O+1||(w.reset(),x.reset()),this.lastSn=g,this.lastPartIndex=f}},a.onFragLoaded=function(s,S){var w=S.frag,x=S.payload,L=this.initPTS,O=this.unparsedVttFrags;if(w.type===m.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(V.isFiniteNumber)(L[w.cc])){O.push(S),L.length&&this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Missing initial subtitle PTS")});return}var _=w.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var b=this.tracks[w.level],g=this.vttCCs;g[w.cc]||(g[w.cc]={start:w.start,prevCC:this.prevCC,new:!0},this.prevCC=w.cc),b&&b.textCodec===D.IMSC1_CODEC?this._parseIMSC1(w,x):this._parseVTTs(w,x,g)}}else this.hls.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(s,S){var w=this,x=this.hls;Object(D.parseIMSC1)(S,this.initPTS[s.cc],this.timescale[s.cc],function(L){w._appendCues(L,s.level),x.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(L){p.logger.log("Failed to parse IMSC1: "+L),x.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:L})})},a._parseVTTs=function(s,S,w){var x=this,L=this.hls;Object(W.parseWebVTT)(S,this.initPTS[s.cc],this.timescale[s.cc],w,s.cc,s.start,function(O){x._appendCues(O,s.level),L.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(O){x._fallbackToIMSC1(s,S),p.logger.log("Failed to parse VTT cue: "+O),L.trigger(j.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:O})})},a._fallbackToIMSC1=function(s,S){var w=this,x=this.tracks[s.level];x.textCodec||Object(D.parseIMSC1)(S,this.initPTS[s.cc],this.timescale[s.cc],function(){x.textCodec=D.IMSC1_CODEC,w._parseIMSC1(s,S)},function(){x.textCodec="wvtt"})},a._appendCues=function(s,S){var w=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[S];if(x.mode==="disabled")return;s.forEach(function(_){return Object(n.addCueToTrack)(x,_)})}else{var L=this.tracks[S],O=L.default?"default":"subtitles"+S;w.trigger(j.Events.CUES_PARSED,{type:"subtitles",cues:s,track:O})}},a.onFragDecrypted=function(s,S){var w=S.frag;if(w.type===m.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[w.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(j.Events.FRAG_LOADED,S)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(s,S){var w=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(w&&x))return;for(var L=0;L<S.samples.length;L++){var O=S.samples[L].bytes;if(O){var _=this.extractCea608Data(O);w.addData(S.samples[L].pts,_[0]),x.addData(S.samples[L].pts,_[1])}}},a.onBufferFlushing=function(s,S){var w=S.startOffset,x=S.endOffset,L=S.endOffsetSubtitles,O=S.type,_=this.media;if(!_||_.currentTime<x)return;if(!O||O==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(f){return Object(n.removeCuesInRange)(b[f],w,x)})}if(this.config.renderTextTracksNatively&&(w===0&&L!==void 0)){var g=this.textTracks;Object.keys(g).forEach(function(f){return Object(n.removeCuesInRange)(g[f],w,L)})}},a.extractCea608Data=function(s){for(var S=s[0]&31,w=2,x=[[],[]],L=0;L<S;L++){var O=s[w++],_=127&s[w++],b=127&s[w++],g=(4&O)!==0,f=3&O;if(_===0&&b===0)continue;g&&((f===0||f===1)&&(x[f].push(_),x[f].push(b)))}return x},i}();function c(i,a){return i&&i.label===a.name&&!(i.textTrack1||i.textTrack2)}function o(i,a,r,s){return Math.min(a,s)-Math.max(i,r)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function j(G,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=W}var M=j.prototype;return M.decrypt=function(W,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,W)},j}()},"./src/crypt/aes-decryptor.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"removePadding",function(){return j}),P.d(X,"default",function(){return M});var V=P("./src/utils/typed-array.ts");function j(G){var W=G.byteLength,n=W&&new DataView(G.buffer).getUint8(W-1);return n?Object(V.sliceUint8)(G,0,W-n):G}var M=function(){function G(){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 W=G.prototype;return W.uint8ArrayToUint32Array_=function(D){for(var m=new DataView(D),p=new Uint32Array(4),h=0;h<4;h++)p[h]=m.getUint32(h*4);return p},W.initTable=function(){var D=this.sBox,m=this.invSBox,p=this.subMix,h=p[0],c=p[1],o=p[2],d=p[3],i=this.invSubMix,a=i[0],r=i[1],s=i[2],S=i[3],w=new Uint32Array(256),x=0,L=0,O=0;for(O=0;O<256;O++)O<128?w[O]=O<<1:w[O]=O<<1^283;for(O=0;O<256;O++){var _=L^L<<1^L<<2^L<<3^L<<4;_=_>>>8^_&255^99,D[x]=_,m[_]=x;var b=w[x],g=w[b],f=w[g],C=w[_]*257^_*16843008;h[x]=C<<24|C>>>8,c[x]=C<<16|C>>>16,o[x]=C<<8|C>>>24,d[x]=C,C=f*16843009^g*65537^b*257^x*16843008,a[_]=C<<24|C>>>8,r[_]=C<<16|C>>>16,s[_]=C<<8|C>>>24,S[_]=C,x?(x=b^w[w[w[f^b]]],L^=w[w[L]]):x=L=1}},W.expandKey=function(D){for(var m=this.uint8ArrayToUint32Array_(D),p=!0,h=0;h<m.length&&p;)p=m[h]===this.key[h],h++;if(p)return;this.key=m;var c=this.keySize=m.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var o=this.ksRows=(c+6+1)*4,d,i,a=this.keySchedule=new Uint32Array(o),r=this.invKeySchedule=new Uint32Array(o),s=this.sBox,S=this.rcon,w=this.invSubMix,x=w[0],L=w[1],O=w[2],_=w[3],b,g;for(d=0;d<o;d++){if(d<c){b=a[d]=m[d];continue}g=b,d%c===0?(g=g<<8|g>>>24,g=s[g>>>24]<<24|s[g>>>16&255]<<16|s[g>>>8&255]<<8|s[g&255],g^=S[d/c|0]<<24):c>6&&d%c===4&&(g=s[g>>>24]<<24|s[g>>>16&255]<<16|s[g>>>8&255]<<8|s[g&255]),a[d]=b=(a[d-c]^g)>>>0}for(i=0;i<o;i++)d=o-i,i&3?g=a[d]:g=a[d-4],i<4||d<=4?r[i]=g:r[i]=x[s[g>>>24]]^L[s[g>>>16&255]]^O[s[g>>>8&255]]^_[s[g&255]],r[i]=r[i]>>>0},W.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},W.decrypt=function(D,m,p){for(var h=this.keySize+6,c=this.invKeySchedule,o=this.invSBox,d=this.invSubMix,i=d[0],a=d[1],r=d[2],s=d[3],S=this.uint8ArrayToUint32Array_(p),w=S[0],x=S[1],L=S[2],O=S[3],_=new Int32Array(D),b=new Int32Array(_.length),g,f,C,E,v,N,U,A,H,F,T,z,Q,ne,se=this.networkToHostOrderSwap;m<_.length;){for(H=se(_[m]),F=se(_[m+1]),T=se(_[m+2]),z=se(_[m+3]),v=H^c[0],N=z^c[1],U=T^c[2],A=F^c[3],Q=4,ne=1;ne<h;ne++)g=i[v>>>24]^a[N>>16&255]^r[U>>8&255]^s[A&255]^c[Q],f=i[N>>>24]^a[U>>16&255]^r[A>>8&255]^s[v&255]^c[Q+1],C=i[U>>>24]^a[A>>16&255]^r[v>>8&255]^s[N&255]^c[Q+2],E=i[A>>>24]^a[v>>16&255]^r[N>>8&255]^s[U&255]^c[Q+3],v=g,N=f,U=C,A=E,Q=Q+4;g=o[v>>>24]<<24^o[N>>16&255]<<16^o[U>>8&255]<<8^o[A&255]^c[Q],f=o[N>>>24]<<24^o[U>>16&255]<<16^o[A>>8&255]<<8^o[v&255]^c[Q+1],C=o[U>>>24]<<24^o[A>>16&255]<<16^o[v>>8&255]<<8^o[N&255]^c[Q+2],E=o[A>>>24]<<24^o[v>>16&255]<<16^o[N>>8&255]<<8^o[U&255]^c[Q+3],b[m]=se(g^w),b[m+1]=se(E^x),b[m+2]=se(C^L),b[m+3]=se(f^O),w=H,x=F,L=T,O=z,m=m+4}return b.buffer},G}()},"./src/crypt/decrypter.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return m});var V=P("./src/crypt/aes-crypto.ts"),j=P("./src/crypt/fast-aes-key.ts"),M=P("./src/crypt/aes-decryptor.ts"),G=P("./src/utils/logger.ts"),W=P("./src/utils/mp4-tools.ts"),n=P("./src/utils/typed-array.ts"),D=16,m=function(){function p(c,o,d){var i=d===void 0?{}:d,a=i.removePKCS7Padding,r=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=o,this.removePKCS7Padding=r,r)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var h=p.prototype;return h.destroy=function(){this.observer=null},h.isSync=function(){return this.config.enableSoftwareAES},h.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var d=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(d):d},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(o,d,i,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),d,i);var r=this.flush();r&&a(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),d,i).then(a)},h.softwareDecrypt=function(o,d,i){var a=this.currentIV,r=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(o=Object(W.appendUint8Array)(s,o),this.remainderData=null);var S=this.getValidChunk(o);if(!S.length)return null;a&&(i=a);var w=this.softwareDecrypter;w||(w=this.softwareDecrypter=new M.default),w.expandKey(d);var x=r;return this.currentResult=w.decrypt(S.buffer,0,i),this.currentIV=Object(n.sliceUint8)(S,-16).buffer,x||null},h.webCryptoDecrypt=function(o,d,i){var a=this,r=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new j.default(r,d)),this.fastAesKey.expandKey().then(function(s){if(!r)return Promise.reject(new Error("web crypto not initialized"));var S=new V.default(r,i);return S.decrypt(o.buffer,s)}).catch(function(s){return a.onWebCryptoError(s,o,d,i)})},h.onWebCryptoError=function(o,d,i,a){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,i,a)},h.getValidChunk=function(o){var d=o,i=o.length-o.length%D;return i!==o.length&&(d=Object(n.sliceUint8)(o,0,i),this.remainderData=Object(n.sliceUint8)(o,i)),d},h.logOnce=function(o){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function j(G,W){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=W}var M=j.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},j}()},"./src/demux/aacdemuxer.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/adts.ts"),M=P("./src/utils/logger.ts"),G=P("./src/demux/id3.ts");function W(m,p){m.prototype=Object.create(p.prototype),m.prototype.constructor=m,n(m,p)}function n(m,p){return n=Object.setPrototypeOf||function(c,o){return c.__proto__=o,c},n(m,p)}var D=function(m){W(p,m);function p(c,o){var d;return d=m.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=c,d.config=o,d}var h=p.prototype;return h.resetInitSegment=function(o,d,i){m.prototype.resetInitSegment.call(this,o,d,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var d=G.getID3Data(o,0)||[],i=d.length,a=o.length;i<a;i++)if(j.probe(o,i))return M.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(o,d){return j.canParse(o,d)},h.appendFrame=function(o,d,i){j.initTrackConfig(o,this.observer,d,i,o.manifestCodec);var a=j.appendFrame(o,d,i,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},p}(V.default);D.minProbeByteLength=9,X.default=D},"./src/demux/adts.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"getAudioConfig",function(){return G}),P.d(X,"isHeaderPattern",function(){return W}),P.d(X,"getHeaderLength",function(){return n}),P.d(X,"getFullFrameLength",function(){return D}),P.d(X,"canGetFrameLength",function(){return m}),P.d(X,"isHeader",function(){return p}),P.d(X,"canParse",function(){return h}),P.d(X,"probe",function(){return c}),P.d(X,"initTrackConfig",function(){return o}),P.d(X,"getFrameDuration",function(){return d}),P.d(X,"parseFrameHeader",function(){return i}),P.d(X,"appendFrame",function(){return a});var V=P("./src/utils/logger.ts"),j=P("./src/errors.ts"),M=P("./src/events.ts");function G(r,s,S,w){var x,L,O,_,b=navigator.userAgent.toLowerCase(),g=w,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((s[S+2]&192)>>>6)+1;var C=(s[S+2]&60)>>>2;if(C>f.length-1){r.trigger(M.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return O=(s[S+2]&1)<<2,O|=(s[S+3]&192)>>>6,V.logger.log("manifest codec:"+w+", ADTS type:"+x+", samplingIndex:"+C),/firefox/i.test(b)?C>=6?(x=5,_=new Array(4),L=C-3):(x=2,_=new Array(2),L=C):b.indexOf("android")!==-1?(x=2,_=new Array(2),L=C):(x=5,_=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&C>=6?L=C-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(C>=6&&O===1||/vivaldi/i.test(b))||!w&&O===1)&&(x=2,_=new Array(2)),L=C)),_[0]=x<<3,_[0]|=(C&14)>>1,_[1]|=(C&1)<<7,_[1]|=O<<3,x===5&&(_[1]|=(L&14)>>1,_[2]=(L&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:f[C],channelCount:O,codec:"mp4a.40."+x,manifestCodec:g}}function W(r,s){return r[s]===255&&(r[s+1]&246)===240}function n(r,s){return r[s+1]&1?7:9}function D(r,s){return(r[s+3]&3)<<11|r[s+4]<<3|(r[s+5]&224)>>>5}function m(r,s){return s+5<r.length}function p(r,s){return s+1<r.length&&W(r,s)}function h(r,s){return m(r,s)&&W(r,s)&&D(r,s)<=r.length-s}function c(r,s){if(p(r,s)){var S=n(r,s);if(s+S>=r.length)return!1;var w=D(r,s);if(w<=S)return!1;var x=s+w;return x===r.length||p(r,x)}return!1}function o(r,s,S,w,x){if(!r.samplerate){var L=G(s,S,w,x);if(!L)return;r.config=L.config,r.samplerate=L.samplerate,r.channelCount=L.channelCount,r.codec=L.codec,r.manifestCodec=L.manifestCodec,V.logger.log("parsed codec:"+r.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function d(r){return 1024*9e4/r}function i(r,s,S,w,x){var L=n(r,s),O=D(r,s);if(O-=L,O>0){var _=S+w*x;return{headerLength:L,frameLength:O,stamp:_}}}function a(r,s,S,w,x){var L=d(r.samplerate),O=i(s,S,w,x,L);if(O){var _=O.frameLength,b=O.headerLength,g=O.stamp,f=b+_,C=Math.max(0,S+f-s.length),E;C?(E=new Uint8Array(f-b),E.set(s.subarray(S+b,s.length),0)):E=s.subarray(S+b,S+f);var v={unit:E,pts:g};return C||r.samples.push(v),{sample:v,length:f,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"initPTSFn",function(){return D});var V=P("./src/polyfills/number.ts"),j=P("./src/demux/id3.ts"),M=P("./src/demux/dummy-demuxed-track.ts"),G=P("./src/utils/mp4-tools.ts"),W=P("./src/utils/typed-array.ts"),n=function(){function m(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=m.prototype;return p.resetInitSegment=function(c,o,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(c,o){return!1},p.appendFrame=function(c,o,d){},p.demux=function(c,o){this.cachedData&&(c=Object(G.appendUint8Array)(this.cachedData,c),this.cachedData=null);var d=j.getID3Data(c,0),i=d?d.length:0,a,r,s=this._audioTrack,S=this._id3Track,w=d?j.getTimeStamp(d):void 0,x=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(w,o)),d&&d.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),r=this.initPTS;i<x;){if(this.canParse(c,i)){var L=this.appendFrame(s,c,i);L?(this.frameIndex++,r=L.sample.pts,i+=L.length,a=i):i=x}else j.canParse(c,i)?(d=j.getID3Data(c,i),S.samples.push({pts:r,dts:r,data:d}),i+=d.length,a=i):i++;if(i===x&&a!==x){var O=Object(W.sliceUint8)(c,a);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:s,avcTrack:Object(M.dummyTrack)(),id3Track:S,textTrack:Object(M.dummyTrack)()}},p.demuxSampleAes=function(c,o,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(c){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},p.destroy=function(){},m}(),D=function(p,h){return Object(V.isFiniteNumber)(p)?p*90:h*9e4};X.default=n},"./src/demux/chunk-cache.ts":function(Z,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 G=M.prototype;return G.push=function(n){this.chunks.push(n),this.dataLength+=n.length},G.flush=function(){var n=this.chunks,D=this.dataLength,m;if(n.length)n.length===1?m=n[0]:m=j(n,D);else return new Uint8Array(0);return this.reset(),m},G.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function j(M,G){for(var W=new Uint8Array(G),n=0,D=0;D<M.length;D++){var m=M[D];W.set(m,n),n+=m.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(Z,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(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/logger.ts"),j=function(){function M(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var G=M.prototype;return G.loadWord=function(){var n=this.data,D=this.bytesAvailable,m=n.byteLength-D,p=new Uint8Array(4),h=Math.min(4,D);if(h===0)throw new Error("no bytes available");p.set(n.subarray(m,m+h)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=h*8,this.bytesAvailable-=h},G.skipBits=function(n){var D;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,D=n>>3,n-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},G.readBits=function(n){var D=Math.min(this.bitsAvailable,n),m=this.word>>>32-D;return n>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=n-D,D>0&&this.bitsAvailable?m<<D|this.readBits(D):m},G.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},G.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(n){for(var D=8,m=8,p,h=0;h<n;h++)m!==0&&(p=this.readEG(),m=(D+p+256)%256),D=m===0?D:m},G.readSPS=function(){var n=0,D=0,m=0,p=0,h,c,o,d=this.readUByte.bind(this),i=this.readBits.bind(this),a=this.readUEG.bind(this),r=this.readBoolean.bind(this),s=this.skipBits.bind(this),S=this.skipEG.bind(this),w=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);d();var L=d();if(i(5),s(3),d(),w(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var O=a();if(O===3&&s(1),w(),w(),s(1),r())for(c=O!==3?8:12,o=0;o<c;o++)r()&&(o<6?x(16):x(64))}w();var _=a();if(_===0)a();else if(_===1)for(s(1),S(),S(),h=a(),o=0;o<h;o++)S();w(),s(1);var b=a(),g=a(),f=i(1);f===0&&s(1),s(1),r()&&(n=a(),D=a(),m=a(),p=a());var C=[1,1];if(r()&&r()){var E=d();switch(E){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((b+1)*16-n*2-D*2),height:(2-f)*(g+1)*16-(f?2:4)*(m+p),pixelRatio:C}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();X.default=j},"./src/demux/id3.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"isHeader",function(){return V}),P.d(X,"isFooter",function(){return j}),P.d(X,"getID3Data",function(){return M}),P.d(X,"canParse",function(){return W}),P.d(X,"getTimeStamp",function(){return n}),P.d(X,"isTimeStampFrame",function(){return D}),P.d(X,"getID3Frames",function(){return p}),P.d(X,"decodeFrame",function(){return h}),P.d(X,"utf8ArrayToStr",function(){return a}),P.d(X,"testables",function(){return r});var V=function(x,L){return L+10<=x.length&&(x[L]===73&&x[L+1]===68&&x[L+2]===51&&(x[L+3]<255&&x[L+4]<255&&(x[L+6]<128&&x[L+7]<128&&x[L+8]<128&&x[L+9]<128)))},j=function(x,L){return L+10<=x.length&&(x[L]===51&&x[L+1]===68&&x[L+2]===73&&(x[L+3]<255&&x[L+4]<255&&(x[L+6]<128&&x[L+7]<128&&x[L+8]<128&&x[L+9]<128)))},M=function(x,L){for(var O=L,_=0;V(x,L);){_+=10;var b=G(x,L+6);_+=b,j(x,L+10)&&(_+=10),L+=_}return _>0?x.subarray(O,O+_):void 0},G=function(x,L){var O=0;return O=(x[L]&127)<<21,O|=(x[L+1]&127)<<14,O|=(x[L+2]&127)<<7,O|=x[L+3]&127,O},W=function(x,L){return V(x,L)&&G(x,L+6)+10<=x.length-L},n=function(x){for(var L=p(x),O=0;O<L.length;O++){var _=L[O];if(D(_))return i(_)}return},D=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},m=function(x){var L=String.fromCharCode(x[0],x[1],x[2],x[3]),O=G(x,4),_=10;return{type:L,size:O,data:x.subarray(_,_+O)}},p=function(x){for(var L=0,O=[];V(x,L);){var _=G(x,L+6);L+=10;for(var b=L+_;L+8<b;){var g=m(x.subarray(L)),f=h(g);f&&O.push(f),L+=g.size+10}j(x,L)&&(L+=10)}return O},h=function(x){return x.type==="PRIV"?c(x):x.type[0]==="W"?d(x):o(x)},c=function(x){if(x.size<2)return;var L=a(x.data,!0),O=new Uint8Array(x.data.subarray(L.length+1));return{key:x.type,info:L,data:O.buffer}},o=function(x){if(x.size<2)return;if(x.type==="TXXX"){var L=1,O=a(x.data.subarray(L),!0);L+=O.length+1;var _=a(x.data.subarray(L));return{key:x.type,info:O,data:_}}var b=a(x.data.subarray(1));return{key:x.type,data:b}},d=function(x){if(x.type==="WXXX"){if(x.size<2)return;var L=1,O=a(x.data.subarray(L),!0);L+=O.length+1;var _=a(x.data.subarray(L));return{key:x.type,info:O,data:_}}var b=a(x.data);return{key:x.type,data:b}},i=function(x){if(x.data.byteLength===8){var L=new Uint8Array(x.data),O=L[3]&1,_=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return _/=45,O&&(_+=4772185884e-2),Math.round(_)}return},a=function(x,L){L===void 0&&(L=!1);var O=S();if(O){var _=O.decode(x);if(L){var b=_.indexOf("\0");return b!==-1?_.substring(0,b):_}return _.replace(/\0/g,"")}for(var g=x.length,f,C,E,v="",N=0;N<g;){if(f=x[N++],f===0&&L)return v;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:v+=String.fromCharCode(f);break;case 12:case 13:C=x[N++],v+=String.fromCharCode((f&31)<<6|C&63);break;case 14:C=x[N++],E=x[N++],v+=String.fromCharCode((f&15)<<12|(C&63)<<6|(E&63)<<0);break;default:}}return v},r={decodeTextFrame:o},s;function S(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/id3.ts"),M=P("./src/utils/logger.ts"),G=P("./src/demux/mpegaudio.ts");function W(m,p){m.prototype=Object.create(p.prototype),m.prototype.constructor=m,n(m,p)}function n(m,p){return n=Object.setPrototypeOf||function(c,o){return c.__proto__=o,c},n(m,p)}var D=function(m){W(p,m);function p(){return m.apply(this,arguments)||this}var h=p.prototype;return h.resetInitSegment=function(o,d,i){m.prototype.resetInitSegment.call(this,o,d,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var d=j.getID3Data(o,0)||[],i=d.length,a=o.length;i<a;i++)if(G.probe(o,i))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(o,d){return G.canParse(o,d)},h.appendFrame=function(o,d,i){return this.initPTS===null?void 0:G.appendFrame(o,d,i,this.initPTS,this.frameIndex)},p}(V.default);D.minProbeByteLength=4,X.default=D},"./src/demux/mp4demuxer.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/mp4-tools.ts"),j=P("./src/demux/dummy-demuxed-track.ts"),M=function(){function G(n,D){this.remainderData=null,this.config=void 0,this.config=D}var W=G.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},G.probe=function(D){return Object(V.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},W.demux=function(D){var m=D,p=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(m=Object(V.appendUint8Array)(this.remainderData,D));var h=Object(V.segmentValidRange)(m);this.remainderData=h.remainder,p.samples=h.valid||new Uint8Array}else p.samples=m;return{audioTrack:Object(j.dummyTrack)(),avcTrack:p,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},W.flush=function(){var D=Object(j.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:D,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},W.demuxSampleAes=function(D,m,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},G}();M.minProbeByteLength=1024,X.default=M},"./src/demux/mpegaudio.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"appendFrame",function(){return n}),P.d(X,"parseHeader",function(){return D}),P.d(X,"isHeaderPattern",function(){return m}),P.d(X,"isHeader",function(){return p}),P.d(X,"canParse",function(){return h}),P.d(X,"probe",function(){return c});var V=null,j=[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],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function n(o,d,i,a,r){if(i+24>d.length)return;var s=D(d,i);if(s&&i+s.frameLength<=d.length){var S=s.samplesPerFrame*9e4/s.sampleRate,w=a+r*S,x={unit:d.subarray(i,i+s.frameLength),pts:w,dts:w};return o.config=[],o.channelCount=s.channelCount,o.samplerate=s.sampleRate,o.samples.push(x),{sample:x,length:s.frameLength,missing:0}}}function D(o,d){var i=o[d+1]>>3&3,a=o[d+1]>>1&3,r=o[d+2]>>4&15,s=o[d+2]>>2&3;if(i!==1&&r!==0&&r!==15&&s!==3){var S=o[d+2]>>1&1,w=o[d+3]>>6,x=i===3?3-a:a===3?3:4,L=j[x*14+r-1]*1e3,O=i===3?0:i===2?1:2,_=M[O*3+s],b=w===3?1:2,g=G[i][a],f=W[a],C=g*8*f,E=Math.floor(g*L/_+S)*f;if(V===null){var v=navigator.userAgent||"",N=v.match(/Chrome\/(\d+)/i);V=N?parseInt(N[1]):0}var U=!!V&&V<=87;return U&&a===2&&L>=224e3&&w===0&&(o[d+3]=o[d+3]|128),{sampleRate:_,channelCount:b,frameLength:E,samplesPerFrame:C}}}function m(o,d){return o[d]===255&&(o[d+1]&224)===224&&(o[d+1]&6)!==0}function p(o,d){return d+1<o.length&&m(o,d)}function h(o,d){var i=4;return m(o,d)&&i<=o.length-d}function c(o,d){if(d+1<o.length&&m(o,d)){var i=4,a=D(o,d),r=i;a!=null&&a.frameLength&&(r=a.frameLength);var s=d+r;return s===o.length||p(o,s)}return!1}},"./src/demux/sample-aes.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/crypt/decrypter.ts"),j=P("./src/demux/tsdemuxer.ts"),M=function(){function G(n,D,m){this.keyData=void 0,this.decrypter=void 0,this.keyData=m,this.decrypter=new V.default(n,D,{removePKCS7Padding:!1})}var W=G.prototype;return W.decryptBuffer=function(D,m){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,m)},W.decryptAacSample=function(D,m,p,h){var c=D[m].unit,o=c.subarray(16,c.length-c.length%16),d=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),i=this;this.decryptBuffer(d,function(a){var r=new Uint8Array(a);c.set(r,16),h||i.decryptAacSamples(D,m+1,p)})},W.decryptAacSamples=function(D,m,p){for(;;m++){if(m>=D.length){p();return}if(D[m].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(D,m,p,h),!h)return}},W.getAvcEncryptedData=function(D){for(var m=Math.floor((D.length-48)/160)*16+16,p=new Int8Array(m),h=0,c=32;c<=D.length-16;c+=160,h+=16)p.set(D.subarray(c,c+16),h);return p},W.getAvcDecryptedUnit=function(D,m){for(var p=new Uint8Array(m),h=0,c=32;c<=D.length-16;c+=160,h+=16)D.set(p.subarray(h,h+16),c);return D},W.decryptAvcSample=function(D,m,p,h,c,o){var d=Object(j.discardEPB)(c.data),i=this.getAvcEncryptedData(d),a=this;this.decryptBuffer(i.buffer,function(r){c.data=a.getAvcDecryptedUnit(d,r),o||a.decryptAvcSamples(D,m,p+1,h)})},W.decryptAvcSamples=function(D,m,p,h){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;m++,p=0){if(m>=D.length){h();return}for(var c=D[m].units;!(p>=c.length);p++){var o=c[p];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(D,m,p,h,o,d),!d)return}}},G}();X.default=M},"./src/demux/transmuxer-interface.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c});var V=P("./node_modules/webworkify-webpack/index.js"),j=P.n(V),M=P("./src/events.ts"),G=P("./src/demux/transmuxer.ts"),W=P("./src/utils/logger.ts"),n=P("./src/errors.ts"),D=P("./src/utils/mediasource-helper.ts"),m=P("./node_modules/eventemitter3/index.js"),p=P.n(m),h=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function o(i,a,r,s){var S=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=i,this.id=a,this.onTransmuxComplete=r,this.onFlush=s;var w=i.config,x=function(g,f){f=f||{},f.frag=S.frag,f.id=S.id,i.trigger(g,f)};this.observer=new m.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,x),this.observer.on(M.Events.ERROR,x);var L={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var _;try{_=this.worker=V("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(b){i.trigger(M.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},_.postMessage({cmd:"init",typeSupported:L,vendor:O,id:a,config:JSON.stringify(w)})}catch(b){W.logger.warn("Error in worker:",b),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new G.default(this.observer,L,w,O,a),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,w,O,a)}var d=o.prototype;return d.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var r=this.transmuxer;r&&(r.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},d.push=function(a,r,s,S,w,x,L,O,_,b){var g=this;_.transmuxing.start=self.performance.now();var f=this.transmuxer,C=this.worker,E=x?x.start:w.start,v=w.decryptdata,N=this.frag,U=!(N&&w.cc===N.cc),A=!(N&&_.level===N.level),H=N?_.sn-N.sn:-1,F=this.part?_.part-this.part.index:1,T=!A&&(H===1||H===0&&F===1),z=self.performance.now();(A||H||w.stats.parsing.start===0)&&(w.stats.parsing.start=z),x&&(F||!T)&&(x.stats.parsing.start=z);var Q=new G.TransmuxState(U,T,O,A,E);if(!T||U){W.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
discontinuity: `+U+`
trackSwitch: `+A+`
contiguous: `+T+`
accurateTimeOffset: `+O+`
timeOffset: `+E);var ne=new G.TransmuxConfig(s,S,r,L,b);this.configureTransmuxer(ne)}if(this.frag=w,this.part=x,C)C.postMessage({cmd:"demux",data:a,decryptdata:v,chunkMeta:_,state:Q},a instanceof ArrayBuffer?[a]:[]);else if(f){var se=f.push(a,v,_,Q);Object(G.isPromise)(se)?se.then(function(xe){g.handleTransmuxComplete(xe)}):this.handleTransmuxComplete(se)}},d.flush=function(a){var r=this;a.transmuxing.start=self.performance.now();var s=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:a});else if(s){var w=s.flush(a);Object(G.isPromise)(w)?w.then(function(x){r.handleFlushResult(x,a)}):this.handleFlushResult(w,a)}},d.handleFlushResult=function(a,r){var s=this;a.forEach(function(S){s.handleTransmuxComplete(S)}),this.onFlush(r)},d.onWorkerMessage=function(a){var r=a.data,s=this.hls;switch(r.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(r.data);break}case"flush":{this.onFlush(r.data);break}default:{r.data=r.data||{},r.data.frag=this.frag,r.data.id=this.id,s.trigger(r.event,r.data);break}}},d.configureTransmuxer=function(a){var r=this.worker,s=this.transmuxer;r?r.postMessage({cmd:"configure",config:a}):s&&s.configure(a)},d.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},o}()},"./src/demux/transmuxer-worker.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return n});var V=P("./src/demux/transmuxer.ts"),j=P("./src/events.ts"),M=P("./src/utils/logger.ts"),G=P("./node_modules/eventemitter3/index.js"),W=P.n(G);function n(c){var o=new G.EventEmitter,d=function(a,r){c.postMessage({event:a,data:r})};o.on(j.Events.FRAG_DECRYPTED,d),o.on(j.Events.ERROR,d),c.addEventListener("message",function(i){var a=i.data;switch(a.cmd){case"init":{var r=JSON.parse(a.config);c.transmuxer=new V.default(o,a.typeSupported,r,a.vendor,a.id),Object(M.enableLogs)(r.debug),d("init",null);break}case"configure":{c.transmuxer.configure(a.config);break}case"demux":{var s=c.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(V.isPromise)(s)?s.then(function(x){D(c,x)}):D(c,s);break}case"flush":{var S=a.chunkMeta,w=c.transmuxer.flush(S);Object(V.isPromise)(w)?w.then(function(x){p(c,x,S)}):p(c,w,S);break}default:break}})}function D(c,o){if(h(o.remuxResult))return;var d=[],i=o.remuxResult,a=i.audio,r=i.video;a&&m(d,a),r&&m(d,r),c.postMessage({event:"transmuxComplete",data:o},d)}function m(c,o){o.data1&&c.push(o.data1.buffer),o.data2&&c.push(o.data2.buffer)}function p(c,o,d){o.forEach(function(i){D(c,i)}),c.postMessage({event:"flush",data:d})}function h(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return r}),P.d(X,"isPromise",function(){return w}),P.d(X,"TransmuxConfig",function(){return x}),P.d(X,"TransmuxState",function(){return L});var V=P("./src/events.ts"),j=P("./src/errors.ts"),M=P("./src/crypt/decrypter.ts"),G=P("./src/demux/aacdemuxer.ts"),W=P("./src/demux/mp4demuxer.ts"),n=P("./src/demux/tsdemuxer.ts"),D=P("./src/demux/mp3demuxer.ts"),m=P("./src/remux/mp4-remuxer.ts"),p=P("./src/remux/passthrough-remuxer.ts"),h=P("./src/demux/chunk-cache.ts"),c=P("./src/utils/mp4-tools.ts"),o=P("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(O){o.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var i=[{demux:n.default,remux:m.default},{demux:W.default,remux:p.default},{demux:G.default,remux:m.default},{demux:D.default,remux:m.default}],a=1024;i.forEach(function(O){var _=O.demux;a=Math.max(a,_.minProbeByteLength)});var r=function(){function O(b,g,f,C,E){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 h.default,this.observer=b,this.typeSupported=g,this.config=f,this.vendor=C,this.id=E}var _=O.prototype;return _.configure=function(g){this.transmuxConfig=g,this.decrypter&&this.decrypter.reset()},_.push=function(g,f,C,E){var v=this,N=C.transmuxing;N.executeStart=d();var U=new Uint8Array(g),A=this.cache,H=this.config,F=this.currentTransmuxState,T=this.transmuxConfig;E&&(this.currentTransmuxState=E);var z=s(U,f);if(z&&z.method==="AES-128"){var Q=this.getDecrypter();if(H.enableSoftwareAES){var ne=Q.softwareDecrypt(U,z.key.buffer,z.iv.buffer);if(!ne)return N.executeEnd=d(),S(C);U=new Uint8Array(ne)}else return this.decryptionPromise=Q.webCryptoDecrypt(U,z.key.buffer,z.iv.buffer).then(function(Qe){var at=v.push(Qe,null,C);return v.decryptionPromise=null,at}),this.decryptionPromise}var se=E||F,xe=se.contiguous,me=se.discontinuity,ve=se.trackSwitch,Oe=se.accurateTimeOffset,Re=se.timeOffset,fe=T.audioCodec,ue=T.videoCodec,Pe=T.defaultInitPts,et=T.duration,rt=T.initSegmentData;if((me||ve)&&this.resetInitSegment(rt,fe,ue,et),me&&this.resetInitialTimestamp(Pe),xe||this.resetContiguity(),this.needsProbing(U,me,ve)){if(A.dataLength){var tt=A.flush();U=Object(c.appendUint8Array)(tt,U)}this.configureTransmuxer(U,T)}var it=this.transmux(U,z,Re,Oe,C),ze=this.currentTransmuxState;return ze.contiguous=!0,ze.discontinuity=!1,ze.trackSwitch=!1,N.executeEnd=d(),it},_.flush=function(g){var f=this,C=g.transmuxing;C.executeStart=d();var E=this.decrypter,v=this.cache,N=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return f.flush(g)});var A=[],H=N.timeOffset;if(E){var F=E.flush();F&&A.push(this.push(F,null,g))}var T=v.dataLength;v.reset();var z=this.demuxer,Q=this.remuxer;if(!z||!Q)return T>=a&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=d(),[S(g)];var ne=z.flush(H);return w(ne)?ne.then(function(se){return f.flushRemux(A,se,g),A}):(this.flushRemux(A,ne,g),A)},_.flushRemux=function(g,f,C){var E=f.audioTrack,v=f.avcTrack,N=f.id3Track,U=f.textTrack,A=this.currentTransmuxState,H=A.accurateTimeOffset,F=A.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var T=this.remuxer.remux(E,v,N,U,F,H,!0,this.id);g.push({remuxResult:T,chunkMeta:C}),C.transmuxing.executeEnd=d()},_.resetInitialTimestamp=function(g){var f=this.demuxer,C=this.remuxer;if(!f||!C)return;f.resetTimeStamp(g),C.resetTimeStamp(g)},_.resetContiguity=function(){var g=this.demuxer,f=this.remuxer;if(!g||!f)return;g.resetContiguity(),f.resetNextTimestamp()},_.resetInitSegment=function(g,f,C,E){var v=this.demuxer,N=this.remuxer;if(!v||!N)return;v.resetInitSegment(f,C,E),N.resetInitSegment(g,f,C)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(g,f,C,E,v){var N;return f&&f.method==="SAMPLE-AES"?N=this.transmuxSampleAes(g,f,C,E,v):N=this.transmuxUnencrypted(g,C,E,v),N},_.transmuxUnencrypted=function(g,f,C,E){var v=this.demuxer.demux(g,f,!1,!this.config.progressive),N=v.audioTrack,U=v.avcTrack,A=v.id3Track,H=v.textTrack,F=this.remuxer.remux(N,U,A,H,f,C,!1,this.id);return{remuxResult:F,chunkMeta:E}},_.transmuxSampleAes=function(g,f,C,E,v){var N=this;return this.demuxer.demuxSampleAes(g,f,C).then(function(U){var A=N.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,C,E,!1,N.id);return{remuxResult:A,chunkMeta:v}})},_.configureTransmuxer=function(g,f){for(var C=this.config,E=this.observer,v=this.typeSupported,N=this.vendor,U=f.audioCodec,A=f.defaultInitPts,H=f.duration,F=f.initSegmentData,T=f.videoCodec,z,Q=0,ne=i.length;Q<ne;Q++)if(i[Q].demux.probe(g)){z=i[Q];break}z||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:W.default,remux:p.default});var se=this.demuxer,xe=this.remuxer,me=z.remux,ve=z.demux;(!xe||!(xe instanceof me))&&(this.remuxer=new me(E,C,v,N)),(!se||!(se instanceof ve))&&(this.demuxer=new ve(E,C,v),this.probe=ve.probe),this.resetInitSegment(F,U,T,H),this.resetInitialTimestamp(A)},_.needsProbing=function(g,f,C){return!this.demuxer||!this.remuxer||f||C},_.getDecrypter=function(){var g=this.decrypter;return g||(g=this.decrypter=new M.default(this.observer,this.config)),g},O}();function s(O,_){var b=null;return O.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(b=_),b}var S=function(_){return{remuxResult:{},chunkMeta:_}};function w(O){return"then"in O&&O.then instanceof Function}var x=function(_,b,g,f,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=b,this.initSegmentData=g,this.duration=f,this.defaultInitPts=C},L=function(_,b,g,f,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=b,this.accurateTimeOffset=g,this.trackSwitch=f,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"discardEPB",function(){return S});var V=P("./src/demux/adts.ts"),j=P("./src/demux/mpegaudio.ts"),M=P("./src/demux/exp-golomb.ts"),G=P("./src/demux/id3.ts"),W=P("./src/demux/sample-aes.ts"),n=P("./src/events.ts"),D=P("./src/utils/mp4-tools.ts"),m=P("./src/utils/logger.ts"),p=P("./src/errors.ts"),h={video:1,audio:2,id3:3,text:4},c=function(){function w(L,O,_){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=L,this.config=O,this.typeSupported=_}w.probe=function(O){var _=w.syncOffset(O);return _<0?!1:(_&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},w.syncOffset=function(O){for(var _=Math.min(1e3,O.length-3*188),b=0;b<_;){if(O[b]===71&&O[b+188]===71&&O[b+2*188]===71)return b;b++}return-1},w.createTrack=function(O,_){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:h[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?_:void 0}};var x=w.prototype;return x.resetInitSegment=function(O,_,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=w.createTrack("video",b),this._audioTrack=w.createTrack("audio",b),this._id3Track=w.createTrack("id3",b),this._txtTrack=w.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=_,this._duration=b},x.resetTimeStamp=function(){},x.resetContiguity=function(){var O=this._audioTrack,_=this._avcTrack,b=this._id3Track;O&&(O.pesData=null),_&&(_.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(O,_,b,g){b===void 0&&(b=!1),g===void 0&&(g=!1),b||(this.sampleAes=null);var f,C=this._avcTrack,E=this._audioTrack,v=this._id3Track,N=C.pid,U=C.pesData,A=E.pid,H=v.pid,F=E.pesData,T=v.pesData,z=!1,Q=this.pmtParsed,ne=this._pmtId,se=O.length;if(this.remainderData&&(O=Object(D.appendUint8Array)(this.remainderData,O),se=O.length,this.remainderData=null),se<188&&!g)return this.remainderData=O,{audioTrack:E,avcTrack:C,id3Track:v,textTrack:this._txtTrack};var xe=Math.max(0,w.syncOffset(O));se-=(se+xe)%188,se<O.byteLength&&!g&&(this.remainderData=new Uint8Array(O.buffer,se,O.buffer.byteLength-se));for(var me=xe;me<se;me+=188)if(O[me]===71){var ve=!!(O[me+1]&64),Oe=((O[me+1]&31)<<8)+O[me+2],Re=(O[me+3]&48)>>4,fe=void 0;if(Re>1){if(fe=me+5+O[me+4],fe===me+188)continue}else fe=me+4;switch(Oe){case N:ve&&(U&&(f=a(U))&&this.parseAVCPES(f,!1),U={data:[],size:0}),U&&(U.data.push(O.subarray(fe,me+188)),U.size+=me+188-fe);break;case A:ve&&(F&&(f=a(F))&&(E.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),F={data:[],size:0}),F&&(F.data.push(O.subarray(fe,me+188)),F.size+=me+188-fe);break;case H:ve&&(T&&(f=a(T))&&this.parseID3PES(f),T={data:[],size:0}),T&&(T.data.push(O.subarray(fe,me+188)),T.size+=me+188-fe);break;case 0:ve&&(fe+=O[fe]+1),ne=this._pmtId=d(O,fe);break;case ne:{ve&&(fe+=O[fe]+1);var ue=i(O,fe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);N=ue.avc,N>0&&(C.pid=N),A=ue.audio,A>0&&(E.pid=A,E.isAAC=ue.isAAC),H=ue.id3,H>0&&(v.pid=H),z&&!Q&&(m.logger.log("reparse from beginning"),z=!1,me=xe-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=U,E.pesData=F,v.pesData=T;var Pe={audioTrack:E,avcTrack:C,id3Track:v,textTrack:this._txtTrack};return g&&this.extractRemainingSamples(Pe),Pe},x.flush=function(){var O=this.remainderData;this.remainderData=null;var _;return O?_=this.demux(O,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},x.extractRemainingSamples=function(O){var _=O.audioTrack,b=O.avcTrack,g=O.id3Track,f=b.pesData,C=_.pesData,E=g.pesData,v;f&&(v=a(f))?(this.parseAVCPES(v,!0),b.pesData=null):b.pesData=f,C&&(v=a(C))?(_.isAAC?this.parseAACPES(v):this.parseMPEGPES(v),_.pesData=null):(C!=null&&C.size&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=C),E&&(v=a(E))?(this.parseID3PES(v),g.pesData=null):g.pesData=E},x.demuxSampleAes=function(O,_,b){var g=this.demux(O,b,!0,!this.config.progressive),f=this.sampleAes=new W.default(this.observer,this.config,_);return this.decrypt(g,f)},x.decrypt=function(O,_){return new Promise(function(b){var g=O.audioTrack,f=O.avcTrack;g.samples&&g.isAAC?_.decryptAacSamples(g.samples,0,function(){f.samples?_.decryptAvcSamples(f.samples,0,0,function(){b(O)}):b(O)}):f.samples&&_.decryptAvcSamples(f.samples,0,0,function(){b(O)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(O,_){var b=this,g=this._avcTrack,f=this.parseAVCNALu(O.data),C=!1,E=this.avcSample,v,N=!1;O.data=null,E&&f.length&&!g.audFound&&(r(E,g),E=this.avcSample=o(!1,O.pts,O.dts,"")),f.forEach(function(U){switch(U.type){case 1:{v=!0,E||(E=b.avcSample=o(!0,O.pts,O.dts,"")),C&&(E.debug+="NDR "),E.frame=!0;var A=U.data;if(N&&A.length>4){var H=new M.default(A).readSliceType();(H===2||H===4||H===7||H===9)&&(E.key=!0)}break}case 5:v=!0,E||(E=b.avcSample=o(!0,O.pts,O.dts,"")),C&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{v=!0,C&&E&&(E.debug+="SEI ");var F=new M.default(S(U.data));F.readUByte();for(var T=0,z=0,Q=!1,ne=0;!Q&&F.bytesAvailable>1;){T=0;do ne=F.readUByte(),T+=ne;while(ne===255);z=0;do ne=F.readUByte(),z+=ne;while(ne===255);if(T===4&&F.bytesAvailable!==0){Q=!0;var se=F.readUByte();if(se===181){var xe=F.readUShort();if(xe===49){var me=F.readUInt();if(me===1195456820){var ve=F.readUByte();if(ve===3){for(var Oe=F.readUByte(),Re=F.readUByte(),fe=31&Oe,ue=[Oe,Re],Pe=0;Pe<fe;Pe++)ue.push(F.readUByte()),ue.push(F.readUByte()),ue.push(F.readUByte());s(b._txtTrack.samples,{type:3,pts:O.pts,bytes:ue})}}}}}else if(T===5&&F.bytesAvailable!==0){if(Q=!0,z>16){for(var et=[],rt=0;rt<16;rt++)et.push(F.readUByte().toString(16)),(rt===3||rt===5||rt===7||rt===9)&&et.push("-");for(var tt=z-16,it=new Uint8Array(tt),ze=0;ze<tt;ze++)it[ze]=F.readUByte();s(b._txtTrack.samples,{pts:O.pts,payloadType:T,uuid:et.join(""),userData:Object(G.utf8ArrayToStr)(it),userDataBytes:it})}}else if(z<F.bytesAvailable)for(var Qe=0;Qe<z;Qe++)F.readUByte()}break}case 7:if(v=!0,N=!0,C&&E&&(E.debug+="SPS "),!g.sps){var at=new M.default(U.data),he=at.readSPS();g.width=he.width,g.height=he.height,g.pixelRatio=he.pixelRatio,g.sps=[U.data],g.duration=b._duration;for(var Se=U.data.subarray(1,4),Le="avc1.",Me=0;Me<3;Me++){var qe=Se[Me].toString(16);qe.length<2&&(qe="0"+qe),Le+=qe}g.codec=Le}break;case 8:v=!0,C&&E&&(E.debug+="PPS "),g.pps||(g.pps=[U.data]);break;case 9:v=!1,g.audFound=!0,E&&r(E,g),E=b.avcSample=o(!1,O.pts,O.dts,C?"AUD ":"");break;case 12:v=!1;break;default:v=!1,E&&(E.debug+="unknown NAL "+U.type+" ");break}if(E&&v){var st=E.units;st.push(U)}}),_&&E&&(r(E,g),this.avcSample=null)},x.getLastNalUnit=function(){var O,_=this.avcSample,b;if(!_||_.units.length===0){var g=this._avcTrack.samples;_=g[g.length-1]}if((O=_)!==null&&O!==void 0&&O.units){var f=_.units;b=f[f.length-1]}return b},x.parseAVCNALu=function(O){var _=O.byteLength,b=this._avcTrack,g=b.naluState||0,f=g,C=[],E=0,v,N,U,A=-1,H=0;for(g===-1&&(A=0,H=O[0]&31,g=0,E=1);E<_;){if(v=O[E++],!g){g=v?0:1;continue}if(g===1){g=v?0:2;continue}if(!v)g=3;else if(v===1){if(A>=0){var F={data:O.subarray(A,E-g-1),type:H};C.push(F)}else{var T=this.getLastNalUnit();if(T&&(f&&E<=4-f&&(T.state&&(T.data=T.data.subarray(0,T.data.byteLength-f))),N=E-g-1,N>0)){var z=new Uint8Array(T.data.byteLength+N);z.set(T.data,0),z.set(O.subarray(0,N),T.data.byteLength),T.data=z,T.state=0}}E<_?(U=O[E]&31,A=E,H=U,g=0):g=-1}else g=0}if(A>=0&&g>=0){var Q={data:O.subarray(A,_),type:H,state:g};C.push(Q)}if(C.length===0){var ne=this.getLastNalUnit();if(ne){var se=new Uint8Array(ne.data.byteLength+O.byteLength);se.set(ne.data,0),se.set(O,ne.data.byteLength),ne.data=se}}return b.naluState=g,C},x.parseAACPES=function(O){var _=0,b=this._audioTrack,g=this.aacOverFlow,f=O.data;if(g){this.aacOverFlow=null;var C=g.sample.unit.byteLength,E=Math.min(g.missing,C),v=C-E;g.sample.unit.set(f.subarray(0,E),v),b.samples.push(g.sample),_=g.missing}var N,U;for(N=_,U=f.length;N<U-1&&!V.isHeader(f,N);N++);if(N!==_){var A,H;if(N<U-1?(A="AAC PES did not start with ADTS header,offset:"+N,H=!1):(A="no ADTS header found in AAC PES",H=!0),m.logger.warn("parsing error:"+A),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:A}),H)return}V.initTrackConfig(b,this.observer,f,N,this.audioCodec);var F;if(O.pts!==void 0)F=O.pts;else if(g){var T=V.getFrameDuration(b.samplerate);F=g.sample.pts+T}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;N<U;)if(V.isHeader(f,N)){if(N+5<U){var Q=V.appendFrame(b,f,N,F,z);if(Q)if(Q.missing)this.aacOverFlow=Q;else{N+=Q.length,z++;continue}}break}else N++},x.parseMPEGPES=function(O){var _=O.data,b=_.length,g=0,f=0,C=O.pts;if(C===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<b;)if(j.isHeader(_,f)){var E=j.appendFrame(this._audioTrack,_,f,C,g);if(E)f+=E.length,g++;else break}else f++},x.parseID3PES=function(O){if(O.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},w}();c.minProbeByteLength=188;function o(w,x,L,O){return{key:w,frame:!1,pts:x,dts:L,units:[],debug:O,length:0}}function d(w,x){return(w[x+10]&31)<<8|w[x+11]}function i(w,x,L,O){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(w[x+1]&15)<<8|w[x+2],g=x+3+b-4,f=(w[x+10]&15)<<8|w[x+11];for(x+=12+f;x<g;){var C=(w[x+1]&31)<<8|w[x+2];switch(w[x]){case 207:if(!O){m.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=C);break;case 21:_.id3===-1&&(_.id3=C);break;case 219:if(!O){m.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=C);break;case 3:case 4:L?_.audio===-1&&(_.audio=C,_.isAAC=!1):m.logger.log("MPEG audio found, not supported in this browser");break;case 36:m.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((w[x+3]&15)<<8|w[x+4])+5}return _}function a(w){var x=0,L,O,_,b,g,f=w.data;if(!w||w.size===0)return null;for(;f[0].length<19&&f.length>1;){var C=new Uint8Array(f[0].length+f[1].length);C.set(f[0]),C.set(f[1],f[0].length),f[0]=C,f.splice(1,1)}L=f[0];var E=(L[0]<<16)+(L[1]<<8)+L[2];if(E===1){if(O=(L[4]<<8)+L[5],O&&O>w.size-6)return null;var v=L[7];v&192&&(b=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,v&64?(g=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,b-g>60*9e4&&(m.logger.warn(Math.round((b-g)/9e4)+"s delta between PTS and DTS, align them"),b=g)):g=b),_=L[8];var N=_+9;if(w.size<=N)return null;w.size-=N;for(var U=new Uint8Array(w.size),A=0,H=f.length;A<H;A++){L=f[A];var F=L.byteLength;if(N)if(N>F){N-=F;continue}else L=L.subarray(N),F-=N,N=0;U.set(L,x),x+=F}return O&&(O-=_+3),{data:U,pts:b,dts:g,len:O}}return null}function r(w,x){if(w.units.length&&w.frame){if(w.pts===void 0){var L=x.samples,O=L.length;if(O){var _=L[O-1];w.pts=_.pts,w.dts=_.dts}else{x.dropped++;return}}x.samples.push(w)}w.debug.length&&m.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function s(w,x){var L=w.length;if(L>0){if(x.pts>=w[L-1].pts)w.push(x);else for(var O=L-1;O>=0;O--)if(x.pts<w[O].pts){w.splice(O,0,x);break}}else w.push(x)}function S(w){for(var x=w.byteLength,L=[],O=1;O<x-2;)w[O]===0&&w[O+1]===0&&w[O+2]===3?(L.push(O+2),O+=2):O++;if(L.length===0)return w;var _=x-L.length,b=new Uint8Array(_),g=0;for(O=0;O<_;g++,O++)g===L[0]&&(g++,L.shift()),b[O]=w[g];return b}X.default=c},"./src/errors.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"ErrorTypes",function(){return V}),P.d(X,"ErrorDetails",function(){return j});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 j;(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"})(j||(j={}))},"./src/events.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"Events",function(){return V});var V;(function(j){j.MEDIA_ATTACHING="hlsMediaAttaching",j.MEDIA_ATTACHED="hlsMediaAttached",j.MEDIA_DETACHING="hlsMediaDetaching",j.MEDIA_DETACHED="hlsMediaDetached",j.BUFFER_RESET="hlsBufferReset",j.BUFFER_CODECS="hlsBufferCodecs",j.BUFFER_CREATED="hlsBufferCreated",j.BUFFER_APPENDING="hlsBufferAppending",j.BUFFER_APPENDED="hlsBufferAppended",j.BUFFER_EOS="hlsBufferEos",j.BUFFER_FLUSHING="hlsBufferFlushing",j.BUFFER_FLUSHED="hlsBufferFlushed",j.MANIFEST_LOADING="hlsManifestLoading",j.MANIFEST_LOADED="hlsManifestLoaded",j.MANIFEST_PARSED="hlsManifestParsed",j.LEVEL_SWITCHING="hlsLevelSwitching",j.LEVEL_SWITCHED="hlsLevelSwitched",j.LEVEL_LOADING="hlsLevelLoading",j.LEVEL_LOADED="hlsLevelLoaded",j.LEVEL_UPDATED="hlsLevelUpdated",j.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",j.LEVELS_UPDATED="hlsLevelsUpdated",j.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",j.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",j.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",j.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",j.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",j.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",j.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",j.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",j.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",j.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",j.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",j.CUES_PARSED="hlsCuesParsed",j.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",j.INIT_PTS_FOUND="hlsInitPtsFound",j.FRAG_LOADING="hlsFragLoading",j.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",j.FRAG_LOADED="hlsFragLoaded",j.FRAG_DECRYPTED="hlsFragDecrypted",j.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",j.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",j.FRAG_PARSING_METADATA="hlsFragParsingMetadata",j.FRAG_PARSED="hlsFragParsed",j.FRAG_BUFFERED="hlsFragBuffered",j.FRAG_CHANGED="hlsFragChanged",j.FPS_DROP="hlsFpsDrop",j.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",j.ERROR="hlsError",j.DESTROYING="hlsDestroying",j.KEY_LOADING="hlsKeyLoading",j.KEY_LOADED="hlsKeyLoaded",j.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",j.BACK_BUFFER_REACHED="hlsBackBufferReached"})(V||(V={}))},"./src/hls.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return w});var V=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(V),M=P("./src/loader/playlist-loader.ts"),G=P("./src/loader/key-loader.ts"),W=P("./src/controller/id3-track-controller.ts"),n=P("./src/controller/latency-controller.ts"),D=P("./src/controller/level-controller.ts"),m=P("./src/controller/fragment-tracker.ts"),p=P("./src/controller/stream-controller.ts"),h=P("./src/is-supported.ts"),c=P("./src/utils/logger.ts"),o=P("./src/config.ts"),d=P("./node_modules/eventemitter3/index.js"),i=P.n(d),a=P("./src/events.ts"),r=P("./src/errors.ts");function s(x,L){for(var O=0;O<L.length;O++){var _=L[O];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function S(x,L,O){return L&&s(x.prototype,L),O&&s(x,O),x}var w=function(){x.isSupported=function(){return Object(h.isSupported)()};function x(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.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 _=this.config=Object(o.mergeConfig)(x.DefaultConfig,O);this.userConfig=O,Object(c.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(o.enableStreamingMode)(_);var b=_.abrController,g=_.bufferController,f=_.capLevelController,C=_.fpsController,E=this.abrController=new b(this),v=this.bufferController=new g(this),N=this.capLevelController=new f(this),U=new C(this),A=new M.default(this),H=new G.default(this),F=new W.default(this),T=this.levelController=new D.default(this),z=new m.FragmentTracker(this),Q=this.streamController=new p.default(this,z);N.setStreamController(Q),U.setStreamController(Q);var ne=[T,Q];this.networkControllers=ne;var se=[A,H,E,v,N,U,F,z];this.audioTrackController=this.createController(_.audioTrackController,null,ne),this.createController(_.audioStreamController,z,ne),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,ne),this.createController(_.subtitleStreamController,z,ne),this.createController(_.timelineController,null,se),this.emeController=this.createController(_.emeController,null,se),this.cmcdController=this.createController(_.cmcdController,null,se),this.latencyController=this.createController(n.default,null,se),this.coreComponents=se}var L=x.prototype;return L.createController=function(_,b,g){if(_){var f=b?new _(this,b):new _(this);return g&&g.push(f),f}return null},L.on=function(_,b,g){g===void 0&&(g=this),this._emitter.on(_,b,g)},L.once=function(_,b,g){g===void 0&&(g=this),this._emitter.once(_,b,g)},L.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},L.off=function(_,b,g,f){g===void 0&&(g=this),this._emitter.off(_,b,g,f)},L.listeners=function(_){return this._emitter.listeners(_)},L.emit=function(_,b,g){return this._emitter.emit(_,b,g)},L.trigger=function(_,b){if(this.config.debug)return this.emit(_,_,b);try{return this.emit(_,_,b)}catch(g){c.logger.error("An internal error happened while handling event "+_+'. Error message: "'+g.message+'". Here is a stacktrace:',g),this.trigger(a.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:g})}return!1},L.listenerCount=function(_){return this._emitter.listenerCount(_)},L.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(_){return _.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(_){return _.destroy()}),this.coreComponents.length=0},L.attachMedia=function(_){c.logger.log("attachMedia"),this._media=_,this.trigger(a.Events.MEDIA_ATTACHING,{media:_})},L.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(_){this.stopLoad();var b=this.media,g=this.url,f=this.url=V.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});c.logger.log("loadSource:"+f),b&&g&&g!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(a.Events.MANIFEST_LOADING,{url:_})},L.startLoad=function(_){_===void 0&&(_=-1),c.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(b){b.startLoad(_)})},L.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},L.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){c.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},L.removeLevel=function(_,b){b===void 0&&(b=0),this.levelController.removeLevel(_,b)},S(x,[{key:"levels",get:function(){var _=this.levelController.levels;return _||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(_){c.logger.log("set currentLevel:"+_),this.loadLevel=_,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(_){c.logger.log("set nextLevel:"+_),this.levelController.manualLevel=_,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(_){c.logger.log("set loadLevel:"+_),this.levelController.manualLevel=_}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(_){this.levelController.nextLoadLevel=_}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(_){c.logger.log("set firstLevel:"+_),this.levelController.firstLevel=_}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(_){c.logger.log("set startLevel:"+_),_!==-1&&(_=Math.max(_,this.minAutoLevel)),this.levelController.startLevel=_}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(_){var b=!!_;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(_){this._autoLevelCapping!==_&&(c.logger.log("set autoLevelCapping:"+_),this._autoLevelCapping=_)}},{key:"bandwidthEstimate",get:function(){var _=this.abrController.bwEstimator;return _?_.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var _=this.levels,b=this.config.minAutoBitrate;if(!_)return 0;for(var g=_.length,f=0;f<g;f++)if(_[f].maxBitrate>b)return f;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,b=this.autoLevelCapping,g;return b===-1&&_&&_.length?g=_.length-1:g=b,g}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var b=this.audioTrackController;b&&(b.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var b=this.subtitleTrackController;b&&(b.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{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 r.ErrorTypes}},{key:"ErrorDetails",get:function(){return r.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:o.hlsDefaultConfig},set:function(_){x.defaultConfig=_}}]),x}();w.defaultConfig=void 0},"./src/is-supported.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"isSupported",function(){return M}),P.d(X,"changeTypeSupported",function(){return G});var V=P("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var W=Object(V.getMediaSource)();if(!W)return!1;var n=j(),D=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),m=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!D&&!!m}function G(){var W,n=j();return typeof(n==null||((W=n.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c}),P.d(X,"LoadError",function(){return d});var V=P("./src/polyfills/number.ts"),j=P("./src/errors.ts");function M(i,a){i.prototype=Object.create(a.prototype),i.prototype.constructor=i,m(i,a)}function G(i){var a=typeof Map=="function"?new Map:void 0;return G=function(s){if(s===null||!D(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(s))return a.get(s);a.set(s,S)}function S(){return W(s,arguments,p(this).constructor)}return S.prototype=Object.create(s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),m(S,s)},G(i)}function W(i,a,r){return n()?W=Reflect.construct:W=function(S,w,x){var L=[null];L.push.apply(L,w);var O=Function.bind.apply(S,L),_=new O;return x&&m(_,x.prototype),_},W.apply(null,arguments)}function n(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function D(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function m(i,a){return m=Object.setPrototypeOf||function(s,S){return s.__proto__=S,s},m(i,a)}function p(i){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},p(i)}var h=Math.pow(2,17),c=function(){function i(r){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=r}var a=i.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(s,S){var w=this,x=s.url;if(!x)return Promise.reject(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var L=this.config,O=L.fLoader,_=L.loader;return new Promise(function(b,g){w.loader&&w.loader.destroy();var f=w.loader=s.loader=O?new O(L):new _(L),C=o(s),E={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:h};s.stats=f.stats,f.load(C,E,{onSuccess:function(N,U,A,H){w.resetLoader(s,f),b({frag:s,part:null,payload:N.data,networkDetails:H})},onError:function(N,U,A){w.resetLoader(s,f),g(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:N,networkDetails:A}))},onAbort:function(N,U,A){w.resetLoader(s,f),g(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:A}))},onTimeout:function(N,U,A){w.resetLoader(s,f),g(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:A}))},onProgress:function(N,U,A,H){S&&S({frag:s,part:null,payload:A,networkDetails:H})}})})},a.loadPart=function(s,S,w){var x=this;this.abort();var L=this.config,O=L.fLoader,_=L.loader;return new Promise(function(b,g){x.loader&&x.loader.destroy();var f=x.loader=s.loader=O?new O(L):new _(L),C=o(s,S),E={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:h};S.stats=f.stats,f.load(C,E,{onSuccess:function(N,U,A,H){x.resetLoader(s,f),x.updateStatsFromPart(s,S);var F={frag:s,part:S,payload:N.data,networkDetails:H};w(F),b(F)},onError:function(N,U,A){x.resetLoader(s,f),g(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:S,response:N,networkDetails:A}))},onAbort:function(N,U,A){s.stats.aborted=S.stats.aborted,x.resetLoader(s,f),g(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:S,networkDetails:A}))},onTimeout:function(N,U,A){x.resetLoader(s,f),g(new d({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:S,networkDetails:A}))}})})},a.updateStatsFromPart=function(s,S){var w=s.stats,x=S.stats,L=x.total;if(w.loaded+=x.loaded,L){var O=Math.round(s.duration/S.duration),_=Math.min(Math.round(w.loaded/L),O),b=O-_,g=b*Math.round(w.loaded/_);w.total=w.loaded+g}else w.total=Math.max(w.loaded,w.total);var f=w.loading,C=x.loading;f.start?f.first+=C.first-C.start:(f.start=C.start,f.first=C.first),f.end=C.end},a.resetLoader=function(s,S){s.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},i}();function o(i,a){a===void 0&&(a=null);var r=a||i,s={frag:i,part:a,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},S=r.byteRangeStartOffset,w=r.byteRangeEndOffset;return Object(V.isFiniteNumber)(S)&&Object(V.isFiniteNumber)(w)&&(s.rangeStart=S,s.rangeEnd=w),s}var d=function(i){M(a,i);function a(r){for(var s,S=arguments.length,w=new Array(S>1?S-1:0),x=1;x<S;x++)w[x-1]=arguments[x];return s=i.call.apply(i,[this].concat(w))||this,s.data=void 0,s.data=r,s}return a}(G(Error))},"./src/loader/fragment.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"ElementaryStreamTypes",function(){return c}),P.d(X,"BaseSegment",function(){return o}),P.d(X,"Fragment",function(){return d}),P.d(X,"Part",function(){return i});var V=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),M=P.n(j),G=P("./src/utils/logger.ts"),W=P("./src/loader/level-key.ts"),n=P("./src/loader/load-stats.ts");function D(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,m(a,r)}function m(a,r){return m=Object.setPrototypeOf||function(S,w){return S.__proto__=w,S},m(a,r)}function p(a,r){for(var s=0;s<r.length;s++){var S=r[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,r,s){return r&&p(a.prototype,r),s&&p(a,s),a}var c;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(c||(c={}));var o=function(){function a(s){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[c.AUDIO]=null,S[c.VIDEO]=null,S[c.AUDIOVIDEO]=null,S),this.baseurl=s}var r=a.prototype;return r.setByteRange=function(S,w){var x=S.split("@",2),L=[];x.length===1?L[0]=w?w.byteRangeEndOffset:0:L[0]=parseInt(x[1]),L[1]=parseInt(x[0])+L[0],this._byteRange=L},h(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(j.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),a}(),d=function(a){D(r,a);function r(S,w){var x;return x=a.call(this,w)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new n.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=S,x}var s=r.prototype;return s.createInitializationVector=function(w){for(var x=new Uint8Array(16),L=12;L<16;L++)x[L]=w>>8*(15-L)&255;return x},s.setDecryptDataFromLevelKey=function(w,x){var L=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(L=W.LevelKey.fromURI(w.uri),L.method=w.method,L.iv=this.createInitializationVector(x),L.keyFormat="identity"),L},s.setElementaryStreamInfo=function(w,x,L,O,_,b){b===void 0&&(b=!1);var g=this.elementaryStreams,f=g[w];if(!f){g[w]={startPTS:x,endPTS:L,startDTS:O,endDTS:_,partial:b};return}f.startPTS=Math.min(f.startPTS,x),f.endPTS=Math.max(f.endPTS,L),f.startDTS=Math.min(f.startDTS,O),f.endDTS=Math.max(f.endDTS,_)},s.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[c.AUDIO]=null,w[c.VIDEO]=null,w[c.AUDIOVIDEO]=null},h(r,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var w=this.sn;typeof w!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),w=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,w)}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 w=Object(V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+w*1e3}},{key:"encrypted",get:function(){var w;return!!((w=this.decryptdata)!==null&&w!==void 0&&w.keyFormat&&this.decryptdata.uri)}}]),r}(o),i=function(a){D(r,a);function r(s,S,w,x,L){var O;O=a.call(this,w)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new n.LoadStats,O.duration=s.decimalFloatingPoint("DURATION"),O.gap=s.bool("GAP"),O.independent=s.bool("INDEPENDENT"),O.relurl=s.enumeratedString("URI"),O.fragment=S,O.index=x;var _=s.enumeratedString("BYTERANGE");return _&&O.setByteRange(_,L),L&&(O.fragOffset=L.fragOffset+L.duration),O}return h(r,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),r}(o)},"./src/loader/key-loader.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return G});var V=P("./src/events.ts"),j=P("./src/errors.ts"),M=P("./src/utils/logger.ts"),G=function(){function W(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var n=W.prototype;return n._registerListeners=function(){this.hls.on(V.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(V.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var m in this.loaders){var p=this.loaders[m];p&&p.destroy()}this.loaders={}},n.onKeyLoading=function(m,p){var h=p.frag,c=h.type,o=this.loaders[c];if(!h.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=h.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(o&&(M.logger.warn("abort previous key loader for type:"+c),o.abort()),!d){M.logger.warn("key uri is falsy");return}var a=i.loader,r=h.loader=this.loaders[c]=new a(i);this.decrypturl=d,this.decryptkey=null;var s={url:d,frag:h,responseType:"arraybuffer"},S={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};r.load(s,S,w)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:h}))},n.loadsuccess=function(m,p,h){var c=h.frag;if(!c.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(m.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:c})},n.loaderror=function(m,p){var h=p.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(V.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:h,response:m})},n.loadtimeout=function(m,p){var h=p.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(V.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},W}()},"./src/loader/level-details.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"LevelDetails",function(){return W});var V=P("./src/polyfills/number.ts");function j(n,D){for(var m=0;m<D.length;m++){var p=D[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function M(n,D,m){return D&&j(n.prototype,D),m&&j(n,m),n}var G=10,W=function(){function n(m){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=m}var D=n.prototype;return D.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var h=this.lastPartSn-p.lastPartSn,c=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!c||!!h,this.advanced=this.endSN>p.endSN||h>0||h===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},M(n,[{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||G}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var h=this.driftEnd-this.driftStart;return h*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.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 p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"LevelKey",function(){return W});var V=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(V);function M(n,D){for(var m=0;m<D.length;m++){var p=D[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function G(n,D,m){return D&&M(n.prototype,D),m&&M(n,m),n}var W=function(){n.fromURL=function(m,p){return new n(m,p)},n.fromURI=function(m){return new n(m)};function n(D,m){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,m?this._uri=Object(V.buildAbsoluteURL)(D,m,{alwaysNormalize:!0}):this._uri=D}return G(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(Z,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(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return r});var V=P("./src/polyfills/number.ts"),j=P("./node_modules/url-toolkit/src/url-toolkit.js"),M=P.n(j),G=P("./src/loader/fragment.ts"),W=P("./src/loader/level-details.ts"),n=P("./src/loader/level-key.ts"),D=P("./src/utils/attr-list.ts"),m=P("./src/utils/logger.ts"),p=P("./src/utils/codecs.ts"),h=/#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,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function a(L){var O,_;return i.test((O=(_=j.parseURL(L))===null||_===void 0?void 0:_.path)!=null?O:"")}var r=function(){function L(){}return L.findGroup=function(_,b){for(var g=0;g<_.length;g++){var f=_[g];if(f.id===b)return f}},L.convertAVC1ToAVCOTI=function(_){var b=_.split(".");if(b.length>2){var g=b.shift()+".";return g+=parseInt(b.shift()).toString(16),g+=("000"+parseInt(b.shift()).toString(16)).substr(-4),g}return _},L.resolve=function(_,b){return j.buildAbsoluteURL(b,_,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(_,b){var g=[],f={},C=!1;h.lastIndex=0;for(var E;(E=h.exec(_))!=null;)if(E[1]){var v=new D.AttrList(E[1]),N={attrs:v,bitrate:v.decimalInteger("AVERAGE-BANDWIDTH")||v.decimalInteger("BANDWIDTH"),name:v.NAME,url:L.resolve(E[2],b)},U=v.decimalResolution("RESOLUTION");U&&(N.width=U.width,N.height=U.height),s((v.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=L.convertAVC1ToAVCOTI(N.videoCodec)),g.push(N)}else if(E[3]){var A=new D.AttrList(E[3]);A["DATA-ID"]&&(C=!0,f[A["DATA-ID"]]=A)}return{levels:g,sessionData:C?f:null}},L.parseMasterPlaylistMedia=function(_,b,g,f){f===void 0&&(f=[]);var C,E=[],v=0;for(c.lastIndex=0;(C=c.exec(_))!==null;){var N=new D.AttrList(C[1]);if(N.TYPE===g){var U={attrs:N,bitrate:0,id:v++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:g,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?L.resolve(N.URI,b):""};if(f.length){var A=L.findGroup(f,U.groupId)||f[0];S(U,A,"audioCodec"),S(U,A,"textCodec")}E.push(U)}}return E},L.parseLevelPlaylist=function(_,b,g,f,C){var E=new W.LevelDetails(b),v=E.fragments,N=null,U=0,A=0,H=0,F=0,T=null,z=new G.Fragment(f,b),Q,ne,se,xe=-1,me=!1;for(o.lastIndex=0,E.m3u8=_;(Q=o.exec(_))!==null;){me&&(me=!1,z=new G.Fragment(f,b),z.start=H,z.sn=U,z.cc=F,z.level=g,N&&(z.initSegment=N,z.rawProgramDateTime=N.rawProgramDateTime));var ve=Q[1];if(ve){z.duration=parseFloat(ve);var Oe=(" "+Q[2]).slice(1);z.title=Oe||null,z.tagList.push(Oe?["INF",ve,Oe]:["INF",ve])}else if(Q[3])Object(V.isFiniteNumber)(z.duration)&&(z.start=H,se&&(z.levelkey=se),z.sn=U,z.level=g,z.cc=F,z.urlId=C,v.push(z),z.relurl=(" "+Q[3]).slice(1),x(z,T),T=z,H+=z.duration,U++,A=0,me=!0);else if(Q[4]){var Re=(" "+Q[4]).slice(1);T?z.setByteRange(Re,T):z.setByteRange(Re)}else if(Q[5])z.rawProgramDateTime=(" "+Q[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),xe===-1&&(xe=v.length);else{if(Q=Q[0].match(d),!Q){m.logger.warn("No matches on slow regex match for level playlist!");continue}for(ne=1;ne<Q.length&&!(typeof Q[ne]!="undefined");ne++);var fe=(" "+Q[ne]).slice(1),ue=(" "+Q[ne+1]).slice(1),Pe=Q[ne+2]?(" "+Q[ne+2]).slice(1):"";switch(fe){case"PLAYLIST-TYPE":E.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":U=E.startSN=parseInt(ue);break;case"SKIP":{var et=new D.AttrList(ue),rt=et.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(rt)){E.skippedSegments=rt;for(var tt=rt;tt--;)v.unshift(null);U+=rt}var it=et.enumeratedString("RECENTLY-REMOVED-DATERANGES");it&&(E.recentlyRemovedDateranges=it.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(ue);break;case"VERSION":E.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(ue||Pe)&&z.tagList.push(Pe?[ue,Pe]:[ue]);break;case"DIS":F++;case"GAP":z.tagList.push([fe]);break;case"BITRATE":z.tagList.push([fe,ue]);break;case"DISCONTINUITY-SEQ":F=parseInt(ue);break;case"KEY":{var ze,Qe=new D.AttrList(ue),at=Qe.enumeratedString("METHOD"),he=Qe.URI,Se=Qe.hexadecimalInteger("IV"),Le=Qe.enumeratedString("KEYFORMATVERSIONS"),Me=Qe.enumeratedString("KEYID"),qe=(ze=Qe.enumeratedString("KEYFORMAT"))!=null?ze:"identity",st=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(st.indexOf(qe)>-1){m.logger.warn("Keyformat "+qe+" is not supported from the manifest");continue}else if(qe!=="identity")continue;at&&(se=n.LevelKey.fromURL(b,he),he&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(at)>=0&&(se.method=at,se.keyFormat=qe,Me&&(se.keyID=Me),Le&&(se.keyFormatVersions=Le),se.iv=Se));break}case"START":{var mt=new D.AttrList(ue),gt=mt.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(gt)&&(E.startTimeOffset=gt);break}case"MAP":{var St=new D.AttrList(ue);z.relurl=St.URI,St.BYTERANGE&&z.setByteRange(St.BYTERANGE),z.level=g,z.sn="initSegment",se&&(z.levelkey=se),z.initSegment=null,N=z,me=!0;break}case"SERVER-CONTROL":{var Et=new D.AttrList(ue);E.canBlockReload=Et.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=Et.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&Et.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=Et.optionalFloat("PART-HOLD-BACK",0),E.holdBack=Et.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ae=new D.AttrList(ue);E.partTarget=Ae.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ce=E.partList;Ce||(Ce=E.partList=[]);var Xe=A>0?Ce[Ce.length-1]:void 0,Je=A++,ke=new G.Part(new D.AttrList(ue),z,b,Je,Xe);Ce.push(ke),z.duration+=ke.duration;break}case"PRELOAD-HINT":{var Ke=new D.AttrList(ue);E.preloadHint=Ke;break}case"RENDITION-REPORT":{var ye=new D.AttrList(ue);E.renditionReports=E.renditionReports||[],E.renditionReports.push(ye);break}default:m.logger.warn("line parsed but not handled: "+Q);break}}}T&&!T.relurl?(v.pop(),H-=T.duration,E.partList&&(E.fragmentHint=T)):E.partList&&(x(z,T),z.cc=F,E.fragmentHint=z);var ce=v.length,pe=v[0],ie=v[ce-1];if(H+=E.skippedSegments*E.targetduration,H>0&&ce&&ie){E.averagetargetduration=H/ce;var ae=ie.sn;E.endSN=ae!=="initSegment"?ae:0,pe&&(E.startCC=pe.cc,pe.initSegment||E.fragments.every(function(de){return de.relurl&&a(de.relurl)})&&(m.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new G.Fragment(f,b),z.relurl=ie.relurl,z.level=g,z.sn="initSegment",pe.initSegment=z,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(H+=E.fragmentHint.duration),E.totalduration=H,E.endCC=F,xe>0&&w(v,xe),E},L}();function s(L,O){["video","audio","text"].forEach(function(_){var b=L.filter(function(f){return Object(p.isCodecType)(f,_)});if(b.length){var g=b.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});O[_+"Codec"]=g.length>0?g[0]:b[0],L=L.filter(function(f){return b.indexOf(f)===-1})}}),O.unknownCodecs=L}function S(L,O,_){var b=O[_];b&&(L[_]=b)}function w(L,O){for(var _=L[O],b=O;b--;){var g=L[b];if(!g)return;g.programDateTime=_.programDateTime-g.duration*1e3,_=g}}function x(L,O){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):O!=null&&O.programDateTime&&(L.programDateTime=O.endProgramDateTime),Object(V.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),M=P("./src/errors.ts"),G=P("./src/utils/logger.ts"),W=P("./src/utils/mp4-tools.ts"),n=P("./src/loader/m3u8-parser.ts"),D=P("./src/types/loader.ts"),m=P("./src/utils/attr-list.ts");function p(o){var d=o.type;switch(d){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function h(o,d){var i=o.url;return(i===void 0||i.indexOf("data:")===0)&&(i=d.url),i}var c=function(){function o(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var d=o.prototype;return d.registerListeners=function(){var a=this.hls;a.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var a=this.hls;a.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(a){var r=this.hls.config,s=r.pLoader,S=r.loader,w=s||S,x=new w(r);return a.loader=x,this.loaders[a.type]=x,x},d.getInternalLoader=function(a){return this.loaders[a.type]},d.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},d.destroyInternalLoaders=function(){for(var a in this.loaders){var r=this.loaders[a];r&&r.destroy(),this.resetInternalLoader(a)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(a,r){var s=r.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},d.onLevelLoading=function(a,r){var s=r.id,S=r.level,w=r.url,x=r.deliveryDirectives;this.load({id:s,groupId:null,level:S,responseType:"text",type:D.PlaylistContextType.LEVEL,url:w,deliveryDirectives:x})},d.onAudioTrackLoading=function(a,r){var s=r.id,S=r.groupId,w=r.url,x=r.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:x})},d.onSubtitleTrackLoading=function(a,r){var s=r.id,S=r.groupId,w=r.url,x=r.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:x})},d.load=function(a){var r,s=this.hls.config,S=this.getInternalLoader(a);if(S){var w=S.context;if(w&&w.url===a.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),S.abort()}var x,L,O,_;switch(a.type){case D.PlaylistContextType.MANIFEST:x=s.manifestLoadingMaxRetry,L=s.manifestLoadingTimeOut,O=s.manifestLoadingRetryDelay,_=s.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:x=0,L=s.levelLoadingTimeOut;break;default:x=s.levelLoadingMaxRetry,L=s.levelLoadingTimeOut,O=s.levelLoadingRetryDelay,_=s.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(a),(r=a.deliveryDirectives)!==null&&r!==void 0&&r.part){var b;if(a.type===D.PlaylistContextType.LEVEL&&a.level!==null?b=this.hls.levels[a.level].details:a.type===D.PlaylistContextType.AUDIO_TRACK&&a.id!==null?b=this.hls.audioTracks[a.id].details:a.type===D.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(b=this.hls.subtitleTracks[a.id].details),b){var g=b.partTarget,f=b.targetduration;g&&f&&(L=Math.min(Math.max(g*3,f*.8)*1e3,L))}}var C={timeout:L,maxRetry:x,retryDelay:O,maxRetryDelay:_,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(a,C,E)},d.loadsuccess=function(a,r,s,S){if(S===void 0&&(S=null),s.isSidxRequest){this.handleSidxRequest(a,s),this.handlePlaylistLoaded(a,r,s,S);return}this.resetInternalLoader(s.type);var w=a.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,s,"no EXTM3U delimiter",S);return}r.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,r,s,S):this.handleMasterPlaylist(a,r,s,S)},d.loaderror=function(a,r,s){s===void 0&&(s=null),this.handleNetworkError(r,s,!1,a)},d.loadtimeout=function(a,r,s){s===void 0&&(s=null),this.handleNetworkError(r,s,!0)},d.handleMasterPlaylist=function(a,r,s,S){var w=this.hls,x=a.data,L=h(a,s),O=n.default.parseMasterPlaylist(x,L),_=O.levels,b=O.sessionData;if(!_.length){this.handleManifestParsingError(a,s,"no level found in manifest",S);return}var g=_.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),f=_.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),C=n.default.parseMasterPlaylistMedia(x,L,"AUDIO",g),E=n.default.parseMasterPlaylistMedia(x,L,"SUBTITLES",f),v=n.default.parseMasterPlaylistMedia(x,L,"CLOSED-CAPTIONS");if(C.length){var N=C.some(function(U){return!U.url});!N&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m.AttrList({}),bitrate:0,url:""}))}w.trigger(j.Events.MANIFEST_LOADED,{levels:_,audioTracks:C,subtitles:E,captions:v,url:L,stats:r,networkDetails:S,sessionData:b})},d.handleTrackOrLevelPlaylist=function(a,r,s,S){var w=this.hls,x=s.id,L=s.level,O=s.type,_=h(a,s),b=Object(V.isFiniteNumber)(x)?x:0,g=Object(V.isFiniteNumber)(L)?L:b,f=p(s),C=n.default.parseLevelPlaylist(a.data,_,g,f,b);if(!C.fragments.length){w.trigger(j.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(O===D.PlaylistContextType.MANIFEST){var E={attrs:new m.AttrList({}),bitrate:0,details:C,name:"",url:_};w.trigger(j.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:_,stats:r,networkDetails:S,sessionData:null})}if(r.parsing.end=performance.now(),C.needSidxRanges){var v,N=(v=C.fragments[0].initSegment)===null||v===void 0?void 0:v.url;this.load({url:N,isSidxRequest:!0,type:O,level:L,levelDetails:C,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=C,this.handlePlaylistLoaded(a,r,s,S)},d.handleSidxRequest=function(a,r){var s=Object(W.parseSegmentIndex)(new Uint8Array(a.data));if(!s)return;var S=s.references,w=r.levelDetails;S.forEach(function(x,L){var O=x.info,_=w.fragments[L];_.byteRange.length===0&&_.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),_.initSegment&&_.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(a,r,s,S){this.hls.trigger(j.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:r.type===D.PlaylistContextType.MANIFEST,url:a.url,reason:s,response:a,context:r,networkDetails:S})},d.handleNetworkError=function(a,r,s,S){s===void 0&&(s=!1),G.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var w=M.ErrorDetails.UNKNOWN,x=!1,L=this.getInternalLoader(a);switch(a.type){case D.PlaylistContextType.MANIFEST:w=s?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case D.PlaylistContextType.LEVEL:w=s?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.AUDIO_TRACK:w=s?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:w=s?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}L&&this.resetInternalLoader(a.type);var O={type:M.ErrorTypes.NETWORK_ERROR,details:w,fatal:x,url:a.url,loader:L,context:a,networkDetails:r};S&&(O.response=S),this.hls.trigger(j.Events.ERROR,O)},d.handlePlaylistLoaded=function(a,r,s,S){var w=s.type,x=s.level,L=s.id,O=s.groupId,_=s.loader,b=s.levelDetails,g=s.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(a,s,"invalid target duration",S);return}if(!_)return;b.live&&(_.getCacheAge&&(b.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(w){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:b,level:x||0,id:L||0,stats:r,networkDetails:S,deliveryDirectives:g});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:b,id:L||0,groupId:O||"",stats:r,networkDetails:S,deliveryDirectives:g});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:b,id:L||0,groupId:O||"",stats:r,networkDetails:S,deliveryDirectives:g});break}},o}();X.default=c},"./src/polyfills/number.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"isFiniteNumber",function(){return V}),P.d(X,"MAX_SAFE_INTEGER",function(){return j});var V=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,X,P){"use strict";P.r(X);var V=function(){function j(){}return j.getSilentFrame=function(G,W){switch(G){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===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(W===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(W===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(W===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(W===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},j}();X.default=V},"./src/remux/mp4-generator.ts":function(Z,X,P){"use strict";P.r(X);var V=Math.pow(2,32)-1,j=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 W;for(W in M.types)M.types.hasOwnProperty(W)&&(M.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var n=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:n,audio:D};var m=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=p,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 h=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,h,o,h,c),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,m))},M.box=function(W){for(var n=8,D=arguments.length,m=new Array(D>1?D-1:0),p=1;p<D;p++)m[p-1]=arguments[p];for(var h=m.length,c=h;h--;)n+=m[h].byteLength;var o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(W,4),h=0,n=8;h<c;h++)o.set(m[h],n),n+=m[h].byteLength;return o},M.hdlr=function(W){return M.box(M.types.hdlr,M.HDLR_TYPES[W])},M.mdat=function(W){return M.box(M.types.mdat,W)},M.mdhd=function(W,n){n*=W;var D=Math.floor(n/(V+1)),m=Math.floor(n%(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,W>>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,m>>24,m>>16&255,m>>8&255,m&255,85,196,0,0]))},M.mdia=function(W){return M.box(M.types.mdia,M.mdhd(W.timescale,W.duration),M.hdlr(W.type),M.minf(W))},M.mfhd=function(W){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},M.minf=function(W){return W.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(W)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(W))},M.moof=function(W,n,D){return M.box(M.types.moof,M.mfhd(W),M.traf(D,n))},M.moov=function(W){for(var n=W.length,D=[];n--;)D[n]=M.trak(W[n]);return M.box.apply(null,[M.types.moov,M.mvhd(W[0].timescale,W[0].duration)].concat(D).concat(M.mvex(W)))},M.mvex=function(W){for(var n=W.length,D=[];n--;)D[n]=M.trex(W[n]);return M.box.apply(null,[M.types.mvex].concat(D))},M.mvhd=function(W,n){n*=W;var D=Math.floor(n/(V+1)),m=Math.floor(n%(V+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,m>>24,m>>16&255,m>>8&255,m&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,p)},M.sdtp=function(W){var n=W.samples||[],D=new Uint8Array(4+n.length),m,p;for(m=0;m<n.length;m++)p=n[m].flags,D[m+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return M.box(M.types.sdtp,D)},M.stbl=function(W){return M.box(M.types.stbl,M.stsd(W),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(W){var n=[],D=[],m,p,h;for(m=0;m<W.sps.length;m++)p=W.sps[m],h=p.byteLength,n.push(h>>>8&255),n.push(h&255),n=n.concat(Array.prototype.slice.call(p));for(m=0;m<W.pps.length;m++)p=W.pps[m],h=p.byteLength,D.push(h>>>8&255),D.push(h&255),D=D.concat(Array.prototype.slice.call(p));var c=M.box(M.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|W.sps.length].concat(n).concat([W.pps.length]).concat(D))),o=W.width,d=W.height,i=W.pixelRatio[0],a=W.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,o&255,d>>8&255,d&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([i>>24,i>>16&255,i>>8&255,i&255,a>>24,a>>16&255,a>>8&255,a&255])))},M.esds=function(W){var n=W.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(W.config).concat([6,1,2]))},M.mp4a=function(W){var n=W.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,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),M.box(M.types.esds,M.esds(W)))},M.mp3=function(W){var n=W.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,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},M.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(W)):M.box(M.types.stsd,M.STSD,M.mp4a(W)):M.box(M.types.stsd,M.STSD,M.avc1(W))},M.tkhd=function(W){var n=W.id,D=W.duration*W.timescale,m=W.width,p=W.height,h=Math.floor(D/(V+1)),c=Math.floor(D%(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,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,h>>24,h>>16&255,h>>8&255,h&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,m>>8&255,m&255,0,0,p>>8&255,p&255,0,0]))},M.traf=function(W,n){var D=M.sdtp(W),m=W.id,p=Math.floor(n/(V+1)),h=Math.floor(n%(V+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,h>>24,h>>16&255,h>>8&255,h&255])),M.trun(W,D.length+16+20+8+16+8+8),D)},M.trak=function(W){return W.duration=W.duration||4294967295,M.box(M.types.trak,M.tkhd(W),M.mdia(W))},M.trex=function(W){var n=W.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(W,n){var D=W.samples||[],m=D.length,p=12+16*m,h=new Uint8Array(p),c,o,d,i,a,r;for(n+=8+p,h.set([0,0,15,1,m>>>24&255,m>>>16&255,m>>>8&255,m&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),c=0;c<m;c++)o=D[c],d=o.duration,i=o.size,a=o.flags,r=o.cts,h.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,r>>>24&255,r>>>16&255,r>>>8&255,r&255],12+16*c);return M.box(M.types.trun,h)},M.initSegment=function(W){M.types||M.init();var n=M.moov(W),D=new Uint8Array(M.FTYP.byteLength+n.byteLength);return D.set(M.FTYP),D.set(n,M.FTYP.byteLength),D},M}();j.types=void 0,j.HDLR_TYPES=void 0,j.STTS=void 0,j.STSC=void 0,j.STCO=void 0,j.STSZ=void 0,j.VMHD=void 0,j.SMHD=void 0,j.STSD=void 0,j.FTYP=void 0,j.DINF=void 0,X.default=j},"./src/remux/mp4-remuxer.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return r}),P.d(X,"normalizePts",function(){return s});var V=P("./src/polyfills/number.ts"),j=P("./src/remux/aac-helper.ts"),M=P("./src/remux/mp4-generator.ts"),G=P("./src/events.ts"),W=P("./src/errors.ts"),n=P("./src/utils/logger.ts"),D=P("./src/types/loader.ts"),m=P("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var _=arguments[O];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(L[b]=_[b])}return L},p.apply(this,arguments)}var h=10*1e3,c=1024,o=1152,d=null,i=null,a=!1,r=function(){function L(_,b,g,f){if(f===void 0&&(f=""),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=_,this.config=b,this.typeSupported=g,this.ISGenerated=!1,d===null){var C=navigator.userAgent||"",E=C.match(/Chrome\/(\d+)/i);d=E?parseInt(E[1]):0}if(i===null){var v=navigator.userAgent.match(/Safari\/(\d+)/i);i=v?parseInt(v[1]):0}a=!!d&&d<75||!!i&&i<600}var O=L.prototype;return O.destroy=function(){},O.resetTimeStamp=function(b){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},O.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(b){var g=!1,f=b.reduce(function(C,E){var v=E.pts-C;return v<-4294967296?(g=!0,s(C,E.pts)):v>0?C:E.pts},b[0].pts);return g&&n.logger.debug("PTS rollover detected"),f},O.remux=function(b,g,f,C,E,v,N,U){var A,H,F,T,z,Q,ne=E,se=E,xe=b.pid>-1,me=g.pid>-1,ve=g.samples.length,Oe=b.samples.length>0,Re=ve>1,fe=(!xe||Oe)&&(!me||Re)||this.ISGenerated||N;if(fe){this.ISGenerated||(F=this.generateIS(b,g,E));var ue=this.isVideoContiguous,Pe=-1;if(Re&&(Pe=S(g.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,Pe>0){n.logger.warn("[mp4-remuxer]: Dropped "+Pe+" out of "+ve+" video samples due to a missing keyframe");var et=this.getVideoStartPts(g.samples);g.samples=g.samples.slice(Pe),g.dropped+=Pe,se+=(g.samples[0].pts-et)/(g.timescale||9e4)}else Pe===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+ve+" video samples"),Q=!1);if(this.ISGenerated){if(Oe&&Re){var rt=this.getVideoStartPts(g.samples),tt=s(b.samples[0].pts,rt)-rt,it=tt/g.inputTimeScale;ne+=Math.max(0,it),se+=Math.max(0,-it)}if(Oe){if(b.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(b,g,E)),H=this.remuxAudio(b,ne,this.isAudioContiguous,v,me||Re||U===D.PlaylistLevelType.AUDIO?se:void 0),Re){var ze=H?H.endPTS-H.startPTS:0;g.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(b,g,E)),A=this.remuxVideo(g,se,ue,ze)}}else Re&&(A=this.remuxVideo(g,se,ue,0));A&&(A.firstKeyFrame=Pe,A.independent=Pe!==-1)}}return this.ISGenerated&&(f.samples.length&&(z=this.remuxID3(f,E)),C.samples.length&&(T=this.remuxText(C,E))),{audio:H,video:A,initSegment:F,independent:Q,text:T,id3:z}},O.generateIS=function(b,g,f){var C=b.samples,E=g.samples,v=this.typeSupported,N={},U=!Object(V.isFiniteNumber)(this._initPTS),A="audio/mp4",H,F,T;if(U&&(H=F=Infinity),b.config&&C.length&&(b.timescale=b.samplerate,b.isAAC||(v.mpeg?(A="audio/mpeg",b.codec=""):v.mp3&&(b.codec="mp3")),N.audio={id:"audio",container:A,codec:b.codec,initSegment:!b.isAAC&&v.mpeg?new Uint8Array(0):M.default.initSegment([b]),metadata:{channelCount:b.channelCount}},U&&(T=b.inputTimeScale,H=F=C[0].pts-Math.round(T*f))),g.sps&&g.pps&&E.length&&(g.timescale=g.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:g.codec,initSegment:M.default.initSegment([g]),metadata:{width:g.width,height:g.height}},U)){T=g.inputTimeScale;var z=this.getVideoStartPts(E),Q=Math.round(T*f);F=Math.min(F,s(E[0].dts,z)-Q),H=Math.min(H,z-Q)}if(Object.keys(N).length)return this.ISGenerated=!0,U&&(this._initPTS=H,this._initDTS=F),{tracks:N,initPTS:H,timescale:T}},O.remuxVideo=function(b,g,f,C){var E=b.inputTimeScale,v=b.samples,N=[],U=v.length,A=this._initPTS,H=this.nextAvcDts,F=8,T,z,Q,ne=Number.POSITIVE_INFINITY,se=Number.NEGATIVE_INFINITY,xe=0,me=!1;if(!f||H===null){var ve=g*E,Oe=v[0].pts-s(v[0].dts,v[0].pts);H=ve-Oe}for(var Re=0;Re<U;Re++){var fe=v[Re];if(fe.pts=s(fe.pts-A,H),fe.dts=s(fe.dts-A,H),fe.dts>fe.pts){var ue=9e4*.2;xe=Math.max(Math.min(xe,fe.pts-fe.dts),-1*ue)}fe.dts<v[Re>0?Re-1:Re].dts&&(me=!0)}me&&v.sort(function(ot,He){var Ge=ot.dts-He.dts,Ue=ot.pts-He.pts;return Ge||Ue}),z=v[0].dts,Q=v[v.length-1].dts;var Pe=Math.round((Q-z)/(U-1));if(xe<0){if(xe<Pe*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(m.toMsFromMpegTsClock)(-Pe,!0)+" ms");for(var et=xe,rt=0;rt<U;rt++)v[rt].dts=et=Math.max(et,v[rt].pts-Pe),v[rt].pts=Math.max(et,v[rt].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(m.toMsFromMpegTsClock)(xe,!0)+" ms to overcome this issue");for(var tt=0;tt<U;tt++)v[tt].dts=v[tt].dts+xe}z=v[0].dts}if(f){var it=z-H,ze=it>Pe,Qe=it<-1;if(ze||Qe){ze?n.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(it,!0)+" ms ("+it+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(-it,!0)+" ms ("+it+"dts) overlapping between fragments detected"),z=H;var at=v[0].pts-it;v[0].dts=z,v[0].pts=at,n.logger.log("Video: First PTS/DTS adjusted: "+Object(m.toMsFromMpegTsClock)(at,!0)+"/"+Object(m.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(m.toMsFromMpegTsClock)(it,!0)+" ms")}}a&&(z=Math.max(0,z));for(var he=0,Se=0,Le=0;Le<U;Le++){for(var Me=v[Le],qe=Me.units,st=qe.length,mt=0,gt=0;gt<st;gt++)mt+=qe[gt].data.length;Se+=mt,he+=st,Me.length=mt,Me.dts=Math.max(Me.dts,z),Me.pts=Math.max(Me.pts,Me.dts,0),ne=Math.min(Me.pts,ne),se=Math.max(Me.pts,se)}Q=v[U-1].dts;var St=Se+4*he+8,Et;try{Et=new Uint8Array(St)}catch(ot){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:St,reason:"fail allocating video mdat "+St});return}var Ae=new DataView(Et.buffer);Ae.setUint32(0,St),Et.set(M.default.types.mdat,4);for(var Ce=0;Ce<U;Ce++){for(var Xe=v[Ce],Je=Xe.units,ke=0,Ke=0,ye=Je.length;Ke<ye;Ke++){var ce=Je[Ke],pe=ce.data,ie=ce.data.byteLength;Ae.setUint32(F,ie),F+=4,Et.set(pe,F),F+=ie,ke+=4+ie}if(Ce<U-1)T=v[Ce+1].dts-Xe.dts;else{var ae=this.config,de=Xe.dts-v[Ce>0?Ce-1:Ce].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var ge=Math.floor(ae.maxBufferHole*E),Te=(C?ne+C*E:this.nextAudioPts)-Xe.pts;Te>ge?(T=Te-de,T<0&&(T=de),n.logger.log("[mp4-remuxer]: It is approximately "+Te/90+" ms to the next segment; using duration "+T/90+" ms for the last video frame.")):T=de}else T=de}var De=Math.round(Xe.pts-Xe.dts);N.push(new w(Xe.key,T,ke,De))}if(N.length&&d&&d<70){var Ze=N[0].flags;Ze.dependsOn=2,Ze.isNonSync=0}console.assert(T!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=Q+T,this.isVideoContiguous=!0;var pt=M.default.moof(b.sequenceNumber++,z,p({},b,{samples:N})),Ot="video",yt={data1:pt,data2:Et,startPTS:ne/E,endPTS:(se+T)/E,startDTS:z/E,endDTS:H/E,type:Ot,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(Et.length,"MDAT length must not be zero"),yt},O.remuxAudio=function(b,g,f,C,E){var v=b.inputTimeScale,N=b.samplerate?b.samplerate:v,U=v/N,A=b.isAAC?c:o,H=A*U,F=this._initPTS,T=!b.isAAC&&this.typeSupported.mpeg,z=[],Q=b.samples,ne=T?0:8,se=this.nextAudioPts||-1,xe=g*v;if(this.isAudioContiguous=f=f||Q.length&&se>0&&(C&&Math.abs(xe-se)<9e3||Math.abs(s(Q[0].pts-F,xe)-se)<20*H),Q.forEach(function(pe){pe.pts=s(pe.pts-F,xe)}),!f||se<0){if(Q=Q.filter(function(pe){return pe.pts>=0}),!Q.length)return;E===0?se=0:C?se=Math.max(0,xe):se=Q[0].pts}if(b.isAAC)for(var me=E!==void 0,ve=this.config.maxAudioFramesDrift,Oe=0,Re=se;Oe<Q.length;Oe++){var fe=Q[Oe],ue=fe.pts,Pe=ue-Re,et=Math.abs(1e3*Pe/v);if(Pe<=-ve*H&&me)Oe===0&&(n.logger.warn("Audio frame @ "+(ue/v).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Pe/v)+" ms."),this.nextAudioPts=se=Re=ue);else if(Pe>=ve*H&&et<h&&me){var rt=Math.round(Pe/H);Re=ue-rt*H,Re<0&&(rt--,Re+=H),Oe===0&&(this.nextAudioPts=se=Re),n.logger.warn("[mp4-remuxer]: Injecting "+rt+" audio frame @ "+(Re/v).toFixed(3)+"s due to "+Math.round(1e3*Pe/v)+" ms gap.");for(var tt=0;tt<rt;tt++){var it=Math.max(Re,0),ze=j.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);ze||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ze=fe.unit.subarray()),Q.splice(Oe,0,{unit:ze,pts:it}),Re+=H,Oe++}}fe.pts=Re,Re+=H}for(var Qe=null,at=null,he,Se=0,Le=Q.length;Le--;)Se+=Q[Le].unit.byteLength;for(var Me=0,qe=Q.length;Me<qe;Me++){var st=Q[Me],mt=st.unit,gt=st.pts;if(at!==null){var St=z[Me-1];St.duration=Math.round((gt-at)/U)}else if(f&&b.isAAC&&(gt=se),Qe=gt,Se>0){Se+=ne;try{he=new Uint8Array(Se)}catch(pe){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Se,reason:"fail allocating audio mdat "+Se});return}if(!T){var Et=new DataView(he.buffer);Et.setUint32(0,Se),he.set(M.default.types.mdat,4)}}else return;he.set(mt,ne);var Ae=mt.byteLength;ne+=Ae,z.push(new w(!0,A,Ae,0)),at=gt}var Ce=z.length;if(!Ce)return;var Xe=z[z.length-1];this.nextAudioPts=se=at+U*Xe.duration;var Je=T?new Uint8Array(0):M.default.moof(b.sequenceNumber++,Qe/U,p({},b,{samples:z}));b.samples=[];var ke=Qe/v,Ke=se/v,ye="audio",ce={data1:Je,data2:he,startPTS:ke,endPTS:Ke,startDTS:ke,endDTS:Ke,type:ye,hasAudio:!0,hasVideo:!1,nb:Ce};return this.isAudioContiguous=!0,console.assert(he.length,"MDAT length must not be zero"),ce},O.remuxEmptyAudio=function(b,g,f,C){var E=b.inputTimeScale,v=b.samplerate?b.samplerate:E,N=E/v,U=this.nextAudioPts,A=(U!==null?U:C.startDTS*E)+this._initDTS,H=C.endDTS*E+this._initDTS,F=N*c,T=Math.ceil((H-A)/F),z=j.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Q=[],ne=0;ne<T;ne++){var se=A+ne*F;Q.push({unit:z,pts:se,dts:se})}return b.samples=Q,this.remuxAudio(b,g,f,!1)},O.remuxID3=function(b,g){var f=b.samples.length;if(!f)return;for(var C=b.inputTimeScale,E=this._initPTS,v=this._initDTS,N=0;N<f;N++){var U=b.samples[N];U.pts=s(U.pts-E,g*C)/C,U.dts=s(U.dts-v,g*C)/C}var A=b.samples;return b.samples=[],{samples:A}},O.remuxText=function(b,g){var f=b.samples.length;if(!f)return;for(var C=b.inputTimeScale,E=this._initPTS,v=0;v<f;v++){var N=b.samples[v];N.pts=s(N.pts-E,g*C)/C}b.samples.sort(function(A,H){return A.pts-H.pts});var U=b.samples;return b.samples=[],{samples:U}},L}();function s(L,O){var _;if(O===null)return L;for(O<L?_=-8589934592:_=8589934592;Math.abs(L-O)>4294967296;)L+=_;return L}function S(L){for(var O=0;O<L.length;O++)if(L[O].key)return O;return-1}var w=function(O,_,b,g){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=b,this.cts=g,this.flags=new x(O)},x=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),j=P("./src/utils/mp4-tools.ts"),M=P("./src/loader/fragment.ts"),G=P("./src/utils/logger.ts"),W=function(){function m(){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 p=m.prototype;return p.destroy=function(){},p.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(c,o,d){this.audioCodec=o,this.videoCodec=d,this.generateInitSegment(c),this.emitInitSegment=!0},p.generateInitSegment=function(c){var o=this.audioCodec,d=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(j.parseInitSegment)(c);o||(o=D(i.audio,M.ElementaryStreamTypes.AUDIO)),d||(d=D(i.video,M.ElementaryStreamTypes.VIDEO));var a={};i.audio&&i.video?a.audiovideo={container:"video/mp4",codec:o+","+d,initSegment:c,id:"main"}:i.audio?a.audio={container:"audio/mp4",codec:o,initSegment:c,id:"audio"}:i.video?a.video={container:"video/mp4",codec:d,initSegment:c,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},p.remux=function(c,o,d,i,a){var r=this.initPTS,s=this.lastEndDTS,S={audio:void 0,video:void 0,text:i,id3:d,initSegment:void 0};Object(V.isFiniteNumber)(s)||(s=this.lastEndDTS=a||0);var w=o.samples;if(!w||!w.length)return S;var x={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(w),L=this.initData),!L||!L.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(r)||(this.initPTS=x.initPTS=r=n(L,w,s));var O=Object(j.getDuration)(w,L),_=s,b=O+_;Object(j.offsetStartDTS)(L,w,r),O>0?this.lastEndDTS=b:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var g=!!L.audio,f=!!L.video,C="";g&&(C+="audio"),f&&(C+="video");var E={data1:w,startPTS:_,startDTS:_,endPTS:b,endDTS:b,type:C,hasAudio:g,hasVideo:f,nb:1,dropped:0};return S.audio=E.type==="audio"?E:void 0,S.video=E.type!=="audio"?E:void 0,S.text=i,S.id3=d,S.initSegment=x,S},m}(),n=function(p,h,c){return Object(j.getStartDTS)(p,h)-c};function D(m,p){var h=m==null?void 0:m.codec;return h&&h.length>4?h:h==="hvc1"?"hvc1.1.c.L120.90":h==="av01"?"av01.0.04M.08":h==="avc1"||p===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}X.default=W},"./src/task-loop.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function j(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=j.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(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!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(){},j}()},"./src/types/cmcd.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"CMCDVersion",function(){return V}),P.d(X,"CMCDObjectType",function(){return j}),P.d(X,"CMCDStreamingFormat",function(){return M}),P.d(X,"CMCDStreamType",function(){return G});var V=1,j;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(j||(j={}));var M;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(M||(M={}));var G;(function(W){W.VOD="v",W.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"HlsSkip",function(){return M}),P.d(X,"getSkipValue",function(){return G}),P.d(X,"HlsUrlParameters",function(){return W}),P.d(X,"Level",function(){return n});function V(D,m){for(var p=0;p<m.length;p++){var h=m[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function j(D,m,p){return m&&V(D.prototype,m),p&&V(D,p),D}var M;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(M||(M={}));function G(D,m){var p=D.canSkipUntil,h=D.canSkipDateRanges,c=D.endSN,o=m!==void 0?m-c:0;return p&&o<p?h?M.v2:M.Yes:M.No}var W=function(){function D(p,h,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=h,this.skip=c}var m=D.prototype;return m.addDirectives=function(h){var c=new self.URL(h);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()},D}(),n=function(){function D(m){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=[m.url],this.attrs=m.attrs,this.bitrate=m.bitrate,m.details&&(this.details=m.details),this.id=m.id||0,this.name=m.name,this.width=m.width||0,this.height=m.height||0,this.audioCodec=m.audioCodec,this.videoCodec=m.videoCodec,this.unknownCodecs=m.unknownCodecs,this.codecSet=[m.videoCodec,m.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return j(D,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(p){var h=p%this.url.length;this._urlId!==h&&(this.details=void 0,this._urlId=h)}}]),D}()},"./src/types/loader.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"PlaylistContextType",function(){return V}),P.d(X,"PlaylistLevelType",function(){return j});var V;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var j;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(j||(j={}))},"./src/types/transmuxer.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"ChunkMetadata",function(){return V});var V=function(G,W,n,D,m,p){D===void 0&&(D=0),m===void 0&&(m=-1),p===void 0&&(p=!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=j(),this.buffering={audio:j(),video:j(),audiovideo:j()},this.level=G,this.sn=W,this.id=n,this.size=D,this.part=m,this.partial=p};function j(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"AttrList",function(){return M});var V=/^(\d+)x(\d+)$/,j=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function G(n){typeof n=="string"&&(n=G.parseAttrList(n));for(var D in n)n.hasOwnProperty(D)&&(this[D]=n[D])}var W=G.prototype;return W.decimalInteger=function(D){var m=parseInt(this[D],10);return m>Number.MAX_SAFE_INTEGER?Infinity:m},W.hexadecimalInteger=function(D){if(this[D]){var m=(this[D]||"0x").slice(2);m=(m.length&1?"0":"")+m;for(var p=new Uint8Array(m.length/2),h=0;h<m.length/2;h++)p[h]=parseInt(m.slice(h*2,h*2+2),16);return p}else return null},W.hexadecimalIntegerAsNumber=function(D){var m=parseInt(this[D],16);return m>Number.MAX_SAFE_INTEGER?Infinity:m},W.decimalFloatingPoint=function(D){return parseFloat(this[D])},W.optionalFloat=function(D,m){var p=this[D];return p?parseFloat(p):m},W.enumeratedString=function(D){return this[D]},W.bool=function(D){return this[D]==="YES"},W.decimalResolution=function(D){var m=V.exec(this[D]);return m===null?void 0:{width:parseInt(m[1],10),height:parseInt(m[2],10)}},G.parseAttrList=function(D){var m,p={},h='"';for(j.lastIndex=0;(m=j.exec(D))!==null;){var c=m[2];c.indexOf(h)===0&&c.lastIndexOf(h)===c.length-1&&(c=c.slice(1,-1)),p[m[1]]=c}return p},G}()},"./src/utils/binary-search.ts":function(Z,X,P){"use strict";P.r(X);var V={search:function(M,G){for(var W=0,n=M.length-1,D=null,m=null;W<=n;){D=(W+n)/2|0,m=M[D];var p=G(m);if(p>0)W=D+1;else if(p<0)n=D-1;else return m}return null}};X.default=V},"./src/utils/buffer-helper.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"BufferHelper",function(){return M});var V=P("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function G(){}return G.isBuffered=function(n,D){try{if(n){for(var m=G.getBuffered(n),p=0;p<m.length;p++)if(D>=m.start(p)&&D<=m.end(p))return!0}}catch(h){}return!1},G.bufferInfo=function(n,D,m){try{if(n){var p=G.getBuffered(n),h=[],c;for(c=0;c<p.length;c++)h.push({start:p.start(c),end:p.end(c)});return this.bufferedInfo(h,D,m)}}catch(o){}return{len:0,start:D,end:D,nextStart:void 0}},G.bufferedInfo=function(n,D,m){D=Math.max(0,D),n.sort(function(x,L){var O=x.start-L.start;return O||L.end-x.end});var p=[];if(m)for(var h=0;h<n.length;h++){var c=p.length;if(c){var o=p[c-1].end;n[h].start-o<m?n[h].end>o&&(p[c-1].end=n[h].end):p.push(n[h])}else p.push(n[h])}else p=n;for(var d=0,i,a=D,r=D,s=0;s<p.length;s++){var S=p[s].start,w=p[s].end;if(D+m>=S&&D<w)a=S,r=w,d=r-D;else if(D+m<S){i=S;break}}return{len:d,start:a||0,end:r||0,nextStart:i}},G.getBuffered=function(n){try{return n.buffered}catch(D){return V.logger.log("failed to get media.buffered",D),j}},G}()},"./src/utils/cea-608-parser.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"Row",function(){return r}),P.d(X,"CaptionScreen",function(){return s});var V=P("./src/utils/logger.ts"),j={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(b){var g=b;return j.hasOwnProperty(b)&&(g=j[b]),String.fromCharCode(g)},G=15,W=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},m={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(_){_[_.ERROR=0]="ERROR",_[_.TEXT=1]="TEXT",_[_.WARNING=2]="WARNING",_[_.INFO=2]="INFO",_[_.DEBUG=3]="DEBUG",_[_.DATA=3]="DATA"})(c||(c={}));var o=function(){function _(){this.time=null,this.verboseLevel=c.ERROR}var b=_.prototype;return b.log=function(f,C){this.verboseLevel>=f&&V.logger.log(this.time+" ["+f+"] "+C)},_}(),d=function(b){for(var g=[],f=0;f<b.length;f++)g.push(b[f].toString(16));return g},i=function(){function _(g,f,C,E,v){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=g||"white",this.underline=f||!1,this.italics=C||!1,this.background=E||"black",this.flash=v||!1}var b=_.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(f){for(var C=["foreground","underline","italics","background","flash"],E=0;E<C.length;E++){var v=C[E];f.hasOwnProperty(v)&&(this[v]=f[v])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},b.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),a=function(){function _(g,f,C,E,v,N){this.uchar=void 0,this.penState=void 0,this.uchar=g||" ",this.penState=new i(f,C,E,v,N)}var b=_.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(f,C){this.uchar=f,this.penState.copy(C)},b.setPenState=function(f){this.penState.copy(f)},b.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},b.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),r=function(){function _(g){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<W;f++)this.chars.push(new a);this.logger=g,this.pos=0,this.currPenState=new i}var b=_.prototype;return b.equals=function(f){for(var C=!0,E=0;E<W;E++)if(!this.chars[E].equals(f.chars[E])){C=!1;break}return C},b.copy=function(f){for(var C=0;C<W;C++)this.chars[C].copy(f.chars[C])},b.isEmpty=function(){for(var f=!0,C=0;C<W;C++)if(!this.chars[C].isEmpty()){f=!1;break}return f},b.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},b.moveCursor=function(f){var C=this.pos+f;if(f>1)for(var E=this.pos+1;E<C+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(C)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(f){f>=144&&this.backSpace();var C=M(f);if(this.pos>=W){this.logger.log(c.ERROR,"Cannot insert "+f.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(f){var C;for(C=f;C<W;C++)this.chars[C].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var f=[],C=!0,E=0;E<W;E++){var v=this.chars[E].uchar;v!==" "&&(C=!1),f.push(v)}return C?"":f.join("")},b.setPenStyles=function(f){this.currPenState.setStyles(f);var C=this.chars[this.pos];C.setPenState(this.currPenState)},_}(),s=function(){function _(g){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<G;f++)this.rows.push(new r(g));this.logger=g,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=_.prototype;return b.reset=function(){for(var f=0;f<G;f++)this.rows[f].clear();this.currRow=G-1},b.equals=function(f){for(var C=!0,E=0;E<G;E++)if(!this.rows[E].equals(f.rows[E])){C=!1;break}return C},b.copy=function(f){for(var C=0;C<G;C++)this.rows[C].copy(f.rows[C])},b.isEmpty=function(){for(var f=!0,C=0;C<G;C++)if(!this.rows[C].isEmpty()){f=!1;break}return f},b.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},b.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},b.insertChar=function(f){var C=this.rows[this.currRow];C.insertChar(f)},b.setPen=function(f){var C=this.rows[this.currRow];C.setPenStyles(f)},b.moveCursor=function(f){var C=this.rows[this.currRow];C.moveCursor(f)},b.setCursor=function(f){this.logger.log(c.INFO,"setCursor: "+f);var C=this.rows[this.currRow];C.setCursor(f)},b.setPAC=function(f){this.logger.log(c.INFO,"pacData = "+JSON.stringify(f));var C=f.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var E=0;E<G;E++)this.rows[E].clear();var v=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var U=N.rows[v].cueStartTime,A=this.logger.time;if(U&&A!==null&&U<A)for(var H=0;H<this.nrRollUpRows;H++)this.rows[C-this.nrRollUpRows+H+1].copy(N.rows[v+H])}}this.currRow=C;var F=this.rows[this.currRow];if(f.indent!==null){var T=f.indent,z=Math.max(T-1,0);F.setCursor(f.indent),f.color=F.chars[z].penState.foreground}var Q={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(Q)},b.setBkgData=function(f){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},b.setRollUpRows=function(f){this.nrRollUpRows=f},b.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 f=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(f,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(c.INFO,"Rolling up")},b.getDisplayText=function(f){f=f||!1;for(var C=[],E="",v=-1,N=0;N<G;N++){var U=this.rows[N].getTextString();U&&(v=N+1,f?C.push("Row "+v+": '"+U+"'"):C.push(U.trim()))}return C.length>0&&(f?E="["+C.join(" | ")+"]":E=C.join(`
`)),E},b.getTextAndFormat=function(){return this.rows},_}(),S=function(){function _(g,f,C){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=g,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new s(C),this.nonDisplayedMemory=new s(C),this.lastOutputScreen=new s(C),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var b=_.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(f){this.outputFilter=f},b.setPAC=function(f){this.writeScreen.setPAC(f)},b.setBkgData=function(f){this.writeScreen.setBkgData(f)},b.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(c.INFO,"MODE="+f),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=f},b.insertChars=function(f){for(var C=0;C<f.length;C++)this.writeScreen.insertChar(f[C]);var E=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,E+": "+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())},b.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(f){this.logger.log(c.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},b.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(f){this.logger.log(c.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},b.ccMIDROW=function(f){var C={flash:!1};if(C.underline=f%2===1,C.italics=f>=46,C.italics)C.foreground="white";else{var E=Math.floor(f/2)-16,v=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=v[E]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},b.outputDataUpdate=function(f){f===void 0&&(f=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},_}(),w=function(){function _(g,f,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new o;this.channels=[null,new S(g,f,E),new S(g+1,C,E)],this.cmdHistory=O(),this.logger=E}var b=_.prototype;return b.getHandler=function(f){return this.channels[f].getHandler()},b.setHandler=function(f,C){this.channels[f].setHandler(C)},b.addData=function(f,C){var E,v,N,U=!1;this.logger.time=f;for(var A=0;A<C.length;A+=2){if(v=C[A]&127,N=C[A+1]&127,v===0&&N===0)continue;if(this.logger.log(c.DATA,"["+d([C[A],C[A+1]])+"] -> ("+d([v,N])+")"),E=this.parseCmd(v,N),E||(E=this.parseMidrow(v,N)),E||(E=this.parsePAC(v,N)),E||(E=this.parseBackgroundAttributes(v,N)),!E&&(U=this.parseChars(v,N),U)){var H=this.currentChannel;if(H&&H>0){var F=this.channels[H];F.insertChars(U)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!U&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+d([v,N])+" orig: "+d([C[A],C[A+1]]))}},b.parseCmd=function(f,C){var E=this.cmdHistory,v=(f===20||f===28||f===21||f===29)&&C>=32&&C<=47,N=(f===23||f===31)&&C>=33&&C<=35;if(!(v||N))return!1;if(L(f,C,E))return x(null,null,E),this.logger.log(c.DEBUG,"Repeated command ("+d([f,C])+") is dropped"),!0;var U=f===20||f===21||f===23?1:2,A=this.channels[U];return f===20||f===21||f===28||f===29?C===32?A.ccRCL():C===33?A.ccBS():C===34?A.ccAOF():C===35?A.ccAON():C===36?A.ccDER():C===37?A.ccRU(2):C===38?A.ccRU(3):C===39?A.ccRU(4):C===40?A.ccFON():C===41?A.ccRDC():C===42?A.ccTR():C===43?A.ccRTD():C===44?A.ccEDM():C===45?A.ccCR():C===46?A.ccENM():C===47&&A.ccEOC():A.ccTO(C-32),x(f,C,E),this.currentChannel=U,!0},b.parseMidrow=function(f,C){var E=0;if((f===17||f===25)&&C>=32&&C<=47){if(f===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var v=this.channels[E];return v?(v.ccMIDROW(C),this.logger.log(c.DEBUG,"MIDROW ("+d([f,C])+")"),!0):!1}return!1},b.parsePAC=function(f,C){var E,v=this.cmdHistory,N=(f>=17&&f<=23||f>=25&&f<=31)&&C>=64&&C<=127,U=(f===16||f===24)&&C>=64&&C<=95;if(!(N||U))return!1;if(L(f,C,v))return x(null,null,v),!0;var A=f<=23?1:2;C>=64&&C<=95?E=A===1?n[f]:m[f]:E=A===1?D[f]:p[f];var H=this.channels[A];return H?(H.setPAC(this.interpretPAC(E,C)),x(f,C,v),this.currentChannel=A,!0):!1},b.interpretPAC=function(f,C){var E,v={color:null,italics:!1,indent:null,underline:!1,row:f};return C>95?E=C-96:E=C-64,v.underline=(E&1)===1,E<=13?v.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(v.italics=!0,v.color="white"):v.indent=Math.floor((E-16)/2)*4,v},b.parseChars=function(f,C){var E,v=null,N=null;if(f>=25?(E=2,N=f-8):(E=1,N=f),N>=17&&N<=19){var U;N===17?U=C+80:N===18?U=C+112:U=C+144,this.logger.log(c.INFO,"Special char '"+M(U)+"' in channel "+E),v=[U]}else f>=32&&f<=127&&(v=C===0?[f]:[f,C]);if(v){var A=d(v);this.logger.log(c.DEBUG,"Char codes = "+A.join(",")),x(f,C,this.cmdHistory)}return v},b.parseBackgroundAttributes=function(f,C){var E=(f===16||f===24)&&C>=32&&C<=47,v=(f===23||f===31)&&C>=45&&C<=47;if(!(E||v))return!1;var N,U={};f===16||f===24?(N=Math.floor((C-32)/2),U.background=h[N],C%2===1&&(U.background=U.background+"_semi")):C===45?U.background="transparent":(U.foreground="black",C===47&&(U.underline=!0));var A=f<=23?1:2,H=this.channels[A];return H.setBkgData(U),x(f,C,this.cmdHistory),!0},b.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var C=this.channels[f];C&&C.reset()}this.cmdHistory=O()},b.cueSplitAtTime=function(f){for(var C=0;C<this.channels.length;C++){var E=this.channels[C];E&&E.cueSplitAtTime(f)}},_}();function x(_,b,g){g.a=_,g.b=b}function L(_,b,g){return g.a===_&&g.b===b}function O(){return{a:null,b:null}}X.default=w},"./src/utils/codecs.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"isCodecType",function(){return j}),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 j(G,W){var n=V[W];return!!n&&n[G.slice(0,4)]===!0}function M(G,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/vttparser.ts"),j=P("./src/utils/webvtt-parser.ts"),M=P("./src/utils/texttrack-utils.ts"),G=/\s/,W={newCue:function(D,m,p,h){for(var c=[],o,d,i,a,r,s=self.VTTCue||self.TextTrackCue,S=0;S<h.rows.length;S++)if(o=h.rows[S],i=!0,a=0,r="",!o.isEmpty()){for(var w=0;w<o.chars.length;w++)G.test(o.chars[w].uchar)&&i?a++:(r+=o.chars[w].uchar,i=!1);o.cueStartTime=m,m===p&&(p+=1e-4),a>=16?a--:a++;var x=Object(V.fixLineBreaks)(r.trim()),L=Object(j.generateCueId)(m,p,x);(!D||!D.cues||!D.cues.getCueById(L))&&(d=new s(m,p,x),d.id=L,d.line=S+1,d.align="left",d.position=10+Math.min(80,Math.floor(a*8/32)*10),c.push(d))}return D&&c.length&&(c.sort(function(O,_){return O.line==="auto"||_.line==="auto"?0:O.line>8&&_.line>8?_.line-O.line:O.line-_.line}),c.forEach(function(O){return Object(M.addCueToTrack)(D,O)})),c}};X.default=W},"./src/utils/discontinuities.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"findFirstFragWithCC",function(){return G}),P.d(X,"shouldAlignOnDiscontinuities",function(){return W}),P.d(X,"findDiscontinuousReferenceFrag",function(){return n}),P.d(X,"adjustSlidingStart",function(){return m}),P.d(X,"alignStream",function(){return p}),P.d(X,"alignPDT",function(){return c}),P.d(X,"alignFragmentByPDTDelta",function(){return o}),P.d(X,"alignMediaPlaylistByPDT",function(){return d});var V=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts"),M=P("./src/controller/level-helper.ts");function G(i,a){for(var r=null,s=0,S=i.length;s<S;s++){var w=i[s];if(w&&w.cc===a){r=w;break}}return r}function W(i,a,r){return!!(a.details&&(r.endCC>r.startCC||i&&i.cc<r.startCC))}function n(i,a){var r=i.fragments,s=a.fragments;if(!s.length||!r.length){j.logger.log("No fragments to align");return}var S=G(r,s[0].cc);if(!S||S&&!S.startPTS){j.logger.log("No frag in previous level to align on");return}return S}function D(i,a){if(i){var r=i.start+a;i.start=i.startPTS=r,i.endPTS=r+i.duration}}function m(i,a){for(var r=a.fragments,s=0,S=r.length;s<S;s++)D(r[s],i);a.fragmentHint&&D(a.fragmentHint,i),a.alignedSliding=!0}function p(i,a,r){if(!a)return;h(i,r,a),!r.alignedSliding&&a.details&&c(r,a.details),!r.alignedSliding&&a.details&&!r.skippedSegments&&Object(M.adjustSliding)(a.details,r)}function h(i,a,r){if(W(i,r,a)){var s=n(r.details,a);s&&Object(V.isFiniteNumber)(s.start)&&(j.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),m(s.start,a))}}function c(i,a){if(!a.fragments.length||!i.hasProgramDateTime||!a.hasProgramDateTime)return;var r=a.fragments[0].programDateTime,s=i.fragments[0].programDateTime,S=(s-r)/1e3+a.fragments[0].start;S&&Object(V.isFiniteNumber)(S)&&(j.logger.log("Adjusting PTS using programDateTime delta "+(s-r)+"ms, sliding:"+S.toFixed(3)+" "+i.url+" "),m(S,i))}function o(i,a){var r=i.programDateTime;if(!r)return;var s=(r-a)/1e3;i.start=i.startPTS=s,i.endPTS=s+i.duration}function d(i,a){if(!a.fragments.length||!i.hasProgramDateTime||!a.hasProgramDateTime)return;var r=a.fragments[0].programDateTime,s=a.fragments[0].start,S=r-s*1e3;i.fragments.forEach(function(w){o(w,S)}),i.fragmentHint&&o(i.fragmentHint,S),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/ewma.ts"),j=function(){function M(W,n,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(W),this.fast_=new V.default(n)}var G=M.prototype;return G.update=function(n,D){var m=this.slow_,p=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new V.default(n,m.getEstimate(),m.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new V.default(D,p.getEstimate(),p.getTotalWeight()))},G.sample=function(n,D){n=Math.max(n,this.minDelayMs_);var m=8*D,p=n/1e3,h=m/p;this.fast_.sample(p,h),this.slow_.sample(p,h)},G.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},M}();X.default=j},"./src/utils/ewma.ts":function(Z,X,P){"use strict";P.r(X);var V=function(){function j(G,W,n){W===void 0&&(W=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=W,this.totalWeight_=n}var M=j.prototype;return M.sample=function(W,n){var D=Math.pow(this.alpha_,W);this.estimate_=n*(1-D)+D*this.estimate_,this.totalWeight_+=W},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},j}();X.default=V},"./src/utils/fetch-loader.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"fetchSupported",function(){return o});var V=P("./src/polyfills/number.ts"),j=P("./src/loader/load-stats.ts"),M=P("./src/demux/chunk-cache.ts");function G(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,p(s,S)}function W(s){var S=typeof Map=="function"?new Map:void 0;return W=function(x){if(x===null||!m(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(x))return S.get(x);S.set(x,L)}function L(){return n(x,arguments,h(this).constructor)}return L.prototype=Object.create(x.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),p(L,x)},W(s)}function n(s,S,w){return D()?n=Reflect.construct:n=function(L,O,_){var b=[null];b.push.apply(b,O);var g=Function.bind.apply(L,b),f=new g;return _&&p(f,_.prototype),f},n.apply(null,arguments)}function D(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function m(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function p(s,S){return p=Object.setPrototypeOf||function(x,L){return x.__proto__=L,x},p(s,S)}function h(s){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},h(s)}function c(){return c=Object.assign||function(s){for(var S=1;S<arguments.length;S++){var w=arguments[S];for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&(s[x]=w[x])}return s},c.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var d=function(){function s(w){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=w.fetchSetup||a,this.controller=new self.AbortController,this.stats=new j.LoadStats}var S=s.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(x,L,O){var _=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var g=i(x,this.controller.signal),f=O.onProgress,C=x.responseType==="arraybuffer",E=C?"byteLength":"length";this.context=x,this.config=L,this.callbacks=O,this.request=this.fetchSetup(x,g),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),O.onTimeout(b,x,_.response)},L.timeout),self.fetch(this.request).then(function(v){if(_.response=_.loader=v,!v.ok){var N=v.status,U=v.statusText;throw new r(U||"fetch, bad network response",N,v)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(v.headers.get("Content-Length")||"0"),f&&Object(V.isFiniteNumber)(L.highWaterMark)?_.loadProgressively(v,b,x,L.highWaterMark,f):C?v.arrayBuffer():v.text()}).then(function(v){var N=_.response;self.clearTimeout(_.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=v[E];var U={url:N.url,data:v};f&&!Object(V.isFiniteNumber)(L.highWaterMark)&&f(b,x,v,N),O.onSuccess(U,b,x,N)}).catch(function(v){if(self.clearTimeout(_.requestTimeout),b.aborted)return;var N=v.code||0;O.onError({code:N,text:v.message},x,v.details)})},S.getCacheAge=function(){var x=null;if(this.response){var L=this.response.headers.get("age");x=L?parseFloat(L):null}return x},S.loadProgressively=function(x,L,O,_,b){_===void 0&&(_=0);var g=new M.default,f=x.body.getReader(),C=function E(){return f.read().then(function(v){if(v.done)return g.dataLength&&b(L,O,g.flush(),x),Promise.resolve(new ArrayBuffer(0));var N=v.value,U=N.length;return L.loaded+=U,U<_||g.dataLength?(g.push(N),g.dataLength>=_&&b(L,O,g.flush(),x)):b(L,O,N,x),E()}).catch(function(){return Promise.reject()})};return C()},s}();function i(s,S){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(c({},s.headers))};return s.rangeEnd&&w.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),w}function a(s,S){return new self.Request(s.url,S)}var r=function(s){G(S,s);function S(w,x,L){var O;return O=s.call(this,w)||this,O.code=void 0,O.details=void 0,O.code=x,O.details=L,O}return S}(W(Error));X.default=d},"./src/utils/imsc1-ttml-parser.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"IMSC1_CODEC",function(){return m}),P.d(X,"parseIMSC1",function(){return o});var V=P("./src/utils/mp4-tools.ts"),j=P("./src/utils/vttparser.ts"),M=P("./src/utils/vttcue.ts"),G=P("./src/demux/id3.ts"),W=P("./src/utils/timescale-conversion.ts"),n=P("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(_){for(var b=1;b<arguments.length;b++){var g=arguments[b];for(var f in g)Object.prototype.hasOwnProperty.call(g,f)&&(_[f]=g[f])}return _},D.apply(this,arguments)}var m="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(_,b,g,f,C){var E=Object(V.findBox)(new Uint8Array(_),["mdat"]);if(E.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var v=E[0],N=Object(G.utf8ArrayToStr)(new Uint8Array(_,v.start,v.end-v.start)),U=Object(W.toTimescaleFromScale)(b,1,g);try{f(d(N,U))}catch(A){C(A)}}function d(_,b){var g=new DOMParser,f=g.parseFromString(_,"text/xml"),C=f.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},v=Object.keys(E).reduce(function(F,T){return F[T]=C.getAttribute("ttp:"+T)||E[T],F},{}),N=C.getAttribute("xml:space")!=="preserve",U=a(i(C,"styling","style")),A=a(i(C,"layout","region")),H=i(C,"body","[begin]");return[].map.call(H,function(F){var T=r(F,N);if(!T||!F.hasAttribute("begin"))return null;var z=x(F.getAttribute("begin"),v),Q=x(F.getAttribute("dur"),v),ne=x(F.getAttribute("end"),v);if(z===null)throw w(F);if(ne===null){if(Q===null)throw w(F);ne=z+Q}var se=new M.default(z-b,ne-b,T);se.id=Object(n.generateCueId)(se.startTime,se.endTime,se.text);var xe=A[F.getAttribute("region")],me=U[F.getAttribute("style")];se.position=10,se.size=80;var ve=s(xe,me),Oe=ve.textAlign;if(Oe){var Re=c[Oe];Re&&(se.lineAlign=Re),se.align=Oe}return D(se,ve),se}).filter(function(F){return F!==null})}function i(_,b,g){var f=_.getElementsByTagName(b)[0];return f?[].slice.call(f.querySelectorAll(g)):[]}function a(_){return _.reduce(function(b,g){var f=g.getAttribute("xml:id");return f&&(b[f]=g),b},{})}function r(_,b){return[].slice.call(_.childNodes).reduce(function(g,f,C){var E;return f.nodeName==="br"&&C?g+`
`:(E=f.childNodes)!==null&&E!==void 0&&E.length?r(f,b):b?g+f.textContent.trim().replace(/\s+/g," "):g+f.textContent},"")}function s(_,b){var g="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(C,E){var v=S(b,g,E)||S(_,g,E);return v&&(C[E]=v),C},{})}function S(_,b,g){return _.hasAttributeNS(b,g)?_.getAttributeNS(b,g):null}function w(_){return new Error("Could not parse ttml timestamp "+_)}function x(_,b){if(!_)return null;var g=Object(j.parseTimeStamp)(_);return g===null&&(p.test(_)?g=L(_,b):h.test(_)&&(g=O(_,b))),g}function L(_,b){var g=p.exec(_),f=(g[4]|0)+(g[5]|0)/b.subFrameRate;return(g[1]|0)*3600+(g[2]|0)*60+(g[3]|0)+f/b.frameRate}function O(_,b){var g=h.exec(_),f=Number(g[1]),C=g[2];switch(C){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/b.frameRate;case"t":return f/b.tickRate}return f}},"./src/utils/logger.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"enableLogs",function(){return n}),P.d(X,"logger",function(){return D});var V=function(){},j={trace:V,debug:V,log:V,warn:V,info:V,error:V},M=j;function G(m){var p=self.console[m];return p?p.bind(self.console,"["+m+"] >"):V}function W(m){for(var p=arguments.length,h=new Array(p>1?p-1:0),c=1;c<p;c++)h[c-1]=arguments[c];h.forEach(function(o){M[o]=m[o]?m[o].bind(m):G(o)})}function n(m){if(self.console&&m===!0||typeof m=="object"){W(m,"debug","log","info","warn","error");try{M.log()}catch(p){M=j}}else M=j}var D=M},"./src/utils/mediakeys-helper.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"KeySystems",function(){return V}),P.d(X,"requestMediaKeySystemAccess",function(){return j});var V;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(V||(V={}));var j=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Z,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(Z,X,P){"use strict";P.r(X),P.d(X,"bin2str",function(){return W}),P.d(X,"readUint16",function(){return n}),P.d(X,"readUint32",function(){return D}),P.d(X,"writeUint32",function(){return m}),P.d(X,"findBox",function(){return p}),P.d(X,"parseSegmentIndex",function(){return h}),P.d(X,"parseInitSegment",function(){return c}),P.d(X,"getStartDTS",function(){return o}),P.d(X,"getDuration",function(){return d}),P.d(X,"computeRawDurationFromSamples",function(){return i}),P.d(X,"offsetStartDTS",function(){return a}),P.d(X,"segmentValidRange",function(){return r}),P.d(X,"appendUint8Array",function(){return s});var V=P("./src/utils/typed-array.ts"),j=P("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,G=[].push;function W(S){return String.fromCharCode.apply(null,S)}function n(S,w){"data"in S&&(w+=S.start,S=S.data);var x=S[w]<<8|S[w+1];return x<0?65536+x:x}function D(S,w){"data"in S&&(w+=S.start,S=S.data);var x=S[w]<<24|S[w+1]<<16|S[w+2]<<8|S[w+3];return x<0?4294967296+x:x}function m(S,w,x){"data"in S&&(w+=S.start,S=S.data),S[w]=x>>24,S[w+1]=x>>16&255,S[w+2]=x>>8&255,S[w+3]=x&255}function p(S,w){var x=[];if(!w.length)return x;var L,O,_;"data"in S?(L=S.data,O=S.start,_=S.end):(L=S,O=0,_=L.byteLength);for(var b=O;b<_;){var g=D(L,b),f=W(L.subarray(b+4,b+8)),C=g>1?b+g:_;if(f===w[0])if(w.length===1)x.push({data:L,start:b+8,end:C});else{var E=p({data:L,start:b+8,end:C},w.slice(1));E.length&&G.apply(x,E)}b=C}return x}function h(S){var w=p(S,["moov"]),x=w[0],L=x?x.end:null,O=p(S,["sidx"]);if(!O||!O[0])return null;var _=[],b=O[0],g=b.data[0],f=g===0?8:16,C=D(b,f);f+=4;var E=0,v=0;g===0?f+=8:f+=16,f+=2;var N=b.end+v,U=n(b,f);f+=2;for(var A=0;A<U;A++){var H=f,F=D(b,H);H+=4;var T=F&2147483647,z=(F&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=D(b,H);H+=4,_.push({referenceSize:T,subsegmentDuration:Q,info:{duration:Q/C,start:N,end:N+T-1}}),N+=T,H+=4,f=H}return{earliestPresentationTime:E,timescale:C,version:g,referencesCount:U,references:_,moovEndOffset:L}}function c(S){for(var w=[],x=p(S,["moov","trak"]),L=0;L<x.length;L++){var O=x[L],_=p(O,["tkhd"])[0];if(_){var b=_.data[_.start],g=b===0?12:20,f=D(_,g),C=p(O,["mdia","mdhd"])[0];if(C){b=C.data[C.start],g=b===0?12:20;var E=D(C,g),v=p(O,["mdia","hdlr"])[0];if(v){var N=W(v.data.subarray(v.start+8,v.start+12)),U={soun:j.ElementaryStreamTypes.AUDIO,vide:j.ElementaryStreamTypes.VIDEO}[N];if(U){var A=p(O,["mdia","minf","stbl","stsd"])[0],H=void 0;A&&(H=W(A.data.subarray(A.start+12,A.start+16))),w[f]={timescale:E,type:U},w[U]={timescale:E,id:f,codec:H}}}}}}var F=p(S,["moov","mvex","trex"]);return F.forEach(function(T){var z=D(T,4),Q=w[z];Q&&(Q.default={duration:D(T,12),flags:D(T,20)})}),w}function o(S,w){return p(w,["moof","traf"]).reduce(function(x,L){var O=p(L,["tfdt"])[0],_=O.data[O.start],b=p(L,["tfhd"]).reduce(function(g,f){var C=D(f,4),E=S[C];if(E){var v=D(O,4);_===1&&(v*=Math.pow(2,32),v+=D(O,8));var N=E.timescale||9e4,U=v/N;if(isFinite(U)&&(g===null||U<g))return U}return g},null);return b!==null&&isFinite(b)&&(x===null||b<x)?b:x},null)||0}function d(S,w){for(var x=0,L=0,O=0,_=p(S,["moof","traf"]),b=0;b<_.length;b++){var g=_[b],f=p(g,["tfhd"])[0],C=D(f,4),E=w[C];if(!E)continue;var v=E.default,N=D(f,0)|(v==null?void 0:v.flags),U=v==null?void 0:v.duration;N&8&&(N&2?U=D(f,12):U=D(f,8));for(var A=E.timescale||9e4,H=p(g,["trun"]),F=0;F<H.length;F++){if(U){var T=D(H[F],4);x=U*T}else x=i(H[F]);E.type===j.ElementaryStreamTypes.VIDEO?L+=x/A:E.type===j.ElementaryStreamTypes.AUDIO&&(O+=x/A)}}if(L===0&&O===0){var z=h(S);if(z!=null&&z.references)return z.references.reduce(function(Q,ne){return Q+ne.info.duration||0},0)}return L||O}function i(S){var w=D(S,0),x=8;w&1&&(x+=4),w&4&&(x+=4);for(var L=0,O=D(S,4),_=0;_<O;_++){if(w&256){var b=D(S,x);L+=b,x+=4}w&512&&(x+=4),w&1024&&(x+=4),w&2048&&(x+=4)}return L}function a(S,w,x){p(w,["moof","traf"]).forEach(function(L){p(L,["tfhd"]).forEach(function(O){var _=D(O,4),b=S[_];if(!b)return;var g=b.timescale||9e4;p(L,["tfdt"]).forEach(function(f){var C=f.data[f.start],E=D(f,4);if(C===0)m(f,4,E-x*g);else{E*=Math.pow(2,32),E+=D(f,8),E-=x*g,E=Math.max(E,0);var v=Math.floor(E/(M+1)),N=Math.floor(E%(M+1));m(f,4,v),m(f,8,N)}})})})}function r(S){var w={valid:null,remainder:null},x=p(S,["moof"]);if(x){if(x.length<2)return w.remainder=S,w}else return w;var L=x[x.length-1];return w.valid=Object(V.sliceUint8)(S,0,L.start-8),w.remainder=Object(V.sliceUint8)(S,L.start-8),w}function s(S,w){var x=new Uint8Array(S.length+w.length);return x.set(S),x.set(w,S.length),x}},"./src/utils/output-filter.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function j(G,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=W}var M=j.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(W,n,D){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=n,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"sendAddTrackEvent",function(){return j}),P.d(X,"addCueToTrack",function(){return M}),P.d(X,"clearCurrentCues",function(){return G}),P.d(X,"removeCuesInRange",function(){return W}),P.d(X,"getCuesInRange",function(){return D});var V=P("./src/utils/logger.ts");function j(m,p){var h;try{h=new Event("addtrack")}catch(c){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=m,p.dispatchEvent(h)}function M(m,p){var h=m.mode;if(h==="disabled"&&(m.mode="hidden"),m.cues&&!m.cues.getCueById(p.id))try{if(m.addCue(p),!m.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(o){V.logger.debug("[texttrack-utils]: "+o);var c=new self.TextTrackCue(p.startTime,p.endTime,p.text);c.id=p.id,m.addCue(c)}h==="disabled"&&(m.mode=h)}function G(m){var p=m.mode;if(p==="disabled"&&(m.mode="hidden"),m.cues)for(var h=m.cues.length;h--;)m.removeCue(m.cues[h]);p==="disabled"&&(m.mode=p)}function W(m,p,h){var c=m.mode;if(c==="disabled"&&(m.mode="hidden"),m.cues&&m.cues.length>0)for(var o=D(m.cues,p,h),d=0;d<o.length;d++)m.removeCue(o[d]);c==="disabled"&&(m.mode=c)}function n(m,p){if(p<m[0].startTime)return 0;var h=m.length-1;if(p>m[h].endTime)return-1;for(var c=0,o=h;c<=o;){var d=Math.floor((o+c)/2);if(p<m[d].startTime)o=d-1;else if(p>m[d].startTime&&c<h)c=d+1;else return d}return m[c].startTime-p<p-m[o].startTime?c:o}function D(m,p,h){var c=[],o=n(m,p);if(o>-1)for(var d=o,i=m.length;d<i;d++){var a=m[d];if(a.startTime>=p&&a.endTime<=h)c.push(a);else if(a.startTime>h)return c}return c}},"./src/utils/time-ranges.ts":function(Z,X,P){"use strict";P.r(X);var V={toString:function(M){for(var G="",W=M.length,n=0;n<W;n++)G+="["+M.start(n).toFixed(3)+","+M.end(n).toFixed(3)+"]";return G}};X.default=V},"./src/utils/timescale-conversion.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"toTimescaleFromBase",function(){return j}),P.d(X,"toTimescaleFromScale",function(){return M}),P.d(X,"toMsFromMpegTsClock",function(){return G}),P.d(X,"toMpegTsClockFromTimescale",function(){return W});var V=9e4;function j(n,D,m,p){m===void 0&&(m=1),p===void 0&&(p=!1);var h=n*D*m;return p?Math.round(h):h}function M(n,D,m,p){return m===void 0&&(m=1),p===void 0&&(p=!1),j(n,D,1/m,p)}function G(n,D){return D===void 0&&(D=!1),j(n,1e3,1/V,D)}function W(n,D){return D===void 0&&(D=1),j(n,V,1/D)}},"./src/utils/typed-array.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"sliceUint8",function(){return V});function V(j,M,G){return Uint8Array.prototype.slice?j.slice(M,G):new Uint8Array(Array.prototype.slice.call(j,M,G))}},"./src/utils/vttcue.ts":function(Z,X,P){"use strict";P.r(X),X.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],j=["start","middle","end","left","right"];function M(m,p){if(typeof p!="string")return!1;if(!Array.isArray(m))return!1;var h=p.toLowerCase();return~m.indexOf(h)?h:!1}function G(m){return M(V,m)}function W(m){return M(j,m)}function n(m){for(var p=arguments.length,h=new Array(p>1?p-1:0),c=1;c<p;c++)h[c-1]=arguments[c];for(var o=1;o<arguments.length;o++){var d=arguments[o];for(var i in d)m[i]=d[i]}return m}function D(m,p,h){var c=this,o={enumerable:!0};c.hasBeenReset=!1;var d="",i=!1,a=m,r=p,s=h,S=null,w="",x=!0,L="auto",O="start",_=50,b="middle",g=50,f="middle";Object.defineProperty(c,"id",n({},o,{get:function(){return d},set:function(E){d=""+E}})),Object.defineProperty(c,"pauseOnExit",n({},o,{get:function(){return i},set:function(E){i=!!E}})),Object.defineProperty(c,"startTime",n({},o,{get:function(){return a},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");a=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},o,{get:function(){return r},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");r=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},o,{get:function(){return s},set:function(E){s=""+E,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},o,{get:function(){return S},set:function(E){S=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},o,{get:function(){return w},set:function(E){var v=G(E);if(v===!1)throw new SyntaxError("An invalid or illegal string was specified.");w=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},o,{get:function(){return x},set:function(E){x=!!E,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},o,{get:function(){return L},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},o,{get:function(){return O},set:function(E){var v=W(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");O=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},o,{get:function(){return _},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");_=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},o,{get:function(){return b},set:function(E){var v=W(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");b=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},o,{get:function(){return g},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");g=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},o,{get:function(){return f},set:function(E){var v=W(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");f=v,this.hasBeenReset=!0}})),c.displayState=void 0}return D.prototype.getCueAsHTML=function(){var m=self.WebVTT;return m.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"parseTimeStamp",function(){return M}),P.d(X,"fixLineBreaks",function(){return p}),P.d(X,"VTTParser",function(){return h});var V=P("./src/utils/vttcue.ts"),j=function(){function c(){}var o=c.prototype;return o.decode=function(i,a){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},c}();function M(c){function o(i,a,r,s){return(i|0)*3600+(a|0)*60+(r|0)+parseFloat(s||0)}var d=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?o(d[2],d[3],0,d[4]):o(d[1],d[2],d[3],d[4]):null}var G=function(){function c(){this.values=Object.create(null)}var o=c.prototype;return o.set=function(i,a){!this.get(i)&&a!==""&&(this.values[i]=a)},o.get=function(i,a,r){return r?this.has(i)?this.values[i]:a[r]:this.has(i)?this.values[i]:a},o.has=function(i){return i in this.values},o.alt=function(i,a,r){for(var s=0;s<r.length;++s)if(a===r[s]){this.set(i,a);break}},o.integer=function(i,a){/^-?\d+$/.test(a)&&this.set(i,parseInt(a,10))},o.percent=function(i,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var r=parseFloat(a);if(r>=0&&r<=100)return this.set(i,r),!0}return!1},c}();function W(c,o,d,i){var a=i?c.split(i):[c];for(var r in a){if(typeof a[r]!="string")continue;var s=a[r].split(d);if(s.length!==2)continue;var S=s[0],w=s[1];o(S,w)}}var n=new V.default(0,0,""),D=n.align==="middle"?"middle":"center";function m(c,o,d){var i=c;function a(){var S=M(c);if(S===null)throw new Error("Malformed timestamp: "+i);return c=c.replace(/^[^\sa-zA-Z-]+/,""),S}function r(S,w){var x=new G;W(S,function(_,b){var g;switch(_){case"region":for(var f=d.length-1;f>=0;f--)if(d[f].id===b){x.set(_,d[f].region);break}break;case"vertical":x.alt(_,b,["rl","lr"]);break;case"line":g=b.split(","),x.integer(_,g[0]),x.percent(_,g[0])&&x.set("snapToLines",!1),x.alt(_,g[0],["auto"]),g.length===2&&x.alt("lineAlign",g[1],["start",D,"end"]);break;case"position":g=b.split(","),x.percent(_,g[0]),g.length===2&&x.alt("positionAlign",g[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":x.percent(_,b);break;case"align":x.alt(_,b,["start",D,"end","left","right"]);break}},/:/,/\s/),w.region=x.get("region",null),w.vertical=x.get("vertical","");var L=x.get("line","auto");L==="auto"&&n.line===-1&&(L=-1),w.line=L,w.lineAlign=x.get("lineAlign","start"),w.snapToLines=x.get("snapToLines",!0),w.size=x.get("size",100),w.align=x.get("align",D);var O=x.get("position","auto");O==="auto"&&n.position===50&&(O=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=O}function s(){c=c.replace(/^\s+/,"")}if(s(),o.startTime=a(),s(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);c=c.substr(3),s(),o.endTime=a(),s(),r(c,o)}function p(c){return c.replace(/<br(?: \/)?>/gi,`
`)}var h=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new j,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=c.prototype;return o.parse=function(i){var a=this;i&&(a.buffer+=a.decoder.decode(i,{stream:!0}));function r(){var O=a.buffer,_=0;for(O=p(O);_<O.length&&O[_]!=="\r"&&O[_]!==`
`;)++_;var b=O.substr(0,_);return O[_]==="\r"&&++_,O[_]===`
`&&++_,a.buffer=O.substr(_),b}function s(O){W(O,function(_,b){},/:/)}try{var S="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;S=r();var w=S.match(/^()?WEBVTT([ \t].*)?$/);if(!w||!w[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var x=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;x?x=!1:S=r();switch(a.state){case"HEADER":/:/.test(S)?s(S):S||(a.state="ID");continue;case"NOTE":S||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){a.state="NOTE";break}if(!S)continue;if(a.cue=new V.default(0,0,""),a.state="CUE",S.indexOf("-->")===-1){a.cue.id=S;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{m(S,a.cue,a.regionList)}catch(O){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var L=S.indexOf("-->")!==-1;if(!S||L&&(x=!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+=S}continue;case"BADCUE":S||(a.state="ID")}}}catch(O){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){i.onparsingerror&&i.onparsingerror(a)}return i.onflush&&i.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"generateCueId",function(){return h}),P.d(X,"parseWebVTT",function(){return o});var V=P("./src/polyfills/number.ts"),j=P("./src/utils/vttparser.ts"),M=P("./src/demux/id3.ts"),G=P("./src/utils/timescale-conversion.ts"),W=P("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,D=function(i,a,r){return r===void 0&&(r=0),i.substr(r,a.length)===a},m=function(i){var a=parseInt(i.substr(-3)),r=parseInt(i.substr(-6,2)),s=parseInt(i.substr(-9,2)),S=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(a)||!Object(V.isFiniteNumber)(r)||!Object(V.isFiniteNumber)(s)||!Object(V.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return a+=1e3*r,a+=60*1e3*s,a+=60*60*1e3*S,a},p=function(i){for(var a=5381,r=i.length;r;)a=a*33^i.charCodeAt(--r);return(a>>>0).toString()};function h(d,i,a){return p(d.toString())+p(i.toString())+p(a)}var c=function(i,a,r){var s=i[a],S=i[s.prevCC];if(!S||!S.new&&s.new){i.ccOffset=i.presentationOffset=s.start,s.new=!1;return}for(;(w=S)!==null&&w!==void 0&&w.new;){var w;i.ccOffset+=s.start-S.start,s.new=!1,s=S,S=i[s.prevCC]}i.presentationOffset=r};function o(d,i,a,r,s,S,w,x){var L=new j.VTTParser,O=Object(M.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
`).split(`
`),_=[],b=Object(G.toMpegTsClockFromTimescale)(i,a),g="00:00.000",f=0,C=0,E,v=!0,N=!1;L.oncue=function(U){var A=r[s],H=r.ccOffset,F=(f-b)/9e4;if(A!=null&&A.new&&(C!==void 0?H=r.ccOffset=A.start:c(r,s,F)),F&&(H=F-r.presentationOffset),N){var T=U.endTime-U.startTime,z=Object(W.normalizePts)((U.startTime+H-C)*9e4,S*9e4)/9e4;U.startTime=z,U.endTime=z+T}var Q=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(Q)),U.id||(U.id=h(U.startTime,U.endTime,Q)),U.endTime>0&&_.push(U)},L.onparsingerror=function(U){E=U},L.onflush=function(){if(E){x(E);return}w(_)},O.forEach(function(U){if(v)if(D(U,"X-TIMESTAMP-MAP=")){v=!1,N=!0,U.substr(16).split(",").forEach(function(A){D(A,"LOCAL:")?g=A.substr(6):D(A,"MPEGTS:")&&(f=parseInt(A.substr(7)))});try{C=m(g)/1e3}catch(A){N=!1,E=A}return}else U===""&&(v=!1);L.parse(U+`
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/logger.ts"),j=P("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,G=function(){function W(D){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=D?D.xhrSetup:null,this.stats=new j.LoadStats,this.retryDelay=0}var n=W.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var m=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),m&&(m.onreadystatechange=null,m.onprogress=null,m.readyState!==4&&(this.stats.aborted=!0,m.abort()))},n.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(m,p,h){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=m,this.config=p,this.callbacks=h,this.retryDelay=p.retryDelay,this.loadInternal()},n.loadInternal=function(){var m=this.config,p=this.context;if(!m)return;var h=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var o=this.xhrSetup;try{if(o)try{o(h,p.url)}catch(a){h.open("GET",p.url,!0),o(h,p.url)}h.readyState||h.open("GET",p.url,!0);var d=this.context.headers;if(d)for(var i in d)h.setRequestHeader(i,d[i])}catch(a){this.callbacks.onError({code:h.status,text:a.message},p,h);return}p.rangeEnd&&h.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout),h.send()},n.readystatechange=function(){var m=this.context,p=this.loader,h=this.stats;if(!m||!p)return;var c=p.readyState,o=this.config;if(h.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),h.loading.first===0&&(h.loading.first=Math.max(self.performance.now(),h.loading.start)),c===4){p.onreadystatechange=null,p.onprogress=null;var d=p.status;if(d>=200&&d<300){h.loading.end=Math.max(self.performance.now(),h.loading.first);var i,a;if(m.responseType==="arraybuffer"?(i=p.response,a=i.byteLength):(i=p.responseText,a=i.length),h.loaded=h.total=a,!this.callbacks)return;var r=this.callbacks.onProgress;if(r&&r(h,m,i,p),!this.callbacks)return;var s={url:p.responseURL,data:i};this.callbacks.onSuccess(s,h,m,p)}else h.retry>=o.maxRetry||d>=400&&d<499?(V.logger.error(d+" while loading "+m.url),this.callbacks.onError({code:d,text:p.statusText},m,p)):(V.logger.warn(d+" while loading "+m.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),h.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},n.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var m=this.callbacks;m&&(this.abortInternal(),m.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(m){var p=this.stats;p.loaded=m.loaded,m.lengthComputable&&(p.total=m.total)},n.getCacheAge=function(){var m=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");m=p?parseFloat(p):null}return m},W}();X.default=G}}).default})},vHTk:function(Fe,oe,k){Fe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return mt});var Z=k("rePB"),X=k("VTBJ"),P=k("KQm4"),V=k("U8pU"),j=k("ODXe"),M=k("q1tI"),G=k("TSYQ"),W=k.n(G),n=k("Gytx"),D=k.n(n),m=k("Kwbf"),p=k("t23M"),h=k("qx4F"),c=k("6eGT"),o=k("IBYe"),d=k("Ff2n"),i=k("c+Xe"),a=k("fyJ8"),r=k("biw7");function s(Ae,Ce,Xe,Je,ke){var Ke=Xe[Ae]||{},ye=Xe[Ce]||{},ce,pe;Ke.fixed==="left"?ce=Je.left[Ae]:ye.fixed==="right"&&(pe=Je.right[Ce]);var ie=!1,ae=!1,de=!1,ge=!1,Te=Xe[Ce+1],De=Xe[Ae-1];if(ke==="rtl"){if(ce!==void 0){var Ze=De&&De.fixed==="left";ge=!Ze}else if(pe!==void 0){var pt=Te&&Te.fixed==="right";de=!pt}}else if(ce!==void 0){var Ot=Te&&Te.fixed==="left";ie=!Ot}else if(pe!==void 0){var yt=De&&De.fixed==="right";ae=!yt}return{fixLeft:ce,fixRight:pe,lastFixLeft:ie,firstFixRight:ae,lastFixRight:de,firstFixLeft:ge,isSticky:Je.isSticky}}var S=k("sR1s");function w(Ae){var Ce=Ae.cells,Xe=Ae.stickyOffsets,Je=Ae.flattenColumns,ke=Ae.rowComponent,Ke=Ae.cellComponent,ye=Ae.onHeaderRow,ce=Ae.index,pe=M.useContext(r.a),ie=pe.prefixCls,ae=pe.direction,de;ye&&(de=ye(Ce.map(function(Te){return Te.column}),ce));var ge=Object(S.a)(Ce.map(function(Te){return Te.column}));return M.createElement(ke,Object.assign({},de),Ce.map(function(Te,De){var Ze=Te.column,pt=s(Te.colStart,Te.colEnd,Je,Xe,ae),Ot;return Ze&&Ze.onHeaderCell&&(Ot=Te.column.onHeaderCell(Ze)),M.createElement(a.a,Object.assign({},Te,{ellipsis:Ze.ellipsis,align:Ze.align,component:Ke,prefixCls:ie,key:ge[De]},pt,{additionalProps:Ot,rowType:"header"}))}))}w.displayName="HeaderRow";var x=w;function L(Ae){var Ce=[];function Xe(ye,ce){var pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ce[pe]=Ce[pe]||[];var ie=ce,ae=ye.filter(Boolean).map(function(de){var ge={key:de.key,className:de.className||"",children:de.title,column:de,colStart:ie},Te=1,De=de.children;return De&&De.length>0&&(Te=Xe(De,ie,pe+1).reduce(function(Ze,pt){return Ze+pt},0),ge.hasSubColumns=!0),"colSpan"in de&&(Te=de.colSpan),"rowSpan"in de&&(ge.rowSpan=de.rowSpan),ge.colSpan=Te,ge.colEnd=ge.colStart+Te-1,Ce[pe].push(ge),ie+=Te,Te});return ae}Xe(Ae,0);for(var Je=Ce.length,ke=function(ce){Ce[ce].forEach(function(pe){!("rowSpan"in pe)&&!pe.hasSubColumns&&(pe.rowSpan=Je-ce)})},Ke=0;Ke<Je;Ke+=1)ke(Ke);return Ce}function O(Ae){var Ce=Ae.stickyOffsets,Xe=Ae.columns,Je=Ae.flattenColumns,ke=Ae.onHeaderRow,Ke=M.useContext(r.a),ye=Ke.prefixCls,ce=Ke.getComponent,pe=M.useMemo(function(){return L(Xe)},[Xe]),ie=ce(["header","wrapper"],"thead"),ae=ce(["header","row"],"tr"),de=ce(["header","cell"],"th");return M.createElement(ie,{className:"".concat(ye,"-thead")},pe.map(function(ge,Te){var De=M.createElement(x,{key:Te,flattenColumns:Je,cells:ge,stickyOffsets:Ce,rowComponent:ae,cellComponent:de,onHeaderRow:ke,index:Te});return De}))}var _=O,b=k("hW8S");function g(Ae){for(var Ce=Ae.colWidths,Xe=Ae.columns,Je=Ae.columCount,ke=[],Ke=Je||Xe.length,ye=!1,ce=Ke-1;ce>=0;ce-=1){var pe=Ce[ce],ie=Xe&&Xe[ce],ae=ie&&ie[b.a];(pe||ae||ye)&&(ke.unshift(M.createElement("col",Object.assign({key:ce,style:{width:pe,minWidth:pe}},ae))),ye=!0)}return M.createElement("colgroup",null,ke)}var f=g;function C(Ae,Ce){return Object(M.useMemo)(function(){for(var Xe=[],Je=0;Je<Ce;Je+=1){var ke=Ae[Je];if(ke!==void 0)Xe[Je]=ke;else return null}return Xe},[Ae.join("_"),Ce])}var E=M.forwardRef(function(Ae,Ce){var Xe=Ae.noData,Je=Ae.columns,ke=Ae.flattenColumns,Ke=Ae.colWidths,ye=Ae.columCount,ce=Ae.stickyOffsets,pe=Ae.direction,ie=Ae.fixHeader,ae=Ae.offsetHeader,de=Ae.stickyClassName,ge=Ae.onScroll,Te=Object(d.a)(Ae,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),De=M.useContext(r.a),Ze=De.prefixCls,pt=De.scrollbarSize,Ot=De.isSticky,yt=Ot&&!ie?0:pt,ot=M.useRef(null),He=M.useCallback(function(ht){Object(i.b)(Ce,ht),Object(i.b)(ot,ht)},[]);M.useEffect(function(){var ht;function ft(Ie){var $e=Ie.currentTarget,xt=Ie.deltaX;xt&&(ge({currentTarget:$e,scrollLeft:$e.scrollLeft+xt}),Ie.preventDefault())}return(ht=ot.current)===null||ht===void 0||ht.addEventListener("wheel",ft),function(){var Ie;(Ie=ot.current)===null||Ie===void 0||Ie.removeEventListener("wheel",ft)}},[]);var Ge=ke[ke.length-1],Ue={fixed:Ge?Ge.fixed:null,onHeaderCell:function(){return{className:"".concat(Ze,"-cell-scrollbar")}}},le=Object(M.useMemo)(function(){return yt?[].concat(Object(P.a)(Je),[Ue]):Je},[yt,Je]),_e=Object(M.useMemo)(function(){return yt?[].concat(Object(P.a)(ke),[Ue]):ke},[yt,ke]),Ve=Object(M.useMemo)(function(){var ht=ce.right,ft=ce.left;return Object(X.a)(Object(X.a)({},ce),{},{left:pe==="rtl"?[].concat(Object(P.a)(ft.map(function(Ie){return Ie+yt})),[0]):ft,right:pe==="rtl"?ht:[].concat(Object(P.a)(ht.map(function(Ie){return Ie+yt})),[0]),isSticky:Ot})},[yt,ce,Ot]),je=C(Ke,ye);return M.createElement("div",{style:Object(X.a)({overflow:"hidden"},Ot?{top:ae}:{}),ref:He,className:W()("".concat(Ze,"-header"),Object(Z.a)({},de,!!de))},M.createElement("table",{style:{tableLayout:"fixed",visibility:Xe||je?null:"hidden"}},M.createElement(f,{colWidths:je?[].concat(Object(P.a)(je),[yt]):[],columCount:ye+1,columns:_e}),M.createElement(_,Object.assign({},Te,{stickyOffsets:Ve,columns:le,flattenColumns:_e}))))});E.displayName="FixedHeader";var v=E,N=M.createContext(null),U=N;function A(Ae){var Ce=Ae.prefixCls,Xe=Ae.children,Je=Ae.component,ke=Ae.cellComponent,Ke=Ae.fixHeader,ye=Ae.fixColumn,ce=Ae.horizonScroll,pe=Ae.className,ie=Ae.expanded,ae=Ae.componentWidth,de=Ae.colSpan,ge=M.useContext(r.a),Te=ge.scrollbarSize;return M.useMemo(function(){var De=Xe;return ye&&(De=M.createElement("div",{style:{width:ae-(Ke?Te:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ce,"-expanded-row-fixed")},De)),M.createElement(Je,{className:pe,style:{display:ie?null:"none"}},M.createElement(a.a,{component:ke,prefixCls:Ce,colSpan:de},De))},[Xe,Je,Ke,ce,pe,ie,ae,de,Te])}var H=A;function F(Ae){var Ce=Ae.className,Xe=Ae.style,Je=Ae.record,ke=Ae.index,Ke=Ae.rowKey,ye=Ae.getRowKey,ce=Ae.rowExpandable,pe=Ae.expandedKeys,ie=Ae.onRow,ae=Ae.indent,de=ae===void 0?0:ae,ge=Ae.rowComponent,Te=Ae.cellComponent,De=Ae.childrenColumnName,Ze=M.useContext(r.a),pt=Ze.prefixCls,Ot=Ze.fixedInfoList,yt=M.useContext(U),ot=yt.fixHeader,He=yt.fixColumn,Ge=yt.horizonScroll,Ue=yt.componentWidth,le=yt.flattenColumns,_e=yt.expandableType,Ve=yt.expandRowByClick,je=yt.onTriggerExpand,ht=yt.rowClassName,ft=yt.expandedRowClassName,Ie=yt.indentSize,$e=yt.expandIcon,xt=yt.expandedRowRender,Ft=yt.expandIconColumnIndex,ct=M.useState(!1),Ut=Object(j.a)(ct,2),$t=Ut[0],Vt=Ut[1],At=pe&&pe.has(Ae.recordKey);M.useEffect(function(){At&&Vt(!0)},[At]);var Tn=_e==="row"&&(!ce||ce(Je)),Fn=_e==="nest",Sn=De&&Je&&Je[De],Wt=Tn||Fn,hn;ie&&(hn=ie(Je,ke));var Mn=function(I){if(Ve&&Wt&&je(Je,I),hn&&hn.onClick){for(var R,K=arguments.length,ee=new Array(K>1?K-1:0),Y=1;Y<K;Y++)ee[Y-1]=arguments[Y];(R=hn).onClick.apply(R,[I].concat(ee))}},Bn;typeof ht=="string"?Bn=ht:typeof ht=="function"&&(Bn=ht(Je,ke,de));var ut=Object(S.a)(le),Ct=M.createElement(ge,Object.assign({},hn,{"data-row-key":Ke,className:W()(Ce,"".concat(pt,"-row"),"".concat(pt,"-row-level-").concat(de),Bn,hn&&hn.className),style:Object(X.a)(Object(X.a)({},Xe),hn?hn.style:null),onClick:Mn}),le.map(function(J,I){var R=J.render,K=J.dataIndex,ee=J.className,Y=ut[I],Ee=Ot[I],Ye;I===(Ft||0)&&Fn&&(Ye=M.createElement(M.Fragment,null,M.createElement("span",{style:{paddingLeft:"".concat(Ie*de,"px")},className:"".concat(pt,"-row-indent indent-level-").concat(de)}),$e({prefixCls:pt,expanded:At,expandable:Sn,record:Je,onExpand:je})));var lt;return J.onCell&&(lt=J.onCell(Je,ke)),M.createElement(a.a,Object.assign({className:ee,ellipsis:J.ellipsis,align:J.align,component:Te,prefixCls:pt,key:Y,record:Je,index:ke,dataIndex:K,render:R,shouldCellUpdate:J.shouldCellUpdate},Ee,{appendNode:Ye,additionalProps:lt}))})),Hn;if(Tn&&($t||At)){var pr=xt(Je,ke,de+1,At),ur=ft&&ft(Je,ke,de);Hn=M.createElement(H,{expanded:At,className:W()("".concat(pt,"-expanded-row"),"".concat(pt,"-expanded-row-level-").concat(de+1),ur),prefixCls:pt,fixHeader:ot,fixColumn:He,horizonScroll:Ge,component:ge,componentWidth:Ue,cellComponent:Te,colSpan:le.length},pr)}var kr;return Sn&&At&&(kr=(Je[De]||[]).map(function(J,I){var R=ye(J,I);return M.createElement(F,Object.assign({},Ae,{key:R,rowKey:R,record:J,recordKey:R,index:I,indent:de+1}))})),M.createElement(M.Fragment,null,Ct,Hn,kr)}F.displayName="BodyRow";var T=F,z=M.createContext(null),Q=z;function ne(Ae){var Ce=Ae.columnKey,Xe=Ae.onColumnResize,Je=M.useRef();return M.useEffect(function(){Je.current&&Xe(Ce,Je.current.offsetWidth)},[]),M.createElement(p.a,{onResize:function(Ke){var ye=Ke.offsetWidth;Xe(Ce,ye)}},M.createElement("td",{ref:Je,style:{padding:0,border:0,height:0}},M.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function se(Ae){var Ce=Ae.data,Xe=Ae.getRowKey,Je=Ae.measureColumnWidth,ke=Ae.expandedKeys,Ke=Ae.onRow,ye=Ae.rowExpandable,ce=Ae.emptyNode,pe=Ae.childrenColumnName,ie=M.useContext(Q),ae=ie.onColumnResize,de=M.useContext(r.a),ge=de.prefixCls,Te=de.getComponent,De=M.useContext(U),Ze=De.fixHeader,pt=De.horizonScroll,Ot=De.flattenColumns,yt=De.componentWidth;return M.useMemo(function(){var ot=Te(["body","wrapper"],"tbody"),He=Te(["body","row"],"tr"),Ge=Te(["body","cell"],"td"),Ue;Ce.length?Ue=Ce.map(function(_e,Ve){var je=Xe(_e,Ve);return M.createElement(T,{key:je,rowKey:je,record:_e,recordKey:je,index:Ve,rowComponent:He,cellComponent:Ge,expandedKeys:ke,onRow:Ke,getRowKey:Xe,rowExpandable:ye,childrenColumnName:pe})}):Ue=M.createElement(H,{expanded:!0,className:"".concat(ge,"-placeholder"),prefixCls:ge,fixHeader:Ze,fixColumn:pt,horizonScroll:pt,component:He,componentWidth:yt,cellComponent:Ge,colSpan:Ot.length},ce);var le=Object(S.a)(Ot);return M.createElement(ot,{className:"".concat(ge,"-tbody")},Je&&M.createElement("tr",{"aria-hidden":"true",className:"".concat(ge,"-measure-row"),style:{height:0}},le.map(function(_e){return M.createElement(ne,{key:_e,columnKey:_e,onColumnResize:ae})})),Ue)},[Ce,ge,Ke,Je,ke,Xe,Te,yt,ce,Ot])}var xe=M.memo(se);xe.displayName="Body";var me=xe,ve=k("wRmb"),Oe=k("xEkU"),Re=k.n(Oe);function fe(Ae){var Ce=Object(M.useRef)(Ae),Xe=Object(M.useState)({}),Je=Object(j.a)(Xe,2),ke=Je[1],Ke=Object(M.useRef)(null),ye=Object(M.useRef)([]);function ce(pe){Ke.current===null&&(ye.current=[],Ke.current=Re()(function(){ye.current.forEach(function(ie){Ce.current=ie(Ce.current)}),Ke.current=null,ke({})})),ye.current.push(pe)}return Object(M.useEffect)(function(){return function(){Re.a.cancel(Ke.current)}},[]),[Ce.current,ce]}function ue(Ae){var Ce=Object(M.useRef)(Ae),Xe=Object(M.useRef)(null);function Je(){window.clearTimeout(Xe.current)}function ke(ye){Ce.current=ye,Je(),Xe.current=window.setTimeout(function(){Ce.current=null,Xe.current=null},100)}function Ke(){return Ce.current}return Object(M.useEffect)(function(){return Je},[]),[ke,Ke]}function Pe(Ae,Ce,Xe){var Je=Object(M.useMemo)(function(){for(var ke=[],Ke=[],ye=0,ce=0,pe=0;pe<Ce;pe+=1)if(Xe==="rtl"){Ke[pe]=ce,ce+=Ae[pe]||0;var ie=Ce-pe-1;ke[ie]=ye,ye+=Ae[ie]||0}else{ke[pe]=ye,ye+=Ae[pe]||0;var ae=Ce-pe-1;Ke[ae]=ce,ce+=Ae[ae]||0}return{left:ke,right:Ke}},[Ae,Ce,Xe]);return Je}var et=Pe;function rt(Ae){var Ce=Ae.className,Xe=Ae.children;return M.createElement("div",{className:Ce},Xe)}var tt=rt,it=k("n6Qo");function ze(Ae){var Ce,Xe=Ae.prefixCls,Je=Ae.record,ke=Ae.onExpand,Ke=Ae.expanded,ye=Ae.expandable,ce="".concat(Xe,"-row-expand-icon");if(!ye)return M.createElement("span",{className:W()(ce,"".concat(Xe,"-row-spaced"))});var pe=function(ae){ke(Je,ae),ae.stopPropagation()};return M.createElement("span",{className:W()(ce,(Ce={},Object(Z.a)(Ce,"".concat(Xe,"-row-expanded"),Ke),Object(Z.a)(Ce,"".concat(Xe,"-row-collapsed"),!Ke),Ce)),onClick:pe})}function Qe(Ae,Ce,Xe){var Je=[];function ke(Ke){(Ke||[]).forEach(function(ye,ce){Je.push(Ce(ye,ce)),ke(ye[Xe])})}return ke(Ae),Je}var at=k("zT1h"),he=k("y0+3"),Se=function(Ce,Xe){var Je,ke,Ke=Ce.scrollBodyRef,ye=Ce.onScroll,ce=Ce.offsetScroll,pe=M.useContext(r.a),ie=pe.prefixCls,ae=((Je=Ke.current)===null||Je===void 0?void 0:Je.scrollWidth)||0,de=((ke=Ke.current)===null||ke===void 0?void 0:ke.clientWidth)||0,ge=ae&&de*(de/ae),Te=M.useRef(),De=fe({scrollLeft:0,isHiddenScrollBar:!1}),Ze=Object(j.a)(De,2),pt=Ze[0],Ot=Ze[1],yt=M.useRef({delta:0,x:0}),ot=M.useState(!1),He=Object(j.a)(ot,2),Ge=He[0],Ue=He[1],le=function(){Ue(!1)},_e=function(Ie){Ie.persist(),yt.current.delta=Ie.pageX-pt.scrollLeft,yt.current.x=0,Ue(!0),Ie.preventDefault()},Ve=function(Ie){var $e,xt=Ie||(($e=window)===null||$e===void 0?void 0:$e.event),Ft=xt.buttons;if(!Ge||Ft===0){Ge&&Ue(!1);return}var ct=yt.current.x+Ie.pageX-yt.current.x-yt.current.delta;ct<=0&&(ct=0),ct+ge>=de&&(ct=de-ge),ye({scrollLeft:ct/de*(ae+2)}),yt.current.x=Ie.pageX},je=function(){var Ie=Object(he.b)(Ke.current).top,$e=Ie+Ke.current.offsetHeight,xt=document.documentElement.scrollTop+window.innerHeight;$e-Object(h.a)()<=xt||Ie>=xt-ce?Ot(function(Ft){return Object(X.a)(Object(X.a)({},Ft),{},{isHiddenScrollBar:!0})}):Ot(function(Ft){return Object(X.a)(Object(X.a)({},Ft),{},{isHiddenScrollBar:!1})})},ht=function(Ie){Ot(function($e){return Object(X.a)(Object(X.a)({},$e),{},{scrollLeft:Ie/ae*de||0})})};return M.useImperativeHandle(Xe,function(){return{setScrollLeft:ht}}),M.useEffect(function(){var ft=Object(at.a)(document.body,"mouseup",le,!1),Ie=Object(at.a)(document.body,"mousemove",Ve,!1);return je(),function(){ft.remove(),Ie.remove()}},[ge,Ge]),M.useEffect(function(){var ft=Object(at.a)(window,"scroll",je,!1),Ie=Object(at.a)(window,"resize",je,!1);return function(){ft.remove(),Ie.remove()}},[]),M.useEffect(function(){pt.isHiddenScrollBar||Ot(function(ft){var Ie,$e;return Object(X.a)(Object(X.a)({},ft),{},{scrollLeft:Ke.current.scrollLeft/((Ie=Ke.current)===null||Ie===void 0?void 0:Ie.scrollWidth)*(($e=Ke.current)===null||$e===void 0?void 0:$e.clientWidth)})})},[pt.isHiddenScrollBar]),ae<=de||!ge||pt.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(h.a)(),width:de,bottom:ce},className:"".concat(ie,"-sticky-scroll")},M.createElement("div",{onMouseDown:_e,ref:Te,className:W()("".concat(ie,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(ie,"-sticky-scroll-bar-active"),Ge)),style:{width:"".concat(ge,"px"),transform:"translate3d(".concat(pt.scrollLeft,"px, 0, 0)")}}))},Le=M.forwardRef(Se);function Me(Ae,Ce){return M.useMemo(function(){var Xe=!!Ae;return{isSticky:Xe,stickyClassName:Xe?"".concat(Ce,"-sticky-header"):"",offsetHeader:Object(V.a)(Ae)==="object"&&Ae.offsetHeader||0,offsetScroll:Object(V.a)(Ae)==="object"&&Ae.offsetScroll||0}},[Ae,Ce])}var qe=[],st={},mt="rc-table-internal-hook",gt=M.memo(function(Ae){var Ce=Ae.children;return Ce},function(Ae,Ce){return D()(Ae.props,Ce.props)?Ae.pingLeft!==Ce.pingLeft||Ae.pingRight!==Ce.pingRight:!1});function St(Ae){var Ce,Xe=Ae.prefixCls,Je=Ae.className,ke=Ae.rowClassName,Ke=Ae.style,ye=Ae.data,ce=Ae.rowKey,pe=Ae.scroll,ie=Ae.tableLayout,ae=Ae.direction,de=Ae.title,ge=Ae.footer,Te=Ae.summary,De=Ae.id,Ze=Ae.showHeader,pt=Ae.components,Ot=Ae.emptyText,yt=Ae.onRow,ot=Ae.onHeaderRow,He=Ae.internalHooks,Ge=Ae.transformColumns,Ue=Ae.internalRefs,le=Ae.sticky,_e=ye||qe,Ve=!!_e.length,je=M.useState(0),ht=Object(j.a)(je,2),ft=ht[0],Ie=ht[1];M.useEffect(function(){Ie(Object(h.a)())});var $e=M.useMemo(function(){return Object(S.c)(pt,{})},[pt]),xt=M.useCallback(function(xn,pn){return Object(S.b)($e,xn)||pn},[$e]),Ft=M.useMemo(function(){return typeof ce=="function"?ce:function(xn){var pn=xn&&xn[ce];return pn}},[ce]),ct=Object(b.c)(Ae),Ut=ct.expandIcon,$t=ct.expandedRowKeys,Vt=ct.defaultExpandedRowKeys,At=ct.defaultExpandAllRows,Tn=ct.expandedRowRender,Fn=ct.onExpand,Sn=ct.onExpandedRowsChange,Wt=ct.expandRowByClick,hn=ct.rowExpandable,Mn=ct.expandIconColumnIndex,Bn=ct.expandedRowClassName,ut=ct.childrenColumnName,Ct=ct.indentSize,Hn=Ut||ze,pr=ut||"children",ur=M.useMemo(function(){return Tn?"row":Ae.expandable&&He===mt&&Ae.expandable.__PARENT_RENDER_ICON__||_e.some(function(xn){return xn&&Object(V.a)(xn)==="object"&&xn[pr]})?"nest":!1},[!!Tn,_e]),kr=M.useState(function(){return Vt||(At?Qe(_e,Ft,pr):[])}),J=Object(j.a)(kr,2),I=J[0],R=J[1],K=M.useMemo(function(){return new Set($t||I||[])},[$t,I]),ee=M.useCallback(function(xn){var pn=Ft(xn,_e.indexOf(xn)),yn,gr=K.has(pn);gr?(K.delete(pn),yn=Object(P.a)(K)):yn=[].concat(Object(P.a)(K),[pn]),R(yn),Fn&&Fn(!gr,xn),Sn&&Sn(yn)},[Ft,K,_e,Fn,Sn]),Y=M.useState(0),Ee=Object(j.a)(Y,2),Ye=Ee[0],lt=Ee[1],vt=Object(ve.b)(Object(X.a)(Object(X.a)(Object(X.a)({},Ae),ct),{},{expandable:!!Tn,expandedKeys:K,getRowKey:Ft,onTriggerExpand:ee,expandIcon:Hn,expandIconColumnIndex:Mn,direction:ae}),He===mt?Ge:null),We=Object(j.a)(vt,2),_t=We[0],Lt=We[1],Mt=M.useMemo(function(){return{columns:_t,flattenColumns:Lt}},[_t,Lt]),en=M.useRef(),Rt=M.useRef(),nn=M.useRef(),tn=M.useState(!1),Pn=Object(j.a)(tn,2),Xt=Pn[0],On=Pn[1],An=M.useState(!1),Ln=Object(j.a)(An,2),wn=Ln[0],In=Ln[1],Gn=fe(new Map),ar=Object(j.a)(Gn,2),Xn=ar[0],_n=ar[1],Wn=Object(S.a)(Lt),fn=Wn.map(function(xn){return Xn.get(xn)}),gn=M.useMemo(function(){return fn},[fn.join("_")]),vn=et(gn,Lt.length,ae),Yt=pe&&Object(S.d)(pe.y),Tt=pe&&Object(S.d)(pe.x),Kt=Tt&&Lt.some(function(xn){var pn=xn.fixed;return pn}),bt=M.useRef(),qt=Me(le,Xe),kt=qt.isSticky,Yn=qt.offsetHeader,un=qt.offsetScroll,Qn=qt.stickyClassName,Kr,wr,Vr;Yt&&(wr={overflowY:"scroll",maxHeight:pe.y}),Tt&&(Kr={overflowX:"auto"},Yt||(wr={overflowY:"hidden"}),Vr={width:pe.x===!0?"auto":pe.x,minWidth:"100%"});var Nr=M.useCallback(function(xn,pn){_n(function(yn){var gr=new Map(yn);return gr.set(xn,pn),gr})},[]),Rr=ue(null),Gr=Object(j.a)(Rr,2),zn=Gr[0],Gt=Gr[1];function Xr(xn,pn){if(!pn)return;typeof pn=="function"?pn(xn):pn.scrollLeft!==xn&&(pn.scrollLeft=xn)}var br=function(pn){var yn=pn.currentTarget,gr=pn.scrollLeft,Qr=typeof gr=="number"?gr:yn.scrollLeft,qr=yn||st;if(!Gt()||Gt()===qr){var ri;zn(qr),Xr(Qr,Rt.current),Xr(Qr,nn.current),Xr(Qr,(ri=bt.current)===null||ri===void 0?void 0:ri.setScrollLeft)}if(yn){var Ti=yn.scrollWidth,ln=yn.clientWidth;On(Qr>0),In(Qr<Ti-ln)}},ni=function(){nn.current&&br({currentTarget:nn.current})},Bt=function(pn){var yn=pn.width;ni(),lt(en.current?en.current.offsetWidth:yn)};M.useEffect(function(){return ni},[]),M.useEffect(function(){Tt&&ni()},[Tt]),M.useEffect(function(){He===mt&&Ue&&(Ue.body.current=nn.current)});var Zt=xt(["table"],"table"),zt=M.useMemo(function(){return ie||(Kt?pe.x==="max-content"?"auto":"fixed":Yt||Lt.some(function(xn){var pn=xn.ellipsis;return pn})?"fixed":"auto")},[Yt,Kt,Lt,ie]),rn,on={colWidths:gn,columCount:Lt.length,stickyOffsets:vn,onHeaderRow:ot,fixHeader:Yt},Cn=M.useMemo(function(){return Ve?null:typeof Ot=="function"?Ot():Ot},[Ve,Ot]),cn=M.createElement(me,{data:_e,measureColumnWidth:Yt||Tt||kt,expandedKeys:K,rowExpandable:hn,getRowKey:Ft,onRow:yt,emptyNode:Cn,childrenColumnName:pr}),jn=M.createElement(f,{colWidths:Lt.map(function(xn){var pn=xn.width;return pn}),columns:Lt}),or=Te&&M.createElement(it.b,null,Te(_e)),an=xt(["body"]);if(Yt||kt){var _r;typeof an=="function"?(_r=an(_e,{scrollbarSize:ft,ref:nn,onScroll:br}),on.colWidths=Lt.map(function(xn,pn){var yn=xn.width,gr=pn===_t.length-1?yn-ft:yn;return typeof gr=="number"&&!Number.isNaN(gr)?gr:(Object(m.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):_r=M.createElement("div",{style:Object(X.a)(Object(X.a)({},Kr),wr),onScroll:br,ref:nn,className:W()("".concat(Xe,"-body"))},M.createElement(Zt,{style:Object(X.a)(Object(X.a)({},Vr),{},{tableLayout:zt})},jn,cn,or),kt&&M.createElement(Le,{ref:bt,offsetScroll:un,scrollBodyRef:nn,onScroll:br})),rn=M.createElement(M.Fragment,null,Ze!==!1&&M.createElement(v,Object.assign({noData:!_e.length},on,Mt,{direction:ae,offsetHeader:Yn,stickyClassName:Qn,ref:Rt,onScroll:br})),_r)}else rn=M.createElement("div",{style:Object(X.a)(Object(X.a)({},Kr),wr),className:W()("".concat(Xe,"-content")),onScroll:br,ref:nn},M.createElement(Zt,{style:Object(X.a)(Object(X.a)({},Vr),{},{tableLayout:zt})},jn,Ze!==!1&&M.createElement(_,Object.assign({},on,Mt)),cn,or));var En=Object(b.b)(Ae),qn=M.createElement("div",Object.assign({className:W()(Xe,Je,(Ce={},Object(Z.a)(Ce,"".concat(Xe,"-rtl"),ae==="rtl"),Object(Z.a)(Ce,"".concat(Xe,"-ping-left"),Xt),Object(Z.a)(Ce,"".concat(Xe,"-ping-right"),wn),Object(Z.a)(Ce,"".concat(Xe,"-layout-fixed"),ie==="fixed"),Object(Z.a)(Ce,"".concat(Xe,"-fixed-header"),Yt),Object(Z.a)(Ce,"".concat(Xe,"-fixed-column"),Kt),Object(Z.a)(Ce,"".concat(Xe,"-scroll-horizontal"),Tt),Object(Z.a)(Ce,"".concat(Xe,"-has-fix-left"),Lt[0]&&Lt[0].fixed),Object(Z.a)(Ce,"".concat(Xe,"-has-fix-right"),Lt[Lt.length-1]&&Lt[Lt.length-1].fixed==="right"),Ce)),style:Ke,id:De,ref:en},En),M.createElement(gt,{pingLeft:Xt,pingRight:wn,props:Object(X.a)(Object(X.a)({},Ae),{},{stickyOffsets:vn,mergedExpandedKeys:K})},de&&M.createElement(tt,{className:"".concat(Xe,"-title")},de(_e)),M.createElement("div",{className:"".concat(Xe,"-container")},rn),ge&&M.createElement(tt,{className:"".concat(Xe,"-footer")},ge(_e))));Tt&&(qn=M.createElement(p.a,{onResize:Bt},qn));var er=M.useMemo(function(){return{prefixCls:Xe,getComponent:xt,scrollbarSize:ft,direction:ae,fixedInfoList:Lt.map(function(xn,pn){return s(pn,pn,Lt,vn,ae)}),isSticky:kt}},[Xe,xt,ft,ae,Lt,vn,ae,kt]),mr=M.useMemo(function(){return Object(X.a)(Object(X.a)({},Mt),{},{tableLayout:zt,rowClassName:ke,expandedRowClassName:Bn,componentWidth:Ye,fixHeader:Yt,fixColumn:Kt,horizonScroll:Tt,expandIcon:Hn,expandableType:ur,expandRowByClick:Wt,expandedRowRender:Tn,onTriggerExpand:ee,expandIconColumnIndex:Mn,indentSize:Ct})},[Mt,zt,ke,Bn,Ye,Yt,Kt,Tt,Hn,ur,Wt,Tn,ee,Mn,Ct]),Wi=M.useMemo(function(){return{onColumnResize:Nr}},[Nr]);return M.createElement(r.a.Provider,{value:er},M.createElement(U.Provider,{value:mr},M.createElement(Q.Provider,{value:Wi},qn)))}St.Column=o.a,St.ColumnGroup=c.a,St.Summary=it.a,St.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Et=oe.b=St},wRmb:function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return D});var Z=k("rePB"),X=k("KQm4"),P=k("VTBJ"),V=k("Ff2n"),j=k("q1tI"),M=k.n(j),G=k("Kwbf"),W=k("Zm9Q"),n=k("hW8S");function D(o){return Object(W.a)(o).filter(function(d){return j.isValidElement(d)}).map(function(d){var i=d.key,a=d.props,r=a.children,s=Object(V.a)(a,["children"]),S=Object(P.a)({key:i},s);return r&&(S.children=D(r)),S})}function m(o){return o.reduce(function(d,i){var a=i.fixed,r=a===!0?"left":a,s=i.children;return s&&s.length>0?[].concat(Object(X.a)(d),Object(X.a)(m(s).map(function(S){return Object(P.a)({fixed:r},S)}))):[].concat(Object(X.a)(d),[Object(P.a)(Object(P.a)({},i),{},{fixed:r})])},[])}function p(o){for(var d=!0,i=0;i<o.length;i+=1){var a=o[i];if(d&&a.fixed!=="left")d=!1;else if(!d&&a.fixed==="left"){Object(G.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var r=!0,s=o.length-1;s>=0;s-=1){var S=o[s];if(r&&S.fixed!=="right")r=!1;else if(!r&&S.fixed==="right"){Object(G.a)(!1,"Index ".concat(s+1," of `columns` missing `fixed='right'` prop."));break}}}function h(o){return o.map(function(d){var i=d.fixed,a=Object(V.a)(d,["fixed"]),r=i;return i==="left"?r="right":i==="right"&&(r="left"),Object(P.a)({fixed:r},a)})}function c(o,d){var i=o.prefixCls,a=o.columns,r=o.children,s=o.expandable,S=o.expandedKeys,w=o.getRowKey,x=o.onTriggerExpand,L=o.expandIcon,O=o.rowExpandable,_=o.expandIconColumnIndex,b=o.direction,g=o.expandRowByClick,f=j.useMemo(function(){return a||D(r)},[a,r]),C=j.useMemo(function(){if(s){var N,U=_||0,A=f[U],H=(N={},Object(Z.a)(N,n.a,{className:"".concat(i,"-expand-icon-col")}),Object(Z.a)(N,"title",""),Object(Z.a)(N,"fixed",A?A.fixed:null),Object(Z.a)(N,"className","".concat(i,"-row-expand-icon-cell")),Object(Z.a)(N,"render",function(z,Q,ne){var se=w(Q,ne),xe=S.has(se),me=O?O(Q):!0,ve=L({prefixCls:i,expanded:xe,expandable:me,record:Q,onExpand:x});return g?j.createElement("span",{onClick:function(Re){return Re.stopPropagation()}},ve):ve}),N),F=f.slice();return U>=0&&F.splice(U,0,H),F}return f},[s,f,w,S,L,b]),E=j.useMemo(function(){var N=C;return d&&(N=d(N)),N.length||(N=[{render:function(){return null}}]),N},[d,C,b]),v=j.useMemo(function(){return b==="rtl"?h(m(E)):m(E)},[E,b]);return[E,v]}oe.b=c},"y0+3":function(Fe,oe,k){"use strict";k.d(oe,"a",function(){return m}),k.d(oe,"b",function(){return h});var Z=/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 j(c,o,d){if(o=o.toLowerCase(),d==="auto"){if(o==="height")return c.offsetHeight;if(o==="width")return c.offsetWidth}return o in X||(X[o]=Z.test(o)),X[o]?parseFloat(d)||0:d}function M(c,o){var d=arguments.length,i=V(c);return o=P[o]?"cssFloat"in c.style?"cssFloat":"styleFloat":o,d===1?i:j(c,o,i[o]||c.style[o])}function G(c,o,d){var i=arguments.length;if(o=P[o]?"cssFloat"in c.style?"cssFloat":"styleFloat":o,i===3)return typeof d=="number"&&Z.test(o)&&(d="".concat(d,"px")),c.style[o]=d,d;for(var a in o)o.hasOwnProperty(a)&&G(c,a,o[a]);return V(c)}function W(c){return c===document.body?document.documentElement.clientWidth:c.offsetWidth}function n(c){return c===document.body?window.innerHeight||document.documentElement.clientHeight:c.offsetHeight}function D(){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:o}}function m(){var c=document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:o}}function p(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function h(c){var o=c.getBoundingClientRect(),d=document.documentElement;return{left:o.left+(window.pageXOffset||d.scrollLeft)-(d.clientLeft||document.body.clientLeft||0),top:o.top+(window.pageYOffset||d.scrollTop)-(d.clientTop||document.body.clientTop||0)}}},ynwM:function(Fe,oe,k){var Z=k("MFOe"),X=Z.Global;Fe.exports={name:"oldFF-globalStorage",read:V,write:j,each:M,remove:G,clearAll:W};var P=X.globalStorage;function V(n){return P[n]}function j(n,D){P[n]=D}function M(n){for(var D=P.length-1;D>=0;D--){var m=P.key(D);n(P[m],m)}}function G(n){return P.removeItem(n)}function W(){M(function(n,D){delete P[n]})}}}]);