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.
122 lines
406 KiB
122 lines
406 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[148,6,7],{"+NIl":function(bt,Ye,C){(function(F){F(C("VrN/"))})(function(F){"use strict";F.defineMode("stex",function(ge,oe){"use strict";function Oe(le,W){le.cmdState.push(W)}function Ee(le){return le.cmdState.length>0?le.cmdState[le.cmdState.length-1]:null}function G(le){var W=le.cmdState.pop();W&&W.closeBracket()}function M(le){for(var W=le.cmdState,P=W.length-1;P>=0;P--){var U=W[P];if(U.name=="DEFAULT")continue;return U}return{styleIdentifier:function(){return null}}}function D(le,W,P){return function(){this.name=le,this.bracketNo=0,this.style=W,this.styles=P,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var S={};S.importmodule=D("importmodule","tag",["string","builtin"]),S.documentclass=D("documentclass","tag",["","atom"]),S.usepackage=D("usepackage","tag",["atom"]),S.begin=D("begin","tag",["atom"]),S.end=D("end","tag",["atom"]),S.label=D("label","tag",["atom"]),S.ref=D("ref","tag",["atom"]),S.eqref=D("eqref","tag",["atom"]),S.cite=D("cite","tag",["atom"]),S.bibitem=D("bibitem","tag",["atom"]),S.Bibitem=D("Bibitem","tag",["atom"]),S.RBibitem=D("RBibitem","tag",["atom"]),S.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function z(le,W){le.f=W}function $(le,W){var P;if(le.match(/^\\[a-zA-Z@]+/)){var U=le.current().slice(1);return P=S.hasOwnProperty(U)?S[U]:S.DEFAULT,P=new P,Oe(W,P),z(W,ye),P.style}if(le.match(/^\\[$&%#{}_]/))return"tag";if(le.match(/^\\[,;!\/\\]/))return"tag";if(le.match("\\["))return z(W,function(ie,Te){return re(ie,Te,"\\]")}),"keyword";if(le.match("\\("))return z(W,function(ie,Te){return re(ie,Te,"\\)")}),"keyword";if(le.match("$$"))return z(W,function(ie,Te){return re(ie,Te,"$$")}),"keyword";if(le.match("$"))return z(W,function(ie,Te){return re(ie,Te,"$")}),"keyword";var se=le.next();if(se=="%")return le.skipToEnd(),"comment";if(se=="}"||se=="]"){if(P=Ee(W),P)P.closeBracket(se),z(W,ye);else return"error";return"bracket"}else return se=="{"||se=="["?(P=S.DEFAULT,P=new P,Oe(W,P),"bracket"):/\d/.test(se)?(le.eatWhile(/[\w.%]/),"atom"):(le.eatWhile(/[\w\-_]/),P=M(W),P.name=="begin"&&(P.argument=le.current()),P.styleIdentifier())}function re(le,W,P){if(le.eatSpace())return null;if(P&&le.match(P))return z(W,$),"keyword";if(le.match(/^\\[a-zA-Z@]+/))return"tag";if(le.match(/^[a-zA-Z]+/))return"variable-2";if(le.match(/^\\[$&%#{}_]/))return"tag";if(le.match(/^\\[,;!\/]/))return"tag";if(le.match(/^[\^_&]/))return"tag";if(le.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(le.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var U=le.next();return U=="{"||U=="}"||U=="["||U=="]"||U=="("||U==")"?"bracket":U=="%"?(le.skipToEnd(),"comment"):"error"}function ye(le,W){var P=le.peek(),U;return P=="{"||P=="["?(U=Ee(W),U.openBracket(P),le.eat(P),z(W,$),"bracket"):/[ \t\r]/.test(P)?(le.eat(P),null):(z(W,$),G(W),$(le,W))}return{startState:function(){var le=oe.inMathMode?function(W,P){return re(W,P)}:$;return{cmdState:[],f:le}},copyState:function(le){return{cmdState:le.cmdState.slice(),f:le.f}},token:function(le,W){return W.f(le,W)},blankLine:function(le){le.f=$,le.cmdState.length=0},lineComment:"%"}}),F.defineMIME("text/x-stex","stex"),F.defineMIME("text/x-latex","stex")})},"19Vz":function(bt,Ye,C){(function(F){F(C("VrN/"))})(function(F){F.defineOption("placeholder","",function(D,S,z){var $=z&&z!=F.Init;if(S&&!$)D.on("blur",Ee),D.on("change",G),D.on("swapDoc",G),F.on(D.getInputField(),"compositionupdate",D.state.placeholderCompose=function(){Oe(D)}),G(D);else if(!S&&$){D.off("blur",Ee),D.off("change",G),D.off("swapDoc",G),F.off(D.getInputField(),"compositionupdate",D.state.placeholderCompose),ge(D);var re=D.getWrapperElement();re.className=re.className.replace(" CodeMirror-empty","")}S&&!D.hasFocus()&&Ee(D)});function ge(D){D.state.placeholder&&(D.state.placeholder.parentNode.removeChild(D.state.placeholder),D.state.placeholder=null)}function oe(D){ge(D);var S=D.state.placeholder=document.createElement("pre");S.style.cssText="height: 0; overflow: visible",S.style.direction=D.getOption("direction"),S.className="CodeMirror-placeholder CodeMirror-line-like";var z=D.getOption("placeholder");typeof z=="string"&&(z=document.createTextNode(z)),S.appendChild(z),D.display.lineSpace.insertBefore(S,D.display.lineSpace.firstChild)}function Oe(D){setTimeout(function(){var S=!1,z=D.getInputField();z.nodeName=="TEXTAREA"?S=!z.value:D.lineCount()==1&&(S=!/[^\u200b]/.test(z.querySelector(".CodeMirror-line").textContent)),S?oe(D):ge(D)},20)}function Ee(D){M(D)&&oe(D)}function G(D){var S=D.getWrapperElement(),z=M(D);S.className=S.className.replace(" CodeMirror-empty","")+(z?" CodeMirror-empty":""),z?oe(D):ge(D)}function M(D){return D.lineCount()===1&&D.getLine(0)===""}})},"1eCo":function(bt,Ye,C){(function(F){F(C("VrN/"))})(function(F){"use strict";var ge={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},oe={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};F.defineMode("xml",function(Oe,Ee){var G=Oe.indentUnit,M={},D=Ee.htmlMode?ge:oe;for(var S in D)M[S]=D[S];for(var S in Ee)M[S]=Ee[S];var z,$;function re(y,Z){function X(j){return Z.tokenize=j,j(y,Z)}var w=y.next();if(w=="<")return y.eat("!")?y.eat("[")?y.match("CDATA[")?X(W("atom","]]>")):null:y.match("--")?X(W("comment","-->")):y.match("DOCTYPE",!0,!0)?(y.eatWhile(/[\w\._\-]/),X(P(1))):null:y.eat("?")?(y.eatWhile(/[\w\._\-]/),Z.tokenize=W("meta","?>"),"meta"):(z=y.eat("/")?"closeTag":"openTag",Z.tokenize=ye,"tag bracket");if(w=="&"){var ee;return y.eat("#")?y.eat("x")?ee=y.eatWhile(/[a-fA-F\d]/)&&y.eat(";"):ee=y.eatWhile(/[\d]/)&&y.eat(";"):ee=y.eatWhile(/[\w\.\-:]/)&&y.eat(";"),ee?"atom":"error"}else return y.eatWhile(/[^&<]/),null}re.isInText=!0;function ye(y,Z){var X=y.next();if(X==">"||X=="/"&&y.eat(">"))return Z.tokenize=re,z=X==">"?"endTag":"selfcloseTag","tag bracket";if(X=="=")return z="equals",null;if(X=="<"){Z.tokenize=re,Z.state=Te,Z.tagName=Z.tagStart=null;var w=Z.tokenize(y,Z);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(X)?(Z.tokenize=le(X),Z.stringStartCol=y.column(),Z.tokenize(y,Z)):(y.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function le(y){var Z=function(X,w){for(;!X.eol();)if(X.next()==y){w.tokenize=ye;break}return"string"};return Z.isInAttribute=!0,Z}function W(y,Z){return function(X,w){for(;!X.eol();){if(X.match(Z)){w.tokenize=re;break}X.next()}return y}}function P(y){return function(Z,X){for(var w;(w=Z.next())!=null;){if(w=="<")return X.tokenize=P(y+1),X.tokenize(Z,X);if(w==">")if(y==1){X.tokenize=re;break}else return X.tokenize=P(y-1),X.tokenize(Z,X)}return"meta"}}function U(y,Z,X){this.prev=y.context,this.tagName=Z,this.indent=y.indented,this.startOfLine=X,(M.doNotIndent.hasOwnProperty(Z)||y.context&&y.context.noIndent)&&(this.noIndent=!0)}function se(y){y.context&&(y.context=y.context.prev)}function ie(y,Z){for(var X;;){if(!y.context)return;if(X=y.context.tagName,!M.contextGrabbers.hasOwnProperty(X)||!M.contextGrabbers[X].hasOwnProperty(Z))return;se(y)}}function Te(y,Z,X){return y=="openTag"?(X.tagStart=Z.column(),We):y=="closeTag"?pe:Te}function We(y,Z,X){return y=="word"?(X.tagName=Z.current(),$="tag",Q):M.allowMissingTagName&&y=="endTag"?($="tag bracket",Q(y,Z,X)):($="error",We)}function pe(y,Z,X){if(y=="word"){var w=Z.current();return X.context&&X.context.tagName!=w&&M.implicitlyClosed.hasOwnProperty(X.context.tagName)&&se(X),X.context&&X.context.tagName==w||M.matchClosing===!1?($="tag",be):($="tag error",Re)}else return M.allowMissingTagName&&y=="endTag"?($="tag bracket",be(y,Z,X)):($="error",Re)}function be(y,Z,X){return y!="endTag"?($="error",be):(se(X),Te)}function Re(y,Z,X){return $="error",be(y,Z,X)}function Q(y,Z,X){if(y=="word")return $="attribute",me;if(y=="endTag"||y=="selfcloseTag"){var w=X.tagName,ee=X.tagStart;return X.tagName=X.tagStart=null,y=="selfcloseTag"||M.autoSelfClosers.hasOwnProperty(w)?ie(X,w):(ie(X,w),X.context=new U(X,w,ee==X.indented)),Te}return $="error",Q}function me(y,Z,X){return y=="equals"?Ae:(M.allowMissing||($="error"),Q(y,Z,X))}function Ae(y,Z,X){return y=="string"?J:y=="word"&&M.allowUnquoted?($="string",Q):($="error",Q(y,Z,X))}function J(y,Z,X){return y=="string"?J:Q(y,Z,X)}return{startState:function(y){var Z={tokenize:re,state:Te,indented:y||0,tagName:null,tagStart:null,context:null};return y!=null&&(Z.baseIndent=y),Z},token:function(y,Z){if(!Z.tagName&&y.sol()&&(Z.indented=y.indentation()),y.eatSpace())return null;z=null;var X=Z.tokenize(y,Z);return(X||z)&&X!="comment"&&($=null,Z.state=Z.state(z||X,y,Z),$&&(X=$=="error"?X+" error":$)),X},indent:function(y,Z,X){var w=y.context;if(y.tokenize.isInAttribute)return y.tagStart==y.indented?y.stringStartCol+1:y.indented+G;if(w&&w.noIndent)return F.Pass;if(y.tokenize!=ye&&y.tokenize!=re)return X?X.match(/^(\s*)/)[0].length:0;if(y.tagName)return M.multilineTagIndentPastTag!==!1?y.tagStart+y.tagName.length+2:y.tagStart+G*(M.multilineTagIndentFactor||1);if(M.alignCDATA&&/<!\[CDATA\[/.test(Z))return 0;var ee=Z&&/^<(\/)?([\w_:\.-]*)/.exec(Z);if(ee&&ee[1])for(;w;)if(w.tagName==ee[2]){w=w.prev;break}else if(M.implicitlyClosed.hasOwnProperty(w.tagName))w=w.prev;else break;else if(ee)for(;w;){var j=M.contextGrabbers[w.tagName];if(j&&j.hasOwnProperty(ee[2]))w=w.prev;else break}for(;w&&w.prev&&!w.startOfLine;)w=w.prev;return w?w.indent+G:y.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:M.htmlMode?"html":"xml",helperType:M.htmlMode?"html":"xml",skipAttribute:function(y){y.state==Ae&&(y.state=Q)},xmlCurrentTag:function(y){return y.tagName?{name:y.tagName,close:y.type=="closeTag"}:null},xmlCurrentContext:function(y){for(var Z=[],X=y.context;X;X=X.prev)X.tagName&&Z.push(X.tagName);return Z.reverse()}}}),F.defineMIME("text/xml","xml"),F.defineMIME("application/xml","xml"),F.mimeModes.hasOwnProperty("text/html")||F.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7/Dv":function(bt,Ye,C){bt.exports={bg:"bg___2rJyo",head:"head___23PFV",formWrap:"formWrap___2b6uL"}},"7ahc":function(bt,Ye,C){"use strict";C.d(Ye,"a",function(){return We});var F=C("k1fw"),ge=C("0Owb"),oe=C("+L6B"),Oe=C("2/Rp"),Ee=C("y8nQ"),G=C("Vl3Y"),M=C("tJVT"),D=C("OaEy"),S=C("2fM7"),z=C("q1tI"),$=C.n(z),re=C("VrN/"),ye=C.n(re),le=C("p77/"),W=C.n(le),P=C("c5Ni"),U=C.n(P),se=S.a.Option,ie={labelCol:{span:4},wrapperCol:{span:20}},Te={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"]};Ye.b=function(pe){var be=pe.callback,Re=pe.onCancel,Q=Object(z.useState)("python"),me=Object(M.a)(Q,2),Ae=me[0],J=me[1];function y(X){J(Te[X][1])}function Z(X){be(X)}return $.a.createElement(G.a,Object(ge.a)({},ie,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Z}),$.a.createElement(G.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},$.a.createElement(S.a,{onChange:y},Object.keys(Te).map(function(X){return $.a.createElement(se,{key:X,value:X},Te[X][0])}))),$.a.createElement(G.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},$.a.createElement(We,{mode:Ae})),$.a.createElement("div",{className:"flex-container flex-end"},$.a.createElement(Oe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),$.a.createElement(Oe.a,{type:"ghost",onClick:Re},"\u53D6\u6D88")))};function We(pe){var be=pe.value,Re=pe.onChange,Q=pe.mode,me=pe.options,Ae=me===void 0?{}:me,J=Object(z.useRef)(),y=Object(z.useState)(),Z=Object(M.a)(y,2),X=Z[0],w=Z[1];return Object(z.useEffect)(function(){if(X){function ee(j){var A=j.getValue();Re&&Re(A)}return X.on("change",ee),function(){X.off("change",ee)}}},[X,Re]),Object(z.useEffect)(function(){X&&X.setOption("mode",Q)},[X,Q]),Object(z.useEffect)(function(){X&&((be!==X.getValue()||be==="")&&setTimeout(function(){X.setValue(be||" ")},300))},[X,be]),Object(z.useEffect)(function(){if(J.current&&!X){var ee=ye.a.fromTextArea(J.current,Object(F.a)({mode:Q,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Ae));w(ee)}},[J.current,X]),$.a.createElement("div",{className:"my-codemirror-container"},$.a.createElement("textarea",{ref:J}))}},"7ixt":function(bt,Ye,C){"use strict";C.d(Ye,"a",function(){return oe});var F={adjustX:1,adjustY:1},ge=[0,0],oe={left:{points:["cr","cl"],overflow:F,offset:[-4,0],targetOffset:ge},right:{points:["cl","cr"],overflow:F,offset:[4,0],targetOffset:ge},top:{points:["bc","tc"],overflow:F,offset:[0,-4],targetOffset:ge},bottom:{points:["tc","bc"],overflow:F,offset:[0,4],targetOffset:ge},topLeft:{points:["bl","tl"],overflow:F,offset:[0,-4],targetOffset:ge},leftTop:{points:["tr","tl"],overflow:F,offset:[-4,0],targetOffset:ge},topRight:{points:["br","tr"],overflow:F,offset:[0,-4],targetOffset:ge},rightTop:{points:["tl","tr"],overflow:F,offset:[4,0],targetOffset:ge},bottomRight:{points:["tr","br"],overflow:F,offset:[0,4],targetOffset:ge},rightBottom:{points:["bl","br"],overflow:F,offset:[4,0],targetOffset:ge},bottomLeft:{points:["tl","bl"],overflow:F,offset:[0,4],targetOffset:ge},leftBottom:{points:["br","bl"],overflow:F,offset:[-4,0],targetOffset:ge}},Oe=oe},"8EBN":function(bt,Ye,C){(function(F){F(C("VrN/"))})(function(F){"use strict";F.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 ge=0;ge<F.modeInfo.length;ge++){var oe=F.modeInfo[ge];oe.mimes&&(oe.mime=oe.mimes[0])}F.findModeByMIME=function(Oe){Oe=Oe.toLowerCase();for(var Ee=0;Ee<F.modeInfo.length;Ee++){var G=F.modeInfo[Ee];if(G.mime==Oe)return G;if(G.mimes){for(var M=0;M<G.mimes.length;M++)if(G.mimes[M]==Oe)return G}}if(/\+xml$/.test(Oe))return F.findModeByMIME("application/xml");if(/\+json$/.test(Oe))return F.findModeByMIME("application/json")},F.findModeByExtension=function(Oe){Oe=Oe.toLowerCase();for(var Ee=0;Ee<F.modeInfo.length;Ee++){var G=F.modeInfo[Ee];if(G.ext){for(var M=0;M<G.ext.length;M++)if(G.ext[M]==Oe)return G}}},F.findModeByFileName=function(Oe){for(var Ee=0;Ee<F.modeInfo.length;Ee++){var G=F.modeInfo[Ee];if(G.file&&G.file.test(Oe))return G}var M=Oe.lastIndexOf("."),D=M>-1&&Oe.substring(M+1,Oe.length);if(D)return F.findModeByExtension(D)},F.findModeByName=function(Oe){Oe=Oe.toLowerCase();for(var Ee=0;Ee<F.modeInfo.length;Ee++){var G=F.modeInfo[Ee];if(G.name.toLowerCase()==Oe)return G;if(G.alias){for(var M=0;M<G.alias.length;M++)if(G.alias[M].toLowerCase()==Oe)return G}}}})},"9Bee":function(bt,Ye,C){"use strict";var F=C("k1fw"),ge=C("tJVT"),oe=C("q1tI"),Oe=C.n(oe),Ee=C("vg9a"),G=C("DlQD"),M=C.n(G),D=C("rUJ1");function S(g,_){var N=g.match(/^(\s+)(?:```)/);if(N===null)return _;var de=N[1];return _.split(`
|
|
`).map(function(_e){var ae=_e.match(/^\s+/);if(ae===null)return _e;var Se=Object(ge.a)(ae,1),ue=Se[0];return ue.length>=de.length?_e.slice(de.length):_e}).join(`
|
|
`)}var z=[],$=["<ul>"],re=new M.a.Renderer,ye=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function le(){z.length=0,$=["<ul>"]}var W={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function P(g,_,N,de){if(_>=g.length||g[_].level<=N)return _;var _e=g[_];de.push("<li><a href='#"+_e.anchor+"'>"+_e.text+"</a>"),_++;var ae=[];return _=P(g,_,_e.level,ae),ae.length>0&&(de.push("<ul>"),ae.forEach(function(Se){de.push(Se)}),de.push("</ul>")),de.push("</li>"),_=P(g,_,N,de),_}function U(){return P(z,0,0,$),$.push("</ul>"),$.join("")}var se={heading:function(_){var N=ye.exec(_);if(N)return{type:"heading",raw:N[0],depth:N[1].length,text:N[2]}},fences:function(_){var N=this.rules.block.fences.exec(_);if(N){var de=N[0],_e=S(de,N[3]||""),ae=N[2]?N[2].trim():N[2];if(["latex","katex","math"].indexOf(ae)>=0){var Se=We(),ue=_e;_e=Se,pe[Se]={type:"block",expression:ue}}return{type:"code",raw:de,lang:ae,text:_e}}}},ie=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Te=0,We=function(){return"__special_katext_id_".concat(Te++,"__")},pe={};function be(){return pe}function Re(){Te=0,pe={}}function Q(g){return g=g.replace(ie,function(_,N){var de=We();return pe[de]={type:"inline",expression:N},de}),g}var me=re.listitem;re.listitem=function(g){return me(Q(g))};var Ae=re.paragraph;re.paragraph=function(g){return Ae(Q(g))};var J=re.tablecell;re.tablecell=function(g,_){return J(Q(g),_)},re.code=function(g,_,N){var de=(_||"").match(/\S*/)[0];return de?["latex","katex","math"].indexOf(de)>=0?"<p class='editormd-tex'>".concat(g,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(_,'">').concat(N?g:Object(D.escape)(g,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(N?g:Object(D.escape)(g,!0))+"</code></pre>"},re.heading=function(g,_,N){var de=this.options.headerPrefix+N.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return z.push({anchor:de,level:_,text:g}),"<h"+_+' id="'+de+'">'+g+"</h"+_+">"},M.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),M.a.use({tokenizer:se,renderer:re});var y=M.a,Z=C("SJMd"),X=C("ulZh"),w=C.n(X),ee=C("m3rI"),j=C("Oy/b"),A=C("p5ED"),k=/<pre[^>]*>/g;function c(g){var _=document.createElement("div");return _.innerHTML=g,_.childNodes.length===0?"":_.childNodes[0].nodeValue}var l=Ye.a=function(g){var _,N=g.value,de=N===void 0?"":N,_e=g.className,ae=g.showTextOnly,Se=g.showLines,ue=g.style,ce=ue===void 0?{}:ue,H=g.stylesPrev,te=H===void 0?{}:H,h=(_=String(de))===null||_===void 0?void 0:_.replace(/<script.*?>|<\/script>/gi,"").replace(/on\w+="[^"]*"/gi,""),T=Object(oe.useState)(""),m=Object(ge.a)(T,2),R=m[0],Y=m[1],B=Object(oe.useMemo)(function(){try{var Pe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,we=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Me=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;h=h.replace(Pe,"("+ee.a.API_SERVER+"/api/attachments/").replace(we,'"'+ee.a.API_SERVER+"/api/attachments/").replace(Me,'"'+ee.a.API_SERVER+"/files/uploads/").replace(/\r\n/g,`
|
|
`),h=h.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(qe){}var Ge=y(h),Ve=be();if(h.match(/\[TOC\]/)&&(Ge=Ge.replace("<p>[TOC]</p>",U()),le()),Ge=Ge.replace(/(__special_katext_id_\d+__)/g,function(qe,ht){var nt=Ve[ht],Xe=nt.type,ve=nt.expression;return Object(j.renderToString)(c(ve)||"",{displayMode:Xe==="block",throwOnError:!1,output:"html"})}),Ge=Ge.replace(/▁/g,"\u2581\u2581\u2581"),Re(),ae){var Ke=document.createElement("div");return Ke.innerHTML=Ge,Ke.innerText}return setTimeout(function(){return je()},500),Ge},[h]),ne=Object(oe.useRef)();W.WebkitLineClamp=Se,Se&&(ce=Object(F.a)(Object(F.a)({},ce),W));function ke(Pe){var we=Pe.target;if(we.tagName.toUpperCase()==="A"){var Me=we.getAttribute("href");if(Me.indexOf("office")>-1)Pe.preventDefault(),Y(Me);else if(Me.startsWith("#")){Pe.preventDefault();var Ge=document.getElementById(Me.replace("#",""));Ge&&Ge.scrollIntoView(!0)}}}var je=function(){var we,Me=(we=ne.current)===null||we===void 0?void 0:we.querySelectorAll("video");Me==null||Me.forEach(function(Ge){if(Ge.oncontextmenu=function(){return!1},Ge.src.indexOf(".m3u8")>-1&&!Ge.canPlayType("application/vnd.apple.mpegurl")){if(w.a.isSupported()){var Ve=new w.a;Ve.loadSource(Ge.src),Ve.attachMedia(Ge)}}})};return Object(oe.useEffect)(function(){if(ne.current&&B&&(B.match(k)&&window.PR.prettyPrint()),ne.current)return ne.current.addEventListener("click",ke),function(){ne.current.removeEventListener("click",ke),Re(),le()}},[B,ne.current,ke]),Oe.a.createElement(Oe.a.Fragment,null,Oe.a.createElement("div",{ref:ne,style:Object(F.a)({},ce),className:"".concat(_e||""," markdown-body "),dangerouslySetInnerHTML:{__html:B}}),Oe.a.createElement(A.a,{close:!0,data:R,type:R!=null&&R.length?"office":"",style:Object(F.a)({},te),onClose:function(){return Y("")}}))}},"9VGf":function(bt,Ye,C){"use strict";C.d(Ye,"a",function(){return oe});var F=C("q1tI"),ge=C.n(F);function oe(Oe,Ee){var G=Object(F.useRef)();Object(F.useEffect)(function(){G.current=Oe}),Object(F.useEffect)(function(){function M(){G.current()}if(Ee!==null){var D=setInterval(M,Ee);return function(){return clearInterval(D)}}},[Ee])}},Bd2K:function(bt,Ye,C){(function(F){F(C("VrN/"),C("osHv"))})(function(F){F.defineOption("autoCloseTags",!1,function(S,z,$){if($!=F.Init&&$&&S.removeKeyMap("autoCloseTags"),!z)return;var re={name:"autoCloseTags"};(typeof z!="object"||z.whenClosing!==!1)&&(re["'/'"]=function(ye){return G(ye)}),(typeof z!="object"||z.whenOpening!==!1)&&(re["'>'"]=function(ye){return Oe(ye)}),S.addKeyMap(re)});var ge=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],oe=["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 Oe(S){if(S.getOption("disableInput"))return F.Pass;for(var z=S.listSelections(),$=[],re=S.getOption("autoCloseTags"),ye=0;ye<z.length;ye++){if(!z[ye].empty())return F.Pass;var le=z[ye].head,W=S.getTokenAt(le),P=F.innerMode(S.getMode(),W.state),U=P.state,se=P.mode.xmlCurrentTag&&P.mode.xmlCurrentTag(U),ie=se&&se.name;if(!ie)return F.Pass;var Te=P.mode.configuration=="html",We=typeof re=="object"&&re.dontCloseTags||Te&&ge,pe=typeof re=="object"&&re.indentTags||Te&&oe;W.end>le.ch&&(ie=ie.slice(0,ie.length-W.end+le.ch));var be=ie.toLowerCase();if(!ie||W.type=="string"&&(W.end!=le.ch||!/[\"\']/.test(W.string.charAt(W.string.length-1))||W.string.length==1)||W.type=="tag"&&se.close||W.string.indexOf("/")==le.ch-W.start-1||We&&M(We,be)>-1||D(S,P.mode.xmlCurrentContext&&P.mode.xmlCurrentContext(U)||[],ie,le,!0))return F.Pass;var Re=typeof re=="object"&&re.emptyTags;if(Re&&M(Re,ie)>-1){$[ye]={text:"/>",newPos:F.Pos(le.line,le.ch+2)};continue}var Q=pe&&M(pe,be)>-1;$[ye]={indent:Q,text:">"+(Q?`
|
|
|
|
`:"")+"</"+ie+">",newPos:Q?F.Pos(le.line+1,0):F.Pos(le.line,le.ch+1)}}for(var me=typeof re=="object"&&re.dontIndentOnAutoClose,ye=z.length-1;ye>=0;ye--){var Ae=$[ye];S.replaceRange(Ae.text,z[ye].head,z[ye].anchor,"+insert");var J=S.listSelections().slice(0);J[ye]={head:Ae.newPos,anchor:Ae.newPos},S.setSelections(J),!me&&Ae.indent&&(S.indentLine(Ae.newPos.line,null,!0),S.indentLine(Ae.newPos.line+1,null,!0))}}function Ee(S,z){for(var $=S.listSelections(),re=[],ye=z?"/":"</",le=S.getOption("autoCloseTags"),W=typeof le=="object"&&le.dontIndentOnSlash,P=0;P<$.length;P++){if(!$[P].empty())return F.Pass;var U=$[P].head,se=S.getTokenAt(U),ie=F.innerMode(S.getMode(),se.state),Te=ie.state;if(z&&(se.type=="string"||se.string.charAt(0)!="<"||se.start!=U.ch-1))return F.Pass;var We,pe=ie.mode.name!="xml"&&S.getMode().name=="htmlmixed";if(pe&&ie.mode.name=="javascript")We=ye+"script";else if(pe&&ie.mode.name=="css")We=ye+"style";else{var be=ie.mode.xmlCurrentContext&&ie.mode.xmlCurrentContext(Te);if(!be||be.length&&D(S,be,be[be.length-1],U))return F.Pass;We=ye+be[be.length-1]}S.getLine(U.line).charAt(se.end)!=">"&&(We+=">"),re[P]=We}if(S.replaceSelections(re),$=S.listSelections(),!W)for(var P=0;P<$.length;P++)(P==$.length-1||$[P].head.line<$[P+1].head.line)&&S.indentLine($[P].head.line)}function G(S){return S.getOption("disableInput")?F.Pass:Ee(S,!0)}F.commands.closeTag=function(S){return Ee(S)};function M(S,z){if(S.indexOf)return S.indexOf(z);for(var $=0,re=S.length;$<re;++$)if(S[$]==z)return $;return-1}function D(S,z,$,re,ye){if(!F.scanForClosingTag)return!1;var le=Math.min(S.lastLine()+1,re.line+500),W=F.scanForClosingTag(S,re,null,le);if(!W||W.tag!=$)return!1;for(var P=ye?1:0,U=z.length-1;U>=0&&z[U]==$;U--)++P;re=W.to;for(var U=1;U<P;U++){var se=F.scanForClosingTag(S,re,null,le);if(!se||se.tag!=$)return!1;re=se.to}return!0}})},BjJ7:function(bt,Ye,C){"use strict";C.d(Ye,"d",function(){return ge}),C.d(Ye,"c",function(){return oe}),C.d(Ye,"e",function(){return Oe}),C.d(Ye,"b",function(){return Ee}),C.d(Ye,"a",function(){return M});var F=C("m3rI");function ge(D){var S=!0;if(D.length>0){for(var z=0;z<D.length;z++)if(D[z].compile_success==0||!D[z].compile_success){S=!1;break}}else S=!1;return S}function oe(D){for(var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",z=[],$=0;$<D.length;$++){var re=D[$],ye=S?"".concat(S,"/").concat(re.name):"".concat(re.name);z.push({title:re.name,isLeaf:!(re.type==="tree"),key:ye})}return z}function Oe(D,S,z){for(var $=0;$<D.length;$++){var re=D[$];if(re.key===S){re.children=z;break}re.children&&Oe(re.children,S,z)}return D}function Ee(D,S,z){var $;return function(){var re=this,ye=arguments,le=function(){$=null,z||D.apply(re,ye)},W=z&&!$;clearTimeout($),$=setTimeout(le,S),W&&D.apply(re,ye)}}var G=!0,M=F.a.API_SERVER},"C+DQ":function(bt,Ye,C){},CKgm:function(bt,Ye,C){"use strict";C.r(Ye);var F=C("+L6B"),ge=C("2/Rp"),oe=C("7Kak"),Oe=C("9yH6"),Ee=C("14J3"),G=C("BMrR"),M=C("5NDa"),D=C("5rEg"),S=C("k1fw"),z=C("miYZ"),$=C("tsqr"),re=C("oBTY"),ye=C("9og8"),le=C("y8nQ"),W=C("Vl3Y"),P=C("tJVT"),U=C("PpiC"),se=C("DZo9"),ie=C("8z0m"),Te=C("OaEy"),We=C("2fM7"),pe=C("WmNS"),be=C.n(pe),Re=C("q1tI"),Q=C.n(Re),me=C("Ty5D"),Ae=C("9kvl"),J=C("Ot1p"),y=C("7/Dv"),Z=C.n(y),X=C("LtfV"),w=C("m3rI"),ee=C("ErOA"),j=We.a.Option,A=ie.a.Dragger,k=function(l){var g,_=l.forumsDetail,N=l.globalSetting,de=l.dispatch,_e=Object(U.a)(l,["forumsDetail","globalSetting","dispatch"]),ae=Object(me.i)(),Se=W.a.useForm(),ue=Object(P.a)(Se,1),ce=ue[0],H=Object(Re.useState)({}),te=Object(P.a)(H,2),h=te[0],T=te[1],m=Object(Re.useState)([]),R=Object(P.a)(m,2),Y=R[0],B=R[1],ne=Object(Re.useState)(1),ke=Object(P.a)(ne,2),je=ke[0],Pe=ke[1],we=Object(Re.useState)(!1),Me=Object(P.a)(we,2),Ge=Me[0],Ve=Me[1],Ke=Object(Re.useState)(void 0),qe=Object(P.a)(Ke,2),ht=qe[0],nt=qe[1],Xe=Object(Re.useState)([]),ve=Object(P.a)(Xe,2),at=ve[0],Je=ve[1],Ce=Object(Re.useState)([]),Ie=Object(P.a)(Ce,2),I=Ie[0],L=Ie[1],x=Object(Re.useRef)([]);console.log(Y,h,"fileList"),Object(Re.useEffect)(function(){p()},[]),Object(Re.useEffect)(function(){p(),ae.memoId&&je===2&&f()},[ae.memoId,je]);var f=function(){var st=Object(ye.a)(be.a.mark(function it(){var ze,ct,ft,_t,kt,vt;return be.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return ze="/api/memos/".concat(ae.memoId,"/edit.json"),Ut.next=3,Object(ee.a)(ze,{method:"get"});case 3:ct=Ut.sent,console.log(ct,22),ct&&(_t={subject:ct.subject,content:ct.content,forum_id:ct==null?void 0:ct.forum_section.forum_id,children_forum_id:ct==null?void 0:ct.forum_section_id,tag_id:ct.tag_id,is_original:ct.is_original?1:2,reprint_link:(ct==null?void 0:ct.reprint_link)||""},kt=at.find(function(zt){return zt.id===_t.forum_id}),vt=ct==null||((ft=ct.attachments_url)===null||ft===void 0)?void 0:ft.map(function(zt,pn){return{name:zt.title,uid:pn,percent:100,response:zt}}),B(vt),L((kt==null?void 0:kt.children_tags)||[]),ce.setFieldsValue(_t),T(_t),nt(ct.memo_image_info));case 6:case"end":return Ut.stop()}},it)}));return function(){return st.apply(this,arguments)}}(),p=function(){var st=Object(ye.a)(be.a.mark(function it(){var ze;return be.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(ee.a)("/api/forum_sections.json",{method:"get"});case 2:ze=ft.sent,ze&&ze.forum_sections&&(Je(ze.forum_sections),Pe(2));case 4:case"end":return ft.stop()}},it)}));return function(){return st.apply(this,arguments)}}(),v=function(it){if(it.file.status==="done"){var ze;if(B(it.fileList),x.current=Object(re.a)(it.fileList),!it.file.response)return;if((ze=it.file.response)!==null&&ze!==void 0&&ze.id)return}},b=function(){var st=Object(ye.a)(be.a.mark(function it(ze){var ct;return be.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:if(ze.response){_t.next=3;break}return $.b.info("\u8FD8\u672A\u4E0A\u4F20\u5B8C\u6210\uFF0C\u65E0\u6CD5\u8FDB\u884C\u5220\u9664\u64CD\u4F5C\uFF01"),_t.abrupt("return");case 3:ct=Y.filter(function(kt){return kt.uid!==ze.uid}),B(ct),x.current=Object(re.a)(ct),$.b.info("\u5220\u9664\u6210\u529F");case 7:case"end":return _t.stop()}},it)}));return function(ze){return st.apply(this,arguments)}}(),V=function(it){if(Y!=null&&Y.some(function(ct){return ct.name===it.name}))return $.b.info("".concat(it.name,"\u6587\u4EF6\u5DF2\u5B58\u5728")),!1;if(it.size/1024/1024>50)return $.b.info("\u6587\u4EF6\u8D85\u8FC750M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;var ze={name:it.name,uid:it.uid,file:it,percent:0};Y.push(ze),x.current=Object(re.a)(Y),B(Object(re.a)(Y))},fe={name:"file",multiple:!0,fileList:Y,action:"".concat(w.a.API_SERVER,"/api/attachments.json"),onChange:v,onRemove:b,beforeUpload:V};function Le(st){nt(st)}var tt=function(){var st=Object(ye.a)(be.a.mark(function it(ze){var ct,ft,_t;return be.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(Ve(!0),ct={forum_id:ze.forum_id,attachment_id:ht&&ht.id,children_forum_id:ze.children_forum_id,attachments:Y==null?void 0:Y.map(function(Bt){var Ut;return Bt==null||((Ut=Bt.response)===null||Ut===void 0)?void 0:Ut.id}),memo:{subject:ze.subject,content:ze.content,tag_id:ze.tag_id,is_original:ze.is_original,reprint_link:ze.reprint_link}},!ae.memoId){vt.next=9;break}return vt.next=5,Object(ee.a)("/api/memos/".concat(ae.memoId,".json"),{method:"put",body:ct});case 5:ft=vt.sent,ft.status===1&&($.b.success(ft==null?void 0:ft.message),Ae.d.push("/forums/".concat(ae.memoId))),vt.next=13;break;case 9:return vt.next=11,Object(ee.a)("/api/memos.json",{method:"post",body:ct});case 11:_t=vt.sent,_t.status===1&&($.b.success(_t==null?void 0:_t.message),Ae.d.push("/forums/".concat(_t.memo_id)));case 13:Ve(!1);case 14:case"end":return vt.stop()}},it)}));return function(ze){return st.apply(this,arguments)}}(),rt=function(){Ae.d.goBack()},ot=function(it){if(T(Object(S.a)(Object(S.a)({},h),it)),"forum_id"in it){var ze,ct,ft=at.find(function(kt){return kt.id===it.forum_id}),_t=(ft==null||((ze=ft.children_tags)===null||ze===void 0||((ct=ze[0])===null||ct===void 0))?void 0:ct.id)||void 0;L((ft==null?void 0:ft.children_tags)||[]),ce.setFieldsValue({children_forum_id:_t}),T(Object(S.a)(Object(S.a)({},h),{},{children_forum_id:_t}))}};return Q.a.createElement("section",{className:Z.a.bg},Q.a.createElement("div",{className:Z.a.head},ae.memoId?"\u7F16\u8F91":"\u65B0\u5EFA"),Q.a.createElement(W.a,{form:ce,className:Z.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:ot,onFinish:tt},Q.a.createElement(W.a.Item,{name:"subject",label:"\u6807\u9898",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},Q.a.createElement(D.a,{placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",maxLength:50,suffix:"".concat(((g=h.subject)===null||g===void 0?void 0:g.length)||0,"/50")})),Q.a.createElement(W.a.Item,{name:"content",label:"\u5185\u5BB9",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5185\u5BB9"}]},Q.a.createElement(J.a,{defaultValue:h.content||"",watch:!0})),Q.a.createElement(A,fe,Q.a.createElement("p",{className:"ant-upload-drag-icon"},Q.a.createElement(X.a,null)),Q.a.createElement("p",{className:"ant-upload-text"},"\u62D6\u52A8\u6587\u4EF6\u6216",Q.a.createElement("span",{className:"c-light-primary"},"\u70B9\u51FB\u6B64\u5904\u4E0A\u4F20"))),Q.a.createElement(G.a,{className:"mt20",align:"bottom"},Q.a.createElement(W.a.Item,{name:"forum_id",label:"\u4E3B\u9898\u677F\u5757",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E3B\u9898\u677F\u5757"}]},Q.a.createElement(We.a,{placeholder:"\u8BF7\u9009\u62E9\u4E3B\u9898\u677F\u5757",style:{width:260}},at==null?void 0:at.map(function(st){return Q.a.createElement(j,{value:st.id},st.name)}))),Q.a.createElement(W.a.Item,{name:"children_forum_id",label:""},Q.a.createElement(We.a,{style:{width:260,marginLeft:20}},I==null?void 0:I.map(function(st){return Q.a.createElement(j,{value:st.id},st.title)})))),Q.a.createElement(W.a.Item,{name:"tag_id",label:"\u5E16\u5B50\u6807\u7B7E",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5E16\u5B50\u6807\u7B7E"}]},Q.a.createElement(We.a,{style:{width:"260px"}},Q.a.createElement(j,{value:1},"\u4EA4\u6D41"),Q.a.createElement(j,{value:2},"\u6C42\u52A9"))),Q.a.createElement(W.a.Item,{name:"is_original",label:"\u662F\u5426\u539F\u521B",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u539F\u521B"}]},Q.a.createElement(Oe.a.Group,null,Q.a.createElement(Oe.a,{value:1},"\u662F"),Q.a.createElement(Oe.a,{value:2},"\u5426"))),(h==null?void 0:h.is_original)===2&&Q.a.createElement(W.a.Item,{name:"reprint_link",label:"\u8F6C\u8F7D\u81EA"},Q.a.createElement(D.a,{style:{width:"260px"},placeholder:"\u8F6C\u8F7D\u94FE\u63A5"})),Q.a.createElement(G.a,{className:"mt20",align:"middle"},Q.a.createElement(ge.a,{onClick:rt},"\u8FD4\u56DE"),Q.a.createElement(ge.a,{loading:Ge,className:"ml20",type:"primary",onClick:function(){return ce.submit()}},"\u4FDD\u5B58"))))};Ye.default=Object(Ae.a)(function(c){var l=c.forumsDetail,g=c.globalSetting;return{forumsDetail:l,globalSetting:g}})(k)},DlQD:function(bt,Ye,C){(function(F,ge){bt.exports=ge()})(this,function(){"use strict";function F(I,L){for(var x=0;x<L.length;x++){var f=L[x];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(I,f.key,f)}}function ge(I,L,x){return L&&F(I.prototype,L),x&&F(I,x),I}function oe(I,L){if(!I)return;if(typeof I=="string")return Oe(I,L);var x=Object.prototype.toString.call(I).slice(8,-1);if(x==="Object"&&I.constructor&&(x=I.constructor.name),x==="Map"||x==="Set")return Array.from(I);if(x==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(x))return Oe(I,L)}function Oe(I,L){(L==null||L>I.length)&&(L=I.length);for(var x=0,f=new Array(L);x<L;x++)f[x]=I[x];return f}function Ee(I,L){var x;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(x=oe(I))||L&&I&&typeof I.length=="number"){x&&(I=x);var f=0;return function(){return f>=I.length?{done:!0}:{done:!1,value:I[f++]}}}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 x=I[Symbol.iterator](),x.next.bind(x)}function G(I,L){return L={exports:{}},I(L,L.exports),L.exports}var M=G(function(I){function L(){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 x(f){I.exports.defaults=f}I.exports={defaults:L(),getDefaults:L,changeDefaults:x}}),D=M.defaults,S=M.getDefaults,z=M.changeDefaults,$=/[&<>"']/,re=/[&<>"']/g,ye=/[<>"']|&(?!#?\w+;)/,le=/[<>"']|&(?!#?\w+;)/g,W={"&":"&","<":"<",">":">",'"':""","'":"'"},P=function(L){return W[L]};function U(I,L){if(L){if($.test(I))return I.replace(re,P)}else if(ye.test(I))return I.replace(le,P);return I}var se=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ie(I){return I.replace(se,function(L,x){return x=x.toLowerCase(),x==="colon"?":":x.charAt(0)==="#"?x.charAt(1)==="x"?String.fromCharCode(parseInt(x.substring(2),16)):String.fromCharCode(+x.substring(1)):""})}var Te=/(^|[^\[])\^/g;function We(I,L){I=I.source||I,L=L||"";var x={replace:function(p,v){return v=v.source||v,v=v.replace(Te,"$1"),I=I.replace(p,v),x},getRegex:function(){return new RegExp(I,L)}};return x}var pe=/[^\w:]/g,be=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Re(I,L,x){if(I){var f;try{f=decodeURIComponent(ie(x)).replace(pe,"").toLowerCase()}catch(p){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}L&&!be.test(x)&&(x=y(L,x));try{x=encodeURI(x).replace(/%25/g,"%")}catch(p){return null}return x}var Q={},me=/^[^:]+:\/*[^/]*$/,Ae=/^([^:]+:)[\s\S]*$/,J=/^([^:]+:\/*[^/]*)[\s\S]*$/;function y(I,L){Q[" "+I]||(me.test(I)?Q[" "+I]=I+"/":Q[" "+I]=ee(I,"/",!0)),I=Q[" "+I];var x=I.indexOf(":")===-1;return L.substring(0,2)==="//"?x?L:I.replace(Ae,"$1")+L:L.charAt(0)==="/"?x?L:I.replace(J,"$1")+L:I+L}var Z={exec:function(){}};function X(I){for(var L=1,x,f;L<arguments.length;L++){x=arguments[L];for(f in x)Object.prototype.hasOwnProperty.call(x,f)&&(I[f]=x[f])}return I}function w(I,L){var x=I.replace(/\|/g,function(v,b,V){for(var fe=!1,Le=b;--Le>=0&&V[Le]==="\\";)fe=!fe;return fe?"|":" |"}),f=x.split(/ \|/),p=0;if(f.length>L)f.splice(L);else for(;f.length<L;)f.push("");for(;p<f.length;p++)f[p]=f[p].trim().replace(/\\\|/g,"|");return f}function ee(I,L,x){var f=I.length;if(f===0)return"";for(var p=0;p<f;){var v=I.charAt(f-p-1);if(v===L&&!x)p++;else if(v!==L&&x)p++;else break}return I.substr(0,f-p)}function j(I,L){if(I.indexOf(L[1])===-1)return-1;for(var x=I.length,f=0,p=0;p<x;p++)if(I[p]==="\\")p++;else if(I[p]===L[0])f++;else if(I[p]===L[1]&&(f--,f<0))return p;return-1}function A(I){I&&I.sanitize&&!I.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 k={escape:U,unescape:ie,edit:We,cleanUrl:Re,resolveUrl:y,noopTest:Z,merge:X,splitCells:w,rtrim:ee,findClosingBracket:j,checkSanitizeDeprecation:A},c=M.defaults,l=k.rtrim,g=k.splitCells,_=k.escape,N=k.findClosingBracket;function de(I,L,x){var f=L.href,p=L.title?_(L.title):null,v=I[1].replace(/\\([\[\]])/g,"$1");return I[0].charAt(0)!=="!"?{type:"link",raw:x,href:f,title:p,text:v}:{type:"image",raw:x,href:f,title:p,text:_(v)}}function _e(I,L){var x=I.match(/^(\s+)(?:```)/);if(x===null)return L;var f=x[1];return L.split(`
|
|
`).map(function(p){var v=p.match(/^\s+/);if(v===null)return p;var b=v[0];return b.length>=f.length?p.slice(f.length):p}).join(`
|
|
`)}var ae=function(){function I(x){this.options=x||c}var L=I.prototype;return L.space=function(f){var p=this.rules.block.newline.exec(f);if(p)return p[0].length>1?{type:"space",raw:p[0]}:{raw:`
|
|
`}},L.code=function(f,p){var v=this.rules.block.code.exec(f);if(v){var b=p[p.length-1];if(b&&b.type==="paragraph")return{raw:v[0],text:v[0].trimRight()};var V=v[0].replace(/^ {4}/gm,"");return{type:"code",raw:v[0],codeBlockStyle:"indented",text:this.options.pedantic?V:l(V,`
|
|
`)}}},L.fences=function(f){var p=this.rules.block.fences.exec(f);if(p){var v=p[0],b=_e(v,p[3]||"");return{type:"code",raw:v,lang:p[2]?p[2].trim():p[2],text:b}}},L.heading=function(f){var p=this.rules.block.heading.exec(f);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},L.nptable=function(f){var p=this.rules.block.nptable.exec(f);if(p){var v={type:"table",header:g(p[1].replace(/^ *| *\| *$/g,"")),align:p[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:p[3]?p[3].replace(/\n$/,"").split(`
|
|
`):[],raw:p[0]};if(v.header.length===v.align.length){var b=v.align.length,V;for(V=0;V<b;V++)/^ *-+: *$/.test(v.align[V])?v.align[V]="right":/^ *:-+: *$/.test(v.align[V])?v.align[V]="center":/^ *:-+ *$/.test(v.align[V])?v.align[V]="left":v.align[V]=null;for(b=v.cells.length,V=0;V<b;V++)v.cells[V]=g(v.cells[V],v.header.length);return v}}},L.hr=function(f){var p=this.rules.block.hr.exec(f);if(p)return{type:"hr",raw:p[0]}},L.blockquote=function(f){var p=this.rules.block.blockquote.exec(f);if(p){var v=p[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:p[0],text:v}}},L.list=function(f){var p=this.rules.block.list.exec(f);if(p){for(var v=p[0],b=p[2],V=b.length>1,fe=b[b.length-1]===")",Le={type:"list",raw:v,ordered:V,start:V?+b.slice(0,-1):"",loose:!1,items:[]},tt=p[0].match(this.rules.block.item),rt=!1,ot,st,it,ze,ct,ft,_t,kt=tt.length,vt=0;vt<kt;vt++)ot=tt[vt],v=ot,st=ot.length,ot=ot.replace(/^ *([*+-]|\d+[.)]) */,""),~ot.indexOf(`
|
|
`)&&(st-=ot.length,ot=this.options.pedantic?ot.replace(/^ {1,4}/gm,""):ot.replace(new RegExp("^ {1,"+st+"}","gm"),"")),vt!==kt-1&&(it=this.rules.block.bullet.exec(tt[vt+1])[0],(V?it.length===1||!fe&&it[it.length-1]===")":it.length>1||this.options.smartLists&&it!==b)&&(ze=tt.slice(vt+1).join(`
|
|
`),Le.raw=Le.raw.substring(0,Le.raw.length-ze.length),vt=kt-1)),ct=rt||/\n\n(?!\s*$)/.test(ot),vt!==kt-1&&(rt=ot.charAt(ot.length-1)===`
|
|
`,ct||(ct=rt)),ct&&(Le.loose=!0),ft=/^\[[ xX]\] /.test(ot),_t=void 0,ft&&(_t=ot[1]!==" ",ot=ot.replace(/^\[[ xX]\] +/,"")),Le.items.push({type:"list_item",raw:v,task:ft,checked:_t,loose:ct,text:ot});return Le}},L.html=function(f){var p=this.rules.block.html.exec(f);if(p)return{type:this.options.sanitize?"paragraph":"html",raw:p[0],pre:!this.options.sanitizer&&(p[1]==="pre"||p[1]==="script"||p[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(p[0]):_(p[0]):p[0]}},L.def=function(f){var p=this.rules.block.def.exec(f);if(p){p[3]&&(p[3]=p[3].substring(1,p[3].length-1));var v=p[1].toLowerCase().replace(/\s+/g," ");return{tag:v,raw:p[0],href:p[2],title:p[3]}}},L.table=function(f){var p=this.rules.block.table.exec(f);if(p){var v={type:"table",header:g(p[1].replace(/^ *| *\| *$/g,"")),align:p[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:p[3]?p[3].replace(/\n$/,"").split(`
|
|
`):[]};if(v.header.length===v.align.length){v.raw=p[0];var b=v.align.length,V;for(V=0;V<b;V++)/^ *-+: *$/.test(v.align[V])?v.align[V]="right":/^ *:-+: *$/.test(v.align[V])?v.align[V]="center":/^ *:-+ *$/.test(v.align[V])?v.align[V]="left":v.align[V]=null;for(b=v.cells.length,V=0;V<b;V++)v.cells[V]=g(v.cells[V].replace(/^ *\| *| *\| *$/g,""),v.header.length);return v}}},L.lheading=function(f){var p=this.rules.block.lheading.exec(f);if(p)return{type:"heading",raw:p[0],depth:p[2].charAt(0)==="="?1:2,text:p[1]}},L.paragraph=function(f){var p=this.rules.block.paragraph.exec(f);if(p)return{type:"paragraph",raw:p[0],text:p[1].charAt(p[1].length-1)===`
|
|
`?p[1].slice(0,-1):p[1]}},L.text=function(f,p){var v=this.rules.block.text.exec(f);if(v){var b=p[p.length-1];return b&&b.type==="text"?{raw:v[0],text:v[0]}:{type:"text",raw:v[0],text:v[0]}}},L.escape=function(f){var p=this.rules.inline.escape.exec(f);if(p)return{type:"escape",raw:p[0],text:_(p[1])}},L.tag=function(f,p,v){var b=this.rules.inline.tag.exec(f);if(b)return!p&&/^<a /i.test(b[0])?p=!0:p&&/^<\/a>/i.test(b[0])&&(p=!1),!v&&/^<(pre|code|kbd|script)(\s|>)/i.test(b[0])?v=!0:v&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(b[0])&&(v=!1),{type:this.options.sanitize?"text":"html",raw:b[0],inLink:p,inRawBlock:v,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(b[0]):_(b[0]):b[0]}},L.link=function(f){var p=this.rules.inline.link.exec(f);if(p){var v=N(p[2],"()");if(v>-1){var b=p[0].indexOf("!")===0?5:4,V=b+p[1].length+v;p[2]=p[2].substring(0,v),p[0]=p[0].substring(0,V).trim(),p[3]=""}var fe=p[2],Le="";if(this.options.pedantic){var tt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(fe);tt?(fe=tt[1],Le=tt[3]):Le=""}else Le=p[3]?p[3].slice(1,-1):"";fe=fe.trim().replace(/^<([\s\S]*)>$/,"$1");var rt=de(p,{href:fe&&fe.replace(this.rules.inline._escapes,"$1"),title:Le&&Le.replace(this.rules.inline._escapes,"$1")},p[0]);return rt}},L.reflink=function(f,p){var v;if((v=this.rules.inline.reflink.exec(f))||(v=this.rules.inline.nolink.exec(f))){var b=(v[2]||v[1]).replace(/\s+/g," ");if(b=p[b.toLowerCase()],!b||!b.href){var V=v[0].charAt(0);return{type:"text",raw:V,text:V}}var fe=de(v,b,v[0]);return fe}},L.strong=function(f,p,v){v===void 0&&(v="");var b=this.rules.inline.strong.start.exec(f);if(b&&(!b[1]||b[1]&&(v===""||this.rules.inline.punctuation.exec(v)))){p=p.slice(-1*f.length);var V=b[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;V.lastIndex=0;for(var fe;(b=V.exec(p))!=null;)if(fe=this.rules.inline.strong.middle.exec(p.slice(0,b.index+3)),fe)return{type:"strong",raw:f.slice(0,fe[0].length),text:f.slice(2,fe[0].length-2)}}},L.em=function(f,p,v){v===void 0&&(v="");var b=this.rules.inline.em.start.exec(f);if(b&&(!b[1]||b[1]&&(v===""||this.rules.inline.punctuation.exec(v)))){p=p.slice(-1*f.length);var V=b[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;V.lastIndex=0;for(var fe;(b=V.exec(p))!=null;)if(fe=this.rules.inline.em.middle.exec(p.slice(0,b.index+2)),fe)return{type:"em",raw:f.slice(0,fe[0].length),text:f.slice(1,fe[0].length-1)}}},L.codespan=function(f){var p=this.rules.inline.code.exec(f);if(p){var v=p[2].replace(/\n/g," "),b=/[^ ]/.test(v),V=v.startsWith(" ")&&v.endsWith(" ");return b&&V&&(v=v.substring(1,v.length-1)),v=_(v,!0),{type:"codespan",raw:p[0],text:v}}},L.br=function(f){var p=this.rules.inline.br.exec(f);if(p)return{type:"br",raw:p[0]}},L.del=function(f){var p=this.rules.inline.del.exec(f);if(p)return{type:"del",raw:p[0],text:p[1]}},L.autolink=function(f,p){var v=this.rules.inline.autolink.exec(f);if(v){var b,V;return v[2]==="@"?(b=_(this.options.mangle?p(v[1]):v[1]),V="mailto:"+b):(b=_(v[1]),V=b),{type:"link",raw:v[0],text:b,href:V,tokens:[{type:"text",raw:b,text:b}]}}},L.url=function(f,p){var v;if(v=this.rules.inline.url.exec(f)){var b,V;if(v[2]==="@")b=_(this.options.mangle?p(v[0]):v[0]),V="mailto:"+b;else{var fe;do fe=v[0],v[0]=this.rules.inline._backpedal.exec(v[0])[0];while(fe!==v[0]);b=_(v[0]),v[1]==="www."?V="http://"+b:V=b}return{type:"link",raw:v[0],text:b,href:V,tokens:[{type:"text",raw:b,text:b}]}}},L.inlineText=function(f,p,v){var b=this.rules.inline.text.exec(f);if(b){var V;return p?V=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(b[0]):_(b[0]):b[0]:V=_(this.options.smartypants?v(b[0]):b[0]),{type:"text",raw:b[0],text:V}}},I}(),Se=k.noopTest,ue=k.edit,ce=k.merge,H={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};H._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,H._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,H.def=ue(H.def).replace("label",H._label).replace("title",H._title).getRegex(),H.bullet=/(?:[*+-]|\d{1,9}[.)])/,H.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,H.item=ue(H.item,"gm").replace(/bull/g,H.bullet).getRegex(),H.list=ue(H.list).replace(/bull/g,H.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+H.def.source+")").getRegex(),H._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",H._comment=/<!--(?!-?>)[\s\S]*?-->/,H.html=ue(H.html,"i").replace("comment",H._comment).replace("tag",H._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H.paragraph=ue(H._paragraph).replace("hr",H.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",H._tag).getRegex(),H.blockquote=ue(H.blockquote).replace("paragraph",H.paragraph).getRegex(),H.normal=ce({},H),H.gfm=ce({},H.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*|$)"}),H.gfm.nptable=ue(H.gfm.nptable).replace("hr",H.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",H._tag).getRegex(),H.gfm.table=ue(H.gfm.table).replace("hr",H.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",H._tag).getRegex(),H.pedantic=ce({},H.normal,{html:ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",H._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Se,paragraph:ue(H.normal._paragraph).replace("hr",H.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",H.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};te._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",te.punctuation=ue(te.punctuation).replace(/punctuation/g,te._punctuation).getRegex(),te._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",te._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",te.em.start=ue(te.em.start).replace(/punctuation/g,te._punctuation).getRegex(),te.em.middle=ue(te.em.middle).replace(/punctuation/g,te._punctuation).replace(/overlapSkip/g,te._overlapSkip).getRegex(),te.em.endAst=ue(te.em.endAst,"g").replace(/punctuation/g,te._punctuation).getRegex(),te.em.endUnd=ue(te.em.endUnd,"g").replace(/punctuation/g,te._punctuation).getRegex(),te.strong.start=ue(te.strong.start).replace(/punctuation/g,te._punctuation).getRegex(),te.strong.middle=ue(te.strong.middle).replace(/punctuation/g,te._punctuation).replace(/blockSkip/g,te._blockSkip).getRegex(),te.strong.endAst=ue(te.strong.endAst,"g").replace(/punctuation/g,te._punctuation).getRegex(),te.strong.endUnd=ue(te.strong.endUnd,"g").replace(/punctuation/g,te._punctuation).getRegex(),te.blockSkip=ue(te._blockSkip,"g").getRegex(),te.overlapSkip=ue(te._overlapSkip,"g").getRegex(),te._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,te._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])?)+(?![-_])/,te.autolink=ue(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex(),te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,te.tag=ue(te.tag).replace("comment",H._comment).replace("attribute",te._attribute).getRegex(),te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,te._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,te.link=ue(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex(),te.reflink=ue(te.reflink).replace("label",te._label).getRegex(),te.reflinkSearch=ue(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex(),te.normal=ce({},te),te.pedantic=ce({},te.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:ue(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()}),te.gfm=ce({},te.normal,{escape:ue(te.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),te.gfm.url=ue(te.gfm.url,"i").replace("email",te.gfm._extended_email).getRegex(),te.breaks=ce({},te.gfm,{br:ue(te.br).replace("{2,}","*").getRegex(),text:ue(te.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var h={block:H,inline:te},T=M.defaults,m=h.block,R=h.inline;function Y(I){return I.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 B(I){var L="",x,f,p=I.length;for(x=0;x<p;x++)f=I.charCodeAt(x),Math.random()>.5&&(f="x"+f.toString(16)),L+="&#"+f+";";return L}var ne=function(){function I(x){this.tokens=[],this.tokens.links=Object.create(null),this.options=x||T,this.options.tokenizer=this.options.tokenizer||new ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var f={block:m.normal,inline:R.normal};this.options.pedantic?(f.block=m.pedantic,f.inline=R.pedantic):this.options.gfm&&(f.block=m.gfm,this.options.breaks?f.inline=R.breaks:f.inline=R.gfm),this.tokenizer.rules=f}I.lex=function(f,p){var v=new I(p);return v.lex(f)};var L=I.prototype;return L.lex=function(f){return f=f.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(f,this.tokens,!0),this.inline(this.tokens),this.tokens},L.blockTokens=function(f,p,v){p===void 0&&(p=[]),v===void 0&&(v=!0),f=f.replace(/^ +$/gm,"");for(var b,V,fe,Le;f;){if(b=this.tokenizer.space(f)){f=f.substring(b.raw.length),b.type&&p.push(b);continue}if(b=this.tokenizer.code(f,p)){f=f.substring(b.raw.length),b.type?p.push(b):(Le=p[p.length-1],Le.raw+=`
|
|
`+b.raw,Le.text+=`
|
|
`+b.text);continue}if(b=this.tokenizer.fences(f)){f=f.substring(b.raw.length),p.push(b);continue}if(b=this.tokenizer.heading(f)){f=f.substring(b.raw.length),p.push(b);continue}if(b=this.tokenizer.nptable(f)){f=f.substring(b.raw.length),p.push(b);continue}if(b=this.tokenizer.hr(f)){f=f.substring(b.raw.length),p.push(b);continue}if(b=this.tokenizer.blockquote(f)){f=f.substring(b.raw.length),b.tokens=this.blockTokens(b.text,[],v),p.push(b);continue}if(b=this.tokenizer.list(f)){for(f=f.substring(b.raw.length),fe=b.items.length,V=0;V<fe;V++)b.items[V].tokens=this.blockTokens(b.items[V].text,[],!1);p.push(b);continue}if(b=this.tokenizer.html(f)){f=f.substring(b.raw.length),p.push(b);continue}if(v&&(b=this.tokenizer.def(f))){f=f.substring(b.raw.length),this.tokens.links[b.tag]||(this.tokens.links[b.tag]={href:b.href,title:b.title});continue}if(b=this.tokenizer.table(f)){f=f.substring(b.raw.length),p.push(b);continue}if(b=this.tokenizer.lheading(f)){f=f.substring(b.raw.length),p.push(b);continue}if(v&&(b=this.tokenizer.paragraph(f))){f=f.substring(b.raw.length),p.push(b);continue}if(b=this.tokenizer.text(f,p)){f=f.substring(b.raw.length),b.type?p.push(b):(Le=p[p.length-1],Le.raw+=`
|
|
`+b.raw,Le.text+=`
|
|
`+b.text);continue}if(f){var tt="Infinite loop on byte: "+f.charCodeAt(0);if(this.options.silent){console.error(tt);break}else throw new Error(tt)}}return p},L.inline=function(f){var p,v,b,V,fe,Le,tt=f.length;for(p=0;p<tt;p++){Le=f[p];switch(Le.type){case"paragraph":case"text":case"heading":{Le.tokens=[],this.inlineTokens(Le.text,Le.tokens);break}case"table":{for(Le.tokens={header:[],cells:[]},V=Le.header.length,v=0;v<V;v++)Le.tokens.header[v]=[],this.inlineTokens(Le.header[v],Le.tokens.header[v]);for(V=Le.cells.length,v=0;v<V;v++)for(fe=Le.cells[v],Le.tokens.cells[v]=[],b=0;b<fe.length;b++)Le.tokens.cells[v][b]=[],this.inlineTokens(fe[b],Le.tokens.cells[v][b]);break}case"blockquote":{this.inline(Le.tokens);break}case"list":{for(V=Le.items.length,v=0;v<V;v++)this.inline(Le.items[v].tokens);break}}}return f},L.inlineTokens=function(f,p,v,b,V){p===void 0&&(p=[]),v===void 0&&(v=!1),b===void 0&&(b=!1),V===void 0&&(V="");var fe,Le=f,tt;if(this.tokens.links){var rt=Object.keys(this.tokens.links);if(rt.length>0)for(;(tt=this.tokenizer.rules.inline.reflinkSearch.exec(Le))!=null;)rt.includes(tt[0].slice(tt[0].lastIndexOf("[")+1,-1))&&(Le=Le.slice(0,tt.index)+"["+"a".repeat(tt[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(tt=this.tokenizer.rules.inline.blockSkip.exec(Le))!=null;)Le=Le.slice(0,tt.index)+"["+"a".repeat(tt[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;f;){if(fe=this.tokenizer.escape(f)){f=f.substring(fe.raw.length),p.push(fe);continue}if(fe=this.tokenizer.tag(f,v,b)){f=f.substring(fe.raw.length),v=fe.inLink,b=fe.inRawBlock,p.push(fe);continue}if(fe=this.tokenizer.link(f)){f=f.substring(fe.raw.length),fe.type==="link"&&(fe.tokens=this.inlineTokens(fe.text,[],!0,b)),p.push(fe);continue}if(fe=this.tokenizer.reflink(f,this.tokens.links)){f=f.substring(fe.raw.length),fe.type==="link"&&(fe.tokens=this.inlineTokens(fe.text,[],!0,b)),p.push(fe);continue}if(fe=this.tokenizer.strong(f,Le,V)){f=f.substring(fe.raw.length),fe.tokens=this.inlineTokens(fe.text,[],v,b),p.push(fe);continue}if(fe=this.tokenizer.em(f,Le,V)){f=f.substring(fe.raw.length),fe.tokens=this.inlineTokens(fe.text,[],v,b),p.push(fe);continue}if(fe=this.tokenizer.codespan(f)){f=f.substring(fe.raw.length),p.push(fe);continue}if(fe=this.tokenizer.br(f)){f=f.substring(fe.raw.length),p.push(fe);continue}if(fe=this.tokenizer.del(f)){f=f.substring(fe.raw.length),fe.tokens=this.inlineTokens(fe.text,[],v,b),p.push(fe);continue}if(fe=this.tokenizer.autolink(f,B)){f=f.substring(fe.raw.length),p.push(fe);continue}if(!v&&(fe=this.tokenizer.url(f,B))){f=f.substring(fe.raw.length),p.push(fe);continue}if(fe=this.tokenizer.inlineText(f,b,Y)){f=f.substring(fe.raw.length),V=fe.raw.slice(-1),p.push(fe);continue}if(f){var ot="Infinite loop on byte: "+f.charCodeAt(0);if(this.options.silent){console.error(ot);break}else throw new Error(ot)}}return p},ge(I,null,[{key:"rules",get:function(){return{block:m,inline:R}}}]),I}(),ke=M.defaults,je=k.cleanUrl,Pe=k.escape,we=function(){function I(x){this.options=x||ke}var L=I.prototype;return L.code=function(f,p,v){var b=(p||"").match(/\S*/)[0];if(this.options.highlight){var V=this.options.highlight(f,b);V!=null&&V!==f&&(v=!0,f=V)}return b?'<pre><code class="'+this.options.langPrefix+Pe(b,!0)+'">'+(v?f:Pe(f,!0))+`</code></pre>
|
|
`:"<pre><code>"+(v?f:Pe(f,!0))+`</code></pre>
|
|
`},L.blockquote=function(f){return`<blockquote>
|
|
`+f+`</blockquote>
|
|
`},L.html=function(f){return f},L.heading=function(f,p,v,b){return this.options.headerIds?"<h"+p+' id="'+this.options.headerPrefix+b.slug(v)+'">'+f+"</h"+p+`>
|
|
`:"<h"+p+">"+f+"</h"+p+`>
|
|
`},L.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},L.list=function(f,p,v){var b=p?"ol":"ul",V=p&&v!==1?' start="'+v+'"':"";return"<"+b+V+`>
|
|
`+f+"</"+b+`>
|
|
`},L.listitem=function(f){return"<li>"+f+`</li>
|
|
`},L.checkbox=function(f){return"<input "+(f?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},L.paragraph=function(f){return"<p>"+f+`</p>
|
|
`},L.table=function(f,p){return p&&(p="<tbody>"+p+"</tbody>"),`<table>
|
|
<thead>
|
|
`+f+`</thead>
|
|
`+p+`</table>
|
|
`},L.tablerow=function(f){return`<tr>
|
|
`+f+`</tr>
|
|
`},L.tablecell=function(f,p){var v=p.header?"th":"td",b=p.align?"<"+v+' align="'+p.align+'">':"<"+v+">";return b+f+"</"+v+`>
|
|
`},L.strong=function(f){return"<strong>"+f+"</strong>"},L.em=function(f){return"<em>"+f+"</em>"},L.codespan=function(f){return"<code>"+f+"</code>"},L.br=function(){return this.options.xhtml?"<br/>":"<br>"},L.del=function(f){return"<del>"+f+"</del>"},L.link=function(f,p,v){if(f=je(this.options.sanitize,this.options.baseUrl,f),f===null)return v;var b='<a href="'+Pe(f)+'"';return p&&(b+=' title="'+p+'"'),b+=">"+v+"</a>",b},L.image=function(f,p,v){if(f=je(this.options.sanitize,this.options.baseUrl,f),f===null)return v;var b='<img src="'+f+'" alt="'+v+'"';return p&&(b+=' title="'+p+'"'),b+=this.options.xhtml?"/>":">",b},L.text=function(f){return f},I}(),Me=function(){function I(){}var L=I.prototype;return L.strong=function(f){return f},L.em=function(f){return f},L.codespan=function(f){return f},L.del=function(f){return f},L.html=function(f){return f},L.text=function(f){return f},L.link=function(f,p,v){return""+v},L.image=function(f,p,v){return""+v},L.br=function(){return""},I}(),Ge=function(){function I(){this.seen={}}var L=I.prototype;return L.slug=function(f){var p=f.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(p)){var v=p;do this.seen[v]++,p=v+"-"+this.seen[v];while(this.seen.hasOwnProperty(p))}return this.seen[p]=0,p},I}(),Ve=M.defaults,Ke=k.unescape,qe=function(){function I(x){this.options=x||Ve,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Me,this.slugger=new Ge}I.parse=function(f,p){var v=new I(p);return v.parse(f)};var L=I.prototype;return L.parse=function(f,p){p===void 0&&(p=!0);var v="",b,V,fe,Le,tt,rt,ot,st,it,ze,ct,ft,_t,kt,vt,Bt,Ut,zt,pn=f.length;for(b=0;b<pn;b++){ze=f[b];switch(ze.type){case"space":continue;case"hr":{v+=this.renderer.hr();continue}case"heading":{v+=this.renderer.heading(this.parseInline(ze.tokens),ze.depth,Ke(this.parseInline(ze.tokens,this.textRenderer)),this.slugger);continue}case"code":{v+=this.renderer.code(ze.text,ze.lang,ze.escaped);continue}case"table":{for(st="",ot="",Le=ze.header.length,V=0;V<Le;V++)ot+=this.renderer.tablecell(this.parseInline(ze.tokens.header[V]),{header:!0,align:ze.align[V]});for(st+=this.renderer.tablerow(ot),it="",Le=ze.cells.length,V=0;V<Le;V++){for(rt=ze.tokens.cells[V],ot="",tt=rt.length,fe=0;fe<tt;fe++)ot+=this.renderer.tablecell(this.parseInline(rt[fe]),{header:!1,align:ze.align[fe]});it+=this.renderer.tablerow(ot)}v+=this.renderer.table(st,it);continue}case"blockquote":{it=this.parse(ze.tokens),v+=this.renderer.blockquote(it);continue}case"list":{for(ct=ze.ordered,ft=ze.start,_t=ze.loose,Le=ze.items.length,it="",V=0;V<Le;V++)vt=ze.items[V],Bt=vt.checked,Ut=vt.task,kt="",vt.task&&(zt=this.renderer.checkbox(Bt),_t?vt.tokens.length>0&&vt.tokens[0].type==="text"?(vt.tokens[0].text=zt+" "+vt.tokens[0].text,vt.tokens[0].tokens&&vt.tokens[0].tokens.length>0&&vt.tokens[0].tokens[0].type==="text"&&(vt.tokens[0].tokens[0].text=zt+" "+vt.tokens[0].tokens[0].text)):vt.tokens.unshift({type:"text",text:zt}):kt+=zt),kt+=this.parse(vt.tokens,_t),it+=this.renderer.listitem(kt,Ut,Bt);v+=this.renderer.list(it,ct,ft);continue}case"html":{v+=this.renderer.html(ze.text);continue}case"paragraph":{v+=this.renderer.paragraph(this.parseInline(ze.tokens));continue}case"text":{for(it=ze.tokens?this.parseInline(ze.tokens):ze.text;b+1<pn&&f[b+1].type==="text";)ze=f[++b],it+=`
|
|
`+(ze.tokens?this.parseInline(ze.tokens):ze.text);v+=p?this.renderer.paragraph(it):it;continue}default:{var an='Token with "'+ze.type+'" type was not found.';if(this.options.silent){console.error(an);return}else throw new Error(an)}}}return v},L.parseInline=function(f,p){p=p||this.renderer;var v="",b,V,fe=f.length;for(b=0;b<fe;b++){V=f[b];switch(V.type){case"escape":{v+=p.text(V.text);break}case"html":{v+=p.html(V.text);break}case"link":{v+=p.link(V.href,V.title,this.parseInline(V.tokens,p));break}case"image":{v+=p.image(V.href,V.title,V.text);break}case"strong":{v+=p.strong(this.parseInline(V.tokens,p));break}case"em":{v+=p.em(this.parseInline(V.tokens,p));break}case"codespan":{v+=p.codespan(V.text);break}case"br":{v+=p.br();break}case"del":{v+=p.del(this.parseInline(V.tokens,p));break}case"text":{v+=p.text(V.text);break}default:{var Le='Token with "'+V.type+'" type was not found.';if(this.options.silent){console.error(Le);return}else throw new Error(Le)}}}return v},I}(),ht=k.merge,nt=k.checkSanitizeDeprecation,Xe=k.escape,ve=M.getDefaults,at=M.changeDefaults,Je=M.defaults;function Ce(I,L,x){if(typeof I=="undefined"||I===null)throw new Error("marked(): input parameter is undefined or null");if(typeof I!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(I)+", string expected");if(typeof L=="function"&&(x=L,L=null),L=ht({},Ce.defaults,L||{}),nt(L),x){var f=L.highlight,p;try{p=ne.lex(I,L)}catch(fe){return x(fe)}var v=function(Le){var tt;if(!Le)try{tt=qe.parse(p,L)}catch(rt){Le=rt}return L.highlight=f,Le?x(Le):x(null,tt)};if(!f||f.length<3)return v();if(delete L.highlight,!p.length)return v();var b=0;Ce.walkTokens(p,function(fe){fe.type==="code"&&(b++,setTimeout(function(){f(fe.text,fe.lang,function(Le,tt){if(Le)return v(Le);tt!=null&&tt!==fe.text&&(fe.text=tt,fe.escaped=!0),b--,b===0&&v()})},0))}),b===0&&v();return}try{var V=ne.lex(I,L);return L.walkTokens&&Ce.walkTokens(V,L.walkTokens),qe.parse(V,L)}catch(fe){if(fe.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,L.silent)return"<p>An error occurred:</p><pre>"+Xe(fe.message+"",!0)+"</pre>";throw fe}}Ce.options=Ce.setOptions=function(I){return ht(Ce.defaults,I),at(Ce.defaults),Ce},Ce.getDefaults=ve,Ce.defaults=Je,Ce.use=function(I){var L=ht({},I);if(I.renderer&&function(){var f=Ce.defaults.renderer||new we,p=function(V){var fe=f[V];f[V]=function(){for(var Le=arguments.length,tt=new Array(Le),rt=0;rt<Le;rt++)tt[rt]=arguments[rt];var ot=I.renderer[V].apply(f,tt);return ot===!1&&(ot=fe.apply(f,tt)),ot}};for(var v in I.renderer)p(v);L.renderer=f}(),I.tokenizer&&function(){var f=Ce.defaults.tokenizer||new ae,p=function(V){var fe=f[V];f[V]=function(){for(var Le=arguments.length,tt=new Array(Le),rt=0;rt<Le;rt++)tt[rt]=arguments[rt];var ot=I.tokenizer[V].apply(f,tt);return ot===!1&&(ot=fe.apply(f,tt)),ot}};for(var v in I.tokenizer)p(v);L.tokenizer=f}(),I.walkTokens){var x=Ce.defaults.walkTokens;L.walkTokens=function(f){I.walkTokens(f),x&&x(f)}}Ce.setOptions(L)},Ce.walkTokens=function(I,L){for(var x=Ee(I),f;!(f=x()).done;){var p=f.value;L(p);switch(p.type){case"table":{for(var v=Ee(p.tokens.header),b;!(b=v()).done;){var V=b.value;Ce.walkTokens(V,L)}for(var fe=Ee(p.tokens.cells),Le;!(Le=fe()).done;)for(var tt=Le.value,rt=Ee(tt),ot;!(ot=rt()).done;){var st=ot.value;Ce.walkTokens(st,L)}break}case"list":{Ce.walkTokens(p.items,L);break}default:p.tokens&&Ce.walkTokens(p.tokens,L)}}},Ce.Parser=qe,Ce.parser=qe.parse,Ce.Renderer=we,Ce.TextRenderer=Me,Ce.Lexer=ne,Ce.lexer=ne.lex,Ce.Tokenizer=ae,Ce.Slugger=Ge,Ce.parse=Ce;var Ie=Ce;return Ie})},ELLl:function(bt,Ye,C){(function(F){F(C("VrN/"))})(function(F){var ge={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},oe=F.Pos;F.defineOption("autoCloseBrackets",!1,function(W,P,U){U&&U!=F.Init&&(W.removeKeyMap(Ee),W.state.closeBrackets=null),P&&(G(Oe(P,"pairs")),W.state.closeBrackets=P,W.addKeyMap(Ee))});function Oe(W,P){return P=="pairs"&&typeof W=="string"?W:typeof W=="object"&&W[P]!=null?W[P]:ge[P]}var Ee={Backspace:S,Enter:z};function G(W){for(var P=0;P<W.length;P++){var U=W.charAt(P),se="'"+U+"'";Ee[se]||(Ee[se]=M(U))}}G(ge.pairs+"`");function M(W){return function(P){return re(P,W)}}function D(W){var P=W.state.closeBrackets;if(!P||P.override)return P;var U=W.getModeAt(W.getCursor());return U.closeBrackets||P}function S(W){var P=D(W);if(!P||W.getOption("disableInput"))return F.Pass;for(var U=Oe(P,"pairs"),se=W.listSelections(),ie=0;ie<se.length;ie++){if(!se[ie].empty())return F.Pass;var Te=ye(W,se[ie].head);if(!Te||U.indexOf(Te)%2!=0)return F.Pass}for(var ie=se.length-1;ie>=0;ie--){var We=se[ie].head;W.replaceRange("",oe(We.line,We.ch-1),oe(We.line,We.ch+1),"+delete")}}function z(W){var P=D(W),U=P&&Oe(P,"explode");if(!U||W.getOption("disableInput"))return F.Pass;for(var se=W.listSelections(),ie=0;ie<se.length;ie++){if(!se[ie].empty())return F.Pass;var Te=ye(W,se[ie].head);if(!Te||U.indexOf(Te)%2!=0)return F.Pass}W.operation(function(){var We=W.lineSeparator()||`
|
|
`;W.replaceSelection(We+We,null),W.execCommand("goCharLeft"),se=W.listSelections();for(var pe=0;pe<se.length;pe++){var be=se[pe].head.line;W.indentLine(be,null,!0),W.indentLine(be+1,null,!0)}})}function $(W){var P=F.cmpPos(W.anchor,W.head)>0;return{anchor:new oe(W.anchor.line,W.anchor.ch+(P?-1:1)),head:new oe(W.head.line,W.head.ch+(P?1:-1))}}function re(W,P){var U=D(W);if(!U||W.getOption("disableInput"))return F.Pass;var se=Oe(U,"pairs"),ie=se.indexOf(P);if(ie==-1)return F.Pass;for(var Te=Oe(U,"closeBefore"),We=Oe(U,"triples"),pe=se.charAt(ie+1)==P,be=W.listSelections(),Re=ie%2==0,Q,me=0;me<be.length;me++){var Ae=be[me],J=Ae.head,y,Z=W.getRange(J,oe(J.line,J.ch+1));if(Re&&!Ae.empty())y="surround";else if((pe||!Re)&&Z==P)pe&&le(W,J)?y="both":We.indexOf(P)>=0&&W.getRange(J,oe(J.line,J.ch+3))==P+P+P?y="skipThree":y="skip";else if(pe&&J.ch>1&&We.indexOf(P)>=0&&W.getRange(oe(J.line,J.ch-2),J)==P+P){if(J.ch>2&&/\bstring/.test(W.getTokenTypeAt(oe(J.line,J.ch-2))))return F.Pass;y="addFour"}else if(pe){var X=J.ch==0?" ":W.getRange(oe(J.line,J.ch-1),J);if(!F.isWordChar(Z)&&X!=P&&!F.isWordChar(X))y="both";else return F.Pass}else if(Re&&(Z.length===0||/\s/.test(Z)||Te.indexOf(Z)>-1))y="both";else return F.Pass;if(!Q)Q=y;else if(Q!=y)return F.Pass}var w=ie%2?se.charAt(ie-1):P,ee=ie%2?P:se.charAt(ie+1);W.operation(function(){if(Q=="skip")W.execCommand("goCharRight");else if(Q=="skipThree")for(var j=0;j<3;j++)W.execCommand("goCharRight");else if(Q=="surround"){for(var A=W.getSelections(),j=0;j<A.length;j++)A[j]=w+A[j]+ee;W.replaceSelections(A,"around"),A=W.listSelections().slice();for(var j=0;j<A.length;j++)A[j]=$(A[j]);W.setSelections(A)}else Q=="both"?(W.replaceSelection(w+ee,null),W.triggerElectric(w+ee),W.execCommand("goCharLeft")):Q=="addFour"&&(W.replaceSelection(w+w+w+w,"before"),W.execCommand("goCharRight"))})}function ye(W,P){var U=W.getRange(oe(P.line,P.ch-1),oe(P.line,P.ch+1));return U.length==2?U:null}function le(W,P){var U=W.getTokenAt(oe(P.line,P.ch+1));return/\bstring/.test(U.type)&&U.start==P.ch&&(P.ch==0||!/\bstring/.test(W.getTokenTypeAt(P)))}})},GfqC:function(bt,Ye,C){"use strict";var F=C("q1tI"),ge=C.n(F),oe=C("TSYQ"),Oe=C.n(oe);function Ee(k,c){var l="cannot "+k.method+" "+k.action+" "+c.status+"'",g=new Error(l);return g.status=c.status,g.method=k.method,g.url=k.action,g}function G(k){var c=k.responseText||k.response;if(!c)return c;try{return JSON.parse(c)}catch(l){return c}}function M(k){var c=new XMLHttpRequest;k.onProgress&&c.upload&&(c.upload.onprogress=function(N){N.total>0&&(N.percent=N.loaded/N.total*100),k.onProgress(N)});var l=new FormData;k.data&&Object.keys(k.data).forEach(function(_){var N=k.data[_];if(Array.isArray(N)){N.forEach(function(de){l.append(_+"[]",de)});return}l.append(_,k.data[_])}),k.file instanceof Blob?l.append(k.filename,k.file,k.file.name):l.append(k.filename,k.file),c.onerror=function(N){k.onError(N)},c.onload=function(){return c.status<200||c.status>=300?k.onError(Ee(k,c),G(c)):k.onSuccess(G(c),c)},c.open(k.method,k.action,!0),k.withCredentials&&"withCredentials"in c&&(c.withCredentials=!0);var g=k.headers||{};return g["X-Requested-With"]!==null&&c.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(g).forEach(function(_){g[_]!==null&&c.setRequestHeader(_,g[_])}),c.send(l),{abort:function(){c.abort()}}}var D=+new Date,S=0;function z(){return"rc-upload-"+D+"-"+ ++S}function $(k,c){return k.indexOf(c,k.length-c.length)!==-1}var re=function(k,c){if(k&&c){var l=Array.isArray(c)?c:c.split(","),g=k.name||"",_=k.type||"",N=_.replace(/\/.*$/,"");return l.some(function(de){var _e=de.trim();return _e.charAt(0)==="."?$(g.toLowerCase(),_e.toLowerCase()):/\/\*$/.test(_e)?N===_e.replace(/\/.*$/,""):_===_e})}return!0};function ye(k,c){var l=k.createReader(),g=[];function _(){l.readEntries(function(N){var de=Array.prototype.slice.apply(N);g=g.concat(de);var _e=!de.length;_e?c(g):_()})}_()}var le=function(c,l,g){var _=function N(de,_e){_e=_e||"",de.isFile?de.file(function(ae){g(ae)&&(de.fullPath&&!ae.webkitRelativePath&&(Object.defineProperties(ae,{webkitRelativePath:{writable:!0}}),ae.webkitRelativePath=de.fullPath.replace(/^\//,""),Object.defineProperties(ae,{webkitRelativePath:{writable:!1}})),l([ae]))}):de.isDirectory&&ye(de,function(ae){ae.forEach(function(Se){N(Se,""+_e+de.name+"/")})})};c.forEach(function(N){_(N.webkitGetAsEntry())})},W=le,P=Object.assign||function(k){for(var c=1;c<arguments.length;c++){var l=arguments[c];for(var g in l)Object.prototype.hasOwnProperty.call(l,g)&&(k[g]=l[g])}return k},U=function(){function k(c,l){var g=[],_=!0,N=!1,de=void 0;try{for(var _e=c[Symbol.iterator](),ae;!(_=(ae=_e.next()).done)&&!(g.push(ae.value),l&&g.length===l);_=!0);}catch(Se){N=!0,de=Se}finally{try{!_&&_e.return&&_e.return()}finally{if(N)throw de}}return g}return function(c,l){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return k(c,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),se=function(){function k(c,l){for(var g=0;g<l.length;g++){var _=l[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(c,_.key,_)}}return function(c,l,g){return l&&k(c.prototype,l),g&&k(c,g),c}}();function ie(k,c,l){return c in k?Object.defineProperty(k,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):k[c]=l,k}function Te(k,c){var l={};for(var g in k){if(c.indexOf(g)>=0)continue;if(!Object.prototype.hasOwnProperty.call(k,g))continue;l[g]=k[g]}return l}function We(k,c){if(!(k instanceof c))throw new TypeError("Cannot call a class as a function")}function pe(k,c){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:k}function be(k,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);k.prototype=Object.create(c&&c.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(k,c):k.__proto__=c)}var Re=function(c){return Object.keys(c).reduce(function(l,g){return(g.substr(0,5)==="data-"||g.substr(0,5)==="aria-"||g==="role")&&(l[g]=c[g]),l},{})},Q=function(k){be(c,k);function c(){var l,g,_,N;We(this,c);for(var de=arguments.length,_e=Array(de),ae=0;ae<de;ae++)_e[ae]=arguments[ae];return N=(g=(_=pe(this,(l=c.__proto__||Object.getPrototypeOf(c)).call.apply(l,[this].concat(_e))),_),_.state={uid:z()},_.reqs={},_.onChange=function(Se){var ue=Se.target.files;_.uploadFiles(ue),_.reset()},_.onClick=function(Se){var ue=_.fileInput;if(!ue)return;var ce=_.props,H=ce.children,te=ce.onClick;H&&H.type==="button"&&(ue.parentNode.focus(),ue.parentNode.querySelector("button").blur()),ue.click(),te&&te(Se)},_.onKeyDown=function(Se){Se.key==="Enter"&&_.onClick()},_.onFileDrop=function(Se){var ue=_.props.multiple;if(Se.preventDefault(),Se.type==="dragover")return;if(_.props.directory)W(Array.prototype.slice.call(Se.dataTransfer.items),_.uploadFiles,function(H){return re(H,_.props.accept)});else{var ce=Array.prototype.slice.call(Se.dataTransfer.files).filter(function(H){return re(H,_.props.accept)});ue===!1&&(ce=ce.slice(0,1)),_.uploadFiles(ce)}},_.uploadFiles=function(Se){var ue=Array.prototype.slice.call(Se);ue.map(function(ce){return ce.uid=z(),ce}).forEach(function(ce){_.upload(ce,ue)})},_.saveFileInput=function(Se){_.fileInput=Se},g),pe(_,N)}return se(c,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(g,_){var N=this,de=this.props;if(!de.beforeUpload)return setTimeout(function(){return N.post(g)},0);var _e=de.beforeUpload(g,_);_e&&_e.then?_e.then(function(ae){var Se=Object.prototype.toString.call(ae);return Se==="[object File]"||Se==="[object Blob]"?N.post(ae):N.post(g)}).catch(function(ae){console.log(ae)}):_e!==!1&&setTimeout(function(){return N.post(g)},0);return}},{key:"post",value:function(g){var _=this;if(!this._isMounted)return;var N=this.props,de=N.onStart,_e=N.onProgress,ae=N.transformFile,Se=ae===void 0?function(ue){return ue}:ae;new Promise(function(ue){var ce=N.action;return typeof ce=="function"&&(ce=ce(g)),ue(ce)}).then(function(ue){var ce=g.uid,H=N.customRequest||M,te=Promise.resolve(Se(g)).then(function(h){var T=N.data;return typeof T=="function"&&(T=T(h)),Promise.all([h,T])}).catch(function(h){console.error(h)});te.then(function(h){var T=U(h,2),m=T[0],R=T[1],Y={action:ue,filename:N.name,data:R,file:m,headers:N.headers,withCredentials:N.withCredentials,method:N.method||"post",onProgress:_e?function(B){_e(B,g)}:null,onSuccess:function(ne,ke){delete _.reqs[ce],N.onSuccess(ne,g,ke)},onError:function(ne,ke){delete _.reqs[ce],N.onError(ne,ke,g)}};de(g),_.reqs[ce]=H(Y)})})}},{key:"reset",value:function(){this.setState({uid:z()})}},{key:"abort",value:function(g){var _=this.reqs;if(g){var N=g;g&&g.uid&&(N=g.uid),_[N]&&_[N].abort&&_[N].abort(),delete _[N]}else Object.keys(_).forEach(function(de){_[de]&&_[de].abort&&_[de].abort(),delete _[de]})}},{key:"render",value:function(){var g,_=this.props,N=_.component,de=_.prefixCls,_e=_.className,ae=_.disabled,Se=_.id,ue=_.style,ce=_.multiple,H=_.accept,te=_.children,h=_.directory,T=_.openFileDialogOnClick,m=_.onMouseEnter,R=_.onMouseLeave,Y=Te(_,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),B=Oe()((g={},ie(g,de,!0),ie(g,de+"-disabled",ae),ie(g,_e,_e),g)),ne=ae?{}:{onClick:T?this.onClick:function(){},onKeyDown:T?this.onKeyDown:function(){},onMouseEnter:m,onMouseLeave:R,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return ge.a.createElement(N,P({},ne,{className:B,role:"button",style:ue}),ge.a.createElement("input",P({},Re(Y),{id:Se,type:"file",ref:this.saveFileInput,onClick:function(je){return je.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:H,directory:h?"directory":null,webkitdirectory:h?"webkitdirectory":null,multiple:ce,onChange:this.onChange})),te)}}]),c}(F.Component),me=Q,Ae=Object.assign||function(k){for(var c=1;c<arguments.length;c++){var l=arguments[c];for(var g in l)Object.prototype.hasOwnProperty.call(l,g)&&(k[g]=l[g])}return k},J=function(){function k(c,l){for(var g=0;g<l.length;g++){var _=l[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(c,_.key,_)}}return function(c,l,g){return l&&k(c.prototype,l),g&&k(c,g),c}}();function y(k,c){if(!(k instanceof c))throw new TypeError("Cannot call a class as a function")}function Z(k,c){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:k}function X(k,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);k.prototype=Object.create(c&&c.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(k,c):k.__proto__=c)}function w(){}var ee=function(k){X(c,k);function c(){var l,g,_,N;y(this,c);for(var de=arguments.length,_e=Array(de),ae=0;ae<de;ae++)_e[ae]=arguments[ae];return N=(g=(_=Z(this,(l=c.__proto__||Object.getPrototypeOf(c)).call.apply(l,[this].concat(_e))),_),_.saveUploader=function(Se){_.uploader=Se},g),Z(_,N)}return J(c,[{key:"abort",value:function(g){this.uploader.abort(g)}},{key:"render",value:function(){return ge.a.createElement(me,Ae({},this.props,{ref:this.saveUploader}))}}]),c}(F.Component);ee.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:w,onError:w,onSuccess:w,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var j=ee,A=Ye.a=j},Gytx:function(bt,Ye){bt.exports=function(F,ge,oe,Oe){var Ee=oe?oe.call(Oe,F,ge):void 0;if(Ee!==void 0)return!!Ee;if(F===ge)return!0;if(typeof F!="object"||!F||typeof ge!="object"||!ge)return!1;var G=Object.keys(F),M=Object.keys(ge);if(G.length!==M.length)return!1;for(var D=Object.prototype.hasOwnProperty.bind(ge),S=0;S<G.length;S++){var z=G[S];if(!D(z))return!1;var $=F[z],re=ge[z];if(Ee=oe?oe.call(Oe,$,re,z):void 0,Ee===!1||Ee===void 0&&$!==re)return!1}return!0}},HmJG:function(bt,Ye,C){},LdHM:function(bt,Ye,C){"use strict";C.d(Ye,"b",function(){return Te}),C.d(Ye,"a",function(){return pe});var F=C("1OyB"),ge=C("vuIU"),oe=C("Ji7U"),Oe=C("LK+K"),Ee=C("q1tI"),G=C("rePB"),M=C("Ff2n"),D=C("ODXe"),S=C("4IlW"),z=C("bX4T"),$=C("YrtM"),re=C("TSYQ"),ye=C.n(re),le=C("+nKL"),W=C("8OUc"),P=function(g,_){var N=g.prefixCls,de=g.id,_e=g.flattenOptions,ae=g.childrenAsData,Se=g.values,ue=g.searchValue,ce=g.multiple,H=g.defaultActiveFirstOption,te=g.height,h=g.itemHeight,T=g.notFoundContent,m=g.open,R=g.menuItemSelectedIcon,Y=g.virtual,B=g.onSelect,ne=g.onToggleOpen,ke=g.onActiveValue,je=g.onScroll,Pe=g.onMouseEnter,we="".concat(N,"-item"),Me=Object($.a)(function(){return _e},[m,_e],function(Ie,I){return I[0]&&Ie[1]!==I[1]}),Ge=Ee.useRef(null),Ve=function(I){I.preventDefault()},Ke=function(I){Ge.current&&Ge.current.scrollTo({index:I})},qe=function(I){for(var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,x=Me.length,f=0;f<x;f+=1){var p=(I+f*L+x)%x,v=Me[p],b=v.group,V=v.data;if(!b&&!V.disabled)return p}return-1},ht=Ee.useState(function(){return qe(0)}),nt=Object(D.a)(ht,2),Xe=nt[0],ve=nt[1],at=function(I){ve(I);var L=Me[I];if(!L){ke(null,-1);return}ke(L.data.value,I)};Ee.useEffect(function(){at(H!==!1?qe(0):-1)},[Me.length,ue]),Ee.useEffect(function(){var Ie=setTimeout(function(){if(!ce&&m&&Se.size===1){var I=Array.from(Se)[0],L=Me.findIndex(function(x){var f=x.data;return f.value===I});at(L),Ke(L)}});return function(){return clearTimeout(Ie)}},[m]);var Je=function(I){I!==void 0&&B(I,{selected:!Se.has(I)}),ce||ne(!1)};if(Ee.useImperativeHandle(_,function(){return{onKeyDown:function(I){var L=I.which;switch(L){case S.a.UP:case S.a.DOWN:{var x=0;if(L===S.a.UP?x=-1:L===S.a.DOWN&&(x=1),x!==0){var f=qe(Xe+x,x);Ke(f),at(f)}break}case S.a.ENTER:{var p=Me[Xe];p&&!p.data.disabled?Je(p.data.value):Je(void 0),m&&I.preventDefault();break}case S.a.ESC:ne(!1)}},onKeyUp:function(){},scrollTo:function(I){Ke(I)}}}),Me.length===0)return Ee.createElement("div",{role:"listbox",id:"".concat(de,"_list"),className:"".concat(we,"-empty"),onMouseDown:Ve},T);function Ce(Ie){var I=Me[Ie];if(!I)return null;var L=I.data||{},x=L.value,f=L.label,p=L.children,v=Object(z.a)(L,!0),b=ae?p:f;return I?Ee.createElement("div",Object.assign({"aria-label":typeof b=="string"?b:null},v,{key:Ie,role:"option",id:"".concat(de,"_list_").concat(Ie),"aria-selected":Se.has(x)}),x):null}return Ee.createElement(Ee.Fragment,null,Ee.createElement("div",{role:"listbox",id:"".concat(de,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ce(Xe-1),Ce(Xe),Ce(Xe+1)),Ee.createElement(le.a,{itemKey:"key",ref:Ge,data:Me,height:te,itemHeight:h,fullHeight:!1,onMouseDown:Ve,onScroll:je,virtual:Y,onMouseEnter:Pe},function(Ie,I){var L,x=Ie.group,f=Ie.groupOption,p=Ie.data,v=p.label,b=p.key;if(x)return Ee.createElement("div",{className:ye()(we,"".concat(we,"-group"))},v!==void 0?v:b);var V=p.disabled,fe=p.value,Le=p.title,tt=p.children,rt=p.style,ot=p.className,st=Object(M.a)(p,["disabled","value","title","children","style","className"]),it=Se.has(fe),ze="".concat(we,"-option"),ct=ye()(we,ze,ot,(L={},Object(G.a)(L,"".concat(ze,"-grouped"),f),Object(G.a)(L,"".concat(ze,"-active"),Xe===I&&!V),Object(G.a)(L,"".concat(ze,"-disabled"),V),Object(G.a)(L,"".concat(ze,"-selected"),it),L)),ft=ae?tt:v,_t=!R||typeof R=="function"||it;return Ee.createElement("div",Object.assign({},st,{"aria-selected":it,className:ct,title:Le,onMouseMove:function(){if(Xe===I||V)return;at(I)},onClick:function(){V||Je(fe)},style:rt}),Ee.createElement("div",{className:"".concat(ze,"-content")},ft||fe),Ee.isValidElement(R)||it,_t&&Ee.createElement(W.a,{className:"".concat(we,"-option-state"),customizeIcon:R,customizeIconProps:{isSelected:it}},it?"\u2713":null))}))},U=Ee.forwardRef(P);U.displayName="OptionList";var se=U,ie=function(){return null};ie.isSelectOption=!0;var Te=ie,We=function(){return null};We.isSelectOptGroup=!0;var pe=We,be=C("VTBJ"),Re=C("Zm9Q");function Q(l){var g=l.key,_=l.props,N=_.children,de=_.value,_e=Object(M.a)(_,["children","value"]);return Object(be.a)({key:g,value:de!==void 0?de:g,children:N},_e)}function me(l){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Re.a)(l).map(function(_,N){if(!Ee.isValidElement(_)||!_.type)return null;var de=_.type.isSelectOptGroup,_e=_.key,ae=_.props,Se=ae.children,ue=Object(M.a)(ae,["children"]);return g||!de?Q(_):Object(be.a)(Object(be.a)({key:"__RC_SELECT_GRP__".concat(_e===null?N:_e,"__"),label:_e},ue),{},{options:me(Se)})}).filter(function(_){return _})}var Ae=C("2Qr1"),J=C("qNPg"),y=C("U8pU"),Z=C("Kwbf"),X=C("WKfj");function w(l){var g=l.mode,_=l.options,N=l.children,de=l.backfill,_e=l.allowClear,ae=l.placeholder,Se=l.getInputElement,ue=l.showSearch,ce=l.onSearch,H=l.defaultOpen,te=l.autoFocus,h=l.labelInValue,T=l.value,m=l.inputValue,R=l.optionLabelProp,Y=g==="multiple"||g==="tags",B=ue!==void 0?ue:Y||g==="combobox",ne=_||me(N);if(Object(Z.a)(g!=="tags"||ne.every(function(we){return!we.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),g==="tags"||g==="combobox"){var ke=ne.some(function(we){return we.options?we.options.some(function(Me){return typeof("value"in Me?Me.value:Me.key)=="number"}):typeof("value"in we?we.value:we.key)=="number"});Object(Z.a)(!ke,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(Z.a)(g!=="combobox"||!R,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(Z.a)(g==="combobox"||!de,"`backfill` only works with `combobox` mode."),Object(Z.a)(g==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(Z.b)(g!=="combobox"||!Se||!_e||!ae,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ce&&!B&&g!=="combobox"&&g!=="tags"&&Object(Z.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(Z.b)(!H||te,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),T!=null){var je=Object(X.d)(T);Object(Z.a)(!h||je.every(function(we){return Object(y.a)(we)==="object"&&("key"in we||"value"in we)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(Z.a)(!Y||Array.isArray(T),"`value` should be array when `mode` is `multiple` or `tags`")}if(N){var Pe=null;Object(Re.a)(N).some(function(we){if(!Ee.isValidElement(we)||!we.type)return!1;var Me=we.type;if(Me.isSelectOption)return!1;if(Me.isSelectOptGroup){var Ge=Object(Re.a)(we.props.children).every(function(Ve){return!Ee.isValidElement(Ve)||!we.type||Ve.type.isSelectOption?!0:(Pe=Ve.type,!1)});return!Ge}return Pe=Me,!0}),Pe&&Object(Z.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Pe.displayName||Pe.name||Pe,"`.")),Object(Z.a)(m===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var ee=w,j=Object(J.a)({prefixCls:"rc-select",components:{optionList:se},convertChildrenToData:me,flattenOptions:Ae.d,getLabeledValue:Ae.e,filterOptions:Ae.b,isValueDisabled:Ae.g,findValueOption:Ae.c,warningProps:ee,fillOptionsWithMissingValue:Ae.a}),A=function(l){Object(oe.a)(_,l);var g=Object(Oe.a)(_);function _(){var N;return Object(F.a)(this,_),N=g.apply(this,arguments),N.selectRef=Ee.createRef(),N.focus=function(){N.selectRef.current.focus()},N.blur=function(){N.selectRef.current.blur()},N}return Object(ge.a)(_,[{key:"render",value:function(){return Ee.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),_}(Ee.Component);A.Option=Te,A.OptGroup=pe;var k=A,c=Ye.c=k},M8RZ:function(bt,Ye,C){"use strict";C.d(Ye,"a",function(){return S});var F=C("fWQN"),ge=C("mtLc"),oe=C("yKVA"),Oe=C("879j"),Ee=C("q1tI"),G=C.n(Ee),M=C("i8i4"),D=C.n(M),S=function(z){Object(oe.a)(re,z);var $=Object(Oe.a)(re);function re(ye){var le;Object(F.a)(this,re),le=$.call(this,ye);var W=window.document;return le.node=W.createElement("div"),W.body.appendChild(le.node),le}return Object(ge.a)(re,[{key:"render",value:function(){var le=this.props.children;return Object(M.createPortal)(le,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),re}(G.a.Component)},OLES:function(bt,Ye,C){"use strict";var F=C("U8pU"),ge=C("VTBJ"),oe=C("Ff2n"),Oe=C("q1tI"),Ee=C("uciX"),G=C("7ixt"),M=function(ye){var le=ye.overlay,W=ye.prefixCls,P=ye.id,U=ye.overlayInnerStyle;return Oe.createElement("div",{className:"".concat(W,"-inner"),id:P,role:"tooltip",style:U},typeof le=="function"?le():le)},D=M,S=function(ye,le){var W=ye.overlayClassName,P=ye.trigger,U=P===void 0?["hover"]:P,se=ye.mouseEnterDelay,ie=se===void 0?0:se,Te=ye.mouseLeaveDelay,We=Te===void 0?.1:Te,pe=ye.overlayStyle,be=ye.prefixCls,Re=be===void 0?"rc-tooltip":be,Q=ye.children,me=ye.onVisibleChange,Ae=ye.afterVisibleChange,J=ye.transitionName,y=ye.animation,Z=ye.placement,X=Z===void 0?"right":Z,w=ye.align,ee=w===void 0?{}:w,j=ye.destroyTooltipOnHide,A=j===void 0?!1:j,k=ye.defaultVisible,c=ye.getTooltipContainer,l=ye.overlayInnerStyle,g=Object(oe.a)(ye,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),_=Object(Oe.useRef)(null);Object(Oe.useImperativeHandle)(le,function(){return _.current});var N=Object(ge.a)({},g);"visible"in ye&&(N.popupVisible=ye.visible);var de=function(){var ce=ye.arrowContent,H=ce===void 0?null:ce,te=ye.overlay,h=ye.id;return[Oe.createElement("div",{className:"".concat(Re,"-arrow"),key:"arrow"},H),Oe.createElement(D,{key:"content",prefixCls:Re,id:h,overlay:te,overlayInnerStyle:l})]},_e=!1,ae=!1;if(typeof A=="boolean")_e=A;else if(A&&Object(F.a)(A)==="object"){var Se=A.keepParent;_e=Se===!0,ae=Se===!1}return Oe.createElement(Ee.a,Object.assign({popupClassName:W,prefixCls:Re,popup:de,action:U,builtinPlacements:G.a,popupPlacement:X,ref:_,popupAlign:ee,getPopupContainer:c,onPopupVisibleChange:me,afterPopupVisibleChange:Ae,popupTransitionName:J,popupAnimation:y,defaultPopupVisible:k,destroyPopupOnHide:_e,autoDestroy:ae,mouseLeaveDelay:We,popupStyle:pe,mouseEnterDelay:ie},N),Q)},z=Object(Oe.forwardRef)(S),$=Ye.a=z},Ot1p:function(bt,Ye,C){"use strict";var F=C("2qtc"),ge=C("kLXV"),oe=C("rAM+"),Oe=C("miYZ"),Ee=C("tsqr"),G=C("tJVT"),M=C("jrin"),D=C("q1tI"),S=C.n(D),z=C("VrN/"),$=C.n(z),re=C("bdgK"),ye=C("p77/"),le=C("Bd2K"),W=C("ELLl"),P=C("19Vz"),U=C("lZu9"),se=C("+NIl"),ie=C("kSUc"),Te=C("9Bee"),We=function(x){var f=x.value,p=f===void 0?"":f,v=x.className,b=x.showTextOnly,V=x.showLines,fe=x.style,Le=fe===void 0?{}:fe,tt=Object(D.useMemo)(function(){return""},[p]);return S.a.createElement(S.a.Fragment,null,S.a.createElement("div",{dangerouslySetInnerHTML:{__html:tt}}))},pe=C("0Owb"),be=C("dejd"),Re=C("C+DQ"),Q=[{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 me(x){var f=x.onActionCallback,p=x.title,v=x.icon,b=x.actionName,V=x.className,fe=V===void 0?"":V,Le=x.children;function tt(){f(b)}return S.a.createElement("a",{title:p,className:fe,onClick:tt},S.a.createElement("i",{className:"md-iconfont ".concat(v)}),Le)}var Ae=function(x){var f=x.watch,p=x.showNullButton,v=x.onActionCallback,b=x.fullScreen,V=x.insertTemp,fe=x.hidetoolBar,Le=[].concat(Q,[{title:"".concat(f?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(f?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return S.a.createElement("ul",{className:"markdown-toolbar-container"},!fe&&Le.map(function(tt,rt){return S.a.createElement("li",{key:rt},tt.actionName?S.a.createElement(me,Object(pe.a)({},tt,{onActionCallback:v})):S.a.createElement("span",{className:"v-line"}))}),p?S.a.createElement("li",null,S.a.createElement(me,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:v},S.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,V&&S.a.createElement("li",null,S.a.createElement(me,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(V),onActionCallback:v},S.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),S.a.createElement("li",{className:"btn-full-screen"},S.a.createElement(me,{icon:"".concat(b?"icon-shrink":"icon-enlarge"),title:b?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:v})))},J=C("M8RZ"),y=C("+L6B"),Z=C("2/Rp"),X=C("y8nQ"),w=C("Vl3Y"),ee=C("5NDa"),j=C("5rEg"),A={labelCol:{span:4},wrapperCol:{span:20}},k=function(x){var f=x.callback,p=x.onCancel;function v(b){f(b)}return S.a.createElement(w.a,Object(pe.a)({},A,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:v}),S.a.createElement(w.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},S.a.createElement(j.a,null)),S.a.createElement(w.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},S.a.createElement(j.a,null)),S.a.createElement("div",{className:"flex-container flex-end"},S.a.createElement(Z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),S.a.createElement(Z.a,{type:"ghost",onClick:p},"\u53D6\u6D88")))},c=C("7ahc"),l=C("HmJG"),g=C("BjJ7"),_=w.a.useForm,N={width:280,marginRight:10},de={labelCol:{span:5},wrapperCol:{span:19}},_e=function(x){var f=x.callback,p=x.onCancel,v=_(),b=Object(G.a)(v,1),V=b[0];function fe(rt){f(rt)}function Le(rt,ot){V.setFieldsValue({src:"/api/attachments/".concat(rt.id),type:ot.type})}function tt(rt){var ot=rt.target.files[0];Se(ot,Le)}return S.a.createElement(w.a,Object(pe.a)({form:V},de,{className:"upload-image-panel",onFinish:fe}),S.a.createElement(w.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},S.a.createElement("div",{className:"flex-container"},S.a.createElement(w.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},S.a.createElement(j.a,{style:N})),S.a.createElement(ae,{onFileChange:tt}))),S.a.createElement(w.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},S.a.createElement(j.a,{style:{width:264}})),S.a.createElement(w.a.Item,{style:{textAlign:"right"}},S.a.createElement(Z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),S.a.createElement(Z.a,{type:"ghost",onClick:p},"\u53D6\u6D88")))};function ae(x){var f=x.onFileChange;return S.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",S.a.createElement("input",{type:"file",onChange:f}))}function Se(x,f){if(!x)throw new String("\u6CA1\u6709\u6587\u4EF6");var p=new FormData;p.append("editormd-image-file",x),p.append("file_param_name","editormd-image-file"),p.append("byxhr","true");var v=new window.XMLHttpRequest;v.withCredentials=!0,v.addEventListener("load",function(b){f(JSON.parse(b.target.responseText),x)},!1),v.addEventListener("error",function(b){console.error(b)},!1),v.open("POST","".concat(g.a,"/api/attachments.json")),v.send(p)}var ue=C("giR+"),ce=C("fyUT"),H=C("7Kak"),te=C("9yH6"),h=te.a.Group,T={margin:"0 8px"},m=function(x){var f=x.callback,p=x.onCancel;function v(b){f(b)}return S.a.createElement(w.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:v},S.a.createElement("div",{className:"flex-container"},S.a.createElement("span",{style:T},"\u5355\u5143\u683C\u6570\uFF1A"),S.a.createElement("span",{style:T},"\u884C\u6570"),S.a.createElement(w.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},S.a.createElement(ce.a,null)),S.a.createElement("span",{style:T},"\u5217\u6570"),S.a.createElement(w.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},S.a.createElement(ce.a,null))),S.a.createElement("div",{className:"flex-container",style:{marginTop:12}},S.a.createElement("span",{style:T},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),S.a.createElement(w.a.Item,{name:"align"},S.a.createElement(h,null,S.a.createElement(te.a,{value:"default"},S.a.createElement("i",{className:"fa fa-align-justify"})),S.a.createElement(te.a,{value:"left"},S.a.createElement("i",{className:"fa fa-align-left"})),S.a.createElement(te.a,{value:"center"},S.a.createElement("i",{className:"fa fa-align-center"})),S.a.createElement(te.a,{value:"right"},S.a.createElement("i",{className:"fa fa-align-right"}))))),S.a.createElement("div",{className:"flex-container flex-end"},S.a.createElement(Z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),S.a.createElement(Z.a,{type:"ghost",onClick:p},"\u53D6\u6D88")))},R=C("m3rI"),Y=C("wMS7"),B=C.n(Y),ne="link",ke="upload-image",je="code-block",Pe="add-table",we="------------",Me={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},Ge=C("9VGf"),Ve,Ke;function qe(){}var ht=0,nt=1e4,Xe="\u2581",ve=`
|
|
**\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 at(x){return/^\d+$/.test(x)?"".concat(x,"px"):x}var Je=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ce=Je?"Cmd":"Ctrl",Ie=(Ve={},Object(M.a)(Ve,Ce+"-B","bold"),Object(M.a)(Ve,Ce+"-I","italic"),Ve),I=(Ke={},Object(M.a)(Ke,ne,"\u6DFB\u52A0\u94FE\u63A5"),Object(M.a)(Ke,je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(M.a)(Ke,ke,"\u6DFB\u52A0\u56FE\u7247"),Object(M.a)(Ke,Pe,"\u6DFB\u52A0\u8868\u683C"),Ke),L=Ye.a=function(x){var f=x.defaultValue,p=f===void 0?"":f,v=x.onChange,b=x.width,V=b===void 0?"100%":b,fe=x.height,Le=fe===void 0?400:fe,tt=x.miniToolbar,rt=tt===void 0?!1:tt,ot=x.isFocus,st=ot===void 0?!1:ot,it=x.watch,ze=x.insertTemp,ct=x.mode,ft=ct===void 0?"markdown":ct,_t=x.id,kt=_t===void 0?"markdown-editor-id":_t,vt=x.showResizeBar,Bt=vt===void 0?!1:vt,Ut=x.noStorage,zt=Ut===void 0?!1:Ut,pn=x.showNullButton,an=pn===void 0?!1:pn,nr=x.hidetoolBar,An=nr===void 0?!1:nr,Rn=x.fullScreen,Wn=Rn===void 0?!1:Rn,Dt=x.onBlur,Qe=x.onCMBeforeChange,tn=x.onFullScreen,Gn=x.className,mn=Gn===void 0?"":Gn,Ct=x.disablePaste,kn=Ct===void 0?!1:Ct,Pn=x.placeholder,Ln=Pn===void 0?"":Pn,Ne=x.values,mt=Ne===void 0?"":Ne,Sn=Object(D.useState)(null),Dn=Object(G.a)(Sn,2),Fe=Dn[0],Xn=Dn[1],Tr=Object(D.useState)(p),pt=Object(G.a)(Tr,2),un=pt[0],Hn=pt[1],Vn=Object(D.useState)(it),cn=Object(G.a)(Vn,2),Mn=cn[0],dt=cn[1],he=Object(D.useState)(Wn),Ze=Object(G.a)(he,2),lt=Ze[0],Tt=Ze[1],dn=Object(D.useState)(""),$t=Object(G.a)(dn,2),jt=$t[0],Rt=$t[1],Or=Object(D.useState)(0),En=Object(G.a)(Or,2),Nn=En[0],gn=En[1],ki=Object(D.useState)(Le),Si=Object(G.a)(ki,2),pr=Si[0],rr=Si[1],Zi=Object(D.useState)(!1),Ti=Object(G.a)(Zi,2),Fa=Ti[0],qr=Ti[1],$n=Object(D.useRef)(),Ar=Object(D.useRef)(),Lr=Object(D.useRef)(),mr=Object(D.useRef)();Object(D.useEffect)(function(){Hn(mt),Fe==null||Fe.setValue(mt)},[mt]),Object(D.useEffect)(function(){tn==null||tn(lt)},[lt]),Object(D.useEffect)(function(){if($n.current){var yt=$.a.fromTextArea($n.current,{mode:ft,lineNumbers:!rt,lineWrapping:!0,value:p,autoCloseTags:!0,autoCloseBrackets:!0});st&&yt.focus();function xt(wt,St){if(kn){St.preventDefault();return}var At=St.clipboardData;if(At){var Pt=At.types.toString(),Ft=At.items,Yt=["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"];if(Pt==="Files"||At.types.indexOf("Files")>-1){if(St.preventDefault(),ft=="stex")return;try{var qt,qn=Ft[1];((qt=Ft[0])===null||qt===void 0?void 0:qt.kind)==="file"&&(qn=Ft[0]);var Kt=qn.getAsFile(),ar=Kt.name.split(".").pop();Se(Kt,function(on){if(on.id){var Jn,Zn,Qr;(Kt==null||((Jn=Kt.type)===null||Jn===void 0)?void 0:Jn.indexOf("image"))>-1?yt.replaceSelection(".concat(on.content_type,")")):(Kt==null||((Zn=Kt.type)===null||Zn===void 0)?void 0:Zn.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(R.a.API_SERVER,"/api/attachments/").concat(on.id,'"></video>')):(Kt==null||((Qr=Kt.type)===null||Qr===void 0)?void 0:Qr.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(R.a.API_SERVER,"/api/attachments/").concat(on.id,"?type=").concat(Kt.type,'&disposition=inline" target="_blank">').concat(Kt.name,"</a>")):Yt.includes(ar)?yt.replaceSelection('<a href="'.concat(R.a.API_SERVER,"/api/attachments/").concat(on.id,'?type=office&disposition=inline" target="_blank">').concat(Kt.name,"</a>")):yt.replaceSelection("[".concat(Kt.name,"](").concat(R.a.API_SERVER,"/api/attachments/").concat(on.id,"?type=").concat(on.content_type,")"))}else(on==null?void 0:on.status)===401&&(document.location.href="/user/login")})}catch(on){Ee.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",xt),Xn(yt),function(){yt.off("paste",xt)}}},[]);var Jr=Object(D.useCallback)(function(){if(Ar.current)try{}catch(yt){console.log(yt,"---- to set md editor body height")}},[pr,Ar,lt]);Object(D.useEffect)(function(){function yt(){var wt=new re.default(function(St){var At=Object(oe.a)(St),Pt;try{for(At.s();!(Pt=At.n()).done;){var Ft=Pt.value;(Ft.target.offsetHeight>0||Ft.target.offsetWidth>0)&&(Jr(),Fe.setSize("100%","100%"),Fe.refresh())}}catch(Yt){At.e(Yt)}finally{At.f()}});return wt.observe($n.current.parentElement),wt}if(Fe){var xt=yt();return function(){xt.unobserve($n.current.parentElement)}}},[Fe,Jr]),Object(D.useEffect)(function(){if(Fe){for(var yt=[],xt=function(){var Ft=St[wt];At=Object(G.a)(Ft,2);var Yt=At[0],qt=At[1],qn=Object(M.a)({},Yt,function(){gr(qt)});yt.push(qn),Fe.addKeyMap(qn)},wt=0,St=Object.entries(Ie);wt<St.length;wt++){var At;xt()}return function(){var Pt=Object(oe.a)(yt),Ft;try{for(Pt.s();!(Ft=Pt.n()).done;){var Yt=Ft.value;Fe.removeKeyMap(Yt)}}catch(qt){Pt.e(qt)}finally{Pt.f()}}}},[Fe]),Object(D.useEffect)(function(){Wn!==lt&&Tt(Wn)},[Wn]),Object(Ge.a)(function(){if(!zt&&Nn>0){var yt=new Date().getTime(),xt=window.sessionStorage.getItem(kt);yt>=Nn+nt&&(!xt||xt!==un)&&(window.sessionStorage.setItem(kt,un),qr(!0))}},nt),Object(D.useEffect)(function(){dt(it)},[Fe,it]),Object(D.useEffect)(function(){Fe&&(st&&Fe.focus())},[Fe,st]),Object(D.useEffect)(function(){if(Mn&&Fe){var yt=Fe.getScrollerElement();function xt(wt){var St=wt.target;if(mr.current){var At=St.scrollTop/St.scrollHeight;mr.current.scrollTop=mr.current.scrollHeight*At}}return yt.addEventListener("scroll",xt),function(){yt.removeEventListener("scroll",xt)}}},[Fe,Mn]),Object(D.useEffect)(function(){if(Fe&&Qe){function yt(xt,wt){Qe(xt,wt)}return Fe.on("beforeChange",yt),function(){Fe.off("beforeChange",yt)}}},[Fe,Qe]),Object(D.useEffect)(function(){if(Fe&&Dt){function yt(){Dt(Fe.getValue())}return Fe.on("blur",yt),function(){Fe.off("blur",yt)}}},[Fe,Dt]),Object(D.useEffect)(function(){if(Fe){function yt(xt){var wt=B.a.sanitize(xt.getValue());Hn(wt),gn(new Date().getTime()),xt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),v&&v(wt)}return Fe.on("change",yt),function(){Fe.off("change",yt)}}},[Fe,v]),Object(D.useEffect)(function(){Fe&&(p==null?(Fe.setValue(""),Hn("")):p!==Fe.getValue()&&(Fe.setValue(p),Hn(p),Fe.setCursor(Fe.lineCount(),0)))},[Fe,p]);var gr=Object(D.useCallback)(function(yt){var xt=Fe.getCursor(),wt=Fe.getSelection(),St=wt.split(`
|
|
`);switch(yt){case"bold":return Fe.replaceSelection("**"+wt+"**"),wt===""&&Fe.setCursor(xt.line,xt.ch+2),Fe.focus();case"italic":return Fe.replaceSelection("*"+wt+"*"),wt===""&&Fe.setCursor(xt.line,xt.ch+1),Fe.focus();case"code":return Fe.replaceSelection("`"+wt+"`"),wt===""&&Fe.setCursor(xt.line,xt.ch+1),Fe.focus();case"inline-latex":return Fe.replaceSelection("`$$"+wt+"$$`"),wt===""&&Fe.setCursor(xt.line,xt.ch+3),Fe.focus();case"latex":return Fe.replaceSelection("```latex\n"+wt+"\n```"),Fe.setCursor(xt.line+1,wt.length+1),Fe.focus();case"line-break":return Fe.replaceSelection(`<br/>
|
|
`),Fe.focus();case"list-ul":return wt===""?Fe.replaceSelection("- "+wt):Fe.replaceSelection(St.map(function(At){return At===""?"":"- ".concat(At)}).join(`
|
|
`)),Fe.focus();case"list-ol":return wt===""?Fe.replaceSelection("1. "+wt):Fe.replaceSelection(St.map(function(At,Pt){return At===""?"":"".concat(Pt+1,". ").concat(At)}).join(`
|
|
`)),Fe.focus();case"add-null-ch":return wt===""&&Fe.setCursor(xt.line,xt.ch+1),Fe.replaceSelection(Xe),Fe.focus();case"inster-template-1":return wt===""&&Fe.setCursor(xt.line,xt.ch),Fe.replaceSelection(ve),Fe.focus();case"eraser":return Fe.setValue(""),Fe.focus();case"trigger-watch":return dt(!Mn),Fe.focus();case"trigger-full-screen":return Tt(!lt),Fe.focus();case ne:Rt(ne);return;case je:Rt(je);return;case ke:Rt(ke);return;case Pe:Rt(Pe);return;default:throw new Error}},[Fe,Mn,lt]),Yn=Object(D.useCallback)(function(yt){Rt("");switch(jt){case ne:var xt=yt.title,wt=yt.link;return Fe.replaceSelection("[".concat(xt,"](").concat(wt,")")),Fe.focus();case je:var St=yt.language,At=yt.content;return Fe.replaceSelection(["```"+St,At,"```"].join(`
|
|
`)),Fe.focus();case ke:var Pt=yt.src,Ft=yt.alt;return Fe.replaceSelection(".concat(Pt,' "').concat(Ft,'" )')),Fe.focus();case Pe:for(var Yt=yt.row,qt=yt.col,qn=yt.align,Kt=`
|
|
`,ar=0;ar<Yt;ar++){for(var on=[],Jn=[],Zn=0;Zn<qt;Zn++)ar===1&&Jn.push(Me[qn]),on.push(" ");ar===1&&(Kt+="| ".concat(Jn.join(" | "),` |
|
|
`)),Kt+="| ".concat(on.join(qt===1?"":" | "),` |
|
|
`)}return Fe.replaceSelection(Kt+`
|
|
`),Fe.focus();default:throw new Error}},[Fe,jt]),Zr=Object(D.useMemo)(function(){switch(jt){case ne:return S.a.createElement(k,{callback:Yn,onCancel:ir});case je:return S.a.createElement(c.b,{callback:Yn,onCancel:ir});case ke:return S.a.createElement(_e,{callback:Yn,onCancel:ir});case Pe:return S.a.createElement(m,{callback:Yn,onCancel:ir});default:return null}},[jt]);function ir(){Rt("")}Object(D.useEffect)(function(){if(Lr.current){var yt=Lr.current,xt=!1,wt=0;function St(Ft){xt=!0,wt=Ft.pageY}function At(){xt=!1}function Pt(Ft){if(xt){var Yt=Ft.pageY-wt;Yt<0&&(Yt=0),Yt>300&&(Yt=300);var qt=Le+Yt+"px";rr(qt)}}return yt.addEventListener("mousedown",St),document.addEventListener("mousemove",Pt),document.addEventListener("mouseup",At),function(){yt.removeEventListener("mousedown",St),document.removeEventListener("mousemove",Pt),document.removeEventListener("mouseup",At)}}},[Fe,Lr]),Object(D.useEffect)(function(){rr(Le)},[Le]);var Oi=at(V),Dr=at(pr),Qi={width:Oi,height:Dr},ea=Object(D.useMemo)(function(){if(Nn){var yt=new Date(Nn),xt=yt.getHours(),wt=yt.getMinutes(),St=yt.getSeconds();return xt=xt<10?"0"+xt:xt,wt=wt<10?"0"+wt:wt,St=St<10?"0"+St:St,"".concat(xt,":").concat(wt,":").concat(St)}return 0},[Nn]);function jn(){window.sessionStorage.removeItem(kt),qr(!1),gn(0)}function Wa(){qr(!1),gn(0),Fe.setValue(window.sessionStorage.getItem(kt))}return S.a.createElement(D.Fragment,null,S.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ar},S.a.createElement("div",{className:"markdown-editor-container ".concat(mn," ").concat(Mn?"on-preview":""," ").concat(rt?"mini":""," ").concat(lt?"full-screen":""),style:Qi},S.a.createElement(Ae,{insertTemp:ze,watch:Mn,fullScreen:lt,showNullButton:an,onActionCallback:gr,hidetoolBar:An}),S.a.createElement("div",{className:"markdown-editor-body"},S.a.createElement("div",{className:"codemirror-container"},S.a.createElement("textarea",{ref:$n,placeholder:Ln})),Mn?S.a.createElement("div",{ref:mr,className:"preview-container"},ft==="stex"&&S.a.createElement(We,{value:un}),ft!=="stex"&&S.a.createElement(Te.a,{value:un})):null))),Bt?S.a.createElement("a",{ref:Lr,className:"editor-resize"}):null,S.a.createElement(J.a,null,I[jt]?S.a.createElement(ge.a,{centered:!0,title:I[jt],visible:!0,onCancel:ir,footer:null},Zr):null))}},SJMd:function(bt,Ye){/**
|
|
* @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 C,F,ge,oe=!1,Oe,Ee;window.PR_SHOULD_USE_CONTINUATION=!0;var G,M;(function(){var D=window,S=["break,continue,do,else,for,if,return,while"],z=[S,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],$=[z,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],re=[$,"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"],ye=[$,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],le=[$,"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"],W="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",P=[$,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],U="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",se=[S,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],ie=[S,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],Te=[S,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],We=[re,le,ye,P,U,se,ie,Te],pe=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,be="str",Re="kwd",Q="com",me="typ",Ae="lit",J="pun",y="pln",Z="tag",X="dec",w="src",ee="atn",j="atv",A="nocode",k="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function c(B){for(var ne=0,ke=!1,je=!1,Pe=0,we=B.length;Pe<we;++Pe){var Me=B[Pe];if(Me.ignoreCase)je=!0;else if(/[a-z]/i.test(Me.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ke=!0,je=!1;break}}var Ge={b:8,t:9,n:10,v:11,f:12,r:13};function Ve(Xe){var ve=Xe.charCodeAt(0);if(ve!==92)return ve;var at=Xe.charAt(1);return ve=Ge[at],ve||("0"<=at&&at<="7"?parseInt(Xe.substring(1),8):at==="u"||at==="x"?parseInt(Xe.substring(2),16):Xe.charCodeAt(1))}function Ke(Xe){if(Xe<32)return(Xe<16?"\\x0":"\\x")+Xe.toString(16);var ve=String.fromCharCode(Xe);return ve==="\\"||ve==="-"||ve==="]"||ve==="^"?"\\"+ve:ve}function qe(Xe){var ve=Xe.substring(1,Xe.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")),at=[],Je=ve[0]==="^",Ce=["["];Je&&Ce.push("^");for(var Ie=Je?1:0,I=ve.length;Ie<I;++Ie){var L=ve[Ie];if(/\\[bdsw]/i.test(L))Ce.push(L);else{var x=Ve(L),f;Ie+2<I&&ve[Ie+1]==="-"?(f=Ve(ve[Ie+2]),Ie+=2):f=x,at.push([x,f]),f<65||x>122||(f<65||x>90||at.push([Math.max(65,x)|32,Math.min(f,90)|32]),f<97||x>122||at.push([Math.max(97,x)&~32,Math.min(f,122)&~32]))}}at.sort(function(V,fe){return V[0]-fe[0]||fe[1]-V[1]});for(var p=[],v=[],Ie=0;Ie<at.length;++Ie){var b=at[Ie];b[0]<=v[1]+1?v[1]=Math.max(v[1],b[1]):p.push(v=b)}for(var Ie=0;Ie<p.length;++Ie){var b=p[Ie];Ce.push(Ke(b[0])),b[1]>b[0]&&(b[1]+1>b[0]&&Ce.push("-"),Ce.push(Ke(b[1])))}return Ce.push("]"),Ce.join("")}function ht(Xe){for(var ve=Xe.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")),at=ve.length,Je=[],Ce=0,Ie=0;Ce<at;++Ce){var I=ve[Ce];if(I==="(")++Ie;else if(I.charAt(0)==="\\"){var L=+I.substring(1);L&&(L<=Ie?Je[L]=-1:ve[Ce]=Ke(L))}}for(var Ce=1;Ce<Je.length;++Ce)Je[Ce]===-1&&(Je[Ce]=++ne);for(var Ce=0,Ie=0;Ce<at;++Ce){var I=ve[Ce];if(I==="(")++Ie,Je[Ie]||(ve[Ce]="(?:");else if(I.charAt(0)==="\\"){var L=+I.substring(1);L&&L<=Ie&&(ve[Ce]="\\"+Je[L])}}for(var Ce=0;Ce<at;++Ce)ve[Ce]==="^"&&ve[Ce+1]!=="^"&&(ve[Ce]="");if(Xe.ignoreCase&&ke)for(var Ce=0;Ce<at;++Ce){var I=ve[Ce],x=I.charAt(0);I.length>=2&&x==="["?ve[Ce]=qe(I):x!=="\\"&&(ve[Ce]=I.replace(/[a-zA-Z]/g,function(v){var b=v.charCodeAt(0);return"["+String.fromCharCode(b&~32,b|32)+"]"}))}return ve.join("")}for(var nt=[],Pe=0,we=B.length;Pe<we;++Pe){var Me=B[Pe];if(Me.global||Me.multiline)throw new Error(""+Me);nt.push("(?:"+ht(Me)+")")}return new RegExp(nt.join("|"),je?"gi":"g")}function l(B,ne){var ke=/(?:^|\s)nocode(?:\s|$)/,je=[],Pe=0,we=[],Me=0;function Ge(Ve){var Ke=Ve.nodeType;if(Ke==1){if(ke.test(Ve.className))return;for(var qe=Ve.firstChild;qe;qe=qe.nextSibling)Ge(qe);var ht=Ve.nodeName.toLowerCase();(ht==="br"||ht==="li")&&(je[Me]=`
|
|
`,we[Me<<1]=Pe++,we[Me++<<1|1]=Ve)}else if(Ke==3||Ke==4){var nt=Ve.nodeValue;nt.length&&(ne?nt=nt.replace(/\r\n?/g,`
|
|
`):nt=nt.replace(/[ \t\r\n]+/g," "),je[Me]=nt,we[Me<<1]=Pe,Pe+=nt.length,we[Me++<<1|1]=Ve)}}return Ge(B),{sourceCode:je.join("").replace(/\n$/,""),spans:we}}function g(B,ne,ke,je,Pe){if(!ke)return;var we={sourceNode:B,pre:1,langExtension:null,numberLines:null,sourceCode:ke,spans:null,basePos:ne,decorations:null};je(we),Pe.push.apply(Pe,we.decorations)}var _=/\S/;function N(B){for(var ne=void 0,ke=B.firstChild;ke;ke=ke.nextSibling){var je=ke.nodeType;ne=je===1?ne?B:ke:je===3&&_.test(ke.nodeValue)?B:ne}return ne===B?void 0:ne}function de(B,ne){var ke={},je;(function(){for(var Me=B.concat(ne),Ge=[],Ve={},Ke=0,qe=Me.length;Ke<qe;++Ke){var ht=Me[Ke],nt=ht[3];if(nt)for(var Xe=nt.length;--Xe>=0;)ke[nt.charAt(Xe)]=ht;var ve=ht[1],at=""+ve;Ve.hasOwnProperty(at)||(Ge.push(ve),Ve[at]=null)}Ge.push(/[\0-\uffff]/),je=c(Ge)})();var Pe=ne.length,we=function(Me){for(var Ge=Me.sourceCode,Ve=Me.basePos,Ke=Me.sourceNode,qe=[Ve,y],ht=0,nt=Ge.match(je)||[],Xe={},ve=0,at=nt.length;ve<at;++ve){var Je=nt[ve],Ce=Xe[Je],Ie=void 0,I;if(typeof Ce=="string")I=!1;else{var L=ke[Je.charAt(0)];if(L)Ie=Je.match(L[1]),Ce=L[0];else{for(var x=0;x<Pe;++x)if(L=ne[x],Ie=Je.match(L[1]),Ie){Ce=L[0];break}Ie||(Ce=y)}I=Ce.length>=5&&Ce.substring(0,5)==="lang-",I&&!(Ie&&typeof Ie[1]=="string")&&(I=!1,Ce=w),I||(Xe[Je]=Ce)}var f=ht;if(ht+=Je.length,!I)qe.push(Ve+f,Ce);else{var p=Ie[1],v=Je.indexOf(p),b=v+p.length;Ie[2]&&(b=Je.length-Ie[2].length,v=b-p.length);var V=Ce.substring(5);g(Ke,Ve+f,Je.substring(0,v),we,qe),g(Ke,Ve+f+v,p,te(V,p),qe),g(Ke,Ve+f+b,Je.substring(b),we,qe)}}Me.decorations=qe};return we}function _e(B){var ne=[],ke=[];B.tripleQuotedStrings?ne.push([be,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):B.multiLineStrings?ne.push([be,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ne.push([be,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),B.verbatimStrings&&ke.push([be,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var je=B.hashComments;je&&(B.cStyleComments?(je>1?ne.push([Q,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ne.push([Q,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ke.push([be,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ne.push([Q,/^#[^\r\n]*/,null,"#"])),B.cStyleComments&&(ke.push([Q,/^\/\/[^\r\n]*/,null]),ke.push([Q,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Pe=B.regexLiterals;if(Pe){var we=Pe>1?"":`
|
|
\r`,Me=we?".":"[\\S\\s]",Ge="/(?=[^/*"+we+"])(?:[^/\\x5B\\x5C"+we+"]|\\x5C"+Me+"|\\x5B(?:[^\\x5C\\x5D"+we+"]|\\x5C"+Me+")*(?:\\x5D|$))+/";ke.push(["lang-regex",RegExp("^"+k+"("+Ge+")")])}var Ve=B.types;Ve&&ke.push([me,Ve]);var Ke=(""+B.keywords).replace(/^ | $/g,"");Ke.length&&ke.push([Re,new RegExp("^(?:"+Ke.replace(/[\s,]+/g,"|")+")\\b"),null]),ne.push([y,/^\s+/,null,` \r
|
|
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return B.regexLiterals&&(qe+="(?!s*/)"),ke.push([Ae,/^@[a-z_$][a-z_$@0-9]*/i,null],[me,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[y,/^[a-z_$][a-z_$@0-9]*/i,null],[Ae,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[y,/^\\[\s\S]?/,null],[J,new RegExp(qe),null]),de(ne,ke)}var ae=_e({keywords:We,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(B,ne,ke){for(var je=/(?:^|\s)nocode(?:\s|$)/,Pe=/\r\n?|\n/,we=B.ownerDocument,Me=we.createElement("li");B.firstChild;)Me.appendChild(B.firstChild);var Ge=[Me];function Ve(ve){var at=ve.nodeType;if(at==1&&!je.test(ve.className))if(ve.nodeName==="br")Ke(ve),ve.parentNode&&ve.parentNode.removeChild(ve);else for(var Je=ve.firstChild;Je;Je=Je.nextSibling)Ve(Je);else if((at==3||at==4)&&ke){var Ce=ve.nodeValue,Ie=Ce.match(Pe);if(Ie){var I=Ce.substring(0,Ie.index);ve.nodeValue=I;var L=Ce.substring(Ie.index+Ie[0].length);if(L){var x=ve.parentNode;x.insertBefore(we.createTextNode(L),ve.nextSibling)}Ke(ve),I||ve.parentNode.removeChild(ve)}}}function Ke(ve){for(;!ve.nextSibling;)if(ve=ve.parentNode,!ve)return;function at(Ie,I){var L=I?Ie.cloneNode(!1):Ie,x=Ie.parentNode;if(x){var f=at(x,1),p=Ie.nextSibling;f.appendChild(L);for(var v=p;v;v=p)p=v.nextSibling,f.appendChild(v)}return L}for(var Je=at(ve.nextSibling,0),Ce;(Ce=Je.parentNode)&&Ce.nodeType===1;)Je=Ce;Ge.push(Je)}for(var qe=0;qe<Ge.length;++qe)Ve(Ge[qe]);ne===(ne|0)&&Ge[0].setAttribute("value",ne);var ht=we.createElement("ol");ht.className="linenums";for(var nt=Math.max(0,ne-1|0)||0,qe=0,Xe=Ge.length;qe<Xe;++qe)Me=Ge[qe],Me.className="L"+(qe+nt)%10,Me.firstChild||Me.appendChild(we.createTextNode("\xA0")),ht.appendChild(Me);B.appendChild(ht)}function ue(B){var ne=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ne=ne&&+ne[1]<=8;var ke=/\n/g,je=B.sourceCode,Pe=je.length,we=0,Me=B.spans,Ge=Me.length,Ve=0,Ke=B.decorations,qe=Ke.length,ht=0;Ke[qe]=Pe;var nt,Xe;for(Xe=nt=0;Xe<qe;)Ke[Xe]!==Ke[Xe+2]?(Ke[nt++]=Ke[Xe++],Ke[nt++]=Ke[Xe++]):Xe+=2;for(qe=nt,Xe=nt=0;Xe<qe;){for(var ve=Ke[Xe],at=Ke[Xe+1],Je=Xe+2;Je+2<=qe&&Ke[Je+1]===at;)Je+=2;Ke[nt++]=ve,Ke[nt++]=at,Xe=Je}qe=Ke.length=nt;var Ce=B.sourceNode,Ie="";Ce&&(Ie=Ce.style.display,Ce.style.display="none");try{for(var I=null;Ve<Ge;){var L=Me[Ve],x=Me[Ve+2]||Pe,f=Ke[ht+2]||Pe,Je=Math.min(x,f),p=Me[Ve+1],v;if(p.nodeType!==1&&(v=je.substring(we,Je))){ne&&(v=v.replace(ke,"\r")),p.nodeValue=v;var b=p.ownerDocument,V=b.createElement("span");V.className=Ke[ht+1];var fe=p.parentNode;fe.replaceChild(V,p),V.appendChild(p),we<x&&(Me[Ve+1]=p=b.createTextNode(je.substring(Je,x)),fe.insertBefore(p,V.nextSibling))}we=Je,we>=x&&(Ve+=2),we>=f&&(ht+=2)}}finally{Ce&&(Ce.style.display=Ie)}}var ce={};function H(B,ne){for(var ke=ne.length;--ke>=0;){var je=ne[ke];ce.hasOwnProperty(je)?D.console&&console.warn("cannot override language handler %s",je):ce[je]=B}}function te(B,ne){return B&&ce.hasOwnProperty(B)||(B=/^\s*</.test(ne)?"default-markup":"default-code"),ce[B]}H(ae,["default-code"]),H(de([],[[y,/^[^<?]+/],[X,/^<!\w[^>]*(?:>|$)/],[Q,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[J,/^(?:<[%?]|[%?]>)/],["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"]),H(de([[y,/^[\s]+/,null,` \r
|
|
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Z,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[ee,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[J,/^[=<>\/]+/],["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"]),H(de([],[[j,/^[\s\S]+/]]),["uq.val"]),H(_e({keywords:re,hashComments:!0,cStyleComments:!0,types:pe}),["c","cc","cpp","cxx","cyc","m"]),H(_e({keywords:"null,true,false"}),["json"]),H(_e({keywords:le,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:pe}),["cs"]),H(_e({keywords:ye,cStyleComments:!0}),["java"]),H(_e({keywords:Te,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),H(_e({keywords:se,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),H(_e({keywords:U,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),H(_e({keywords:ie,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),H(_e({keywords:P,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),H(_e({keywords:W,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),H(de([],[[be,/^[\s\S]+/]]),["regex"]);function h(B){var ne=B.langExtension;try{var ke=l(B.sourceNode,B.pre),je=ke.sourceCode;B.sourceCode=je,B.spans=ke.spans,B.basePos=0,te(ne,je)(B),ue(B)}catch(Pe){D.console&&console.log(Pe&&Pe.stack||Pe)}}function T(B,ne,ke){var je=ke||!1,Pe=ne||null,we=document.createElement("div");we.innerHTML="<pre>"+B+"</pre>",we=we.firstChild,je&&Se(we,je,!0);var Me={langExtension:Pe,numberLines:je,sourceNode:we,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return h(Me),we.innerHTML}function m(B,ne){var ke=ne||document.body,je=ke.ownerDocument||document;function Pe(L){return ke.getElementsByTagName(L)}for(var we=[Pe("pre"),Pe("code"),Pe("xmp")],Me=[],Ge=0;Ge<we.length;++Ge)for(var Ve=0,Ke=we[Ge].length;Ve<Ke;++Ve)Me.push(we[Ge][Ve]);we=null;var qe=Date;qe.now||(qe={now:function(){return+new Date}});var ht=0,nt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Xe=/\bprettyprint\b/,ve=/\bprettyprinted\b/,at=/pre|xmp/i,Je=/^code$/i,Ce=/^(?:pre|code|xmp)$/i,Ie={};function I(){for(var L=D.PR_SHOULD_USE_CONTINUATION?qe.now()+250:Infinity;ht<Me.length&&qe.now()<L;ht++){for(var x=Me[ht],f=Ie,p=x;p=p.previousSibling;){var v=p.nodeType,b=(v===7||v===8)&&p.nodeValue;if(b?!/^\??prettify\b/.test(b):v!==3||/\S/.test(p.nodeValue))break;if(b){f={},b.replace(/\b(\w+)=([\w:.%+-]+)/g,function(kt,vt,Bt){f[vt]=Bt});break}}var V=x.className;if((f!==Ie||Xe.test(V))&&!ve.test(V)){for(var fe=!1,Le=x.parentNode;Le;Le=Le.parentNode){var tt=Le.tagName;if(Ce.test(tt)&&Le.className&&Xe.test(Le.className)){fe=!0;break}}if(!fe){x.className+=" prettyprinted";var rt=f.lang;if(!rt){rt=V.match(nt);var ot;!rt&&(ot=N(x))&&Je.test(ot.tagName)&&(rt=ot.className.match(nt)),rt&&(rt=rt[1])}var st;if(at.test(x.tagName))st=1;else{var it=x.currentStyle,ze=je.defaultView,ct=it?it.whiteSpace:ze&&ze.getComputedStyle?ze.getComputedStyle(x,null).getPropertyValue("white-space"):0;st=ct&&ct.substring(0,3)==="pre"}var ft=f.linenums;(ft=ft==="true"||+ft)||(ft=V.match(/\blinenums\b(?::(\d+))?/),ft=ft?ft[1]&&ft[1].length?+ft[1]:!0:!1),ft&&Se(x,ft,st);var _t={langExtension:rt,sourceNode:x,numberLines:ft,pre:st,sourceCode:null,basePos:null,spans:null,decorations:null};h(_t)}}}ht<Me.length?D.setTimeout(I,250):typeof B=="function"&&B()}I()}var R=D.PR={createSimpleLexer:de,registerLangHandler:H,sourceDecorator:_e,PR_ATTRIB_NAME:ee,PR_ATTRIB_VALUE:j,PR_COMMENT:Q,PR_DECLARATION:X,PR_KEYWORD:Re,PR_LITERAL:Ae,PR_NOCODE:A,PR_PLAIN:y,PR_PUNCTUATION:J,PR_SOURCE:w,PR_STRING:be,PR_TAG:Z,PR_TYPE:me,prettyPrintOne:oe?D.prettyPrintOne=T:G=T,prettyPrint:M=oe?D.prettyPrint=m:M=m},Y=D.define;typeof Y=="function"&&Y.amd&&Y("google-code-prettify",[],function(){return R})})()},"VrN/":function(bt,Ye,C){(function(F,ge){bt.exports=ge()})(this,function(){"use strict";var F=navigator.userAgent,ge=navigator.platform,oe=/gecko\/\d/i.test(F),Oe=/MSIE \d/.test(F),Ee=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(F),G=/Edge\/(\d+)/.exec(F),M=Oe||Ee||G,D=M&&(Oe?document.documentMode||6:+(G||Ee)[1]),S=!G&&/WebKit\//.test(F),z=S&&/Qt\/\d+\.\d+/.test(F),$=!G&&/Chrome\//.test(F),re=/Opera\//.test(F),ye=/Apple Computer/.test(navigator.vendor),le=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(F),W=/PhantomJS/.test(F),P=!G&&/AppleWebKit/.test(F)&&/Mobile\/\w+/.test(F),U=/Android/.test(F),se=P||U||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(F),ie=P||/Mac/.test(ge),Te=/\bCrOS\b/.test(F),We=/win/i.test(ge),pe=re&&F.match(/Version\/(\d*\.\d*)/);pe&&(pe=Number(pe[1])),pe&&pe>=15&&(re=!1,S=!0);var be=ie&&(z||re&&(pe==null||pe<12.11)),Re=oe||M&&D>=9;function Q(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var me=function(e,t){var r=e.className,n=Q(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function Ae(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function J(e,t){return Ae(e).appendChild(t)}function y(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function Z(e,t,r,n){var i=y(e,t,r,n);return i.setAttribute("role","presentation"),i}var X;document.createRange?X=function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:X=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function w(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 ee(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,t){var r=e.className;Q(t).test(r)||(e.className+=(r?" ":"")+t)}function A(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!Q(r[n]).test(t)&&(t+=" "+r[n]);return t}var k=function(e){e.select()};P?k=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:M&&(k=function(e){try{e.select()}catch(t){}});function c(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function l(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function g(e,t,r,n,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=n||0,o=i||0;;){var s=e.indexOf(" ",a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=r-o%r,a=s+1}}var _=function(){this.id=null,this.f=null,this.time=0,this.handler=c(this.onTimeout,this)};_.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},_.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function N(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var de=50,_e={toString:function(){return"CodeMirror.Pass"}},ae={scroll:!1},Se={origin:"*mouse"},ue={origin:"+move"};function ce(e,t,r){for(var n=0,i=0;;){var a=e.indexOf(" ",n);a==-1&&(a=e.length);var o=a-n;if(a==e.length||i+o>=t)return n+Math.min(o,t-i);if(i+=a-n,i+=r-i%r,n=a+1,i>=t)return n}}var H=[""];function te(e){for(;H.length<=e;)H.push(h(H)+" ");return H[e]}function h(e){return e[e.length-1]}function T(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function m(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function R(){}function Y(e,t){var r;return Object.create?r=Object.create(e):(R.prototype=e,r=new R),t&&l(t,r),r}var B=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ne(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||B.test(e))}function ke(e,t){return t?t.source.indexOf("\\w")>-1&&ne(e)?!0:t.test(e):ne(e)}function je(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Pe=/[\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 we(e){return e.charCodeAt(0)>=768&&Pe.test(e)}function Me(e,t,r){for(;(r<0?t>0:t<e.length)&&we(e.charAt(t));)t+=r;return t}function Ge(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,a=n<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:r;e(a)?r=a:t=a+n}}function Ve(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<r&&o.to>t||t==r&&o.to==t)&&(n(Math.max(o.from,t),Math.min(o.to,r),o.level==1?"rtl":"ltr",a),i=!0)}i||n(t,r,"ltr")}var Ke=null;function qe(e,t,r){var n;Ke=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&r=="before"?n=i:Ke=i),a.from==t&&(a.from!=a.to&&r!="before"?n=i:Ke=i)}return n!=null?n:Ke}var ht=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(d){return d<=247?e.charAt(d):1424<=d&&d<=1524?"R":1536<=d&&d<=1785?t.charAt(d-1536):1774<=d&&d<=2220?"r":8192<=d&&d<=8203?"w":d==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,o=/[Lb1n]/,s=/[1n]/;function u(d,E,O){this.level=d,this.from=E,this.to=O}return function(d,E){var O=E=="ltr"?"L":"R";if(d.length==0||E=="ltr"&&!n.test(d))return!1;for(var q=d.length,K=[],xe=0;xe<q;++xe)K.push(r(d.charCodeAt(xe)));for(var De=0,Ue=O;De<q;++De){var He=K[De];He=="m"?K[De]=Ue:Ue=He}for(var $e=0,Be=O;$e<q;++$e){var et=K[$e];et=="1"&&Be=="r"?K[$e]="n":a.test(et)&&(Be=et,et=="r"&&(K[$e]="R"))}for(var gt=1,ut=K[0];gt<q-1;++gt){var Et=K[gt];Et=="+"&&ut=="1"&&K[gt+1]=="1"?K[gt]="1":Et==","&&ut==K[gt+1]&&(ut=="1"||ut=="n")&&(K[gt]=ut),ut=Et}for(var Mt=0;Mt<q;++Mt){var Qt=K[Mt];if(Qt==",")K[Mt]="N";else if(Qt=="%"){var It=void 0;for(It=Mt+1;It<q&&K[It]=="%";++It);for(var Cn=Mt&&K[Mt-1]=="!"||It<q&&K[It]=="1"?"1":"N",yn=Mt;yn<It;++yn)K[yn]=Cn;Mt=It-1}}for(var Gt=0,xn=O;Gt<q;++Gt){var rn=K[Gt];xn=="L"&&rn=="1"?K[Gt]="L":a.test(rn)&&(xn=rn)}for(var Vt=0;Vt<q;++Vt)if(i.test(K[Vt])){var Xt=void 0;for(Xt=Vt+1;Xt<q&&i.test(K[Xt]);++Xt);for(var Wt=(Vt?K[Vt-1]:O)=="L",wn=(Xt<q?K[Xt]:O)=="L",$r=Wt==wn?Wt?"L":"R":O,hr=Vt;hr<Xt;++hr)K[hr]=$r;Vt=Xt-1}for(var ln=[],Kn,en=0;en<q;)if(o.test(K[en])){var Ia=en;for(++en;en<q&&o.test(K[en]);++en);ln.push(new u(0,Ia,en))}else{var tr=en,kr=ln.length,Sr=E=="rtl"?1:0;for(++en;en<q&&K[en]!="L";++en);for(var hn=tr;hn<en;)if(s.test(K[hn])){tr<hn&&(ln.splice(kr,0,new u(1,tr,hn)),kr+=Sr);var Yr=hn;for(++hn;hn<en&&s.test(K[hn]);++hn);ln.splice(kr,0,new u(2,Yr,hn)),kr+=Sr,tr=hn}else++hn;tr<en&&ln.splice(kr,0,new u(1,tr,en))}return E=="ltr"&&(ln[0].level==1&&(Kn=d.match(/^\s+/))&&(ln[0].from=Kn[0].length,ln.unshift(new u(0,0,Kn[0].length))),h(ln).level==1&&(Kn=d.match(/\s+$/))&&(h(ln).to-=Kn[0].length,ln.push(new u(0,q-Kn[0].length,q)))),E=="rtl"?ln.reverse():ln}}();function nt(e,t){var r=e.order;return r==null&&(r=e.order=ht(e.text,t)),r}var Xe=[],ve=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Xe).concat(r)}};function at(e,t){return e._handlers&&e._handlers[t]||Xe}function Je(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var a=N(i,r);a>-1&&(n[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Ce(e,t){var r=at(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Ie(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ce(e,r||t.type,e,t),v(t)||t.codemirrorIgnore}function I(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)N(r,t[n])==-1&&r.push(t[n])}function L(e,t){return at(e,t).length>0}function x(e){e.prototype.on=function(t,r){ve(this,t,r)},e.prototype.off=function(t,r){Je(this,t,r)}}function f(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function p(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function v(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function b(e){f(e),p(e)}function V(e){return e.target||e.srcElement}function fe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ie&&e.ctrlKey&&t==1&&(t=3),t}var Le=function(){if(M&&D<9)return!1;var e=y("div");return"draggable"in e||"dragDrop"in e}(),tt;function rt(e){if(tt==null){var t=y("span","\u200B");J(e,y("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(tt=t.offsetWidth<=1&&t.offsetHeight>2&&!(M&&D<8))}var r=tt?y("span","\u200B"):y("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var ot;function st(e){if(ot!=null)return ot;var t=J(e,document.createTextNode("A\u062EA")),r=X(t,0,1).getBoundingClientRect(),n=X(t,1,2).getBoundingClientRect();return Ae(e),!r||r.left==r.right?!1:ot=n.right-r.right<3}var it=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf(`
|
|
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=a.indexOf("\r");o!=-1?(r.push(a.slice(0,o)),t+=o+1):(r.push(a),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ze=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(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},ct=function(){var e=y("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ft=null;function _t(e){if(ft!=null)return ft;var t=J(e,y("span","x")),r=t.getBoundingClientRect(),n=X(t,0,1).getBoundingClientRect();return ft=Math.abs(r.left-n.left)>1}var kt={},vt={};function Bt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),kt[e]=t}function Ut(e,t){vt[e]=t}function zt(e){if(typeof e=="string"&&vt.hasOwnProperty(e))e=vt[e];else if(e&&typeof e.name=="string"&&vt.hasOwnProperty(e.name)){var t=vt[e.name];typeof t=="string"&&(t={name:t}),e=Y(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return zt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return zt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function pn(e,t){t=zt(t);var r=kt[t.name];if(!r)return pn(e,"text/plain");var n=r(e,t);if(an.hasOwnProperty(t.name)){var i=an[t.name];for(var a in i){if(!i.hasOwnProperty(a))continue;n.hasOwnProperty(a)&&(n["_"+a]=n[a]),n[a]=i[a]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)n[o]=t.modeProps[o];return n}var an={};function nr(e,t){var r=an.hasOwnProperty(e)?an[e]:an[e]={};l(t,r)}function An(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Rn(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Wn(e,t,r){return e.startState?e.startState(t,r):!0}var Dt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Dt.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},Dt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=g(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?g(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.indentation=function(){return g(this.string,null,this.tabSize)-(this.lineStart?g(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(o){return r?o.toLowerCase():o},i=this.string.substr(this.pos,e.length);if(n(i)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Qe(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 r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],a=i.chunkSize();if(t<a){r=i;break}t-=a}return r.lines[t]}function tn(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(a){var o=a.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Gn(e,t,r){var n=[];return e.iter(t,r,function(i){n.push(i.text)}),n}function mn(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Ct(e){if(e.parent==null)return null;for(var t=e.parent,r=N(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;!(n.children[i]==t);++i)r+=n.children[i].chunkSize();return r+t.first}function kn(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],a=i.height;if(t<a){e=i;continue e}t-=a,r+=i.chunkSize()}return r}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o],u=s.height;if(t<u)break;t-=u}return r+o}function Pn(e,t){return t>=e.first&&t<e.first+e.size}function Ln(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ne(e,t,r){if(r===void 0&&(r=null),!(this instanceof Ne))return new Ne(e,t,r);this.line=e,this.ch=t,this.sticky=r}function mt(e,t){return e.line-t.line||e.ch-t.ch}function Sn(e,t){return e.sticky==t.sticky&&mt(e,t)==0}function Dn(e){return Ne(e.line,e.ch)}function Fe(e,t){return mt(e,t)<0?t:e}function Xn(e,t){return mt(e,t)<0?e:t}function Tr(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pt(e,t){if(t.line<e.first)return Ne(e.first,0);var r=e.first+e.size-1;return t.line>r?Ne(r,Qe(e,r).text.length):un(t,Qe(e,t.line).text.length)}function un(e,t){var r=e.ch;return r==null||r>t?Ne(e.line,t):r<0?Ne(e.line,0):e}function Hn(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=pt(e,t[n]);return r}var Vn=function(e,t){this.state=e,this.lookAhead=t},cn=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};cn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},cn.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}},cn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},cn.fromSaved=function(e,t,r){return t instanceof Vn?new cn(e,An(e.mode,t.state),r,t.lookAhead):new cn(e,An(e.mode,t),r)},cn.prototype.save=function(e){var t=e!==!1?An(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Vn(t,this.maxLookAhead):t};function Mn(e,t,r,n){var i=[e.state.modeGen],a={};Rt(e,t.text,e.doc.mode,r,function(d,E){return i.push(d,E)},a,n);for(var o=r.state,s=function(d){r.baseTokens=i;var E=e.state.overlays[d],O=1,q=0;r.state=!0,Rt(e,t.text,E.mode,r,function(K,xe){for(var De=O;q<K;){var Ue=i[O];Ue>K&&i.splice(O,1,K,i[O+1],Ue),O+=2,q=Math.min(K,Ue)}if(!xe)return;if(E.opaque)i.splice(De,O-De,K,"overlay "+xe),O=De+2;else for(;De<O;De+=2){var He=i[De+1];i[De+1]=(He?He+" ":"")+"overlay "+xe}},a),r.state=o,r.baseTokens=null,r.baseTokenPos=1},u=0;u<e.state.overlays.length;++u)s(u);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function dt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=he(e,Ct(t)),i=t.text.length>e.options.maxHighlightLength&&An(e.doc.mode,n.state),a=Mn(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function he(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new cn(n,!0,t);var a=Or(e,t,r),o=a>n.first&&Qe(n,a-1).stateAfter,s=o?cn.fromSaved(n,o,a):new cn(n,Wn(n.mode),a);return n.iter(a,t,function(u){Ze(e,u.text,s);var d=s.line;u.stateAfter=d==t-1||d%5==0||d>=i.viewFrom&&d<i.viewTo?s.save():null,s.nextLine()}),r&&(n.modeFrontier=s.line),s}function Ze(e,t,r,n){var i=e.doc.mode,a=new Dt(t,e.options.tabSize,r);for(a.start=a.pos=n||0,t==""&<(i,r.state);!a.eol();)Tt(i,a,r.state),a.start=a.pos}function lt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=Rn(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function Tt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Rn(e,r).mode);var a=e.token(t,r);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var dn=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function $t(e,t,r,n){var i=e.doc,a=i.mode,o;t=pt(i,t);var s=Qe(i,t.line),u=he(e,t.line,r),d=new Dt(s.text,e.options.tabSize,u),E;for(n&&(E=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,o=Tt(a,d,u.state),n&&E.push(new dn(d,o,An(i.mode,u.state)));return n?E:new dn(d,o,u.state)}function jt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Rt(e,t,r,n,i,a,o){var s=r.flattenSpans;s==null&&(s=e.options.flattenSpans);var u=0,d=null,E=new Dt(t,e.options.tabSize,n),O,q=e.options.addModeClass&&[null];for(t==""&&jt(lt(r,n.state),a);!E.eol();){if(E.pos>e.options.maxHighlightLength?(s=!1,o&&Ze(e,t,n,E.pos),E.pos=t.length,O=null):O=jt(Tt(r,E,n.state,q),a),q){var K=q[0].name;K&&(O="m-"+(O?K+" "+O:K))}if(!s||d!=O){for(;u<E.start;)u=Math.min(E.start,u+5e3),i(u,d);d=O}E.start=E.pos}for(;u<E.pos;){var xe=Math.min(E.pos,u+5e3);i(xe,d),u=xe}}function Or(e,t,r){for(var n,i,a=e.doc,o=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var u=Qe(a,s-1),d=u.stateAfter;if(d&&(!r||s+(d instanceof Vn?d.lookAhead:0)<=a.modeFrontier))return s;var E=g(u.text,null,e.options.tabSize);(i==null||n>E)&&(i=s-1,n=E)}return i}function En(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var i=Qe(e,n).stateAfter;if(i&&(!(i instanceof Vn)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Nn=!1,gn=!1;function ki(){Nn=!0}function Si(){gn=!0}function pr(e,t,r){this.marker=e,this.from=t,this.to=r}function rr(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Zi(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Ti(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Fa(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);if(s||a.from==t&&o.type=="bookmark"&&(!r||!a.marker.insertLeft)){var u=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(n||(n=[])).push(new pr(o,a.from,u?null:a.to))}}return n}function qr(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);if(s||a.from==t&&o.type=="bookmark"&&(!r||a.marker.insertLeft)){var u=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(n||(n=[])).push(new pr(o,u?null:a.from-t,a.to==null?null:a.to-t))}}return n}function $n(e,t){if(t.full)return null;var r=Pn(e,t.from.line)&&Qe(e,t.from.line).markedSpans,n=Pn(e,t.to.line)&&Qe(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,a=t.to.ch,o=mt(t.from,t.to)==0,s=Fa(r,i,o),u=qr(n,a,o),d=t.text.length==1,E=h(t.text).length+(d?i:0);if(s)for(var O=0;O<s.length;++O){var q=s[O];if(q.to==null){var K=rr(u,q.marker);K?d&&(q.to=K.to==null?null:K.to+E):q.to=i}}if(u)for(var xe=0;xe<u.length;++xe){var De=u[xe];if(De.to!=null&&(De.to+=E),De.from==null){var Ue=rr(s,De.marker);Ue||(De.from=E,d&&(s||(s=[])).push(De))}else De.from+=E,d&&(s||(s=[])).push(De)}s&&(s=Ar(s)),u&&u!=s&&(u=Ar(u));var He=[s];if(!d){var $e=t.text.length-2,Be;if($e>0&&s)for(var et=0;et<s.length;++et)s[et].to==null&&(Be||(Be=[])).push(new pr(s[et].marker,null,null));for(var gt=0;gt<$e;++gt)He.push(Be);He.push(u)}return He}function Ar(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Lr(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(K){if(K.markedSpans)for(var xe=0;xe<K.markedSpans.length;++xe){var De=K.markedSpans[xe].marker;De.readOnly&&(!n||N(n,De)==-1)&&(n||(n=[])).push(De)}}),!n)return null;for(var i=[{from:t,to:r}],a=0;a<n.length;++a)for(var o=n[a],s=o.find(0),u=0;u<i.length;++u){var d=i[u];if(mt(d.to,s.from)<0||mt(d.from,s.to)>0)continue;var E=[u,1],O=mt(d.from,s.from),q=mt(d.to,s.to);(O<0||!o.inclusiveLeft&&!O)&&E.push({from:d.from,to:s.from}),(q>0||!o.inclusiveRight&&!q)&&E.push({from:s.to,to:d.to}),i.splice.apply(i,E),u+=E.length-3}return i}function mr(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function Jr(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function gr(e){return e.inclusiveLeft?-1:0}function Yn(e){return e.inclusiveRight?1:0}function Zr(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),i=t.find(),a=mt(n.from,i.from)||gr(e)-gr(t);if(a)return-a;var o=mt(n.to,i.to)||Yn(e)-Yn(t);return o||t.id-e.id}function ir(e,t){var r=gn&&e.markedSpans,n;if(r)for(var i=void 0,a=0;a<r.length;++a)i=r[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!n||Zr(n,i.marker)<0)&&(n=i.marker);return n}function Oi(e){return ir(e,!0)}function Dr(e){return ir(e,!1)}function Qi(e,t){var r=gn&&e.markedSpans,n;if(r)for(var i=0;i<r.length;++i){var a=r[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!n||Zr(n,a.marker)<0)&&(n=a.marker)}return n}function ea(e,t,r,n,i){var a=Qe(e,t),o=gn&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var u=o[s];if(!u.marker.collapsed)continue;var d=u.marker.find(0),E=mt(d.from,r)||gr(u.marker)-gr(i),O=mt(d.to,n)||Yn(u.marker)-Yn(i);if(E>=0&&O<=0||E<=0&&O>=0)continue;if(E<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?mt(d.to,r)>=0:mt(d.to,r)>0)||E>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?mt(d.from,n)<=0:mt(d.from,n)<0))return!0}}function jn(e){for(var t;t=Oi(e);)e=t.find(-1,!0).line;return e}function Wa(e){for(var t;t=Dr(e);)e=t.find(1,!0).line;return e}function yt(e){for(var t,r;t=Dr(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function xt(e,t){var r=Qe(e,t),n=jn(r);return r==n?t:Ct(n)}function wt(e,t){if(t>e.lastLine())return t;var r=Qe(e,t),n;if(!St(e,r))return t;for(;n=Dr(r);)r=n.find(1,!0).line;return Ct(r)+1}function St(e,t){var r=gn&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i){if(n=r[i],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&At(e,t,n))return!0}}function At(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return At(e,n.line,rr(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(i.to==null||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&At(e,t,i))return!0}function Pt(e){e=jn(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var a=r.parent;a;r=a,a=r.parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==r)break;t+=s.height}return t}function Ft(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=Oi(n);){var i=r.find(0,!0);n=i.from.line,t+=i.from.ch-i.to.ch}for(n=e;r=Dr(n);){var a=r.find(0,!0);t-=n.text.length-a.from.ch,n=a.to.line,t+=n.text.length-a.to.ch}return t}function Yt(e){var t=e.display,r=e.doc;t.maxLine=Qe(r,r.first),t.maxLineLength=Ft(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var i=Ft(n);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var qt=function(e,t,r){this.text=e,Jr(this,t),this.height=r?r(this):1};qt.prototype.lineNo=function(){return Ct(this)},x(qt);function qn(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),mr(e),Jr(e,r);var i=n?n(e):1;i!=e.height&&mn(e,i)}function Kt(e){e.parent=null,mr(e)}var ar={},on={};function Jn(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?on:ar;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Zn(e,t){var r=Z("span",null,null,S?"padding-right: .1px":null),n={pre:Z("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;n.pos=0,n.addToken=ks,st(e.display.measure)&&(o=nt(a,e.doc.direction))&&(n.addToken=Ts(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&Ct(a);Os(a,n,dt(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=A(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=A(a.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(rt(e.display.measure))),i==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(S){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ce(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=A(n.pre.className,n.textClass||"")),n}function Qr(e){var t=y("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ks(e,t,r,n,i,a,o){if(!t)return;var s=e.splitSpaces?Ss(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,E;if(!u.test(t))e.col+=t.length,E=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,E),M&&D<9&&(d=!0),e.pos+=t.length;else{E=document.createDocumentFragment();for(var O=0;;){u.lastIndex=O;var q=u.exec(t),K=q?q.index-O:t.length-O;if(K){var xe=document.createTextNode(s.slice(O,O+K));M&&D<9?E.appendChild(y("span",[xe])):E.appendChild(xe),e.map.push(e.pos,e.pos+K,xe),e.col+=K,e.pos+=K}if(!q)break;O+=K+1;var De=void 0;if(q[0]==" "){var Ue=e.cm.options.tabSize,He=Ue-e.col%Ue;De=E.appendChild(y("span",te(He),"cm-tab")),De.setAttribute("role","presentation"),De.setAttribute("cm-text"," "),e.col+=He}else q[0]=="\r"||q[0]==`
|
|
`?(De=E.appendChild(y("span",q[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),De.setAttribute("cm-text",q[0]),e.col+=1):(De=e.cm.options.specialCharPlaceholder(q[0]),De.setAttribute("cm-text",q[0]),M&&D<9?E.appendChild(y("span",[De])):E.appendChild(De),e.col+=1);e.map.push(e.pos,e.pos+1,De),e.pos++}}if(e.trailingSpace=s.charCodeAt(t.length-1)==32,r||n||i||d||a||o){var $e=r||"";n&&($e+=n),i&&($e+=i);var Be=y("span",[E],$e,a);if(o)for(var et in o)o.hasOwnProperty(et)&&et!="style"&&et!="class"&&Be.setAttribute(et,o[et]);return e.content.appendChild(Be)}e.content.appendChild(E)}function Ss(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&r&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a="\xA0"),n+=a,r=a==" "}return n}function Ts(e,t){return function(r,n,i,a,o,s,u){i=i?i+" cm-force-border":"cm-force-border";for(var d=r.pos,E=d+n.length;;){for(var O=void 0,q=0;q<t.length&&!(O=t[q],O.to>d&&O.from<=d);q++);if(O.to>=E)return e(r,n,i,a,o,s,u);e(r,n.slice(0,O.to-d),i,a,null,s,u),a=null,n=n.slice(O.to-d),d=O.to}}}function Ha(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Os(e,t,r){var n=e.markedSpans,i=e.text,a=0;if(!n){for(var o=1;o<r.length;o+=2)t.addToken(t,i.slice(a,a=r[o]),Jn(r[o+1],t.cm.options));return}for(var s=i.length,u=0,d=1,E="",O,q,K=0,xe,De,Ue,He,$e;;){if(K==u){xe=De=Ue=q="",$e=null,He=null,K=Infinity;for(var Be=[],et=void 0,gt=0;gt<n.length;++gt){var ut=n[gt],Et=ut.marker;if(Et.type=="bookmark"&&ut.from==u&&Et.widgetNode)Be.push(Et);else if(ut.from<=u&&(ut.to==null||ut.to>u||Et.collapsed&&ut.to==u&&ut.from==u)){if(ut.to!=null&&ut.to!=u&&K>ut.to&&(K=ut.to,De=""),Et.className&&(xe+=" "+Et.className),Et.css&&(q=(q?q+";":"")+Et.css),Et.startStyle&&ut.from==u&&(Ue+=" "+Et.startStyle),Et.endStyle&&ut.to==K&&(et||(et=[])).push(Et.endStyle,ut.to),Et.title&&(($e||($e={})).title=Et.title),Et.attributes)for(var Mt in Et.attributes)($e||($e={}))[Mt]=Et.attributes[Mt];Et.collapsed&&(!He||Zr(He.marker,Et)<0)&&(He=ut)}else ut.from>u&&K>ut.from&&(K=ut.from)}if(et)for(var Qt=0;Qt<et.length;Qt+=2)et[Qt+1]==K&&(De+=" "+et[Qt]);if(!He||He.from==u)for(var It=0;It<Be.length;++It)Ha(t,0,Be[It]);if(He&&(He.from||0)==u){if(Ha(t,(He.to==null?s+1:He.to)-u,He.marker,He.from==null),He.to==null)return;He.to==u&&(He=!1)}}if(u>=s)break;for(var Cn=Math.min(s,K);;){if(E){var yn=u+E.length;if(!He){var Gt=yn>Cn?E.slice(0,Cn-u):E;t.addToken(t,Gt,O?O+xe:xe,Ue,u+Gt.length==K?De:"",q,$e)}if(yn>=Cn){E=E.slice(Cn-u),u=Cn;break}u=yn,Ue=""}E=i.slice(a,a=r[d++]),O=Jn(r[d++],t.cm.options)}}}function Ba(e,t,r){this.line=t,this.rest=yt(t),this.size=this.rest?Ct(h(this.rest))-r+1:1,this.node=this.text=null,this.hidden=St(e,t)}function Ai(e,t,r){for(var n=[],i,a=t;a<r;a=i){var o=new Ba(e.doc,Qe(e.doc,a),a);i=a+o.size,n.push(o)}return n}var Mr=null;function As(e){Mr?Mr.ops.push(e):e.ownsGroup=Mr={ops:[e],delayedCallbacks:[]}}function Ls(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function Ds(e,t){var r=e.ownsGroup;if(!r)return;try{Ls(r)}finally{Mr=null,t(r)}}var ei=null;function nn(e,t){var r=at(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),i;Mr?i=Mr.delayedCallbacks:ei?i=ei:(i=ei=[],setTimeout(Ms,0));for(var a=function(s){i.push(function(){return r[s].apply(null,n)})},o=0;o<r.length;++o)a(o)}function Ms(){var e=ei;ei=null;for(var t=0;t<e.length;++t)e[t]()}function za(e,t,r,n){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Ps(e,t):a=="gutter"?Ga(e,t,r,n):a=="class"?ta(e,t):a=="widget"&&Ns(e,t,n)}t.changes=null}function ti(e){return e.node==e.text&&(e.node=y("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),M&&D<8&&(e.node.style.zIndex=2)),e.node}function Rs(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=ti(t);t.background=n.insertBefore(y("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Ka(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Zn(e,t)}function Ps(e,t){var r=t.text.className,n=Ka(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,ta(e,t)):r&&(t.text.className=r)}function ta(e,t){Rs(e,t),t.line.wrapClass?ti(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ga(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ti(t);t.gutterBackground=y("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=ti(t),s=t.gutter=y("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),o.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=s.appendChild(y("div",Ln(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var u=0;u<e.display.gutterSpecs.length;++u){var d=e.display.gutterSpecs[u].className,E=a.hasOwnProperty(d)&&a[d];E&&s.appendChild(y("div",[E],"CodeMirror-gutter-elt","left: "+n.gutterLeft[d]+"px; width: "+n.gutterWidth[d]+"px"))}}}function Ns(e,t,r){t.alignable&&(t.alignable=null);for(var n=Q("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);Xa(e,t,r)}function js(e,t,r,n){var i=Ka(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),ta(e,t),Ga(e,t,r,n),Xa(e,t,n),t.node}function Xa(e,t,r){if(Va(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Va(e,t.rest[n],t,r,!1)}function Va(e,t,r,n,i){if(!t.widgets)return;for(var a=ti(r),o=0,s=t.widgets;o<s.length;++o){var u=s[o],d=y("div",[u.node],"CodeMirror-linewidget"+(u.className?" "+u.className:""));u.handleMouseEvents||d.setAttribute("cm-ignore-events","true"),Is(u,d,r,n),e.display.input.setUneditable(d),i&&u.above?a.insertBefore(d,r.gutter||r.text):a.appendChild(d),nn(u,"redraw")}}function Is(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function ni(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!w(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),J(t.display.measure,y("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Qn(e,t){for(var r=V(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Li(e){return e.lineSpace.offsetTop}function na(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $a(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=J(e.measure,y("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Bn(e){return de-e.display.nativeBarWidth}function vr(e){return e.display.scroller.clientWidth-Bn(e)-e.display.barWidth}function ra(e){return e.display.scroller.clientHeight-Bn(e)-e.display.barHeight}function Us(e,t,r){var n=e.options.lineWrapping,i=n&&vr(e);if(!t.measure.heights||n&&t.measure.width!=i){var a=t.measure.heights=[];if(n){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var u=o[s],d=o[s+1];Math.abs(u.bottom-d.bottom)>2&&a.push((u.bottom+d.top)/2-r.top)}}a.push(r.bottom-r.top)}}function Ya(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(Ct(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Fs(e,t){t=jn(t);var r=Ct(t),n=e.display.externalMeasured=new Ba(e.doc,t,r);n.lineN=r;var i=n.built=Zn(e,n);return n.text=i.pre,J(e.display.lineMeasure,i.pre),n}function qa(e,t,r,n){return zn(e,Rr(e,t),r,n)}function ia(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[xr(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function Rr(e,t){var r=Ct(t),n=ia(e,r);n&&!n.text?n=null:n&&n.changes&&(za(e,n,r,ca(e)),e.curOp.forceUpdate=!0),n||(n=Fs(e,t));var i=Ya(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function zn(e,t,r,n,i){t.before&&(r=-1);var a=r+(n||""),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),o=Hs(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Ja={left:0,right:0,top:0,bottom:0};function Za(e,t,r){for(var n,i,a,o,s,u,d=0;d<e.length;d+=3)if(s=e[d],u=e[d+1],t<s?(i=0,a=1,o="left"):t<u?(i=t-s,a=i+1):(d==e.length-3||t==u&&e[d+3]>t)&&(a=u-s,i=a-1,t>=u&&(o="right")),i!=null){if(n=e[d+2],s==u&&r==(n.insertLeft?"left":"right")&&(o=r),r=="left"&&i==0)for(;d&&e[d-2]==e[d-3]&&e[d-1].insertLeft;)n=e[(d-=3)+2],o="left";if(r=="right"&&i==u-s)for(;d<e.length-3&&e[d+3]==e[d+4]&&!e[d+5].insertLeft;)n=e[(d+=3)+2],o="right";break}return{node:n,start:i,end:a,collapse:o,coverStart:s,coverEnd:u}}function Ws(e,t){var r=Ja;if(t=="left")for(var n=0;n<e.length&&!((r=e[n]).left!=r.right);n++);else for(var i=e.length-1;i>=0&&!((r=e[i]).left!=r.right);i--);return r}function Hs(e,t,r,n){var i=Za(t.map,r,n),a=i.node,o=i.start,s=i.end,u=i.collapse,d;if(a.nodeType==3){for(var E=0;E<4;E++){for(;o&&we(t.line.text.charAt(i.coverStart+o));)--o;for(;i.coverStart+s<i.coverEnd&&we(t.line.text.charAt(i.coverStart+s));)++s;if(M&&D<9&&o==0&&s==i.coverEnd-i.coverStart?d=a.parentNode.getBoundingClientRect():d=Ws(X(a,o,s).getClientRects(),n),d.left||d.right||o==0)break;s=o,o=o-1,u="right"}M&&D<11&&(d=Bs(e.display.measure,d))}else{o>0&&(u=n="right");var O;e.options.lineWrapping&&(O=a.getClientRects()).length>1?d=O[n=="right"?O.length-1:0]:d=a.getBoundingClientRect()}if(M&&D<9&&!o&&(!d||!d.left&&!d.right)){var q=a.parentNode.getClientRects()[0];q?d={left:q.left,right:q.left+Nr(e.display),top:q.top,bottom:q.bottom}:d=Ja}for(var K=d.top-t.rect.top,xe=d.bottom-t.rect.top,De=(K+xe)/2,Ue=t.view.measure.heights,He=0;He<Ue.length-1&&!(De<Ue[He]);He++);var $e=He?Ue[He-1]:0,Be=Ue[He],et={left:(u=="right"?d.right:d.left)-t.rect.left,right:(u=="left"?d.left:d.right)-t.rect.left,top:$e,bottom:Be};return!d.left&&!d.right&&(et.bogus=!0),e.options.singleCursorHeightPerLine||(et.rtop=K,et.rbottom=xe),et}function Bs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!_t(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function Qa(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 eo(e){e.display.externalMeasure=null,Ae(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Qa(e.display.view[t])}function ri(e){eo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function to(){return $&&U?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function no(){return $&&U?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function aa(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=ni(e.widgets[r]));return t}function Di(e,t,r,n,i){if(!i){var a=aa(t);r.top+=a,r.bottom+=a}if(n=="line")return r;n||(n="local");var o=Pt(t);if(n=="local"?o+=Li(e.display):o-=e.display.viewOffset,n=="page"||n=="window"){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(n=="window"?0:no());var u=s.left+(n=="window"?0:to());r.left+=u,r.right+=u}return r.top+=o,r.bottom+=o,r}function ro(e,t,r){if(r=="div")return t;var n=t.left,i=t.top;if(r=="page")n-=to(),i-=no();else if(r=="local"||!r){var a=e.display.sizer.getBoundingClientRect();n+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:n-o.left,top:i-o.top}}function oa(e,t,r,n,i){return n||(n=Qe(e.doc,t.line)),Di(e,n,qa(e,n,t.ch,i),r)}function In(e,t,r,n,i,a){n=n||Qe(e.doc,t.line),i||(i=Rr(e,n));function o(xe,De){var Ue=zn(e,i,xe,De?"right":"left",a);return De?Ue.left=Ue.right:Ue.right=Ue.left,Di(e,n,Ue,r)}var s=nt(n,e.doc.direction),u=t.ch,d=t.sticky;if(u>=n.text.length?(u=n.text.length,d="before"):u<=0&&(u=0,d="after"),!s)return o(d=="before"?u-1:u,d=="before");function E(xe,De,Ue){var He=s[De],$e=He.level==1;return o(Ue?xe-1:xe,$e!=Ue)}var O=qe(s,u,d),q=Ke,K=E(u,O,d=="before");return q!=null&&(K.other=E(u,q,d!="before")),K}function io(e,t){var r=0;t=pt(e.doc,t),e.options.lineWrapping||(r=Nr(e.display)*t.ch);var n=Qe(e.doc,t.line),i=Pt(n)+Li(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function sa(e,t,r,n,i){var a=Ne(e,t,r);return a.xRel=i,n&&(a.outside=n),a}function la(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return sa(n.first,0,null,-1,-1);var i=kn(n,r),a=n.first+n.size-1;if(i>a)return sa(n.first+n.size-1,Qe(n,a).text.length,null,1,1);t<0&&(t=0);for(var o=Qe(n,i);;){var s=zs(e,o,i,t,r),u=Qi(o,s.ch+(s.xRel>0||s.outside>0?1:0));if(!u)return s;var d=u.find(1);if(d.line==i)return d;o=Qe(n,i=d.line)}}function ao(e,t,r,n){n-=aa(t);var i=t.text.length,a=Ge(function(o){return zn(e,r,o-1).bottom<=n},i,0);return i=Ge(function(o){return zn(e,r,o).top>n},a,i),{begin:a,end:i}}function oo(e,t,r,n){r||(r=Rr(e,t));var i=Di(e,t,zn(e,r,n),"line").top;return ao(e,t,r,i)}function ua(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function zs(e,t,r,n,i){i-=Pt(t);var a=Rr(e,t),o=aa(t),s=0,u=t.text.length,d=!0,E=nt(t,e.doc.direction);if(E){var O=(e.options.lineWrapping?Gs:Ks)(e,t,r,a,E,n,i);d=O.level!=1,s=d?O.from:O.to-1,u=d?O.to:O.from-1}var q=null,K=null,xe=Ge(function(gt){var ut=zn(e,a,gt);return ut.top+=o,ut.bottom+=o,ua(ut,n,i,!1)?(ut.top<=i&&ut.left<=n&&(q=gt,K=ut),!0):!1},s,u),De,Ue,He=!1;if(K){var $e=n-K.left<K.right-n,Be=$e==d;xe=q+(Be?0:1),Ue=Be?"after":"before",De=$e?K.left:K.right}else{!d&&(xe==u||xe==s)&&xe++,Ue=xe==0?"after":xe==t.text.length?"before":zn(e,a,xe-(d?1:0)).bottom+o<=i==d?"after":"before";var et=In(e,Ne(r,xe,Ue),"line",t,a);De=et.left,He=i<et.top?-1:i>=et.bottom?1:0}return xe=Me(t.text,xe,1),sa(r,xe,Ue,He,n-De)}function Ks(e,t,r,n,i,a,o){var s=Ge(function(O){var q=i[O],K=q.level!=1;return ua(In(e,Ne(r,K?q.to:q.from,K?"before":"after"),"line",t,n),a,o,!0)},0,i.length-1),u=i[s];if(s>0){var d=u.level!=1,E=In(e,Ne(r,d?u.from:u.to,d?"after":"before"),"line",t,n);ua(E,a,o,!0)&&E.top>o&&(u=i[s-1])}return u}function Gs(e,t,r,n,i,a,o){var s=ao(e,t,n,o),u=s.begin,d=s.end;/\s/.test(t.text.charAt(d-1))&&d--;for(var E=null,O=null,q=0;q<i.length;q++){var K=i[q];if(K.from>=d||K.to<=u)continue;var xe=K.level!=1,De=zn(e,n,xe?Math.min(d,K.to)-1:Math.max(u,K.from)).right,Ue=De<a?a-De+1e9:De-a;(!E||O>Ue)&&(E=K,O=Ue)}return E||(E=i[i.length-1]),E.from<u&&(E={from:u,to:E.to,level:E.level}),E.to>d&&(E={from:E.from,to:d,level:E.level}),E}var br;function Pr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(br==null){br=y("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)br.appendChild(document.createTextNode("x")),br.appendChild(y("br"));br.appendChild(document.createTextNode("x"))}J(e.measure,br);var r=br.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Ae(e.measure),r||1}function Nr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=y("span","xxxxxxxxxx"),r=y("pre",[t],"CodeMirror-line-like");J(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ca(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=e.display.gutterSpecs[o].className;r[s]=a.offsetLeft+a.clientLeft+i,n[s]=a.clientWidth}return{fixedPos:da(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function da(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function so(e){var t=Pr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Nr(e.display)-3);return function(i){if(St(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return r?a+(Math.ceil(i.text.length/n)||1)*t:a+t}}function fa(e){var t=e.doc,r=so(e);t.iter(function(n){var i=r(n);i!=n.height&&mn(n,i)})}function yr(e,t,r,n){var i=e.display;if(!r&&V(t).getAttribute("cm-not-content")=="true")return null;var a,o,s=i.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch(O){return null}var u=la(e,a,o),d;if(n&&u.xRel>0&&(d=Qe(e.doc,u.line).text).length==u.ch){var E=g(d,d.length,e.options.tabSize)-d.length;u=Ne(u.line,Math.max(0,Math.round((a-$a(e.display).left)/Nr(e.display))-E))}return u}function xr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function vn(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)gn&&xt(e.doc,t)<i.viewTo&&sr(e);else if(r<=i.viewFrom)gn&&wt(e.doc,r+n)>i.viewFrom?sr(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)sr(e);else if(t<=i.viewFrom){var a=Mi(e,r,r+n,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=n):sr(e)}else if(r>=i.viewTo){var o=Mi(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):sr(e)}else{var s=Mi(e,t,t,-1),u=Mi(e,r,r+n,1);s&&u?(i.view=i.view.slice(0,s.index).concat(Ai(e,s.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=n):sr(e)}var d=i.externalMeasured;d&&(r<d.lineN?d.lineN+=n:t<d.lineN+d.size&&(i.externalMeasured=null))}function or(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var a=n.view[xr(e,t)];if(a.node==null)return;var o=a.changes||(a.changes=[]);N(o,r)==-1&&o.push(r)}function sr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Mi(e,t,r,n){var i=xr(e,t),a,o=e.display.view;if(!gn||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,u=0;u<i;u++)s+=o[u].size;if(s!=t){if(n>0){if(i==o.length-1)return null;a=s+o[i].size-t,i++}else a=s-t;t+=a,r+=a}for(;xt(e.doc,r)!=r;){if(i==(n<0?0:o.length-1))return null;r+=n*o[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function Xs(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Ai(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Ai(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(xr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Ai(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,xr(e,r)))),n.viewTo=r}function lo(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];!i.hidden&&(!i.node||i.changes)&&++r}return r}function ii(e){e.display.input.showSelection(e.display.input.prepareSelection())}function uo(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),a=n.selection=document.createDocumentFragment(),o=0;o<r.sel.ranges.length;o++){if(!t&&o==r.sel.primIndex)continue;var s=r.sel.ranges[o];if(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)continue;var u=s.empty();(u||e.options.showCursorWhenSelecting)&&co(e,s.head,i),u||Vs(e,s,a)}return n}function co(e,t,r){var n=In(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(y("div","\xA0","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var a=r.appendChild(y("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=n.other.left+"px",a.style.top=n.other.top+"px",a.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Ri(e,t){return e.top-t.top||e.left-t.left}function Vs(e,t,r){var n=e.display,i=e.doc,a=document.createDocumentFragment(),o=$a(e.display),s=o.left,u=Math.max(n.sizerWidth,vr(e)-n.sizer.offsetLeft)-o.right,d=i.direction=="ltr";function E(Be,et,gt,ut){et<0&&(et=0),et=Math.round(et),ut=Math.round(ut),a.appendChild(y("div",null,"CodeMirror-selected","position: absolute; left: "+Be+`px;
|
|
top: `+et+"px; width: "+(gt==null?u-Be:gt)+`px;
|
|
height: `+(ut-et)+"px"))}function O(Be,et,gt){var ut=Qe(i,Be),Et=ut.text.length,Mt,Qt;function It(Gt,xn){return oa(e,Ne(Be,Gt),"div",ut,xn)}function Cn(Gt,xn,rn){var Vt=oo(e,ut,null,Gt),Xt=xn=="ltr"==(rn=="after")?"left":"right",Wt=rn=="after"?Vt.begin:Vt.end-(/\s/.test(ut.text.charAt(Vt.end-1))?2:1);return It(Wt,Xt)[Xt]}var yn=nt(ut,i.direction);return Ve(yn,et||0,gt==null?Et:gt,function(Gt,xn,rn,Vt){var Xt=rn=="ltr",Wt=It(Gt,Xt?"left":"right"),wn=It(xn-1,Xt?"right":"left"),$r=et==null&&Gt==0,hr=gt==null&&xn==Et,ln=Vt==0,Kn=!yn||Vt==yn.length-1;if(wn.top-Wt.top<=3){var en=(d?$r:hr)&&ln,Ia=(d?hr:$r)&&Kn,tr=en?s:(Xt?Wt:wn).left,kr=Ia?u:(Xt?wn:Wt).right;E(tr,Wt.top,kr-tr,Wt.bottom)}else{var Sr,hn,Yr,Ua;Xt?(Sr=d&&$r&&ln?s:Wt.left,hn=d?u:Cn(Gt,rn,"before"),Yr=d?s:Cn(xn,rn,"after"),Ua=d&&hr&&Kn?u:wn.right):(Sr=d?Cn(Gt,rn,"before"):s,hn=!d&&$r&&ln?u:Wt.right,Yr=!d&&hr&&Kn?s:wn.left,Ua=d?Cn(xn,rn,"after"):u),E(Sr,Wt.top,hn-Sr,Wt.bottom),Wt.bottom<wn.top&&E(s,Wt.bottom,null,wn.top),E(Yr,wn.top,Ua-Yr,wn.bottom)}(!Mt||Ri(Wt,Mt)<0)&&(Mt=Wt),Ri(wn,Mt)<0&&(Mt=wn),(!Qt||Ri(Wt,Qt)<0)&&(Qt=Wt),Ri(wn,Qt)<0&&(Qt=wn)}),{start:Mt,end:Qt}}var q=t.from(),K=t.to();if(q.line==K.line)O(q.line,q.ch,K.ch);else{var xe=Qe(i,q.line),De=Qe(i,K.line),Ue=jn(xe)==jn(De),He=O(q.line,q.ch,Ue?xe.text.length+1:null).end,$e=O(K.line,Ue?0:null,K.ch).start;Ue&&(He.top<$e.top-2?(E(He.right,He.top,null,He.bottom),E(s,$e.top,$e.left,$e.bottom)):E(He.right,He.top,$e.left-He.right,He.bottom)),He.bottom<$e.top&&E(s,He.bottom,null,$e.top)}r.appendChild(a)}function ha(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||jr(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function fo(e){e.state.focused||(e.display.input.focus(),pa(e))}function ho(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,jr(e))},100)}function pa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ce(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),S&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ha(e)}function jr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ce(e,"blur",e,t),e.state.focused=!1,me(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Pi(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],a=e.options.lineWrapping,o=void 0,s=0;if(i.hidden)continue;if(M&&D<8){var u=i.node.offsetTop+i.node.offsetHeight;o=u-r,r=u}else{var d=i.node.getBoundingClientRect();o=d.bottom-d.top,!a&&i.text.firstChild&&(s=i.text.firstChild.getBoundingClientRect().right-d.left-1)}var E=i.line.height-o;if((E>.005||E<-.005)&&(mn(i.line,o),po(i.line),i.rest))for(var O=0;O<i.rest.length;O++)po(i.rest[O]);if(s>e.display.sizerWidth){var q=Math.ceil(s/Nr(e.display));q>e.display.maxLineLength&&(e.display.maxLineLength=q,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function po(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Ni(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Li(e));var i=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,a=kn(t,n),o=kn(t,i);if(r&&r.ensure){var s=r.ensure.from.line,u=r.ensure.to.line;s<a?(a=s,o=kn(t,Pt(Qe(t,s))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=o&&(a=kn(t,Pt(Qe(t,u))-e.wrapper.clientHeight),o=u)}return{from:a,to:Math.max(o,a+1)}}function $s(e,t){if(Ie(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!W){var a=y("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-Li(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Bn(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}function Ys(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(t=t.ch?Ne(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Ne(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var o=!1,s=In(e,t),u=!r||r==t?s:In(e,r);i={left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-n,right:Math.max(s.left,u.left),bottom:Math.max(s.bottom,u.bottom)+n};var d=ma(e,i),E=e.doc.scrollTop,O=e.doc.scrollLeft;if(d.scrollTop!=null&&(oi(e,d.scrollTop),Math.abs(e.doc.scrollTop-E)>1&&(o=!0)),d.scrollLeft!=null&&(wr(e,d.scrollLeft),Math.abs(e.doc.scrollLeft-O)>1&&(o=!0)),!o)break}return i}function qs(e,t){var r=ma(e,t);r.scrollTop!=null&&oi(e,r.scrollTop),r.scrollLeft!=null&&wr(e,r.scrollLeft)}function ma(e,t){var r=e.display,n=Pr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,a=ra(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+na(r),u=t.top<n,d=t.bottom>s-n;if(t.top<i)o.scrollTop=u?0:t.top;else if(t.bottom>i+a){var E=Math.min(t.top,(d?s:t.bottom)-a);E!=i&&(o.scrollTop=E)}var O=e.options.fixedGutter?0:r.gutters.offsetWidth,q=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-O,K=vr(e)-r.gutters.offsetWidth,xe=t.right-t.left>K;return xe&&(t.right=t.left+K),t.left<10?o.scrollLeft=0:t.left<q?o.scrollLeft=Math.max(0,t.left+O-(xe?0:10)):t.right>K+q-3&&(o.scrollLeft=t.right+(xe?0:10)-K),o}function ga(e,t){if(t==null)return;ji(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ir(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ai(e,t,r){(t!=null||r!=null)&&ji(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Js(e,t){ji(e),e.curOp.scrollToPos=t}function ji(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=io(e,t.from),n=io(e,t.to);mo(e,r,n,t.margin)}}function mo(e,t,r,n){var i=ma(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});ai(e,i.scrollLeft,i.scrollTop)}function oi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;oe||ba(e,{top:t}),go(e,t,!0),oe&&ba(e),ui(e,100)}function go(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function wr(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,wo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function si(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+na(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?r:0,docHeight:n,scrollHeight:n+Bn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Er=function(e,t,r){this.cm=r;var n=this.vert=y("div",[y("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=y("div",[y("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),ve(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ve(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,M&&D<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Er.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Er.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Er.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Er.prototype.zeroWidthHack=function(){var e=ie&&!le?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new _,this.disableVert=new _},Er.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var i=e.getBoundingClientRect(),a=r=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);a!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Er.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var li=function(){};li.prototype.update=function(){return{bottom:0,right:0}},li.prototype.setScrollLeft=function(){},li.prototype.setScrollTop=function(){},li.prototype.clear=function(){};function Ur(e,t){t||(t=si(e));var r=e.display.barWidth,n=e.display.barHeight;vo(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Pi(e),vo(e,si(e)),r=e.display.barWidth,n=e.display.barHeight}function vo(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var bo={native:Er,null:li};function yo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&me(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new bo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ve(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?wr(e,t):oi(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function _r(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:++Zs},As(e.curOp)}function Cr(e){var t=e.curOp;t&&Ds(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;Qs(r)})}function Qs(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var n=0;n<t.length;n++)tl(t[n]);for(var i=0;i<t.length;i++)nl(t[i]);for(var a=0;a<t.length;a++)rl(t[a]);for(var o=0;o<t.length;o++)il(t[o])}function el(e){var t=e.cm,r=t.display;ol(t),e.updateMaxLine&&Yt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&va(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&Pi(t),e.barMeasure=si(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=qa(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Bn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-vr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.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&&wr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==ee();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ur(t,e.barMeasure),e.updatedDisplay&&xa(t,e.barMeasure),e.selectionChanged&&ha(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&fo(e.cm)}function il(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&xo(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&go(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&wr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Ys(t,pt(n,e.scrollToPos.from),pt(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,i)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var s=0;s<a.length;++s)a[s].lines.length||Ce(a[s],"hide");if(o)for(var u=0;u<o.length;++u)o[u].lines.length&&Ce(o[u],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function _n(e,t){if(e.curOp)return t();_r(e);try{return t()}finally{Cr(e)}}function Jt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);_r(e);try{return t.apply(e,arguments)}finally{Cr(e)}}}function fn(e){return function(){if(this.curOp)return e.apply(this,arguments);_r(this);try{return e.apply(this,arguments)}finally{Cr(this)}}}function Zt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);_r(t);try{return e.apply(this,arguments)}finally{Cr(t)}}}function ui(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,c(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=he(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(n.line>=e.display.viewFrom){var o=a.styles,s=a.text.length>e.options.maxHighlightLength?An(t.mode,n.state):null,u=Mn(e,a,n,!0);s&&(n.state=s),a.styles=u.styles;var d=a.styleClasses,E=u.classes;E?a.styleClasses=E:d&&(a.styleClasses=null);for(var O=!o||o.length!=a.styles.length||d!=E&&(!d||!E||d.bgClass!=E.bgClass||d.textClass!=E.textClass),q=0;!O&&q<o.length;++q)O=o[q]!=a.styles[q];O&&i.push(n.line),a.stateAfter=n.save(),n.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Ze(e,a.text,n),a.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ui(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&_n(e,function(){for(var a=0;a<i.length;a++)or(e,i[a],"text")})}var Ii=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Ni(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=vr(e),this.force=r,this.dims=ca(e),this.events=[]};Ii.prototype.signal=function(e,t){L(e,t)&&this.events.push(arguments)},Ii.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ce.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=Bn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Bn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=ee();if(!t||!w(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&w(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==ee())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&w(document.body,e.anchorNode)&&w(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function va(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return sr(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&lo(e)==0)return!1;Eo(e)&&(sr(e),t.dims=ca(e));var i=n.first+n.size,a=Math.max(t.visible.from-e.options.viewportMargin,n.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<a&&a-r.viewFrom<20&&(a=Math.max(n.first,r.viewFrom)),r.viewTo>o&&r.viewTo-o<20&&(o=Math.min(i,r.viewTo)),gn&&(a=xt(e.doc,a),o=wt(e.doc,o));var s=a!=r.viewFrom||o!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Xs(e,a,o),r.viewOffset=Pt(Qe(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=lo(e);if(!s&&u==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var d=sl(e);return u>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(d),Ae(r.cursorDiv),Ae(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ui(e,400)),r.updateLineNumbers=null,!0}function xo(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==vr(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+na(e.display)-ra(e),r.top)}),t.visible=Ni(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Ni(e.display,e.doc,r));if(!va(e,t))break;Pi(e);var i=si(e);ii(e),Ur(e,i),xa(e,i),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 ba(e,t){var r=new Ii(e,t);if(va(e,r)){Pi(e),xo(e,r);var n=si(e);ii(e),Ur(e,n),xa(e,n),r.finish()}}function ul(e,t,r){var n=e.display,i=e.options.lineNumbers,a=n.lineDiv,o=a.firstChild;function s(xe){var De=xe.nextSibling;return S&&ie&&e.display.currentWheelTarget==xe?xe.style.display="none":xe.parentNode.removeChild(xe),De}for(var u=n.view,d=n.viewFrom,E=0;E<u.length;E++){var O=u[E];if(!O.hidden)if(!O.node||O.node.parentNode!=a){var q=js(e,O,d,r);a.insertBefore(q,o)}else{for(;o!=O.node;)o=s(o);var K=i&&t!=null&&t<=d&&O.lineNumber;O.changes&&(N(O.changes,"gutter")>-1&&(K=!1),za(e,O,d,r)),K&&(Ae(O.lineNumber),O.lineNumber.appendChild(document.createTextNode(Ln(e.options,d)))),o=O.node.nextSibling}d+=O.size}for(;o;)o=s(o)}function ya(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+Bn(e)+"px"}function wo(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=da(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=n+"px",o=0;o<r.length;o++)if(!r[o].hidden){e.options.fixedGutter&&(r[o].gutter&&(r[o].gutter.style.left=a),r[o].gutterBackground&&(r[o].gutterBackground.style.left=a));var s=r[o].alignable;if(s)for(var u=0;u<s.length;u++)s[u].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}function Eo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Ln(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(y("div",[y("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(a,n.lineGutter.offsetWidth-o)+1,n.lineNumWidth=n.lineNumInnerWidth+o,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",ya(e.display),!0}return!1}function wa(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!="string"&&(o=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:a,style:o})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function _o(e){var t=e.gutters,r=e.gutterSpecs;Ae(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],a=i.className,o=i.style,s=t.appendChild(y("div",null,"CodeMirror-gutter "+a));o&&(s.style.cssText=o),a=="CodeMirror-linenumbers"&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",ya(e)}function ci(e){_o(e.display),vn(e),wo(e)}function cl(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=y("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=y("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=Z("div",null,"CodeMirror-code"),i.selectionDiv=y("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=y("div",null,"CodeMirror-cursors"),i.measure=y("div",null,"CodeMirror-measure"),i.lineMeasure=y("div",null,"CodeMirror-measure"),i.lineSpace=Z("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=Z("div",[i.lineSpace],"CodeMirror-lines");i.mover=y("div",[a],null,"position: relative"),i.sizer=y("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=y("div",null,null,"position: absolute; height: "+de+"px; width: 1px;"),i.gutters=y("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=y("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=y("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),M&&D<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!S&&!(oe&&se)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=wa(n.gutters,n.lineNumbers),_o(i),r.init(i)}var Ui=0,Tn=null;M?Tn=-.53:oe?Tn=15:$?Tn=-.7:ye&&(Tn=-1/3);function Co(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function dl(e){var t=Co(e);return t.x*=Tn,t.y*=Tn,t}function ko(e,t){var r=Co(t),n=r.x,i=r.y,a=e.display,o=a.scroller,s=o.scrollWidth>o.clientWidth,u=o.scrollHeight>o.clientHeight;if(!(n&&s||i&&u))return;if(i&&ie&&S){e:for(var d=t.target,E=a.view;d!=o;d=d.parentNode)for(var O=0;O<E.length;O++)if(E[O].node==d){e.display.currentWheelTarget=d;break e}}if(n&&!oe&&!re&&Tn!=null){i&&u&&oi(e,Math.max(0,o.scrollTop+i*Tn)),wr(e,Math.max(0,o.scrollLeft+n*Tn)),(!i||i&&u)&&f(t),a.wheelStartX=null;return}if(i&&Tn!=null){var q=i*Tn,K=e.doc.scrollTop,xe=K+a.wrapper.clientHeight;q<0?K=Math.max(0,K+q-50):xe=Math.min(e.doc.height,xe+q+50),ba(e,{top:K,bottom:xe})}Ui<20&&(a.wheelStartX==null?(a.wheelStartX=o.scrollLeft,a.wheelStartY=o.scrollTop,a.wheelDX=n,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX==null)return;var De=o.scrollLeft-a.wheelStartX,Ue=o.scrollTop-a.wheelStartY,He=Ue&&a.wheelDY&&Ue/a.wheelDY||De&&a.wheelDX&&De/a.wheelDX;if(a.wheelStartX=a.wheelStartY=null,!He)return;Tn=(Tn*Ui+He)/(Ui+1),++Ui},200)):(a.wheelDX+=n,a.wheelDY+=i))}var On=function(e,t){this.ranges=e,this.primIndex=t};On.prototype.primary=function(){return this.ranges[this.primIndex]},On.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 r=this.ranges[t],n=e.ranges[t];if(!Sn(r.anchor,n.anchor)||!Sn(r.head,n.head))return!1}return!0},On.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ot(Dn(this.ranges[t].anchor),Dn(this.ranges[t].head));return new On(e,this.primIndex)},On.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},On.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(mt(t,n.from())>=0&&mt(e,n.to())<=0)return r}return-1};var Ot=function(e,t){this.anchor=e,this.head=t};Ot.prototype.from=function(){return Xn(this.anchor,this.head)},Ot.prototype.to=function(){return Fe(this.anchor,this.head)},Ot.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Un(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(q,K){return mt(q.from(),K.from())}),r=N(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],u=mt(s.to(),o.from());if(n&&!o.empty()?u>0:u>=0){var d=Xn(s.from(),o.from()),E=Fe(s.to(),o.to()),O=s.empty()?o.from()==o.head:s.from()==s.head;a<=r&&--r,t.splice(--a,2,new Ot(O?E:d,O?d:E))}}return new On(t,r)}function lr(e,t){return new On([new Ot(e,t||e)],0)}function ur(e){return e.text?Ne(e.from.line+e.text.length-1,h(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function So(e,t){if(mt(e,t.from)<0)return e;if(mt(e,t.to)<=0)return ur(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=ur(t).ch-t.to.ch),Ne(r,n)}function Ea(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Ot(So(i.anchor,t),So(i.head,t)))}return Un(e.cm,r,e.sel.primIndex)}function To(e,t,r){return e.line==t.line?Ne(r.line,e.ch-t.ch+r.ch):Ne(r.line+(e.line-t.line),e.ch)}function fl(e,t,r){for(var n=[],i=Ne(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],u=To(s.from,i,a),d=To(ur(s),i,a);if(i=s.to,a=d,r=="around"){var E=e.sel.ranges[o],O=mt(E.head,E.anchor)<0;n[o]=new Ot(O?d:u,O?u:d)}else n[o]=new Ot(u,u)}return new On(n,e.sel.primIndex)}function _a(e){e.doc.mode=pn(e.options,e.doc.modeOption),di(e)}function di(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,ui(e,100),e.state.modeGen++,e.curOp&&vn(e)}function Oo(e,t){return t.from.ch==0&&t.to.ch==0&&h(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ca(e,t,r,n){function i($e){return r?r[$e]:null}function a($e,Be,et){qn($e,Be,et,n),nn($e,"change",$e,t)}function o($e,Be){for(var et=[],gt=$e;gt<Be;++gt)et.push(new qt(d[gt],i(gt),n));return et}var s=t.from,u=t.to,d=t.text,E=Qe(e,s.line),O=Qe(e,u.line),q=h(d),K=i(d.length-1),xe=u.line-s.line;if(t.full)e.insert(0,o(0,d.length)),e.remove(d.length,e.size-d.length);else if(Oo(e,t)){var De=o(0,d.length-1);a(O,O.text,K),xe&&e.remove(s.line,xe),De.length&&e.insert(s.line,De)}else if(E==O)if(d.length==1)a(E,E.text.slice(0,s.ch)+q+E.text.slice(u.ch),K);else{var Ue=o(1,d.length-1);Ue.push(new qt(q+E.text.slice(u.ch),K,n)),a(E,E.text.slice(0,s.ch)+d[0],i(0)),e.insert(s.line+1,Ue)}else if(d.length==1)a(E,E.text.slice(0,s.ch)+d[0]+O.text.slice(u.ch),i(0)),e.remove(s.line+1,xe);else{a(E,E.text.slice(0,s.ch)+d[0],i(0)),a(O,q+O.text.slice(u.ch),K);var He=o(1,d.length-1);xe>1&&e.remove(s.line+1,xe-1),e.insert(s.line+1,He)}nn(e,"change",e,t)}function cr(e,t,r){function n(i,a,o){if(i.linked)for(var s=0;s<i.linked.length;++s){var u=i.linked[s];if(u.doc==a)continue;var d=o&&u.sharedHist;if(r&&!d)continue;t(u.doc,d),n(u.doc,i,d)}}n(e,null,!0)}function Ao(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,fa(e),_a(e),Lo(e),e.options.lineWrapping||Yt(e),e.options.mode=t.modeOption,vn(e)}function Lo(e){(e.doc.direction=="rtl"?j:me)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){_n(e,function(){Lo(e),vn(e)})}function Fi(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 ka(e,t){var r={from:Dn(t.from),to:ur(t),text:tn(e,t.from,t.to)};return Ro(e,r,t.from.line,t.to.line+1),cr(e,function(n){return Ro(n,r,t.from.line,t.to.line+1)},!0),r}function Do(e){for(;e.length;){var t=h(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Do(e.done),h(e.done);if(e.done.length&&!h(e.done).ranges)return h(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),h(e.done)}function Mo(e,t,r,n){var i=e.history;i.undone.length=0;var a=+new Date,o,s;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=pl(i,i.lastOp==n)))s=h(o.changes),mt(t.from,t.to)==0&&mt(t.from,s.to)==0?s.to=ur(t):o.changes.push(ka(e,t));else{var u=h(i.done);for((!u||!u.ranges)&&Wi(e.sel,i.done),o={changes:[ka(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Ce(e,"historyAdded")}function ml(e,t,r,n){var i=t.charAt(0);return i=="*"||i=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,n){var i=e.history,a=n&&n.origin;r==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||ml(e,a,h(i.done),t))?i.done[i.done.length-1]=t:Wi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=r,n&&n.clearRedo!==!1&&Do(i.undone)}function Wi(e,t){var r=h(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Ro(e,t,r,n){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(o){o.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=o.markedSpans),++a})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function bl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(vl(r[i]));return n}function Po(e,t){var r=bl(e,t),n=$n(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var a=r[i],o=n[i];if(a&&o){e:for(var s=0;s<o.length;++s){for(var u=o[s],d=0;d<a.length;++d)if(a[d].marker==u.marker)continue e;a.push(u)}}else o&&(r[i]=o)}return r}function Fr(e,t,r){for(var n=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){n.push(r?On.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];n.push({changes:s});for(var u=0;u<o.length;++u){var d=o[u],E=void 0;if(s.push({from:d.from,to:d.to,text:d.text}),t)for(var O in d)(E=O.match(/^spans_(\d+)$/))&&(N(t,Number(E[1]))>-1&&(h(s)[O]=d[O],delete d[O]))}}return n}function Sa(e,t,r,n){if(n){var i=e.anchor;if(r){var a=mt(t,i)<0;a!=mt(r,i)<0?(i=t,t=r):a!=mt(t,r)<0&&(t=r)}return new Ot(i,t)}else return new Ot(r||t,t)}function Hi(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),sn(e,new On([Sa(e.sel.primary(),t,r,i)],0),n)}function No(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)n[a]=Sa(e.sel.ranges[a],t[a],null,i);var o=Un(e.cm,n,e.sel.primIndex);sn(e,o,r)}function Ta(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,sn(e,Un(e.cm,i,e.sel.primIndex),n)}function jo(e,t,r,n){sn(e,lr(t,r),n)}function yl(e,t,r){var n={ranges:t.ranges,update:function(i){this.ranges=[];for(var a=0;a<i.length;a++)this.ranges[a]=new Ot(pt(e,i[a].anchor),pt(e,i[a].head))},origin:r&&r.origin};return Ce(e,"beforeSelectionChange",e,n),e.cm&&Ce(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Un(e.cm,n.ranges,n.ranges.length-1):t}function Io(e,t,r){var n=e.history.done,i=h(n);i&&i.ranges?(n[n.length-1]=t,Bi(e,t,r)):sn(e,t,r)}function sn(e,t,r){Bi(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Bi(e,t,r){(L(e,"beforeSelectionChange")||e.cm&&L(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,r));var n=r&&r.bias||(mt(t.primary().head,e.sel.primary().head)<0?-1:1);Uo(e,Wo(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&Ir(e.cm)}function Uo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,I(e.cm)),nn(e,"cursorActivity",e)}function Fo(e){Uo(e,Wo(e,e.sel,null,!1))}function Wo(e,t,r,n){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],u=zi(e,o.anchor,s&&s.anchor,r,n),d=zi(e,o.head,s&&s.head,r,n);(i||u!=o.anchor||d!=o.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new Ot(u,d))}return i?Un(e.cm,i,t.primIndex):t}function Wr(e,t,r,n,i){var a=Qe(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],u=s.marker,d="selectLeft"in u?!u.selectLeft:u.inclusiveLeft,E="selectRight"in u?!u.selectRight:u.inclusiveRight;if((s.from==null||(d?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(E?s.to>=t.ch:s.to>t.ch))){if(i&&(Ce(u,"beforeCursorEnter"),u.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!u.atomic)continue;if(r){var O=u.find(n<0?1:-1),q=void 0;if((n<0?E:d)&&(O=Ho(e,O,-n,O&&O.line==t.line?a:null)),O&&O.line==t.line&&(q=mt(O,r))&&(n<0?q<0:q>0))return Wr(e,O,t,n,i)}var K=u.find(n<0?-1:1);return(n<0?d:E)&&(K=Ho(e,K,n,K.line==t.line?a:null)),K?Wr(e,K,t,n,i):null}}return t}function zi(e,t,r,n,i){var a=n||1,o=Wr(e,t,r,a,i)||!i&&Wr(e,t,r,a,!0)||Wr(e,t,r,-a,i)||!i&&Wr(e,t,r,-a,!0);return o||(e.cantEdit=!0,Ne(e.first,0))}function Ho(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?pt(e,Ne(t.line-1)):null:r>0&&t.ch==(n||Qe(e,t.line)).text.length?t.line<e.first+e.size-1?Ne(t.line+1,0):null:new Ne(t.line,t.ch+r)}function Bo(e){e.setSelection(Ne(e.firstLine(),0),Ne(e.lastLine()),ae)}function zo(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(i,a,o,s){i&&(n.from=pt(e,i)),a&&(n.to=pt(e,a)),o&&(n.text=o),s!==void 0&&(n.origin=s)}),Ce(e,"beforeChange",e,n),e.cm&&Ce(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Hr(e,t,r){if(e.cm){if(!e.cm.curOp)return Jt(e.cm,Hr)(e,t,r);if(e.cm.state.suppressEdits)return}if((L(e,"beforeChange")||e.cm&&L(e.cm,"beforeChange"))&&(t=zo(e,t,!0),!t))return;var n=Nn&&!r&&Lr(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Ko(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Ko(e,t)}function Ko(e,t){if(t.text.length==1&&t.text[0]==""&&mt(t.from,t.to)==0)return;var r=Ea(e,t);Mo(e,t,r,e.cm?e.cm.curOp.id:NaN),fi(e,t,r,$n(e,t));var n=[];cr(e,function(i,a){!a&&N(n,i.history)==-1&&($o(i.history,t),n.push(i.history)),fi(i,t,null,$n(i,t))})}function Ki(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var i=e.history,a,o=e.sel,s=t=="undo"?i.done:i.undone,u=t=="undo"?i.undone:i.done,d=0;d<s.length&&!(a=s[d],r?a.ranges&&!a.equals(e.sel):!a.ranges);d++);if(d==s.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(Wi(a,u),r&&!a.equals(e.sel)){sn(e,a,{clearRedo:!1});return}o=a}else if(n){s.push(a);return}else break;var E=[];Wi(o,u),u.push({changes:E,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var O=L(e,"beforeChange")||e.cm&&L(e.cm,"beforeChange"),q=function(De){var Ue=a.changes[De];if(Ue.origin=t,O&&!zo(e,Ue,!1))return s.length=0,{};E.push(ka(e,Ue));var He=De?Ea(e,Ue):h(s);fi(e,Ue,He,Po(e,Ue)),!De&&e.cm&&e.cm.scrollIntoView({from:Ue.from,to:ur(Ue)});var $e=[];cr(e,function(Be,et){!et&&N($e,Be.history)==-1&&($o(Be.history,Ue),$e.push(Be.history)),fi(Be,Ue,null,Po(Be,Ue))})},K=a.changes.length-1;K>=0;--K){var xe=q(K);if(xe)return xe.v}}function Go(e,t){if(t==0)return;if(e.first+=t,e.sel=new On(T(e.sel.ranges,function(i){return new Ot(Ne(i.anchor.line+t,i.anchor.ch),Ne(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){vn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)or(e.cm,n,"gutter")}}function fi(e,t,r,n){if(e.cm&&!e.cm.curOp)return Jt(e.cm,fi)(e,t,r,n);if(t.to.line<e.first){Go(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 i=t.text.length-1-(e.first-t.from.line);Go(e,i),t={from:Ne(e.first,0),to:Ne(t.to.line+i,t.to.ch),text:[h(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:Ne(a,Qe(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tn(e,t.from,t.to),r||(r=Ea(e,t)),e.cm?xl(e.cm,t,n):Ca(e,t,n),Bi(e,r,ae),e.cantEdit&&zi(e,Ne(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,r){var n=e.doc,i=e.display,a=t.from,o=t.to,s=!1,u=a.line;e.options.lineWrapping||(u=Ct(jn(Qe(n,a.line))),n.iter(u,o.line+1,function(K){if(K==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&I(e),Ca(n,t,r,so(e)),e.options.lineWrapping||(n.iter(u,a.line+t.text.length,function(K){var xe=Ft(K);xe>i.maxLineLength&&(i.maxLine=K,i.maxLineLength=xe,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),En(n,a.line),ui(e,400);var d=t.text.length-(o.line-a.line)-1;t.full?vn(e):a.line==o.line&&t.text.length==1&&!Oo(e.doc,t)?or(e,a.line,"text"):vn(e,a.line,o.line+1,d);var E=L(e,"changes"),O=L(e,"change");if(O||E){var q={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};O&&nn(e,"change",e,q),E&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(q)}e.display.selForContextMenu=null}function Br(e,t,r,n,i){var a;n||(n=r),mt(n,r)<0&&(a=[n,r],r=a[0],n=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Hr(e,{from:r,to:n,text:t,origin:i})}function Xo(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Vo(e,t,r,n){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)Xo(a.ranges[s].anchor,t,r,n),Xo(a.ranges[s].head,t,r,n);continue}for(var u=0;u<a.changes.length;++u){var d=a.changes[u];if(r<d.from.line)d.from=Ne(d.from.line+n,d.from.ch),d.to=Ne(d.to.line+n,d.to.ch);else if(t<=d.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function $o(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Vo(e.done,r,n,i),Vo(e.undone,r,n,i)}function hi(e,t,r,n){var i=t,a=t;return typeof t=="number"?a=Qe(e,Tr(e,t)):i=Ct(t),i==null?null:(n(a,i)&&e.cm&&or(e.cm,i,r),a)}function pi(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}pi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,Kt(i),nn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function mi(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}mi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var a=Math.min(t,i-e),o=n.height;if(n.removeInner(e,a),this.height-=o-n.height,i==a&&(this.children.splice(r--,1),n.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof pi))){var s=[];this.collapse(s),this.children=[new pi(s)],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,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var u=new pi(i.lines.slice(s,s+=25));i.height-=u.height,this.children.splice(++n,0,u),u.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new mi(t);if(e.parent){e.size-=r.size,e.height-=r.height;var i=N(e.parent.children,e);e.parent.children.splice(i+1,0,r)}else{var n=new mi(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,r))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var gi=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};gi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Ct(r);if(n==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var a=ni(this);mn(r,Math.max(0,r.height-a)),e&&(_n(e,function(){Yo(e,r,-a),or(e,n,"widget")}),nn(e,"lineWidgetCleared",e,this,n))},gi.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=ni(this)-t;if(!i)return;St(this.doc,n)||mn(n,n.height+i),r&&_n(r,function(){r.curOp.forceUpdate=!0,Yo(r,n,i),nn(r,"lineWidgetChanged",r,e,Ct(n))})},x(gi);function Yo(e,t,r){Pt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ga(e,r)}function wl(e,t,r,n){var i=new gi(e,r,n),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),hi(e,t,"widget",function(o){var s=o.widgets||(o.widgets=[]);if(i.insertAt==null?s.push(i):s.splice(Math.min(s.length-1,Math.max(0,i.insertAt)),0,i),i.line=o,a&&!St(e,o)){var u=Pt(o)<e.scrollTop;mn(o,o.height+ni(i)),u&&ga(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&nn(a,"lineWidgetAdded",a,i,typeof t=="number"?t:Ct(t)),i}var qo=0,dr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++qo};dr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&_r(e),L(this,"clear")){var r=this.find();r&&nn(this,"clear",r.from,r.to)}for(var n=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=rr(o.markedSpans,this);e&&!this.collapsed?or(e,Ct(o),"text"):e&&(s.to!=null&&(i=Ct(o)),s.from!=null&&(n=Ct(o))),o.markedSpans=Zi(o.markedSpans,s),s.from==null&&this.collapsed&&!St(this.doc,o)&&e&&mn(o,Pr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var d=jn(this.lines[u]),E=Ft(d);E>e.display.maxLineLength&&(e.display.maxLine=d,e.display.maxLineLength=E,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&vn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Fo(e.doc)),e&&nn(e,"markerCleared",e,this,n,i),t&&Cr(e),this.parent&&this.parent.clear()},dr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var a=this.lines[i],o=rr(a.markedSpans,this);if(o.from!=null&&(r=Ne(t?a:Ct(a),o.from),e==-1))return r;if(o.to!=null&&(n=Ne(t?a:Ct(a),o.to),e==1))return n}return r&&{from:r,to:n}},dr.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;_n(n,function(){var i=t.line,a=Ct(t.line),o=ia(n,a);if(o&&(Qa(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!St(r.doc,i)&&r.height!=null){var s=r.height;r.height=null;var u=ni(r)-s;u&&mn(i,i.height+u)}nn(n,"markerChanged",n,e)})},dr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||N(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},dr.prototype.detachLine=function(e){if(this.lines.splice(N(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},x(dr);function zr(e,t,r,n,i){if(n&&n.shared)return El(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Jt(e.cm,zr)(e,t,r,n,i);var a=new dr(e,i),o=mt(t,r);if(n&&l(n,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=Z("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ea(e,t.line,t,r,a)||t.line!=r.line&&ea(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");Si()}a.addToHistory&&Mo(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s=t.line,u=e.cm,d;if(e.iter(s,r.line+1,function(O){u&&a.collapsed&&!u.options.lineWrapping&&jn(O)==u.display.maxLine&&(d=!0),a.collapsed&&s!=t.line&&mn(O,0),Ti(O,new pr(a,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),a.collapsed&&e.iter(t.line,r.line+1,function(O){St(e,O)&&mn(O,0)}),a.clearOnEnter&&ve(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(ki(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++qo,a.atomic=!0),u){if(d&&(u.curOp.updateMaxLine=!0),a.collapsed)vn(u,t.line,r.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var E=t.line;E<=r.line;E++)or(u,E,"text");a.atomic&&Fo(u.doc),nn(u,"markerAdded",u,a)}return a}var vi=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};vi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();nn(this,"clear")},vi.prototype.find=function(e,t){return this.primary.find(e,t)},x(vi);function El(e,t,r,n,i){n=l(n),n.shared=!1;var a=[zr(e,t,r,n,i)],o=a[0],s=n.widgetNode;return cr(e,function(u){s&&(n.widgetNode=s.cloneNode(!0)),a.push(zr(u,pt(u,t),pt(u,r),n,i));for(var d=0;d<u.linked.length;++d)if(u.linked[d].isParent)return;o=h(a)}),new vi(a,o)}function Jo(e){return e.findMarks(Ne(e.first,0),e.clipPos(Ne(e.lastLine())),function(t){return t.parent})}function _l(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(mt(a,o)){var s=zr(e,a,o,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function Cl(e){for(var t=function(n){var i=e[n],a=[i.primary.doc];cr(i.primary.doc,function(u){return a.push(u)});for(var o=0;o<i.markers.length;o++){var s=i.markers[o];N(a,s.doc)==-1&&(s.parent=null,i.markers.splice(o--,1))}},r=0;r<e.length;r++)t(r)}var kl=0,bn=function(e,t,r,n,i){if(!(this instanceof bn))return new bn(e,t,r,n,i);r==null&&(r=0),mi.call(this,[new pi([new qt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var a=Ne(r,0);this.sel=lr(a),this.history=new Fi(null),this.id=++kl,this.modeOption=t,this.lineSep=n,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ca(this,{from:a,to:a,text:e}),sn(this,lr(a),ae)};bn.prototype=Y(mi.prototype,{constructor:bn,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Gn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Zt(function(e){var t=Ne(this.first,0),r=this.first+this.size-1;Hr(this,{from:t,to:Ne(r,Qe(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ai(this.cm,0,0),sn(this,lr(t),ae)}),replaceRange:function(e,t,r,n){t=pt(this,t),r=r?pt(this,r):t,Br(this,e,t,r,n)},getRange:function(e,t,r){var n=tn(this,pt(this,e),pt(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Pn(this,e))return Qe(this,e)},getLineNumber:function(e){return Ct(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Qe(this,e)),jn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return pt(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Zt(function(e,t,r){jo(this,pt(this,typeof e=="number"?Ne(e,t||0):e),null,r)}),setSelection:Zt(function(e,t,r){jo(this,pt(this,e),pt(this,t||e),r)}),extendSelection:Zt(function(e,t,r){Hi(this,pt(this,e),t&&pt(this,t),r)}),extendSelections:Zt(function(e,t){No(this,Hn(this,e),t)}),extendSelectionsBy:Zt(function(e,t){var r=T(this.sel.ranges,e);No(this,Hn(this,r),t)}),setSelections:Zt(function(e,t,r){if(!e.length)return;for(var n=[],i=0;i<e.length;i++)n[i]=new Ot(pt(this,e[i].anchor),pt(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),sn(this,Un(this.cm,n,t),r)}),addSelection:Zt(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Ot(pt(this,e),pt(this,t||e))),sn(this,Un(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var i=tn(this,t[n].from(),t[n].to());r=r?r.concat(i):i}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=tn(this,r[n].from(),r[n].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Zt(function(e,t,r){for(var n=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];n[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:r}}for(var s=t&&t!="end"&&fl(this,n,t),u=n.length-1;u>=0;u--)Hr(this,n[u]);s?Io(this,s):this.cm&&Ir(this.cm)}),undo:Zt(function(){Ki(this,"undo")}),redo:Zt(function(){Ki(this,"redo")}),undoSelection:Zt(function(){Ki(this,"undo",!0)}),redoSelection:Zt(function(){Ki(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Fi(this.history.maxGeneration),cr(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:Fr(this.history.done),undone:Fr(this.history.undone)}},setHistory:function(e){var t=this.history=new Fi(this.history.maxGeneration);t.done=Fr(e.done.slice(0),null,!0),t.undone=Fr(e.undone.slice(0),null,!0)},setGutterMarker:Zt(function(e,t,r){return hi(this,e,"gutter",function(n){var i=n.gutterMarkers||(n.gutterMarkers={});return i[t]=r,!r&&je(i)&&(n.gutterMarkers=null),!0})}),clearGutter:Zt(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&hi(t,r,"gutter",function(){return r.gutterMarkers[e]=null,je(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Pn(this,e))return null;if(t=e,e=Qe(this,e),!e)return null}else if(t=Ct(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:Zt(function(e,t,r){return hi(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[i])n[i]=r;else{if(Q(r).test(n[i]))return!1;n[i]+=" "+r}return!0})}),removeLineClass:Zt(function(e,t,r){return hi(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=n[i];if(a)if(r==null)n[i]=null;else{var o=a.match(Q(r));if(!o)return!1;var s=o.index+o[0].length;n[i]=a.slice(0,o.index)+(!o.index||s==a.length?"":" ")+a.slice(s)||null}else return!1;return!0})}),addLineWidget:Zt(function(e,t,r){return wl(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return zr(this,pt(this,e),pt(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=pt(this,e),zr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=pt(this,e);var t=[],r=Qe(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=pt(this,e),t=pt(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var u=o[s];!(u.to!=null&&i==e.line&&e.ch>=u.to||u.from==null&&i!=e.line||u.from!=null&&i==t.line&&u.from>=t.ch)&&(!r||r(u.marker))&&n.push(u.marker.parent||u.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+n;if(a>e)return t=e,!0;e-=a,++r}),pt(this,Ne(r,t))},indexFromPos:function(e){e=pt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new bn(Gn(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,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new bn(Gn(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],_l(n,Jo(this)),n},unlinkDoc:function(e){if(e instanceof Nt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Cl(Jo(this));break}if(e.history==this.history){var n=[e.id];cr(e,function(i){return n.push(i.id)},!0),e.history=new Fi(null),e.history.done=Fr(this.history.done,n),e.history.undone=Fr(this.history.undone,n)}},iterLinkedDocs:function(e){cr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):it(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Zt(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),bn.prototype.eachLine=bn.prototype.iter;var Zo=0;function Sl(e){var t=this;if(Qo(t),Ie(t,e)||Qn(t.display,e))return;f(e),M&&(Zo=+new Date);var r=yr(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,a=Array(i),o=0,s=function(){++o==i&&Jt(t,function(){r=pt(t.doc,r);var K={from:r,to:r,text:t.doc.splitLines(a.filter(function(xe){return xe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Hr(t.doc,K),Io(t.doc,lr(pt(t.doc,r),pt(t.doc,ur(K))))})()},u=function(K,xe){if(t.options.allowDropFileTypes&&N(t.options.allowDropFileTypes,K.type)==-1){s();return}var De=new FileReader;De.onerror=function(){return s()},De.onload=function(){var Ue=De.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ue)){s();return}a[xe]=Ue,s()},De.readAsText(K)},d=0;d<n.length;d++)u(n[d],d);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var E=e.dataTransfer.getData("Text");if(E){var O;if(t.state.draggingText&&!t.state.draggingText.copy&&(O=t.listSelections()),Bi(t.doc,lr(r,r)),O)for(var q=0;q<O.length;++q)Br(t.doc,"",O[q].anchor,O[q].head,"drag");t.replaceSelection(E,"around","paste"),t.display.input.focus()}}catch(K){}}}function Tl(e,t){if(M&&(!e.state.draggingText||+new Date-Zo<100)){b(t);return}if(Ie(e,t)||Qn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ye){var r=y("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",re&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),re&&r.parentNode.removeChild(r)}}function Ol(e,t){var r=yr(e,t);if(!r)return;var n=document.createDocumentFragment();co(e,r,n),e.display.dragCursor||(e.display.dragCursor=y("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),J(e.display.dragCursor,n)}function Qo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function es(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var a=0;a<r.length;a++)e(r[a])})}var ts=!1;function Al(){if(ts)return;Ll(),ts=!0}function Ll(){var e;ve(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,es(Dl)},100))}),ve(window,"blur",function(){return es(jr)})}function Dl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var fr={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"},bi=0;bi<10;bi++)fr[bi+48]=fr[bi+96]=String(bi);for(var Gi=65;Gi<=90;Gi++)fr[Gi]=String.fromCharCode(Gi);for(var yi=1;yi<=12;yi++)fr[yi+111]=fr[yi+63235]="F"+yi;var er={};er.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"},er.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"},er.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"},er.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"]},er.default=ie?er.macDefault:er.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,a,o=0;o<t.length-1;o++){var s=t[o];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Rl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var i=T(r.split(" "),Ml),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(" "),o=n):(s=i.slice(0,a+1).join(" "),o="...");var u=t[s];if(!u)t[s]=o;else if(u!=o)throw new Error("Inconsistent bindings for "+s)}delete e[r]}for(var d in t)e[d]=t[d];return e}function Kr(e,t,r,n){t=Xi(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&r(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Kr(e,t.fallthrough,r,n);for(var a=0;a<t.fallthrough.length;a++){var o=Kr(e,t.fallthrough[a],r,n);if(o)return o}}}function ns(e){var t=typeof e=="string"?e:fr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function rs(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(be?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(be?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function is(e,t){if(re&&e.keyCode==34&&e.char)return!1;var r=fr[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),rs(r,e,t))}function Xi(e){return typeof e=="string"?er[e]:e}function Gr(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var a=t(r[i]);n.length&&mt(a.from,h(n).to)<=0;){var o=n.pop();if(mt(o.from,a.from)<0){a.from=o.from;break}}n.push(a)}_n(e,function(){for(var s=n.length-1;s>=0;s--)Br(e.doc,"",n[s].from,n[s].to,"+delete");Ir(e)})}function Oa(e,t,r){var n=Me(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Aa(e,t,r){var n=Oa(e,t.ch,r);return n==null?null:new Ne(t.line,n,r<0?"after":"before")}function La(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=nt(r,t.doc.direction);if(a){var o=i<0?h(a):a[0],s=i<0==(o.level==1),u=s?"after":"before",d;if(o.level>0||t.doc.direction=="rtl"){var E=Rr(t,r);d=i<0?r.text.length-1:0;var O=zn(t,E,d).top;d=Ge(function(q){return zn(t,E,q).top==O},i<0==(o.level==1)?o.from:o.to-1,d),u=="before"&&(d=Oa(r,d,1))}else d=i<0?o.to:o.from;return new Ne(n,d,u)}}return new Ne(n,i<0?r.text.length:0,i<0?"before":"after")}function Pl(e,t,r,n){var i=nt(t,e.doc.direction);if(!i)return Aa(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var a=qe(i,r.ch,r.sticky),o=i[a];if(e.doc.direction=="ltr"&&o.level%2==0&&(n>0?o.to>r.ch:o.from<r.ch))return Aa(t,r,n);var s=function(He,$e){return Oa(t,He instanceof Ne?He.ch:He,$e)},u,d=function(He){return e.options.lineWrapping?(u=u||Rr(e,t),oo(e,t,u,He)):{begin:0,end:t.text.length}},E=d(r.sticky=="before"?s(r,-1):r.ch);if(e.doc.direction=="rtl"||o.level==1){var O=o.level==1==n<0,q=s(r,O?1:-1);if(q!=null&&(O?q<=o.to&&q<=E.end:q>=o.from&&q>=E.begin)){var K=O?"before":"after";return new Ne(r.line,q,K)}}var xe=function(He,$e,Be){for(var et=function(Mt,Qt){return Qt?new Ne(r.line,s(Mt,1),"before"):new Ne(r.line,Mt,"after")};He>=0&&He<i.length;He+=$e){var gt=i[He],ut=$e>0==(gt.level!=1),Et=ut?Be.begin:s(Be.end,-1);if(gt.from<=Et&&Et<gt.to)return et(Et,ut);if(Et=ut?gt.from:s(gt.to,-1),Be.begin<=Et&&Et<Be.end)return et(Et,ut)}},De=xe(a+n,n,E);if(De)return De;var Ue=n>0?E.end:s(E.begin,-1);return Ue!=null&&!(n>0&&Ue==t.text.length)&&(De=xe(n>0?0:i.length-1,n,d(Ue)),De)?De:null}var xi={selectAll:Bo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ae)},killLine:function(e){return Gr(e,function(t){if(t.empty()){var r=Qe(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Ne(t.head.line+1,0)}:{from:t.head,to:Ne(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Gr(e,function(t){return{from:Ne(t.from().line,0),to:pt(e.doc,Ne(t.to().line+1,0))}})},delLineLeft:function(e){return Gr(e,function(t){return{from:Ne(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Gr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Gr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Ne(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ne(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return as(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return os(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},ue)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},ue)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?os(e,t.head):n},ue)},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=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var a=r[i].from(),o=g(e.getLine(a.line),a.ch,n);t.push(te(n-o%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return _n(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var i=t[n].head,a=Qe(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new Ne(i.line,i.ch-1)),i.ch>0)i=new Ne(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),Ne(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=Qe(e.doc,i.line-1).text;o&&(i=new Ne(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),Ne(i.line-1,o.length-1),i,"+transpose"))}}r.push(new Ot(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return _n(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Ir(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function as(e,t){var r=Qe(e.doc,t),n=jn(r);return n!=r&&(t=Ct(n)),La(!0,e,n,t,1)}function Nl(e,t){var r=Qe(e.doc,t),n=Wa(r);return n!=r&&(t=Ct(n)),La(!0,e,r,t,-1)}function os(e,t){var r=as(e,t.line),n=Qe(e.doc,r.line),i=nt(n,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(r.ch,n.text.search(/\S/)),o=t.line==r.line&&t.ch<=a&&t.ch;return Ne(r.line,o?0:a,r.sticky)}return r}function Vi(e,t,r){if(typeof t=="string"&&(t=xi[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=_e}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function jl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Kr(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Kr(t,e.options.extraKeys,r,e)||Kr(t,e.options.keyMap,r,e)}var Il=new _;function wi(e,t,r,n){var i=e.state.keySeq;if(i){if(ns(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Il.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ss(e,i+" "+t,r,n))return!0}return ss(e,t,r,n)}function ss(e,t,r,n){var i=jl(e,t,n);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&nn(e,"keyHandled",e,t,r),(i=="handled"||i=="multi")&&(f(r),ha(e)),!!i}function ls(e,t){var r=is(t,!0);return r?t.shiftKey&&!e.state.keySeq?wi(e,"Shift-"+r,t,function(n){return Vi(e,n,!0)})||wi(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Vi(e,n)}):wi(e,r,t,function(n){return Vi(e,n)}):!1}function Ul(e,t,r){return wi(e,"'"+r+"'",t,function(n){return Vi(e,n,!0)})}var Da=null;function us(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=ee(),Ie(t,e))return;M&&D<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=ls(t,e);re&&(Da=n?r:null,!n&&r==88&&!ct&&(ie?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),oe&&!ie&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;j(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(me(t,"CodeMirror-crosshair"),Je(document,"keyup",r),Je(document,"mouseover",r))}ve(document,"keyup",r),ve(document,"mouseover",r)}function cs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ie(this,e)}function ds(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Qn(t.display,e)||Ie(t,e)||e.ctrlKey&&!e.altKey||ie&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(re&&r==Da){Da=null,f(e);return}if(re&&(!e.which||e.which<10)&&ls(t,e))return;var i=String.fromCharCode(n==null?r:n);if(i=="\b")return;if(Ul(t,e,i))return;t.display.input.onKeyPress(e)}var Wl=400,Ma=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ma.prototype.compare=function(e,t,r){return this.time+Wl>e&&mt(t,this.pos)==0&&r==this.button};var Ei,_i;function Hl(e,t){var r=+new Date;return _i&&_i.compare(r,e,t)?(Ei=_i=null,"triple"):Ei&&Ei.compare(r,e,t)?(_i=new Ma(r,e,t),Ei=null,"double"):(Ei=new Ma(r,e,t),_i=null,"single")}function fs(e){var t=this,r=t.display;if(Ie(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,Qn(r,e)){S||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Ra(t,e))return;var n=yr(t,e),i=fe(e),a=n?Hl(n,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),n&&Bl(t,i,n,a,e))return;i==1?n?Kl(t,n,a,e):V(e)==r.scroller&&f(e):i==2?(n&&Hi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(Re?t.display.input.onContextMenu(e):ho(t))}function Bl(e,t,r,n,i){var a="Click";return n=="double"?a="Double"+a:n=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,wi(e,rs(a,i),i,function(o){if(typeof o=="string"&&(o=xi[o]),!o)return!1;var s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=o(e,r)!=_e}finally{e.state.suppressEdits=!1}return s})}function zl(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var a=Te?r.shiftKey&&r.metaKey:r.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),i.addNew==null&&(i.addNew=ie?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(ie?r.altKey:r.ctrlKey)),i}function Kl(e,t,r,n){M?setTimeout(c(fo,e),0):e.curOp.focus=ee();var i=zl(e,r,n),a=e.doc.sel,o;e.options.dragDrop&&Le&&!e.isReadOnly()&&r=="single"&&(o=a.contains(t))>-1&&(mt((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(mt(o.to(),t)>0||t.xRel<0)?Gl(e,n,t,i):Xl(e,n,t,i)}function Gl(e,t,r,n){var i=e.display,a=!1,o=Jt(e,function(d){S&&(i.scroller.draggable=!1),e.state.draggingText=!1,Je(i.wrapper.ownerDocument,"mouseup",o),Je(i.wrapper.ownerDocument,"mousemove",s),Je(i.scroller,"dragstart",u),Je(i.scroller,"drop",o),a||(f(d),n.addNew||Hi(e.doc,r,null,null,n.extend),S&&!ye||M&&D==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),s=function(d){a=a||Math.abs(t.clientX-d.clientX)+Math.abs(t.clientY-d.clientY)>=10},u=function(){return a=!0};S&&(i.scroller.draggable=!0),e.state.draggingText=o,o.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ve(i.wrapper.ownerDocument,"mouseup",o),ve(i.wrapper.ownerDocument,"mousemove",s),ve(i.scroller,"dragstart",u),ve(i.scroller,"drop",o),ho(e),setTimeout(function(){return i.input.focus()},20)}function hs(e,t,r){if(r=="char")return new Ot(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Ot(Ne(t.line,0),pt(e.doc,Ne(t.line+1,0)));var n=r(e,t);return new Ot(n.from,n.to)}function Xl(e,t,r,n){var i=e.display,a=e.doc;f(t);var o,s,u=a.sel,d=u.ranges;if(n.addNew&&!n.extend?(s=a.sel.contains(r),s>-1?o=d[s]:o=new Ot(r,r)):(o=a.sel.primary(),s=a.sel.primIndex),n.unit=="rectangle")n.addNew||(o=new Ot(r,r)),r=yr(e,t,!0,!0),s=-1;else{var E=hs(e,r,n.unit);n.extend?o=Sa(o,E.anchor,E.head,n.extend):o=E}n.addNew?s==-1?(s=d.length,sn(a,Un(e,d.concat([o]),s),{scroll:!1,origin:"*mouse"})):d.length>1&&d[s].empty()&&n.unit=="char"&&!n.extend?(sn(a,Un(e,d.slice(0,s).concat(d.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=a.sel):Ta(a,s,o,Se):(s=0,sn(a,new On([o],0),Se),u=a.sel);var O=r;function q(Be){if(mt(O,Be)==0)return;if(O=Be,n.unit=="rectangle"){for(var et=[],gt=e.options.tabSize,ut=g(Qe(a,r.line).text,r.ch,gt),Et=g(Qe(a,Be.line).text,Be.ch,gt),Mt=Math.min(ut,Et),Qt=Math.max(ut,Et),It=Math.min(r.line,Be.line),Cn=Math.min(e.lastLine(),Math.max(r.line,Be.line));It<=Cn;It++){var yn=Qe(a,It).text,Gt=ce(yn,Mt,gt);Mt==Qt?et.push(new Ot(Ne(It,Gt),Ne(It,Gt))):yn.length>Gt&&et.push(new Ot(Ne(It,Gt),Ne(It,ce(yn,Qt,gt))))}et.length||et.push(new Ot(r,r)),sn(a,Un(e,u.ranges.slice(0,s).concat(et),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Be)}else{var xn=o,rn=hs(e,Be,n.unit),Vt=xn.anchor,Xt;mt(rn.anchor,Vt)>0?(Xt=rn.head,Vt=Xn(xn.from(),rn.anchor)):(Xt=rn.anchor,Vt=Fe(xn.to(),rn.head));var Wt=u.ranges.slice(0);Wt[s]=Vl(e,new Ot(pt(a,Vt),Xt)),sn(a,Un(e,Wt,s),Se)}}var K=i.wrapper.getBoundingClientRect(),xe=0;function De(Be){var et=++xe,gt=yr(e,Be,!0,n.unit=="rectangle");if(!gt)return;if(mt(gt,O)!=0){e.curOp.focus=ee(),q(gt);var ut=Ni(i,a);(gt.line>=ut.to||gt.line<ut.from)&&setTimeout(Jt(e,function(){xe==et&&De(Be)}),150)}else{var Et=Be.clientY<K.top?-20:Be.clientY>K.bottom?20:0;Et&&setTimeout(Jt(e,function(){if(xe!=et)return;i.scroller.scrollTop+=Et,De(Be)}),50)}}function Ue(Be){e.state.selectingText=!1,xe=Infinity,Be&&(f(Be),i.input.focus()),Je(i.wrapper.ownerDocument,"mousemove",He),Je(i.wrapper.ownerDocument,"mouseup",$e),a.history.lastSelOrigin=null}var He=Jt(e,function(Be){Be.buttons===0||!fe(Be)?Ue(Be):De(Be)}),$e=Jt(e,Ue);e.state.selectingText=$e,ve(i.wrapper.ownerDocument,"mousemove",He),ve(i.wrapper.ownerDocument,"mouseup",$e)}function Vl(e,t){var r=t.anchor,n=t.head,i=Qe(e.doc,r.line);if(mt(r,n)==0&&r.sticky==n.sticky)return t;var a=nt(i);if(!a)return t;var o=qe(a,r.ch,r.sticky),s=a[o];if(s.from!=r.ch&&s.to!=r.ch)return t;var u=o+(s.from==r.ch==(s.level!=1)?0:1);if(u==0||u==a.length)return t;var d;if(n.line!=r.line)d=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var E=qe(a,n.ch,n.sticky),O=E-o||(n.ch-r.ch)*(s.level==1?-1:1);E==u-1||E==u?d=O<0:d=O>0}var q=a[u+(d?-1:0)],K=d==(q.level==1),xe=K?q.from:q.to,De=K?"after":"before";return r.ch==xe&&r.sticky==De?t:new Ot(new Ne(r.line,xe,De),n)}function ps(e,t,r,n){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch(q){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&f(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!L(e,r))return v(t);a-=s.top-o.viewOffset;for(var u=0;u<e.display.gutterSpecs.length;++u){var d=o.gutters.childNodes[u];if(d&&d.getBoundingClientRect().right>=i){var E=kn(e.doc,a),O=e.display.gutterSpecs[u];return Ce(e,r,e,E,O.className,t),v(t)}}}function Ra(e,t){return ps(e,t,"gutterClick",!0)}function ms(e,t){if(Qn(e.display,t)||$l(e,t))return;if(Ie(e,t,"contextmenu"))return;Re||e.display.input.onContextMenu(t)}function $l(e,t){return L(e,"gutterContextMenu")?ps(e,t,"gutterContextMenu",!1):!1}function gs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ri(e)}var Xr={toString:function(){return"CodeMirror.Init"}},vs={},$i={};function Yl(e){var t=e.optionHandlers;function r(n,i,a,o){e.defaults[n]=i,a&&(t[n]=o?function(s,u,d){d!=Xr&&a(s,u,d)}:a)}e.defineOption=r,e.Init=Xr,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,_a(n)},!0),r("indentUnit",2,_a,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){di(n),ri(n),vn(n)},!0),r("lineSeparator",null,function(n,i){if(n.doc.lineSep=i,!i)return;var a=[],o=n.doc.first;n.doc.iter(function(u){for(var d=0;;){var E=u.text.indexOf(i,d);if(E==-1)break;d=E+i.length,a.push(Ne(o,E))}o++});for(var s=a.length-1;s>=0;s--)Br(n.doc,i,a[s],Ne(a[s].line,a[s].ch+i.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,i,a){n.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),a!=Xr&&n.refresh()}),r("specialCharPlaceholder",Qr,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",se?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,i){return n.getInputField().spellcheck=i},!0),r("autocorrect",!1,function(n,i){return n.getInputField().autocorrect=i},!0),r("autocapitalize",!1,function(n,i){return n.getInputField().autocapitalize=i},!0),r("rtlMoveVisually",!We),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){gs(n),ci(n)},!0),r("keyMap","default",function(n,i,a){var o=Xi(i),s=a!=Xr&&Xi(a);s&&s.detach&&s.detach(n,o),o.attach&&o.attach(n,s||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Jl,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=wa(i,n.options.lineNumbers),ci(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?da(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return Ur(n)},!0),r("scrollbarStyle","native",function(n){yo(n),Ur(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,i){n.display.gutterSpecs=wa(n.options.gutters,i),ci(n)},!0),r("firstLineNumber",1,ci,!0),r("lineNumberFormatter",function(n){return n},ci,!0),r("showCursorWhenSelecting",!1,ii,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(jr(n),n.display.input.blur()),n.display.input.readOnlyChanged(i)}),r("screenReaderLabel",null,function(n,i){i=i===""?null:i,n.display.input.screenReaderLabelChanged(i)}),r("disableInput",!1,function(n,i){i||n.display.input.reset()},!0),r("dragDrop",!0,ql),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,ii,!0),r("singleCursorHeightPerLine",!0,ii,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,di,!0),r("addModeClass",!1,di,!0),r("pollInterval",100),r("undoDepth",200,function(n,i){return n.doc.history.undoDepth=i}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,di,!0),r("moveInputWithCursor",!0,function(n,i){i||n.display.input.resetPosition()}),r("tabindex",null,function(n,i){return n.display.input.getField().tabIndex=i||""}),r("autofocus",null),r("direction","ltr",function(n,i){return n.doc.setDirection(i)},!0),r("phrases",null)}function ql(e,t,r){var n=r&&r!=Xr;if(!t!=!n){var i=e.display.dragFunctions,a=t?ve:Je;a(e.display.scroller,"dragstart",i.start),a(e.display.scroller,"dragenter",i.enter),a(e.display.scroller,"dragover",i.over),a(e.display.scroller,"dragleave",i.leave),a(e.display.scroller,"drop",i.drop)}}function Jl(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(me(e.display.wrapper,"CodeMirror-wrap"),Yt(e)),fa(e),vn(e),ri(e),setTimeout(function(){return Ur(e)},100)}function Nt(e,t){var r=this;if(!(this instanceof Nt))return new Nt(e,t);this.options=t=t?l(t):{},l(vs,t,!1);var n=t.value;typeof n=="string"?n=new bn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Nt.inputStyles[t.inputStyle](this),a=this.display=new cl(e,n,i,t);a.wrapper.CodeMirror=this,gs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),yo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new _,keySeq:null,specialChars:null},t.autofocus&&!se&&a.input.focus(),M&&D<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Al(),_r(this),this.curOp.forceUpdate=!0,Ao(this,n),t.autofocus&&!se||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&pa(r)},20):jr(this);for(var o in $i)$i.hasOwnProperty(o)&&$i[o](this,t[o],Xr);Eo(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Pa.length;++s)Pa[s](this);Cr(this),S&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}Nt.defaults=vs,Nt.optionHandlers=$i;function Zl(e){var t=e.display;ve(t.scroller,"mousedown",Jt(e,fs)),M&&D<11?ve(t.scroller,"dblclick",Jt(e,function(u){if(Ie(e,u))return;var d=yr(e,u);if(!d||Ra(e,u)||Qn(e.display,u))return;f(u);var E=e.findWordAt(d);Hi(e.doc,E.anchor,E.head)})):ve(t.scroller,"dblclick",function(u){return Ie(e,u)||f(u)}),ve(t.scroller,"contextmenu",function(u){return ms(e,u)}),ve(t.input.getField(),"contextmenu",function(u){t.scroller.contains(u.target)||ms(e,u)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function a(u){if(u.touches.length!=1)return!1;var d=u.touches[0];return d.radiusX<=1&&d.radiusY<=1}function o(u,d){if(d.left==null)return!0;var E=d.left-u.left,O=d.top-u.top;return E*E+O*O>20*20}ve(t.scroller,"touchstart",function(u){if(!Ie(e,u)&&!a(u)&&!Ra(e,u)){t.input.ensurePolled(),clearTimeout(r);var d=+new Date;t.activeTouch={start:d,moved:!1,prev:d-n.end<=300?n:null},u.touches.length==1&&(t.activeTouch.left=u.touches[0].pageX,t.activeTouch.top=u.touches[0].pageY)}}),ve(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ve(t.scroller,"touchend",function(u){var d=t.activeTouch;if(d&&!Qn(t,u)&&d.left!=null&&!d.moved&&new Date-d.start<300){var E=e.coordsChar(t.activeTouch,"page"),O;!d.prev||o(d,d.prev)?O=new Ot(E,E):!d.prev.prev||o(d,d.prev.prev)?O=e.findWordAt(E):O=new Ot(Ne(E.line,0),pt(e.doc,Ne(E.line+1,0))),e.setSelection(O.anchor,O.head),e.focus(),f(u)}i()}),ve(t.scroller,"touchcancel",i),ve(t.scroller,"scroll",function(){t.scroller.clientHeight&&(oi(e,t.scroller.scrollTop),wr(e,t.scroller.scrollLeft,!0),Ce(e,"scroll",e))}),ve(t.scroller,"mousewheel",function(u){return ko(e,u)}),ve(t.scroller,"DOMMouseScroll",function(u){return ko(e,u)}),ve(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(u){Ie(e,u)||b(u)},over:function(u){Ie(e,u)||(Ol(e,u),b(u))},start:function(u){return Tl(e,u)},drop:Jt(e,Sl),leave:function(u){Ie(e,u)||Qo(e)}};var s=t.input.getField();ve(s,"keyup",function(u){return cs.call(e,u)}),ve(s,"keydown",Jt(e,us)),ve(s,"keypress",Jt(e,ds)),ve(s,"focus",function(u){return pa(e,u)}),ve(s,"blur",function(u){return jr(e,u)})}var Pa=[];Nt.defineInitHook=function(e){return Pa.push(e)};function Ci(e,t,r,n){var i=e.doc,a;r==null&&(r="add"),r=="smart"&&(i.mode.indent?a=he(e,t).state:r="prev");var o=e.options.tabSize,s=Qe(i,t),u=g(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var d=s.text.match(/^\s*/)[0],E;if(!n&&!/\S/.test(s.text))E=0,r="not";else if(r=="smart"&&(E=i.mode.indent(a,s.text.slice(d.length),s.text),E==_e||E>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?E=g(Qe(i,t-1).text,null,o):E=0:r=="add"?E=u+e.options.indentUnit:r=="subtract"?E=u-e.options.indentUnit:typeof r=="number"&&(E=u+r),E=Math.max(0,E);var O="",q=0;if(e.options.indentWithTabs)for(var K=Math.floor(E/o);K;--K)q+=o,O+=" ";if(q<E&&(O+=te(E-q)),O!=d)return Br(i,O,Ne(t,0),Ne(t,d.length),"+input"),s.stateAfter=null,!0;for(var xe=0;xe<i.sel.ranges.length;xe++){var De=i.sel.ranges[xe];if(De.head.line==t&&De.head.ch<d.length){var Ue=Ne(t,d.length);Ta(i,xe,new Ot(Ue,Ue));break}}}var Fn=null;function Yi(e){Fn=e}function Na(e,t,r,n,i){var a=e.doc;e.display.shift=!1,n||(n=a.sel);var o=+new Date-200,s=i=="paste"||e.state.pasteIncoming>o,u=it(t),d=null;if(s&&n.ranges.length>1)if(Fn&&Fn.text.join(`
|
|
`)==t){if(n.ranges.length%Fn.text.length==0){d=[];for(var E=0;E<Fn.text.length;E++)d.push(a.splitLines(Fn.text[E]))}}else u.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(d=T(u,function(He){return[He]}));for(var O=e.curOp.updateInput,q=n.ranges.length-1;q>=0;q--){var K=n.ranges[q],xe=K.from(),De=K.to();K.empty()&&(r&&r>0?xe=Ne(xe.line,xe.ch-r):e.state.overwrite&&!s?De=Ne(De.line,Math.min(Qe(a,De.line).text.length,De.ch+h(u).length)):s&&Fn&&Fn.lineWise&&Fn.text.join(`
|
|
`)==u.join(`
|
|
`)&&(xe=De=Ne(xe.line,0)));var Ue={from:xe,to:De,text:d?d[q%d.length]:u,origin:i||(s?"paste":e.state.cutIncoming>o?"cut":"+input")};Hr(e.doc,Ue),nn(e,"inputRead",e,Ue)}t&&!s&&ys(e,t),Ir(e),e.curOp.updateInput<2&&(e.curOp.updateInput=O),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function bs(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&_n(t,function(){return Na(t,r,0,null,"paste")}),!0}function ys(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)continue;var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(t.indexOf(a.electricChars.charAt(s))>-1){o=Ci(e,i.head.line,"smart");break}}else a.electricInput&&(a.electricInput.test(Qe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Ci(e,i.head.line,"smart")));o&&nn(e,"electricInput",e,i.head.line)}}function xs(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,a={anchor:Ne(i,0),head:Ne(i+1,0)};r.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:r}}function ws(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Es(){var e=y("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=y("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return S?e.style.width="1000px":e.setAttribute("wrap","off"),P&&(e.style.border="1px solid black"),ws(e),t}function Ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,i){var a=this.options,o=a[n];if(a[n]==i&&n!="mode")return;a[n]=i,t.hasOwnProperty(n)&&Jt(this,t[n])(this,i,o),Ce(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,i){this.state.keyMaps[i?"push":"unshift"](Xi(n))},removeKeyMap:function(n){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==n||i[a].name==n)return i.splice(a,1),!0},addOverlay:fn(function(n,i){var a=n.token?n:e.getMode(this.options,n);if(a.startState)throw new Error("Overlays may not be stateful.");m(this.state.overlays,{mode:a,modeSpec:n,opaque:i&&i.opaque,priority:i&&i.priority||0},function(o){return o.priority}),this.state.modeGen++,vn(this)}),removeOverlay:fn(function(n){for(var i=this.state.overlays,a=0;a<i.length;++a){var o=i[a].modeSpec;if(o==n||typeof n=="string"&&o.name==n){i.splice(a,1),this.state.modeGen++,vn(this);return}}}),indentLine:fn(function(n,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Pn(this.doc,n)&&Ci(this,n,i,a)}),indentSelection:fn(function(n){for(var i=this.doc.sel.ranges,a=-1,o=0;o<i.length;o++){var s=i[o];if(s.empty())s.head.line>a&&(Ci(this,s.head.line,n,!0),a=s.head.line,o==this.doc.sel.primIndex&&Ir(this));else{var u=s.from(),d=s.to(),E=Math.max(a,u.line);a=Math.min(this.lastLine(),d.line-(d.ch?0:1))+1;for(var O=E;O<a;++O)Ci(this,O,n);var q=this.doc.sel.ranges;u.ch==0&&i.length==q.length&&q[o].from().ch>0&&Ta(this.doc,o,new Ot(u,q[o].to()),ae)}}}),getTokenAt:function(n,i){return $t(this,n,i)},getLineTokens:function(n,i){return $t(this,Ne(n),i,!0)},getTokenTypeAt:function(n){n=pt(this.doc,n);var i=dt(this,Qe(this.doc,n.line)),a=0,o=(i.length-1)/2,s=n.ch,u;if(s==0)u=i[2];else for(;;){var d=a+o>>1;if((d?i[d*2-1]:0)>=s)o=d;else if(i[d*2+1]<s)a=d+1;else{u=i[d*2+2];break}}var E=u?u.indexOf("overlay "):-1;return E<0?u:E==0?null:u.slice(0,E-1)},getModeAt:function(n){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(n).state).mode:i},getHelper:function(n,i){return this.getHelpers(n,i)[0]},getHelpers:function(n,i){var a=[];if(!r.hasOwnProperty(i))return a;var o=r[i],s=this.getModeAt(n);if(typeof s[i]=="string")o[s[i]]&&a.push(o[s[i]]);else if(s[i])for(var u=0;u<s[i].length;u++){var d=o[s[i][u]];d&&a.push(d)}else s.helperType&&o[s.helperType]?a.push(o[s.helperType]):o[s.name]&&a.push(o[s.name]);for(var E=0;E<o._global.length;E++){var O=o._global[E];O.pred(s,this)&&N(a,O.val)==-1&&a.push(O.val)}return a},getStateAfter:function(n,i){var a=this.doc;return n=Tr(a,n==null?a.first+a.size-1:n),he(this,n+1,i).state},cursorCoords:function(n,i){var a,o=this.doc.sel.primary();return n==null?a=o.head:typeof n=="object"?a=pt(this.doc,n):a=n?o.from():o.to(),In(this,a,i||"page")},charCoords:function(n,i){return oa(this,pt(this.doc,n),i||"page")},coordsChar:function(n,i){return n=ro(this,n,i||"page"),la(this,n.left,n.top)},lineAtHeight:function(n,i){return n=ro(this,{top:n,left:0},i||"page").top,kn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,i,a){var o=!1,s;if(typeof n=="number"){var u=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>u&&(n=u,o=!0),s=Qe(this.doc,n)}else s=n;return Di(this,s,{top:0,left:0},i||"page",a||o).top+(o?this.doc.height-Pt(s):0)},defaultTextHeight:function(){return Pr(this.display)},defaultCharWidth:function(){return Nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,a,o,s){var u=this.display;n=In(this,pt(this.doc,n));var d=n.bottom,E=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),u.sizer.appendChild(i),o=="over")d=n.top;else if(o=="above"||o=="near"){var O=Math.max(u.wrapper.clientHeight,this.doc.height),q=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);(o=="above"||n.bottom+i.offsetHeight>O)&&n.top>i.offsetHeight?d=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=O&&(d=n.bottom),E+i.offsetWidth>q&&(E=q-i.offsetWidth)}i.style.top=d+"px",i.style.left=i.style.right="",s=="right"?(E=u.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(s=="left"?E=0:s=="middle"&&(E=(u.sizer.clientWidth-i.offsetWidth)/2),i.style.left=E+"px"),a&&qs(this,{left:E,top:d,right:E+i.offsetWidth,bottom:d+i.offsetHeight})},triggerOnKeyDown:fn(us),triggerOnKeyPress:fn(ds),triggerOnKeyUp:cs,triggerOnMouseDown:fn(fs),execCommand:function(n){if(xi.hasOwnProperty(n))return xi[n].call(null,this)},triggerElectric:fn(function(n){ys(this,n)}),findPosH:function(n,i,a,o){var s=1;i<0&&(s=-1,i=-i);for(var u=pt(this.doc,n),d=0;d<i&&!(u=ja(this.doc,u,s,a,o),u.hitSide);++d);return u},moveH:fn(function(n,i){var a=this;this.extendSelectionsBy(function(o){return a.display.shift||a.doc.extend||o.empty()?ja(a.doc,o.head,n,i,a.options.rtlMoveVisually):n<0?o.from():o.to()},ue)}),deleteH:fn(function(n,i){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):Gr(this,function(s){var u=ja(o,s.head,n,i,!1);return n<0?{from:u,to:s.head}:{from:s.head,to:u}})}),findPosV:function(n,i,a,o){var s=1,u=o;i<0&&(s=-1,i=-i);for(var d=pt(this.doc,n),E=0;E<i;++E){var O=In(this,d,"div");if(u==null?u=O.left:O.left=u,d=_s(this,O,s,a),d.hitSide)break}return d},moveV:fn(function(n,i){var a=this,o=this.doc,s=[],u=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(E){if(u)return n<0?E.from():E.to();var O=In(a,E.head,"div");E.goalColumn!=null&&(O.left=E.goalColumn),s.push(O.left);var q=_s(a,O,n,i);return i=="page"&&E==o.sel.primary()&&ga(a,oa(a,q,"div").top-O.top),q},ue),s.length)for(var d=0;d<o.sel.ranges.length;d++)o.sel.ranges[d].goalColumn=s[d]}),findWordAt:function(n){var i=this.doc,a=Qe(i,n.line).text,o=n.ch,s=n.ch;if(a){var u=this.getHelper(n,"wordChars");(n.sticky=="before"||s==a.length)&&o?--o:++s;for(var d=a.charAt(o),E=ke(d,u)?function(O){return ke(O,u)}:/\s/.test(d)?function(O){return/\s/.test(O)}:function(O){return!/\s/.test(O)&&!ke(O)};o>0&&E(a.charAt(o-1));)--o;for(;s<a.length&&E(a.charAt(s));)++s}return new Ot(Ne(n.line,o),Ne(n.line,s))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):me(this.display.cursorDiv,"CodeMirror-overwrite"),Ce(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==ee()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:fn(function(n,i){ai(this,n,i)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Bn(this)-this.display.barHeight,width:n.scrollWidth-Bn(this)-this.display.barWidth,clientHeight:ra(this),clientWidth:vr(this)}},scrollIntoView:fn(function(n,i){n==null?(n={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Ne(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=i||0,n.from.line!=null?Js(this,n):mo(this,n.from,n.to,n.margin)}),setSize:fn(function(n,i){var a=this,o=function(u){return typeof u=="number"||/^\d+$/.test(String(u))?u+"px":u};n!=null&&(this.display.wrapper.style.width=o(n)),i!=null&&(this.display.wrapper.style.height=o(i)),this.options.lineWrapping&&eo(this);var s=this.display.viewFrom;this.doc.iter(s,this.display.viewTo,function(u){if(u.widgets){for(var d=0;d<u.widgets.length;d++)if(u.widgets[d].noHScroll){or(a,s,"widget");break}}++s}),this.curOp.forceUpdate=!0,Ce(this,"refresh",this)}),operation:function(n){return _n(this,n)},startOperation:function(){return _r(this)},endOperation:function(){return Cr(this)},refresh:fn(function(){var n=this.display.cachedTextHeight;vn(this),this.curOp.forceUpdate=!0,ri(this),ai(this,this.doc.scrollLeft,this.doc.scrollTop),ya(this.display),(n==null||Math.abs(n-Pr(this.display))>.5||this.options.lineWrapping)&&fa(this),Ce(this,"refresh",this)}),swapDoc:fn(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Ao(this,n),ri(this),this.display.input.reset(),ai(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,nn(this,"swapDoc",this,i),i}),phrase:function(n){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},x(e),e.registerHelper=function(n,i,a){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][i]=a},e.registerGlobalHelper=function(n,i,a,o){e.registerHelper(n,i,o),r[n]._global.push({pred:a,val:o})}}function ja(e,t,r,n,i){var a=t,o=r,s=Qe(e,t.line),u=i&&e.direction=="rtl"?-r:r;function d(){var $e=t.line+u;return $e<e.first||$e>=e.first+e.size?!1:(t=new Ne($e,t.ch,t.sticky),s=Qe(e,$e))}function E($e){var Be;if(n=="codepoint"){var et=s.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(et)?Be=null:Be=new Ne(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(et>=55296&&et<56320?2:1))),-r)}else i?Be=Pl(e.cm,s,t,r):Be=Aa(s,t,r);if(Be==null)if(!$e&&d())t=La(i,e.cm,s,t.line,u);else return!1;else t=Be;return!0}if(n=="char"||n=="codepoint")E();else if(n=="column")E(!0);else if(n=="word"||n=="group")for(var O=null,q=n=="group",K=e.cm&&e.cm.getHelper(t,"wordChars"),xe=!0;!(r<0&&!E(!xe));xe=!1){var De=s.text.charAt(t.ch)||`
|
|
`,Ue=ke(De,K)?"w":q&&De==`
|
|
`?"n":!q||/\s/.test(De)?null:"p";if(q&&!xe&&!Ue&&(Ue="s"),O&&O!=Ue){r<0&&(r=1,E(),t.sticky="after");break}if(Ue&&(O=Ue),r>0&&!E(!xe))break}var He=zi(e,t,a,o,!0);return Sn(a,He)&&(He.hitSide=!0),He}function _s(e,t,r,n){var i=e.doc,a=t.left,o;if(n=="page"){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(s-.5*Pr(e.display),3);o=(r>0?t.bottom:t.top)+r*u}else n=="line"&&(o=r>0?t.bottom+3:t.top-3);for(var d;!(d=la(e,a,o),!d.outside);){if(r<0?o<=0:o>=i.height){d.hitSide=!0;break}o+=r*5}return d}var Lt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new _,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Lt.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;ws(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function a(s){for(var u=s.target;u;u=u.parentNode){if(u==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(u.className))break}return!1}ve(i,"paste",function(s){if(!a(s)||Ie(n,s)||bs(s,n))return;D<=11&&setTimeout(Jt(n,function(){return t.updateFromDOM()}),20)}),ve(i,"compositionstart",function(s){t.composing={data:s.data,done:!1}}),ve(i,"compositionupdate",function(s){t.composing||(t.composing={data:s.data,done:!1})}),ve(i,"compositionend",function(s){t.composing&&(s.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ve(i,"touchstart",function(){return r.forceCompositionEnd()}),ve(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(s){if(!a(s)||Ie(n,s))return;if(n.somethingSelected())Yi({lineWise:!1,text:n.getSelections()}),s.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var u=xs(n);Yi({lineWise:!0,text:u.text}),s.type=="cut"&&n.operation(function(){n.setSelections(u.ranges,0,ae),n.replaceSelection("",null,"cut")})}else return;if(s.clipboardData){s.clipboardData.clearData();var d=Fn.text.join(`
|
|
`);if(s.clipboardData.setData("Text",d),s.clipboardData.getData("Text")==d){s.preventDefault();return}}var E=Es(),O=E.firstChild;n.display.lineSpace.insertBefore(E,n.display.lineSpace.firstChild),O.value=Fn.text.join(`
|
|
`);var q=document.activeElement;k(O),setTimeout(function(){n.display.lineSpace.removeChild(E),q.focus(),q==i&&r.showPrimarySelection()},50)}ve(i,"copy",o),ve(i,"cut",o)},Lt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Lt.prototype.prepareSelection=function(){var e=uo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Lt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Lt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Lt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=qi(t,e.anchorNode,e.anchorOffset),o=qi(t,e.focusNode,e.focusOffset);if(a&&!a.bad&&o&&!o.bad&&mt(Xn(a,o),n)==0&&mt(Fe(a,o),i)==0)return;var s=t.display.view,u=n.line>=t.display.viewFrom&&Cs(t,n)||{node:s[0].measure.map[2],offset:0},d=i.line<t.display.viewTo&&Cs(t,i);if(!d){var E=s[s.length-1].measure,O=E.maps?E.maps[E.maps.length-1]:E.map;d={node:O[O.length-1],offset:O[O.length-2]-O[O.length-3]}}if(!u||!d){e.removeAllRanges();return}var q=e.rangeCount&&e.getRangeAt(0),K;try{K=X(u.node,u.offset,d.offset,d.node)}catch(xe){}K&&(!oe&&t.state.focused?(e.collapse(u.node,u.offset),K.collapsed||(e.removeAllRanges(),e.addRange(K))):(e.removeAllRanges(),e.addRange(K)),q&&e.anchorNode==null?e.addRange(q):oe&&this.startGracePeriod()),this.rememberSelection()},Lt.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)},Lt.prototype.showMultipleSelections=function(e){J(this.cm.display.cursorDiv,e.cursors),J(this.cm.display.selectionDiv,e.selection)},Lt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Lt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return w(this.div,t)},Lt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Lt.prototype.blur=function(){this.div.blur()},Lt.prototype.getField=function(){return this.div},Lt.prototype.supportsTouch=function(){return!0},Lt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():_n(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)},Lt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Lt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(U&&$&&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 r=qi(t,e.anchorNode,e.anchorOffset),n=qi(t,e.focusNode,e.focusOffset);r&&n&&_n(t,function(){sn(t.doc,lr(r,n),ae),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Lt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Ne(n.line-1,Qe(e.doc,n.line-1).length)),i.ch==Qe(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=Ne(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,s;n.line==t.viewFrom||(a=xr(e,n.line))==0?(o=Ct(t.view[0].line),s=t.view[0].node):(o=Ct(t.view[a].line),s=t.view[a-1].node.nextSibling);var u=xr(e,i.line),d,E;if(u==t.view.length-1?(d=t.viewTo-1,E=t.lineDiv.lastChild):(d=Ct(t.view[u+1].line)-1,E=t.view[u+1].node.previousSibling),!s)return!1;for(var O=e.doc.splitLines(tu(e,s,E,o,d)),q=tn(e.doc,Ne(o,0),Ne(d,Qe(e.doc,d).text.length));O.length>1&&q.length>1;)if(h(O)==h(q))O.pop(),q.pop(),d--;else if(O[0]==q[0])O.shift(),q.shift(),o++;else break;for(var K=0,xe=0,De=O[0],Ue=q[0],He=Math.min(De.length,Ue.length);K<He&&De.charCodeAt(K)==Ue.charCodeAt(K);)++K;for(var $e=h(O),Be=h(q),et=Math.min($e.length-(O.length==1?K:0),Be.length-(q.length==1?K:0));xe<et&&$e.charCodeAt($e.length-xe-1)==Be.charCodeAt(Be.length-xe-1);)++xe;if(O.length==1&&q.length==1&&o==n.line)for(;K&&K>n.ch&&$e.charCodeAt($e.length-xe-1)==Be.charCodeAt(Be.length-xe-1);)K--,xe++;O[O.length-1]=$e.slice(0,$e.length-xe).replace(/^\u200b+/,""),O[0]=O[0].slice(K).replace(/\u200b+$/,"");var gt=Ne(o,K),ut=Ne(d,q.length?h(q).length-xe:0);if(O.length>1||O[0]||mt(gt,ut))return Br(e.doc,O,gt,ut,"+input"),!0},Lt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Lt.prototype.reset=function(){this.forceCompositionEnd()},Lt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Lt.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)},Lt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&_n(this.cm,function(){return vn(e.cm)})},Lt.prototype.setUneditable=function(e){e.contentEditable="false"},Lt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Jt(this.cm,Na)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Lt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Lt.prototype.onContextMenu=function(){},Lt.prototype.resetPosition=function(){},Lt.prototype.needsContentAttribute=!0;function Cs(e,t){var r=ia(e,t.line);if(!r||r.hidden)return null;var n=Qe(e.doc,t.line),i=Ya(r,n,t.line),a=nt(n,e.doc.direction),o="left";if(a){var s=qe(a,t.ch);o=s%2?"right":"left"}var u=Za(i.map,t.ch,o);return u.offset=u.collapse=="right"?u.end:u.start,u}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Vr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,i){var a="",o=!1,s=e.doc.lineSeparator(),u=!1;function d(K){return function(xe){return xe.id==K}}function E(){o&&(a+=s,u&&(a+=s),o=u=!1)}function O(K){K&&(E(),a+=K)}function q(K){if(K.nodeType==1){var xe=K.getAttribute("cm-text");if(xe){O(xe);return}var De=K.getAttribute("cm-marker"),Ue;if(De){var He=e.findMarks(Ne(n,0),Ne(i+1,0),d(+De));He.length&&(Ue=He[0].find(0))&&O(tn(e.doc,Ue.from,Ue.to).join(s));return}if(K.getAttribute("contenteditable")=="false")return;var $e=/^(pre|div|p|li|table|br)$/i.test(K.nodeName);if(!/^br$/i.test(K.nodeName)&&K.textContent.length==0)return;$e&&E();for(var Be=0;Be<K.childNodes.length;Be++)q(K.childNodes[Be]);/^(pre|p)$/i.test(K.nodeName)&&(u=!0),$e&&(o=!0)}else K.nodeType==3&&O(K.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(q(t),t==r);)t=t.nextSibling,u=!1;return a}function qi(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return Vr(e.clipPos(Ne(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==n)return nu(a,t,r)}}function nu(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!w(n,t))return Vr(Ne(Ct(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var a=e.rest?h(e.rest):e.line;return Vr(Ne(Ct(a),a.text.length),i)}var o=t.nodeType==3?t:null,s=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,r&&(r=o.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var u=e.measure,d=u.maps;function E(Ue,He,$e){for(var Be=-1;Be<(d?d.length:0);Be++)for(var et=Be<0?u.map:d[Be],gt=0;gt<et.length;gt+=3){var ut=et[gt+2];if(ut==Ue||ut==He){var Et=Ct(Be<0?e.line:e.rest[Be]),Mt=et[gt]+$e;return($e<0||ut!=Ue)&&(Mt=et[gt+($e?1:0)]),Ne(Et,Mt)}}}var O=E(o,s,r);if(O)return Vr(O,i);for(var q=s.nextSibling,K=o?o.nodeValue.length-r:0;q;q=q.nextSibling){if(O=E(q,q.firstChild,0),O)return Vr(Ne(O.line,O.ch-K),i);K+=q.textContent.length}for(var xe=s.previousSibling,De=r;xe;xe=xe.previousSibling){if(O=E(xe,xe.firstChild,-1),O)return Vr(Ne(O.line,O.ch+De),i);De+=xe.textContent.length}}var Ht=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new _,this.hasSelection=!1,this.composing=null};Ht.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),P&&(i.style.width="0px"),ve(i,"input",function(){M&&D>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),ve(i,"paste",function(o){if(Ie(n,o)||bs(o,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function a(o){if(Ie(n,o))return;if(n.somethingSelected())Yi({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var s=xs(n);Yi({lineWise:!0,text:s.text}),o.type=="cut"?n.setSelections(s.ranges,null,ae):(r.prevInput="",i.value=s.text.join(`
|
|
`),k(i))}else return;o.type=="cut"&&(n.state.cutIncoming=+new Date)}ve(i,"cut",a),ve(i,"copy",a),ve(e.scroller,"paste",function(o){if(Qn(e,o)||Ie(n,o))return;if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var s=new Event("paste");s.clipboardData=o.clipboardData,i.dispatchEvent(s)}),ve(e.lineSpace,"selectstart",function(o){Qn(e,o)||f(o)}),ve(i,"compositionstart",function(){var o=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:o,range:n.markText(o,n.getCursor("to"),{className:"CodeMirror-composing"})}}),ve(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Ht.prototype.createField=function(e){this.wrapper=Es(),this.textarea=this.wrapper.firstChild},Ht.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ht.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=uo(e);if(e.options.moveInputWithCursor){var i=In(e,r.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return n},Ht.prototype.showSelection=function(e){var t=this.cm,r=t.display;J(r.cursorDiv,e.cursors),J(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ht.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&k(this.textarea),M&&D>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",M&&D>=9&&(this.hasSelection=null))},Ht.prototype.getField=function(){return this.textarea},Ht.prototype.supportsTouch=function(){return!1},Ht.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!se||ee()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ht.prototype.blur=function(){this.textarea.blur()},Ht.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ht.prototype.receivedFocus=function(){this.slowPoll()},Ht.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()})},Ht.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},Ht.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ze(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(M&&D>=9&&this.hasSelection===i||ie&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!n&&(n="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var o=0,s=Math.min(n.length,i.length);o<s&&n.charCodeAt(o)==i.charCodeAt(o);)++o;return _n(t,function(){Na(t,i.slice(o),n.length-o,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
`)>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ht.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ht.prototype.onKeyPress=function(){M&&D>=9&&(this.hasSelection=null),this.fastPoll()},Ht.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=yr(r,e),o=n.scroller.scrollTop;if(!a||re)return;var s=r.options.resetSelectionOnContextMenu;s&&r.doc.sel.contains(a)==-1&&Jt(r,sn)(r.doc,lr(a),ae);var u=i.style.cssText,d=t.wrapper.style.cssText,E=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-E.top-5)+"px; left: "+(e.clientX-E.left-5)+`px;
|
|
z-index: 1000; background: `+(M?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var O;S&&(O=window.scrollY),n.input.focus(),S&&window.scrollTo(null,O),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=K,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function q(){if(i.selectionStart!=null){var De=r.somethingSelected(),Ue="\u200B"+(De?i.value:"");i.value="\u21DA",i.value=Ue,t.prevInput=De?"":"\u200B",i.selectionStart=1,i.selectionEnd=Ue.length,n.selForContextMenu=r.doc.sel}}function K(){if(t.contextMenuPending!=K)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,M&&D<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=o),i.selectionStart!=null){(!M||M&&D<9)&&q();var De=0,Ue=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Jt(r,Bo)(r):De++<10?n.detectingSelectAll=setTimeout(Ue,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ue,200)}}if(M&&D>=9&&q(),Re){b(e);var xe=function(){Je(window,"mouseup",xe),setTimeout(K,20)};ve(window,"mouseup",xe)}else setTimeout(K,50)},Ht.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ht.prototype.setUneditable=function(){},Ht.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?l(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 r=ee();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(ve(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){n(),a.submit=i,a.submit(),a.submit=o}}catch(u){}}t.finishInit=function(u){u.save=n,u.getTextArea=function(){return e},u.toTextArea=function(){u.toTextArea=isNaN,n(),e.parentNode.removeChild(u.getWrapperElement()),e.style.display="",e.form&&(Je(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var s=Nt(function(u){return e.parentNode.insertBefore(u,e.nextSibling)},t);return s}function iu(e){e.off=Je,e.on=ve,e.wheelEventPixels=dl,e.Doc=bn,e.splitLines=it,e.countColumn=g,e.findColumn=ce,e.isWordChar=ne,e.Pass=_e,e.signal=Ce,e.Line=qt,e.changeEnd=ur,e.scrollbarModel=bo,e.Pos=Ne,e.cmpPos=mt,e.modes=kt,e.mimeModes=vt,e.resolveMode=zt,e.getMode=pn,e.modeExtensions=an,e.extendMode=nr,e.copyState=An,e.startState=Wn,e.innerMode=Rn,e.commands=xi,e.keyMap=er,e.keyName=is,e.isModifierKey=ns,e.lookupKey=Kr,e.normalizeKeyMap=Rl,e.StringStream=Dt,e.SharedTextMarker=vi,e.TextMarker=dr,e.LineWidget=gi,e.e_preventDefault=f,e.e_stopPropagation=p,e.e_stop=b,e.addClass=j,e.contains=w,e.rmClass=me,e.keyNames=fr}Yl(Nt),Ql(Nt);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ji in bn.prototype)bn.prototype.hasOwnProperty(Ji)&&N(au,Ji)<0&&(Nt.prototype[Ji]=function(e){return function(){return e.apply(this.doc,arguments)}}(bn.prototype[Ji]));return x(bn),Nt.inputStyles={textarea:Ht,contenteditable:Lt},Nt.defineMode=function(e){!Nt.defaults.mode&&e!="null"&&(Nt.defaults.mode=e),Bt.apply(this,arguments)},Nt.defineMIME=Ut,Nt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nt.defineMIME("text/plain","null"),Nt.defineExtension=function(e,t){Nt.prototype[e]=t},Nt.defineDocExtension=function(e,t){bn.prototype[e]=t},Nt.fromTextArea=ru,iu(Nt),Nt.version="5.58.2",Nt})},Y1PL:function(bt,Ye,C){"use strict";C.r(Ye),C.d(Ye,"ResizableTextArea",function(){return N});var F=C("wx14"),ge=C("1OyB"),oe=C("vuIU"),Oe=C("Ji7U"),Ee=C("LK+K"),G=C("q1tI"),M=C("VTBJ"),D=C("rePB"),S=C("Zm9Q"),z=C("Kwbf"),$=C("c+Xe"),re=C("m+aA"),ye=C("bdgK"),le=new Map;function W(ae){ae.forEach(function(Se){var ue,ce=Se.target;(ue=le.get(ce))===null||ue===void 0||ue.forEach(function(H){return H(ce)})})}var P=new ye.default(W),U=null,se=null;function ie(ae,Se){le.has(ae)||(le.set(ae,new Set),P.observe(ae)),le.get(ae).add(Se)}function Te(ae,Se){le.has(ae)&&(le.get(ae).delete(Se),le.get(ae).size||(P.unobserve(ae),le.delete(ae)))}var We=function(ae){Object(Oe.a)(ue,ae);var Se=Object(Ee.a)(ue);function ue(){return Object(ge.a)(this,ue),Se.apply(this,arguments)}return Object(oe.a)(ue,[{key:"render",value:function(){return this.props.children}}]),ue}(G.Component),pe=G.createContext(null);function be(ae){var Se=ae.children,ue=ae.onBatchResize,ce=G.useRef(0),H=G.useRef([]),te=G.useContext(pe),h=G.useCallback(function(T,m,R){ce.current+=1;var Y=ce.current;H.current.push({size:T,element:m,data:R}),Promise.resolve().then(function(){Y===ce.current&&(ue==null||ue(H.current),H.current=[])}),te==null||te(T,m,R)},[ue,te]);return G.createElement(pe.Provider,{value:h},Se)}function Re(ae){var Se=ae.children,ue=ae.disabled,ce=G.useRef(null),H=G.useRef(null),te=G.useContext(pe),h=G.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),T=G.isValidElement(Se)&&Object($.c)(Se),m=T?Se.ref:null,R=G.useMemo(function(){return Object($.a)(m,ce)},[m,ce]),Y=G.useRef(ae);Y.current=ae;var B=G.useCallback(function(ne){var ke=Y.current,je=ke.onResize,Pe=ke.data,we=ne.getBoundingClientRect(),Me=we.width,Ge=we.height,Ve=ne.offsetWidth,Ke=ne.offsetHeight,qe=Math.floor(Me),ht=Math.floor(Ge);if(h.current.width!==qe||h.current.height!==ht||h.current.offsetWidth!==Ve||h.current.offsetHeight!==Ke){var nt={width:qe,height:ht,offsetWidth:Ve,offsetHeight:Ke};h.current=nt;var Xe=Ve===Math.round(Me)?Me:Ve,ve=Ke===Math.round(Ge)?Ge:Ke,at=Object(M.a)(Object(M.a)({},nt),{},{offsetWidth:Xe,offsetHeight:ve});te==null||te(at,ne,Pe),je&&Promise.resolve().then(function(){je(at,ne)})}},[]);return G.useEffect(function(){var ne=Object(re.a)(ce.current)||Object(re.a)(H.current);return ne&&!ue&&ie(ne,B),function(){return Te(ne,B)}},[ce.current,ue]),G.createElement(We,{ref:H},T?G.cloneElement(Se,{ref:R}):Se)}var Q="rc-observer-key";function me(ae){var Se=ae.children,ue=Object(S.a)(Se);return ue.map(function(ce,H){var te=(ce==null?void 0:ce.key)||"".concat(Q,"-").concat(H);return G.createElement(Re,Object(F.a)({},ae,{key:te}),ce)})}me.Collection=be;var Ae=me,J=C("bT9E"),y=C("TSYQ"),Z=C.n(y),X=`
|
|
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
|
|
`,w=["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"],ee={},j;function A(ae){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ue=ae.getAttribute("id")||ae.getAttribute("data-reactid")||ae.getAttribute("name");if(Se&&ee[ue])return ee[ue];var ce=window.getComputedStyle(ae),H=ce.getPropertyValue("box-sizing")||ce.getPropertyValue("-moz-box-sizing")||ce.getPropertyValue("-webkit-box-sizing"),te=parseFloat(ce.getPropertyValue("padding-bottom"))+parseFloat(ce.getPropertyValue("padding-top")),h=parseFloat(ce.getPropertyValue("border-bottom-width"))+parseFloat(ce.getPropertyValue("border-top-width")),T=w.map(function(R){return"".concat(R,":").concat(ce.getPropertyValue(R))}).join(";"),m={sizingStyle:T,paddingSize:te,borderSize:h,boxSizing:H};return Se&&ue&&(ee[ue]=m),m}function k(ae){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ce=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),ae.getAttribute("wrap")?j.setAttribute("wrap",ae.getAttribute("wrap")):j.removeAttribute("wrap");var H=A(ae,Se),te=H.paddingSize,h=H.borderSize,T=H.boxSizing,m=H.sizingStyle;j.setAttribute("style","".concat(m,";").concat(X)),j.value=ae.value||ae.placeholder||"";var R=Number.MIN_SAFE_INTEGER,Y=Number.MAX_SAFE_INTEGER,B=j.scrollHeight,ne;if(T==="border-box"?B+=h:T==="content-box"&&(B-=te),ue!==null||ce!==null){j.value=" ";var ke=j.scrollHeight-te;ue!==null&&(R=ke*ue,T==="border-box"&&(R=R+te+h),B=Math.max(R,B)),ce!==null&&(Y=ke*ce,T==="border-box"&&(Y=Y+te+h),ne=B>Y?"":"hidden",B=Math.min(Y,B))}return{height:B,minHeight:R,maxHeight:Y,overflowY:ne,resize:"none"}}var c=C("Gytx"),l=C.n(c),g;(function(ae){ae[ae.NONE=0]="NONE",ae[ae.RESIZING=1]="RESIZING",ae[ae.RESIZED=2]="RESIZED"})(g||(g={}));var _=function(ae){Object(Oe.a)(ue,ae);var Se=Object(Ee.a)(ue);function ue(ce){var H;return Object(ge.a)(this,ue),H=Se.call(this,ce),H.nextFrameActionId=void 0,H.resizeFrameId=void 0,H.textArea=void 0,H.saveTextArea=function(te){H.textArea=te},H.handleResize=function(te){var h=H.state.resizeStatus,T=H.props,m=T.autoSize,R=T.onResize;if(h!==g.NONE)return;typeof R=="function"&&R(te),m&&H.resizeOnNextFrame()},H.resizeOnNextFrame=function(){cancelAnimationFrame(H.nextFrameActionId),H.nextFrameActionId=requestAnimationFrame(H.resizeTextarea)},H.resizeTextarea=function(){var te=H.props.autoSize;if(!te||!H.textArea)return;var h=te.minRows,T=te.maxRows,m=k(H.textArea,!1,h,T);H.setState({textareaStyles:m,resizeStatus:g.RESIZING},function(){cancelAnimationFrame(H.resizeFrameId),H.resizeFrameId=requestAnimationFrame(function(){H.setState({resizeStatus:g.RESIZED},function(){H.resizeFrameId=requestAnimationFrame(function(){H.setState({resizeStatus:g.NONE}),H.fixFirefoxAutoScroll()})})})})},H.renderTextArea=function(){var te=H.props,h=te.prefixCls,T=h===void 0?"rc-textarea":h,m=te.autoSize,R=te.onResize,Y=te.className,B=te.disabled,ne=H.state,ke=ne.textareaStyles,je=ne.resizeStatus,Pe=Object(J.a)(H.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),we=Z()(T,Y,Object(D.a)({},"".concat(T,"-disabled"),B));"value"in Pe&&(Pe.value=Pe.value||"");var Me=Object(M.a)(Object(M.a)(Object(M.a)({},H.props.style),ke),je===g.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return G.createElement(Ae,{onResize:H.handleResize,disabled:!(m||R)},G.createElement("textarea",Object(F.a)({},Pe,{className:we,style:Me,ref:H.saveTextArea})))},H.state={textareaStyles:{},resizeStatus:g.NONE},H}return Object(oe.a)(ue,[{key:"componentDidUpdate",value:function(H){(H.value!==this.props.value||!l()(H.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 H=this.textArea.selectionStart,te=this.textArea.selectionEnd;this.textArea.setSelectionRange(H,te)}}catch(h){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ue}(G.Component),N=_,de=function(ae){Object(Oe.a)(ue,ae);var Se=Object(Ee.a)(ue);function ue(ce){var H;Object(ge.a)(this,ue),H=Se.call(this,ce),H.resizableTextArea=void 0,H.focus=function(){H.resizableTextArea.textArea.focus()},H.saveTextArea=function(h){H.resizableTextArea=h},H.handleChange=function(h){var T=H.props.onChange;H.setValue(h.target.value,function(){H.resizableTextArea.resizeTextarea()}),T&&T(h)},H.handleKeyDown=function(h){var T=H.props,m=T.onPressEnter,R=T.onKeyDown;h.keyCode===13&&m&&m(h),R&&R(h)};var te=typeof ce.value=="undefined"||ce.value===null?ce.defaultValue:ce.value;return H.state={value:te},H}return Object(oe.a)(ue,[{key:"setValue",value:function(H,te){"value"in this.props||this.setState({value:H},te)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return G.createElement(N,Object(F.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(H){return"value"in H?{value:H.value}:null}}]),ue}(G.Component),_e=Ye.default=de},ZW9T:function(bt,Ye,C){"use strict";C.d(Ye,"a",function(){return We});var F=C("k1fw"),ge=C("miYZ"),oe=C("tsqr"),Oe=C("rAM+"),Ee=C("tJVT"),G=C("PpiC"),M=C("q1tI"),D=C.n(M),S=C("bdgK");function z(pe,be,Re,Q,me){var Ae=be.getWordUntilPosition(Re),J={startLineNumber:Re.lineNumber,endLineNumber:Re.lineNumber,startColumn:Ae.startColumn,endColumn:Ae.endColumn},y=Q.map(function(Z){return{label:Z,kind:pe.languages.CompletionItemKind.Keyword,insertText:Z,insertTextRules:pe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:J}});return me.map(function(Z){y.push(Object(F.a)(Object(F.a)({},Z),{},{range:J}))}),y}var $=function(pe){var be={label:"ifelse",kind:pe.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:pe.languages.CompletionItemInsertTextRule.InsertAsSnippet},Re=["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","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];pe.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(J,y){var Z=z(pe,J,y,Re,[be]);return{suggestions:Z}}});var Q=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];pe.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(J,y){var Z=[{label:"print",kind:pe.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:pe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],X=z(pe,J,y,Q,Z);return{suggestions:X}}});var me=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];pe.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(J,y){var Z=[be,{label:"main",kind:pe.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:pe.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:pe.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:pe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],X=z(pe,J,y,me,Z);return{suggestions:X}}})},re="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",ye=C("LvDl");function le(pe){return/^\d+$/.test(pe)?"".concat(pe,"px"):pe}function W(){}var P=!1,U={"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 se(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=pe;if(Array.isArray(pe)){for(var Re=0;Re<pe.length;Re++){var Q=U[pe[Re]];if(Q)return Q}return be[0]}return U[be]||be}var ie=null,Te=Ye.b=function(pe){var be=pe.width,Re=be===void 0?"100%":be,Q=pe.height,me=Q===void 0?"100%":Q,Ae=pe.value,J=pe.language,y=J===void 0?"javascript":J,Z=pe.style,X=Z===void 0?{}:Z,w=pe.options,ee=w===void 0?{}:w,j=pe.overrideServices,A=j===void 0?{}:j,k=pe.theme,c=k===void 0?"vs-dark":k,l=pe.onEditBlur,g=pe.onSave,_=pe.autoHeight,N=_===void 0?!1:_,de=pe.forbidCopy,_e=de===void 0?!1:de,ae=pe.onChange,Se=ae===void 0?W:ae,ue=pe.editorDidMount,ce=ue===void 0?W:ue,H=pe.onFocus,te=H===void 0?W:H,h=pe.filename,T=h===void 0?"educoder.txt":h,m=Object(G.a)(pe,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),R=Object(M.useRef)(),Y=Object(M.useRef)({}),B=Object(M.useRef)(),ne=Object(M.useRef)(!1),ke=Object(M.useRef)(),je=Object(M.useState)(!1),Pe=Object(Ee.a)(je,2),we=Pe[0],Me=Pe[1];function Ge(){var v;return R.current&&(v=new S.default(function(b){var V=Object(Oe.a)(b),fe;try{for(V.s();!(fe=V.n()).done;){var Le=fe.value;(Le.target.offsetHeight>0||Le.target.offsetWidth>0)&&Y.current.instance.layout()}}catch(tt){V.e(tt)}finally{V.f()}}),v.observe(R.current)),v}function Ve(){oe.b.warn(decodeURIComponent(re))}var Ke=function(){var b=Y.current.instance;if(Ae!=null&&b&&we){var V=b.getModel();V&&Ae!==V.getValue()&&(P=!0,V.setValue(Ae),b.layout(),P=!1)}};Object(M.useEffect)(function(){B.current&&clearTimeout(B.current),B.current=setTimeout(function(){Ke()},500)},[Ae,we,Y.current]);function qe(){var v=Y.current.instance;if(v){var b=v.getSelection(),V=Y.current.pastePos||{},fe=new ie.Range(V.startLineNumber||b.endLineNumber,V.startColumn||b.endColumn,V.endLineNumber||b.endLineNumber,V.endColumn||b.endColumn);setTimeout(function(){v.executeEdits("",[{range:fe,text:""}])},300)}}function ht(v){(window.navigator.platform.match("Mac")?v.metaKey:v.ctrlKey)&&v.keyCode==83&&(v.preventDefault(),g())}var nt=function(){if(N&&Y.current.instance){var b=Y.current.instance.getContentHeight();f(b<me?me:b)}else f(me)};function Xe(v){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),v.dispatchEvent(b)}function ve(v,b){var V=window.URL||window.webkitURL||window,fe=new Blob([b]),Le=document.createElementNS("http://www.w3.org/1999/xhtml","a");Le.href=V.createObjectURL(fe),Le.download=v,Xe(Le)}Object(M.useEffect)(function(){nt()},[nt]),Object(M.useEffect)(function(){R.current&&!we&&C.e(26).then(C.t.bind(null,"M/lh",7)).then(function(v){try{ie=v,Y.current.instance=ie.editor.create(R.current,{value:Ae,language:se(y),theme:c,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},A);var b=Y.current.instance;if(ce(b,ie),setTimeout(function(){nt(),Y.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ve(T||"educoder.txt",b.getValue())}})},500),Y.current.subscription=b.onDidChangeModelContent(function(fe){ne.current?clearTimeout(ke.current):(nt(),Se(b.getValue(),fe)),ke.current=setTimeout(function(){ne.current=!1},500)}),window.Monaco||$(ie),_e&&(b.addCommand(ie.KeyMod.CtrlCmd|ie.KeyMod.Shift|ie.KeyCode.KEY_V,function(){return Ve(),null}),b.addCommand(ie.KeyMod.CtrlCmd|ie.KeyCode.KEY_C,function(){return Ve(),null})),window.Monaco=ie,l&&b.onDidBlurEditorWidget(function(){l(b.getValue())}),te&&b.onDidFocusEditorText(function(){te(b.getValue())}),_e){b.addCommand(ie.KeyMod.CtrlCmd|ie.KeyCode.KEY_V,function(){return Ve(),null}),b.onDidPaste(function(fe){Y.current.pastePos=fe});try{window.addEventListener("paste",qe)}catch(fe){}}var V=Ge();return Me(!0),function(){var fe=Y.current.instance;fe.dispose();var Le=fe.getModel();Le&&Le.dispose(),Y.current.subscription&&Y.current.subscription.dispose(),_e&&window.removeEventListener("paste",qe),V.unobserve(R.current)}}catch(fe){}})},[]),Object(M.useEffect)(function(){var v=Y.current.instance;if(v&&we)return document.addEventListener("keydown",ht,!1),function(){document.removeEventListener("keydown",ht)}},[g,we]),Object(M.useEffect)(function(){var v=Y.current.instance;if(v&&we){var b=se(y);ie.editor.setModelLanguage(v.getModel(),b),console.log("language:",y,v.getModel(),b)}},[y,we]),Object(M.useEffect)(function(){var v=Y.current.instance;v&&we&&ie.editor.setTheme(c)},[c,we]),Object(M.useEffect)(function(){var v=Y.current.instance;v&&we&&(v.updateOptions(Object(F.a)({},ee)),setTimeout(function(){v.getModel().updateOptions(Object(F.a)({},ee))},200))},[JSON.stringify(ee),we]),Object(M.useEffect)(function(){var v=Y.current.instance;v&&we&&v.layout()},[Re,me,we]);var at=Object(M.useState)(le(Re)),Je=Object(Ee.a)(at,2),Ce=Je[0],Ie=Je[1],I=Object(M.useState)(le(me)),L=Object(Ee.a)(I,2),x=L[0],f=L[1],p=Object(F.a)(Object(F.a)({},X),{},{width:Ce,height:x});return D.a.createElement("div",{className:"my-monaco-editor",ref:R,style:p})};function We(pe){var be=pe.width,Re=be===void 0?"100%":be,Q=pe.height,me=Q===void 0?"100%":Q,Ae=pe.original,J=pe.modified,y=pe.language,Z=pe.options,X=Z===void 0?{}:Z,w=Object(M.useRef)(),ee=Object(M.useState)(null),j=Object(Ee.a)(ee,2),A=j[0],k=j[1];function c(N){var de;return w.current&&(de=new S.default(function(_e){var ae=Object(Oe.a)(_e),Se;try{for(ae.s();!(Se=ae.n()).done;){var ue=Se.value;(ue.target.offsetHeight>0||ue.target.offsetWidth>0)&&N.layout()}}catch(ce){ae.e(ce)}finally{ae.f()}}),de.observe(w.current)),de}Object(M.useEffect)(function(){w.current&&C.e(26).then(C.t.bind(null,"M/lh",7)).then(function(N){ie=N;var de=ie.editor.createDiffEditor(w.current,Object(F.a)(Object(F.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},X),{},{wordWrap:!0}));k(de);var _e=c(de);return function(){de.dispose();var ae=de.getModel();ae&&ae.dispose(),_e.unobserve(w.current)}})},[]),Object(M.useEffect)(function(){A&&A.setModel({original:ie.editor.createModel(Ae,y),modified:ie.editor.createModel(J,y)})},[Ae,J,y,A]);var l=le(Re),g=le(me),_={width:l,height:g};return D.a.createElement("div",{className:"my-diff-editor",ref:w,style:_})}},ZpRC:function(bt,Ye,C){"use strict";function F($){return typeof $=="object"&&$!=null&&$.nodeType===1}function ge($,re){return(!re||$!=="hidden")&&$!=="visible"&&$!=="clip"}function oe($,re){if($.clientHeight<$.scrollHeight||$.clientWidth<$.scrollWidth){var ye=getComputedStyle($,null);return ge(ye.overflowY,re)||ge(ye.overflowX,re)||function(le){var W=function(P){if(!P.ownerDocument||!P.ownerDocument.defaultView)return null;try{return P.ownerDocument.defaultView.frameElement}catch(U){return null}}(le);return!!W&&(W.clientHeight<le.scrollHeight||W.clientWidth<le.scrollWidth)}($)}return!1}function Oe($,re,ye,le,W,P,U,se){return P<$&&U>re||P>$&&U<re?0:P<=$&&se<=ye||U>=re&&se>=ye?P-$-le:U>re&&se<ye||P<$&&se>ye?U-re+W:0}var Ee=function($,re){var ye=window,le=re.scrollMode,W=re.block,P=re.inline,U=re.boundary,se=re.skipOverflowHiddenElements,ie=typeof U=="function"?U:function(ke){return ke!==U};if(!F($))throw new TypeError("Invalid target");for(var Te=document.scrollingElement||document.documentElement,We=[],pe=$;F(pe)&&ie(pe);){if((pe=pe.parentElement)===Te){We.push(pe);break}pe!=null&&pe===document.body&&oe(pe)&&!oe(document.documentElement)||pe!=null&&oe(pe,se)&&We.push(pe)}for(var be=ye.visualViewport?ye.visualViewport.width:innerWidth,Re=ye.visualViewport?ye.visualViewport.height:innerHeight,Q=window.scrollX||pageXOffset,me=window.scrollY||pageYOffset,Ae=$.getBoundingClientRect(),J=Ae.height,y=Ae.width,Z=Ae.top,X=Ae.right,w=Ae.bottom,ee=Ae.left,j=W==="start"||W==="nearest"?Z:W==="end"?w:Z+J/2,A=P==="center"?ee+y/2:P==="end"?X:ee,k=[],c=0;c<We.length;c++){var l=We[c],g=l.getBoundingClientRect(),_=g.height,N=g.width,de=g.top,_e=g.right,ae=g.bottom,Se=g.left;if(le==="if-needed"&&Z>=0&&ee>=0&&w<=Re&&X<=be&&Z>=de&&w<=ae&&ee>=Se&&X<=_e)return k;var ue=getComputedStyle(l),ce=parseInt(ue.borderLeftWidth,10),H=parseInt(ue.borderTopWidth,10),te=parseInt(ue.borderRightWidth,10),h=parseInt(ue.borderBottomWidth,10),T=0,m=0,R="offsetWidth"in l?l.offsetWidth-l.clientWidth-ce-te:0,Y="offsetHeight"in l?l.offsetHeight-l.clientHeight-H-h:0;if(Te===l)T=W==="start"?j:W==="end"?j-Re:W==="nearest"?Oe(me,me+Re,Re,H,h,me+j,me+j+J,J):j-Re/2,m=P==="start"?A:P==="center"?A-be/2:P==="end"?A-be:Oe(Q,Q+be,be,ce,te,Q+A,Q+A+y,y),T=Math.max(0,T+me),m=Math.max(0,m+Q);else{T=W==="start"?j-de-H:W==="end"?j-ae+h+Y:W==="nearest"?Oe(de,ae,_,H,h+Y,j,j+J,J):j-(de+_/2)+Y/2,m=P==="start"?A-Se-ce:P==="center"?A-(Se+N/2)+R/2:P==="end"?A-_e+te+R:Oe(Se,_e,N,ce,te+R,A,A+y,y);var B=l.scrollLeft,ne=l.scrollTop;j+=ne-(T=Math.max(0,Math.min(ne+T,l.scrollHeight-_+Y))),A+=B-(m=Math.max(0,Math.min(B+m,l.scrollWidth-N+R)))}k.push({el:l,top:T,left:m})}return k};function G($){return $===Object($)&&Object.keys($).length!==0}function M($,re){re===void 0&&(re="auto");var ye="scrollBehavior"in document.body.style;$.forEach(function(le){var W=le.el,P=le.top,U=le.left;W.scroll&&ye?W.scroll({top:P,left:U,behavior:re}):(W.scrollTop=P,W.scrollLeft=U)})}function D($){return $===!1?{block:"end",inline:"nearest"}:G($)?$:{block:"start",inline:"nearest"}}function S($,re){var ye=!$.ownerDocument.documentElement.contains($);if(G(re)&&typeof re.behavior=="function")return re.behavior(ye?[]:Ee($,re));if(ye)return;var le=D(re);return M(Ee($,le),le.behavior)}var z=Ye.a=S},Zss7:function(bt,Ye,C){var F;(function(ge){var oe=/^\s+/,Oe=/\s+$/,Ee=0,G=ge.round,M=ge.min,D=ge.max,S=ge.random;function z(h,T){if(h=h||"",T=T||{},h instanceof z)return h;if(!(this instanceof z))return new z(h,T);var m=$(h);this._originalInput=h,this._r=m.r,this._g=m.g,this._b=m.b,this._a=m.a,this._roundA=G(100*this._a)/100,this._format=T.format||m.format,this._gradientType=T.gradientType,this._r<1&&(this._r=G(this._r)),this._g<1&&(this._g=G(this._g)),this._b<1&&(this._b=G(this._b)),this._ok=m.ok,this._tc_id=Ee++}z.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var h=this.toRgb();return(h.r*299+h.g*587+h.b*114)/1e3},getLuminance:function(){var h=this.toRgb(),T,m,R,Y,B,ne;return T=h.r/255,m=h.g/255,R=h.b/255,T<=.03928?Y=T/12.92:Y=ge.pow((T+.055)/1.055,2.4),m<=.03928?B=m/12.92:B=ge.pow((m+.055)/1.055,2.4),R<=.03928?ne=R/12.92:ne=ge.pow((R+.055)/1.055,2.4),.2126*Y+.7152*B+.0722*ne},setAlpha:function(h){return this._a=k(h),this._roundA=G(100*this._a)/100,this},toHsv:function(){var h=W(this._r,this._g,this._b);return{h:h.h*360,s:h.s,v:h.v,a:this._a}},toHsvString:function(){var h=W(this._r,this._g,this._b),T=G(h.h*360),m=G(h.s*100),R=G(h.v*100);return this._a==1?"hsv("+T+", "+m+"%, "+R+"%)":"hsva("+T+", "+m+"%, "+R+"%, "+this._roundA+")"},toHsl:function(){var h=ye(this._r,this._g,this._b);return{h:h.h*360,s:h.s,l:h.l,a:this._a}},toHslString:function(){var h=ye(this._r,this._g,this._b),T=G(h.h*360),m=G(h.s*100),R=G(h.l*100);return this._a==1?"hsl("+T+", "+m+"%, "+R+"%)":"hsla("+T+", "+m+"%, "+R+"%, "+this._roundA+")"},toHex:function(h){return U(this._r,this._g,this._b,h)},toHexString:function(h){return"#"+this.toHex(h)},toHex8:function(h){return se(this._r,this._g,this._b,this._a,h)},toHex8String:function(h){return"#"+this.toHex8(h)},toRgb:function(){return{r:G(this._r),g:G(this._g),b:G(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+G(this._r)+", "+G(this._g)+", "+G(this._b)+")":"rgba("+G(this._r)+", "+G(this._g)+", "+G(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:G(c(this._r,255)*100)+"%",g:G(c(this._g,255)*100)+"%",b:G(c(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+G(c(this._r,255)*100)+"%, "+G(c(this._g,255)*100)+"%, "+G(c(this._b,255)*100)+"%)":"rgba("+G(c(this._r,255)*100)+"%, "+G(c(this._g,255)*100)+"%, "+G(c(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:j[U(this._r,this._g,this._b,!0)]||!1},toFilter:function(h){var T="#"+ie(this._r,this._g,this._b,this._a),m=T,R=this._gradientType?"GradientType = 1, ":"";if(h){var Y=z(h);m="#"+ie(Y._r,Y._g,Y._b,Y._a)}return"progid:DXImageTransform.Microsoft.gradient("+R+"startColorstr="+T+",endColorstr="+m+")"},toString:function(h){var T=!!h;h=h||this._format;var m=!1,R=this._a<1&&this._a>=0,Y=!T&&R&&(h==="hex"||h==="hex6"||h==="hex3"||h==="hex4"||h==="hex8"||h==="name");return Y?h==="name"&&this._a===0?this.toName():this.toRgbString():(h==="rgb"&&(m=this.toRgbString()),h==="prgb"&&(m=this.toPercentageRgbString()),(h==="hex"||h==="hex6")&&(m=this.toHexString()),h==="hex3"&&(m=this.toHexString(!0)),h==="hex4"&&(m=this.toHex8String(!0)),h==="hex8"&&(m=this.toHex8String()),h==="name"&&(m=this.toName()),h==="hsl"&&(m=this.toHslString()),h==="hsv"&&(m=this.toHsvString()),m||this.toHexString())},clone:function(){return z(this.toString())},_applyModification:function(h,T){var m=h.apply(null,[this].concat([].slice.call(T)));return this._r=m._r,this._g=m._g,this._b=m._b,this.setAlpha(m._a),this},lighten:function(){return this._applyModification(be,arguments)},brighten:function(){return this._applyModification(Re,arguments)},darken:function(){return this._applyModification(Q,arguments)},desaturate:function(){return this._applyModification(Te,arguments)},saturate:function(){return this._applyModification(We,arguments)},greyscale:function(){return this._applyModification(pe,arguments)},spin:function(){return this._applyModification(me,arguments)},_applyCombination:function(h,T){return h.apply(null,[this].concat([].slice.call(T)))},analogous:function(){return this._applyCombination(X,arguments)},complement:function(){return this._applyCombination(Ae,arguments)},monochromatic:function(){return this._applyCombination(w,arguments)},splitcomplement:function(){return this._applyCombination(Z,arguments)},triad:function(){return this._applyCombination(J,arguments)},tetrad:function(){return this._applyCombination(y,arguments)}},z.fromRatio=function(h,T){if(typeof h=="object"){var m={};for(var R in h)h.hasOwnProperty(R)&&(R==="a"?m[R]=h[R]:m[R]=_e(h[R]));h=m}return z(h,T)};function $(h){var T={r:0,g:0,b:0},m=1,R=null,Y=null,B=null,ne=!1,ke=!1;return typeof h=="string"&&(h=H(h)),typeof h=="object"&&(ce(h.r)&&ce(h.g)&&ce(h.b)?(T=re(h.r,h.g,h.b),ne=!0,ke=String(h.r).substr(-1)==="%"?"prgb":"rgb"):ce(h.h)&&ce(h.s)&&ce(h.v)?(R=_e(h.s),Y=_e(h.v),T=P(h.h,R,Y),ne=!0,ke="hsv"):ce(h.h)&&ce(h.s)&&ce(h.l)&&(R=_e(h.s),B=_e(h.l),T=le(h.h,R,B),ne=!0,ke="hsl"),h.hasOwnProperty("a")&&(m=h.a)),m=k(m),{ok:ne,format:h.format||ke,r:M(255,D(T.r,0)),g:M(255,D(T.g,0)),b:M(255,D(T.b,0)),a:m}}function re(h,T,m){return{r:c(h,255)*255,g:c(T,255)*255,b:c(m,255)*255}}function ye(h,T,m){h=c(h,255),T=c(T,255),m=c(m,255);var R=D(h,T,m),Y=M(h,T,m),B,ne,ke=(R+Y)/2;if(R==Y)B=ne=0;else{var je=R-Y;ne=ke>.5?je/(2-R-Y):je/(R+Y);switch(R){case h:B=(T-m)/je+(T<m?6:0);break;case T:B=(m-h)/je+2;break;case m:B=(h-T)/je+4;break}B/=6}return{h:B,s:ne,l:ke}}function le(h,T,m){var R,Y,B;h=c(h,360),T=c(T,100),m=c(m,100);function ne(Pe,we,Me){return Me<0&&(Me+=1),Me>1&&(Me-=1),Me<1/6?Pe+(we-Pe)*6*Me:Me<1/2?we:Me<2/3?Pe+(we-Pe)*(2/3-Me)*6:Pe}if(T===0)R=Y=B=m;else{var ke=m<.5?m*(1+T):m+T-m*T,je=2*m-ke;R=ne(je,ke,h+1/3),Y=ne(je,ke,h),B=ne(je,ke,h-1/3)}return{r:R*255,g:Y*255,b:B*255}}function W(h,T,m){h=c(h,255),T=c(T,255),m=c(m,255);var R=D(h,T,m),Y=M(h,T,m),B,ne,ke=R,je=R-Y;if(ne=R===0?0:je/R,R==Y)B=0;else{switch(R){case h:B=(T-m)/je+(T<m?6:0);break;case T:B=(m-h)/je+2;break;case m:B=(h-T)/je+4;break}B/=6}return{h:B,s:ne,v:ke}}function P(h,T,m){h=c(h,360)*6,T=c(T,100),m=c(m,100);var R=ge.floor(h),Y=h-R,B=m*(1-T),ne=m*(1-Y*T),ke=m*(1-(1-Y)*T),je=R%6,Pe=[m,ne,B,B,ke,m][je],we=[ke,m,m,ne,B,B][je],Me=[B,B,ke,m,m,ne][je];return{r:Pe*255,g:we*255,b:Me*255}}function U(h,T,m,R){var Y=[de(G(h).toString(16)),de(G(T).toString(16)),de(G(m).toString(16))];return R&&Y[0].charAt(0)==Y[0].charAt(1)&&Y[1].charAt(0)==Y[1].charAt(1)&&Y[2].charAt(0)==Y[2].charAt(1)?Y[0].charAt(0)+Y[1].charAt(0)+Y[2].charAt(0):Y.join("")}function se(h,T,m,R,Y){var B=[de(G(h).toString(16)),de(G(T).toString(16)),de(G(m).toString(16)),de(ae(R))];return Y&&B[0].charAt(0)==B[0].charAt(1)&&B[1].charAt(0)==B[1].charAt(1)&&B[2].charAt(0)==B[2].charAt(1)&&B[3].charAt(0)==B[3].charAt(1)?B[0].charAt(0)+B[1].charAt(0)+B[2].charAt(0)+B[3].charAt(0):B.join("")}function ie(h,T,m,R){var Y=[de(ae(R)),de(G(h).toString(16)),de(G(T).toString(16)),de(G(m).toString(16))];return Y.join("")}z.equals=function(h,T){return!h||!T?!1:z(h).toRgbString()==z(T).toRgbString()},z.random=function(){return z.fromRatio({r:S(),g:S(),b:S()})};function Te(h,T){T=T===0?0:T||10;var m=z(h).toHsl();return m.s-=T/100,m.s=l(m.s),z(m)}function We(h,T){T=T===0?0:T||10;var m=z(h).toHsl();return m.s+=T/100,m.s=l(m.s),z(m)}function pe(h){return z(h).desaturate(100)}function be(h,T){T=T===0?0:T||10;var m=z(h).toHsl();return m.l+=T/100,m.l=l(m.l),z(m)}function Re(h,T){T=T===0?0:T||10;var m=z(h).toRgb();return m.r=D(0,M(255,m.r-G(255*-(T/100)))),m.g=D(0,M(255,m.g-G(255*-(T/100)))),m.b=D(0,M(255,m.b-G(255*-(T/100)))),z(m)}function Q(h,T){T=T===0?0:T||10;var m=z(h).toHsl();return m.l-=T/100,m.l=l(m.l),z(m)}function me(h,T){var m=z(h).toHsl(),R=(m.h+T)%360;return m.h=R<0?360+R:R,z(m)}function Ae(h){var T=z(h).toHsl();return T.h=(T.h+180)%360,z(T)}function J(h){var T=z(h).toHsl(),m=T.h;return[z(h),z({h:(m+120)%360,s:T.s,l:T.l}),z({h:(m+240)%360,s:T.s,l:T.l})]}function y(h){var T=z(h).toHsl(),m=T.h;return[z(h),z({h:(m+90)%360,s:T.s,l:T.l}),z({h:(m+180)%360,s:T.s,l:T.l}),z({h:(m+270)%360,s:T.s,l:T.l})]}function Z(h){var T=z(h).toHsl(),m=T.h;return[z(h),z({h:(m+72)%360,s:T.s,l:T.l}),z({h:(m+216)%360,s:T.s,l:T.l})]}function X(h,T,m){T=T||6,m=m||30;var R=z(h).toHsl(),Y=360/m,B=[z(h)];for(R.h=(R.h-(Y*T>>1)+720)%360;--T;)R.h=(R.h+Y)%360,B.push(z(R));return B}function w(h,T){T=T||6;for(var m=z(h).toHsv(),R=m.h,Y=m.s,B=m.v,ne=[],ke=1/T;T--;)ne.push(z({h:R,s:Y,v:B})),B=(B+ke)%1;return ne}z.mix=function(h,T,m){m=m===0?0:m||50;var R=z(h).toRgb(),Y=z(T).toRgb(),B=m/100,ne={r:(Y.r-R.r)*B+R.r,g:(Y.g-R.g)*B+R.g,b:(Y.b-R.b)*B+R.b,a:(Y.a-R.a)*B+R.a};return z(ne)},z.readability=function(h,T){var m=z(h),R=z(T);return(ge.max(m.getLuminance(),R.getLuminance())+.05)/(ge.min(m.getLuminance(),R.getLuminance())+.05)},z.isReadable=function(h,T,m){var R=z.readability(h,T),Y,B;B=!1,Y=te(m);switch(Y.level+Y.size){case"AAsmall":case"AAAlarge":B=R>=4.5;break;case"AAlarge":B=R>=3;break;case"AAAsmall":B=R>=7;break}return B},z.mostReadable=function(h,T,m){var R=null,Y=0,B,ne,ke,je;m=m||{},ne=m.includeFallbackColors,ke=m.level,je=m.size;for(var Pe=0;Pe<T.length;Pe++)B=z.readability(h,T[Pe]),B>Y&&(Y=B,R=z(T[Pe]));return z.isReadable(h,R,{level:ke,size:je})||!ne?R:(m.includeFallbackColors=!1,z.mostReadable(h,["#fff","#000"],m))};var ee=z.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},j=z.hexNames=A(ee);function A(h){var T={};for(var m in h)h.hasOwnProperty(m)&&(T[h[m]]=m);return T}function k(h){return h=parseFloat(h),(isNaN(h)||h<0||h>1)&&(h=1),h}function c(h,T){_(h)&&(h="100%");var m=N(h);return h=M(T,D(0,parseFloat(h))),m&&(h=parseInt(h*T,10)/100),ge.abs(h-T)<1e-6?1:h%T/parseFloat(T)}function l(h){return M(1,D(0,h))}function g(h){return parseInt(h,16)}function _(h){return typeof h=="string"&&h.indexOf(".")!=-1&&parseFloat(h)===1}function N(h){return typeof h=="string"&&h.indexOf("%")!=-1}function de(h){return h.length==1?"0"+h:""+h}function _e(h){return h<=1&&(h=h*100+"%"),h}function ae(h){return ge.round(parseFloat(h)*255).toString(16)}function Se(h){return g(h)/255}var ue=function(){var h="[-\\+]?\\d+%?",T="[-\\+]?\\d*\\.\\d+%?",m="(?:"+T+")|(?:"+h+")",R="[\\s|\\(]+("+m+")[,|\\s]+("+m+")[,|\\s]+("+m+")\\s*\\)?",Y="[\\s|\\(]+("+m+")[,|\\s]+("+m+")[,|\\s]+("+m+")[,|\\s]+("+m+")\\s*\\)?";return{CSS_UNIT:new RegExp(m),rgb:new RegExp("rgb"+R),rgba:new RegExp("rgba"+Y),hsl:new RegExp("hsl"+R),hsla:new RegExp("hsla"+Y),hsv:new RegExp("hsv"+R),hsva:new RegExp("hsva"+Y),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ce(h){return!!ue.CSS_UNIT.exec(h)}function H(h){h=h.replace(oe,"").replace(Oe,"").toLowerCase();var T=!1;if(ee[h])h=ee[h],T=!0;else if(h=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var m;return(m=ue.rgb.exec(h))?{r:m[1],g:m[2],b:m[3]}:(m=ue.rgba.exec(h))?{r:m[1],g:m[2],b:m[3],a:m[4]}:(m=ue.hsl.exec(h))?{h:m[1],s:m[2],l:m[3]}:(m=ue.hsla.exec(h))?{h:m[1],s:m[2],l:m[3],a:m[4]}:(m=ue.hsv.exec(h))?{h:m[1],s:m[2],v:m[3]}:(m=ue.hsva.exec(h))?{h:m[1],s:m[2],v:m[3],a:m[4]}:(m=ue.hex8.exec(h))?{r:g(m[1]),g:g(m[2]),b:g(m[3]),a:Se(m[4]),format:T?"name":"hex8"}:(m=ue.hex6.exec(h))?{r:g(m[1]),g:g(m[2]),b:g(m[3]),format:T?"name":"hex"}:(m=ue.hex4.exec(h))?{r:g(m[1]+""+m[1]),g:g(m[2]+""+m[2]),b:g(m[3]+""+m[3]),a:Se(m[4]+""+m[4]),format:T?"name":"hex8"}:(m=ue.hex3.exec(h))?{r:g(m[1]+""+m[1]),g:g(m[2]+""+m[2]),b:g(m[3]+""+m[3]),format:T?"name":"hex"}:!1}function te(h){var T,m;return h=h||{level:"AA",size:"small"},T=(h.level||"AA").toUpperCase(),m=(h.size||"small").toLowerCase(),T!=="AA"&&T!=="AAA"&&(T="AA"),m!=="small"&&m!=="large"&&(m="small"),{level:T,size:m}}bt.exports?bt.exports=z:!(F=function(){return z}.call(Ye,C,Ye,bt),F!==void 0&&(bt.exports=F))})(Math)},bT9E:function(bt,Ye,C){"use strict";C.d(Ye,"a",function(){return ge});var F=C("VTBJ");function ge(oe,Oe){var Ee=Object(F.a)({},oe);return Array.isArray(Oe)&&Oe.forEach(function(G){delete Ee[G]}),Ee}},c5Ni:function(bt,Ye,C){},dejd:function(bt,Ye,C){},dmUQ:function(bt,Ye,C){"use strict";var F=C("Ff2n"),ge=C("rePB"),oe=C("1OyB"),Oe=C("vuIU"),Ee=C("Ji7U"),G=C("md7G"),M=C("foSv"),D=C("q1tI"),S=C.n(D),z=C("TSYQ"),$=C.n(z),re=C("4IlW");function ye(J,y){var Z=Object.keys(J);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(J);y&&(X=X.filter(function(w){return Object.getOwnPropertyDescriptor(J,w).enumerable})),Z.push.apply(Z,X)}return Z}function le(J){for(var y=1;y<arguments.length;y++){var Z=arguments[y]!=null?arguments[y]:{};y%2?ye(Object(Z),!0).forEach(function(X){Object(ge.a)(J,X,Z[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(J,Object.getOwnPropertyDescriptors(Z)):ye(Object(Z)).forEach(function(X){Object.defineProperty(J,X,Object.getOwnPropertyDescriptor(Z,X))})}return J}function W(J){var y=P();return function(){var X=Object(M.a)(J),w;if(y){var ee=Object(M.a)(this).constructor;w=Reflect.construct(X,arguments,ee)}else w=X.apply(this,arguments);return Object(G.a)(this,w)}}function P(){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(J){return!1}}function U(){}function se(J){J.preventDefault()}var ie=function(y){return y.replace(/[^\w.-]+/g,"")},Te=200,We=600,pe=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,be=function(y){return y!=null},Re=function(y,Z){return Z===y||typeof Z=="number"&&typeof y=="number"&&isNaN(Z)&&isNaN(y)},Q=function(J){Object(Ee.a)(Z,J);var y=W(Z);function Z(X){var w;Object(oe.a)(this,Z),w=y.call(this,X),w.onKeyDown=function(A){var k=w.props,c=k.onKeyDown,l=k.onPressEnter;if(A.keyCode===re.a.UP){var g=w.getRatio(A);w.up(A,g,null),w.stop()}else if(A.keyCode===re.a.DOWN){var _=w.getRatio(A);w.down(A,_,null),w.stop()}else A.keyCode===re.a.ENTER&&l&&l(A);if(w.recordCursorPosition(),w.lastKeyCode=A.keyCode,c){for(var N=arguments.length,de=new Array(N>1?N-1:0),_e=1;_e<N;_e++)de[_e-1]=arguments[_e];c.apply(void 0,[A].concat(de))}},w.onKeyUp=function(A){var k=w.props.onKeyUp;if(w.stop(),w.recordCursorPosition(),k){for(var c=arguments.length,l=new Array(c>1?c-1:0),g=1;g<c;g++)l[g-1]=arguments[g];k.apply(void 0,[A].concat(l))}},w.onChange=function(A){var k=w.props.onChange;w.state.focused&&(w.inputting=!0),w.rawInput=w.props.parser(w.getValueFromEvent(A)),w.setState({inputValue:w.rawInput}),k(w.toNumber(w.rawInput))},w.onMouseUp=function(){var A=w.props.onMouseUp;w.recordCursorPosition(),A&&A.apply(void 0,arguments)},w.onFocus=function(){var A;w.setState({focused:!0}),(A=w.props).onFocus.apply(A,arguments)},w.onBlur=function(){var A=w.props.onBlur;w.inputting=!1,w.setState({focused:!1});var k=w.getCurrentValidValue(w.state.inputValue),c=w.setValue(k,U);if(A){var l=w.input.value,g=w.getInputDisplayValue({focus:!1,value:c});w.input.value=g&&Number(g),A.apply(void 0,arguments),w.input.value=l}},w.getRatio=function(A){var k=1;return A.metaKey||A.ctrlKey?k=.1:A.shiftKey&&(k=10),k},w.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},w.getPrecision=function(A){if(be(w.props.precision))return w.props.precision;var k=String(A);if(k.indexOf("e-")>=0)return parseInt(k.slice(k.indexOf("e-")+2),10);var c=0;return k.indexOf(".")>=0&&(c=k.length-k.indexOf(".")-1),c},w.getInputDisplayValue=function(A){var k=A||w.state,c=k.focused,l=k.inputValue,g=k.value,_;c?_=l:_=w.toPrecisionAsStep(g),_==null&&(_="");var N=w.formatWrapper(_);return be(w.props.decimalSeparator)&&(N=N.toString().replace(".",w.props.decimalSeparator)),N},w.recordCursorPosition=function(){try{w.cursorStart=w.input.selectionStart,w.cursorEnd=w.input.selectionEnd,w.currentValue=w.input.value,w.cursorBefore=w.input.value.substring(0,w.cursorStart),w.cursorAfter=w.input.value.substring(w.cursorEnd)}catch(A){}},w.restoreByAfter=function(A){if(A===void 0)return!1;var k=w.input.value,c=k.lastIndexOf(A);if(c===-1)return!1;var l=w.cursorBefore.length;return w.lastKeyCode===re.a.DELETE&&w.cursorBefore.charAt(l-1)===A[0]?(w.fixCaret(l,l),!0):c+A.length===k.length?(w.fixCaret(c,c),!0):!1},w.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(k,c){var l=A.substring(c);return w.restoreByAfter(l)})},w.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},w.stop=function(){w.autoStepTimer&&clearTimeout(w.autoStepTimer)},w.down=function(A,k,c){w.pressingUpOrDown=!0,w.step("down",A,k,c)},w.up=function(A,k,c){w.pressingUpOrDown=!0,w.step("up",A,k,c)},w.saveInput=function(A){w.input=A};var ee=X.value;ee===void 0&&(ee=X.defaultValue),w.state={focused:X.autoFocus};var j=w.getValidValue(w.toNumber(ee));return w.state=le(le({},w.state),{},{inputValue:w.toPrecisionAsStep(j),value:j}),w}return Object(Oe.a)(Z,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(w){var ee=this.props,j=ee.value,A=ee.onChange,k=ee.max,c=ee.min,l=this.state.focused;if(w){if(!Re(w.value,j)||!Re(w.max,k)||!Re(w.min,c)){var g=l?j:this.getValidValue(j),_;this.pressingUpOrDown?_=g:this.inputting?_=this.rawInput:_=this.toPrecisionAsStep(g),this.setState({value:g,inputValue:_})}var N="value"in this.props?j:this.state.value;"max"in this.props&&w.max!==k&&typeof N=="number"&&N>k&&A&&A(k),"min"in this.props&&w.min!==c&&typeof N=="number"&&N<c&&A&&A(c)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var de=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===re.a.BACKSPACE?de=this.cursorStart-1:this.lastKeyCode===re.a.DELETE&&(de=this.cursorStart):de=this.input.value.length,this.fixCaret(de,de)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case re.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case re.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(_e){}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(w){var ee=w;return ee===""?ee="":this.isNotCompleteNumber(parseFloat(ee))?ee=this.state.value:ee=this.getValidValue(ee),this.toNumber(ee)}},{key:"getValueFromEvent",value:function(w){var ee=w.target.value.trim().replace(/。/g,".");return be(this.props.decimalSeparator)&&(ee=ee.replace(this.props.decimalSeparator,".")),ee}},{key:"getValidValue",value:function(w){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(w);return isNaN(A)?w:(A<ee&&(A=ee),A>j&&(A=j),A)}},{key:"setValue",value:function(w,ee){var j=this.props.precision,A=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),k=this.state.value,c=k===void 0?null:k,l=this.state.inputValue,g=l===void 0?null:l,_=typeof A=="number"?A.toFixed(j):"".concat(A),N=A!==c||_!=="".concat(g);return"value"in this.props?(g=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:g},ee)):this.setState({value:A,inputValue:this.toPrecisionAsStep(w)},ee),N&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(w){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,A=j.precision,k=j.step;if(be(A))return A;var c=this.getPrecision(ee),l=this.getPrecision(k),g=this.getPrecision(w);return w?Math.max(g,c+l):c+l}},{key:"getPrecisionFactor",value:function(w){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(w,ee);return Math.pow(10,j)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(w){return this.props.formatter?this.props.formatter(w):w}},{key:"toPrecisionAsStep",value:function(w){if(this.isNotCompleteNumber(w)||w==="")return w;var ee=Math.abs(this.getMaxPrecision(w));return isNaN(ee)?w.toString():Number(w).toFixed(ee)}},{key:"toNumber",value:function(w){var ee=this.props.precision,j=this.state.focused,A=w&&w.length>16&&j;return this.isNotCompleteNumber(w)||A?w:be(ee)?Math.round(w*Math.pow(10,ee))/Math.pow(10,ee):Number(w)}},{key:"upStep",value:function(w,ee){var j=this.props.step,A=this.getPrecisionFactor(w,ee),k=Math.abs(this.getMaxPrecision(w,ee)),c=((A*w+A*j*ee)/A).toFixed(k);return this.toNumber(c)}},{key:"downStep",value:function(w,ee){var j=this.props.step,A=this.getPrecisionFactor(w,ee),k=Math.abs(this.getMaxPrecision(w,ee)),c=((A*w-A*j*ee)/A).toFixed(k);return this.toNumber(c)}},{key:"step",value:function(w,ee){var j=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=arguments.length>3?arguments[3]:void 0;this.stop(),ee&&(ee.persist(),ee.preventDefault());var c=this.props;if(c.disabled)return;var l=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(l))return;var g=this["".concat(w,"Step")](l,A),_=g>c.max||g<c.min;if(g>c.max?g=c.max:g<c.min&&(g=c.min),this.setValue(g,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),_)return;this.autoStepTimer=setTimeout(function(){j[w](ee,A,!0)},k?Te:We)}},{key:"fixCaret",value:function(w,ee){if(w===void 0||ee===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,A=this.input.selectionEnd;(w!==j||ee!==A)&&this.input.setSelectionRange(w,ee)}catch(k){}}},{key:"render",value:function(){var w,ee=this.props,j=ee.prefixCls,A=ee.disabled,k=ee.readOnly,c=ee.useTouch,l=ee.autoComplete,g=ee.upHandler,_=ee.downHandler,N=ee.className,de=ee.max,_e=ee.min,ae=ee.style,Se=ee.title,ue=ee.onMouseEnter,ce=ee.onMouseLeave,H=ee.onMouseOver,te=ee.onMouseOut,h=ee.required,T=ee.onClick,m=ee.tabIndex,R=ee.type,Y=ee.placeholder,B=ee.id,ne=ee.inputMode,ke=ee.pattern,je=ee.step,Pe=ee.maxLength,we=ee.autoFocus,Me=ee.name,Ge=ee.onPaste,Ve=ee.onInput,Ke=Object(F.a)(ee,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),qe=this.state,ht=qe.value,nt=qe.focused,Xe=$()(j,(w={},Object(ge.a)(w,N,!!N),Object(ge.a)(w,"".concat(j,"-disabled"),A),Object(ge.a)(w,"".concat(j,"-focused"),nt),w)),ve={};Object.keys(Ke).forEach(function(b){(b.substr(0,5)==="data-"||b.substr(0,5)==="aria-"||b==="role")&&(ve[b]=Ke[b])});var at=!k&&!A,Je=this.getInputDisplayValue(null),Ce=(ht||ht===0)&&(isNaN(ht)||Number(ht)>=de),Ie=(ht||ht===0)&&(isNaN(ht)||Number(ht)<=_e),I=Ce||A||k,L=Ie||A||k,x=$()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(ge.a)({},"".concat(j,"-handler-up-disabled"),I)),f=$()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(ge.a)({},"".concat(j,"-handler-down-disabled"),L)),p=c?{onTouchStart:I?U:this.up,onTouchEnd:this.stop}:{onMouseDown:I?U:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},v=c?{onTouchStart:L?U:this.down,onTouchEnd:this.stop}:{onMouseDown:L?U:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return S.a.createElement("div",{className:Xe,style:ae,title:Se,onMouseEnter:ue,onMouseLeave:ce,onMouseOver:H,onMouseOut:te,onFocus:function(){return null},onBlur:function(){return null}},S.a.createElement("div",{className:"".concat(j,"-handler-wrap")},S.a.createElement("span",Object.assign({unselectable:"on"},p,{role:"button","aria-label":"Increase Value","aria-disabled":I,className:x}),g||S.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:se})),S.a.createElement("span",Object.assign({unselectable:"on"},v,{role:"button","aria-label":"Decrease Value","aria-disabled":L,className:f}),_||S.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:se}))),S.a.createElement("div",{className:"".concat(j,"-input-wrap")},S.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":_e,"aria-valuemax":de,"aria-valuenow":ht,required:h,type:R,placeholder:Y,onPaste:Ge,onClick:T,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:m,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:at?this.onKeyDown:U,onKeyUp:at?this.onKeyUp:U,autoFocus:we,maxLength:Pe,readOnly:k,disabled:A,max:de,min:_e,step:je,name:Me,title:Se,id:B,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Je),pattern:ke,inputMode:ne,onInput:Ve},ve))))}}]),Z}(S.a.Component);Q.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:pe,min:-pe,step:1,style:{},onChange:U,onKeyDown:U,onPressEnter:U,onFocus:U,onBlur:U,parser:ie,required:!1,autoComplete:"off"};var me=Q,Ae=Ye.a=me},h78n:function(bt,Ye,C){"use strict";C.d(Ye,"a",function(){return w});var F=C("q1tI"),ge=C.n(F),oe=C("TSYQ"),Oe=C.n(oe),Ee={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},G=function(A){var k=A.map(function(){return Object(F.useRef)()}),c=Object(F.useRef)();return Object(F.useEffect)(function(){var l=Date.now(),g=!1;Object.keys(k).forEach(function(_){var N=k[_].current;if(!N)return;g=!0;var de=N.style;de.transitionDuration=".3s, .3s, .3s, .06s",c.current&&l-c.current<100&&(de.transitionDuration="0s, 0s")}),g&&(c.current=Date.now())}),[k]};function M(){return M=Object.assign||function(j){for(var A=1;A<arguments.length;A++){var k=arguments[A];for(var c in k)Object.prototype.hasOwnProperty.call(k,c)&&(j[c]=k[c])}return j},M.apply(this,arguments)}function D(j,A){return ye(j)||re(j,A)||z(j,A)||S()}function S(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z(j,A){if(!j)return;if(typeof j=="string")return $(j,A);var k=Object.prototype.toString.call(j).slice(8,-1);if(k==="Object"&&j.constructor&&(k=j.constructor.name),k==="Map"||k==="Set")return Array.from(j);if(k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k))return $(j,A)}function $(j,A){(A==null||A>j.length)&&(A=j.length);for(var k=0,c=new Array(A);k<A;k++)c[k]=j[k];return c}function re(j,A){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var k=[],c=!0,l=!1,g=void 0;try{for(var _=j[Symbol.iterator](),N;!(c=(N=_.next()).done)&&!(k.push(N.value),A&&k.length===A);c=!0);}catch(de){l=!0,g=de}finally{try{!c&&_.return!=null&&_.return()}finally{if(l)throw g}}return k}function ye(j){if(Array.isArray(j))return j}function le(j,A){if(j==null)return{};var k=W(j,A),c,l;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(j);for(l=0;l<g.length;l++){if(c=g[l],A.indexOf(c)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,c))continue;k[c]=j[c]}}return k}function W(j,A){if(j==null)return{};var k={},c=Object.keys(j),l,g;for(g=0;g<c.length;g++){if(l=c[g],A.indexOf(l)>=0)continue;k[l]=j[l]}return k}var P=function(A){var k=A.className,c=A.percent,l=A.prefixCls,g=A.strokeColor,_=A.strokeLinecap,N=A.strokeWidth,de=A.style,_e=A.trailColor,ae=A.trailWidth,Se=A.transition,ue=le(A,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ue.gapPosition;var ce=Array.isArray(c)?c:[c],H=Array.isArray(g)?g:[g],te=G(ce),h=D(te,1),T=h[0],m=N/2,R=100-N/2,Y="M ".concat(_==="round"?m:0,",").concat(m,`
|
|
L `).concat(_==="round"?R:100,",").concat(m),B="0 0 100 ".concat(N),ne=0;return ge.a.createElement("svg",M({className:Oe()("".concat(l,"-line"),k),viewBox:B,preserveAspectRatio:"none",style:de},ue),ge.a.createElement("path",{className:"".concat(l,"-line-trail"),d:Y,strokeLinecap:_,stroke:_e,strokeWidth:ae||N,fillOpacity:"0"}),ce.map(function(ke,je){var Pe={strokeDasharray:"".concat(ke,"px, 100px"),strokeDashoffset:"-".concat(ne,"px"),transition:Se||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},we=H[je]||H[H.length-1];return ne+=ke,ge.a.createElement("path",{key:je,className:"".concat(l,"-line-path"),d:Y,strokeLinecap:_,stroke:we,strokeWidth:N,fillOpacity:"0",ref:T[je],style:Pe})}))};P.defaultProps=Ee;var U=P;function se(){return se=Object.assign||function(j){for(var A=1;A<arguments.length;A++){var k=arguments[A];for(var c in k)Object.prototype.hasOwnProperty.call(k,c)&&(j[c]=k[c])}return j},se.apply(this,arguments)}function ie(j,A){return Re(j)||be(j,A)||We(j,A)||Te()}function Te(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function We(j,A){if(!j)return;if(typeof j=="string")return pe(j,A);var k=Object.prototype.toString.call(j).slice(8,-1);if(k==="Object"&&j.constructor&&(k=j.constructor.name),k==="Map"||k==="Set")return Array.from(j);if(k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k))return pe(j,A)}function pe(j,A){(A==null||A>j.length)&&(A=j.length);for(var k=0,c=new Array(A);k<A;k++)c[k]=j[k];return c}function be(j,A){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var k=[],c=!0,l=!1,g=void 0;try{for(var _=j[Symbol.iterator](),N;!(c=(N=_.next()).done)&&!(k.push(N.value),A&&k.length===A);c=!0);}catch(de){l=!0,g=de}finally{try{!c&&_.return!=null&&_.return()}finally{if(l)throw g}}return k}function Re(j){if(Array.isArray(j))return j}function Q(j,A){if(j==null)return{};var k=me(j,A),c,l;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(j);for(l=0;l<g.length;l++){if(c=g[l],A.indexOf(c)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,c))continue;k[c]=j[c]}}return k}function me(j,A){if(j==null)return{};var k={},c=Object.keys(j),l,g;for(g=0;g<c.length;g++){if(l=c[g],A.indexOf(l)>=0)continue;k[l]=j[l]}return k}var Ae=0;function J(j){return+j.replace("%","")}function y(j){return Array.isArray(j)?j:[j]}function Z(j,A,k,c){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,g=arguments.length>5?arguments[5]:void 0,_=50-c/2,N=0,de=-_,_e=0,ae=-2*_;switch(g){case"left":N=-_,de=0,_e=2*_,ae=0;break;case"right":N=_,de=0,_e=-2*_,ae=0;break;case"bottom":de=_,ae=2*_;break;default:}var Se="M 50,50 m ".concat(N,",").concat(de,`
|
|
a `).concat(_,",").concat(_," 0 1 1 ").concat(_e,",").concat(-ae,`
|
|
a `).concat(_,",").concat(_," 0 1 1 ").concat(-_e,",").concat(ae),ue=Math.PI*2*_,ce={stroke:k,strokeDasharray:"".concat(A/100*(ue-l),"px ").concat(ue,"px"),strokeDashoffset:"-".concat(l/2+j/100*(ue-l),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Se,pathStyle:ce}}var X=function(A){var k=A.prefixCls,c=A.strokeWidth,l=A.trailWidth,g=A.gapDegree,_=A.gapPosition,N=A.trailColor,de=A.strokeLinecap,_e=A.style,ae=A.className,Se=A.strokeColor,ue=A.percent,ce=Q(A,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),H=Object(F.useMemo)(function(){return Ae+=1,Ae},[]),te=Z(0,100,N,c,g,_),h=te.pathString,T=te.pathStyle,m=y(ue),R=y(Se),Y=R.find(function(Pe){return Object.prototype.toString.call(Pe)==="[object Object]"}),B=G(m),ne=ie(B,1),ke=ne[0],je=function(){var we=0;return m.map(function(Me,Ge){var Ve=R[Ge]||R[R.length-1],Ke=Object.prototype.toString.call(Ve)==="[object Object]"?"url(#".concat(k,"-gradient-").concat(H,")"):"",qe=Z(we,Me,Ve,c,g,_);return we+=Me,ge.a.createElement("path",{key:Ge,className:"".concat(k,"-circle-path"),d:qe.pathString,stroke:Ke,strokeLinecap:de,strokeWidth:c,opacity:Me===0?0:1,fillOpacity:"0",style:qe.pathStyle,ref:ke[Ge]})})};return ge.a.createElement("svg",se({className:Oe()("".concat(k,"-circle"),ae),viewBox:"0 0 100 100",style:_e},ce),Y&&ge.a.createElement("defs",null,ge.a.createElement("linearGradient",{id:"".concat(k,"-gradient-").concat(H),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Y).sort(function(Pe,we){return J(Pe)-J(we)}).map(function(Pe,we){return ge.a.createElement("stop",{key:we,offset:Pe,stopColor:Y[Pe]})}))),ge.a.createElement("path",{className:"".concat(k,"-circle-trail"),d:h,stroke:N,strokeLinecap:de,strokeWidth:l||c,fillOpacity:"0",style:T}),je().reverse())};X.defaultProps=Ee;var w=X,ee={Line:U,Circle:w}},kSUc:function(bt,Ye,C){},lZu9:function(bt,Ye,C){(function(F){F(C("VrN/"),C("1eCo"),C("8EBN"))})(function(F){"use strict";F.defineMode("markdown",function(ge,oe){var Oe=F.getMode(ge,"text/html"),Ee=Oe.name=="null";function G(c){if(F.findModeByName){var l=F.findModeByName(c);l&&(c=l.mime||l.mimes[0])}var g=F.getMode(ge,c);return g.name=="null"?null:g}oe.highlightFormatting===void 0&&(oe.highlightFormatting=!1),oe.maxBlockquoteDepth===void 0&&(oe.maxBlockquoteDepth=0),oe.taskLists===void 0&&(oe.taskLists=!1),oe.strikethrough===void 0&&(oe.strikethrough=!1),oe.emoji===void 0&&(oe.emoji=!1),oe.fencedCodeBlockHighlighting===void 0&&(oe.fencedCodeBlockHighlighting=!0),oe.fencedCodeBlockDefaultMode===void 0&&(oe.fencedCodeBlockDefaultMode="text/plain"),oe.xml===void 0&&(oe.xml=!0),oe.tokenTypeOverrides===void 0&&(oe.tokenTypeOverrides={});var M={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 D in M)M.hasOwnProperty(D)&&oe.tokenTypeOverrides[D]&&(M[D]=oe.tokenTypeOverrides[D]);var S=/^([*\-_])(?:\s*\1){2,}\s*$/,z=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,$=/^\[(x| )\](?=\s)/i,re=oe.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ye=/^ {0,3}(?:\={1,}|-{2,})\s*$/,le=/^[^#!\[\]*_\\<>` "'(~:]+/,W=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,P=/^\s*\[[^\]]+?\]:.*$/,U=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,se=" ";function ie(c,l,g){return l.f=l.inline=g,g(c,l)}function Te(c,l,g){return l.f=l.block=g,g(c,l)}function We(c){return!c||!/\S/.test(c.string)}function pe(c){if(c.linkTitle=!1,c.linkHref=!1,c.linkText=!1,c.em=!1,c.strong=!1,c.strikethrough=!1,c.quote=0,c.indentedCode=!1,c.f==Re){var l=Ee;if(!l){var g=F.innerMode(Oe,c.htmlState);l=g.mode.name=="xml"&&g.state.tagStart===null&&!g.state.context&&g.state.tokenize.isInText}l&&(c.f=J,c.block=be,c.htmlState=null)}return c.trailingSpace=0,c.trailingSpaceNewLine=!1,c.prevLine=c.thisLine,c.thisLine={stream:null},null}function be(c,l){var g=c.column()===l.indentation,_=We(l.prevLine.stream),N=l.indentedCode,de=l.prevLine.hr,_e=l.list!==!1,ae=(l.listStack[l.listStack.length-1]||0)+3;l.indentedCode=!1;var Se=l.indentation;if(l.indentationDiff===null&&(l.indentationDiff=l.indentation,_e)){for(l.list=null;Se<l.listStack[l.listStack.length-1];)l.listStack.pop(),l.listStack.length?l.indentation=l.listStack[l.listStack.length-1]:l.list=!1;l.list!==!1&&(l.indentationDiff=Se-l.listStack[l.listStack.length-1])}var ue=!_&&!de&&!l.prevLine.header&&(!_e||!N)&&!l.prevLine.fencedCodeEnd,ce=(l.list===!1||de||_)&&l.indentation<=ae&&c.match(S),H=null;if(l.indentationDiff>=4&&(N||l.prevLine.fencedCodeEnd||l.prevLine.header||_))return c.skipToEnd(),l.indentedCode=!0,M.code;if(c.eatSpace())return null;if(g&&l.indentation<=ae&&(H=c.match(re))&&H[1].length<=6)return l.quote=0,l.header=H[1].length,l.thisLine.header=!0,oe.highlightFormatting&&(l.formatting="header"),l.f=l.inline,me(l);if(l.indentation<=ae&&c.eat(">"))return l.quote=g?1:l.quote+1,oe.highlightFormatting&&(l.formatting="quote"),c.eatSpace(),me(l);if(!ce&&!l.setext&&g&&l.indentation<=ae&&(H=c.match(z))){var te=H[1]?"ol":"ul";return l.indentation=Se+c.current().length,l.list=!0,l.quote=0,l.listStack.push(l.indentation),l.em=!1,l.strong=!1,l.code=!1,l.strikethrough=!1,oe.taskLists&&c.match($,!1)&&(l.taskList=!0),l.f=l.inline,oe.highlightFormatting&&(l.formatting=["list","list-"+te]),me(l)}else{if(g&&l.indentation<=ae&&(H=c.match(W,!0)))return l.quote=0,l.fencedEndRE=new RegExp(H[1]+"+ *$"),l.localMode=oe.fencedCodeBlockHighlighting&&G(H[2]||oe.fencedCodeBlockDefaultMode),l.localMode&&(l.localState=F.startState(l.localMode)),l.f=l.block=Q,oe.highlightFormatting&&(l.formatting="code-block"),l.code=-1,me(l);if(l.setext||(!ue||!_e)&&!l.quote&&l.list===!1&&!l.code&&!ce&&!P.test(c.string)&&(H=c.lookAhead(1))&&(H=H.match(ye)))return l.setext?(l.header=l.setext,l.setext=0,c.skipToEnd(),oe.highlightFormatting&&(l.formatting="header")):(l.header=H[0].charAt(0)=="="?1:2,l.setext=l.header),l.thisLine.header=!0,l.f=l.inline,me(l);if(ce)return c.skipToEnd(),l.hr=!0,l.thisLine.hr=!0,M.hr;if(c.peek()==="[")return ie(c,l,ee)}return ie(c,l,l.inline)}function Re(c,l){var g=Oe.token(c,l.htmlState);if(!Ee){var _=F.innerMode(Oe,l.htmlState);(_.mode.name=="xml"&&_.state.tagStart===null&&!_.state.context&&_.state.tokenize.isInText||l.md_inside&&c.current().indexOf(">")>-1)&&(l.f=J,l.block=be,l.htmlState=null)}return g}function Q(c,l){var g=l.listStack[l.listStack.length-1]||0,_=l.indentation<g,N=g+3;if(l.fencedEndRE&&l.indentation<=N&&(_||c.match(l.fencedEndRE))){oe.highlightFormatting&&(l.formatting="code-block");var de;return _||(de=me(l)),l.localMode=l.localState=null,l.block=be,l.f=J,l.fencedEndRE=null,l.code=0,l.thisLine.fencedCodeEnd=!0,_?Te(c,l,l.block):de}else return l.localMode?l.localMode.token(c,l.localState):(c.skipToEnd(),M.code)}function me(c){var l=[];if(c.formatting){l.push(M.formatting),typeof c.formatting=="string"&&(c.formatting=[c.formatting]);for(var g=0;g<c.formatting.length;g++)l.push(M.formatting+"-"+c.formatting[g]),c.formatting[g]==="header"&&l.push(M.formatting+"-"+c.formatting[g]+"-"+c.header),c.formatting[g]==="quote"&&(!oe.maxBlockquoteDepth||oe.maxBlockquoteDepth>=c.quote?l.push(M.formatting+"-"+c.formatting[g]+"-"+c.quote):l.push("error"))}if(c.taskOpen)return l.push("meta"),l.length?l.join(" "):null;if(c.taskClosed)return l.push("property"),l.length?l.join(" "):null;if(c.linkHref?l.push(M.linkHref,"url"):(c.strong&&l.push(M.strong),c.em&&l.push(M.em),c.strikethrough&&l.push(M.strikethrough),c.emoji&&l.push(M.emoji),c.linkText&&l.push(M.linkText),c.code&&l.push(M.code),c.image&&l.push(M.image),c.imageAltText&&l.push(M.imageAltText,"link"),c.imageMarker&&l.push(M.imageMarker)),c.header&&l.push(M.header,M.header+"-"+c.header),c.quote&&(l.push(M.quote),!oe.maxBlockquoteDepth||oe.maxBlockquoteDepth>=c.quote?l.push(M.quote+"-"+c.quote):l.push(M.quote+"-"+oe.maxBlockquoteDepth)),c.list!==!1){var _=(c.listStack.length-1)%3;_?_===1?l.push(M.list2):l.push(M.list3):l.push(M.list1)}return c.trailingSpaceNewLine?l.push("trailing-space-new-line"):c.trailingSpace&&l.push("trailing-space-"+(c.trailingSpace%2?"a":"b")),l.length?l.join(" "):null}function Ae(c,l){return c.match(le,!0)?me(l):void 0}function J(c,l){var g=l.text(c,l);if(typeof g!="undefined")return g;if(l.list)return l.list=null,me(l);if(l.taskList){var _=c.match($,!0)[1]===" ";return _?l.taskOpen=!0:l.taskClosed=!0,oe.highlightFormatting&&(l.formatting="task"),l.taskList=!1,me(l)}if(l.taskOpen=!1,l.taskClosed=!1,l.header&&c.match(/^#+$/,!0))return oe.highlightFormatting&&(l.formatting="header"),me(l);var N=c.next();if(l.linkTitle){l.linkTitle=!1;var de=N;N==="("&&(de=")"),de=(de+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var _e="^\\s*(?:[^"+de+"\\\\]+|\\\\\\\\|\\\\.)"+de;if(c.match(new RegExp(_e),!0))return M.linkHref}if(N==="`"){var ae=l.formatting;oe.highlightFormatting&&(l.formatting="code"),c.eatWhile("`");var Se=c.current().length;if(l.code==0&&(!l.quote||Se==1))return l.code=Se,me(l);if(Se==l.code){var ue=me(l);return l.code=0,ue}else return l.formatting=ae,me(l)}else if(l.code)return me(l);if(N==="\\"&&(c.next(),oe.highlightFormatting)){var ce=me(l),H=M.formatting+"-escape";return ce?ce+" "+H:H}if(N==="!"&&c.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return l.imageMarker=!0,l.image=!0,oe.highlightFormatting&&(l.formatting="image"),me(l);if(N==="["&&l.imageMarker&&c.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return l.imageMarker=!1,l.imageAltText=!0,oe.highlightFormatting&&(l.formatting="image"),me(l);if(N==="]"&&l.imageAltText){oe.highlightFormatting&&(l.formatting="image");var ce=me(l);return l.imageAltText=!1,l.image=!1,l.inline=l.f=Z,ce}if(N==="["&&!l.image)return l.linkText&&c.match(/^.*?\]/)||(l.linkText=!0,oe.highlightFormatting&&(l.formatting="link")),me(l);if(N==="]"&&l.linkText){oe.highlightFormatting&&(l.formatting="link");var ce=me(l);return l.linkText=!1,l.inline=l.f=c.match(/\(.*?\)| ?\[.*?\]/,!1)?Z:J,ce}if(N==="<"&&c.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){l.f=l.inline=y,oe.highlightFormatting&&(l.formatting="link");var ce=me(l);return ce?ce+=" ":ce="",ce+M.linkInline}if(N==="<"&&c.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){l.f=l.inline=y,oe.highlightFormatting&&(l.formatting="link");var ce=me(l);return ce?ce+=" ":ce="",ce+M.linkEmail}if(oe.xml&&N==="<"&&c.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var te=c.string.indexOf(">",c.pos);if(te!=-1){var h=c.string.substring(c.start,te);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(h)&&(l.md_inside=!0)}return c.backUp(1),l.htmlState=F.startState(Oe),Te(c,l,Re)}if(oe.xml&&N==="<"&&c.match(/^\/\w*?>/))return l.md_inside=!1,"tag";if(N==="*"||N==="_"){for(var T=1,m=c.pos==1?" ":c.string.charAt(c.pos-2);T<3&&c.eat(N);)T++;var R=c.peek()||" ",Y=!/\s/.test(R)&&(!U.test(R)||/\s/.test(m)||U.test(m)),B=!/\s/.test(m)&&(!U.test(m)||/\s/.test(R)||U.test(R)),ne=null,ke=null;if(T%2&&(!l.em&&Y&&(N==="*"||!B||U.test(m))?ne=!0:l.em==N&&B&&(N==="*"||!Y||U.test(R))&&(ne=!1)),T>1&&(!l.strong&&Y&&(N==="*"||!B||U.test(m))?ke=!0:l.strong==N&&B&&(N==="*"||!Y||U.test(R))&&(ke=!1)),ke!=null||ne!=null){oe.highlightFormatting&&(l.formatting=ne==null?"strong":ke==null?"em":"strong em"),ne===!0&&(l.em=N),ke===!0&&(l.strong=N);var ue=me(l);return ne===!1&&(l.em=!1),ke===!1&&(l.strong=!1),ue}}else if(N===" "&&(c.eat("*")||c.eat("_"))){if(c.peek()===" ")return me(l);c.backUp(1)}if(oe.strikethrough){if(N==="~"&&c.eatWhile(N)){if(l.strikethrough){oe.highlightFormatting&&(l.formatting="strikethrough");var ue=me(l);return l.strikethrough=!1,ue}else if(c.match(/^[^\s]/,!1))return l.strikethrough=!0,oe.highlightFormatting&&(l.formatting="strikethrough"),me(l)}else if(N===" "&&c.match(/^~~/,!0)){if(c.peek()===" ")return me(l);c.backUp(2)}}if(oe.emoji&&N===":"&&c.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){l.emoji=!0,oe.highlightFormatting&&(l.formatting="emoji");var je=me(l);return l.emoji=!1,je}return N===" "&&(c.match(/^ +$/,!1)?l.trailingSpace++:l.trailingSpace&&(l.trailingSpaceNewLine=!0)),me(l)}function y(c,l){var g=c.next();if(g===">"){l.f=l.inline=J,oe.highlightFormatting&&(l.formatting="link");var _=me(l);return _?_+=" ":_="",_+M.linkInline}return c.match(/^[^>]+/,!0),M.linkInline}function Z(c,l){if(c.eatSpace())return null;var g=c.next();return g==="("||g==="["?(l.f=l.inline=w(g==="("?")":"]"),oe.highlightFormatting&&(l.formatting="link-string"),l.linkHref=!0,me(l)):"error"}var X={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(c){return function(l,g){var _=l.next();if(_===c){g.f=g.inline=J,oe.highlightFormatting&&(g.formatting="link-string");var N=me(g);return g.linkHref=!1,N}return l.match(X[c]),g.linkHref=!0,me(g)}}function ee(c,l){return c.match(/^([^\]\\]|\\.)*\]:/,!1)?(l.f=j,c.next(),oe.highlightFormatting&&(l.formatting="link"),l.linkText=!0,me(l)):ie(c,l,J)}function j(c,l){if(c.match(/^\]:/,!0)){l.f=l.inline=A,oe.highlightFormatting&&(l.formatting="link");var g=me(l);return l.linkText=!1,g}return c.match(/^([^\]\\]|\\.)+/,!0),M.linkText}function A(c,l){return c.eatSpace()?null:(c.match(/^[^\s]+/,!0),c.peek()===void 0?l.linkTitle=!0:c.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),l.f=l.inline=J,M.linkHref+" url")}var k={startState:function(){return{f:be,prevLine:{stream:null},thisLine:{stream:null},block:be,htmlState:null,indentation:0,inline:J,text:Ae,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(c){return{f:c.f,prevLine:c.prevLine,thisLine:c.thisLine,block:c.block,htmlState:c.htmlState&&F.copyState(Oe,c.htmlState),indentation:c.indentation,localMode:c.localMode,localState:c.localMode?F.copyState(c.localMode,c.localState):null,inline:c.inline,text:c.text,formatting:!1,linkText:c.linkText,linkTitle:c.linkTitle,linkHref:c.linkHref,code:c.code,em:c.em,strong:c.strong,strikethrough:c.strikethrough,emoji:c.emoji,header:c.header,setext:c.setext,hr:c.hr,taskList:c.taskList,list:c.list,listStack:c.listStack.slice(0),quote:c.quote,indentedCode:c.indentedCode,trailingSpace:c.trailingSpace,trailingSpaceNewLine:c.trailingSpaceNewLine,md_inside:c.md_inside,fencedEndRE:c.fencedEndRE}},token:function(c,l){if(l.formatting=!1,c!=l.thisLine.stream){if(l.header=0,l.hr=!1,c.match(/^\s*$/,!0))return pe(l),null;if(l.prevLine=l.thisLine,l.thisLine={stream:c},l.taskList=!1,l.trailingSpace=0,l.trailingSpaceNewLine=!1,!l.localState&&(l.f=l.block,l.f!=Re)){var g=c.match(/^\s*/,!0)[0].replace(/\t/g,se).length;if(l.indentation=g,l.indentationDiff=null,g>0)return null}}return l.f(c,l)},innerMode:function(c){return c.block==Re?{state:c.htmlState,mode:Oe}:c.localState?{state:c.localState,mode:c.localMode}:{state:c,mode:k}},indent:function(c,l,g){return c.block==Re&&Oe.indent?Oe.indent(c.htmlState,l,g):c.localState&&c.localMode.indent?c.localMode.indent(c.localState,l,g):F.Pass},blankLine:pe,getType:me,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return k},"xml"),F.defineMIME("text/markdown","markdown"),F.defineMIME("text/x-markdown","markdown")})},osHv:function(bt,Ye,C){(function(F){F(C("VrN/"))})(function(F){"use strict";var ge=F.Pos;function oe(U,se){return U.line-se.line||U.ch-se.ch}var Oe="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",Ee=Oe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",G=new RegExp("<(/?)(["+Oe+"]["+Ee+"]*)","g");function M(U,se,ie,Te){this.line=se,this.ch=ie,this.cm=U,this.text=U.getLine(se),this.min=Te?Math.max(Te.from,U.firstLine()):U.firstLine(),this.max=Te?Math.min(Te.to-1,U.lastLine()):U.lastLine()}function D(U,se){var ie=U.cm.getTokenTypeAt(ge(U.line,se));return ie&&/\btag\b/.test(ie)}function S(U){return U.line>=U.max?void 0:(U.ch=0,U.text=U.cm.getLine(++U.line),!0)}function z(U){return U.line<=U.min?void 0:(U.text=U.cm.getLine(--U.line),U.ch=U.text.length,!0)}function $(U){for(;;){var se=U.text.indexOf(">",U.ch);if(se==-1){if(S(U))continue;return}if(!D(U,se+1)){U.ch=se+1;continue}var ie=U.text.lastIndexOf("/",se),Te=ie>-1&&!/\S/.test(U.text.slice(ie+1,se));return U.ch=se+1,Te?"selfClose":"regular"}}function re(U){for(;;){var se=U.ch?U.text.lastIndexOf("<",U.ch-1):-1;if(se==-1){if(z(U))continue;return}if(!D(U,se+1)){U.ch=se;continue}G.lastIndex=se,U.ch=se;var ie=G.exec(U.text);if(ie&&ie.index==se)return ie}}function ye(U){for(;;){G.lastIndex=U.ch;var se=G.exec(U.text);if(!se){if(S(U))continue;return}if(!D(U,se.index+1)){U.ch=se.index+1;continue}return U.ch=se.index+se[0].length,se}}function le(U){for(;;){var se=U.ch?U.text.lastIndexOf(">",U.ch-1):-1;if(se==-1){if(z(U))continue;return}if(!D(U,se+1)){U.ch=se;continue}var ie=U.text.lastIndexOf("/",se),Te=ie>-1&&!/\S/.test(U.text.slice(ie+1,se));return U.ch=se+1,Te?"selfClose":"regular"}}function W(U,se){for(var ie=[];;){var Te=ye(U),We,pe=U.line,be=U.ch-(Te?Te[0].length:0);if(!Te||!(We=$(U)))return;if(We=="selfClose")continue;if(Te[1]){for(var Re=ie.length-1;Re>=0;--Re)if(ie[Re]==Te[2]){ie.length=Re;break}if(Re<0&&(!se||se==Te[2]))return{tag:Te[2],from:ge(pe,be),to:ge(U.line,U.ch)}}else ie.push(Te[2])}}function P(U,se){for(var ie=[];;){var Te=le(U);if(!Te)return;if(Te=="selfClose"){re(U);continue}var We=U.line,pe=U.ch,be=re(U);if(!be)return;if(be[1])ie.push(be[2]);else{for(var Re=ie.length-1;Re>=0;--Re)if(ie[Re]==be[2]){ie.length=Re;break}if(Re<0&&(!se||se==be[2]))return{tag:be[2],from:ge(U.line,U.ch),to:ge(We,pe)}}}}F.registerHelper("fold","xml",function(U,se){for(var ie=new M(U,se.line,0);;){var Te=ye(ie);if(!Te||ie.line!=se.line)return;var We=$(ie);if(!We)return;if(!Te[1]&&We!="selfClose"){var pe=ge(ie.line,ie.ch),be=W(ie,Te[2]);return be&&oe(be.from,pe)>0?{from:pe,to:be.from}:null}}}),F.findMatchingTag=function(U,se,ie){var Te=new M(U,se.line,se.ch,ie);if(Te.text.indexOf(">")==-1&&Te.text.indexOf("<")==-1)return;var We=$(Te),pe=We&&ge(Te.line,Te.ch),be=We&&re(Te);if(!We||!be||oe(Te,se)>0)return;var Re={from:ge(Te.line,Te.ch),to:pe,tag:be[2]};return We=="selfClose"?{open:Re,close:null,at:"open"}:be[1]?{open:P(Te,be[2]),close:Re,at:"close"}:(Te=new M(U,pe.line,pe.ch,ie),{open:Re,close:W(Te,be[2]),at:"open"})},F.findEnclosingTag=function(U,se,ie,Te){for(var We=new M(U,se.line,se.ch,ie);;){var pe=P(We,Te);if(!pe)break;var be=new M(U,se.line,se.ch,ie),Re=W(be,pe.tag);if(Re)return{open:pe,close:Re}}},F.scanForClosingTag=function(U,se,ie,Te){var We=new M(U,se.line,se.ch,Te?{from:0,to:Te}:null);return W(We,ie)}})},p5ED:function(bt,Ye,C){"use strict";var F=C("+L6B"),ge=C("2/Rp"),oe=C("5Dmo"),Oe=C("3S7+"),Ee=C("k1fw"),G=C("tJVT"),M=C("q1tI"),D=C.n(M),S=C("vHTk"),z=C.n(S),$=C("yEEn"),re=C("ZW9T"),ye=C("1vsH");Ye.a=function(le){var W=le.name,P=le.data,U=le.theme,se=le.type,ie=le.filename,Te=le.monacoEditor,We=le.className,pe=le.style,be=le.close,Re=le.onClose,Q=le.hasMask,me=Object(M.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Ae=Object(G.a)(me,2),J=Ae[0],y=Ae[1],Z=Object(M.useState)(""),X=Object(G.a)(Z,2),w=X[0],ee=X[1],j=Object(M.useRef)();ie&&(Te.filename=ie),Object(M.useEffect)(function(){var c,l,g=(c=document.cookie)===null||c===void 0||((l=c.replace(/\s/g,""))===null||l===void 0)?void 0:l.split(";");g==null||g.map(function(_){var N=_.split("=");N[0]==="_educoder_session"&&ee(N[1])})},[]);var A=function(){if(P.startsWith("http")||P.startsWith("/")){k();return}Object(ye.y)(ie||"educoder",P,ie)},k=function(){Object(ye.w)(ie||W,P)};return console.log("data:",P,"fileanme:",ie," name:",W),D.a.createElement("div",{style:Object(Ee.a)({},pe||{}),className:"".concat(Q&&z.a.bgBlack," ").concat(se?z.a.wrp:"hide")},be&&D.a.createElement("div",{className:z.a.close,ref:j},D.a.createElement(Oe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return j.current}},D.a.createElement("span",{onClick:k},D.a.createElement("i",{className:"icon-quxiaozhiding"}))),D.a.createElement(Oe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return j.current}},D.a.createElement("span",{className:"",onClick:Re},D.a.createElement("i",{className:"icon-guanbi1"})))),D.a.createElement("div",{className:"".concat(z.a[We]," ").concat(We," ").concat(z.a.monaco," ").concat(se==="txt"?"show":"hide")},se==="txt"&&D.a.createElement(re.b,Te)),se==="audio"&&D.a.createElement("audio",{src:"".concat(P!=null&&P.startsWith("/")||(P==null?void 0:P.indexOf("https://"))>-1?P:"data:audio/mp3;base64,").concat(P),autoPlay:!0}),se==="video"&&D.a.createElement(D.a.Fragment,null,P!=null&&P.startsWith("/")?D.a.createElement("video",{controls:!0,src:"".concat(P),autoPlay:!0}):D.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(P),autoPlay:!0})),se==="pdf"&&D.a.createElement("embed",{className:z.a.embed,src:P}),se==="image"&&D.a.createElement(D.a.Fragment,null,D.a.createElement("img",{src:"".concat(P!=null&&P.startsWith("/")||(P==null?void 0:P.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(P)})),se==="other"&&D.a.createElement("div",null,D.a.createElement(ge.a,{type:"primary",size:"large",onClick:A},D.a.createElement($.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(se==="download"||se==="office")&&D.a.createElement(ge.a,{type:"primary",size:"large",onClick:A},D.a.createElement($.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(bt,Ye,C){},"rAM+":function(bt,Ye,C){"use strict";C.d(Ye,"a",function(){return ge});var F=C("Qw5x");function ge(oe,Oe){var Ee;if(typeof Symbol=="undefined"||oe[Symbol.iterator]==null){if(Array.isArray(oe)||(Ee=Object(F.a)(oe))||Oe&&oe&&typeof oe.length=="number"){Ee&&(oe=Ee);var G=0,M=function(){};return{s:M,n:function(){return G>=oe.length?{done:!0}:{done:!1,value:oe[G++]}},e:function(re){throw re},f:M}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var D=!0,S=!1,z;return{s:function(){Ee=oe[Symbol.iterator]()},n:function(){var re=Ee.next();return D=re.done,re},e:function(re){S=!0,z=re},f:function(){try{!D&&Ee.return!=null&&Ee.return()}finally{if(S)throw z}}}}},rUJ1:function(bt,Ye){const C=/[&<>"']/,F=/[&<>"']/g,ge=/[<>"']|&(?!#?\w+;)/,oe=/[<>"']|&(?!#?\w+;)/g,Oe={"&":"&","<":"<",">":">",'"':""","'":"'"},Ee=Q=>Oe[Q];function G(Q,me){if(me){if(C.test(Q))return Q.replace(F,Ee)}else if(ge.test(Q))return Q.replace(oe,Ee);return Q}const M=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function D(Q){return Q.replace(M,(me,Ae)=>(Ae=Ae.toLowerCase(),Ae==="colon"?":":Ae.charAt(0)==="#"?Ae.charAt(1)==="x"?String.fromCharCode(parseInt(Ae.substring(2),16)):String.fromCharCode(+Ae.substring(1)):""))}const S=/(^|[^\[])\^/g;function z(Q,me){Q=Q.source||Q,me=me||"";const Ae={replace:(J,y)=>(y=y.source||y,y=y.replace(S,"$1"),Q=Q.replace(J,y),Ae),getRegex:()=>new RegExp(Q,me)};return Ae}const $=/[^\w:]/g,re=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ye(Q,me,Ae){if(Q){let J;try{J=decodeURIComponent(D(Ae)).replace($,"").toLowerCase()}catch(y){return null}if(J.indexOf("javascript:")===0||J.indexOf("vbscript:")===0||J.indexOf("data:")===0)return null}me&&!re.test(Ae)&&(Ae=se(me,Ae));try{Ae=encodeURI(Ae).replace(/%25/g,"%")}catch(J){return null}return Ae}const le={},W=/^[^:]+:\/*[^/]*$/,P=/^([^:]+:)[\s\S]*$/,U=/^([^:]+:\/*[^/]*)[\s\S]*$/;function se(Q,me){le[" "+Q]||(W.test(Q)?le[" "+Q]=Q+"/":le[" "+Q]=pe(Q,"/",!0)),Q=le[" "+Q];const Ae=Q.indexOf(":")===-1;return me.substring(0,2)==="//"?Ae?me:Q.replace(P,"$1")+me:me.charAt(0)==="/"?Ae?me:Q.replace(U,"$1")+me:Q+me}const ie={exec:function(){}};function Te(Q){let me=1,Ae,J;for(;me<arguments.length;me++){Ae=arguments[me];for(J in Ae)Object.prototype.hasOwnProperty.call(Ae,J)&&(Q[J]=Ae[J])}return Q}function We(Q,me){const Ae=Q.replace(/\|/g,(Z,X,w)=>{let ee=!1,j=X;for(;--j>=0&&w[j]==="\\";)ee=!ee;return ee?"|":" |"}),J=Ae.split(/ \|/);let y=0;if(J.length>me)J.splice(me);else for(;J.length<me;)J.push("");for(;y<J.length;y++)J[y]=J[y].trim().replace(/\\\|/g,"|");return J}function pe(Q,me,Ae){const J=Q.length;if(J===0)return"";let y=0;for(;y<J;){const Z=Q.charAt(J-y-1);if(Z===me&&!Ae)y++;else if(Z!==me&&Ae)y++;else break}return Q.substr(0,J-y)}function be(Q,me){if(Q.indexOf(me[1])===-1)return-1;const Ae=Q.length;let J=0,y=0;for(;y<Ae;y++)if(Q[y]==="\\")y++;else if(Q[y]===me[0])J++;else if(Q[y]===me[1]&&(J--,J<0))return y;return-1}function Re(Q){Q&&Q.sanitize&&!Q.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")}bt.exports={escape:G,unescape:D,edit:z,cleanUrl:ye,resolveUrl:se,noopTest:ie,merge:Te,splitCells:We,rtrim:pe,findClosingBracket:be,checkSanitizeDeprecation:Re}},vHTk:function(bt,Ye,C){bt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wMS7:function(bt,Ye,C){/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */(function(F,ge){bt.exports=ge()})(this,function(){"use strict";function F(m){if(Array.isArray(m)){for(var R=0,Y=Array(m.length);R<m.length;R++)Y[R]=m[R];return Y}else return Array.from(m)}var ge=Object.hasOwnProperty,oe=Object.setPrototypeOf,Oe=Object.isFrozen,Ee=Object.keys,G=Object.freeze,M=Object.seal,D=Object.create,S=typeof Reflect!="undefined"&&Reflect,z=S.apply,$=S.construct;z||(z=function(R,Y,B){return R.apply(Y,B)}),G||(G=function(R){return R}),M||(M=function(R){return R}),$||($=function(R,Y){return new(Function.prototype.bind.apply(R,[null].concat(F(Y))))});var re=me(Array.prototype.forEach),ye=me(Array.prototype.indexOf),le=me(Array.prototype.join),W=me(Array.prototype.pop),P=me(Array.prototype.push),U=me(Array.prototype.slice),se=me(String.prototype.toLowerCase),ie=me(String.prototype.match),Te=me(String.prototype.replace),We=me(String.prototype.indexOf),pe=me(String.prototype.trim),be=me(RegExp.prototype.test),Re=Ae(RegExp),Q=Ae(TypeError);function me(m){return function(R){for(var Y=arguments.length,B=Array(Y>1?Y-1:0),ne=1;ne<Y;ne++)B[ne-1]=arguments[ne];return z(m,R,B)}}function Ae(m){return function(){for(var R=arguments.length,Y=Array(R),B=0;B<R;B++)Y[B]=arguments[B];return $(m,Y)}}function J(m,R){oe&&oe(m,null);for(var Y=R.length;Y--;){var B=R[Y];if(typeof B=="string"){var ne=se(B);ne!==B&&(Oe(R)||(R[Y]=ne),B=ne)}m[B]=!0}return m}function y(m){var R=D(null),Y=void 0;for(Y in m)z(ge,m,[Y])&&(R[Y]=m[Y]);return R}var Z=G(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),X=G(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),w=G(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ee=G(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),j=G(["#text"]),A=G(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns"]),k=G(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),c=G(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),l=G(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),g=M(/\{\{[\s\S]*|[\s\S]*\}\}/gm),_=M(/<%[\s\S]*|[\s\S]*%>/gm),N=M(/^data-[\-\w.\u00B7-\uFFFF]/),de=M(/^aria-[\-\w]+$/),_e=M(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ae=M(/^(?:\w+script|data):/i),Se=M(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m};function ce(m){if(Array.isArray(m)){for(var R=0,Y=Array(m.length);R<m.length;R++)Y[R]=m[R];return Y}else return Array.from(m)}var H=function(){return typeof window=="undefined"?null:window},te=function(R,Y){if((typeof R=="undefined"?"undefined":ue(R))!=="object"||typeof R.createPolicy!="function")return null;var B=null,ne="data-tt-policy-suffix";Y.currentScript&&Y.currentScript.hasAttribute(ne)&&(B=Y.currentScript.getAttribute(ne));var ke="dompurify"+(B?"#"+B:"");try{return R.createPolicy(ke,{createHTML:function(Pe){return Pe}})}catch(je){return console.warn("TrustedTypes policy "+ke+" could not be created."),null}};function h(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H(),R=function(he){return h(he)};if(R.version="2.0.15",R.removed=[],!m||!m.document||m.document.nodeType!==9)return R.isSupported=!1,R;var Y=m.document,B=!1,ne=m.document,ke=m.DocumentFragment,je=m.HTMLTemplateElement,Pe=m.Node,we=m.NodeFilter,Me=m.NamedNodeMap,Ge=Me===void 0?m.NamedNodeMap||m.MozNamedAttrMap:Me,Ve=m.Text,Ke=m.Comment,qe=m.DOMParser,ht=m.trustedTypes;if(typeof je=="function"){var nt=ne.createElement("template");nt.content&&nt.content.ownerDocument&&(ne=nt.content.ownerDocument)}var Xe=te(ht,Y),ve=Xe&&Rn?Xe.createHTML(""):"",at=ne,Je=at.implementation,Ce=at.createNodeIterator,Ie=at.getElementsByTagName,I=at.createDocumentFragment,L=Y.importNode,x=y(ne).documentMode?ne.documentMode:{},f={};R.isSupported=Je&&typeof Je.createHTMLDocument!="undefined"&&x!==9;var p=g,v=_,b=N,V=de,fe=ae,Le=Se,tt=_e,rt=null,ot=J({},[].concat(ce(Z),ce(X),ce(w),ce(ee),ce(j))),st=null,it=J({},[].concat(ce(A),ce(k),ce(c),ce(l))),ze=null,ct=null,ft=!0,_t=!0,kt=!1,vt=!1,Bt=!1,Ut=!1,zt=!1,pn=!1,an=!1,nr=!1,An=!1,Rn=!1,Wn=!0,Dt=!0,Qe=!1,tn={},Gn=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),mn=null,Ct=J({},["audio","video","img","source","image","track"]),kn=null,Pn=J({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ln=null,Ne=ne.createElement("form"),mt=function(he){if(Ln&&Ln===he)return;(!he||(typeof he=="undefined"?"undefined":ue(he))!=="object")&&(he={}),he=y(he),rt="ALLOWED_TAGS"in he?J({},he.ALLOWED_TAGS):ot,st="ALLOWED_ATTR"in he?J({},he.ALLOWED_ATTR):it,kn="ADD_URI_SAFE_ATTR"in he?J(y(Pn),he.ADD_URI_SAFE_ATTR):Pn,mn="ADD_DATA_URI_TAGS"in he?J(y(Ct),he.ADD_DATA_URI_TAGS):Ct,ze="FORBID_TAGS"in he?J({},he.FORBID_TAGS):{},ct="FORBID_ATTR"in he?J({},he.FORBID_ATTR):{},tn="USE_PROFILES"in he?he.USE_PROFILES:!1,ft=he.ALLOW_ARIA_ATTR!==!1,_t=he.ALLOW_DATA_ATTR!==!1,kt=he.ALLOW_UNKNOWN_PROTOCOLS||!1,vt=he.SAFE_FOR_JQUERY||!1,Bt=he.SAFE_FOR_TEMPLATES||!1,Ut=he.WHOLE_DOCUMENT||!1,an=he.RETURN_DOM||!1,nr=he.RETURN_DOM_FRAGMENT||!1,An=he.RETURN_DOM_IMPORT||!1,Rn=he.RETURN_TRUSTED_TYPE||!1,pn=he.FORCE_BODY||!1,Wn=he.SANITIZE_DOM!==!1,Dt=he.KEEP_CONTENT!==!1,Qe=he.IN_PLACE||!1,tt=he.ALLOWED_URI_REGEXP||tt,Bt&&(_t=!1),nr&&(an=!0),tn&&(rt=J({},[].concat(ce(j))),st=[],tn.html===!0&&(J(rt,Z),J(st,A)),tn.svg===!0&&(J(rt,X),J(st,k),J(st,l)),tn.svgFilters===!0&&(J(rt,w),J(st,k),J(st,l)),tn.mathMl===!0&&(J(rt,ee),J(st,c),J(st,l))),he.ADD_TAGS&&(rt===ot&&(rt=y(rt)),J(rt,he.ADD_TAGS)),he.ADD_ATTR&&(st===it&&(st=y(st)),J(st,he.ADD_ATTR)),he.ADD_URI_SAFE_ATTR&&J(kn,he.ADD_URI_SAFE_ATTR),Dt&&(rt["#text"]=!0),Ut&&J(rt,["html","head","body"]),rt.table&&(J(rt,["tbody"]),delete ze.tbody),G&&G(he),Ln=he},Sn=function(he){P(R.removed,{element:he});try{he.parentNode.removeChild(he)}catch(Ze){he.outerHTML=ve}},Dn=function(he,Ze){try{P(R.removed,{attribute:Ze.getAttributeNode(he),from:Ze})}catch(lt){P(R.removed,{attribute:null,from:Ze})}Ze.removeAttribute(he)},Fe=function(he){var Ze=void 0,lt=void 0;if(pn)he="<remove></remove>"+he;else{var Tt=ie(he,/^[\r\n\t ]+/);lt=Tt&&Tt[0]}var dn=Xe?Xe.createHTML(he):he;try{Ze=new qe().parseFromString(dn,"text/html")}catch(Rt){}if(B&&J(ze,["title"]),!Ze||!Ze.documentElement){Ze=Je.createHTMLDocument("");var $t=Ze,jt=$t.body;jt.parentNode.removeChild(jt.parentNode.firstElementChild),jt.outerHTML=dn}return he&<&&Ze.body.insertBefore(ne.createTextNode(lt),Ze.body.childNodes[0]||null),Ie.call(Ze,Ut?"html":"body")[0]};R.isSupported&&function(){try{var dt=Fe("<x/><title></title><img>");be(/<\/title/,dt.querySelector("title").innerHTML)&&(B=!0)}catch(he){}}();var Xn=function(he){return Ce.call(he.ownerDocument||he,he,we.SHOW_ELEMENT|we.SHOW_COMMENT|we.SHOW_TEXT,function(){return we.FILTER_ACCEPT},!1)},Tr=function(he){return he instanceof Ve||he instanceof Ke?!1:typeof he.nodeName!="string"||typeof he.textContent!="string"||typeof he.removeChild!="function"||!(he.attributes instanceof Ge)||typeof he.removeAttribute!="function"||typeof he.setAttribute!="function"||typeof he.namespaceURI!="string"},pt=function(he){return(typeof Pe=="undefined"?"undefined":ue(Pe))==="object"?he instanceof Pe:he&&(typeof he=="undefined"?"undefined":ue(he))==="object"&&typeof he.nodeType=="number"&&typeof he.nodeName=="string"},un=function(he,Ze,lt){if(!f[he])return;re(f[he],function(Tt){Tt.call(R,Ze,lt,Ln)})},Hn=function(he){var Ze=void 0;if(un("beforeSanitizeElements",he,null),Tr(he))return Sn(he),!0;if(ie(he.nodeName,/[\u0080-\uFFFF]/))return Sn(he),!0;var lt=se(he.nodeName);if(un("uponSanitizeElement",he,{tagName:lt,allowedTags:rt}),(lt==="svg"||lt==="math")&&he.querySelectorAll("p, br").length!==0)return Sn(he),!0;if(!rt[lt]||ze[lt]){if(Dt&&!Gn[lt]&&typeof he.insertAdjacentHTML=="function")try{var Tt=he.innerHTML;he.insertAdjacentHTML("AfterEnd",Xe?Xe.createHTML(Tt):Tt)}catch(dn){}return Sn(he),!0}return lt==="noscript"&&be(/<\/noscript/i,he.innerHTML)||lt==="noembed"&&be(/<\/noembed/i,he.innerHTML)?(Sn(he),!0):(vt&&!pt(he.firstElementChild)&&(!pt(he.content)||!pt(he.content.firstElementChild))&&be(/</g,he.textContent)&&(P(R.removed,{element:he.cloneNode()}),he.innerHTML?he.innerHTML=Te(he.innerHTML,/</g,"<"):he.innerHTML=Te(he.textContent,/</g,"<")),Bt&&he.nodeType===3&&(Ze=he.textContent,Ze=Te(Ze,p," "),Ze=Te(Ze,v," "),he.textContent!==Ze&&(P(R.removed,{element:he.cloneNode()}),he.textContent=Ze)),un("afterSanitizeElements",he,null),!1)},Vn=function(he,Ze,lt){if(Wn&&(Ze==="id"||Ze==="name")&&(lt in ne||lt in Ne))return!1;if(!(_t&&be(b,Ze))){if(!(ft&&be(V,Ze))){if(!st[Ze]||ct[Ze])return!1;if(!kn[Ze]){if(!be(tt,Te(lt,Le,""))){if(!((Ze==="src"||Ze==="xlink:href"||Ze==="href")&&he!=="script"&&We(lt,"data:")===0&&mn[he])){if(!(kt&&!be(fe,Te(lt,Le,"")))){if(lt)return!1}}}}}}return!0},cn=function(he){var Ze=void 0,lt=void 0,Tt=void 0,dn=void 0,$t=void 0;un("beforeSanitizeAttributes",he,null);var jt=he.attributes;if(!jt)return;var Rt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:st};for($t=jt.length;$t--;){Ze=jt[$t];var Or=Ze,En=Or.name,Nn=Or.namespaceURI;if(lt=pe(Ze.value),Tt=se(En),Rt.attrName=Tt,Rt.attrValue=lt,Rt.keepAttr=!0,Rt.forceKeepAttr=void 0,un("uponSanitizeAttribute",he,Rt),lt=Rt.attrValue,Rt.forceKeepAttr)continue;if(Tt==="name"&&he.nodeName==="IMG"&&jt.id)dn=jt.id,jt=U(jt,[]),Dn("id",he),Dn(En,he),ye(jt,dn)>$t&&he.setAttribute("id",dn.value);else{if(he.nodeName==="INPUT"&&Tt==="type"&<==="file"&&Rt.keepAttr&&(st[Tt]||!ct[Tt]))continue;En==="id"&&he.setAttribute(En,""),Dn(En,he)}if(!Rt.keepAttr)continue;if(vt&&be(/\/>/i,lt)){Dn(En,he);continue}if(be(/svg|math/i,he.namespaceURI)&&be(Re("</("+le(Ee(Gn),"|")+")","i"),lt)){Dn(En,he);continue}Bt&&(lt=Te(lt,p," "),lt=Te(lt,v," "));var gn=he.nodeName.toLowerCase();if(!Vn(gn,Tt,lt))continue;try{Nn?he.setAttributeNS(Nn,En,lt):he.setAttribute(En,lt),W(R.removed)}catch(ki){}}un("afterSanitizeAttributes",he,null)},Mn=function dt(he){var Ze=void 0,lt=Xn(he);for(un("beforeSanitizeShadowDOM",he,null);Ze=lt.nextNode();){if(un("uponSanitizeShadowNode",Ze,null),Hn(Ze))continue;Ze.content instanceof ke&&dt(Ze.content),cn(Ze)}un("afterSanitizeShadowDOM",he,null)};return R.sanitize=function(dt,he){var Ze=void 0,lt=void 0,Tt=void 0,dn=void 0,$t=void 0;if(dt||(dt="<!-->"),typeof dt!="string"&&!pt(dt)){if(typeof dt.toString!="function")throw Q("toString is not a function");if(dt=dt.toString(),typeof dt!="string")throw Q("dirty is not a string, aborting")}if(!R.isSupported){if(ue(m.toStaticHTML)==="object"||typeof m.toStaticHTML=="function"){if(typeof dt=="string")return m.toStaticHTML(dt);if(pt(dt))return m.toStaticHTML(dt.outerHTML)}return dt}if(zt||mt(he),R.removed=[],typeof dt=="string"&&(Qe=!1),!Qe)if(dt instanceof Pe)Ze=Fe("<!-->"),lt=Ze.ownerDocument.importNode(dt,!0),lt.nodeType===1&<.nodeName==="BODY"||lt.nodeName==="HTML"?Ze=lt:Ze.appendChild(lt);else{if(!an&&!Bt&&!Ut&&dt.indexOf("<")===-1)return Xe&&Rn?Xe.createHTML(dt):dt;if(Ze=Fe(dt),!Ze)return an?null:ve}Ze&&pn&&Sn(Ze.firstChild);for(var jt=Xn(Qe?dt:Ze);Tt=jt.nextNode();){if(Tt.nodeType===3&&Tt===dn)continue;if(Hn(Tt))continue;Tt.content instanceof ke&&Mn(Tt.content),cn(Tt),dn=Tt}if(dn=null,Qe)return dt;if(an){if(nr)for($t=I.call(Ze.ownerDocument);Ze.firstChild;)$t.appendChild(Ze.firstChild);else $t=Ze;return An&&($t=L.call(Y,$t,!0)),$t}var Rt=Ut?Ze.outerHTML:Ze.innerHTML;return Bt&&(Rt=Te(Rt,p," "),Rt=Te(Rt,v," ")),Xe&&Rn?Xe.createHTML(Rt):Rt},R.setConfig=function(dt){mt(dt),zt=!0},R.clearConfig=function(){Ln=null,zt=!1},R.isValidAttribute=function(dt,he,Ze){Ln||mt({});var lt=se(dt),Tt=se(he);return Vn(lt,Tt,Ze)},R.addHook=function(dt,he){if(typeof he!="function")return;f[dt]=f[dt]||[],P(f[dt],he)},R.removeHook=function(dt){f[dt]&&W(f[dt])},R.removeHooks=function(dt){f[dt]&&(f[dt]=[])},R.removeAllHooks=function(){f={}},R}var T=h();return T})}}]);
|