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.
345 lines
676 KiB
345 lines
676 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[159,7,10,17],{"+NIl":function(mt,Ze,y){(function(S){S(y("VrN/"))})(function(S){"use strict";S.defineMode("stex",function(de,G){"use strict";function z(Q,W){Q.cmdState.push(W)}function C(Q){return Q.cmdState.length>0?Q.cmdState[Q.cmdState.length-1]:null}function ee(Q){var W=Q.cmdState.pop();W&&W.closeBracket()}function E(Q){for(var W=Q.cmdState,H=W.length-1;H>=0;H--){var P=W[H];if(P.name=="DEFAULT")continue;return P}return{styleIdentifier:function(){return null}}}function R(Q,W,H){return function(){this.name=Q,this.bracketNo=0,this.style=W,this.styles=H,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var B={};B.importmodule=R("importmodule","tag",["string","builtin"]),B.documentclass=R("documentclass","tag",["","atom"]),B.usepackage=R("usepackage","tag",["atom"]),B.begin=R("begin","tag",["atom"]),B.end=R("end","tag",["atom"]),B.label=R("label","tag",["atom"]),B.ref=R("ref","tag",["atom"]),B.eqref=R("eqref","tag",["atom"]),B.cite=R("cite","tag",["atom"]),B.bibitem=R("bibitem","tag",["atom"]),B.Bibitem=R("Bibitem","tag",["atom"]),B.RBibitem=R("RBibitem","tag",["atom"]),B.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function X(Q,W){Q.f=W}function D(Q,W){var H;if(Q.match(/^\\[a-zA-Z@]+/)){var P=Q.current().slice(1);return H=B.hasOwnProperty(P)?B[P]:B.DEFAULT,H=new H,z(W,H),X(W,te),H.style}if(Q.match(/^\\[$&%#{}_]/))return"tag";if(Q.match(/^\\[,;!\/\\]/))return"tag";if(Q.match("\\["))return X(W,function(se,Oe){return O(se,Oe,"\\]")}),"keyword";if(Q.match("\\("))return X(W,function(se,Oe){return O(se,Oe,"\\)")}),"keyword";if(Q.match("$$"))return X(W,function(se,Oe){return O(se,Oe,"$$")}),"keyword";if(Q.match("$"))return X(W,function(se,Oe){return O(se,Oe,"$")}),"keyword";var ie=Q.next();if(ie=="%")return Q.skipToEnd(),"comment";if(ie=="}"||ie=="]"){if(H=C(W),H)H.closeBracket(ie),X(W,te);else return"error";return"bracket"}else return ie=="{"||ie=="["?(H=B.DEFAULT,H=new H,z(W,H),"bracket"):/\d/.test(ie)?(Q.eatWhile(/[\w.%]/),"atom"):(Q.eatWhile(/[\w\-_]/),H=E(W),H.name=="begin"&&(H.argument=Q.current()),H.styleIdentifier())}function O(Q,W,H){if(Q.eatSpace())return null;if(H&&Q.match(H))return X(W,D),"keyword";if(Q.match(/^\\[a-zA-Z@]+/))return"tag";if(Q.match(/^[a-zA-Z]+/))return"variable-2";if(Q.match(/^\\[$&%#{}_]/))return"tag";if(Q.match(/^\\[,;!\/]/))return"tag";if(Q.match(/^[\^_&]/))return"tag";if(Q.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Q.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var P=Q.next();return P=="{"||P=="}"||P=="["||P=="]"||P=="("||P==")"?"bracket":P=="%"?(Q.skipToEnd(),"comment"):"error"}function te(Q,W){var H=Q.peek(),P;return H=="{"||H=="["?(P=C(W),P.openBracket(H),Q.eat(H),X(W,D),"bracket"):/[ \t\r]/.test(H)?(Q.eat(H),null):(X(W,D),ee(W),D(Q,W))}return{startState:function(){var Q=G.inMathMode?function(W,H){return O(W,H)}:D;return{cmdState:[],f:Q}},copyState:function(Q){return{cmdState:Q.cmdState.slice(),f:Q.f}},token:function(Q,W){return W.f(Q,W)},blankLine:function(Q){Q.f=D,Q.cmdState.length=0},lineComment:"%"}}),S.defineMIME("text/x-stex","stex"),S.defineMIME("text/x-latex","stex")})},"+QRC":function(mt,Ze,y){"use strict";var S=y("E9nw"),de={"text/plain":"Text","text/html":"Url",default:"Text"},G="Copy to clipboard: #{key}, Enter";function z(ee){var E=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return ee.replace(/#{\s*key\s*}/g,E)}function C(ee,E){var R,B,X,D,O,te,Q=!1;E||(E={}),R=E.debug||!1;try{X=S(),D=document.createRange(),O=document.getSelection(),te=document.createElement("span"),te.textContent=ee,te.style.all="unset",te.style.position="fixed",te.style.top=0,te.style.clip="rect(0, 0, 0, 0)",te.style.whiteSpace="pre",te.style.webkitUserSelect="text",te.style.MozUserSelect="text",te.style.msUserSelect="text",te.style.userSelect="text",te.addEventListener("copy",function(H){if(H.stopPropagation(),E.format)if(H.preventDefault(),typeof H.clipboardData=="undefined"){R&&console.warn("unable to use e.clipboardData"),R&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var P=de[E.format]||de.default;window.clipboardData.setData(P,ee)}else H.clipboardData.clearData(),H.clipboardData.setData(E.format,ee);E.onCopy&&(H.preventDefault(),E.onCopy(H.clipboardData))}),document.body.appendChild(te),D.selectNodeContents(te),O.addRange(D);var W=document.execCommand("copy");if(!W)throw new Error("copy command was unsuccessful");Q=!0}catch(H){R&&console.error("unable to copy using execCommand: ",H),R&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(E.format||"text",ee),E.onCopy&&E.onCopy(window.clipboardData),Q=!0}catch(P){R&&console.error("unable to copy using clipboardData: ",P),R&&console.error("falling back to prompt"),B=z("message"in E?E.message:G),window.prompt(B,ee)}}finally{O&&(typeof O.removeRange=="function"?O.removeRange(D):O.removeAllRanges()),te&&document.body.removeChild(te),X()}return Q}mt.exports=C},"19Vz":function(mt,Ze,y){(function(S){S(y("VrN/"))})(function(S){S.defineOption("placeholder","",function(R,B,X){var D=X&&X!=S.Init;if(B&&!D)R.on("blur",C),R.on("change",ee),R.on("swapDoc",ee),S.on(R.getInputField(),"compositionupdate",R.state.placeholderCompose=function(){z(R)}),ee(R);else if(!B&&D){R.off("blur",C),R.off("change",ee),R.off("swapDoc",ee),S.off(R.getInputField(),"compositionupdate",R.state.placeholderCompose),de(R);var O=R.getWrapperElement();O.className=O.className.replace(" CodeMirror-empty","")}B&&!R.hasFocus()&&C(R)});function de(R){R.state.placeholder&&(R.state.placeholder.parentNode.removeChild(R.state.placeholder),R.state.placeholder=null)}function G(R){de(R);var B=R.state.placeholder=document.createElement("pre");B.style.cssText="height: 0; overflow: visible",B.style.direction=R.getOption("direction"),B.className="CodeMirror-placeholder CodeMirror-line-like";var X=R.getOption("placeholder");typeof X=="string"&&(X=document.createTextNode(X)),B.appendChild(X),R.display.lineSpace.insertBefore(B,R.display.lineSpace.firstChild)}function z(R){setTimeout(function(){var B=!1,X=R.getInputField();X.nodeName=="TEXTAREA"?B=!X.value:R.lineCount()==1&&(B=!/[^\u200b]/.test(X.querySelector(".CodeMirror-line").textContent)),B?G(R):de(R)},20)}function C(R){E(R)&&G(R)}function ee(R){var B=R.getWrapperElement(),X=E(R);B.className=B.className.replace(" CodeMirror-empty","")+(X?" CodeMirror-empty":""),X?G(R):de(R)}function E(R){return R.lineCount()===1&&R.getLine(0)===""}})},"1eCo":function(mt,Ze,y){(function(S){S(y("VrN/"))})(function(S){"use strict";var de={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},G={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};S.defineMode("xml",function(z,C){var ee=z.indentUnit,E={},R=C.htmlMode?de:G;for(var B in R)E[B]=R[B];for(var B in C)E[B]=C[B];var X,D;function O(N,Ee){function ye(he){return Ee.tokenize=he,he(N,Ee)}var k=N.next();if(k=="<")return N.eat("!")?N.eat("[")?N.match("CDATA[")?ye(W("atom","]]>")):null:N.match("--")?ye(W("comment","-->")):N.match("DOCTYPE",!0,!0)?(N.eatWhile(/[\w\._\-]/),ye(H(1))):null:N.eat("?")?(N.eatWhile(/[\w\._\-]/),Ee.tokenize=W("meta","?>"),"meta"):(X=N.eat("/")?"closeTag":"openTag",Ee.tokenize=te,"tag bracket");if(k=="&"){var K;return N.eat("#")?N.eat("x")?K=N.eatWhile(/[a-fA-F\d]/)&&N.eat(";"):K=N.eatWhile(/[\d]/)&&N.eat(";"):K=N.eatWhile(/[\w\.\-:]/)&&N.eat(";"),K?"atom":"error"}else return N.eatWhile(/[^&<]/),null}O.isInText=!0;function te(N,Ee){var ye=N.next();if(ye==">"||ye=="/"&&N.eat(">"))return Ee.tokenize=O,X=ye==">"?"endTag":"selfcloseTag","tag bracket";if(ye=="=")return X="equals",null;if(ye=="<"){Ee.tokenize=O,Ee.state=Oe,Ee.tagName=Ee.tagStart=null;var k=Ee.tokenize(N,Ee);return k?k+" tag error":"tag error"}else return/[\'\"]/.test(ye)?(Ee.tokenize=Q(ye),Ee.stringStartCol=N.column(),Ee.tokenize(N,Ee)):(N.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Q(N){var Ee=function(ye,k){for(;!ye.eol();)if(ye.next()==N){k.tokenize=te;break}return"string"};return Ee.isInAttribute=!0,Ee}function W(N,Ee){return function(ye,k){for(;!ye.eol();){if(ye.match(Ee)){k.tokenize=O;break}ye.next()}return N}}function H(N){return function(Ee,ye){for(var k;(k=Ee.next())!=null;){if(k=="<")return ye.tokenize=H(N+1),ye.tokenize(Ee,ye);if(k==">")if(N==1){ye.tokenize=O;break}else return ye.tokenize=H(N-1),ye.tokenize(Ee,ye)}return"meta"}}function P(N,Ee,ye){this.prev=N.context,this.tagName=Ee,this.indent=N.indented,this.startOfLine=ye,(E.doNotIndent.hasOwnProperty(Ee)||N.context&&N.context.noIndent)&&(this.noIndent=!0)}function ie(N){N.context&&(N.context=N.context.prev)}function se(N,Ee){for(var ye;;){if(!N.context)return;if(ye=N.context.tagName,!E.contextGrabbers.hasOwnProperty(ye)||!E.contextGrabbers[ye].hasOwnProperty(Ee))return;ie(N)}}function Oe(N,Ee,ye){return N=="openTag"?(ye.tagStart=Ee.column(),Ke):N=="closeTag"?ge:Oe}function Ke(N,Ee,ye){return N=="word"?(ye.tagName=Ee.current(),D="tag",_e):E.allowMissingTagName&&N=="endTag"?(D="tag bracket",_e(N,Ee,ye)):(D="error",Ke)}function ge(N,Ee,ye){if(N=="word"){var k=Ee.current();return ye.context&&ye.context.tagName!=k&&E.implicitlyClosed.hasOwnProperty(ye.context.tagName)&&ie(ye),ye.context&&ye.context.tagName==k||E.matchClosing===!1?(D="tag",Me):(D="tag error",Ve)}else return E.allowMissingTagName&&N=="endTag"?(D="tag bracket",Me(N,Ee,ye)):(D="error",Ve)}function Me(N,Ee,ye){return N!="endTag"?(D="error",Me):(ie(ye),Oe)}function Ve(N,Ee,ye){return D="error",Me(N,Ee,ye)}function _e(N,Ee,ye){if(N=="word")return D="attribute",be;if(N=="endTag"||N=="selfcloseTag"){var k=ye.tagName,K=ye.tagStart;return ye.tagName=ye.tagStart=null,N=="selfcloseTag"||E.autoSelfClosers.hasOwnProperty(k)?se(ye,k):(se(ye,k),ye.context=new P(ye,k,K==ye.indented)),Oe}return D="error",_e}function be(N,Ee,ye){return N=="equals"?Ne:(E.allowMissing||(D="error"),_e(N,Ee,ye))}function Ne(N,Ee,ye){return N=="string"?we:N=="word"&&E.allowUnquoted?(D="string",_e):(D="error",_e(N,Ee,ye))}function we(N,Ee,ye){return N=="string"?we:_e(N,Ee,ye)}return{startState:function(N){var Ee={tokenize:O,state:Oe,indented:N||0,tagName:null,tagStart:null,context:null};return N!=null&&(Ee.baseIndent=N),Ee},token:function(N,Ee){if(!Ee.tagName&&N.sol()&&(Ee.indented=N.indentation()),N.eatSpace())return null;X=null;var ye=Ee.tokenize(N,Ee);return(ye||X)&&ye!="comment"&&(D=null,Ee.state=Ee.state(X||ye,N,Ee),D&&(ye=D=="error"?ye+" error":D)),ye},indent:function(N,Ee,ye){var k=N.context;if(N.tokenize.isInAttribute)return N.tagStart==N.indented?N.stringStartCol+1:N.indented+ee;if(k&&k.noIndent)return S.Pass;if(N.tokenize!=te&&N.tokenize!=O)return ye?ye.match(/^(\s*)/)[0].length:0;if(N.tagName)return E.multilineTagIndentPastTag!==!1?N.tagStart+N.tagName.length+2:N.tagStart+ee*(E.multilineTagIndentFactor||1);if(E.alignCDATA&&/<!\[CDATA\[/.test(Ee))return 0;var K=Ee&&/^<(\/)?([\w_:\.-]*)/.exec(Ee);if(K&&K[1])for(;k;)if(k.tagName==K[2]){k=k.prev;break}else if(E.implicitlyClosed.hasOwnProperty(k.tagName))k=k.prev;else break;else if(K)for(;k;){var he=E.contextGrabbers[k.tagName];if(he&&he.hasOwnProperty(K[2]))k=k.prev;else break}for(;k&&k.prev&&!k.startOfLine;)k=k.prev;return k?k.indent+ee:N.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(N){N.state==Ne&&(N.state=_e)},xmlCurrentTag:function(N){return N.tagName?{name:N.tagName,close:N.type=="closeTag"}:null},xmlCurrentContext:function(N){for(var Ee=[],ye=N.context;ye;ye=ye.prev)ye.tagName&&Ee.push(ye.tagName);return Ee.reverse()}}}),S.defineMIME("text/xml","xml"),S.defineMIME("application/xml","xml"),S.mimeModes.hasOwnProperty("text/html")||S.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(mt,Ze,y){"use strict";var S=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),de=new Uint8Array(16);function G(){if(!S)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return S(de)}var z=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function C(te){return typeof te=="string"&&z.test(te)}for(var ee=C,E=[],R=0;R<256;++R)E.push((R+256).toString(16).substr(1));function B(te){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,W=(E[te[Q+0]]+E[te[Q+1]]+E[te[Q+2]]+E[te[Q+3]]+"-"+E[te[Q+4]]+E[te[Q+5]]+"-"+E[te[Q+6]]+E[te[Q+7]]+"-"+E[te[Q+8]]+E[te[Q+9]]+"-"+E[te[Q+10]]+E[te[Q+11]]+E[te[Q+12]]+E[te[Q+13]]+E[te[Q+14]]+E[te[Q+15]]).toLowerCase();if(!ee(W))throw TypeError("Stringified UUID is invalid");return W}var X=B;function D(te,Q,W){te=te||{};var H=te.random||(te.rng||G)();if(H[6]=H[6]&15|64,H[8]=H[8]&63|128,Q){W=W||0;for(var P=0;P<16;++P)Q[W+P]=H[P];return Q}return X(H)}var O=Ze.a=D},"7ahc":function(mt,Ze,y){"use strict";y.d(Ze,"a",function(){return Ke});var S=y("k1fw"),de=y("0Owb"),G=y("+L6B"),z=y("2/Rp"),C=y("y8nQ"),ee=y("Vl3Y"),E=y("tJVT"),R=y("OaEy"),B=y("2fM7"),X=y("q1tI"),D=y.n(X),O=y("VrN/"),te=y.n(O),Q=y("p77/"),W=y.n(Q),H=y("c5Ni"),P=y.n(H),ie=B.a.Option,se={labelCol:{span:4},wrapperCol:{span:20}},Oe={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"]};Ze.b=function(ge){var Me=ge.callback,Ve=ge.onCancel,_e=Object(X.useState)("python"),be=Object(E.a)(_e,2),Ne=be[0],we=be[1];function N(ye){we(Oe[ye][1])}function Ee(ye){Me(ye)}return D.a.createElement(ee.a,Object(de.a)({},se,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ee}),D.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},D.a.createElement(B.a,{onChange:N},Object.keys(Oe).map(function(ye){return D.a.createElement(ie,{key:ye,value:ye},Oe[ye][0])}))),D.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},D.a.createElement(Ke,{mode:Ne})),D.a.createElement("div",{className:"flex-container flex-end"},D.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),D.a.createElement(z.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))};function Ke(ge){var Me=ge.value,Ve=ge.onChange,_e=ge.mode,be=ge.options,Ne=be===void 0?{}:be,we=Object(X.useRef)(),N=Object(X.useState)(),Ee=Object(E.a)(N,2),ye=Ee[0],k=Ee[1];return Object(X.useEffect)(function(){if(ye){function K(he){var $=he.getValue();Ve&&Ve($)}return ye.on("change",K),function(){ye.off("change",K)}}},[ye,Ve]),Object(X.useEffect)(function(){ye&&ye.setOption("mode",_e)},[ye,_e]),Object(X.useEffect)(function(){ye&&((Me!==ye.getValue()||Me==="")&&setTimeout(function(){ye.setValue(Me||" ")},300))},[ye,Me]),Object(X.useEffect)(function(){if(we.current&&!ye){var K=te.a.fromTextArea(we.current,Object(S.a)({mode:_e,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Ne));k(K)}},[we.current,ye]),D.a.createElement("div",{className:"my-codemirror-container"},D.a.createElement("textarea",{ref:we}))}},"7ixt":function(mt,Ze,y){"use strict";y.d(Ze,"a",function(){return G});var S={adjustX:1,adjustY:1},de=[0,0],G={left:{points:["cr","cl"],overflow:S,offset:[-4,0],targetOffset:de},right:{points:["cl","cr"],overflow:S,offset:[4,0],targetOffset:de},top:{points:["bc","tc"],overflow:S,offset:[0,-4],targetOffset:de},bottom:{points:["tc","bc"],overflow:S,offset:[0,4],targetOffset:de},topLeft:{points:["bl","tl"],overflow:S,offset:[0,-4],targetOffset:de},leftTop:{points:["tr","tl"],overflow:S,offset:[-4,0],targetOffset:de},topRight:{points:["br","tr"],overflow:S,offset:[0,-4],targetOffset:de},rightTop:{points:["tl","tr"],overflow:S,offset:[4,0],targetOffset:de},bottomRight:{points:["tr","br"],overflow:S,offset:[0,4],targetOffset:de},rightBottom:{points:["bl","br"],overflow:S,offset:[4,0],targetOffset:de},bottomLeft:{points:["tl","bl"],overflow:S,offset:[0,4],targetOffset:de},leftBottom:{points:["br","bl"],overflow:S,offset:[-4,0],targetOffset:de}},z=G},"8EBN":function(mt,Ze,y){(function(S){S(y("VrN/"))})(function(S){"use strict";S.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 de=0;de<S.modeInfo.length;de++){var G=S.modeInfo[de];G.mimes&&(G.mime=G.mimes[0])}S.findModeByMIME=function(z){z=z.toLowerCase();for(var C=0;C<S.modeInfo.length;C++){var ee=S.modeInfo[C];if(ee.mime==z)return ee;if(ee.mimes){for(var E=0;E<ee.mimes.length;E++)if(ee.mimes[E]==z)return ee}}if(/\+xml$/.test(z))return S.findModeByMIME("application/xml");if(/\+json$/.test(z))return S.findModeByMIME("application/json")},S.findModeByExtension=function(z){z=z.toLowerCase();for(var C=0;C<S.modeInfo.length;C++){var ee=S.modeInfo[C];if(ee.ext){for(var E=0;E<ee.ext.length;E++)if(ee.ext[E]==z)return ee}}},S.findModeByFileName=function(z){for(var C=0;C<S.modeInfo.length;C++){var ee=S.modeInfo[C];if(ee.file&&ee.file.test(z))return ee}var E=z.lastIndexOf("."),R=E>-1&&z.substring(E+1,z.length);if(R)return S.findModeByExtension(R)},S.findModeByName=function(z){z=z.toLowerCase();for(var C=0;C<S.modeInfo.length;C++){var ee=S.modeInfo[C];if(ee.name.toLowerCase()==z)return ee;if(ee.alias){for(var E=0;E<ee.alias.length;E++)if(ee.alias[E].toLowerCase()==z)return ee}}}})},"8hTe":function(mt,Ze,y){mt.exports={button:"button___1wy9m"}},"9Bee":function(mt,Ze,y){"use strict";var S=y("DYRE"),de=y("zeV3"),G=y("+L6B"),z=y("2/Rp"),C=y("k1fw"),ee=y("9og8"),E=y("tJVT"),R=y("WmNS"),B=y.n(R),X=y("q1tI"),D=y.n(X),O=y("vg9a"),te=y("DlQD"),Q=y.n(te),W=y("rUJ1");function H(h,o){var a=h.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
|
|
`).map(function(p){var c=p.match(/^\s+/);if(c===null)return p;var J=Object(E.a)(c,1),We=J[0];return We.length>=u.length?p.slice(u.length):p}).join(`
|
|
`)}var P=[],ie=["<ul>"],se=new Q.a.Renderer,Oe=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ke(){P.length=0,ie=["<ul>"]}var ge={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Me(h,o,a,u){if(o>=h.length||h[o].level<=a)return o;var p=h[o];u.push("<li><a href='#"+p.anchor+"'>"+p.text+"</a>"),o++;var c=[];return o=Me(h,o,p.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(J){u.push(J)}),u.push("</ul>")),u.push("</li>"),o=Me(h,o,a,u),o}function Ve(){return Me(P,0,0,ie),ie.push("</ul>"),ie.join("")}var _e={heading:function(o){var a=Oe.exec(o);if(a)return{type:"heading",raw:a[0],depth:a[1].length,text:a[2]}},fences:function(o){var a=this.rules.block.fences.exec(o);if(a){var u=a[0],p=H(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var J=we(),We=p;p=J,N[J]={type:"block",expression:We}}return{type:"code",raw:u,lang:c,text:p}}}},be=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Ne=0,we=function(){return"__special_katext_id_".concat(Ne++,"__")},N={};function Ee(){return N}function ye(){Ne=0,N={}}function k(h){return h=h.replace(be,function(o,a){var u=we();return N[u]={type:"inline",expression:a},u}),h}var K=se.listitem;se.listitem=function(h){return K(k(h))};var he=se.paragraph;se.paragraph=function(h){return he(k(h))};var $=se.tablecell;se.tablecell=function(h,o){return $(k(h),o)},se.code=function(h,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(h,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?h:Object(W.escape)(h,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?h:Object(W.escape)(h,!0))+"</code></pre>"},se.heading=function(h,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return P.push({anchor:u,level:o,text:h}),"<h"+o+' id="'+u+'">'+h+"</h"+o+">"},Q.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),Q.a.use({tokenizer:_e,renderer:se});var Re=Q.a,M=y("SJMd"),g=y("ulZh"),ue=y.n(g),Ie=y("m3rI"),Te=y("Oy/b"),nt=y("p5ED"),st=y("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Ue=function(h,o){return(Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(h,o)};function He(h,o){function a(){this.constructor=h}Ue(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Le(h,o,a,u){return new(a||(a=Promise))(function(p,c){function J(kt){try{xe(u.next(kt))}catch(Xe){c(Xe)}}function We(kt){try{xe(u.throw(kt))}catch(Xe){c(Xe)}}function xe(kt){var Xe;kt.done?p(kt.value):(Xe=kt.value,Xe instanceof a?Xe:new a(function(Ht){Ht(Xe)})).then(J,We)}xe((u=u.apply(h,o||[])).next())})}function Be(h,o){var a,u,p,c,J={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return c={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function We(xe){return function(kt){return function(Xe){if(a)throw new TypeError("Generator is already executing.");for(;J;)try{if(a=1,u&&(p=2&Xe[0]?u.return:Xe[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,Xe[1])).done)return p;switch(u=0,p&&(Xe=[2&Xe[0],p.value]),Xe[0]){case 0:case 1:p=Xe;break;case 4:return J.label++,{value:Xe[1],done:!1};case 5:J.label++,u=Xe[1],Xe=[0];continue;case 7:Xe=J.ops.pop(),J.trys.pop();continue;default:if(!(p=J.trys,(p=p.length>0&&p[p.length-1])||Xe[0]!==6&&Xe[0]!==2)){J=0;continue}if(Xe[0]===3&&(!p||Xe[1]>p[0]&&Xe[1]<p[3])){J.label=Xe[1];break}if(Xe[0]===6&&J.label<p[1]){J.label=p[1],p=Xe;break}if(p&&J.label<p[2]){J.label=p[2],J.ops.push(Xe);break}p[2]&&J.ops.pop(),J.trys.pop();continue}Xe=o.call(h,J)}catch(Ht){Xe=[6,Ht],u=0}finally{a=p=0}if(5&Xe[0])throw Xe[1];return{value:Xe[0]?Xe[1]:void 0,done:!0}}([xe,kt])}}}function ce(){for(var h=0,o=0,a=arguments.length;o<a;o++)h+=arguments[o].length;var u=Array(h),p=0;for(o=0;o<a;o++)for(var c=arguments[o],J=0,We=c.length;J<We;J++,p++)u[p]=c[J];return u}var j=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var c=p[u],J=c[0],We=c[1];o.setAttribute(J,We)}},h.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&h.setAttributes(p,u),p},h.createLine=function(o,a,u,p,c){var J=document.createElementNS("http://www.w3.org/2000/svg","line");return J.setAttribute("x1",o.toString()),J.setAttribute("y1",a.toString()),J.setAttribute("x2",u.toString()),J.setAttribute("y2",p.toString()),c&&h.setAttributes(J,c),J},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(p,u),p},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,p,c,J,We){var xe=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(xe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",c.toString()],["refY",J.toString()]]),xe.appendChild(We),xe},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h}(),et=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),Ct=function(){function h(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return h.prototype.rasterize=function(o,a,u){var p=this;return new Promise(function(c){var J=u!==void 0?u:document.createElement("canvas");o===null&&(p.markersOnly=!0,p.naturalSize=!1);var We=document.createElementNS("http://www.w3.org/2000/svg","svg");We.setAttribute("xmlns","http://www.w3.org/2000/svg"),We.setAttribute("width",a.width.baseVal.valueAsString),We.setAttribute("height",a.height.baseVal.valueAsString),We.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),We.innerHTML=a.innerHTML,p.naturalSize===!0?(We.width.baseVal.value=o.naturalWidth,We.height.baseVal.value=o.naturalHeight):p.width!==void 0&&p.height!==void 0&&(We.width.baseVal.value=p.width,We.height.baseVal.value=p.height),J.width=We.width.baseVal.value,J.height=We.height.baseVal.value;var xe=We.outerHTML,kt=J.getContext("2d");p.markersOnly!==!0&&kt.drawImage(o,0,0,J.width,J.height);var Xe=window.URL,Ht=new Image(J.width,J.height);Ht.setAttribute("crossOrigin","anonymous");var hn=new Blob([xe],{type:"image/svg+xml"}),Sn=Xe.createObjectURL(hn);Ht.onload=function(){kt.drawImage(Ht,0,0),Xe.revokeObjectURL(Sn);var Ri=J.toDataURL(p.imageType,p.imageQuality);c(Ri)},Ht.src=Sn})},h}(),St=function(){},ze=function(){function h(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),h.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},h.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},h.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new pt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new pt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new pt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new fe("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new fe("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),pt=function(h,o){this.selector=h,this.style=o},fe=function(h,o){this.localName=h,this.style=o},Ae=function(){function h(o,a,u,p,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=p,this.styles=c,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return h.prototype.show=function(o){var a=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(c){var J=document.createElement("div");J.className=""+a.toolbarButtonStyleClass.name,J.setAttribute("data-type-name",c.typeName),J.innerHTML=c.icon,J.addEventListener("click",function(){a.markerToolbarButtonClicked(J,c)}),a.buttons.push(J),a.markerButtons.push(J)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var p=document.createElement("div");p.className=this.toolbarBlockStyleClass.name,p.style.whiteSpace="nowrap",p.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(p),this.addActionButton(p,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(p,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},h.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},h.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},h.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},h.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a<this.markerButtons.length;a++)a<o||a===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[a]):(a===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[a]))}},h.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},h.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(a){a.className=a.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),a.className=a.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),a.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},h.prototype.addActionButton=function(o,a,u){var p=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=a,c.setAttribute("data-action",u),c.addEventListener("click",function(){p.actionToolbarButtonClicked(c,u)}),u){case"select":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":c.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":c.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":c.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(c),this.buttons.push(c)},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new fe("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new fe("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new fe("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new fe("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new fe("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new fe("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new fe("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new fe("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new pt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new pt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},h.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},h.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},h.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},h.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},h.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},h}(),Ge=function(){function h(o,a,u,p){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=p,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return h.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new fe("toolbox",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: sans-serif;
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new fe("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new fe("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new fe("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new fe("toolbox-panel-row",`
|
|
display: flex;
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
cursor: default;
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
box-sizing: content-box;
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new fe("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new fe("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
|
|
padding: `+a+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new fe("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new fe("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new pt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new pt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},h.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},h.prototype.setPanelButtons=function(o){var a,u,p=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(c){var J;c.uiStyleSettings=p.uiStyleSettings;var We=document.createElement("div");We.className=p.toolboxButtonStyleClass.name+" "+((J=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&J!==void 0?J:p.toolboxButtonStyleColorsClass.name),We.innerHTML=c.icon,We.title=c.title,We.addEventListener("click",function(){p.panelButtonClick(c)}),p.panelButtons.push(We),p.buttonRow.appendChild(We)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},h.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var p=o.getUi();p.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(p),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(c,J){var We,xe;c.className=a.toolboxButtonStyleClass.name+" "+(J===u?""+((We=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&We!==void 0?We:a.toolboxActiveButtonStyleColorsClass.name):""+((xe=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&xe!==void 0?xe:a.toolboxButtonStyleColorsClass.name))})},h}(),Se=function(h,o){this.title=h,this.icon=o},rt=function(h){function o(a,u,p,c){var J=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return J.colors=[],J.addTransparent=!1,J.colorBoxes=[],J.colors=u,J.currentColor=p,J.setCurrentColor=J.setCurrentColor.bind(J),J.getColorBox=J.getColorBox.bind(J),J}return He(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(p){var c=a.getColorBox(p);u.appendChild(c),a.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(a){var u=this,p=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-p,J=document.createElement("div");J.style.display="inline-block",J.style.boxSizing="content-box",J.style.width=c-2+"px",J.style.height=c-2+"px",J.style.padding="1px",J.style.marginRight="2px",J.style.marginBottom="2px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderRadius=(c+2)/2+"px",J.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){u.setCurrentColor(a,J)});var We=document.createElement("div");return We.style.display="inline-block",We.style.width=c-2+"px",We.style.height=c-2+"px",We.style.backgroundColor=a,We.style.borderRadius=c/2+"px",a==="transparent"&&(We.style.fill=this.uiStyleSettings.toolboxAccentColor,We.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),J.appendChild(We),J},o.prototype.setCurrentColor=function(a,u){var p=this;this.currentColor=a,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Se),tt=function(){function h(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(h.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),h.prototype.ownsTarget=function(o){return!1},Object.defineProperty(h.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),h.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},h.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},h.prototype.pointerDown=function(o,a){},h.prototype.dblClick=function(o,a){},h.prototype.manipulate=function(o){},h.prototype.pointerUp=function(o){this.stateChanged()},h.prototype.dispose=function(){},h.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},h.prototype.getState=function(){return{typeName:h.typeName,state:this.state,notes:this.notes}},h.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},h.prototype.scale=function(o,a){},h.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},h.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},h.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},h.typeName="MarkerBase",h}(),lt=function(){function h(){this.findGripByVisual=this.findGripByVisual.bind(this)}return h.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},h}(),It=function(){function h(){this.GRIP_SIZE=10,this.visual=j.createGroup(),this.visual.appendChild(j.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(j.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h}(),wt=function(){function h(){}return h.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},h.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},h}(),bt=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.left=0,c.top=0,c.width=0,c.height=0,c.defaultSize={x:50,y:20},c.offsetX=0,c.offsetY=0,c.rotationAngle=0,c.CB_DISTANCE=10,c._suppressMarkerCreateEvent=!1,c.container.transform.baseVal.appendItem(j.createTransform()),c.setupControlBox(),c}return He(o,h),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=j.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var p=this.unrotatePoint(a);if(this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.offsetX=p.x-this.left,this.offsetY=p.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var c=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=c.x-this.width/2,this.top=c.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var J=this.container.transform.baseVal.getItem(0);J.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(J,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;h.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,p=this.manipulationStartWidth,c=this.manipulationStartTop,J=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,p=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:p=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+a.y-this.manipulationStartY,J=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:J=this.manipulationStartHeight+a.y-this.manipulationStartY}p>=0?(this.left=u,this.width=p):(this.left=u+p,this.width=-p),J>=0?(this.top=c,this.height=J):(this.top=c+J,this.height=-J),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(a){if(Math.abs(a.x-this.centerX)>.1){var u=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0)},o.prototype.rotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM(),p=j.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var p=j.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=j.createGroup();var a=j.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=j.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=j.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new lt,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var a=this.controlBox.transform.baseVal.getItem(0);a.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(a,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},o.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},o.prototype.createGrip=function(){var a=new It;return a.visual.transform.baseVal.appendItem(j.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,p=u,c=(this.width+this.CB_DISTANCE)/2-a/2,J=(this.height+this.CB_DISTANCE)/2-a/2,We=this.height+this.CB_DISTANCE-a/2,xe=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,p),this.positionGrip(this.controlGrips.topCenter.visual,c,p),this.positionGrip(this.controlGrips.topRight.visual,xe,p),this.positionGrip(this.controlGrips.centerLeft.visual,u,J),this.positionGrip(this.controlGrips.centerRight.visual,xe,J),this.positionGrip(this.controlGrips.bottomLeft.visual,u,We),this.positionGrip(this.controlGrips.bottomCenter.visual,c,We),this.positionGrip(this.controlGrips.bottomRight.visual,xe,We),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,p-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,p){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,p),a.transform.baseVal.replaceItem(c,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:wt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:wt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(wt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(wt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u);var p=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:p.x*a,y:p.y*u});this.left=c.x,this.top=c.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(tt),ut=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.createVisual=c.createVisual.bind(c),c}return He(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=j.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),j.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&j.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&j.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&j.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&j.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(bt),Rt=function(h){function o(a,u,p,c){var J=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return J.widths=[],J.widthBoxes=[],J.widths=u,J.currentWidth=p,J.setCurrentWidth=J.setCurrentWidth.bind(J),J}return He(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(p){var c=document.createElement("div");c.style.display="flex",c.style.flexGrow="2",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=p===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentWidth(p,c)}),u.appendChild(c);var J=document.createElement("div");J.innerText=p.toString(),J.style.marginRight="5px",c.appendChild(J);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.display="flex",We.style.alignItems="center";var xe=document.createElement("hr");xe.style.minWidth="20px",xe.style.border="0px",xe.style.borderTop=p+"px solid "+a.uiStyleSettings.toolboxColor,xe.style.flexGrow="2",We.appendChild(xe),c.appendChild(We),a.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(a,u){var p=this;this.currentWidth=a,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Se),xt=function(h){function o(a,u,p,c){var J=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return J.styles=[],J.styleBoxes=[],J.styles=u,J.currentStyle=p,J.setCurrentStyle=J.setCurrentStyle.bind(J),J}return He(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(p){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.styles.length-5+"%",c.style.borderColor=p===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentStyle(p,c)}),u.appendChild(c);var J=document.createElement("div");J.style.minHeight="20px",J.style.flexGrow="2",J.style.overflow="hidden";var We=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(p!==""?'stroke-dasharray="'+p+'"':"")+` />
|
|
</svg>`;J.innerHTML=We,c.appendChild(J),a.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(a,u){var p=this;this.currentStyle=a,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Se),gt=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new rt("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Rt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new xt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return He(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(ut),De=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Dt=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.x1=0,c.y1=0,c.x2=0,c.y2=0,c.defaultLength=50,c.manipulationStartX=0,c.manipulationStartY=0,c.manipulationStartX1=0,c.manipulationStartY1=0,c.manipulationStartX2=0,c.manipulationStartY2=0,c.setupControlBox(),c}return He(o,h),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;h.prototype.pointerUp.call(this,a),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=j.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var a=new It;return a.visual.transform.baseVal.appendItem(j.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,p){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,p),a.transform.baseVal.replaceItem(c,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(tt),vt=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new rt("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Rt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new xt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return He(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=j.createGroup(),this.selectorLine=j.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=j.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),j.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),j.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),j.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',o}(Dt),je=function(h){function o(a,u,p,c){var J=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return J.fonts=[],J.fontBoxes=[],J.fonts=u,J.currentFont=p,J.setCurrentFont=J.setCurrentFont.bind(J),J}return He(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(p){var c=document.createElement("div");c.style.display="inline-block",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.fonts.length-5+"%",c.style.borderColor=p===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentFont(p,c)}),u.appendChild(c);var J=document.createElement("div");J.style.display="flex",J.style.minHeight="20px",J.style.flexGrow="2",J.style.fontFamily=p,J.style.overflow="hidden";var We=document.createElement("div");We.style.whiteSpace="nowrap",We.style.overflow="hidden",We.style.textOverflow="ellipsis",We.innerHTML="The quick brown fox jumps over the lazy dog",J.appendChild(We),c.appendChild(J),a.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(a,u){var p=this;this.currentFont=a,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Se),qe=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=p.defaultColor,c.fontFamily=p.defaultFontFamily,c.defaultSize={x:100,y:30},c.setColor=c.setColor.bind(c),c.setFont=c.setFont.bind(c),c.renderText=c.renderText.bind(c),c.sizeText=c.sizeText.bind(c),c.textEditDivClicked=c.textEditDivClicked.bind(c),c.showTextEditor=c.showTextEditor.bind(c),c.setSize=c.setSize.bind(c),c.positionTextEditor=c.positionTextEditor.bind(c),c.colorPanel=new rt("Color",p.defaultColorSet,p.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new je("Font",p.defaultFontFamilies,p.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return He(o,h),o.prototype.ownsTarget=function(a){if(h.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(p){p===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=j.createGroup(),this.bgRectangle=j.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=j.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(j.createTransform()),this.textElement.transform.baseVal.appendItem(j.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){a.textElement.appendChild(j.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var p=(1*this.width-this.width*this.padding*2/100)/a.width,c=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(p,c)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),p=0,c=0;return u.width>0&&u.height>0&&(p=(this.width-u.width*a)/2,c=this.height/2-u.height*a/2),{x:p,y:c}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),p=this.getTextPosition(u);p.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+p.x+"px, "+p.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(p.x,p.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){h.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(j.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),j.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),h.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var p=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(p)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){a.textEditDivClicked(a.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var a=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),p=this.textElement.getBBox(),c={x:p.width*a,y:p.height*a};u.x-=c.x/2,u.y-=c.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){h.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),h.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){h.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&j.setAttributes(this.textElement,[["fill",a]]),this.color=a,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(a)},o.prototype.setFont=function(a){this.textElement&&j.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',o}(bt),ae=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=p.defaultColor,c.lineWidth=p.defaultStrokeWidth,c.pixelRatio=p.freehandPixelRatio,c.setColor=c.setColor.bind(c),c.addCanvas=c.addCanvas.bind(c),c.finishCreation=c.finishCreation.bind(c),c.setLineWidth=c.setLineWidth.bind(c),c.colorPanel=new rt("Color",p.defaultColorSet,p.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new Rt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return He(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=j.createGroup(),this.drawingImage=j.createImage(),this.visual.appendChild(this.drawingImage);var a=j.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(a.x,a.y),this.drawing=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),j.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),j.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):h.prototype.pointerUp.call(this,a)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),h.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),h.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],p=u[0],c=u[1],J=u[2],We=u[3],xe=!1,kt=0;kt<this.canvasElement.height;kt++)for(var Xe=0;Xe<this.canvasElement.width;Xe++)a.data[kt*this.canvasElement.width*4+4*Xe+3]>0&&(xe=!0,kt<c&&(c=kt),Xe<p&&(p=Xe),kt>We&&(We=kt),Xe>J&&(J=Xe));if(xe){this.left=p/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(J-p)/this.pixelRatio,this.height=(We-c)/this.pixelRatio;var Ht=document.createElement("canvas");Ht.width=J-p,Ht.height=We-c,Ht.getContext("2d").putImageData(this.canvasContext.getImageData(p,c,J-p,We-c),0,0),this.drawingImgUrl=Ht.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){j.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),j.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),h.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',o}(bt),Z=function(h){function o(a,u,p){var c=h.call(this,a,p||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return c.typeBoxes=[],c.currentType=u,c.setCurrentType=c.setCurrentType.bind(c),c}return He(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var p=function(We){var xe="both";switch(We){case 0:xe="both";break;case 1:xe="start";break;case 2:xe="end";break;case 3:xe="none"}var kt=document.createElement("div");if(kt.style.display="flex",kt.style.flexGrow="2",kt.style.alignItems="center",kt.style.justifyContent="space-between",kt.style.padding="5px",kt.style.borderWidth="2px",kt.style.borderStyle="solid",kt.style.borderColor=xe===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",kt.addEventListener("click",function(){a.setCurrentType(xe,kt)}),u.appendChild(kt),xe==="both"||xe==="start"){var Xe=document.createElement("div");Xe.style.display="flex",Xe.style.alignItems="center",Xe.style.minHeight="20px",Xe.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Xe.style.marginLeft="5px",kt.appendChild(Xe)}var Ht=document.createElement("div");Ht.style.display="flex",Ht.style.alignItems="center",Ht.style.minHeight="20px",Ht.style.flexGrow="2";var hn=document.createElement("hr");if(hn.style.minWidth="20px",hn.style.border="0px",hn.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),hn.style.flexGrow="2",Ht.appendChild(hn),kt.appendChild(Ht),xe==="both"||xe==="end"){var Sn=document.createElement("div");Sn.style.display="flex",Sn.style.alignItems="center",Sn.style.minHeight="20px",Sn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Sn.style.marginRight="5px",kt.appendChild(Sn)}c.typeBoxes.push(kt)},c=this,J=0;J<4;J++)p(J);return u},o.prototype.setCurrentType=function(a,u){var p=this;this.currentType=a,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings!==void 0?p.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Se),re=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.arrowType="end",c.arrowBaseHeight=10,c.arrowBaseWidth=10,c.getArrowPoints=c.getArrowPoints.bind(c),c.setArrowType=c.setArrowType.bind(c),c.arrowTypePanel=new Z("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return He(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var p=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return a-p/2+","+(u+c/2)+" "+a+","+(u-c/2)+" "+(a+p/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=j.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(j.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=j.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(j.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",j.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),j.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var p=this.arrow2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(p,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(vt),x=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.fillColor=p.defaultFillColor,c.strokeWidth=0,c.fillPanel=new rt("Color",p.defaultColorSet,p.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return He(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(ut),w=function(h){function o(a,u,p,c){var J=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return J.opacities=[],J.opacityBoxes=[],J.opacities=u,J.currentOpacity=p,J.setCurrentOpacity=J.setCurrentOpacity.bind(J),J}return He(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(p){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=p===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentOpacity(p,c)}),u.appendChild(c);var J=document.createElement("div");J.innerText=100*p+"%",c.appendChild(J),a.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(a,u){var p=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Se),T=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=p.defaultHighlightColor,c.strokeWidth=0,c.opacity=p.defaultHighlightOpacity,c.fillPanel=new rt("Color",p.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new w("Opacity",p.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return He(o,h),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&j.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',o}(x),L='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',pe=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.bgColor="transparent",c.tipPosition={x:0,y:0},c.tipBase1Position={x:0,y:0},c.tipBase2Position={x:0,y:0},c.tipMoving=!1,c.color=p.defaultStrokeColor,c.bgColor=p.defaultFillColor,c.fontFamily=p.defaultFontFamily,c.defaultSize={x:100,y:30},c.setBgColor=c.setBgColor.bind(c),c.getTipPoints=c.getTipPoints.bind(c),c.positionTip=c.positionTip.bind(c),c.setTipPoints=c.setTipPoints.bind(c),c.colorPanel=new rt("Text color",p.defaultColorSet,c.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),c.colorPanel.onColorChanged=c.setColor,c.bgColorPanel=new rt("Fill color",p.defaultColorSet,c.bgColor,L),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new je("Font",p.defaultFontFamilies,p.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new It,c.tipGrip.visual.transform.baseVal.appendItem(j.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return He(o,h),o.prototype.ownsTarget=function(a){return h.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){j.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=j.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&h.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,h.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";h.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else h.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(j.setAttributes(this.bgRectangle,[["fill",a]]),j.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},o.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},o.prototype.setTipPoints=function(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),p=this.height/5;a&&(this.tipPosition={x:u+p/2,y:this.height+20});var c=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+p,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?c<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-p},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+p,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-p})},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){j.setAttributes(this.tip,[["points",this.getTipPoints()]]);var a=this.tipGrip.visual.transform.baseVal.getItem(0);a.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(a,0)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.select=function(){this.positionTip(),h.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,h.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.tipPosition={x:this.tipPosition.x*a,y:this.tipPosition.y*u},this.positionTip()},o.typeName="CalloutMarker",o.title="Callout marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',o}(qe),ke=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.fillColor=p.defaultFillColor,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.setOpacity=c.setOpacity.bind(c),c.createVisual=c.createVisual.bind(c),c.strokePanel=new rt("Line color",ce(p.defaultColorSet,["transparent"]),p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new rt("Fill color",ce(p.defaultColorSet,["transparent"]),c.fillColor,L),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new Rt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new xt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new w("Opacity",p.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return He(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=j.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),j.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(a){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&j.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&j.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&j.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&j.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&j.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(bt),Je=function(h){function o(a,u,p){return h.call(this,a,u,p)||this}return He(o,h),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=j.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(j.createTransform()),this.visual.appendChild(this.tip1),this.tip2=j.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(j.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(j.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),j.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var p=this.tip2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(p,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',o}(vt),Mt=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokePanel.colors=p.defaultColorSet,c.fillColor="transparent",c}return He(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(ke),Xt=function(){function h(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),h.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},h.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},h.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},h.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},h.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},h}(),$e=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.curveX=0,c.curveY=0,c.manipulationStartCurveX=0,c.manipulationStartCurveY=0,c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.positionGrips=c.positionGrips.bind(c),c.addControlGrips=c.addControlGrips.bind(c),c.adjustVisual=c.adjustVisual.bind(c),c.setupControlBox=c.setupControlBox.bind(c),c.resize=c.resize.bind(c),c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new rt("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Rt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new xt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return He(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=j.createGroup(),this.selectorCurve=j.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=j.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),j.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),j.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),j.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){h.prototype.setupControlBox.call(this),this.curveControlLine1=j.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=j.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,h.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){h.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),h.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,h.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',o}(Dt),zt=function(){function h(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(h.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),h.prototype.preventDefault=function(){this._defaultPrevented=!0},h}(),Lt=function(h){function o(a,u,p){var c=h.call(this,a,!1)||this;return c.dataUrl=u,c.state=p,c}return He(o,h),o}(zt),ht=function(h){function o(a,u,p){p===void 0&&(p=!1);var c=h.call(this,a,p)||this;return c.marker=u,c}return He(o,h),o}(zt),on=function(){function h(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return h.prototype.addEventListener=function(o,a){this[o].push(a)},h.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},h}(),Zt=function(){function h(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new De,this._isOpen=!1,this.undoRedoManager=new Xt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new on,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=h.instanceCounter++,this.styles=new ze(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=o,this.targetRoot=document.body,this.width=o.clientWidth,this.height=o.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(h.prototype,"ALL_MARKER_TYPES",{get:function(){return[gt,ae,re,qe,Mt,ke,T,pe,Je,x,vt,$e]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[gt,ae,re,qe,ke,T,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"BASIC_MARKER_TYPES",{get:function(){return[gt,ae,re,qe,T]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var p=a.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});p!==void 0&&a._availableMarkerTypes.push(p)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),h.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),et.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},h.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&St.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=St.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new zt(o))})},h.prototype.render=function(){return Le(this,void 0,void 0,function(){var o;return Be(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new Ct).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},h.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(p){var c=new zt(a,!0);p(c),c.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(p){return p(new zt(a))}),this.detachEvents(),this._isOpen=!1)}},h.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},h.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},h.prototype.removeRenderEventListener=function(o){},h.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},h.prototype.removeCloseEventListener=function(o){},h.prototype.setupResizeObserver=function(){var o=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return o.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},h.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,u)},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,p=a/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(u,p),this._isResizing=!1},h.prototype.scaleMarkers=function(o,a){var u,p=this;this._currentMarker&&this._currentMarker instanceof qe?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==p._currentMarker&&c.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},h.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},h.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},h.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},h.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=j.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},h.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},h.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},h.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},h.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},h.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},h.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},h.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},h.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var o=document.createElement("a");o.href="https://markerjs.com/",o.target="_blank",o.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},h.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},h.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ae(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ge(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},h.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},h.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},h.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},h.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(p){var c=new ht(o,o._currentMarker,!0);p(c),c.defaultPrevented&&(a=!0)}),!a){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(p){return p(new ht(o,u))})}}},h.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(J){var We=new ht(o,void 0,!0);J(We),We.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(J){var We=p.markers[J];p.setCurrentMarker(p.markers[J]),p._currentMarker.dispose(),p.markerImage.removeChild(p._currentMarker.container),p.markers.splice(p.markers.indexOf(p._currentMarker),1),p.eventListeners.markerdelete.forEach(function(xe){return xe(new ht(o,We))})},p=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(h.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),h.prototype.showNotesEditor=function(){var o;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},h.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},h.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},h.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var p=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),p<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new zt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(c){return c(new zt(o))})}},h.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},h.prototype.undoStep=function(){var o=this,a=this.undoRedoManager.undo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new zt(o))}))},h.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},h.prototype.redoStep=function(){var o=this,a=this.undoRedoManager.redo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new zt(o))}))},h.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},h.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},h.prototype.startRenderAndClose=function(){return Le(this,void 0,void 0,function(){var o,a,u=this;return Be(this,function(p){switch(p.label){case 0:return[4,this.render()];case 1:return o=p.sent(),a=this.getState(),this.eventListeners.render.forEach(function(c){return c(new Lt(u,o,a))}),this.close(!0),[2]}})})},h.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},h.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var p=a._availableMarkerTypes.find(function(J){return J.typeName===u.typeName});if(p!==void 0){var c=a.addNewMarker(p);c.restoreState(u),a.markers.push(c)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(u){return u(new zt(a))})},h.prototype.addNewMarker=function(o){var a=j.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},h.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(p){return p.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(a),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(a.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(p){return p(new ht(u,u._currentMarker))}))},h.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof ae&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ae):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new ht(a,a._currentMarker))})},h.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},h.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},h.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new ht(a,o))})},h.prototype.setCurrentMarker=function(o){var a=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new ht(a,a._currentMarker))})),this._currentMarker=o,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(u){return u(new ht(a,a._currentMarker))}))},h.prototype.onPointerDown=function(o){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||o.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0?(this.setCurrentMarker(a),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:o.clientX,y:o.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY))},h.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0&&a!==this._currentMarker&&this.setCurrentMarker(a),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},h.prototype.onPointerMove=function(o){this.touchPoints!==1&&o.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||o.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(o.clientX,o.clientY)):this.zoomLevel>1&&this.panTo({x:o.clientX,y:o.clientY}))},h.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},h.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},h.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},h.prototype.onWindowResize=function(){this.positionUI()},h.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},h.prototype.addLicenseKey=function(o){et.addKey(o)},h.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},h.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},h.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(h.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),h.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new zt(o))}))},h.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new zt(o))}))},h.instanceCounter=0,h}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var En=function(h,o){return(En=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(h,o)};function vn(h,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=h}En(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Bt(h,o,a,u){return new(a||(a=Promise))(function(p,c){function J(kt){try{xe(u.next(kt))}catch(Xe){c(Xe)}}function We(kt){try{xe(u.throw(kt))}catch(Xe){c(Xe)}}function xe(kt){var Xe;kt.done?p(kt.value):(Xe=kt.value,Xe instanceof a?Xe:new a(function(Ht){Ht(Xe)})).then(J,We)}xe((u=u.apply(h,o||[])).next())})}function Wn(h,o){var a,u,p,c,J={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return c={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function We(xe){return function(kt){return function(Xe){if(a)throw new TypeError("Generator is already executing.");for(;J;)try{if(a=1,u&&(p=2&Xe[0]?u.return:Xe[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,Xe[1])).done)return p;switch(u=0,p&&(Xe=[2&Xe[0],p.value]),Xe[0]){case 0:case 1:p=Xe;break;case 4:return J.label++,{value:Xe[1],done:!1};case 5:J.label++,u=Xe[1],Xe=[0];continue;case 7:Xe=J.ops.pop(),J.trys.pop();continue;default:if(!(p=J.trys,(p=p.length>0&&p[p.length-1])||Xe[0]!==6&&Xe[0]!==2)){J=0;continue}if(Xe[0]===3&&(!p||Xe[1]>p[0]&&Xe[1]<p[3])){J.label=Xe[1];break}if(Xe[0]===6&&J.label<p[1]){J.label=p[1],p=Xe;break}if(p&&J.label<p[2]){J.label=p[2],J.ops.push(Xe);break}p[2]&&J.ops.pop(),J.trys.pop();continue}Xe=o.call(h,J)}catch(Ht){Xe=[6,Ht],u=0}finally{a=p=0}if(5&Xe[0])throw Xe[1];return{value:Xe[0]?Xe[1]:void 0,done:!0}}([xe,kt])}}}var Bn=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),Tt=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var c=p[u],J=c[0],We=c[1];o.setAttribute(J,We)}},h.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&h.setAttributes(p,u),p},h.createLine=function(o,a,u,p,c){var J=document.createElementNS("http://www.w3.org/2000/svg","line");return J.setAttribute("x1",o.toString()),J.setAttribute("y1",a.toString()),J.setAttribute("x2",u.toString()),J.setAttribute("y2",p.toString()),c&&h.setAttributes(J,c),J},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(p,u),p},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,p,c,J,We){var xe=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(xe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",c.toString()],["refY",J.toString()]]),xe.appendChild(We),xe},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&h.setAttributes(u,a),u},h.getHollowRectanglePath=function(o,a,u,p,c,J,We,xe){return"M"+o+","+a+"V"+(a+p)+"H"+(o+u)+"V"+a+"H"+c+"V"+J+"H"+(c+We)+"V"+(J+xe)+"H"+c+"V"+a+"Z"},h}(),di=function(){function h(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),h.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},h.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},h.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new oi("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new oi("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new oi("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ai("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ai("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),oi=function(h,o){this.selector=h,this.style=o},ai=function(h,o){this.localName=h,this.style=o},Si=function(){function h(){this.blocks=[],this.display=""}return h.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},h.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},h.prototype.getUI=function(){var o=document.createElement("div");return o.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,o.style.display=this.display,this.blocks.forEach(function(a){return o.appendChild(a.getUI())}),o},h}(),or=function(){function h(){}return h.prototype.getUI=function(){var o=document.createElement("div");if(o.className=this.className,this.minWidth!==void 0&&(o.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":o.style.justifyContent="flex-start";break;case"center":o.style.justifyContent="center";break;case"end":o.style.justifyContent="flex-end"}return o.style.whiteSpace="nowrap",o},h}(),Bi=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.buttons=[],a}return vn(o,h),o.prototype.addButton=function(a){a.className=this.buttonClassName,a.colorsClassName=this.buttonColorsClassName,a.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(a)},o.prototype.getUI=function(){var a=h.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(or),pn=function(){function h(o,a){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=a,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(h.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),h.prototype.getUI=function(){var o=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return o.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},h.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},h.prototype.hide=function(){this._isHidden=!0},h}(),_t=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.elements=[],a}return vn(o,h),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=h.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(or),Fi=function(){function h(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(h.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),h.prototype.getVerticalLength=function(o){return o/this.ratio},h.prototype.getHorizontalLength=function(o){return o*this.ratio},h}(),dr=function(){function h(){}return h.getIcon=function(o,a){if(o>0&&a>0){var u=new Fi(o,a),p=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),J=document.createElementNS("http://www.w3.org/2000/svg","svg");J.setAttribute("xmlns","http://www.w3.org/2000/svg"),J.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(J);var We=Tt.createDefs();J.appendChild(We);var xe=Tt.createElement("clipPath",[["id","text-bg-clip"]]);We.appendChild(xe);var kt=Tt.createPath(Tt.getHollowRectanglePath((24-p)/2,(24-c)/2,p,c,(24-p)/2+2,(24-c)/2+2,p-4,c-4));J.appendChild(kt);var Xe=Tt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Xe.appendChild(Tt.createTSpan(o+":"+a)),J.appendChild(Xe);var Ht=Xe.getBBox();Tt.setAttributes(Xe,[["x",((24-Ht.width)/2).toString()],["y",((24-Ht.height)/2-Ht.y).toString()]]);var hn=Tt.createPath(Tt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ht.width))/2,(24-Math.ceil(Ht.height))/2,Math.ceil(Ht.width),Math.ceil(Ht.height)));return xe.appendChild(hn),Tt.setAttributes(kt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(J),J.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},h}(),ki=function(h){function o(a,u,p){var c=h.call(this,a,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=p,c}return vn(o,h),o.prototype.setupDropdown=function(){var a=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(pn),ln=function(){function h(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=Tt.createGroup(),this.visual.appendChild(Tt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Tt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return Tt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},h}(),Yi=function(){function h(o,a,u,p){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=a,this.margin=u,this.container=p,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(h.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&Tt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),h.prototype.open=function(){var o=this;this.cropShadeElement=Tt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Tt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(Tt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Tt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.verticalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.cropRectElement=Tt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ln(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ln(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ln(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ln(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},h.prototype.setCropRectangle=function(o){this.cropRect=o;var a=Object.assign({},this.cropRect);this.zoomFactor!==1&&(a.width=this.cropRect.width*this.zoomFactor,a.height=this.cropRect.height*this.zoomFactor,a.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-a.width/2,a.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),Tt.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(c,J){var We=a.y+u*(J+1);Tt.setAttributes(c,[["x1",""+a.x],["y1",""+We],["x2",""+(a.x+a.width)],["y2",""+We]])});var p=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,J){var We=a.x+p*(J+1);Tt.setAttributes(c,[["x1",""+We],["y1",""+a.y],["x2",""+We],["y2",""+(a.y+a.height)]])}),Tt.setAttributes(this.cropShadeElement,[["d",Tt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},h.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},h.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},h.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},h.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},h.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},h.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,p=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+u<this.margin&&(u=this.margin-a.x),a.x+=u,a.width=this.cropRect.x+this.cropRect.width-a.x;break;case this.bottomRightGrip:case this.topRightGrip:a.width+u>this.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=p,a.height=this.cropRect.y+this.cropRect.height-a.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?a.height=this.aspectRatio.getVerticalLength(a.width):a.height+=p}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},h.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),p=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<p/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=p,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=o-this.cropRect.width/2,this.cropRect.y=a-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},h.prototype.getRescaledRect=function(o,a,u,p,c,J){var We=u/o,xe=p/a;return{x:(c.x-J)*We+J,y:(c.y-J)*xe+J,width:c.width*We,height:c.height*xe}},h.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},h}(),fr=function(){function h(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(h.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),h.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},h.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},h.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},h.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},h.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();Tt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},h.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},h.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var p=u%5==0?this.height/3:this.height/6;a+="h4v"+-p+"h1v"+p}a+="v1H0Z",this.scaleShape=Tt.createPath(a);var c=Tt.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=Tt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Tt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var J=Tt.createTSpan("");return J.innerHTML="°",this.angleLabelElement.appendChild(J),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},h}(),pr=function(){function h(){this.naturalSize=!1,this.imageType="image/png"}return h.prototype.rasterize=function(o,a,u,p,c,J,We){var xe=this;return new Promise(function(kt){var Xe=document.createElement("canvas");Xe.width=o.width.baseVal.value-2*p,Xe.height=o.height.baseVal.value-2*p;var Ht=1,hn=1;xe.naturalSize===!0?(Ht=a.naturalWidth/(o.width.baseVal.value-2*p)/J,hn=a.naturalHeight/(o.height.baseVal.value-2*p)/We,Xe.width=a.naturalWidth/J,Xe.height=a.naturalHeight/We):xe.width!==void 0&&xe.height!==void 0&&(Ht=xe.width/u.width,hn=xe.height/u.height,Xe.width*=Ht,Xe.height*=hn);var Sn=Xe.getContext("2d");Sn.translate(Xe.width/2,Xe.height/2),Sn.rotate(c*Math.PI/180),Sn.scale(J,We),Sn.translate(-Xe.width/2,-Xe.height/2),Sn.drawImage(a,0,0,Xe.width,Xe.height);var Ri=document.createElement("canvas");Ri.width=u.width*Ht,Ri.height=u.height*hn,Ri.getContext("2d").putImageData(Sn.getImageData((u.x-p)*Ht,(u.y-p)*hn,u.width*Ht,u.height*hn),0,0),kt(Ri.toDataURL(xe.imageType,xe.imageQuality))})},h}(),Qe=function(){function h(o){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=h.instanceCounter++,this.styles=new di(this.instanceNo),this.target=o,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),h.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},h.prototype.show=function(){this.showUI(),this.open()},h.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},h.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},h.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},h.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},h.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},h.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},h.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(a,u)}},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Tt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},h.prototype.resize=function(o,a){this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},h.prototype.setEditingTarget=function(){var o=document.createElement("canvas");o.width=this.target.naturalWidth,o.height=this.target.naturalHeight,o.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var a=o.toDataURL();Tt.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},h.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left-this.CANVAS_MARGIN,this.top=o.top-a.top-this.CANVAS_MARGIN},h.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Tt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Tt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Tt.createGroup(),this.editingTargetRotationScaleContainer=Tt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=Tt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=Tt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=Tt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},h.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},h.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Tt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Yi(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},h.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,a=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=o+"px "+a+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-a+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},h.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},h.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},h.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},h.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,a=this.target.offsetTop>o+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},h.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},h.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Si,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new Bi;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(hn){var Sn=new pn(dr.getIcon(hn.horizontal,hn.vertical),hn.horizontal===0&&hn.vertical===0?"FREE":hn.horizontal+":"+hn.vertical);Sn.onClick=function(){return o.ratioButtonClicked(hn)},u.push(Sn)}),this.aspectRatioButton=new ki(dr.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var p=new pn('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");p.isActive=this.isGridVisible,p.onClick=function(){o.isGridVisible=!o.isGridVisible,p.isActive=o.isGridVisible},a.addButton(p);var c=new pn('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(c.isActive=this.zoomToCropEnabled,c.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,c.isActive=o.zoomToCropEnabled},a.addButton(c),!Bn.isLicensed){var J=new _t;this.topToolbar.addElementBlock(J);var We=document.createElement("div");We.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var xe=document.createElement("a");xe.style.color="currentColor",xe.href="https://markerjs.com/products/cropro",xe.target="_blank",xe.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',We.appendChild(xe),J.addElement(We)}var kt=new Bi;kt.minWidth=3*this.toolbarHeight+"px",kt.contentAlign="end",this.topToolbar.addButtonBlock(kt);var Xe=new pn('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Xe.onClick=this.startRenderAndClose,kt.addButton(Xe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Xe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ht=new pn('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Ht.onClick=this.close,kt.addButton(Ht),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ht.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},h.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Si,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new Bi;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new pn('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var p=new pn('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");p.onClick=this.rotateRightButtonClicked,a.addButton(p);var c=new _t;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new fr("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(kt){o.rotateBy(kt),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var J=new Bi;J.minWidth=2*this.toolbarHeight+"px",J.contentAlign="end",this.bottomToolbar.addButtonBlock(J);var We=new pn('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");We.onClick=this.flipHorizontallyButtonClicked,J.addButton(We);var xe=new pn('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");xe.onClick=this.flipVerticallyButtonClicked,J.addButton(xe)},h.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},h.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=dr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},h.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Fi(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},h.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},h.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},h.prototype.onWindowResize=function(){this.positionUI()},h.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},h.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},h.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},h.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},h.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},h.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},h.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},h.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},h.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},h.prototype.startRenderAndClose=function(){return Bt(this,void 0,void 0,function(){var o,a;return Wn(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),a=this.getState(),this.renderEventListeners.forEach(function(p){return p(o,a)}),this.close(!0),[2]}})})},h.prototype.render=function(){return Bt(this,void 0,void 0,function(){var o;return Wn(this,function(a){switch(a.label){case 0:return(o=new pr).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),Tt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return a.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,a.sent()]}})})},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ai("toolbar",`
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
overflow: hidden;
|
|
line-height: 0px;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ai("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ai("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ai("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*o)+`px;
|
|
height: `+(this.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ai("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ai("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new oi("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new oi("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ai("toolbar_dropdown",`
|
|
position: absolute;
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
z-index: 20;
|
|
white-space: normal;
|
|
box-sizing: content-box;
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
line-height: 0px;
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new ai("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ai("toolbar_straightener_block",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new ai("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ai("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},h.instanceCounter=0,h}(),Ft=y("8hTe"),Ji=y.n(Ft),ar=/<pre[^>]*>/g;function mr(h){var o=document.createElement("div");return o.innerHTML=h,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var gr=Ze.a=function(h){var o=h.value,a=o===void 0?"":o,u=h.edit,p=u===void 0?!1:u,c=h.className,J=h.showTextOnly,We=h.showLines,xe=h.replaces,kt=h.zoomImg,Xe=h.hasMask,Ht=h.style,hn=Ht===void 0?{}:Ht,Sn=h.stylesPrev,Ri=Sn===void 0?{}:Sn,Hi=String(a),ei=Object(X.useRef)(),Zi=Object(X.useRef)(),Gr=Object(X.useState)(""),xi=Object(E.a)(Gr,2),_i=xi[0],sr=xi[1],vr=Object(X.useState)("office"),zi=Object(E.a)(vr,2),lr=zi[0],Wi=zi[1],so=function(){var bn=new Qe(Zi.current);bn.displayMode="popup",bn.addRenderEventListener(function(){var $n=Object(ee.a)(B.a.mark(function yn(si){var Rn;return B.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ei.current.style.display="none",ti.next=3,Object(st.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si}});case 3:Rn=ti.sent,Rn!=null&&Rn.id&&xe(Zi.current.getAttribute("src").replace(Ie.a.API_SERVER,""),"/api/attachments/".concat(Rn==null?void 0:Rn.id,"?type=").concat(Rn.content_type));case 5:case"end":return ti.stop()}},yn)}));return function(yn){return $n.apply(this,arguments)}}()),bn.show()},Kr=function(){var bn=new Zt(Zi.current);bn.settings.displayMode="popup",bn.addEventListener("render",function(){var $n=Object(ee.a)(B.a.mark(function yn(si){var Rn;return B.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:if(ei.current.style.display="none",!Zi.current){ti.next=6;break}return ti.next=4,Object(st.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si.dataUrl}});case 4:Rn=ti.sent,Rn!=null&&Rn.id&&xe(Zi.current.getAttribute("src").replace(Ie.a.API_SERVER,""),"/api/attachments/".concat(Rn==null?void 0:Rn.id,"?type=").concat(Rn.content_type));case 6:case"end":return ti.stop()}},yn)}));return function(yn){return $n.apply(this,arguments)}}()),bn.show(),window.markerArea=bn},Li=Object(X.useMemo)(function(){try{var Vn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,bn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,$n=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hi=Hi.replace(Vn,"("+Ie.a.API_SERVER+"/api/attachments/").replace(bn,'"'+Ie.a.API_SERVER+"/api/attachments/").replace($n,'"'+Ie.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),Hi=Hi.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(yr){}var yn=Re(Hi),si=Ee();if(Hi.match(/\[TOC\]/)&&(yn=yn.replace("<p>[TOC]</p>",Ve()),Ke()),yn=yn.replace(/(__special_katext_id_\d+__)/g,function(yr,ti){var Zn=si[ti],ur=Zn.type,Or=Zn.expression;return Object(Te.renderToString)(mr(Or)||"",{displayMode:ur==="block",throwOnError:!1,output:"html"})}),yn=yn.replace(/▁/g,"\u2581\u2581\u2581"),ye(),J){var Rn=document.createElement("div");return Rn.innerHTML=yn,Rn.innerText}return setTimeout(function(){return Ir()},500),yn},[Hi]),Jn=Object(X.useRef)();ge.WebkitLineClamp=We,We&&(hn=Object(C.a)(Object(C.a)({},hn),ge));function _r(Vn){var bn=Vn.target;if(bn.tagName.toUpperCase()==="IMG"){if(kt){var $n=bn.getAttribute("src");sr($n),Wi("image")}}else if(bn.tagName.toUpperCase()==="A"){var yn=bn.getAttribute("href");if(yn.indexOf("office")>-1)Vn.preventDefault(),sr(yn),Wi("office");else if(yn.indexOf("application/pdf")>-1)Vn.preventDefault(),sr(yn),Wi("pdf");else if(yn.indexOf("type=text")>-1)Vn.preventDefault(),sr(yn),Wi("html");else if(yn.startsWith("#")){Vn.preventDefault();var si=document.getElementById(yn.replace("#",""));si&&si.scrollIntoView(!0)}}}var Ir=function(){var bn,$n=(bn=Jn.current)===null||bn===void 0?void 0:bn.querySelectorAll("video");$n==null||$n.forEach(function(yn){if(yn.oncontextmenu=function(){return!1},yn.src.indexOf(".m3u8")>-1&&!yn.canPlayType("application/vnd.apple.mpegurl")){if(ue.a.isSupported()){var si=new ue.a;si.loadSource(yn.src),si.attachMedia(yn)}}})};Object(X.useEffect)(function(){if(Jn.current&&Li&&(Li.match(ar)&&window.PR.prettyPrint()),Jn.current)return Jn.current.addEventListener("click",_r),function(){Jn.current.removeEventListener("click",_r),ye(),Ke()}},[Li,Jn.current,_r]);var Xr=function(bn){if(!p)return;bn.target.nodeName==="IMG"?(ei.current.style.display="flex",ei.current.style.width=bn.target.clientWidth+"px",ei.current.style.height=bn.target.clientHeight+"px",ei.current.style.top=bn.target.offsetTop+"px",ei.current.style.left=bn.target.offsetLeft+"px",Zi.current.src=bn.target.getAttribute("src")):ei.current.style.display="none"};return D.a.createElement("div",{style:{position:"relative"}},D.a.createElement("div",{ref:Jn,style:Object(C.a)({},hn),className:"".concat(c||""," markdown-body ").concat(Ji.a.mdBody),onMouseOver:Xr,dangerouslySetInnerHTML:{__html:Li}}),D.a.createElement("div",{ref:ei,className:Ji.a.button},D.a.createElement(de.a,null,D.a.createElement(z.a,{onClick:function(){return so()}},"\u88C1\u526A"),D.a.createElement(z.a,{onClick:function(){return Kr()}},"\u7F16\u8F91"))),D.a.createElement("img",{ref:Zi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),D.a.createElement(nt.a,{close:!0,data:_i,hasMask:Xe,type:_i!=null&&_i.length?lr:"",style:Object(C.a)({},Ri),onClose:function(){return sr("")}}))}},"9VGf":function(mt,Ze,y){"use strict";y.d(Ze,"a",function(){return G});var S=y("q1tI"),de=y.n(S);function G(z,C){var ee=Object(S.useRef)();Object(S.useEffect)(function(){ee.current=z}),Object(S.useEffect)(function(){function E(){ee.current()}if(C!==null){var R=setInterval(E,C);return function(){return clearInterval(R)}}},[C])}},Bd2K:function(mt,Ze,y){(function(S){S(y("VrN/"),y("osHv"))})(function(S){S.defineOption("autoCloseTags",!1,function(B,X,D){if(D!=S.Init&&D&&B.removeKeyMap("autoCloseTags"),!X)return;var O={name:"autoCloseTags"};(typeof X!="object"||X.whenClosing!==!1)&&(O["'/'"]=function(te){return ee(te)}),(typeof X!="object"||X.whenOpening!==!1)&&(O["'>'"]=function(te){return z(te)}),B.addKeyMap(O)});var de=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],G=["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 z(B){if(B.getOption("disableInput"))return S.Pass;for(var X=B.listSelections(),D=[],O=B.getOption("autoCloseTags"),te=0;te<X.length;te++){if(!X[te].empty())return S.Pass;var Q=X[te].head,W=B.getTokenAt(Q),H=S.innerMode(B.getMode(),W.state),P=H.state,ie=H.mode.xmlCurrentTag&&H.mode.xmlCurrentTag(P),se=ie&&ie.name;if(!se)return S.Pass;var Oe=H.mode.configuration=="html",Ke=typeof O=="object"&&O.dontCloseTags||Oe&&de,ge=typeof O=="object"&&O.indentTags||Oe&&G;W.end>Q.ch&&(se=se.slice(0,se.length-W.end+Q.ch));var Me=se.toLowerCase();if(!se||W.type=="string"&&(W.end!=Q.ch||!/[\"\']/.test(W.string.charAt(W.string.length-1))||W.string.length==1)||W.type=="tag"&&ie.close||W.string.indexOf("/")==Q.ch-W.start-1||Ke&&E(Ke,Me)>-1||R(B,H.mode.xmlCurrentContext&&H.mode.xmlCurrentContext(P)||[],se,Q,!0))return S.Pass;var Ve=typeof O=="object"&&O.emptyTags;if(Ve&&E(Ve,se)>-1){D[te]={text:"/>",newPos:S.Pos(Q.line,Q.ch+2)};continue}var _e=ge&&E(ge,Me)>-1;D[te]={indent:_e,text:">"+(_e?`
|
|
|
|
`:"")+"</"+se+">",newPos:_e?S.Pos(Q.line+1,0):S.Pos(Q.line,Q.ch+1)}}for(var be=typeof O=="object"&&O.dontIndentOnAutoClose,te=X.length-1;te>=0;te--){var Ne=D[te];B.replaceRange(Ne.text,X[te].head,X[te].anchor,"+insert");var we=B.listSelections().slice(0);we[te]={head:Ne.newPos,anchor:Ne.newPos},B.setSelections(we),!be&&Ne.indent&&(B.indentLine(Ne.newPos.line,null,!0),B.indentLine(Ne.newPos.line+1,null,!0))}}function C(B,X){for(var D=B.listSelections(),O=[],te=X?"/":"</",Q=B.getOption("autoCloseTags"),W=typeof Q=="object"&&Q.dontIndentOnSlash,H=0;H<D.length;H++){if(!D[H].empty())return S.Pass;var P=D[H].head,ie=B.getTokenAt(P),se=S.innerMode(B.getMode(),ie.state),Oe=se.state;if(X&&(ie.type=="string"||ie.string.charAt(0)!="<"||ie.start!=P.ch-1))return S.Pass;var Ke,ge=se.mode.name!="xml"&&B.getMode().name=="htmlmixed";if(ge&&se.mode.name=="javascript")Ke=te+"script";else if(ge&&se.mode.name=="css")Ke=te+"style";else{var Me=se.mode.xmlCurrentContext&&se.mode.xmlCurrentContext(Oe);if(!Me||Me.length&&R(B,Me,Me[Me.length-1],P))return S.Pass;Ke=te+Me[Me.length-1]}B.getLine(P.line).charAt(ie.end)!=">"&&(Ke+=">"),O[H]=Ke}if(B.replaceSelections(O),D=B.listSelections(),!W)for(var H=0;H<D.length;H++)(H==D.length-1||D[H].head.line<D[H+1].head.line)&&B.indentLine(D[H].head.line)}function ee(B){return B.getOption("disableInput")?S.Pass:C(B,!0)}S.commands.closeTag=function(B){return C(B)};function E(B,X){if(B.indexOf)return B.indexOf(X);for(var D=0,O=B.length;D<O;++D)if(B[D]==X)return D;return-1}function R(B,X,D,O,te){if(!S.scanForClosingTag)return!1;var Q=Math.min(B.lastLine()+1,O.line+500),W=S.scanForClosingTag(B,O,null,Q);if(!W||W.tag!=D)return!1;for(var H=te?1:0,P=X.length-1;P>=0&&X[P]==D;P--)++H;O=W.to;for(var P=1;P<H;P++){var ie=S.scanForClosingTag(B,O,null,Q);if(!ie||ie.tag!=D)return!1;O=ie.to}return!0}})},BjJ7:function(mt,Ze,y){"use strict";y.d(Ze,"d",function(){return de}),y.d(Ze,"c",function(){return G}),y.d(Ze,"e",function(){return z}),y.d(Ze,"b",function(){return C}),y.d(Ze,"a",function(){return E});var S=y("m3rI");function de(R){var B=!0;if(R.length>0){for(var X=0;X<R.length;X++)if(R[X].compile_success==0||!R[X].compile_success){B=!1;break}}else B=!1;return B}function G(R){for(var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",X=[],D=0;D<R.length;D++){var O=R[D],te=B?"".concat(B,"/").concat(O.name):"".concat(O.name);X.push({title:O.name,isLeaf:!(O.type==="tree"),key:te})}return X}function z(R,B,X){for(var D=0;D<R.length;D++){var O=R[D];if(O.key===B){O.children=X;break}O.children&&z(O.children,B,X)}return R}function C(R,B,X){var D;return function(){var O=this,te=arguments,Q=function(){D=null,X||R.apply(O,te)},W=X&&!D;clearTimeout(D),D=setTimeout(Q,B),W&&R.apply(O,te)}}var ee=!0,E=S.a.API_SERVER},"C+DQ":function(mt,Ze,y){},D1Df:function(mt,Ze,y){"use strict";function S(k){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?S=function(he){return typeof he}:S=function(he){return he&&typeof Symbol=="function"&&he.constructor===Symbol&&he!==Symbol.prototype?"symbol":typeof he},S(k)}function de(){return de=Object.assign||function(k){for(var K=1;K<arguments.length;K++){var he=arguments[K];for(var $ in he)Object.prototype.hasOwnProperty.call(he,$)&&(k[$]=he[$])}return k},de.apply(this,arguments)}function G(k,K){var he=Object.keys(k);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(k);K&&($=$.filter(function(Re){return Object.getOwnPropertyDescriptor(k,Re).enumerable})),he.push.apply(he,$)}return he}function z(k){for(var K=1;K<arguments.length;K++){var he=arguments[K]!=null?arguments[K]:{};K%2?G(he,!0).forEach(function($){W(k,$,he[$])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(he)):G(he).forEach(function($){Object.defineProperty(k,$,Object.getOwnPropertyDescriptor(he,$))})}return k}function C(k,K){if(k==null)return{};var he=ee(k,K),$,Re;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(k);for(Re=0;Re<M.length;Re++){if($=M[Re],K.indexOf($)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(k,$))continue;he[$]=k[$]}}return he}function ee(k,K){if(k==null)return{};var he={},$=Object.keys(k),Re,M;for(M=0;M<$.length;M++){if(Re=$[M],K.indexOf(Re)>=0)continue;he[Re]=k[Re]}return he}function E(k,K){if(!(k instanceof K))throw new TypeError("Cannot call a class as a function")}function R(k,K){for(var he=0;he<K.length;he++){var $=K[he];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(k,$.key,$)}}function B(k,K,he){return K&&R(k.prototype,K),he&&R(k,he),k}function X(k,K){return K&&(S(K)==="object"||typeof K=="function")?K:O(k)}function D(k){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(he){return he.__proto__||Object.getPrototypeOf(he)},D(k)}function O(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function te(k,K){if(typeof K!="function"&&K!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(K&&K.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),K&&Q(k,K)}function Q(k,K){return Q=Object.setPrototypeOf||function($,Re){return $.__proto__=Re,$},Q(k,K)}function W(k,K,he){return K in k?Object.defineProperty(k,K,{value:he,enumerable:!0,configurable:!0,writable:!0}):k[K]=he,k}var H=y("q1tI"),P=y("17x9"),ie=y("H38U"),se=y("aRTE");function Oe(k){for(var K="",he=0;he<k.length;he++){var $=k.charCodeAt(he);$<128?K+=String.fromCharCode($):$<2048?(K+=String.fromCharCode(192|$>>6),K+=String.fromCharCode(128|$&63)):$<55296||$>=57344?(K+=String.fromCharCode(224|$>>12),K+=String.fromCharCode(128|$>>6&63),K+=String.fromCharCode(128|$&63)):(he++,$=65536+(($&1023)<<10|k.charCodeAt(he)&1023),K+=String.fromCharCode(240|$>>18),K+=String.fromCharCode(128|$>>12&63),K+=String.fromCharCode(128|$>>6&63),K+=String.fromCharCode(128|$&63))}return K}var Ke={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},ge={},Me=4,Ve=.1;function _e(k){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,he=[];return k.forEach(function($,Re){var M=null;$.forEach(function(g,ue){if(!g&&M!==null){he.push("M".concat(M+K," ").concat(Re+K,"h").concat(ue-M,"v1H").concat(M+K,"z")),M=null;return}if(ue===$.length-1){if(!g)return;M===null?he.push("M".concat(ue+K,",").concat(Re+K," h1v1H").concat(ue+K,"z")):he.push("M".concat(M+K,",").concat(Re+K," h").concat(ue+1-M,"v1H").concat(M+K,"z"));return}g&&M===null&&(M=ue)})}),he.join("")}function be(k,K){return k.slice().map(function(he,$){return $<K.y||$>=K.y+K.h?he:he.map(function(Re,M){return M<K.x||M>=K.x+K.w?Re:!1})})}function Ne(k,K){var he=k.imageSettings,$=k.size,Re=k.includeMargin;if(he==null)return null;var M=Re?Me:0,g=K.length+M*2,ue=Math.floor($*Ve),Ie=g/$,Te=(he.width||ue)*Ie,nt=(he.height||ue)*Ie,st=he.x==null?K.length/2-Te/2:he.x*Ie,Ue=he.y==null?K.length/2-nt/2:he.y*Ie,He=null;if(he.excavate){var Le=Math.floor(st),Be=Math.floor(Ue),ce=Math.ceil(Te+st-Le),j=Math.ceil(nt+Ue-Be);He={x:Le,y:Be,w:ce,h:j}}return{x:st,y:Ue,h:nt,w:Te,excavation:He}}var we=function(){try{new Path2D().addPath(new Path2D)}catch(k){return!1}return!0}(),N=function(k){te(K,k);function K(){var he,$;E(this,K);for(var Re=arguments.length,M=new Array(Re),g=0;g<Re;g++)M[g]=arguments[g];return $=X(this,(he=D(K)).call.apply(he,[this].concat(M))),W(O($),"_canvas",void 0),W(O($),"_image",void 0),W(O($),"state",{imgLoaded:!1}),W(O($),"handleImageLoad",function(){$.setState({imgLoaded:!0})}),$}return B(K,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var $=this.props,Re=$.value,M=$.size,g=$.level,ue=$.bgColor,Ie=$.fgColor,Te=$.includeMargin,nt=$.imageSettings,st=new ie(-1,se[g]);if(st.addData(Oe(Re)),st.make(),this._canvas!=null){var Ue=this._canvas,He=Ue.getContext("2d");if(!He)return;var Le=st.modules;if(Le===null)return;var Be=Te?Me:0,ce=Le.length+Be*2,j=Ne(this.props,Le);nt!=null&&j!=null&&(j.excavation!=null&&(Le=be(Le,j.excavation)));var et=window.devicePixelRatio||1;Ue.height=Ue.width=M*et;var Ct=M/ce*et;He.scale(Ct,Ct),He.fillStyle=ue,He.fillRect(0,0,ce,ce),He.fillStyle=Ie,we?He.fill(new Path2D(_e(Le,Be))):Le.forEach(function(St,ze){St.forEach(function(pt,fe){pt&&He.fillRect(fe+Be,ze+Be,1,1)})}),this.state.imgLoaded&&this._image&&j!=null&&He.drawImage(this._image,j.x+Be,j.y+Be,j.w,j.h)}}},{key:"render",value:function(){var $=this,Re=this.props,M=Re.value,g=Re.size,ue=Re.level,Ie=Re.bgColor,Te=Re.fgColor,nt=Re.style,st=Re.includeMargin,Ue=Re.imageSettings,He=C(Re,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),Le=z({height:g,width:g},nt),Be=null,ce=Ue&&Ue.src;return Ue!=null&&ce!=null&&(Be=H.createElement("img",{src:ce,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(et){return $._image=et}})),H.createElement(H.Fragment,null,H.createElement("canvas",de({style:Le,height:g,width:g,ref:function(et){return $._canvas=et}},He)),Be)}}]),K}(H.PureComponent);W(N,"defaultProps",Ke);var Ee=function(k){te(K,k);function K(){return E(this,K),X(this,D(K).apply(this,arguments))}return B(K,[{key:"render",value:function(){var $=this.props,Re=$.value,M=$.size,g=$.level,ue=$.bgColor,Ie=$.fgColor,Te=$.includeMargin,nt=$.imageSettings,st=C($,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),Ue=new ie(-1,se[g]);Ue.addData(Oe(Re)),Ue.make();var He=Ue.modules;if(He===null)return null;var Le=Te?Me:0,Be=He.length+Le*2,ce=Ne(this.props,He),j=null;nt!=null&&ce!=null&&(ce.excavation!=null&&(He=be(He,ce.excavation)),j=H.createElement("image",{xlinkHref:nt.src,height:ce.h,width:ce.w,x:ce.x+Le,y:ce.y+Le,preserveAspectRatio:"none"}));var et=_e(He,Le);return H.createElement("svg",de({shapeRendering:"crispEdges",height:M,width:M,viewBox:"0 0 ".concat(Be," ").concat(Be)},st),H.createElement("path",{fill:ue,d:"M0,0 h".concat(Be,"v").concat(Be,"H0z")}),H.createElement("path",{fill:Ie,d:et}),j)}}]),K}(H.PureComponent);W(Ee,"defaultProps",Ke);var ye=function(K){var he=K.renderAs,$=C(K,["renderAs"]),Re=he==="svg"?Ee:N;return H.createElement(Re,$)};ye.defaultProps=z({renderAs:"canvas"},Ke),mt.exports=ye},DlQD:function(mt,Ze,y){(function(S,de){mt.exports=de()})(this,function(){"use strict";function S(ae,Z){for(var re=0;re<Z.length;re++){var x=Z[re];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(ae,x.key,x)}}function de(ae,Z,re){return Z&&S(ae.prototype,Z),re&&S(ae,re),ae}function G(ae,Z){if(!ae)return;if(typeof ae=="string")return z(ae,Z);var re=Object.prototype.toString.call(ae).slice(8,-1);if(re==="Object"&&ae.constructor&&(re=ae.constructor.name),re==="Map"||re==="Set")return Array.from(ae);if(re==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(re))return z(ae,Z)}function z(ae,Z){(Z==null||Z>ae.length)&&(Z=ae.length);for(var re=0,x=new Array(Z);re<Z;re++)x[re]=ae[re];return x}function C(ae,Z){var re;if(typeof Symbol=="undefined"||ae[Symbol.iterator]==null){if(Array.isArray(ae)||(re=G(ae))||Z&&ae&&typeof ae.length=="number"){re&&(ae=re);var x=0;return function(){return x>=ae.length?{done:!0}:{done:!1,value:ae[x++]}}}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 re=ae[Symbol.iterator](),re.next.bind(re)}function ee(ae,Z){return Z={exports:{}},ae(Z,Z.exports),Z.exports}var E=ee(function(ae){function Z(){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 re(x){ae.exports.defaults=x}ae.exports={defaults:Z(),getDefaults:Z,changeDefaults:re}}),R=E.defaults,B=E.getDefaults,X=E.changeDefaults,D=/[&<>"']/,O=/[&<>"']/g,te=/[<>"']|&(?!#?\w+;)/,Q=/[<>"']|&(?!#?\w+;)/g,W={"&":"&","<":"<",">":">",'"':""","'":"'"},H=function(Z){return W[Z]};function P(ae,Z){if(Z){if(D.test(ae))return ae.replace(O,H)}else if(te.test(ae))return ae.replace(Q,H);return ae}var ie=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function se(ae){return ae.replace(ie,function(Z,re){return re=re.toLowerCase(),re==="colon"?":":re.charAt(0)==="#"?re.charAt(1)==="x"?String.fromCharCode(parseInt(re.substring(2),16)):String.fromCharCode(+re.substring(1)):""})}var Oe=/(^|[^\[])\^/g;function Ke(ae,Z){ae=ae.source||ae,Z=Z||"";var re={replace:function(w,T){return T=T.source||T,T=T.replace(Oe,"$1"),ae=ae.replace(w,T),re},getRegex:function(){return new RegExp(ae,Z)}};return re}var ge=/[^\w:]/g,Me=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ve(ae,Z,re){if(ae){var x;try{x=decodeURIComponent(se(re)).replace(ge,"").toLowerCase()}catch(w){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}Z&&!Me.test(re)&&(re=N(Z,re));try{re=encodeURI(re).replace(/%25/g,"%")}catch(w){return null}return re}var _e={},be=/^[^:]+:\/*[^/]*$/,Ne=/^([^:]+:)[\s\S]*$/,we=/^([^:]+:\/*[^/]*)[\s\S]*$/;function N(ae,Z){_e[" "+ae]||(be.test(ae)?_e[" "+ae]=ae+"/":_e[" "+ae]=K(ae,"/",!0)),ae=_e[" "+ae];var re=ae.indexOf(":")===-1;return Z.substring(0,2)==="//"?re?Z:ae.replace(Ne,"$1")+Z:Z.charAt(0)==="/"?re?Z:ae.replace(we,"$1")+Z:ae+Z}var Ee={exec:function(){}};function ye(ae){for(var Z=1,re,x;Z<arguments.length;Z++){re=arguments[Z];for(x in re)Object.prototype.hasOwnProperty.call(re,x)&&(ae[x]=re[x])}return ae}function k(ae,Z){var re=ae.replace(/\|/g,function(T,L,pe){for(var ke=!1,Je=L;--Je>=0&&pe[Je]==="\\";)ke=!ke;return ke?"|":" |"}),x=re.split(/ \|/),w=0;if(x.length>Z)x.splice(Z);else for(;x.length<Z;)x.push("");for(;w<x.length;w++)x[w]=x[w].trim().replace(/\\\|/g,"|");return x}function K(ae,Z,re){var x=ae.length;if(x===0)return"";for(var w=0;w<x;){var T=ae.charAt(x-w-1);if(T===Z&&!re)w++;else if(T!==Z&&re)w++;else break}return ae.substr(0,x-w)}function he(ae,Z){if(ae.indexOf(Z[1])===-1)return-1;for(var re=ae.length,x=0,w=0;w<re;w++)if(ae[w]==="\\")w++;else if(ae[w]===Z[0])x++;else if(ae[w]===Z[1]&&(x--,x<0))return w;return-1}function $(ae){ae&&ae.sanitize&&!ae.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 Re={escape:P,unescape:se,edit:Ke,cleanUrl:Ve,resolveUrl:N,noopTest:Ee,merge:ye,splitCells:k,rtrim:K,findClosingBracket:he,checkSanitizeDeprecation:$},M=E.defaults,g=Re.rtrim,ue=Re.splitCells,Ie=Re.escape,Te=Re.findClosingBracket;function nt(ae,Z,re){var x=Z.href,w=Z.title?Ie(Z.title):null,T=ae[1].replace(/\\([\[\]])/g,"$1");return ae[0].charAt(0)!=="!"?{type:"link",raw:re,href:x,title:w,text:T}:{type:"image",raw:re,href:x,title:w,text:Ie(T)}}function st(ae,Z){var re=ae.match(/^(\s+)(?:```)/);if(re===null)return Z;var x=re[1];return Z.split(`
|
|
`).map(function(w){var T=w.match(/^\s+/);if(T===null)return w;var L=T[0];return L.length>=x.length?w.slice(x.length):w}).join(`
|
|
`)}var Ue=function(){function ae(re){this.options=re||M}var Z=ae.prototype;return Z.space=function(x){var w=this.rules.block.newline.exec(x);if(w)return w[0].length>1?{type:"space",raw:w[0]}:{raw:`
|
|
`}},Z.code=function(x,w){var T=this.rules.block.code.exec(x);if(T){var L=w[w.length-1];if(L&&L.type==="paragraph")return{raw:T[0],text:T[0].trimRight()};var pe=T[0].replace(/^ {4}/gm,"");return{type:"code",raw:T[0],codeBlockStyle:"indented",text:this.options.pedantic?pe:g(pe,`
|
|
`)}}},Z.fences=function(x){var w=this.rules.block.fences.exec(x);if(w){var T=w[0],L=st(T,w[3]||"");return{type:"code",raw:T,lang:w[2]?w[2].trim():w[2],text:L}}},Z.heading=function(x){var w=this.rules.block.heading.exec(x);if(w)return{type:"heading",raw:w[0],depth:w[1].length,text:w[2]}},Z.nptable=function(x){var w=this.rules.block.nptable.exec(x);if(w){var T={type:"table",header:ue(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
|
|
`):[],raw:w[0]};if(T.header.length===T.align.length){var L=T.align.length,pe;for(pe=0;pe<L;pe++)/^ *-+: *$/.test(T.align[pe])?T.align[pe]="right":/^ *:-+: *$/.test(T.align[pe])?T.align[pe]="center":/^ *:-+ *$/.test(T.align[pe])?T.align[pe]="left":T.align[pe]=null;for(L=T.cells.length,pe=0;pe<L;pe++)T.cells[pe]=ue(T.cells[pe],T.header.length);return T}}},Z.hr=function(x){var w=this.rules.block.hr.exec(x);if(w)return{type:"hr",raw:w[0]}},Z.blockquote=function(x){var w=this.rules.block.blockquote.exec(x);if(w){var T=w[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:w[0],text:T}}},Z.list=function(x){var w=this.rules.block.list.exec(x);if(w){for(var T=w[0],L=w[2],pe=L.length>1,ke=L[L.length-1]===")",Je={type:"list",raw:T,ordered:pe,start:pe?+L.slice(0,-1):"",loose:!1,items:[]},Mt=w[0].match(this.rules.block.item),Xt=!1,$e,zt,Lt,ht,on,Zt,En,vn=Mt.length,Bt=0;Bt<vn;Bt++)$e=Mt[Bt],T=$e,zt=$e.length,$e=$e.replace(/^ *([*+-]|\d+[.)]) */,""),~$e.indexOf(`
|
|
`)&&(zt-=$e.length,$e=this.options.pedantic?$e.replace(/^ {1,4}/gm,""):$e.replace(new RegExp("^ {1,"+zt+"}","gm"),"")),Bt!==vn-1&&(Lt=this.rules.block.bullet.exec(Mt[Bt+1])[0],(pe?Lt.length===1||!ke&&Lt[Lt.length-1]===")":Lt.length>1||this.options.smartLists&&Lt!==L)&&(ht=Mt.slice(Bt+1).join(`
|
|
`),Je.raw=Je.raw.substring(0,Je.raw.length-ht.length),Bt=vn-1)),on=Xt||/\n\n(?!\s*$)/.test($e),Bt!==vn-1&&(Xt=$e.charAt($e.length-1)===`
|
|
`,on||(on=Xt)),on&&(Je.loose=!0),Zt=/^\[[ xX]\] /.test($e),En=void 0,Zt&&(En=$e[1]!==" ",$e=$e.replace(/^\[[ xX]\] +/,"")),Je.items.push({type:"list_item",raw:T,task:Zt,checked:En,loose:on,text:$e});return Je}},Z.html=function(x){var w=this.rules.block.html.exec(x);if(w)return{type:this.options.sanitize?"paragraph":"html",raw:w[0],pre:!this.options.sanitizer&&(w[1]==="pre"||w[1]==="script"||w[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(w[0]):Ie(w[0]):w[0]}},Z.def=function(x){var w=this.rules.block.def.exec(x);if(w){w[3]&&(w[3]=w[3].substring(1,w[3].length-1));var T=w[1].toLowerCase().replace(/\s+/g," ");return{tag:T,raw:w[0],href:w[2],title:w[3]}}},Z.table=function(x){var w=this.rules.block.table.exec(x);if(w){var T={type:"table",header:ue(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
|
|
`):[]};if(T.header.length===T.align.length){T.raw=w[0];var L=T.align.length,pe;for(pe=0;pe<L;pe++)/^ *-+: *$/.test(T.align[pe])?T.align[pe]="right":/^ *:-+: *$/.test(T.align[pe])?T.align[pe]="center":/^ *:-+ *$/.test(T.align[pe])?T.align[pe]="left":T.align[pe]=null;for(L=T.cells.length,pe=0;pe<L;pe++)T.cells[pe]=ue(T.cells[pe].replace(/^ *\| *| *\| *$/g,""),T.header.length);return T}}},Z.lheading=function(x){var w=this.rules.block.lheading.exec(x);if(w)return{type:"heading",raw:w[0],depth:w[2].charAt(0)==="="?1:2,text:w[1]}},Z.paragraph=function(x){var w=this.rules.block.paragraph.exec(x);if(w)return{type:"paragraph",raw:w[0],text:w[1].charAt(w[1].length-1)===`
|
|
`?w[1].slice(0,-1):w[1]}},Z.text=function(x,w){var T=this.rules.block.text.exec(x);if(T){var L=w[w.length-1];return L&&L.type==="text"?{raw:T[0],text:T[0]}:{type:"text",raw:T[0],text:T[0]}}},Z.escape=function(x){var w=this.rules.inline.escape.exec(x);if(w)return{type:"escape",raw:w[0],text:Ie(w[1])}},Z.tag=function(x,w,T){var L=this.rules.inline.tag.exec(x);if(L)return!w&&/^<a /i.test(L[0])?w=!0:w&&/^<\/a>/i.test(L[0])&&(w=!1),!T&&/^<(pre|code|kbd|script)(\s|>)/i.test(L[0])?T=!0:T&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(L[0])&&(T=!1),{type:this.options.sanitize?"text":"html",raw:L[0],inLink:w,inRawBlock:T,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(L[0]):Ie(L[0]):L[0]}},Z.link=function(x){var w=this.rules.inline.link.exec(x);if(w){var T=Te(w[2],"()");if(T>-1){var L=w[0].indexOf("!")===0?5:4,pe=L+w[1].length+T;w[2]=w[2].substring(0,T),w[0]=w[0].substring(0,pe).trim(),w[3]=""}var ke=w[2],Je="";if(this.options.pedantic){var Mt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ke);Mt?(ke=Mt[1],Je=Mt[3]):Je=""}else Je=w[3]?w[3].slice(1,-1):"";ke=ke.trim().replace(/^<([\s\S]*)>$/,"$1");var Xt=nt(w,{href:ke&&ke.replace(this.rules.inline._escapes,"$1"),title:Je&&Je.replace(this.rules.inline._escapes,"$1")},w[0]);return Xt}},Z.reflink=function(x,w){var T;if((T=this.rules.inline.reflink.exec(x))||(T=this.rules.inline.nolink.exec(x))){var L=(T[2]||T[1]).replace(/\s+/g," ");if(L=w[L.toLowerCase()],!L||!L.href){var pe=T[0].charAt(0);return{type:"text",raw:pe,text:pe}}var ke=nt(T,L,T[0]);return ke}},Z.strong=function(x,w,T){T===void 0&&(T="");var L=this.rules.inline.strong.start.exec(x);if(L&&(!L[1]||L[1]&&(T===""||this.rules.inline.punctuation.exec(T)))){w=w.slice(-1*x.length);var pe=L[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;pe.lastIndex=0;for(var ke;(L=pe.exec(w))!=null;)if(ke=this.rules.inline.strong.middle.exec(w.slice(0,L.index+3)),ke)return{type:"strong",raw:x.slice(0,ke[0].length),text:x.slice(2,ke[0].length-2)}}},Z.em=function(x,w,T){T===void 0&&(T="");var L=this.rules.inline.em.start.exec(x);if(L&&(!L[1]||L[1]&&(T===""||this.rules.inline.punctuation.exec(T)))){w=w.slice(-1*x.length);var pe=L[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;pe.lastIndex=0;for(var ke;(L=pe.exec(w))!=null;)if(ke=this.rules.inline.em.middle.exec(w.slice(0,L.index+2)),ke)return{type:"em",raw:x.slice(0,ke[0].length),text:x.slice(1,ke[0].length-1)}}},Z.codespan=function(x){var w=this.rules.inline.code.exec(x);if(w){var T=w[2].replace(/\n/g," "),L=/[^ ]/.test(T),pe=T.startsWith(" ")&&T.endsWith(" ");return L&&pe&&(T=T.substring(1,T.length-1)),T=Ie(T,!0),{type:"codespan",raw:w[0],text:T}}},Z.br=function(x){var w=this.rules.inline.br.exec(x);if(w)return{type:"br",raw:w[0]}},Z.del=function(x){var w=this.rules.inline.del.exec(x);if(w)return{type:"del",raw:w[0],text:w[1]}},Z.autolink=function(x,w){var T=this.rules.inline.autolink.exec(x);if(T){var L,pe;return T[2]==="@"?(L=Ie(this.options.mangle?w(T[1]):T[1]),pe="mailto:"+L):(L=Ie(T[1]),pe=L),{type:"link",raw:T[0],text:L,href:pe,tokens:[{type:"text",raw:L,text:L}]}}},Z.url=function(x,w){var T;if(T=this.rules.inline.url.exec(x)){var L,pe;if(T[2]==="@")L=Ie(this.options.mangle?w(T[0]):T[0]),pe="mailto:"+L;else{var ke;do ke=T[0],T[0]=this.rules.inline._backpedal.exec(T[0])[0];while(ke!==T[0]);L=Ie(T[0]),T[1]==="www."?pe="http://"+L:pe=L}return{type:"link",raw:T[0],text:L,href:pe,tokens:[{type:"text",raw:L,text:L}]}}},Z.inlineText=function(x,w,T){var L=this.rules.inline.text.exec(x);if(L){var pe;return w?pe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(L[0]):Ie(L[0]):L[0]:pe=Ie(this.options.smartypants?T(L[0]):L[0]),{type:"text",raw:L[0],text:pe}}},ae}(),He=Re.noopTest,Le=Re.edit,Be=Re.merge,ce={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:He,table:He,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ce.def=Le(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex(),ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ce.item=Le(ce.item,"gm").replace(/bull/g,ce.bullet).getRegex(),ce.list=Le(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex(),ce._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",ce._comment=/<!--(?!-?>)[\s\S]*?-->/,ce.html=Le(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce.paragraph=Le(ce._paragraph).replace("hr",ce.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",ce._tag).getRegex(),ce.blockquote=Le(ce.blockquote).replace("paragraph",ce.paragraph).getRegex(),ce.normal=Be({},ce),ce.gfm=Be({},ce.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*|$)"}),ce.gfm.nptable=Le(ce.gfm.nptable).replace("hr",ce.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",ce._tag).getRegex(),ce.gfm.table=Le(ce.gfm.table).replace("hr",ce.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",ce._tag).getRegex(),ce.pedantic=Be({},ce.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._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:He,paragraph:Le(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var j={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:He,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:He,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};j._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",j.punctuation=Le(j.punctuation).replace(/punctuation/g,j._punctuation).getRegex(),j._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",j._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",j.em.start=Le(j.em.start).replace(/punctuation/g,j._punctuation).getRegex(),j.em.middle=Le(j.em.middle).replace(/punctuation/g,j._punctuation).replace(/overlapSkip/g,j._overlapSkip).getRegex(),j.em.endAst=Le(j.em.endAst,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.em.endUnd=Le(j.em.endUnd,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.strong.start=Le(j.strong.start).replace(/punctuation/g,j._punctuation).getRegex(),j.strong.middle=Le(j.strong.middle).replace(/punctuation/g,j._punctuation).replace(/blockSkip/g,j._blockSkip).getRegex(),j.strong.endAst=Le(j.strong.endAst,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.strong.endUnd=Le(j.strong.endUnd,"g").replace(/punctuation/g,j._punctuation).getRegex(),j.blockSkip=Le(j._blockSkip,"g").getRegex(),j.overlapSkip=Le(j._overlapSkip,"g").getRegex(),j._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,j._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,j._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])?)+(?![-_])/,j.autolink=Le(j.autolink).replace("scheme",j._scheme).replace("email",j._email).getRegex(),j._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,j.tag=Le(j.tag).replace("comment",ce._comment).replace("attribute",j._attribute).getRegex(),j._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,j._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,j._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,j.link=Le(j.link).replace("label",j._label).replace("href",j._href).replace("title",j._title).getRegex(),j.reflink=Le(j.reflink).replace("label",j._label).getRegex(),j.reflinkSearch=Le(j.reflinkSearch,"g").replace("reflink",j.reflink).replace("nolink",j.nolink).getRegex(),j.normal=Be({},j),j.pedantic=Be({},j.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:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",j._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",j._label).getRegex()}),j.gfm=Be({},j.normal,{escape:Le(j.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),j.gfm.url=Le(j.gfm.url,"i").replace("email",j.gfm._extended_email).getRegex(),j.breaks=Be({},j.gfm,{br:Le(j.br).replace("{2,}","*").getRegex(),text:Le(j.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var et={block:ce,inline:j},Ct=E.defaults,St=et.block,ze=et.inline;function pt(ae){return ae.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 fe(ae){var Z="",re,x,w=ae.length;for(re=0;re<w;re++)x=ae.charCodeAt(re),Math.random()>.5&&(x="x"+x.toString(16)),Z+="&#"+x+";";return Z}var Ae=function(){function ae(re){this.tokens=[],this.tokens.links=Object.create(null),this.options=re||Ct,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var x={block:St.normal,inline:ze.normal};this.options.pedantic?(x.block=St.pedantic,x.inline=ze.pedantic):this.options.gfm&&(x.block=St.gfm,this.options.breaks?x.inline=ze.breaks:x.inline=ze.gfm),this.tokenizer.rules=x}ae.lex=function(x,w){var T=new ae(w);return T.lex(x)};var Z=ae.prototype;return Z.lex=function(x){return x=x.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(x,this.tokens,!0),this.inline(this.tokens),this.tokens},Z.blockTokens=function(x,w,T){w===void 0&&(w=[]),T===void 0&&(T=!0),x=x.replace(/^ +$/gm,"");for(var L,pe,ke,Je;x;){if(L=this.tokenizer.space(x)){x=x.substring(L.raw.length),L.type&&w.push(L);continue}if(L=this.tokenizer.code(x,w)){x=x.substring(L.raw.length),L.type?w.push(L):(Je=w[w.length-1],Je.raw+=`
|
|
`+L.raw,Je.text+=`
|
|
`+L.text);continue}if(L=this.tokenizer.fences(x)){x=x.substring(L.raw.length),w.push(L);continue}if(L=this.tokenizer.heading(x)){x=x.substring(L.raw.length),w.push(L);continue}if(L=this.tokenizer.nptable(x)){x=x.substring(L.raw.length),w.push(L);continue}if(L=this.tokenizer.hr(x)){x=x.substring(L.raw.length),w.push(L);continue}if(L=this.tokenizer.blockquote(x)){x=x.substring(L.raw.length),L.tokens=this.blockTokens(L.text,[],T),w.push(L);continue}if(L=this.tokenizer.list(x)){for(x=x.substring(L.raw.length),ke=L.items.length,pe=0;pe<ke;pe++)L.items[pe].tokens=this.blockTokens(L.items[pe].text,[],!1);w.push(L);continue}if(L=this.tokenizer.html(x)){x=x.substring(L.raw.length),w.push(L);continue}if(T&&(L=this.tokenizer.def(x))){x=x.substring(L.raw.length),this.tokens.links[L.tag]||(this.tokens.links[L.tag]={href:L.href,title:L.title});continue}if(L=this.tokenizer.table(x)){x=x.substring(L.raw.length),w.push(L);continue}if(L=this.tokenizer.lheading(x)){x=x.substring(L.raw.length),w.push(L);continue}if(T&&(L=this.tokenizer.paragraph(x))){x=x.substring(L.raw.length),w.push(L);continue}if(L=this.tokenizer.text(x,w)){x=x.substring(L.raw.length),L.type?w.push(L):(Je=w[w.length-1],Je.raw+=`
|
|
`+L.raw,Je.text+=`
|
|
`+L.text);continue}if(x){var Mt="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(Mt);break}else throw new Error(Mt)}}return w},Z.inline=function(x){var w,T,L,pe,ke,Je,Mt=x.length;for(w=0;w<Mt;w++){Je=x[w];switch(Je.type){case"paragraph":case"text":case"heading":{Je.tokens=[],this.inlineTokens(Je.text,Je.tokens);break}case"table":{for(Je.tokens={header:[],cells:[]},pe=Je.header.length,T=0;T<pe;T++)Je.tokens.header[T]=[],this.inlineTokens(Je.header[T],Je.tokens.header[T]);for(pe=Je.cells.length,T=0;T<pe;T++)for(ke=Je.cells[T],Je.tokens.cells[T]=[],L=0;L<ke.length;L++)Je.tokens.cells[T][L]=[],this.inlineTokens(ke[L],Je.tokens.cells[T][L]);break}case"blockquote":{this.inline(Je.tokens);break}case"list":{for(pe=Je.items.length,T=0;T<pe;T++)this.inline(Je.items[T].tokens);break}}}return x},Z.inlineTokens=function(x,w,T,L,pe){w===void 0&&(w=[]),T===void 0&&(T=!1),L===void 0&&(L=!1),pe===void 0&&(pe="");var ke,Je=x,Mt;if(this.tokens.links){var Xt=Object.keys(this.tokens.links);if(Xt.length>0)for(;(Mt=this.tokenizer.rules.inline.reflinkSearch.exec(Je))!=null;)Xt.includes(Mt[0].slice(Mt[0].lastIndexOf("[")+1,-1))&&(Je=Je.slice(0,Mt.index)+"["+"a".repeat(Mt[0].length-2)+"]"+Je.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Mt=this.tokenizer.rules.inline.blockSkip.exec(Je))!=null;)Je=Je.slice(0,Mt.index)+"["+"a".repeat(Mt[0].length-2)+"]"+Je.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;x;){if(ke=this.tokenizer.escape(x)){x=x.substring(ke.raw.length),w.push(ke);continue}if(ke=this.tokenizer.tag(x,T,L)){x=x.substring(ke.raw.length),T=ke.inLink,L=ke.inRawBlock,w.push(ke);continue}if(ke=this.tokenizer.link(x)){x=x.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,L)),w.push(ke);continue}if(ke=this.tokenizer.reflink(x,this.tokens.links)){x=x.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,L)),w.push(ke);continue}if(ke=this.tokenizer.strong(x,Je,pe)){x=x.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],T,L),w.push(ke);continue}if(ke=this.tokenizer.em(x,Je,pe)){x=x.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],T,L),w.push(ke);continue}if(ke=this.tokenizer.codespan(x)){x=x.substring(ke.raw.length),w.push(ke);continue}if(ke=this.tokenizer.br(x)){x=x.substring(ke.raw.length),w.push(ke);continue}if(ke=this.tokenizer.del(x)){x=x.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],T,L),w.push(ke);continue}if(ke=this.tokenizer.autolink(x,fe)){x=x.substring(ke.raw.length),w.push(ke);continue}if(!T&&(ke=this.tokenizer.url(x,fe))){x=x.substring(ke.raw.length),w.push(ke);continue}if(ke=this.tokenizer.inlineText(x,L,pt)){x=x.substring(ke.raw.length),pe=ke.raw.slice(-1),w.push(ke);continue}if(x){var $e="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error($e);break}else throw new Error($e)}}return w},de(ae,null,[{key:"rules",get:function(){return{block:St,inline:ze}}}]),ae}(),Ge=E.defaults,Se=Re.cleanUrl,rt=Re.escape,tt=function(){function ae(re){this.options=re||Ge}var Z=ae.prototype;return Z.code=function(x,w,T){var L=(w||"").match(/\S*/)[0];if(this.options.highlight){var pe=this.options.highlight(x,L);pe!=null&&pe!==x&&(T=!0,x=pe)}return L?'<pre><code class="'+this.options.langPrefix+rt(L,!0)+'">'+(T?x:rt(x,!0))+`</code></pre>
|
|
`:"<pre><code>"+(T?x:rt(x,!0))+`</code></pre>
|
|
`},Z.blockquote=function(x){return`<blockquote>
|
|
`+x+`</blockquote>
|
|
`},Z.html=function(x){return x},Z.heading=function(x,w,T,L){return this.options.headerIds?"<h"+w+' id="'+this.options.headerPrefix+L.slug(T)+'">'+x+"</h"+w+`>
|
|
`:"<h"+w+">"+x+"</h"+w+`>
|
|
`},Z.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Z.list=function(x,w,T){var L=w?"ol":"ul",pe=w&&T!==1?' start="'+T+'"':"";return"<"+L+pe+`>
|
|
`+x+"</"+L+`>
|
|
`},Z.listitem=function(x){return"<li>"+x+`</li>
|
|
`},Z.checkbox=function(x){return"<input "+(x?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Z.paragraph=function(x){return"<p>"+x+`</p>
|
|
`},Z.table=function(x,w){return w&&(w="<tbody>"+w+"</tbody>"),`<table>
|
|
<thead>
|
|
`+x+`</thead>
|
|
`+w+`</table>
|
|
`},Z.tablerow=function(x){return`<tr>
|
|
`+x+`</tr>
|
|
`},Z.tablecell=function(x,w){var T=w.header?"th":"td",L=w.align?"<"+T+' align="'+w.align+'">':"<"+T+">";return L+x+"</"+T+`>
|
|
`},Z.strong=function(x){return"<strong>"+x+"</strong>"},Z.em=function(x){return"<em>"+x+"</em>"},Z.codespan=function(x){return"<code>"+x+"</code>"},Z.br=function(){return this.options.xhtml?"<br/>":"<br>"},Z.del=function(x){return"<del>"+x+"</del>"},Z.link=function(x,w,T){if(x=Se(this.options.sanitize,this.options.baseUrl,x),x===null)return T;var L='<a href="'+rt(x)+'"';return w&&(L+=' title="'+w+'"'),L+=">"+T+"</a>",L},Z.image=function(x,w,T){if(x=Se(this.options.sanitize,this.options.baseUrl,x),x===null)return T;var L='<img src="'+x+'" alt="'+T+'"';return w&&(L+=' title="'+w+'"'),L+=this.options.xhtml?"/>":">",L},Z.text=function(x){return x},ae}(),lt=function(){function ae(){}var Z=ae.prototype;return Z.strong=function(x){return x},Z.em=function(x){return x},Z.codespan=function(x){return x},Z.del=function(x){return x},Z.html=function(x){return x},Z.text=function(x){return x},Z.link=function(x,w,T){return""+T},Z.image=function(x,w,T){return""+T},Z.br=function(){return""},ae}(),It=function(){function ae(){this.seen={}}var Z=ae.prototype;return Z.slug=function(x){var w=x.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(w)){var T=w;do this.seen[T]++,w=T+"-"+this.seen[T];while(this.seen.hasOwnProperty(w))}return this.seen[w]=0,w},ae}(),wt=E.defaults,bt=Re.unescape,ut=function(){function ae(re){this.options=re||wt,this.options.renderer=this.options.renderer||new tt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new lt,this.slugger=new It}ae.parse=function(x,w){var T=new ae(w);return T.parse(x)};var Z=ae.prototype;return Z.parse=function(x,w){w===void 0&&(w=!0);var T="",L,pe,ke,Je,Mt,Xt,$e,zt,Lt,ht,on,Zt,En,vn,Bt,Wn,Bn,Tt,di=x.length;for(L=0;L<di;L++){ht=x[L];switch(ht.type){case"space":continue;case"hr":{T+=this.renderer.hr();continue}case"heading":{T+=this.renderer.heading(this.parseInline(ht.tokens),ht.depth,bt(this.parseInline(ht.tokens,this.textRenderer)),this.slugger);continue}case"code":{T+=this.renderer.code(ht.text,ht.lang,ht.escaped);continue}case"table":{for(zt="",$e="",Je=ht.header.length,pe=0;pe<Je;pe++)$e+=this.renderer.tablecell(this.parseInline(ht.tokens.header[pe]),{header:!0,align:ht.align[pe]});for(zt+=this.renderer.tablerow($e),Lt="",Je=ht.cells.length,pe=0;pe<Je;pe++){for(Xt=ht.tokens.cells[pe],$e="",Mt=Xt.length,ke=0;ke<Mt;ke++)$e+=this.renderer.tablecell(this.parseInline(Xt[ke]),{header:!1,align:ht.align[ke]});Lt+=this.renderer.tablerow($e)}T+=this.renderer.table(zt,Lt);continue}case"blockquote":{Lt=this.parse(ht.tokens),T+=this.renderer.blockquote(Lt);continue}case"list":{for(on=ht.ordered,Zt=ht.start,En=ht.loose,Je=ht.items.length,Lt="",pe=0;pe<Je;pe++)Bt=ht.items[pe],Wn=Bt.checked,Bn=Bt.task,vn="",Bt.task&&(Tt=this.renderer.checkbox(Wn),En?Bt.tokens.length>0&&Bt.tokens[0].type==="text"?(Bt.tokens[0].text=Tt+" "+Bt.tokens[0].text,Bt.tokens[0].tokens&&Bt.tokens[0].tokens.length>0&&Bt.tokens[0].tokens[0].type==="text"&&(Bt.tokens[0].tokens[0].text=Tt+" "+Bt.tokens[0].tokens[0].text)):Bt.tokens.unshift({type:"text",text:Tt}):vn+=Tt),vn+=this.parse(Bt.tokens,En),Lt+=this.renderer.listitem(vn,Bn,Wn);T+=this.renderer.list(Lt,on,Zt);continue}case"html":{T+=this.renderer.html(ht.text);continue}case"paragraph":{T+=this.renderer.paragraph(this.parseInline(ht.tokens));continue}case"text":{for(Lt=ht.tokens?this.parseInline(ht.tokens):ht.text;L+1<di&&x[L+1].type==="text";)ht=x[++L],Lt+=`
|
|
`+(ht.tokens?this.parseInline(ht.tokens):ht.text);T+=w?this.renderer.paragraph(Lt):Lt;continue}default:{var oi='Token with "'+ht.type+'" type was not found.';if(this.options.silent){console.error(oi);return}else throw new Error(oi)}}}return T},Z.parseInline=function(x,w){w=w||this.renderer;var T="",L,pe,ke=x.length;for(L=0;L<ke;L++){pe=x[L];switch(pe.type){case"escape":{T+=w.text(pe.text);break}case"html":{T+=w.html(pe.text);break}case"link":{T+=w.link(pe.href,pe.title,this.parseInline(pe.tokens,w));break}case"image":{T+=w.image(pe.href,pe.title,pe.text);break}case"strong":{T+=w.strong(this.parseInline(pe.tokens,w));break}case"em":{T+=w.em(this.parseInline(pe.tokens,w));break}case"codespan":{T+=w.codespan(pe.text);break}case"br":{T+=w.br();break}case"del":{T+=w.del(this.parseInline(pe.tokens,w));break}case"text":{T+=w.text(pe.text);break}default:{var Je='Token with "'+pe.type+'" type was not found.';if(this.options.silent){console.error(Je);return}else throw new Error(Je)}}}return T},ae}(),Rt=Re.merge,xt=Re.checkSanitizeDeprecation,gt=Re.escape,De=E.getDefaults,Dt=E.changeDefaults,vt=E.defaults;function je(ae,Z,re){if(typeof ae=="undefined"||ae===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ae!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ae)+", string expected");if(typeof Z=="function"&&(re=Z,Z=null),Z=Rt({},je.defaults,Z||{}),xt(Z),re){var x=Z.highlight,w;try{w=Ae.lex(ae,Z)}catch(ke){return re(ke)}var T=function(Je){var Mt;if(!Je)try{Mt=ut.parse(w,Z)}catch(Xt){Je=Xt}return Z.highlight=x,Je?re(Je):re(null,Mt)};if(!x||x.length<3)return T();if(delete Z.highlight,!w.length)return T();var L=0;je.walkTokens(w,function(ke){ke.type==="code"&&(L++,setTimeout(function(){x(ke.text,ke.lang,function(Je,Mt){if(Je)return T(Je);Mt!=null&&Mt!==ke.text&&(ke.text=Mt,ke.escaped=!0),L--,L===0&&T()})},0))}),L===0&&T();return}try{var pe=Ae.lex(ae,Z);return Z.walkTokens&&je.walkTokens(pe,Z.walkTokens),ut.parse(pe,Z)}catch(ke){if(ke.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Z.silent)return"<p>An error occurred:</p><pre>"+gt(ke.message+"",!0)+"</pre>";throw ke}}je.options=je.setOptions=function(ae){return Rt(je.defaults,ae),Dt(je.defaults),je},je.getDefaults=De,je.defaults=vt,je.use=function(ae){var Z=Rt({},ae);if(ae.renderer&&function(){var x=je.defaults.renderer||new tt,w=function(pe){var ke=x[pe];x[pe]=function(){for(var Je=arguments.length,Mt=new Array(Je),Xt=0;Xt<Je;Xt++)Mt[Xt]=arguments[Xt];var $e=ae.renderer[pe].apply(x,Mt);return $e===!1&&($e=ke.apply(x,Mt)),$e}};for(var T in ae.renderer)w(T);Z.renderer=x}(),ae.tokenizer&&function(){var x=je.defaults.tokenizer||new Ue,w=function(pe){var ke=x[pe];x[pe]=function(){for(var Je=arguments.length,Mt=new Array(Je),Xt=0;Xt<Je;Xt++)Mt[Xt]=arguments[Xt];var $e=ae.tokenizer[pe].apply(x,Mt);return $e===!1&&($e=ke.apply(x,Mt)),$e}};for(var T in ae.tokenizer)w(T);Z.tokenizer=x}(),ae.walkTokens){var re=je.defaults.walkTokens;Z.walkTokens=function(x){ae.walkTokens(x),re&&re(x)}}je.setOptions(Z)},je.walkTokens=function(ae,Z){for(var re=C(ae),x;!(x=re()).done;){var w=x.value;Z(w);switch(w.type){case"table":{for(var T=C(w.tokens.header),L;!(L=T()).done;){var pe=L.value;je.walkTokens(pe,Z)}for(var ke=C(w.tokens.cells),Je;!(Je=ke()).done;)for(var Mt=Je.value,Xt=C(Mt),$e;!($e=Xt()).done;){var zt=$e.value;je.walkTokens(zt,Z)}break}case"list":{je.walkTokens(w.items,Z);break}default:w.tokens&&je.walkTokens(w.tokens,Z)}}},je.Parser=ut,je.parser=ut.parse,je.Renderer=tt,je.TextRenderer=lt,je.Lexer=Ae,je.lexer=Ae.lex,je.Tokenizer=Ue,je.Slugger=It,je.parse=je;var qe=je;return qe})},E9nw:function(mt,Ze){mt.exports=function(){var y=document.getSelection();if(!y.rangeCount)return function(){};for(var S=document.activeElement,de=[],G=0;G<y.rangeCount;G++)de.push(y.getRangeAt(G));switch(S.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":S.blur();break;default:S=null;break}return y.removeAllRanges(),function(){y.type==="Caret"&&y.removeAllRanges(),y.rangeCount||de.forEach(function(z){y.addRange(z)}),S&&S.focus()}}},ELLl:function(mt,Ze,y){(function(S){S(y("VrN/"))})(function(S){var de={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},G=S.Pos;S.defineOption("autoCloseBrackets",!1,function(W,H,P){P&&P!=S.Init&&(W.removeKeyMap(C),W.state.closeBrackets=null),H&&(ee(z(H,"pairs")),W.state.closeBrackets=H,W.addKeyMap(C))});function z(W,H){return H=="pairs"&&typeof W=="string"?W:typeof W=="object"&&W[H]!=null?W[H]:de[H]}var C={Backspace:B,Enter:X};function ee(W){for(var H=0;H<W.length;H++){var P=W.charAt(H),ie="'"+P+"'";C[ie]||(C[ie]=E(P))}}ee(de.pairs+"`");function E(W){return function(H){return O(H,W)}}function R(W){var H=W.state.closeBrackets;if(!H||H.override)return H;var P=W.getModeAt(W.getCursor());return P.closeBrackets||H}function B(W){var H=R(W);if(!H||W.getOption("disableInput"))return S.Pass;for(var P=z(H,"pairs"),ie=W.listSelections(),se=0;se<ie.length;se++){if(!ie[se].empty())return S.Pass;var Oe=te(W,ie[se].head);if(!Oe||P.indexOf(Oe)%2!=0)return S.Pass}for(var se=ie.length-1;se>=0;se--){var Ke=ie[se].head;W.replaceRange("",G(Ke.line,Ke.ch-1),G(Ke.line,Ke.ch+1),"+delete")}}function X(W){var H=R(W),P=H&&z(H,"explode");if(!P||W.getOption("disableInput"))return S.Pass;for(var ie=W.listSelections(),se=0;se<ie.length;se++){if(!ie[se].empty())return S.Pass;var Oe=te(W,ie[se].head);if(!Oe||P.indexOf(Oe)%2!=0)return S.Pass}W.operation(function(){var Ke=W.lineSeparator()||`
|
|
`;W.replaceSelection(Ke+Ke,null),W.execCommand("goCharLeft"),ie=W.listSelections();for(var ge=0;ge<ie.length;ge++){var Me=ie[ge].head.line;W.indentLine(Me,null,!0),W.indentLine(Me+1,null,!0)}})}function D(W){var H=S.cmpPos(W.anchor,W.head)>0;return{anchor:new G(W.anchor.line,W.anchor.ch+(H?-1:1)),head:new G(W.head.line,W.head.ch+(H?1:-1))}}function O(W,H){var P=R(W);if(!P||W.getOption("disableInput"))return S.Pass;var ie=z(P,"pairs"),se=ie.indexOf(H);if(se==-1)return S.Pass;for(var Oe=z(P,"closeBefore"),Ke=z(P,"triples"),ge=ie.charAt(se+1)==H,Me=W.listSelections(),Ve=se%2==0,_e,be=0;be<Me.length;be++){var Ne=Me[be],we=Ne.head,N,Ee=W.getRange(we,G(we.line,we.ch+1));if(Ve&&!Ne.empty())N="surround";else if((ge||!Ve)&&Ee==H)ge&&Q(W,we)?N="both":Ke.indexOf(H)>=0&&W.getRange(we,G(we.line,we.ch+3))==H+H+H?N="skipThree":N="skip";else if(ge&&we.ch>1&&Ke.indexOf(H)>=0&&W.getRange(G(we.line,we.ch-2),we)==H+H){if(we.ch>2&&/\bstring/.test(W.getTokenTypeAt(G(we.line,we.ch-2))))return S.Pass;N="addFour"}else if(ge){var ye=we.ch==0?" ":W.getRange(G(we.line,we.ch-1),we);if(!S.isWordChar(Ee)&&ye!=H&&!S.isWordChar(ye))N="both";else return S.Pass}else if(Ve&&(Ee.length===0||/\s/.test(Ee)||Oe.indexOf(Ee)>-1))N="both";else return S.Pass;if(!_e)_e=N;else if(_e!=N)return S.Pass}var k=se%2?ie.charAt(se-1):H,K=se%2?H:ie.charAt(se+1);W.operation(function(){if(_e=="skip")W.execCommand("goCharRight");else if(_e=="skipThree")for(var he=0;he<3;he++)W.execCommand("goCharRight");else if(_e=="surround"){for(var $=W.getSelections(),he=0;he<$.length;he++)$[he]=k+$[he]+K;W.replaceSelections($,"around"),$=W.listSelections().slice();for(var he=0;he<$.length;he++)$[he]=D($[he]);W.setSelections($)}else _e=="both"?(W.replaceSelection(k+K,null),W.triggerElectric(k+K),W.execCommand("goCharLeft")):_e=="addFour"&&(W.replaceSelection(k+k+k+k,"before"),W.execCommand("goCharRight"))})}function te(W,H){var P=W.getRange(G(H.line,H.ch-1),G(H.line,H.ch+1));return P.length==2?P:null}function Q(W,H){var P=W.getTokenAt(G(H.line,H.ch+1));return/\bstring/.test(P.type)&&P.start==H.ch&&(H.ch==0||!/\bstring/.test(W.getTokenTypeAt(H)))}})},Gytx:function(mt,Ze){mt.exports=function(S,de,G,z){var C=G?G.call(z,S,de):void 0;if(C!==void 0)return!!C;if(S===de)return!0;if(typeof S!="object"||!S||typeof de!="object"||!de)return!1;var ee=Object.keys(S),E=Object.keys(de);if(ee.length!==E.length)return!1;for(var R=Object.prototype.hasOwnProperty.bind(de),B=0;B<ee.length;B++){var X=ee[B];if(!R(X))return!1;var D=S[X],O=de[X];if(C=G?G.call(z,D,O,X):void 0,C===!1||C===void 0&&D!==O)return!1}return!0}},H38U:function(mt,Ze,y){var S=y("f4xo"),de=y("rcnY"),G=y("wU8J"),z=y("Iq15"),C=y("dWSS");function ee(R,B){this.typeNumber=R,this.errorCorrectLevel=B,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var E=ee.prototype;E.addData=function(R){var B=new S(R);this.dataList.push(B),this.dataCache=null},E.isDark=function(R,B){if(R<0||this.moduleCount<=R||B<0||this.moduleCount<=B)throw new Error(R+","+B);return this.modules[R][B]},E.getModuleCount=function(){return this.moduleCount},E.make=function(){if(this.typeNumber<1){var R=1;for(R=1;R<40;R++){for(var B=de.getRSBlocks(R,this.errorCorrectLevel),X=new G,D=0,O=0;O<B.length;O++)D+=B[O].dataCount;for(var O=0;O<this.dataList.length;O++){var te=this.dataList[O];X.put(te.mode,4),X.put(te.getLength(),z.getLengthInBits(te.mode,R)),te.write(X)}if(X.getLengthInBits()<=D*8)break}this.typeNumber=R}this.makeImpl(!1,this.getBestMaskPattern())},E.makeImpl=function(R,B){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var X=0;X<this.moduleCount;X++){this.modules[X]=new Array(this.moduleCount);for(var D=0;D<this.moduleCount;D++)this.modules[X][D]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(R,B),this.typeNumber>=7&&this.setupTypeNumber(R),this.dataCache==null&&(this.dataCache=ee.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,B)},E.setupPositionProbePattern=function(R,B){for(var X=-1;X<=7;X++){if(R+X<=-1||this.moduleCount<=R+X)continue;for(var D=-1;D<=7;D++){if(B+D<=-1||this.moduleCount<=B+D)continue;0<=X&&X<=6&&(D==0||D==6)||0<=D&&D<=6&&(X==0||X==6)||2<=X&&X<=4&&2<=D&&D<=4?this.modules[R+X][B+D]=!0:this.modules[R+X][B+D]=!1}}},E.getBestMaskPattern=function(){for(var R=0,B=0,X=0;X<8;X++){this.makeImpl(!0,X);var D=z.getLostPoint(this);(X==0||R>D)&&(R=D,B=X)}return B},E.createMovieClip=function(R,B,X){var D=R.createEmptyMovieClip(B,X),O=1;this.make();for(var te=0;te<this.modules.length;te++)for(var Q=te*O,W=0;W<this.modules[te].length;W++){var H=W*O,P=this.modules[te][W];P&&(D.beginFill(0,100),D.moveTo(H,Q),D.lineTo(H+O,Q),D.lineTo(H+O,Q+O),D.lineTo(H,Q+O),D.endFill())}return D},E.setupTimingPattern=function(){for(var R=8;R<this.moduleCount-8;R++){if(this.modules[R][6]!=null)continue;this.modules[R][6]=R%2==0}for(var B=8;B<this.moduleCount-8;B++){if(this.modules[6][B]!=null)continue;this.modules[6][B]=B%2==0}},E.setupPositionAdjustPattern=function(){for(var R=z.getPatternPosition(this.typeNumber),B=0;B<R.length;B++)for(var X=0;X<R.length;X++){var D=R[B],O=R[X];if(this.modules[D][O]!=null)continue;for(var te=-2;te<=2;te++)for(var Q=-2;Q<=2;Q++)te==-2||te==2||Q==-2||Q==2||te==0&&Q==0?this.modules[D+te][O+Q]=!0:this.modules[D+te][O+Q]=!1}},E.setupTypeNumber=function(R){for(var B=z.getBCHTypeNumber(this.typeNumber),X=0;X<18;X++){var D=!R&&(B>>X&1)==1;this.modules[Math.floor(X/3)][X%3+this.moduleCount-8-3]=D}for(var X=0;X<18;X++){var D=!R&&(B>>X&1)==1;this.modules[X%3+this.moduleCount-8-3][Math.floor(X/3)]=D}},E.setupTypeInfo=function(R,B){for(var X=this.errorCorrectLevel<<3|B,D=z.getBCHTypeInfo(X),O=0;O<15;O++){var te=!R&&(D>>O&1)==1;O<6?this.modules[O][8]=te:O<8?this.modules[O+1][8]=te:this.modules[this.moduleCount-15+O][8]=te}for(var O=0;O<15;O++){var te=!R&&(D>>O&1)==1;O<8?this.modules[8][this.moduleCount-O-1]=te:O<9?this.modules[8][15-O-1+1]=te:this.modules[8][15-O-1]=te}this.modules[this.moduleCount-8][8]=!R},E.mapData=function(R,B){for(var X=-1,D=this.moduleCount-1,O=7,te=0,Q=this.moduleCount-1;Q>0;Q-=2)for(Q==6&&Q--;;){for(var W=0;W<2;W++)if(this.modules[D][Q-W]==null){var H=!1;te<R.length&&(H=(R[te]>>>O&1)==1);var P=z.getMask(B,D,Q-W);P&&(H=!H),this.modules[D][Q-W]=H,O--,O==-1&&(te++,O=7)}if(D+=X,D<0||this.moduleCount<=D){D-=X,X=-X;break}}},ee.PAD0=236,ee.PAD1=17,ee.createData=function(R,B,X){for(var D=de.getRSBlocks(R,B),O=new G,te=0;te<X.length;te++){var Q=X[te];O.put(Q.mode,4),O.put(Q.getLength(),z.getLengthInBits(Q.mode,R)),Q.write(O)}for(var W=0,te=0;te<D.length;te++)W+=D[te].dataCount;if(O.getLengthInBits()>W*8)throw new Error("code length overflow. ("+O.getLengthInBits()+">"+W*8+")");for(O.getLengthInBits()+4<=W*8&&O.put(0,4);O.getLengthInBits()%8!=0;)O.putBit(!1);for(;!(O.getLengthInBits()>=W*8);){if(O.put(ee.PAD0,8),O.getLengthInBits()>=W*8)break;O.put(ee.PAD1,8)}return ee.createBytes(O,D)},ee.createBytes=function(R,B){for(var X=0,D=0,O=0,te=new Array(B.length),Q=new Array(B.length),W=0;W<B.length;W++){var H=B[W].dataCount,P=B[W].totalCount-H;D=Math.max(D,H),O=Math.max(O,P),te[W]=new Array(H);for(var ie=0;ie<te[W].length;ie++)te[W][ie]=255&R.buffer[ie+X];X+=H;var se=z.getErrorCorrectPolynomial(P),Oe=new C(te[W],se.getLength()-1),Ke=Oe.mod(se);Q[W]=new Array(se.getLength()-1);for(var ie=0;ie<Q[W].length;ie++){var ge=ie+Ke.getLength()-Q[W].length;Q[W][ie]=ge>=0?Ke.get(ge):0}}for(var Me=0,ie=0;ie<B.length;ie++)Me+=B[ie].totalCount;for(var Ve=new Array(Me),_e=0,ie=0;ie<D;ie++)for(var W=0;W<B.length;W++)ie<te[W].length&&(Ve[_e++]=te[W][ie]);for(var ie=0;ie<O;ie++)for(var W=0;W<B.length;W++)ie<Q[W].length&&(Ve[_e++]=Q[W][ie]);return Ve},mt.exports=ee},HmJG:function(mt,Ze,y){},I8Z2:function(mt,Ze,y){"use strict";y.d(Ze,"a",function(){return z}),y.d(Ze,"b",function(){return te}),y.d(Ze,"c",function(){return W});var S=y("q1tI"),de=function(){var H=function(P,ie){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(se,Oe){se.__proto__=Oe}||function(se,Oe){for(var Ke in Oe)Oe.hasOwnProperty(Ke)&&(se[Ke]=Oe[Ke])},H(P,ie)};return function(P,ie){H(P,ie);function se(){this.constructor=P}P.prototype=ie===null?Object.create(ie):(se.prototype=ie.prototype,new se)}}(),G=S.createContext(null),z=function(H){de(P,H);function P(){return H!==null&&H.apply(this,arguments)||this}return P.prototype.render=function(){return S.createElement(G.Provider,{value:this.props.store},this.props.children)},P}(S.Component),C=y("Gytx"),ee=y.n(C),E=y("2mql"),R=y.n(E),B=function(){var H=function(P,ie){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(se,Oe){se.__proto__=Oe}||function(se,Oe){for(var Ke in Oe)Oe.hasOwnProperty(Ke)&&(se[Ke]=Oe[Ke])},H(P,ie)};return function(P,ie){H(P,ie);function se(){this.constructor=P}P.prototype=ie===null?Object.create(ie):(se.prototype=ie.prototype,new se)}}(),X=function(){return X=Object.assign||function(H){for(var P,ie=1,se=arguments.length;ie<se;ie++){P=arguments[ie];for(var Oe in P)Object.prototype.hasOwnProperty.call(P,Oe)&&(H[Oe]=P[Oe])}return H},X.apply(this,arguments)};function D(H){return H.displayName||H.name||"Component"}var O=function(){return{}};function te(H,P){P===void 0&&(P={});var ie=!!H,se=H||O;return function(Ke){var ge=function(Ve){B(_e,Ve);function _e(be,Ne){var we=Ve.call(this,be,Ne)||this;return we.unsubscribe=null,we.handleChange=function(){if(!we.unsubscribe)return;var N=se(we.store.getState(),we.props);we.setState({subscribed:N})},we.store=we.context,we.state={subscribed:se(we.store.getState(),be),store:we.store,props:be},we}return _e.getDerivedStateFromProps=function(be,Ne){return H&&H.length===2&&be!==Ne.props?{subscribed:se(Ne.store.getState(),be),props:be}:{props:be}},_e.prototype.componentDidMount=function(){this.trySubscribe()},_e.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},_e.prototype.shouldComponentUpdate=function(be,Ne){return!ee()(this.props,be)||!ee()(this.state.subscribed,Ne.subscribed)},_e.prototype.trySubscribe=function(){ie&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},_e.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},_e.prototype.render=function(){var be=X(X(X({},this.props),this.state.subscribed),{store:this.store});return S.createElement(Ke,X({},be,{ref:this.props.miniStoreForwardedRef}))},_e.displayName="Connect("+D(Ke)+")",_e.contextType=G,_e}(S.Component);if(P.forwardRef){var Me=S.forwardRef(function(Ve,_e){return S.createElement(ge,X({},Ve,{miniStoreForwardedRef:_e}))});return R()(Me,Ke)}return R()(ge,Ke)}}var Q=function(){return Q=Object.assign||function(H){for(var P,ie=1,se=arguments.length;ie<se;ie++){P=arguments[ie];for(var Oe in P)Object.prototype.hasOwnProperty.call(P,Oe)&&(H[Oe]=P[Oe])}return H},Q.apply(this,arguments)};function W(H){var P=H,ie=[];function se(ge){P=Q(Q({},P),ge);for(var Me=0;Me<ie.length;Me++)ie[Me]()}function Oe(){return P}function Ke(ge){return ie.push(ge),function(){var Ve=ie.indexOf(ge);ie.splice(Ve,1)}}return{setState:se,getState:Oe,subscribe:Ke}}},Iq15:function(mt,Ze,y){var S=y("nVVt"),de=y("dWSS"),G=y("dQei"),z={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},C={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(ee){for(var E=ee<<10;C.getBCHDigit(E)-C.getBCHDigit(C.G15)>=0;)E^=C.G15<<C.getBCHDigit(E)-C.getBCHDigit(C.G15);return(ee<<10|E)^C.G15_MASK},getBCHTypeNumber:function(ee){for(var E=ee<<12;C.getBCHDigit(E)-C.getBCHDigit(C.G18)>=0;)E^=C.G18<<C.getBCHDigit(E)-C.getBCHDigit(C.G18);return ee<<12|E},getBCHDigit:function(ee){for(var E=0;ee!=0;)E++,ee>>>=1;return E},getPatternPosition:function(ee){return C.PATTERN_POSITION_TABLE[ee-1]},getMask:function(ee,E,R){switch(ee){case z.PATTERN000:return(E+R)%2==0;case z.PATTERN001:return E%2==0;case z.PATTERN010:return R%3==0;case z.PATTERN011:return(E+R)%3==0;case z.PATTERN100:return(Math.floor(E/2)+Math.floor(R/3))%2==0;case z.PATTERN101:return E*R%2+E*R%3==0;case z.PATTERN110:return(E*R%2+E*R%3)%2==0;case z.PATTERN111:return(E*R%3+(E+R)%2)%2==0;default:throw new Error("bad maskPattern:"+ee)}},getErrorCorrectPolynomial:function(ee){for(var E=new de([1],0),R=0;R<ee;R++)E=E.multiply(new de([1,G.gexp(R)],0));return E},getLengthInBits:function(ee,E){if(1<=E&&E<10)switch(ee){case S.MODE_NUMBER:return 10;case S.MODE_ALPHA_NUM:return 9;case S.MODE_8BIT_BYTE:return 8;case S.MODE_KANJI:return 8;default:throw new Error("mode:"+ee)}else if(E<27)switch(ee){case S.MODE_NUMBER:return 12;case S.MODE_ALPHA_NUM:return 11;case S.MODE_8BIT_BYTE:return 16;case S.MODE_KANJI:return 10;default:throw new Error("mode:"+ee)}else if(E<41)switch(ee){case S.MODE_NUMBER:return 14;case S.MODE_ALPHA_NUM:return 13;case S.MODE_8BIT_BYTE:return 16;case S.MODE_KANJI:return 12;default:throw new Error("mode:"+ee)}else throw new Error("type:"+E)},getLostPoint:function(ee){for(var E=ee.getModuleCount(),R=0,B=0;B<E;B++)for(var X=0;X<E;X++){for(var D=0,O=ee.isDark(B,X),te=-1;te<=1;te++){if(B+te<0||E<=B+te)continue;for(var Q=-1;Q<=1;Q++){if(X+Q<0||E<=X+Q)continue;if(te==0&&Q==0)continue;O==ee.isDark(B+te,X+Q)&&D++}}D>5&&(R+=3+D-5)}for(var B=0;B<E-1;B++)for(var X=0;X<E-1;X++){var W=0;ee.isDark(B,X)&&W++,ee.isDark(B+1,X)&&W++,ee.isDark(B,X+1)&&W++,ee.isDark(B+1,X+1)&&W++,(W==0||W==4)&&(R+=3)}for(var B=0;B<E;B++)for(var X=0;X<E-6;X++)ee.isDark(B,X)&&!ee.isDark(B,X+1)&&ee.isDark(B,X+2)&&ee.isDark(B,X+3)&&ee.isDark(B,X+4)&&!ee.isDark(B,X+5)&&ee.isDark(B,X+6)&&(R+=40);for(var X=0;X<E;X++)for(var B=0;B<E-6;B++)ee.isDark(B,X)&&!ee.isDark(B+1,X)&&ee.isDark(B+2,X)&&ee.isDark(B+3,X)&&ee.isDark(B+4,X)&&!ee.isDark(B+5,X)&&ee.isDark(B+6,X)&&(R+=40);for(var H=0,X=0;X<E;X++)for(var B=0;B<E;B++)ee.isDark(B,X)&&H++;var P=Math.abs(100*H/E/E-50)/5;return R+=P*10,R}};mt.exports=C},LdHM:function(mt,Ze,y){"use strict";y.d(Ze,"b",function(){return Oe}),y.d(Ze,"a",function(){return ge});var S=y("1OyB"),de=y("vuIU"),G=y("Ji7U"),z=y("LK+K"),C=y("q1tI"),ee=y("rePB"),E=y("Ff2n"),R=y("ODXe"),B=y("4IlW"),X=y("bX4T"),D=y("YrtM"),O=y("TSYQ"),te=y.n(O),Q=y("+nKL"),W=y("8OUc"),H=function(ue,Ie){var Te=ue.prefixCls,nt=ue.id,st=ue.flattenOptions,Ue=ue.childrenAsData,He=ue.values,Le=ue.searchValue,Be=ue.multiple,ce=ue.defaultActiveFirstOption,j=ue.height,et=ue.itemHeight,Ct=ue.notFoundContent,St=ue.open,ze=ue.menuItemSelectedIcon,pt=ue.virtual,fe=ue.onSelect,Ae=ue.onToggleOpen,Ge=ue.onActiveValue,Se=ue.onScroll,rt=ue.onMouseEnter,tt="".concat(Te,"-item"),lt=Object(D.a)(function(){return st},[St,st],function(qe,ae){return ae[0]&&qe[1]!==ae[1]}),It=C.useRef(null),wt=function(ae){ae.preventDefault()},bt=function(ae){It.current&&It.current.scrollTo({index:ae})},ut=function(ae){for(var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,re=lt.length,x=0;x<re;x+=1){var w=(ae+x*Z+re)%re,T=lt[w],L=T.group,pe=T.data;if(!L&&!pe.disabled)return w}return-1},Rt=C.useState(function(){return ut(0)}),xt=Object(R.a)(Rt,2),gt=xt[0],De=xt[1],Dt=function(ae){De(ae);var Z=lt[ae];if(!Z){Ge(null,-1);return}Ge(Z.data.value,ae)};C.useEffect(function(){Dt(ce!==!1?ut(0):-1)},[lt.length,Le]),C.useEffect(function(){var qe=setTimeout(function(){if(!Be&&St&&He.size===1){var ae=Array.from(He)[0],Z=lt.findIndex(function(re){var x=re.data;return x.value===ae});Dt(Z),bt(Z)}});return function(){return clearTimeout(qe)}},[St]);var vt=function(ae){ae!==void 0&&fe(ae,{selected:!He.has(ae)}),Be||Ae(!1)};if(C.useImperativeHandle(Ie,function(){return{onKeyDown:function(ae){var Z=ae.which;switch(Z){case B.a.UP:case B.a.DOWN:{var re=0;if(Z===B.a.UP?re=-1:Z===B.a.DOWN&&(re=1),re!==0){var x=ut(gt+re,re);bt(x),Dt(x)}break}case B.a.ENTER:{var w=lt[gt];w&&!w.data.disabled?vt(w.data.value):vt(void 0),St&&ae.preventDefault();break}case B.a.ESC:Ae(!1)}},onKeyUp:function(){},scrollTo:function(ae){bt(ae)}}}),lt.length===0)return C.createElement("div",{role:"listbox",id:"".concat(nt,"_list"),className:"".concat(tt,"-empty"),onMouseDown:wt},Ct);function je(qe){var ae=lt[qe];if(!ae)return null;var Z=ae.data||{},re=Z.value,x=Z.label,w=Z.children,T=Object(X.a)(Z,!0),L=Ue?w:x;return ae?C.createElement("div",Object.assign({"aria-label":typeof L=="string"?L:null},T,{key:qe,role:"option",id:"".concat(nt,"_list_").concat(qe),"aria-selected":He.has(re)}),re):null}return C.createElement(C.Fragment,null,C.createElement("div",{role:"listbox",id:"".concat(nt,"_list"),style:{height:0,width:0,overflow:"hidden"}},je(gt-1),je(gt),je(gt+1)),C.createElement(Q.a,{itemKey:"key",ref:It,data:lt,height:j,itemHeight:et,fullHeight:!1,onMouseDown:wt,onScroll:Se,virtual:pt,onMouseEnter:rt},function(qe,ae){var Z,re=qe.group,x=qe.groupOption,w=qe.data,T=w.label,L=w.key;if(re)return C.createElement("div",{className:te()(tt,"".concat(tt,"-group"))},T!==void 0?T:L);var pe=w.disabled,ke=w.value,Je=w.title,Mt=w.children,Xt=w.style,$e=w.className,zt=Object(E.a)(w,["disabled","value","title","children","style","className"]),Lt=He.has(ke),ht="".concat(tt,"-option"),on=te()(tt,ht,$e,(Z={},Object(ee.a)(Z,"".concat(ht,"-grouped"),x),Object(ee.a)(Z,"".concat(ht,"-active"),gt===ae&&!pe),Object(ee.a)(Z,"".concat(ht,"-disabled"),pe),Object(ee.a)(Z,"".concat(ht,"-selected"),Lt),Z)),Zt=Ue?Mt:T,En=!ze||typeof ze=="function"||Lt;return C.createElement("div",Object.assign({},zt,{"aria-selected":Lt,className:on,title:Je,onMouseMove:function(){if(gt===ae||pe)return;Dt(ae)},onClick:function(){pe||vt(ke)},style:Xt}),C.createElement("div",{className:"".concat(ht,"-content")},Zt||ke),C.isValidElement(ze)||Lt,En&&C.createElement(W.a,{className:"".concat(tt,"-option-state"),customizeIcon:ze,customizeIconProps:{isSelected:Lt}},Lt?"\u2713":null))}))},P=C.forwardRef(H);P.displayName="OptionList";var ie=P,se=function(){return null};se.isSelectOption=!0;var Oe=se,Ke=function(){return null};Ke.isSelectOptGroup=!0;var ge=Ke,Me=y("VTBJ"),Ve=y("Zm9Q");function _e(g){var ue=g.key,Ie=g.props,Te=Ie.children,nt=Ie.value,st=Object(E.a)(Ie,["children","value"]);return Object(Me.a)({key:ue,value:nt!==void 0?nt:ue,children:Te},st)}function be(g){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Ve.a)(g).map(function(Ie,Te){if(!C.isValidElement(Ie)||!Ie.type)return null;var nt=Ie.type.isSelectOptGroup,st=Ie.key,Ue=Ie.props,He=Ue.children,Le=Object(E.a)(Ue,["children"]);return ue||!nt?_e(Ie):Object(Me.a)(Object(Me.a)({key:"__RC_SELECT_GRP__".concat(st===null?Te:st,"__"),label:st},Le),{},{options:be(He)})}).filter(function(Ie){return Ie})}var Ne=y("2Qr1"),we=y("qNPg"),N=y("U8pU"),Ee=y("Kwbf"),ye=y("WKfj");function k(g){var ue=g.mode,Ie=g.options,Te=g.children,nt=g.backfill,st=g.allowClear,Ue=g.placeholder,He=g.getInputElement,Le=g.showSearch,Be=g.onSearch,ce=g.defaultOpen,j=g.autoFocus,et=g.labelInValue,Ct=g.value,St=g.inputValue,ze=g.optionLabelProp,pt=ue==="multiple"||ue==="tags",fe=Le!==void 0?Le:pt||ue==="combobox",Ae=Ie||be(Te);if(Object(Ee.a)(ue!=="tags"||Ae.every(function(tt){return!tt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ue==="tags"||ue==="combobox"){var Ge=Ae.some(function(tt){return tt.options?tt.options.some(function(lt){return typeof("value"in lt?lt.value:lt.key)=="number"}):typeof("value"in tt?tt.value:tt.key)=="number"});Object(Ee.a)(!Ge,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(Ee.a)(ue!=="combobox"||!ze,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(Ee.a)(ue==="combobox"||!nt,"`backfill` only works with `combobox` mode."),Object(Ee.a)(ue==="combobox"||!He,"`getInputElement` only work with `combobox` mode."),Object(Ee.b)(ue!=="combobox"||!He||!st||!Ue,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Be&&!fe&&ue!=="combobox"&&ue!=="tags"&&Object(Ee.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(Ee.b)(!ce||j,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ct!=null){var Se=Object(ye.d)(Ct);Object(Ee.a)(!et||Se.every(function(tt){return Object(N.a)(tt)==="object"&&("key"in tt||"value"in tt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(Ee.a)(!pt||Array.isArray(Ct),"`value` should be array when `mode` is `multiple` or `tags`")}if(Te){var rt=null;Object(Ve.a)(Te).some(function(tt){if(!C.isValidElement(tt)||!tt.type)return!1;var lt=tt.type;if(lt.isSelectOption)return!1;if(lt.isSelectOptGroup){var It=Object(Ve.a)(tt.props.children).every(function(wt){return!C.isValidElement(wt)||!tt.type||wt.type.isSelectOption?!0:(rt=wt.type,!1)});return!It}return rt=lt,!0}),rt&&Object(Ee.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(rt.displayName||rt.name||rt,"`.")),Object(Ee.a)(St===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var K=k,he=Object(we.a)({prefixCls:"rc-select",components:{optionList:ie},convertChildrenToData:be,flattenOptions:Ne.d,getLabeledValue:Ne.e,filterOptions:Ne.b,isValueDisabled:Ne.g,findValueOption:Ne.c,warningProps:K,fillOptionsWithMissingValue:Ne.a}),$=function(g){Object(G.a)(Ie,g);var ue=Object(z.a)(Ie);function Ie(){var Te;return Object(S.a)(this,Ie),Te=ue.apply(this,arguments),Te.selectRef=C.createRef(),Te.focus=function(){Te.selectRef.current.focus()},Te.blur=function(){Te.selectRef.current.blur()},Te}return Object(de.a)(Ie,[{key:"render",value:function(){return C.createElement(he,Object.assign({ref:this.selectRef},this.props))}}]),Ie}(C.Component);$.Option=Oe,$.OptGroup=ge;var Re=$,M=Ze.c=Re},M8RZ:function(mt,Ze,y){"use strict";y.d(Ze,"a",function(){return B});var S=y("fWQN"),de=y("mtLc"),G=y("yKVA"),z=y("879j"),C=y("q1tI"),ee=y.n(C),E=y("i8i4"),R=y.n(E),B=function(X){Object(G.a)(O,X);var D=Object(z.a)(O);function O(te){var Q;Object(S.a)(this,O),Q=D.call(this,te);var W=window.document;return Q.node=W.createElement("div"),W.body.appendChild(Q.node),Q}return Object(de.a)(O,[{key:"render",value:function(){var Q=this.props.children;return Object(E.createPortal)(Q,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),O}(ee.a.Component)},OLES:function(mt,Ze,y){"use strict";var S=y("U8pU"),de=y("VTBJ"),G=y("Ff2n"),z=y("q1tI"),C=y("uciX"),ee=y("7ixt"),E=function(te){var Q=te.overlay,W=te.prefixCls,H=te.id,P=te.overlayInnerStyle;return z.createElement("div",{className:"".concat(W,"-inner"),id:H,role:"tooltip",style:P},typeof Q=="function"?Q():Q)},R=E,B=function(te,Q){var W=te.overlayClassName,H=te.trigger,P=H===void 0?["hover"]:H,ie=te.mouseEnterDelay,se=ie===void 0?0:ie,Oe=te.mouseLeaveDelay,Ke=Oe===void 0?.1:Oe,ge=te.overlayStyle,Me=te.prefixCls,Ve=Me===void 0?"rc-tooltip":Me,_e=te.children,be=te.onVisibleChange,Ne=te.afterVisibleChange,we=te.transitionName,N=te.animation,Ee=te.placement,ye=Ee===void 0?"right":Ee,k=te.align,K=k===void 0?{}:k,he=te.destroyTooltipOnHide,$=he===void 0?!1:he,Re=te.defaultVisible,M=te.getTooltipContainer,g=te.overlayInnerStyle,ue=Object(G.a)(te,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Ie=Object(z.useRef)(null);Object(z.useImperativeHandle)(Q,function(){return Ie.current});var Te=Object(de.a)({},ue);"visible"in te&&(Te.popupVisible=te.visible);var nt=function(){var Be=te.arrowContent,ce=Be===void 0?null:Be,j=te.overlay,et=te.id;return[z.createElement("div",{className:"".concat(Ve,"-arrow"),key:"arrow"},ce),z.createElement(R,{key:"content",prefixCls:Ve,id:et,overlay:j,overlayInnerStyle:g})]},st=!1,Ue=!1;if(typeof $=="boolean")st=$;else if($&&Object(S.a)($)==="object"){var He=$.keepParent;st=He===!0,Ue=He===!1}return z.createElement(C.a,Object.assign({popupClassName:W,prefixCls:Ve,popup:nt,action:P,builtinPlacements:ee.a,popupPlacement:ye,ref:Ie,popupAlign:K,getPopupContainer:M,onPopupVisibleChange:be,afterPopupVisibleChange:Ne,popupTransitionName:we,popupAnimation:N,defaultPopupVisible:Re,destroyPopupOnHide:st,autoDestroy:Ue,mouseLeaveDelay:Ke,popupStyle:ge,mouseEnterDelay:se},Te),_e)},X=Object(z.forwardRef)(B),D=Ze.a=X},Ot1p:function(mt,Ze,y){"use strict";var S=y("2qtc"),de=y("kLXV"),G=y("rAM+"),z=y("miYZ"),C=y("tsqr"),ee=y("9og8"),E=y("tJVT"),R=y("jrin"),B=y("WmNS"),X=y.n(B),D=y("q1tI"),O=y.n(D),te=y("VrN/"),Q=y.n(te),W=y("bdgK"),H=y("p77/"),P=y("Bd2K"),ie=y("ELLl"),se=y("19Vz"),Oe=y("lZu9"),Ke=y("+NIl"),ge=y("kSUc"),Me=y("9Bee"),Ve=function($e){var zt=$e.value,Lt=zt===void 0?"":zt,ht=$e.className,on=$e.showTextOnly,Zt=$e.showLines,En=$e.style,vn=En===void 0?{}:En,Bt=Object(D.useMemo)(function(){return""},[Lt]);return O.a.createElement(O.a.Fragment,null,O.a.createElement("div",{dangerouslySetInnerHTML:{__html:Bt}}))},_e=y("Q9mQ"),be=y("diRs"),Ne=y("0Owb"),we=y("dejd"),N=y("C+DQ"),Ee=y("D1Df"),ye=y.n(Ee),k=y("1vsH"),K=y("m3rI"),he=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function $($e){var zt=$e.onActionCallback,Lt=$e.title,ht=$e.icon,on=$e.actionName,Zt=$e.className,En=Zt===void 0?"":Zt,vn=$e.children;function Bt(){zt(on)}return O.a.createElement("a",{title:Lt,className:En,onClick:Bt},O.a.createElement("i",{className:"md-iconfont ".concat(ht)}),vn)}var Re=function($e){var zt=$e.watch,Lt=$e.showNullButton,ht=$e.onActionCallback,on=$e.fullScreen,Zt=$e.insertTemp,En=$e.hidetoolBar,vn=$e.uuid,Bt=$e.setOpenPhones,Wn=Object(k.E)("_educoder_session_login"),Bn=Object(k.E)("_educoder_session"),Tt=[].concat(he,[{title:"".concat(zt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(zt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return O.a.createElement("ul",{className:"markdown-toolbar-container"},!En&&Tt.map(function(di,oi){return O.a.createElement("li",{key:oi},di.actionName?O.a.createElement($,Object(Ne.a)({},di,{onActionCallback:ht})):O.a.createElement("span",{className:"v-line"}))}),Lt?O.a.createElement("li",null,O.a.createElement($,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ht},O.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Zt&&O.a.createElement("li",null,O.a.createElement($,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Zt),onActionCallback:ht},O.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),O.a.createElement("li",null,O.a.createElement(be.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:O.a.createElement("div",null,O.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+Wn+"&_educoder_session="+Bn+"&key="+vn+"&api="+encodeURIComponent(K.a.API_SERVER)),O.a.createElement(ye.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+Wn+"&_educoder_session="+Bn+"&key="+vn+"&api="+encodeURIComponent(K.a.API_SERVER)}))},O.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return Bt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),O.a.createElement("li",{className:"btn-full-screen"},O.a.createElement($,{icon:"".concat(on?"icon-shrink":"icon-enlarge"),title:on?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ht})))},M=y("M8RZ"),g=y("+L6B"),ue=y("2/Rp"),Ie=y("y8nQ"),Te=y("Vl3Y"),nt=y("5NDa"),st=y("5rEg"),Ue={labelCol:{span:4},wrapperCol:{span:20}},He=function($e){var zt=$e.callback,Lt=$e.onCancel;function ht(on){zt(on)}return O.a.createElement(Te.a,Object(Ne.a)({},Ue,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ht}),O.a.createElement(Te.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},O.a.createElement(st.a,null)),O.a.createElement(Te.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},O.a.createElement(st.a,null)),O.a.createElement("div",{className:"flex-container flex-end"},O.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(ue.a,{type:"ghost",onClick:Lt},"\u53D6\u6D88")))},Le=y("7ahc"),Be=y("k1fw"),ce=y("HmJG"),j=y("BjJ7"),et=Te.a.useForm,Ct={width:280,marginRight:10},St={labelCol:{span:5},wrapperCol:{span:19}},ze=function($e){var zt=$e.callback,Lt=$e.onCancel,ht=et(),on=Object(E.a)(ht,1),Zt=on[0],En=Object(D.useRef)();function vn(Bn){zt(Object(Be.a)(Object(Be.a)({},Bn),{},{name:En.current}))}function Bt(Bn,Tt){Zt.setFieldsValue({src:"/api/attachments/".concat(Bn.id,"?type=").concat(Bn.content_type),type:Tt.type})}function Wn(Bn){var Tt=Bn.target.files[0];En.current=Tt.name,fe(Tt,Bt)}return O.a.createElement(Te.a,Object(Ne.a)({form:Zt},St,{className:"upload-image-panel",onFinish:vn}),O.a.createElement(Te.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},O.a.createElement("div",{className:"flex-container"},O.a.createElement(Te.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},O.a.createElement(st.a,{style:Ct})),O.a.createElement(pt,{onFileChange:Wn}))),O.a.createElement(Te.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},O.a.createElement(st.a,{style:{width:264}})),O.a.createElement(Te.a.Item,{style:{textAlign:"right"}},O.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(ue.a,{type:"ghost",onClick:Lt},"\u53D6\u6D88")))};function pt($e){var zt=$e.onFileChange;return O.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",O.a.createElement("input",{type:"file",onChange:zt}))}function fe($e,zt){if(!$e)throw new String("\u6CA1\u6709\u6587\u4EF6");var Lt=new FormData;Lt.append("editormd-image-file",$e),Lt.append("file_param_name","editormd-image-file"),Lt.append("byxhr","true");var ht=new window.XMLHttpRequest;ht.withCredentials=!0,ht.addEventListener("load",function(on){zt(JSON.parse(on.target.responseText),$e)},!1),ht.addEventListener("error",function(on){console.error(on)},!1),ht.open("POST","".concat(j.a,"/api/attachments.json")),ht.send(Lt)}var Ae=y("giR+"),Ge=y("fyUT"),Se=y("7Kak"),rt=y("9yH6"),tt=rt.a.Group,lt={margin:"0 8px"},It=function($e){var zt=$e.callback,Lt=$e.onCancel;function ht(on){zt(on)}return O.a.createElement(Te.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ht},O.a.createElement("div",{className:"flex-container"},O.a.createElement("span",{style:lt},"\u5355\u5143\u683C\u6570\uFF1A"),O.a.createElement("span",{style:lt},"\u884C\u6570"),O.a.createElement(Te.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},O.a.createElement(Ge.a,null)),O.a.createElement("span",{style:lt},"\u5217\u6570"),O.a.createElement(Te.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},O.a.createElement(Ge.a,null))),O.a.createElement("div",{className:"flex-container",style:{marginTop:12}},O.a.createElement("span",{style:lt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),O.a.createElement(Te.a.Item,{name:"align"},O.a.createElement(tt,null,O.a.createElement(rt.a,{value:"default"},O.a.createElement("i",{className:"fa fa-align-justify"})),O.a.createElement(rt.a,{value:"left"},O.a.createElement("i",{className:"fa fa-align-left"})),O.a.createElement(rt.a,{value:"center"},O.a.createElement("i",{className:"fa fa-align-center"})),O.a.createElement(rt.a,{value:"right"},O.a.createElement("i",{className:"fa fa-align-right"}))))),O.a.createElement("div",{className:"flex-container flex-end"},O.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(ue.a,{type:"ghost",onClick:Lt},"\u53D6\u6D88")))},wt=y("ErOA"),bt=y("7Cbv"),ut="link",Rt="upload-image",xt="code-block",gt="add-table",De="------------",Dt={default:De,left:":".concat(De),center:":".concat(De,":"),right:"".concat(De,":")},vt=y("9VGf"),je,qe;function ae(){}var Z=0,re=1e4,x="\u2581",w=`
|
|
**\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 T($e){return/^\d+$/.test($e)?"".concat($e,"px"):$e}var L=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=L?"Cmd":"Ctrl",ke=["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"],Je=(je={},Object(R.a)(je,pe+"-B","bold"),Object(R.a)(je,pe+"-I","italic"),je),Mt=(qe={},Object(R.a)(qe,ut,"\u6DFB\u52A0\u94FE\u63A5"),Object(R.a)(qe,xt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(R.a)(qe,Rt,"\u6DFB\u52A0\u6587\u4EF6"),Object(R.a)(qe,gt,"\u6DFB\u52A0\u8868\u683C"),qe),Xt=Ze.a=function($e){var zt=$e.defaultValue,Lt=zt===void 0?"":zt,ht=$e.onChange,on=$e.width,Zt=on===void 0?"100%":on,En=$e.height,vn=En===void 0?400:En,Bt=$e.miniToolbar,Wn=Bt===void 0?!1:Bt,Bn=$e.isFocus,Tt=Bn===void 0?!1:Bn,di=$e.watch,oi=$e.insertTemp,ai=$e.mode,Si=ai===void 0?"markdown":ai,or=$e.id,Bi=or===void 0?"markdown-editor-id":or,pn=$e.showResizeBar,_t=pn===void 0?!1:pn,Fi=$e.noStorage,dr=Fi===void 0?!1:Fi,ki=$e.showNullButton,ln=ki===void 0?!1:ki,Yi=$e.hidetoolBar,fr=Yi===void 0?!1:Yi,pr=$e.fullScreen,Qe=pr===void 0?!1:pr,Ft=$e.onBlur,Ji=$e.onCMBeforeChange,ar=$e.onFullScreen,mr=$e.className,gr=mr===void 0?"":mr,h=$e.disablePaste,o=h===void 0?!1:h,a=$e.placeholder,u=a===void 0?"":a,p=$e.values,c=p===void 0?"":p,J=Object(D.useState)(null),We=Object(E.a)(J,2),xe=We[0],kt=We[1],Xe=Object(D.useState)(Lt),Ht=Object(E.a)(Xe,2),hn=Ht[0],Sn=Ht[1],Ri=Object(D.useState)(di),Hi=Object(E.a)(Ri,2),ei=Hi[0],Zi=Hi[1],Gr=Object(D.useState)(Qe),xi=Object(E.a)(Gr,2),_i=xi[0],sr=xi[1],vr=Object(D.useState)(""),zi=Object(E.a)(vr,2),lr=zi[0],Wi=zi[1],so=Object(D.useState)(0),Kr=Object(E.a)(so,2),Li=Kr[0],Jn=Kr[1],_r=Object(D.useState)(vn),Ir=Object(E.a)(_r,2),Xr=Ir[0],Vn=Ir[1],bn=Object(D.useState)(!1),$n=Object(E.a)(bn,2),yn=$n[0],si=$n[1],Rn=Object(D.useRef)(Object(bt.a)()),yr=Object(D.useRef)(!1),ti=Object(D.useRef)(),Zn=Object(D.useRef)(),ur=Object(D.useRef)(),Or=Object(D.useRef)(),qi=Object(D.useRef)(),br=function(){var Ot=Object(ee.a)(X.a.mark(function Gt(){var Pt,an;return X.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(wt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Rn.current}});case 2:an=kn.sent,an!=null&&(Pt=an.attachments)!==null&&Pt!==void 0&&Pt.length&&(console.log("cm:",xe,Zn),an.attachments.map(function(un){un.content_type.indexOf("image")>-1?xe.replaceSelection(".concat(un.content_type,")")):un.content_type.indexOf("video")>-1?xe.replaceSelection('<video width="100%" controls src="'.concat(K.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):un.content_type.indexOf("pdf")>-1?xe.replaceSelection('<a href="'.concat(K.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,'&disposition=inline" target="_blank">').concat(un.name,"</a>")):xe.replaceSelection("[".concat(un.name,"](").concat(K.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,")"))}));case 4:case"end":return kn.stop()}},Gt)}));return function(){return Ot.apply(this,arguments)}}();Object(D.useEffect)(function(){Sn(c),xe==null||xe.setValue(c)},[c]),Object(D.useEffect)(function(){ar==null||ar(_i)},[_i]),Object(D.useEffect)(function(){if(Zn.current){var Ot=Q.a.fromTextArea(Zn.current,{mode:Si,lineNumbers:!Wn,lineWrapping:!0,value:Lt,autoCloseTags:!0,autoCloseBrackets:!0});Tt&&Ot.focus();function Gt(Pt,an){if(o){an.preventDefault();return}var mn=an.clipboardData;if(mn){var kn=mn.types.toString(),un=mn.items;if(kn==="Files"||mn.types.indexOf("Files")>-1){if(an.preventDefault(),Si=="stex")return;try{var Un,li=un[1];((Un=un[0])===null||Un===void 0?void 0:Un.kind)==="file"&&(li=un[0]);var tn=li.getAsFile(),Cr=tn.name.split(".").pop();fe(tn,function(On){if(On.id){var ui,xn,Vi;(tn==null||((ui=tn.type)===null||ui===void 0)?void 0:ui.indexOf("image"))>-1?Ot.replaceSelection(".concat(On.content_type,")")):(tn==null||((xn=tn.type)===null||xn===void 0)?void 0:xn.indexOf("video"))>-1?Ot.replaceSelection('<video width="100%" controls src="'.concat(K.a.API_SERVER,"/api/attachments/").concat(On.id,'"></video>')):(tn==null||((Vi=tn.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?Ot.replaceSelection('<a href="'.concat(K.a.API_SERVER,"/api/attachments/").concat(On.id,"?type=").concat(tn.type,'&disposition=inline" target="_blank">').concat(tn.name,"</a>")):ke.includes(Cr)?Ot.replaceSelection('<a href="'.concat(K.a.API_SERVER,"/api/attachments/").concat(On.id,'?type=office&disposition=inline" target="_blank">').concat(tn.name,"</a>")):Ot.replaceSelection("[".concat(tn.name,"](").concat(K.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){C.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ot.on("paste",Gt),Ot.on("dragleave",function(Pt,an){ur.current.classList.remove("mouse-hover-md")}),Ot.on("dragover",function(Pt,an){ur.current.classList.add("mouse-hover-md")}),Ot.on("drop",function(Pt,an){ur.current.classList.add("mouse-hover-md");var mn;if(mn=an.dataTransfer.files,mn.length>0){an.preventDefault(),an.stopPropagation();for(var kn=function(li){var tn=mn[li],Cr=tn.name.split(".").pop();fe(tn,function(On){if(On.id){var ui,xn,Vi;(tn==null||((ui=tn.type)===null||ui===void 0)?void 0:ui.indexOf("image"))>-1?Ot.replaceSelection(".concat(On.content_type,")")):(tn==null||((xn=tn.type)===null||xn===void 0)?void 0:xn.indexOf("video"))>-1?Ot.replaceSelection('<video width="100%" controls src="'.concat(K.a.API_SERVER,"/api/attachments/").concat(On.id,'"></video>')):(tn==null||((Vi=tn.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?Ot.replaceSelection('<a href="'.concat(K.a.API_SERVER,"/api/attachments/").concat(On.id,"?type=").concat(tn.type,'&disposition=inline" target="_blank">').concat(tn.name,"</a>")):ke.includes(Cr)?Ot.replaceSelection('<a href="'.concat(K.a.API_SERVER,"/api/attachments/").concat(On.id,'?type=office&disposition=inline" target="_blank">').concat(tn.name,"</a>")):Ot.replaceSelection("[".concat(tn.name,"](").concat(K.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")})},un=0;un<mn.length;un++)kn(un)}}),kt(Ot),function(){Ot.off("paste",Gt)}}},[]);var Di=Object(D.useCallback)(function(){if(ur.current)try{}catch(Ot){console.log(Ot,"---- to set md editor body height")}},[Xr,ur,_i]);Object(D.useEffect)(function(){function Ot(){var Pt=new W.default(function(an){var mn=Object(G.a)(an),kn;try{for(mn.s();!(kn=mn.n()).done;){var un=kn.value;(un.target.offsetHeight>0||un.target.offsetWidth>0)&&(Di(),xe.setSize("100%","100%"),xe.refresh())}}catch(Un){mn.e(Un)}finally{mn.f()}});return Pt.observe(Zn.current.parentElement),Pt}if(xe){var Gt=Ot();return function(){Gt.unobserve(Zn.current.parentElement)}}},[xe,Di]),Object(D.useEffect)(function(){if(xe){for(var Ot=[],Gt=function(){var un=an[Pt];mn=Object(E.a)(un,2);var Un=mn[0],li=mn[1],tn=Object(R.a)({},Un,function(){$r(li)});Ot.push(tn),xe.addKeyMap(tn)},Pt=0,an=Object.entries(Je);Pt<an.length;Pt++){var mn;Gt()}return ti.current=setInterval(function(){yr.current&&br()},4e3),function(){clearInterval(ti.current);var kn=Object(G.a)(Ot),un;try{for(kn.s();!(un=kn.n()).done;){var Un=un.value;xe.removeKeyMap(Un)}}catch(li){kn.e(li)}finally{kn.f()}}}},[xe]),Object(D.useEffect)(function(){Qe!==_i&&sr(Qe)},[Qe]),Object(vt.a)(function(){if(!dr&&Li>0){var Ot=new Date().getTime(),Gt=window.sessionStorage.getItem(Bi);Ot>=Li+re&&(!Gt||Gt!==hn)&&(window.sessionStorage.setItem(Bi,hn),si(!0))}},re),Object(D.useEffect)(function(){Zi(di)},[xe,di]),Object(D.useEffect)(function(){xe&&(Tt&&xe.focus())},[xe,Tt]),Object(D.useEffect)(function(){if(ei&&xe){var Ot=xe.getScrollerElement();function Gt(Pt){var an=Pt.target;if(qi.current){var mn=an.scrollTop/an.scrollHeight;qi.current.scrollTop=qi.current.scrollHeight*mn}}return Ot.addEventListener("scroll",Gt),function(){Ot.removeEventListener("scroll",Gt)}}},[xe,ei]),Object(D.useEffect)(function(){if(xe&&Ji){function Ot(Gt,Pt){Ji(Gt,Pt)}return xe.on("beforeChange",Ot),function(){xe.off("beforeChange",Ot)}}},[xe,Ji]),Object(D.useEffect)(function(){if(xe&&Ft){function Ot(){Ft(xe.getValue())}return xe.on("blur",Ot),function(){xe.off("blur",Ot)}}},[xe,Ft]),Object(D.useEffect)(function(){if(xe){function Ot(Gt){var Pt=Gt.getValue();Sn(Pt),Jn(new Date().getTime()),Gt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ht&&ht(Pt)}return xe.on("change",Ot),function(){xe.off("change",Ot)}}},[xe,ht]),Object(D.useEffect)(function(){xe&&(Lt==null?(xe.setValue(""),Sn("")):Lt!==xe.getValue()&&(xe.setValue(Lt),Sn(Lt),xe.setCursor(xe.lineCount(),0)))},[xe,Lt]);var $r=Object(D.useCallback)(function(Ot){var Gt=xe.getCursor(),Pt=xe.getSelection(),an=Pt.split(`
|
|
`);switch(Ot){case"bold":return xe.replaceSelection("**"+Pt+"**"),Pt===""&&xe.setCursor(Gt.line,Gt.ch+2),xe.focus();case"italic":return xe.replaceSelection("*"+Pt+"*"),Pt===""&&xe.setCursor(Gt.line,Gt.ch+1),xe.focus();case"code":return xe.replaceSelection("`"+Pt+"`"),Pt===""&&xe.setCursor(Gt.line,Gt.ch+1),xe.focus();case"inline-latex":return xe.replaceSelection("`$$"+Pt+"$$`"),Pt===""&&xe.setCursor(Gt.line,Gt.ch+3),xe.focus();case"latex":return xe.replaceSelection("```latex\n"+Pt+"\n```"),xe.setCursor(Gt.line+1,Pt.length+1),xe.focus();case"line-break":return xe.replaceSelection(`<br/>
|
|
`),xe.focus();case"list-ul":return Pt===""?xe.replaceSelection("- "+Pt):xe.replaceSelection(an.map(function(mn){return mn===""?"":"- ".concat(mn)}).join(`
|
|
`)),xe.focus();case"list-ol":return Pt===""?xe.replaceSelection("1. "+Pt):xe.replaceSelection(an.map(function(mn,kn){return mn===""?"":"".concat(kn+1,". ").concat(mn)}).join(`
|
|
`)),xe.focus();case"add-null-ch":return Pt===""&&xe.setCursor(Gt.line,Gt.ch+1),xe.replaceSelection(x),xe.focus();case"inster-template-1":return Pt===""&&xe.setCursor(Gt.line,Gt.ch),xe.replaceSelection(w),xe.focus();case"eraser":return xe.setValue(""),xe.focus();case"trigger-watch":return Zi(!ei),xe.focus();case"trigger-full-screen":return sr(!_i),xe.focus();case ut:Wi(ut);return;case xt:Wi(xt);return;case Rt:Wi(Rt);return;case gt:Wi(gt);return;default:throw new Error}},[xe,ei,_i]),Oi=Object(D.useCallback)(function(Ot){Wi("");switch(lr){case ut:var Gt=Ot.title,Pt=Ot.link;return xe.replaceSelection("[".concat(Gt,"](").concat(Pt,")")),xe.focus();case xt:var an=Ot.language,mn=Ot.content;return xe.replaceSelection(["```"+an,mn,"```"].join(`
|
|
`)),xe.focus();case Rt:var kn=Ot.src,un=Ot.alt,Un=Ot.name;return kn.indexOf("type=image")>-1?xe.replaceSelection(".concat(kn,' "').concat(un||"",'" )')):kn.indexOf("type=application/pdf")>-1?xe.replaceSelection('<a href="'.concat(kn,'&disposition=inline" target="_blank">').concat(Un,"</a>")):xe.replaceSelection('<a href="'.concat(kn,'" target="_blank">').concat(Un,"</a>")),xe.focus();case gt:for(var li=Ot.row,tn=Ot.col,Cr=Ot.align,On=`
|
|
`,ui=0;ui<li;ui++){for(var xn=[],Vi=[],lo=0;lo<tn;lo++)ui===1&&Vi.push(Dt[Cr]),xn.push(" ");ui===1&&(On+="| ".concat(Vi.join(" | "),` |
|
|
`)),On+="| ".concat(xn.join(tn===1?"":" | "),` |
|
|
`)}return xe.replaceSelection(On+`
|
|
`),xe.focus();default:throw new Error}},[xe,lr]),Yr=Object(D.useMemo)(function(){switch(lr){case ut:return O.a.createElement(He,{callback:Oi,onCancel:cr});case xt:return O.a.createElement(Le.b,{callback:Oi,onCancel:cr});case Rt:return O.a.createElement(ze,{callback:Oi,onCancel:cr});case gt:return O.a.createElement(It,{callback:Oi,onCancel:cr});default:return null}},[lr]);function cr(){Wi("")}Object(D.useEffect)(function(){if(Or.current){var Ot=Or.current,Gt=!1,Pt=0;function an(un){Gt=!0,Pt=un.pageY}function mn(){Gt=!1}function kn(un){if(Gt){var Un=un.pageY-Pt;Un<0&&(Un=0),Un>300&&(Un=300);var li=vn+Un+"px";Vn(li)}}return Ot.addEventListener("mousedown",an),document.addEventListener("mousemove",kn),document.addEventListener("mouseup",mn),function(){Ot.removeEventListener("mousedown",an),document.removeEventListener("mousemove",kn),document.removeEventListener("mouseup",mn)}}},[xe,Or]),Object(D.useEffect)(function(){Vn(vn)},[vn]);var Mr=T(Zt),Ho=T(Xr),yo={width:Mr,height:Ho},ya=Object(D.useMemo)(function(){if(Li){var Ot=new Date(Li),Gt=Ot.getHours(),Pt=Ot.getMinutes(),an=Ot.getSeconds();return Gt=Gt<10?"0"+Gt:Gt,Pt=Pt<10?"0"+Pt:Pt,an=an<10?"0"+an:an,"".concat(Gt,":").concat(Pt,":").concat(an)}return 0},[Li]);function bo(){window.sessionStorage.removeItem(Bi),si(!1),Jn(0)}function zo(){si(!1),Jn(0),xe.setValue(window.sessionStorage.getItem(Bi))}function Co(Ot,Gt){var Pt=xe.getValue();Pt=Pt.replace(Ot,Gt),Sn(Pt),xe==null||xe.setValue(Pt)}return O.a.createElement(D.Fragment,null,O.a.createElement("div",{className:"markdown-editor-wrapper",ref:ur},O.a.createElement("div",{className:"markdown-editor-container ".concat(gr," ").concat(ei?"on-preview":""," ").concat(Wn?"mini":""," ").concat(_i?"full-screen":""),style:yo},O.a.createElement(Re,{insertTemp:oi,watch:ei,fullScreen:_i,showNullButton:ln,onActionCallback:$r,hidetoolBar:fr,uuid:Rn.current,setOpenPhones:function(){yr.current=!0}}),O.a.createElement("div",{className:"markdown-editor-body"},O.a.createElement("div",{className:"codemirror-container"},O.a.createElement("textarea",{ref:Zn,placeholder:u})),ei?O.a.createElement("div",{ref:qi,className:"preview-container"},Si==="stex"&&O.a.createElement(Ve,{value:hn}),Si!=="stex"&&O.a.createElement(Me.a,{edit:!0,value:hn,replaces:Co})):null))),_t?O.a.createElement("a",{ref:Or,className:"editor-resize"}):null,O.a.createElement(M.a,null,Mt[lr]?O.a.createElement(de.a,{centered:!0,title:Mt[lr],visible:!0,onCancel:cr,footer:null},Yr):null))}},PRkG:function(mt,Ze,y){"use strict";y.r(Ze);var S=y("T2oS"),de=y("W9HT"),G=y("0Owb"),z=y("k1fw"),C=y("+L6B"),ee=y("2/Rp"),E=y("/zsF"),R=y("PArb"),B=y("14J3"),X=y("BMrR"),D=y("jCWc"),O=y("kPKH"),te=y("9og8"),Q=y("tJVT"),W=y("Znn+"),H=y("ZTPi"),P=y("tU7J"),ie=y("wFql"),se=y("WmNS"),Oe=y.n(se),Ke=y("q1tI"),ge=y.n(Ke),Me=y("Ty5D"),Ve=y("9kvl"),_e=y("xz5A"),be=y.n(_e),Ne=y("fr4D"),we=y("9Bee"),N=y("Ot1p"),Ee=y("m3rI"),ye=y("wd/R"),k=y.n(ye),K=y("TTx2"),he=y.n(K),$=y("p5ED"),Re=y("V0Rq"),M=ie.a.Paragraph,g=H.a.TabPane,ue;(function(Te){Te[Te.Preview=0]="Preview",Te[Te.Download=1]="Download"})(ue||(ue={}));var Ie=function(nt){var st,Ue,He,Le,Be,ce,j=nt.user,et=nt.globalSetting,Ct=Object(Ke.useState)(),St=Object(Q.a)(Ct,2),ze=St[0],pt=St[1],fe=Object(Ke.useState)(!1),Ae=Object(Q.a)(fe,2),Ge=Ae[0],Se=Ae[1],rt=Object(Me.i)(),tt=rt.id;Object(Ke.useEffect)(function(){lt()},[]);var lt=function(){var T=Object(te.a)(Oe.a.mark(function L(){var pe,ke;return Oe.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Se(!0),Mt.next=3,Object(Ne.l)({attachment_id:tt});case 3:if(ke=Mt.sent,Se(!1),!ke.status){Mt.next=7;break}return Mt.abrupt("return");case 7:pt(ke.attachment_info),De((pe=ke.attachment_info)===null||pe===void 0?void 0:pe.introduce);case 9:case"end":return Mt.stop()}},L)}));return function(){return T.apply(this,arguments)}}(),It=Object(Ke.useState)(!1),wt=Object(Q.a)(It,2),bt=wt[0],ut=wt[1],Rt=Object(Ke.useState)(""),xt=Object(Q.a)(Rt,2),gt=xt[0],De=xt[1],Dt=Object(Ke.useState)({name:"",filename:"",type:"",className:"",data:"",close:!0,hasMask:!0,style:{position:"fixed",zIndex:9999,background:"rgba(0,0,0,.7)"},monacoEditor:{value:"",language:"",theme:"vs",options:{readOnly:!0}}}),vt=Object(Q.a)(Dt,2),je=vt[0],qe=vt[1],ae=function(){var T=Object(te.a)(Oe.a.mark(function L(){var pe;return Oe.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return Je.next=2,Object(Ne.w)({attachment_id:tt,introduce:gt});case 2:pe=Je.sent,pe.status===0&&(ut(!1),lt());case 4:case"end":return Je.stop()}},L)}));return function(){return T.apply(this,arguments)}}(),Z="".concat(et==null||((st=et.setting)===null||st===void 0)?void 0:st.bigfiles_upload,"/file/download/").concat((Ue=j.userInfo)===null||Ue===void 0?void 0:Ue.login,"/").concat(ze==null?void 0:ze.disk_filename,"?fileName=").concat(encodeURIComponent(ze==null?void 0:ze.filename)),re=ze!=null&&(He=ze.cover_img_file)!==null&&He!==void 0&&(Le=He[0])!==null&&Le!==void 0&&Le.url?"".concat(Ee.a.API_SERVER).concat(ze==null||((Be=ze.cover_img_file)===null||Be===void 0||((ce=Be[0])===null||ce===void 0))?void 0:ce.url):he.a,x=["audio","video","html","pdf","image"].includes(ze==null?void 0:ze.file_type)?"".concat(Z,"&type=").concat(ue.Preview):"".concat(Z,"&type=").concat(ue.Download),w=(ze==null?void 0:ze.is_show_edit_button)===void 0||(ze==null?void 0:ze.is_show_edit_button);return ge.a.createElement(de.a,{spinning:Ge},ze&&ge.a.createElement("div",{className:be.a.wrapper},ge.a.createElement(X.a,{align:"bottom",className:be.a.mainInfo},ge.a.createElement(O.a,null,ge.a.createElement("img",{src:re,alt:"",className:be.a.cover})),ge.a.createElement(O.a,{className:be.a.mainText},ge.a.createElement("div",{className:be.a.title},ze.alias_name),ge.a.createElement(M,{ellipsis:{rows:3,expandable:!0,symbol:ge.a.createElement("span",{style:{color:"#165dff"}},"\u5C55\u5F00")},className:be.a.desc},ze.description))),ge.a.createElement(X.a,{justify:"space-between"},ge.a.createElement(O.a,{className:be.a.info},ge.a.createElement("span",null,"\u6700\u540E\u4FEE\u6539\u4EBA\uFF1A",ze.author),ge.a.createElement("span",{className:be.a.create_time},"\u521B\u5EFA\u65F6\u95F4\uFF1A",k()(ze.created_on).format("YYYY-MM-DD HH:mm")),ge.a.createElement("span",{className:be.a.create_time},"\u5927\u5C0F\uFF1A",ze.filesize))),ge.a.createElement(R.a,null),ge.a.createElement(H.a,null,ge.a.createElement(g,{tab:"\u6570\u636E\u96C6\u4ECB\u7ECD",key:"1"},w&&ge.a.createElement(X.a,{justify:"end",className:be.a.btnWrapper},bt?ge.a.createElement(O.a,null,ge.a.createElement(ee.a,{className:be.a.btn,onClick:function(){return ut(!1)}},"\u53D6\u6D88"),ge.a.createElement(ee.a,{className:be.a.btn,style:{marginLeft:12},onClick:ae,type:"primary"},"\u4FDD\u5B58")):ge.a.createElement(ee.a,{className:be.a.btn,onClick:function(){return ut(!0)}},"\u7F16\u8F91")),bt?ge.a.createElement(N.a,{defaultValue:ze.introduce||"",onChange:function(L){De(L)}}):ge.a.createElement(we.a,{value:ze.introduce||""})),ge.a.createElement(g,{tab:"\u6570\u636E\u96C6\u6587\u4EF6",key:"2"},ge.a.createElement(X.a,{className:be.a.fileWrapper,align:"middle"},ge.a.createElement("a",{onClick:Object(te.a)(Oe.a.mark(function T(){var L;return Oe.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:if(!["xlsx","docx","doc","pptx","office"].includes(ze.file_type)){ke.next=7;break}return ke.next=3,Object(Re.U)({attachment_id:ze==null?void 0:ze.attachment_id});case 3:L=ke.sent,qe(Object(z.a)(Object(z.a)({},je),{},{filename:ze.filename,type:L.fileType,data:Ee.a.API_SERVER+L.url,otherData:L})),ke.next=9;break;case 7:return qe(Object(z.a)(Object(z.a)({},je),{},{filename:ze.filename,type:ze.file_type,data:Ee.a.API_SERVER+ze.url})),ke.abrupt("return");case 9:case"end":return ke.stop()}},T)}))},ge.a.createElement("span",null,ze.filename)),ge.a.createElement("span",{className:be.a.fileSize},"(".concat(ze.filesize,")")),ge.a.createElement("a",{className:be.a.download,download:ze.filename,href:"".concat(Z,"&type=").concat(ue.Download)},"\u4E0B\u8F7D"))))),ge.a.createElement($.a,Object(G.a)({},je,{onClose:function(){qe(Object(z.a)(Object(z.a)({},je),{},{type:""}))}})))};Ze.default=Object(Ve.a)(function(Te){var nt=Te.user,st=Te.globalSetting;return{user:nt,globalSetting:st}})(Ie)},SJMd:function(mt,Ze){/**
|
|
* @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 y,S,de,G=!1,z,C;window.PR_SHOULD_USE_CONTINUATION=!0;var ee,E;(function(){var R=window,B=["break,continue,do,else,for,if,return,while"],X=[B,"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"],D=[X,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],O=[D,"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"],te=[D,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],Q=[D,"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",H=[D,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],P="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",ie=[B,"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"],se=[B,"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"],Oe=[B,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ke=[O,Q,te,H,P,ie,se,Oe],ge=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,Me="str",Ve="kwd",_e="com",be="typ",Ne="lit",we="pun",N="pln",Ee="tag",ye="dec",k="src",K="atn",he="atv",$="nocode",Re="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function M(fe){for(var Ae=0,Ge=!1,Se=!1,rt=0,tt=fe.length;rt<tt;++rt){var lt=fe[rt];if(lt.ignoreCase)Se=!0;else if(/[a-z]/i.test(lt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ge=!0,Se=!1;break}}var It={b:8,t:9,n:10,v:11,f:12,r:13};function wt(gt){var De=gt.charCodeAt(0);if(De!==92)return De;var Dt=gt.charAt(1);return De=It[Dt],De||("0"<=Dt&&Dt<="7"?parseInt(gt.substring(1),8):Dt==="u"||Dt==="x"?parseInt(gt.substring(2),16):gt.charCodeAt(1))}function bt(gt){if(gt<32)return(gt<16?"\\x0":"\\x")+gt.toString(16);var De=String.fromCharCode(gt);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function ut(gt){var De=gt.substring(1,gt.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")),Dt=[],vt=De[0]==="^",je=["["];vt&&je.push("^");for(var qe=vt?1:0,ae=De.length;qe<ae;++qe){var Z=De[qe];if(/\\[bdsw]/i.test(Z))je.push(Z);else{var re=wt(Z),x;qe+2<ae&&De[qe+1]==="-"?(x=wt(De[qe+2]),qe+=2):x=re,Dt.push([re,x]),x<65||re>122||(x<65||re>90||Dt.push([Math.max(65,re)|32,Math.min(x,90)|32]),x<97||re>122||Dt.push([Math.max(97,re)&~32,Math.min(x,122)&~32]))}}Dt.sort(function(pe,ke){return pe[0]-ke[0]||ke[1]-pe[1]});for(var w=[],T=[],qe=0;qe<Dt.length;++qe){var L=Dt[qe];L[0]<=T[1]+1?T[1]=Math.max(T[1],L[1]):w.push(T=L)}for(var qe=0;qe<w.length;++qe){var L=w[qe];je.push(bt(L[0])),L[1]>L[0]&&(L[1]+1>L[0]&&je.push("-"),je.push(bt(L[1])))}return je.push("]"),je.join("")}function Rt(gt){for(var De=gt.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")),Dt=De.length,vt=[],je=0,qe=0;je<Dt;++je){var ae=De[je];if(ae==="(")++qe;else if(ae.charAt(0)==="\\"){var Z=+ae.substring(1);Z&&(Z<=qe?vt[Z]=-1:De[je]=bt(Z))}}for(var je=1;je<vt.length;++je)vt[je]===-1&&(vt[je]=++Ae);for(var je=0,qe=0;je<Dt;++je){var ae=De[je];if(ae==="(")++qe,vt[qe]||(De[je]="(?:");else if(ae.charAt(0)==="\\"){var Z=+ae.substring(1);Z&&Z<=qe&&(De[je]="\\"+vt[Z])}}for(var je=0;je<Dt;++je)De[je]==="^"&&De[je+1]!=="^"&&(De[je]="");if(gt.ignoreCase&&Ge)for(var je=0;je<Dt;++je){var ae=De[je],re=ae.charAt(0);ae.length>=2&&re==="["?De[je]=ut(ae):re!=="\\"&&(De[je]=ae.replace(/[a-zA-Z]/g,function(T){var L=T.charCodeAt(0);return"["+String.fromCharCode(L&~32,L|32)+"]"}))}return De.join("")}for(var xt=[],rt=0,tt=fe.length;rt<tt;++rt){var lt=fe[rt];if(lt.global||lt.multiline)throw new Error(""+lt);xt.push("(?:"+Rt(lt)+")")}return new RegExp(xt.join("|"),Se?"gi":"g")}function g(fe,Ae){var Ge=/(?:^|\s)nocode(?:\s|$)/,Se=[],rt=0,tt=[],lt=0;function It(wt){var bt=wt.nodeType;if(bt==1){if(Ge.test(wt.className))return;for(var ut=wt.firstChild;ut;ut=ut.nextSibling)It(ut);var Rt=wt.nodeName.toLowerCase();(Rt==="br"||Rt==="li")&&(Se[lt]=`
|
|
`,tt[lt<<1]=rt++,tt[lt++<<1|1]=wt)}else if(bt==3||bt==4){var xt=wt.nodeValue;xt.length&&(Ae?xt=xt.replace(/\r\n?/g,`
|
|
`):xt=xt.replace(/[ \t\r\n]+/g," "),Se[lt]=xt,tt[lt<<1]=rt,rt+=xt.length,tt[lt++<<1|1]=wt)}}return It(fe),{sourceCode:Se.join("").replace(/\n$/,""),spans:tt}}function ue(fe,Ae,Ge,Se,rt){if(!Ge)return;var tt={sourceNode:fe,pre:1,langExtension:null,numberLines:null,sourceCode:Ge,spans:null,basePos:Ae,decorations:null};Se(tt),rt.push.apply(rt,tt.decorations)}var Ie=/\S/;function Te(fe){for(var Ae=void 0,Ge=fe.firstChild;Ge;Ge=Ge.nextSibling){var Se=Ge.nodeType;Ae=Se===1?Ae?fe:Ge:Se===3&&Ie.test(Ge.nodeValue)?fe:Ae}return Ae===fe?void 0:Ae}function nt(fe,Ae){var Ge={},Se;(function(){for(var lt=fe.concat(Ae),It=[],wt={},bt=0,ut=lt.length;bt<ut;++bt){var Rt=lt[bt],xt=Rt[3];if(xt)for(var gt=xt.length;--gt>=0;)Ge[xt.charAt(gt)]=Rt;var De=Rt[1],Dt=""+De;wt.hasOwnProperty(Dt)||(It.push(De),wt[Dt]=null)}It.push(/[\0-\uffff]/),Se=M(It)})();var rt=Ae.length,tt=function(lt){for(var It=lt.sourceCode,wt=lt.basePos,bt=lt.sourceNode,ut=[wt,N],Rt=0,xt=It.match(Se)||[],gt={},De=0,Dt=xt.length;De<Dt;++De){var vt=xt[De],je=gt[vt],qe=void 0,ae;if(typeof je=="string")ae=!1;else{var Z=Ge[vt.charAt(0)];if(Z)qe=vt.match(Z[1]),je=Z[0];else{for(var re=0;re<rt;++re)if(Z=Ae[re],qe=vt.match(Z[1]),qe){je=Z[0];break}qe||(je=N)}ae=je.length>=5&&je.substring(0,5)==="lang-",ae&&!(qe&&typeof qe[1]=="string")&&(ae=!1,je=k),ae||(gt[vt]=je)}var x=Rt;if(Rt+=vt.length,!ae)ut.push(wt+x,je);else{var w=qe[1],T=vt.indexOf(w),L=T+w.length;qe[2]&&(L=vt.length-qe[2].length,T=L-w.length);var pe=je.substring(5);ue(bt,wt+x,vt.substring(0,T),tt,ut),ue(bt,wt+x+T,w,j(pe,w),ut),ue(bt,wt+x+L,vt.substring(L),tt,ut)}}lt.decorations=ut};return tt}function st(fe){var Ae=[],Ge=[];fe.tripleQuotedStrings?Ae.push([Me,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):fe.multiLineStrings?Ae.push([Me,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ae.push([Me,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),fe.verbatimStrings&&Ge.push([Me,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Se=fe.hashComments;Se&&(fe.cStyleComments?(Se>1?Ae.push([_e,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ae.push([_e,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ge.push([Me,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ae.push([_e,/^#[^\r\n]*/,null,"#"])),fe.cStyleComments&&(Ge.push([_e,/^\/\/[^\r\n]*/,null]),Ge.push([_e,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var rt=fe.regexLiterals;if(rt){var tt=rt>1?"":`
|
|
\r`,lt=tt?".":"[\\S\\s]",It="/(?=[^/*"+tt+"])(?:[^/\\x5B\\x5C"+tt+"]|\\x5C"+lt+"|\\x5B(?:[^\\x5C\\x5D"+tt+"]|\\x5C"+lt+")*(?:\\x5D|$))+/";Ge.push(["lang-regex",RegExp("^"+Re+"("+It+")")])}var wt=fe.types;wt&&Ge.push([be,wt]);var bt=(""+fe.keywords).replace(/^ | $/g,"");bt.length&&Ge.push([Ve,new RegExp("^(?:"+bt.replace(/[\s,]+/g,"|")+")\\b"),null]),Ae.push([N,/^\s+/,null,` \r
|
|
\xA0`]);var ut="^.[^\\s\\w.$@'\"`/\\\\]*";return fe.regexLiterals&&(ut+="(?!s*/)"),Ge.push([Ne,/^@[a-z_$][a-z_$@0-9]*/i,null],[be,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[N,/^[a-z_$][a-z_$@0-9]*/i,null],[Ne,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[N,/^\\[\s\S]?/,null],[we,new RegExp(ut),null]),nt(Ae,Ge)}var Ue=st({keywords:Ke,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function He(fe,Ae,Ge){for(var Se=/(?:^|\s)nocode(?:\s|$)/,rt=/\r\n?|\n/,tt=fe.ownerDocument,lt=tt.createElement("li");fe.firstChild;)lt.appendChild(fe.firstChild);var It=[lt];function wt(De){var Dt=De.nodeType;if(Dt==1&&!Se.test(De.className))if(De.nodeName==="br")bt(De),De.parentNode&&De.parentNode.removeChild(De);else for(var vt=De.firstChild;vt;vt=vt.nextSibling)wt(vt);else if((Dt==3||Dt==4)&&Ge){var je=De.nodeValue,qe=je.match(rt);if(qe){var ae=je.substring(0,qe.index);De.nodeValue=ae;var Z=je.substring(qe.index+qe[0].length);if(Z){var re=De.parentNode;re.insertBefore(tt.createTextNode(Z),De.nextSibling)}bt(De),ae||De.parentNode.removeChild(De)}}}function bt(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function Dt(qe,ae){var Z=ae?qe.cloneNode(!1):qe,re=qe.parentNode;if(re){var x=Dt(re,1),w=qe.nextSibling;x.appendChild(Z);for(var T=w;T;T=w)w=T.nextSibling,x.appendChild(T)}return Z}for(var vt=Dt(De.nextSibling,0),je;(je=vt.parentNode)&&je.nodeType===1;)vt=je;It.push(vt)}for(var ut=0;ut<It.length;++ut)wt(It[ut]);Ae===(Ae|0)&&It[0].setAttribute("value",Ae);var Rt=tt.createElement("ol");Rt.className="linenums";for(var xt=Math.max(0,Ae-1|0)||0,ut=0,gt=It.length;ut<gt;++ut)lt=It[ut],lt.className="L"+(ut+xt)%10,lt.firstChild||lt.appendChild(tt.createTextNode("\xA0")),Rt.appendChild(lt);fe.appendChild(Rt)}function Le(fe){var Ae=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ae=Ae&&+Ae[1]<=8;var Ge=/\n/g,Se=fe.sourceCode,rt=Se.length,tt=0,lt=fe.spans,It=lt.length,wt=0,bt=fe.decorations,ut=bt.length,Rt=0;bt[ut]=rt;var xt,gt;for(gt=xt=0;gt<ut;)bt[gt]!==bt[gt+2]?(bt[xt++]=bt[gt++],bt[xt++]=bt[gt++]):gt+=2;for(ut=xt,gt=xt=0;gt<ut;){for(var De=bt[gt],Dt=bt[gt+1],vt=gt+2;vt+2<=ut&&bt[vt+1]===Dt;)vt+=2;bt[xt++]=De,bt[xt++]=Dt,gt=vt}ut=bt.length=xt;var je=fe.sourceNode,qe="";je&&(qe=je.style.display,je.style.display="none");try{for(var ae=null;wt<It;){var Z=lt[wt],re=lt[wt+2]||rt,x=bt[Rt+2]||rt,vt=Math.min(re,x),w=lt[wt+1],T;if(w.nodeType!==1&&(T=Se.substring(tt,vt))){Ae&&(T=T.replace(Ge,"\r")),w.nodeValue=T;var L=w.ownerDocument,pe=L.createElement("span");pe.className=bt[Rt+1];var ke=w.parentNode;ke.replaceChild(pe,w),pe.appendChild(w),tt<re&&(lt[wt+1]=w=L.createTextNode(Se.substring(vt,re)),ke.insertBefore(w,pe.nextSibling))}tt=vt,tt>=re&&(wt+=2),tt>=x&&(Rt+=2)}}finally{je&&(je.style.display=qe)}}var Be={};function ce(fe,Ae){for(var Ge=Ae.length;--Ge>=0;){var Se=Ae[Ge];Be.hasOwnProperty(Se)?R.console&&console.warn("cannot override language handler %s",Se):Be[Se]=fe}}function j(fe,Ae){return fe&&Be.hasOwnProperty(fe)||(fe=/^\s*</.test(Ae)?"default-markup":"default-code"),Be[fe]}ce(Ue,["default-code"]),ce(nt([],[[N,/^[^<?]+/],[ye,/^<!\w[^>]*(?:>|$)/],[_e,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[we,/^(?:<[%?]|[%?]>)/],["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"]),ce(nt([[N,/^[\s]+/,null,` \r
|
|
`],[he,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Ee,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[K,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[we,/^[=<>\/]+/],["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"]),ce(nt([],[[he,/^[\s\S]+/]]),["uq.val"]),ce(st({keywords:O,hashComments:!0,cStyleComments:!0,types:ge}),["c","cc","cpp","cxx","cyc","m"]),ce(st({keywords:"null,true,false"}),["json"]),ce(st({keywords:Q,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:ge}),["cs"]),ce(st({keywords:te,cStyleComments:!0}),["java"]),ce(st({keywords:Oe,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ce(st({keywords:ie,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ce(st({keywords:P,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ce(st({keywords:se,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ce(st({keywords:H,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ce(st({keywords:W,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ce(nt([],[[Me,/^[\s\S]+/]]),["regex"]);function et(fe){var Ae=fe.langExtension;try{var Ge=g(fe.sourceNode,fe.pre),Se=Ge.sourceCode;fe.sourceCode=Se,fe.spans=Ge.spans,fe.basePos=0,j(Ae,Se)(fe),Le(fe)}catch(rt){R.console&&console.log(rt&&rt.stack||rt)}}function Ct(fe,Ae,Ge){var Se=Ge||!1,rt=Ae||null,tt=document.createElement("div");tt.innerHTML="<pre>"+fe+"</pre>",tt=tt.firstChild,Se&&He(tt,Se,!0);var lt={langExtension:rt,numberLines:Se,sourceNode:tt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return et(lt),tt.innerHTML}function St(fe,Ae){var Ge=Ae||document.body,Se=Ge.ownerDocument||document;function rt(Z){return Ge.getElementsByTagName(Z)}for(var tt=[rt("pre"),rt("code"),rt("xmp")],lt=[],It=0;It<tt.length;++It)for(var wt=0,bt=tt[It].length;wt<bt;++wt)lt.push(tt[It][wt]);tt=null;var ut=Date;ut.now||(ut={now:function(){return+new Date}});var Rt=0,xt=/\blang(?:uage)?-([\w.]+)(?!\S)/,gt=/\bprettyprint\b/,De=/\bprettyprinted\b/,Dt=/pre|xmp/i,vt=/^code$/i,je=/^(?:pre|code|xmp)$/i,qe={};function ae(){for(var Z=R.PR_SHOULD_USE_CONTINUATION?ut.now()+250:Infinity;Rt<lt.length&&ut.now()<Z;Rt++){for(var re=lt[Rt],x=qe,w=re;w=w.previousSibling;){var T=w.nodeType,L=(T===7||T===8)&&w.nodeValue;if(L?!/^\??prettify\b/.test(L):T!==3||/\S/.test(w.nodeValue))break;if(L){x={},L.replace(/\b(\w+)=([\w:.%+-]+)/g,function(vn,Bt,Wn){x[Bt]=Wn});break}}var pe=re.className;if((x!==qe||gt.test(pe))&&!De.test(pe)){for(var ke=!1,Je=re.parentNode;Je;Je=Je.parentNode){var Mt=Je.tagName;if(je.test(Mt)&&Je.className&>.test(Je.className)){ke=!0;break}}if(!ke){re.className+=" prettyprinted";var Xt=x.lang;if(!Xt){Xt=pe.match(xt);var $e;!Xt&&($e=Te(re))&&vt.test($e.tagName)&&(Xt=$e.className.match(xt)),Xt&&(Xt=Xt[1])}var zt;if(Dt.test(re.tagName))zt=1;else{var Lt=re.currentStyle,ht=Se.defaultView,on=Lt?Lt.whiteSpace:ht&&ht.getComputedStyle?ht.getComputedStyle(re,null).getPropertyValue("white-space"):0;zt=on&&on.substring(0,3)==="pre"}var Zt=x.linenums;(Zt=Zt==="true"||+Zt)||(Zt=pe.match(/\blinenums\b(?::(\d+))?/),Zt=Zt?Zt[1]&&Zt[1].length?+Zt[1]:!0:!1),Zt&&He(re,Zt,zt);var En={langExtension:Xt,sourceNode:re,numberLines:Zt,pre:zt,sourceCode:null,basePos:null,spans:null,decorations:null};et(En)}}}Rt<lt.length?R.setTimeout(ae,250):typeof fe=="function"&&fe()}ae()}var ze=R.PR={createSimpleLexer:nt,registerLangHandler:ce,sourceDecorator:st,PR_ATTRIB_NAME:K,PR_ATTRIB_VALUE:he,PR_COMMENT:_e,PR_DECLARATION:ye,PR_KEYWORD:Ve,PR_LITERAL:Ne,PR_NOCODE:$,PR_PLAIN:N,PR_PUNCTUATION:we,PR_SOURCE:k,PR_STRING:Me,PR_TAG:Ee,PR_TYPE:be,prettyPrintOne:G?R.prettyPrintOne=Ct:ee=Ct,prettyPrint:E=G?R.prettyPrint=St:E=St},pt=R.define;typeof pt=="function"&&pt.amd&&pt("google-code-prettify",[],function(){return ze})})()},TTx2:function(mt,Ze,y){mt.exports=y.p+"static/default-dataset-img.6335ca49.png"},"VrN/":function(mt,Ze,y){(function(S,de){mt.exports=de()})(this,function(){"use strict";var S=navigator.userAgent,de=navigator.platform,G=/gecko\/\d/i.test(S),z=/MSIE \d/.test(S),C=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(S),ee=/Edge\/(\d+)/.exec(S),E=z||C||ee,R=E&&(z?document.documentMode||6:+(ee||C)[1]),B=!ee&&/WebKit\//.test(S),X=B&&/Qt\/\d+\.\d+/.test(S),D=!ee&&/Chrome\//.test(S),O=/Opera\//.test(S),te=/Apple Computer/.test(navigator.vendor),Q=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(S),W=/PhantomJS/.test(S),H=!ee&&/AppleWebKit/.test(S)&&/Mobile\/\w+/.test(S),P=/Android/.test(S),ie=H||P||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(S),se=H||/Mac/.test(de),Oe=/\bCrOS\b/.test(S),Ke=/win/i.test(de),ge=O&&S.match(/Version\/(\d*\.\d*)/);ge&&(ge=Number(ge[1])),ge&&ge>=15&&(O=!1,B=!0);var Me=se&&(X||O&&(ge==null||ge<12.11)),Ve=G||E&&R>=9;function _e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var be=function(e,t){var i=e.className,n=_e(t).exec(i);if(n){var r=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(r?n[1]+r:"")}};function Ne(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function we(e,t){return Ne(e).appendChild(t)}function N(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)r.appendChild(t[s]);return r}function Ee(e,t,i,n){var r=N(e,t,i,n);return r.setAttribute("role","presentation"),r}var ye;document.createRange?ye=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:ye=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(r){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function k(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 K(){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 he(e,t){var i=e.className;_e(t).test(i)||(e.className+=(i?" ":"")+t)}function $(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!_e(i[n]).test(t)&&(t+=" "+i[n]);return t}var Re=function(e){e.select()};H?Re=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:E&&(Re=function(e){try{e.select()}catch(t){}});function M(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function ue(e,t,i,n,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=r||0;;){var d=e.indexOf(" ",s);if(d<0||d>=t)return l+(t-s);l+=d-s,l+=i-l%i,s=d+1}}var Ie=function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)};Ie.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ie.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function Te(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var nt=50,st={toString:function(){return"CodeMirror.Pass"}},Ue={scroll:!1},He={origin:"*mouse"},Le={origin:"+move"};function Be(e,t,i){for(var n=0,r=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||r+l>=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var ce=[""];function j(e){for(;ce.length<=e;)ce.push(et(ce)+" ");return ce[e]}function et(e){return e[e.length-1]}function Ct(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function St(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function ze(){}function pt(e,t){var i;return Object.create?i=Object.create(e):(ze.prototype=e,i=new ze),t&&g(t,i),i}var fe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ae(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||fe.test(e))}function Ge(e,t){return t?t.source.indexOf("\\w")>-1&&Ae(e)?!0:t.test(e):Ae(e)}function Se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var rt=/[\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 tt(e){return e.charCodeAt(0)>=768&&rt.test(e)}function lt(e,t,i){for(;(i<0?t>0:t<e.length)&&tt(e.charAt(t));)t+=i;return t}function It(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var r=(t+i)/2,s=n<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function wt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var bt=null;function ut(e,t,i){var n;bt=null;for(var r=0;r<e.length;++r){var s=e[r];if(s.from<t&&s.to>t)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:bt=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:bt=r)}return n!=null?n:bt}var Rt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,d=/[1n]/;function f(v,U,Y){this.level=v,this.from=U,this.to=Y}return function(v,U){var Y=U=="ltr"?"L":"R";if(v.length==0||U=="ltr"&&!n.test(v))return!1;for(var Ce=v.length,me=[],Fe=0;Fe<Ce;++Fe)me.push(i(v.charCodeAt(Fe)));for(var Ye=0,at=Y;Ye<Ce;++Ye){var dt=me[Ye];dt=="m"?me[Ye]=at:at=dt}for(var yt=0,ft=Y;yt<Ce;++yt){var Et=me[yt];Et=="1"&&ft=="r"?me[yt]="n":s.test(Et)&&(ft=Et,Et=="r"&&(me[yt]="R"))}for(var Vt=1,jt=me[0];Vt<Ce-1;++Vt){var en=me[Vt];en=="+"&&jt=="1"&&me[Vt+1]=="1"?me[Vt]="1":en==","&&jt==me[Vt+1]&&(jt=="1"||jt=="n")&&(me[Vt]=jt),jt=en}for(var In=0;In<Ce;++In){var bi=me[In];if(bi==",")me[In]="N";else if(bi=="%"){var Yn=void 0;for(Yn=In+1;Yn<Ce&&me[Yn]=="%";++Yn);for(var Qi=In&&me[In-1]=="!"||Yn<Ce&&me[Yn]=="1"?"1":"N",Ki=In;Ki<Yn;++Ki)me[Ki]=Qi;In=Yn-1}}for(var ci=0,Xi=Y;ci<Ce;++ci){var Ei=me[ci];Xi=="L"&&Ei=="1"?me[ci]="L":s.test(Ei)&&(Xi=Ei)}for(var yi=0;yi<Ce;++yi)if(r.test(me[yi])){var hi=void 0;for(hi=yi+1;hi<Ce&&r.test(me[hi]);++hi);for(var qn=(yi?me[yi-1]:Y)=="L",$i=(hi<Ce?me[hi]:Y)=="L",Bo=qn==$i?qn?"L":"R":Y,ao=yi;ao<hi;++ao)me[ao]=Bo;yi=hi-1}for(var Ai=[],jr,Ci=0;Ci<Ce;)if(l.test(me[Ci])){var ps=Ci;for(++Ci;Ci<Ce&&l.test(me[Ci]);++Ci);Ai.push(new f(0,ps,Ci))}else{var Vr=Ci,go=Ai.length,vo=U=="rtl"?1:0;for(++Ci;Ci<Ce&&me[Ci]!="L";++Ci);for(var Ui=Vr;Ui<Ci;)if(d.test(me[Ui])){Vr<Ui&&(Ai.splice(go,0,new f(1,Vr,Ui)),go+=vo);var Fo=Ui;for(++Ui;Ui<Ci&&d.test(me[Ui]);++Ui);Ai.splice(go,0,new f(2,Fo,Ui)),go+=vo,Vr=Ui}else++Ui;Vr<Ci&&Ai.splice(go,0,new f(1,Vr,Ci))}return U=="ltr"&&(Ai[0].level==1&&(jr=v.match(/^\s+/))&&(Ai[0].from=jr[0].length,Ai.unshift(new f(0,0,jr[0].length))),et(Ai).level==1&&(jr=v.match(/\s+$/))&&(et(Ai).to-=jr[0].length,Ai.push(new f(0,Ce-jr[0].length,Ce)))),U=="rtl"?Ai.reverse():Ai}}();function xt(e,t){var i=e.order;return i==null&&(i=e.order=Rt(e.text,t)),i}var gt=[],De=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||gt).concat(i)}};function Dt(e,t){return e._handlers&&e._handlers[t]||gt}function vt(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,r=n&&n[t];if(r){var s=Te(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function je(e,t){var i=Dt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r<i.length;++r)i[r].apply(null,n)}function qe(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),je(e,i||t.type,e,t),T(t)||t.codemirrorIgnore}function ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)Te(i,t[n])==-1&&i.push(t[n])}function Z(e,t){return Dt(e,t).length>0}function re(e){e.prototype.on=function(t,i){De(this,t,i)},e.prototype.off=function(t,i){vt(this,t,i)}}function x(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function w(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function T(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function L(e){x(e),w(e)}function pe(e){return e.target||e.srcElement}function ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),se&&e.ctrlKey&&t==1&&(t=3),t}var Je=function(){if(E&&R<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}(),Mt;function Xt(e){if(Mt==null){var t=N("span","\u200B");we(e,N("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Mt=t.offsetWidth<=1&&t.offsetHeight>2&&!(E&&R<8))}var i=Mt?N("span","\u200B"):N("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var $e;function zt(e){if($e!=null)return $e;var t=we(e,document.createTextNode("A\u062EA")),i=ye(t,0,1).getBoundingClientRect(),n=ye(t,1,2).getBoundingClientRect();return Ne(e),!i||i.left==i.right?!1:$e=n.right-i.right<3}var Lt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(`
|
|
`,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ht=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},on=function(){var e=N("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Zt=null;function En(e){if(Zt!=null)return Zt;var t=we(e,N("span","x")),i=t.getBoundingClientRect(),n=ye(t,0,1).getBoundingClientRect();return Zt=Math.abs(i.left-n.left)>1}var vn={},Bt={};function Wn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),vn[e]=t}function Bn(e,t){Bt[e]=t}function Tt(e){if(typeof e=="string"&&Bt.hasOwnProperty(e))e=Bt[e];else if(e&&typeof e.name=="string"&&Bt.hasOwnProperty(e.name)){var t=Bt[e.name];typeof t=="string"&&(t={name:t}),e=pt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function di(e,t){t=Tt(t);var i=vn[t.name];if(!i)return di(e,"text/plain");var n=i(e,t);if(oi.hasOwnProperty(t.name)){var r=oi[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=r[s]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var oi={};function ai(e,t){var i=oi.hasOwnProperty(e)?oi[e]:oi[e]={};g(t,i)}function Si(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i}function or(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Bi(e,t,i){return e.startState?e.startState(t,i):!0}var pn=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};pn.prototype.eol=function(){return this.pos>=this.string.length},pn.prototype.sol=function(){return this.pos==this.lineStart},pn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},pn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},pn.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},pn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},pn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},pn.prototype.skipToEnd=function(){this.pos=this.string.length},pn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},pn.prototype.backUp=function(e){this.pos-=e},pn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ue(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ue(this.string,this.lineStart,this.tabSize):0)},pn.prototype.indentation=function(){return ue(this.string,null,this.tabSize)-(this.lineStart?ue(this.string,this.lineStart,this.tabSize):0)},pn.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(n(r)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},pn.prototype.current=function(){return this.string.slice(this.start,this.pos)},pn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},pn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},pn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function _t(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],s=r.chunkSize();if(t<s){i=r;break}t-=s}return i.lines[t]}function Fi(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;r==i.line&&(l=l.slice(0,i.ch)),r==t.line&&(l=l.slice(t.ch)),n.push(l),++r}),n}function dr(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function ki(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function ln(e){if(e.parent==null)return null;for(var t=e.parent,i=Te(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;!(n.children[r]==t);++r)i+=n.children[r].chunkSize();return i+t.first}function Yi(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue e}t-=s,i+=r.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var d=e.lines[l],f=d.height;if(t<f)break;t-=f}return i+l}function fr(e,t){return t>=e.first&&t<e.first+e.size}function pr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Qe(e,t,i){if(i===void 0&&(i=null),!(this instanceof Qe))return new Qe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ft(e,t){return e.line-t.line||e.ch-t.ch}function Ji(e,t){return e.sticky==t.sticky&&Ft(e,t)==0}function ar(e){return Qe(e.line,e.ch)}function mr(e,t){return Ft(e,t)<0?t:e}function gr(e,t){return Ft(e,t)<0?e:t}function h(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function o(e,t){if(t.line<e.first)return Qe(e.first,0);var i=e.first+e.size-1;return t.line>i?Qe(i,_t(e,i).text.length):a(t,_t(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Qe(e.line,t):i<0?Qe(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var p=function(e,t){this.state=e,this.lookAhead=t},c=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};c.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},c.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}},c.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},c.fromSaved=function(e,t,i){return t instanceof p?new c(e,Si(e.mode,t.state),i,t.lookAhead):new c(e,Si(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?Si(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new p(t,this.maxLookAhead):t};function J(e,t,i,n){var r=[e.state.modeGen],s={};Hi(e,t.text,e.doc.mode,i,function(v,U){return r.push(v,U)},s,n);for(var l=i.state,d=function(v){i.baseTokens=r;var U=e.state.overlays[v],Y=1,Ce=0;i.state=!0,Hi(e,t.text,U.mode,i,function(me,Fe){for(var Ye=Y;Ce<me;){var at=r[Y];at>me&&r.splice(Y,1,me,r[Y+1],at),Y+=2,Ce=Math.min(me,at)}if(!Fe)return;if(U.opaque)r.splice(Ye,Y-Ye,me,"overlay "+Fe),Y=Ye+2;else for(;Ye<Y;Ye+=2){var dt=r[Ye+1];r[Ye+1]=(dt?dt+" ":"")+"overlay "+Fe}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},f=0;f<e.state.overlays.length;++f)d(f);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function We(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=xe(e,ln(t)),r=t.text.length>e.options.maxHighlightLength&&Si(e.doc.mode,n.state),s=J(e,t,n);r&&(n.state=r),t.stateAfter=n.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function xe(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=ei(e,t,i),l=s>n.first&&_t(n,s-1).stateAfter,d=l?c.fromSaved(n,l,s):new c(n,Bi(n.mode),s);return n.iter(s,t,function(f){kt(e,f.text,d);var v=d.line;f.stateAfter=v==t-1||v%5==0||v>=r.viewFrom&&v<r.viewTo?d.save():null,d.nextLine()}),i&&(n.modeFrontier=d.line),d}function kt(e,t,i,n){var r=e.doc.mode,s=new pn(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Xe(r,i.state);!s.eol();)Ht(r,s,i.state),s.start=s.pos}function Xe(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=or(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Ht(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=or(e,i).mode);var s=e.token(t,i);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var hn=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Sn(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var d=_t(r,t.line),f=xe(e,t.line,i),v=new pn(d.text,e.options.tabSize,f),U;for(n&&(U=[]);(n||v.pos<t.ch)&&!v.eol();)v.start=v.pos,l=Ht(s,v,f.state),n&&U.push(new hn(v,l,Si(r.mode,f.state)));return n?U:new hn(v,l,f.state)}function Ri(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Hi(e,t,i,n,r,s,l){var d=i.flattenSpans;d==null&&(d=e.options.flattenSpans);var f=0,v=null,U=new pn(t,e.options.tabSize,n),Y,Ce=e.options.addModeClass&&[null];for(t==""&&Ri(Xe(i,n.state),s);!U.eol();){if(U.pos>e.options.maxHighlightLength?(d=!1,l&&kt(e,t,n,U.pos),U.pos=t.length,Y=null):Y=Ri(Ht(i,U,n.state,Ce),s),Ce){var me=Ce[0].name;me&&(Y="m-"+(Y?me+" "+Y:me))}if(!d||v!=Y){for(;f<U.start;)f=Math.min(U.start,f+5e3),r(f,v);v=Y}U.start=U.pos}for(;f<U.pos;){var Fe=Math.min(U.pos,f+5e3);r(Fe,v),f=Fe}}function ei(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),d=t;d>l;--d){if(d<=s.first)return s.first;var f=_t(s,d-1),v=f.stateAfter;if(v&&(!i||d+(v instanceof p?v.lookAhead:0)<=s.modeFrontier))return d;var U=ue(f.text,null,e.options.tabSize);(r==null||n>U)&&(r=d-1,n=U)}return r}function Zi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var r=_t(e,n).stateAfter;if(r&&(!(r instanceof p)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Gr=!1,xi=!1;function _i(){Gr=!0}function sr(){xi=!0}function vr(e,t,i){this.marker=e,this.from=t,this.to=i}function zi(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function lr(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Wi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function so(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,d=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(d||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new vr(l,s.from,f?null:s.to))}}return n}function Kr(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,d=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(d||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new vr(l,f?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Li(e,t){if(t.full)return null;var i=fr(e,t.from.line)&&_t(e,t.from.line).markedSpans,n=fr(e,t.to.line)&&_t(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=Ft(t.from,t.to)==0,d=so(i,r,l),f=Kr(n,s,l),v=t.text.length==1,U=et(t.text).length+(v?r:0);if(d)for(var Y=0;Y<d.length;++Y){var Ce=d[Y];if(Ce.to==null){var me=zi(f,Ce.marker);me?v&&(Ce.to=me.to==null?null:me.to+U):Ce.to=r}}if(f)for(var Fe=0;Fe<f.length;++Fe){var Ye=f[Fe];if(Ye.to!=null&&(Ye.to+=U),Ye.from==null){var at=zi(d,Ye.marker);at||(Ye.from=U,v&&(d||(d=[])).push(Ye))}else Ye.from+=U,v&&(d||(d=[])).push(Ye)}d&&(d=Jn(d)),f&&f!=d&&(f=Jn(f));var dt=[d];if(!v){var yt=t.text.length-2,ft;if(yt>0&&d)for(var Et=0;Et<d.length;++Et)d[Et].to==null&&(ft||(ft=[])).push(new vr(d[Et].marker,null,null));for(var Vt=0;Vt<yt;++Vt)dt.push(ft);dt.push(f)}return dt}function Jn(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _r(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(me){if(me.markedSpans)for(var Fe=0;Fe<me.markedSpans.length;++Fe){var Ye=me.markedSpans[Fe].marker;Ye.readOnly&&(!n||Te(n,Ye)==-1)&&(n||(n=[])).push(Ye)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],d=l.find(0),f=0;f<r.length;++f){var v=r[f];if(Ft(v.to,d.from)<0||Ft(v.from,d.to)>0)continue;var U=[f,1],Y=Ft(v.from,d.from),Ce=Ft(v.to,d.to);(Y<0||!l.inclusiveLeft&&!Y)&&U.push({from:v.from,to:d.from}),(Ce>0||!l.inclusiveRight&&!Ce)&&U.push({from:d.to,to:v.to}),r.splice.apply(r,U),f+=U.length-3}return r}function Ir(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Xr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Vn(e){return e.inclusiveLeft?-1:0}function bn(e){return e.inclusiveRight?1:0}function $n(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=Ft(n.from,r.from)||Vn(e)-Vn(t);if(s)return-s;var l=Ft(n.to,r.to)||bn(e)-bn(t);return l||t.id-e.id}function yn(e,t){var i=xi&&e.markedSpans,n;if(i)for(var r=void 0,s=0;s<i.length;++s)r=i[s],r.marker.collapsed&&(t?r.from:r.to)==null&&(!n||$n(n,r.marker)<0)&&(n=r.marker);return n}function si(e){return yn(e,!0)}function Rn(e){return yn(e,!1)}function yr(e,t){var i=xi&&e.markedSpans,n;if(i)for(var r=0;r<i.length;++r){var s=i[r];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||$n(n,s.marker)<0)&&(n=s.marker)}return n}function ti(e,t,i,n,r){var s=_t(e,t),l=xi&&s.markedSpans;if(l)for(var d=0;d<l.length;++d){var f=l[d];if(!f.marker.collapsed)continue;var v=f.marker.find(0),U=Ft(v.from,i)||Vn(f.marker)-Vn(r),Y=Ft(v.to,n)||bn(f.marker)-bn(r);if(U>=0&&Y<=0||U<=0&&Y>=0)continue;if(U<=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?Ft(v.to,i)>=0:Ft(v.to,i)>0)||U>=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?Ft(v.from,n)<=0:Ft(v.from,n)<0))return!0}}function Zn(e){for(var t;t=si(e);)e=t.find(-1,!0).line;return e}function ur(e){for(var t;t=Rn(e);)e=t.find(1,!0).line;return e}function Or(e){for(var t,i;t=Rn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function qi(e,t){var i=_t(e,t),n=Zn(i);return i==n?t:ln(n)}function br(e,t){if(t>e.lastLine())return t;var i=_t(e,t),n;if(!Di(e,i))return t;for(;n=Rn(i);)i=n.find(1,!0).line;return ln(i)+1}function Di(e,t){var i=xi&&t.markedSpans;if(i)for(var n=void 0,r=0;r<i.length;++r){if(n=i[r],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&$r(e,t,n))return!0}}function $r(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return $r(e,n.line,zi(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var r=void 0,s=0;s<t.markedSpans.length;++s)if(r=t.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&$r(e,t,r))return!0}function Oi(e){e=Zn(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var r=i.lines[n];if(r==e)break;t+=r.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var d=s.children[l];if(d==i)break;t+=d.height}return t}function Yr(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=si(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Rn(n);){var s=i.find(0,!0);t-=n.text.length-s.from.ch,n=s.to.line,t+=n.text.length-s.to.ch}return t}function cr(e){var t=e.display,i=e.doc;t.maxLine=_t(i,i.first),t.maxLineLength=Yr(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Yr(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Mr=function(e,t,i){this.text=e,Xr(this,t),this.height=i?i(this):1};Mr.prototype.lineNo=function(){return ln(this)},re(Mr);function Ho(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ir(e),Xr(e,i);var r=n?n(e):1;r!=e.height&&ki(e,r)}function yo(e){e.parent=null,Ir(e)}var ya={},bo={};function zo(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?bo:ya;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Co(e,t){var i=Ee("span",null,null,B?"padding-right: .1px":null),n={pre:Ee("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,l=void 0;n.pos=0,n.addToken=Gt,zt(e.display.measure)&&(l=xt(s,e.doc.direction))&&(n.addToken=an(n.addToken,l)),n.map=[];var d=t!=e.display.externalMeasured&&ln(s);kn(s,n,We(e,s,d)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=$(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=$(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Xt(e.display.measure))),r==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(B){var f=n.content.lastChild;(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=$(n.pre.className,n.textClass||"")),n}function Ot(e){var t=N("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Gt(e,t,i,n,r,s,l){if(!t)return;var d=e.splitSpaces?Pt(t,e.trailingSpace):t,f=e.cm.state.specialChars,v=!1,U;if(!f.test(t))e.col+=t.length,U=document.createTextNode(d),e.map.push(e.pos,e.pos+t.length,U),E&&R<9&&(v=!0),e.pos+=t.length;else{U=document.createDocumentFragment();for(var Y=0;;){f.lastIndex=Y;var Ce=f.exec(t),me=Ce?Ce.index-Y:t.length-Y;if(me){var Fe=document.createTextNode(d.slice(Y,Y+me));E&&R<9?U.appendChild(N("span",[Fe])):U.appendChild(Fe),e.map.push(e.pos,e.pos+me,Fe),e.col+=me,e.pos+=me}if(!Ce)break;Y+=me+1;var Ye=void 0;if(Ce[0]==" "){var at=e.cm.options.tabSize,dt=at-e.col%at;Ye=U.appendChild(N("span",j(dt),"cm-tab")),Ye.setAttribute("role","presentation"),Ye.setAttribute("cm-text"," "),e.col+=dt}else Ce[0]=="\r"||Ce[0]==`
|
|
`?(Ye=U.appendChild(N("span",Ce[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ye.setAttribute("cm-text",Ce[0]),e.col+=1):(Ye=e.cm.options.specialCharPlaceholder(Ce[0]),Ye.setAttribute("cm-text",Ce[0]),E&&R<9?U.appendChild(N("span",[Ye])):U.appendChild(Ye),e.col+=1);e.map.push(e.pos,e.pos+1,Ye),e.pos++}}if(e.trailingSpace=d.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var yt=i||"";n&&(yt+=n),r&&(yt+=r);var ft=N("span",[U],yt,s);if(l)for(var Et in l)l.hasOwnProperty(Et)&&Et!="style"&&Et!="class"&&ft.setAttribute(Et,l[Et]);return e.content.appendChild(ft)}e.content.appendChild(U)}function Pt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&i&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function an(e,t){return function(i,n,r,s,l,d,f){r=r?r+" cm-force-border":"cm-force-border";for(var v=i.pos,U=v+n.length;;){for(var Y=void 0,Ce=0;Ce<t.length&&!(Y=t[Ce],Y.to>v&&Y.from<=v);Ce++);if(Y.to>=U)return e(i,n,r,s,l,d,f);e(i,n.slice(0,Y.to-v),r,s,null,d,f),s=null,n=n.slice(Y.to-v),v=Y.to}}}function mn(e,t,i,n){var r=!n&&i.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!n&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",i.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function kn(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,r.slice(s,s=i[l]),zo(i[l+1],t.cm.options));return}for(var d=r.length,f=0,v=1,U="",Y,Ce,me=0,Fe,Ye,at,dt,yt;;){if(me==f){Fe=Ye=at=Ce="",yt=null,dt=null,me=Infinity;for(var ft=[],Et=void 0,Vt=0;Vt<n.length;++Vt){var jt=n[Vt],en=jt.marker;if(en.type=="bookmark"&&jt.from==f&&en.widgetNode)ft.push(en);else if(jt.from<=f&&(jt.to==null||jt.to>f||en.collapsed&&jt.to==f&&jt.from==f)){if(jt.to!=null&&jt.to!=f&&me>jt.to&&(me=jt.to,Ye=""),en.className&&(Fe+=" "+en.className),en.css&&(Ce=(Ce?Ce+";":"")+en.css),en.startStyle&&jt.from==f&&(at+=" "+en.startStyle),en.endStyle&&jt.to==me&&(Et||(Et=[])).push(en.endStyle,jt.to),en.title&&((yt||(yt={})).title=en.title),en.attributes)for(var In in en.attributes)(yt||(yt={}))[In]=en.attributes[In];en.collapsed&&(!dt||$n(dt.marker,en)<0)&&(dt=jt)}else jt.from>f&&me>jt.from&&(me=jt.from)}if(Et)for(var bi=0;bi<Et.length;bi+=2)Et[bi+1]==me&&(Ye+=" "+Et[bi]);if(!dt||dt.from==f)for(var Yn=0;Yn<ft.length;++Yn)mn(t,0,ft[Yn]);if(dt&&(dt.from||0)==f){if(mn(t,(dt.to==null?d+1:dt.to)-f,dt.marker,dt.from==null),dt.to==null)return;dt.to==f&&(dt=!1)}}if(f>=d)break;for(var Qi=Math.min(d,me);;){if(U){var Ki=f+U.length;if(!dt){var ci=Ki>Qi?U.slice(0,Qi-f):U;t.addToken(t,ci,Y?Y+Fe:Fe,at,f+ci.length==me?Ye:"",Ce,yt)}if(Ki>=Qi){U=U.slice(Qi-f),f=Qi;break}f=Ki,at=""}U=r.slice(s,s=i[v++]),Y=zo(i[v++],t.cm.options)}}}function un(e,t,i){this.line=t,this.rest=Or(t),this.size=this.rest?ln(et(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Di(e,t)}function Un(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new un(e.doc,_t(e.doc,s),s);r=s+l.size,n.push(l)}return n}var li=null;function tn(e){li?li.ops.push(e):e.ownsGroup=li={ops:[e],delayedCallbacks:[]}}function Cr(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var r=e.ops[n];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(i<t.length)}function On(e,t){var i=e.ownsGroup;if(!i)return;try{Cr(i)}finally{li=null,t(i)}}var ui=null;function xn(e,t){var i=Dt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;li?r=li.delayedCallbacks:ui?r=ui:(r=ui=[],setTimeout(Vi,0));for(var s=function(d){r.push(function(){return i[d].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Vi(){var e=ui;ui=null;for(var t=0;t<e.length;++t)e[t]()}function lo(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?ba(e,t):s=="gutter"?Go(e,t,i,n):s=="class"?Vo(e,t):s=="widget"&&Ga(e,t,n)}t.changes=null}function uo(e){return e.node==e.text&&(e.node=N("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),E&&R<8&&(e.node.style.zIndex=2)),e.node}function Va(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=uo(t);t.background=n.insertBefore(N("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Wo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Co(e,t)}function ba(e,t){var i=t.text.className,n=Wo(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,Vo(e,t)):i&&(t.text.className=i)}function Vo(e,t){Va(e,t),t.line.wrapClass?uo(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Go(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=uo(t);t.gutterBackground=N("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),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=uo(t),d=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(d),l.insertBefore(d,t.text),t.line.gutterClass&&(d.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=d.appendChild(N("div",pr(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var f=0;f<e.display.gutterSpecs.length;++f){var v=e.display.gutterSpecs[f].className,U=s.hasOwnProperty(v)&&s[v];U&&d.appendChild(N("div",[U],"CodeMirror-gutter-elt","left: "+n.gutterLeft[v]+"px; width: "+n.gutterWidth[v]+"px"))}}}function Ga(e,t,i){t.alignable&&(t.alignable=null);for(var n=_e("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);Ko(e,t,i)}function Ca(e,t,i,n){var r=Wo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),Vo(e,t),Go(e,t,i,n),Ko(e,t,n),t.node}function Ko(e,t,i){if(xa(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)xa(e,t.rest[n],t,i,!1)}function xa(e,t,i,n,r){if(!t.widgets)return;for(var s=uo(i),l=0,d=t.widgets;l<d.length;++l){var f=d[l],v=N("div",[f.node],"CodeMirror-linewidget"+(f.className?" "+f.className:""));f.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),Ka(f,v,i,n),e.display.input.setUneditable(v),r&&f.above?s.insertBefore(v,i.gutter||i.text):s.appendChild(v),xn(f,"redraw")}}function Ka(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Jr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!k(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),we(t.display.measure,N("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function xr(e,t){for(var i=pe(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Xo(e){return e.lineSpace.offsetTop}function A(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function q(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=we(e.measure,N("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function oe(e){return nt-e.display.nativeBarWidth}function I(e){return e.display.scroller.clientWidth-oe(e)-e.display.barWidth}function m(e){return e.display.scroller.clientHeight-oe(e)-e.display.barHeight}function _(e,t,i){var n=e.options.lineWrapping,r=n&&I(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),d=0;d<l.length-1;d++){var f=l[d],v=l[d+1];Math.abs(f.bottom-v.bottom)>2&&s.push((f.bottom+v.top)/2-i.top)}}s.push(i.bottom-i.top)}}function b(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var r=0;r<e.rest.length;r++)if(ln(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function F(e,t){t=Zn(t);var i=ln(t),n=e.display.externalMeasured=new un(e.doc,t,i);n.lineN=i;var r=n.built=Co(e,n);return n.text=r.pre,we(e.display.lineMeasure,r.pre),n}function V(e,t,i,n){return ve(e,ne(e,t),i,n)}function le(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[jn(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function ne(e,t){var i=ln(t),n=le(e,i);n&&!n.text?n=null:n&&n.changes&&(lo(e,n,i,Gn(e)),e.curOp.forceUpdate=!0),n||(n=F(e,t));var r=b(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ve(e,t,i,n,r){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(_(e,t.view,t.rect),t.hasHeights=!0),l=ct(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var Pe={left:0,right:0,top:0,bottom:0};function ot(e,t,i){for(var n,r,s,l,d,f,v=0;v<e.length;v+=3)if(d=e[v],f=e[v+1],t<d?(r=0,s=1,l="left"):t<f?(r=t-d,s=r+1):(v==e.length-3||t==f&&e[v+3]>t)&&(s=f-d,r=s-1,t>=f&&(l="right")),r!=null){if(n=e[v+2],d==f&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)n=e[(v-=3)+2],l="left";if(i=="right"&&r==f-d)for(;v<e.length-3&&e[v+3]==e[v+4]&&!e[v+5].insertLeft;)n=e[(v+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:d,coverEnd:f}}function it(e,t){var i=Pe;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=0&&!((i=e[r]).left!=i.right);r--);return i}function ct(e,t,i,n){var r=ot(t.map,i,n),s=r.node,l=r.start,d=r.end,f=r.collapse,v;if(s.nodeType==3){for(var U=0;U<4;U++){for(;l&&tt(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+d<r.coverEnd&&tt(t.line.text.charAt(r.coverStart+d));)++d;if(E&&R<9&&l==0&&d==r.coverEnd-r.coverStart?v=s.parentNode.getBoundingClientRect():v=it(ye(s,l,d).getClientRects(),n),v.left||v.right||l==0)break;d=l,l=l-1,f="right"}E&&R<11&&(v=Wt(e.display.measure,v))}else{l>0&&(f=n="right");var Y;e.options.lineWrapping&&(Y=s.getClientRects()).length>1?v=Y[n=="right"?Y.length-1:0]:v=s.getBoundingClientRect()}if(E&&R<9&&!l&&(!v||!v.left&&!v.right)){var Ce=s.parentNode.getClientRects()[0];Ce?v={left:Ce.left,right:Ce.left+fi(e.display),top:Ce.top,bottom:Ce.bottom}:v=Pe}for(var me=v.top-t.rect.top,Fe=v.bottom-t.rect.top,Ye=(me+Fe)/2,at=t.view.measure.heights,dt=0;dt<at.length-1&&!(Ye<at[dt]);dt++);var yt=dt?at[dt-1]:0,ft=at[dt],Et={left:(f=="right"?v.right:v.left)-t.rect.left,right:(f=="left"?v.left:v.right)-t.rect.left,top:yt,bottom:ft};return!v.left&&!v.right&&(Et.bogus=!0),e.options.singleCursorHeightPerLine||(Et.rtop=me,Et.rbottom=Fe),Et}function Wt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!En(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function Qt(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 Kt(e){e.display.externalMeasure=null,Ne(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Qt(e.display.view[t])}function $t(e){Kt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function qt(){return D&&P?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Jt(){return D&&P?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Yt(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=Jr(e.widgets[i]));return t}function dn(e,t,i,n,r){if(!r){var s=Yt(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=Oi(t);if(n=="local"?l+=Xo(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var d=e.display.lineSpace.getBoundingClientRect();l+=d.top+(n=="window"?0:Jt());var f=d.left+(n=="window"?0:qt());i.left+=f,i.right+=f}return i.top+=l,i.bottom+=l,i}function nn(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=qt(),r-=Jt();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:r-l.top}}function Fn(e,t,i,n,r){return n||(n=_t(e.doc,t.line)),dn(e,n,V(e,n,t.ch,r),i)}function rn(e,t,i,n,r,s){n=n||_t(e.doc,t.line),r||(r=ne(e,n));function l(Fe,Ye){var at=ve(e,r,Fe,Ye?"right":"left",s);return Ye?at.left=at.right:at.right=at.left,dn(e,n,at,i)}var d=xt(n,e.doc.direction),f=t.ch,v=t.sticky;if(f>=n.text.length?(f=n.text.length,v="before"):f<=0&&(f=0,v="after"),!d)return l(v=="before"?f-1:f,v=="before");function U(Fe,Ye,at){var dt=d[Ye],yt=dt.level==1;return l(at?Fe-1:Fe,yt!=at)}var Y=ut(d,f,v),Ce=bt,me=U(f,Y,v=="before");return Ce!=null&&(me.other=U(f,Ce,v!="before")),me}function Ut(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=fi(e.display)*t.ch);var n=_t(e.doc,t.line),r=Oi(n)+Xo(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function Nt(e,t,i,n,r){var s=Qe(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function sn(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return Nt(n.first,0,null,-1,-1);var r=Yi(n,i),s=n.first+n.size-1;if(r>s)return Nt(n.first+n.size-1,_t(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=_t(n,r);;){var d=Hn(e,l,r,t,i),f=yr(l,d.ch+(d.xRel>0||d.outside>0?1:0));if(!f)return d;var v=f.find(1);if(v.line==r)return v;l=_t(n,r=v.line)}}function fn(e,t,i,n){n-=Yt(t);var r=t.text.length,s=It(function(l){return ve(e,i,l-1).bottom<=n},r,0);return r=It(function(l){return ve(e,i,l).top>n},s,r),{begin:s,end:r}}function At(e,t,i,n){i||(i=ne(e,t));var r=dn(e,t,ve(e,i,n),"line").top;return fn(e,t,i,r)}function gn(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Hn(e,t,i,n,r){r-=Oi(t);var s=ne(e,t),l=Yt(t),d=0,f=t.text.length,v=!0,U=xt(t,e.doc.direction);if(U){var Y=(e.options.lineWrapping?Ln:Cn)(e,t,i,s,U,n,r);v=Y.level!=1,d=v?Y.from:Y.to-1,f=v?Y.to:Y.from-1}var Ce=null,me=null,Fe=It(function(Vt){var jt=ve(e,s,Vt);return jt.top+=l,jt.bottom+=l,gn(jt,n,r,!1)?(jt.top<=r&&jt.left<=n&&(Ce=Vt,me=jt),!0):!1},d,f),Ye,at,dt=!1;if(me){var yt=n-me.left<me.right-n,ft=yt==v;Fe=Ce+(ft?0:1),at=ft?"after":"before",Ye=yt?me.left:me.right}else{!v&&(Fe==f||Fe==d)&&Fe++,at=Fe==0?"after":Fe==t.text.length?"before":ve(e,s,Fe-(v?1:0)).bottom+l<=r==v?"after":"before";var Et=rn(e,Qe(i,Fe,at),"line",t,s);Ye=Et.left,dt=r<Et.top?-1:r>=Et.bottom?1:0}return Fe=lt(t.text,Fe,1),Nt(i,Fe,at,dt,n-Ye)}function Cn(e,t,i,n,r,s,l){var d=It(function(Y){var Ce=r[Y],me=Ce.level!=1;return gn(rn(e,Qe(i,me?Ce.to:Ce.from,me?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),f=r[d];if(d>0){var v=f.level!=1,U=rn(e,Qe(i,v?f.from:f.to,v?"after":"before"),"line",t,n);gn(U,s,l,!0)&&U.top>l&&(f=r[d-1])}return f}function Ln(e,t,i,n,r,s,l){var d=fn(e,t,n,l),f=d.begin,v=d.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var U=null,Y=null,Ce=0;Ce<r.length;Ce++){var me=r[Ce];if(me.from>=v||me.to<=f)continue;var Fe=me.level!=1,Ye=ve(e,n,Fe?Math.min(v,me.to)-1:Math.max(f,me.from)).right,at=Ye<s?s-Ye+1e9:Ye-s;(!U||Y>at)&&(U=me,Y=at)}return U||(U=r[r.length-1]),U.from<f&&(U={from:f,to:U.to,level:U.level}),U.to>v&&(U={from:U.from,to:v,level:U.level}),U}var Tn;function Qn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Tn==null){Tn=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Tn.appendChild(document.createTextNode("x")),Tn.appendChild(N("br"));Tn.appendChild(document.createTextNode("x"))}we(e.measure,Tn);var i=Tn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Ne(e.measure),i||1}function fi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),i=N("pre",[t],"CodeMirror-line-like");we(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Gn(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var d=e.display.gutterSpecs[l].className;i[d]=s.offsetLeft+s.clientLeft+r,n[d]=s.clientWidth}return{fixedPos:Mi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Mi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function er(e){var t=Qn(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/fi(e.display)-3);return function(r){if(Di(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l<r.widgets.length;l++)r.widgets[l].height&&(s+=r.widgets[l].height);return i?s+(Math.ceil(r.text.length/n)||1)*t:s+t}}function Pi(e){var t=e.doc,i=er(e);t.iter(function(n){var r=i(n);r!=n.height&&ki(n,r)})}function pi(e,t,i,n){var r=e.display;if(!i&&pe(t).getAttribute("cm-not-content")=="true")return null;var s,l,d=r.lineSpace.getBoundingClientRect();try{s=t.clientX-d.left,l=t.clientY-d.top}catch(Y){return null}var f=sn(e,s,l),v;if(n&&f.xRel>0&&(v=_t(e.doc,f.line).text).length==f.ch){var U=ue(v,v.length,e.options.tabSize)-v.length;f=Qe(f.line,Math.max(0,Math.round((s-q(e.display).left)/fi(e.display))-U))}return f}function jn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Dn(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var r=e.display;if(n&&i<r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)xi&&qi(e.doc,t)<r.viewTo&&zn(e);else if(i<=r.viewFrom)xi&&br(e.doc,i+n)>r.viewFrom?zn(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)zn(e);else if(t<=r.viewFrom){var s=tr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):zn(e)}else if(i>=r.viewTo){var l=tr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):zn(e)}else{var d=tr(e,t,t,-1),f=tr(e,i,i+n,1);d&&f?(r.view=r.view.slice(0,d.index).concat(Un(e,d.lineN,f.lineN)).concat(r.view.slice(f.index)),r.viewTo+=n):zn(e)}var v=r.externalMeasured;v&&(i<v.lineN?v.lineN+=n:t<v.lineN+v.size&&(r.externalMeasured=null))}function Kn(e,t,i){e.curOp.viewChanged=!0;var n=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[jn(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);Te(l,i)==-1&&l.push(i)}function zn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function tr(e,t,i,n){var r=jn(e,t),s,l=e.display.view;if(!xi||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var d=e.display.viewFrom,f=0;f<r;f++)d+=l[f].size;if(d!=t){if(n>0){if(r==l.length-1)return null;s=d+l[r].size-t,r++}else s=d-t;t+=s,i+=s}for(;qi(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Tr(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Un(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Un(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(jn(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Un(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,jn(e,i)))),n.viewTo=i}function Ar(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];!r.hidden&&(!r.node||r.changes)&&++i}return i}function An(e){e.display.input.showSelection(e.display.input.prepareSelection())}function hr(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var d=i.sel.ranges[l];if(d.from().line>=e.display.viewTo||d.to().line<e.display.viewFrom)continue;var f=d.empty();(f||e.options.showCursorWhenSelecting)&&Rr(e,d.head,r),f||Mn(e,d,s)}return n}function Rr(e,t,i){var n=rn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(N("div","\xA0","CodeMirror-cursor"));if(r.style.left=n.left+"px",r.style.top=n.top+"px",r.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(N("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Nn(e,t){return e.top-t.top||e.left-t.left}function Mn(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=q(e.display),d=l.left,f=Math.max(n.sizerWidth,I(e)-n.sizer.offsetLeft)-l.right,v=r.direction=="ltr";function U(ft,Et,Vt,jt){Et<0&&(Et=0),Et=Math.round(Et),jt=Math.round(jt),s.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+ft+`px;
|
|
top: `+Et+"px; width: "+(Vt==null?f-ft:Vt)+`px;
|
|
height: `+(jt-Et)+"px"))}function Y(ft,Et,Vt){var jt=_t(r,ft),en=jt.text.length,In,bi;function Yn(ci,Xi){return Fn(e,Qe(ft,ci),"div",jt,Xi)}function Qi(ci,Xi,Ei){var yi=At(e,jt,null,ci),hi=Xi=="ltr"==(Ei=="after")?"left":"right",qn=Ei=="after"?yi.begin:yi.end-(/\s/.test(jt.text.charAt(yi.end-1))?2:1);return Yn(qn,hi)[hi]}var Ki=xt(jt,r.direction);return wt(Ki,Et||0,Vt==null?en:Vt,function(ci,Xi,Ei,yi){var hi=Ei=="ltr",qn=Yn(ci,hi?"left":"right"),$i=Yn(Xi-1,hi?"right":"left"),Bo=Et==null&&ci==0,ao=Vt==null&&Xi==en,Ai=yi==0,jr=!Ki||yi==Ki.length-1;if($i.top-qn.top<=3){var Ci=(v?Bo:ao)&&Ai,ps=(v?ao:Bo)&&jr,Vr=Ci?d:(hi?qn:$i).left,go=ps?f:(hi?$i:qn).right;U(Vr,qn.top,go-Vr,qn.bottom)}else{var vo,Ui,Fo,ms;hi?(vo=v&&Bo&&Ai?d:qn.left,Ui=v?f:Qi(ci,Ei,"before"),Fo=v?d:Qi(Xi,Ei,"after"),ms=v&&ao&&jr?f:$i.right):(vo=v?Qi(ci,Ei,"before"):d,Ui=!v&&Bo&&Ai?f:qn.right,Fo=!v&&ao&&jr?d:$i.left,ms=v?Qi(Xi,Ei,"after"):f),U(vo,qn.top,Ui-vo,qn.bottom),qn.bottom<$i.top&&U(d,qn.bottom,null,$i.top),U(Fo,$i.top,ms-Fo,$i.bottom)}(!In||Nn(qn,In)<0)&&(In=qn),Nn($i,In)<0&&(In=$i),(!bi||Nn(qn,bi)<0)&&(bi=qn),Nn($i,bi)<0&&(bi=$i)}),{start:In,end:bi}}var Ce=t.from(),me=t.to();if(Ce.line==me.line)Y(Ce.line,Ce.ch,me.ch);else{var Fe=_t(r,Ce.line),Ye=_t(r,me.line),at=Zn(Fe)==Zn(Ye),dt=Y(Ce.line,Ce.ch,at?Fe.text.length+1:null).end,yt=Y(me.line,at?0:null,me.ch).start;at&&(dt.top<yt.top-2?(U(dt.right,dt.top,null,dt.bottom),U(d,yt.top,yt.left,yt.bottom)):U(dt.right,dt.top,yt.left-dt.right,dt.bottom)),dt.bottom<yt.top&&U(d,dt.bottom,null,yt.top)}i.appendChild(s)}function mi(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Zr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function wa(e){e.state.focused||(e.display.input.focus(),Lr(e))}function $o(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zr(e))},100)}function Lr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(je(e,"focus",e,t),e.state.focused=!0,he(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),B&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),mi(e)}function Zr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,be(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function xo(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var r=t.view[n],s=e.options.lineWrapping,l=void 0,d=0;if(r.hidden)continue;if(E&&R<8){var f=r.node.offsetTop+r.node.offsetHeight;l=f-i,i=f}else{var v=r.node.getBoundingClientRect();l=v.bottom-v.top,!s&&r.text.firstChild&&(d=r.text.firstChild.getBoundingClientRect().right-v.left-1)}var U=r.line.height-l;if((U>.005||U<-.005)&&(ki(r.line,l),Yo(r.line),r.rest))for(var Y=0;Y<r.rest.length;Y++)Yo(r.rest[Y]);if(d>e.display.sizerWidth){var Ce=Math.ceil(d/fi(e.display));Ce>e.display.maxLineLength&&(e.display.maxLineLength=Ce,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Yo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function wo(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Xo(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Yi(t,n),l=Yi(t,r);if(i&&i.ensure){var d=i.ensure.from.line,f=i.ensure.to.line;d<s?(s=d,l=Yi(t,Oi(_t(t,d))+e.wrapper.clientHeight)):Math.min(f,t.lastLine())>=l&&(s=Yi(t,Oi(_t(t,f))-e.wrapper.clientHeight),l=f)}return{from:s,to:Math.max(l,s+1)}}function Xa(e,t){if(qe(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),r=null;if(t.top+n.top<0?r=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!W){var s=N("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Xo(e.display))+`px;
|
|
height: `+(t.bottom-t.top+oe(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function $a(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?Qe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Qe(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,d=rn(e,t),f=!i||i==t?d:rn(e,i);r={left:Math.min(d.left,f.left),top:Math.min(d.top,f.top)-n,right:Math.max(d.left,f.left),bottom:Math.max(d.bottom,f.bottom)+n};var v=Jo(e,r),U=e.doc.scrollTop,Y=e.doc.scrollLeft;if(v.scrollTop!=null&&(eo(e,v.scrollTop),Math.abs(e.doc.scrollTop-U)>1&&(l=!0)),v.scrollLeft!=null&&(nr(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-Y)>1&&(l=!0)),!l)break}return r}function Ea(e,t){var i=Jo(e,t);i.scrollTop!=null&&eo(e,i.scrollTop),i.scrollLeft!=null&&nr(e,i.scrollLeft)}function Jo(e,t){var i=e.display,n=Qn(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=m(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var d=e.doc.height+A(i),f=t.top<n,v=t.bottom>d-n;if(t.top<r)l.scrollTop=f?0:t.top;else if(t.bottom>r+s){var U=Math.min(t.top,(v?d:t.bottom)-s);U!=r&&(l.scrollTop=U)}var Y=e.options.fixedGutter?0:i.gutters.offsetWidth,Ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Y,me=I(e)-i.gutters.offsetWidth,Fe=t.right-t.left>me;return Fe&&(t.right=t.left+me),t.left<10?l.scrollLeft=0:t.left<Ce?l.scrollLeft=Math.max(0,t.left+Y-(Fe?0:10)):t.right>me+Ce-3&&(l.scrollLeft=t.right+(Fe?0:10)-me),l}function Zo(e,t){if(t==null)return;Eo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qr(e){Eo(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function qr(e,t,i){(t!=null||i!=null)&&Eo(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Ya(e,t){Eo(e),e.curOp.scrollToPos=t}function Eo(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Ut(e,t.from),n=Ut(e,t.to);co(e,i,n,t.margin)}}function co(e,t,i,n){var r=Jo(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});qr(e,r.scrollLeft,r.scrollTop)}function eo(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;G||po(e,{top:t}),to(e,t,!0),G&&po(e),fo(e,100)}function to(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function nr(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,cn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Ur(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+A(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+oe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Dr=function(e,t,i){this.cm=i;var n=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),De(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),De(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,E&&R<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var r=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Dr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dr.prototype.zeroWidthHack=function(){var e=se&&!Q?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ie,this.disableVert=new Ie},Dr.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var r=e.getBoundingClientRect(),s=i=="vert"?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Dr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ho=function(){};ho.prototype.update=function(){return{bottom:0,right:0}},ho.prototype.setScrollLeft=function(){},ho.prototype.setScrollTop=function(){},ho.prototype.clear=function(){};function Br(e,t){t||(t=Ur(e));var i=e.display.barWidth,n=e.display.barHeight;So(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&xo(e),So(e,Ur(e)),i=e.display.barWidth,n=e.display.barHeight}function So(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Qo={native:Dr,null:ho};function ko(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&be(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Qo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),De(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?nr(e,t):eo(e,t)},e),e.display.scrollbars.addClass&&he(e.display.wrapper,e.display.scrollbars.addClass)}var qo=0;function Pr(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:++qo},tn(e.curOp)}function Fr(e){var t=e.curOp;t&&On(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;Sa(i)})}function Sa(e){for(var t=e.ops,i=0;i<t.length;i++)Ja(t[i]);for(var n=0;n<t.length;n++)Za(t[n]);for(var r=0;r<t.length;r++)Qa(t[r]);for(var s=0;s<t.length;s++)ea(t[s]);for(var l=0;l<t.length;l++)qa(t[l])}function Ja(e){var t=e.cm,i=t.display;ka(t),e.updateMaxLine&&cr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ir(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Za(e){e.updatedDisplay=e.mustUpdate&&Hr(e.cm,e.update)}function Qa(e){var t=e.cm,i=t.display;e.updatedDisplay&&xo(t),e.barMeasure=Ur(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=V(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+oe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-I(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function ea(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&nr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==K();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Br(t,e.barMeasure),e.updatedDisplay&&_n(t,e.barMeasure),e.selectionChanged&&mi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&wa(e.cm)}function qa(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&_o(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&to(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&nr(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$a(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);Xa(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var d=0;d<s.length;++d)s[d].lines.length||je(s[d],"hide");if(l)for(var f=0;f<l.length;++f)l[f].lines.length&&je(l[f],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&je(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ni(e,t){if(e.curOp)return t();Pr(e);try{return t()}finally{Fr(e)}}function ni(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Pr(e);try{return t.apply(e,arguments)}finally{Fr(e)}}}function wi(e){return function(){if(this.curOp)return e.apply(this,arguments);Pr(this);try{return e.apply(this,arguments)}finally{Fr(this)}}}function ii(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Pr(t);try{return e.apply(this,arguments)}finally{Fr(t)}}}function fo(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,M(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=xe(e,t.highlightFrontier),r=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,d=s.text.length>e.options.maxHighlightLength?Si(t.mode,n.state):null,f=J(e,s,n,!0);d&&(n.state=d),s.styles=f.styles;var v=s.styleClasses,U=f.classes;U?s.styleClasses=U:v&&(s.styleClasses=null);for(var Y=!l||l.length!=s.styles.length||v!=U&&(!v||!U||v.bgClass!=U.bgClass||v.textClass!=U.textClass),Ce=0;!Y&&Ce<l.length;++Ce)Y=l[Ce]!=s.styles[Ce];Y&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&kt(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return fo(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&Ni(e,function(){for(var s=0;s<r.length;s++)Kn(e,r[s],"text")})}var ir=function(e,t,i){var n=e.display;this.viewport=t,this.visible=wo(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=I(e),this.force=i,this.dims=Gn(e),this.events=[]};ir.prototype.signal=function(e,t){Z(e,t)&&this.events.push(arguments)},ir.prototype.finish=function(){for(var e=0;e<this.events.length;e++)je.apply(null,this.events[e])};function ka(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=oe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=oe(e)+"px",t.scrollbarsClipped=!0)}function _a(e){if(e.hasFocus())return null;var t=K();if(!t||!k(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&k(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function Oa(e){if(!e||!e.activeElt||e.activeElt==K())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&k(document.body,e.anchorNode)&&k(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Hr(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return zn(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Ar(e)==0)return!1;gi(e)&&(zn(e),t.dims=Gn(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),xi&&(s=qi(e.doc,s),l=br(e.doc,l));var d=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Tr(e,s,l),i.viewOffset=Oi(_t(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var f=Ar(e);if(!d&&f==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=_a(e);return f>4&&(i.lineDiv.style.display="none"),Ma(e,i.updateLineNumbers,t.dims),f>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Oa(v),Ne(i.cursorDiv),Ne(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,d&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,fo(e,400)),i.updateLineNumbers=null,!0}function _o(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==I(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+A(e.display)-m(e),i.top)}),t.visible=wo(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=wo(e.display,e.doc,i));if(!Hr(e,t))break;xo(e);var r=Ur(e);An(e),Br(e,r),_n(e,r),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 po(e,t){var i=new ir(e,t);if(Hr(e,i)){xo(e),_o(e,i);var n=Ur(e);An(e),Br(e,n),_n(e,n),i.finish()}}function Ma(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function d(Fe){var Ye=Fe.nextSibling;return B&&se&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),Ye}for(var f=n.view,v=n.viewFrom,U=0;U<f.length;U++){var Y=f[U];if(!Y.hidden)if(!Y.node||Y.node.parentNode!=s){var Ce=Ca(e,Y,v,i);s.insertBefore(Ce,l)}else{for(;l!=Y.node;)l=d(l);var me=r&&t!=null&&t<=v&&Y.lineNumber;Y.changes&&(Te(Y.changes,"gutter")>-1&&(me=!1),lo(e,Y,v,i)),me&&(Ne(Y.lineNumber),Y.lineNumber.appendChild(document.createTextNode(pr(e.options,v)))),l=Y.node.nextSibling}v+=Y.size}for(;l;)l=d(l)}function Oo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function _n(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+oe(e)+"px"}function cn(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Mi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var d=i[l].alignable;if(d)for(var f=0;f<d.length;f++)d[f].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function gi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=pr(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(N("div",[N("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Oo(e.display),!0}return!1}function ji(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function no(e){var t=e.gutters,i=e.gutterSpecs;Ne(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,d=t.appendChild(N("div",null,"CodeMirror-gutter "+s));l&&(d.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=d,d.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oo(e)}function wr(e){no(e.display),Dn(e),cn(e)}function mo(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=Ee("div",null,"CodeMirror-code"),r.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=N("div",null,"CodeMirror-cursors"),r.measure=N("div",null,"CodeMirror-measure"),r.lineMeasure=N("div",null,"CodeMirror-measure"),r.lineSpace=Ee("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=Ee("div",[r.lineSpace],"CodeMirror-lines");r.mover=N("div",[s],null,"position: relative"),r.sizer=N("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=N("div",null,null,"position: absolute; height: "+nt+"px; width: 1px;"),r.gutters=N("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=N("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=N("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),E&&R<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!B&&!(G&&ie)&&(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=ji(n.gutters,n.lineNumbers),no(r),i.init(r)}var Nr=0,vi=null;E?vi=-.53:G?vi=15:D?vi=-.7:te&&(vi=-1/3);function Mo(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function ta(e){var t=Mo(e);return t.x*=vi,t.y*=vi,t}function na(e,t){var i=Mo(t),n=i.x,r=i.y,s=e.display,l=s.scroller,d=l.scrollWidth>l.clientWidth,f=l.scrollHeight>l.clientHeight;if(!(n&&d||r&&f))return;if(r&&se&&B){e:for(var v=t.target,U=s.view;v!=l;v=v.parentNode)for(var Y=0;Y<U.length;Y++)if(U[Y].node==v){e.display.currentWheelTarget=v;break e}}if(n&&!G&&!O&&vi!=null){r&&f&&eo(e,Math.max(0,l.scrollTop+r*vi)),nr(e,Math.max(0,l.scrollLeft+n*vi)),(!r||r&&f)&&x(t),s.wheelStartX=null;return}if(r&&vi!=null){var Ce=r*vi,me=e.doc.scrollTop,Fe=me+s.wrapper.clientHeight;Ce<0?me=Math.max(0,me+Ce-50):Fe=Math.min(e.doc.height,Fe+Ce+50),po(e,{top:me,bottom:Fe})}Nr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var Ye=l.scrollLeft-s.wheelStartX,at=l.scrollTop-s.wheelStartY,dt=at&&s.wheelDY&&at/s.wheelDY||Ye&&s.wheelDX&&Ye/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!dt)return;vi=(vi*Nr+dt)/(Nr+1),++Nr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Ii=function(e,t){this.ranges=e,this.primIndex=t};Ii.prototype.primary=function(){return this.ranges[this.primIndex]},Ii.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!Ji(i.anchor,n.anchor)||!Ji(i.head,n.head))return!1}return!0},Ii.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new wn(ar(this.ranges[t].anchor),ar(this.ranges[t].head));return new Ii(e,this.primIndex)},Ii.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ii.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Ft(t,n.from())>=0&&Ft(e,n.to())<=0)return i}return-1};var wn=function(e,t){this.anchor=e,this.head=t};wn.prototype.from=function(){return gr(this.anchor,this.head)},wn.prototype.to=function(){return mr(this.anchor,this.head)},wn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function rr(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(Ce,me){return Ft(Ce.from(),me.from())}),i=Te(t,r);for(var s=1;s<t.length;s++){var l=t[s],d=t[s-1],f=Ft(d.to(),l.from());if(n&&!l.empty()?f>0:f>=0){var v=gr(d.from(),l.from()),U=mr(d.to(),l.to()),Y=d.empty()?l.from()==l.head:d.from()==d.head;s<=i&&--i,t.splice(--s,2,new wn(Y?U:v,Y?v:U))}}return new Ii(t,i)}function Er(e,t){return new Ii([new wn(e,t||e)],0)}function Sr(e){return e.text?Qe(e.from.line+e.text.length-1,et(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ia(e,t){if(Ft(e,t.from)<0)return e;if(Ft(e,t.to)<=0)return Sr(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Sr(t).ch-t.to.ch),Qe(i,n)}function To(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new wn(ia(r.anchor,t),ia(r.head,t)))}return rr(e.cm,i,e.sel.primIndex)}function Ta(e,t,i){return e.line==t.line?Qe(i.line,e.ch-t.ch+i.ch):Qe(i.line+(e.line-t.line),e.ch)}function Aa(e,t,i){for(var n=[],r=Qe(e.first,0),s=r,l=0;l<t.length;l++){var d=t[l],f=Ta(d.from,r,s),v=Ta(Sr(d),r,s);if(r=d.to,s=v,i=="around"){var U=e.sel.ranges[l],Y=Ft(U.head,U.anchor)<0;n[l]=new wn(Y?v:f,Y?f:v)}else n[l]=new wn(f,f)}return new Ii(n,e.sel.primIndex)}function zr(e){e.doc.mode=di(e.options,e.doc.modeOption),ra(e)}function ra(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,fo(e,100),e.state.modeGen++,e.curOp&&Dn(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&et(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,i,n){function r(yt){return i?i[yt]:null}function s(yt,ft,Et){Ho(yt,ft,Et,n),xn(yt,"change",yt,t)}function l(yt,ft){for(var Et=[],Vt=yt;Vt<ft;++Vt)Et.push(new Mr(v[Vt],r(Vt),n));return Et}var d=t.from,f=t.to,v=t.text,U=_t(e,d.line),Y=_t(e,f.line),Ce=et(v),me=r(v.length-1),Fe=f.line-d.line;if(t.full)e.insert(0,l(0,v.length)),e.remove(v.length,e.size-v.length);else if(gs(e,t)){var Ye=l(0,v.length-1);s(Y,Y.text,me),Fe&&e.remove(d.line,Fe),Ye.length&&e.insert(d.line,Ye)}else if(U==Y)if(v.length==1)s(U,U.text.slice(0,d.ch)+Ce+U.text.slice(f.ch),me);else{var at=l(1,v.length-1);at.push(new Mr(Ce+U.text.slice(f.ch),me,n)),s(U,U.text.slice(0,d.ch)+v[0],r(0)),e.insert(d.line+1,at)}else if(v.length==1)s(U,U.text.slice(0,d.ch)+v[0]+Y.text.slice(f.ch),r(0)),e.remove(d.line+1,Fe);else{s(U,U.text.slice(0,d.ch)+v[0],r(0)),s(Y,Ce+Y.text.slice(f.ch),me);var dt=l(1,v.length-1);Fe>1&&e.remove(d.line+1,Fe-1),e.insert(d.line+1,dt)}xn(e,"change",e,t)}function io(e,t,i){function n(r,s,l){if(r.linked)for(var d=0;d<r.linked.length;++d){var f=r.linked[d];if(f.doc==s)continue;var v=l&&f.sharedHist;if(i&&!v)continue;t(f.doc,v),n(f.doc,r,v)}}n(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Pi(e),zr(e),ys(e),e.options.lineWrapping||cr(e),e.options.mode=t.modeOption,Dn(e)}function ys(e){(e.doc.direction=="rtl"?he:be)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ni(e,function(){ys(e),Dn(e)})}function Ra(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ns(e,t){var i={from:ar(t.from),to:Sr(t),text:Fi(e,t.from,t.to)};return xs(e,i,t.from.line,t.to.line+1),io(e,function(n){return xs(n,i,t.from.line,t.to.line+1)},!0),i}function bs(e){for(;e.length;){var t=et(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return bs(e.done),et(e.done);if(e.done.length&&!et(e.done).ranges)return et(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),et(e.done)}function Cs(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,d;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==n)))d=et(l.changes),Ft(t.from,t.to)==0&&Ft(t.from,d.to)==0?d.to=Sr(t):l.changes.push(ns(e,t));else{var f=et(r.done);for((!f||!f.ranges)&&La(e.sel,r.done),l={changes:[ns(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,d||je(e,"historyAdded")}function ml(e,t,i,n){var r=t.charAt(0);return r=="*"||r=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var r=e.history,s=n&&n.origin;i==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,et(r.done),t))?r.done[r.done.length-1]=t:La(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&bs(r.undone)}function La(e,t){var i=et(t);i&&i.ranges&&i.equals(e)||t.push(e)}function xs(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],r=0;r<t.text.length;++r)n.push(vl(i[r]));return n}function ws(e,t){var i=yl(e,t),n=Li(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var d=0;d<l.length;++d){for(var f=l[d],v=0;v<s.length;++v)if(s[v].marker==f.marker)continue e;s.push(f)}}else l&&(i[r]=l)}return i}function Ao(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Ii.prototype.deepCopy.call(s):s);continue}var l=s.changes,d=[];n.push({changes:d});for(var f=0;f<l.length;++f){var v=l[f],U=void 0;if(d.push({from:v.from,to:v.to,text:v.text}),t)for(var Y in v)(U=Y.match(/^spans_(\d+)$/))&&(Te(t,Number(U[1]))>-1&&(et(d)[Y]=v[Y],delete v[Y]))}}return n}function is(e,t,i,n){if(n){var r=e.anchor;if(i){var s=Ft(t,r)<0;s!=Ft(i,r)<0?(r=t,t=i):s!=Ft(t,i)<0&&(t=i)}return new wn(r,t)}else return new wn(i||t,t)}function Da(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Ti(e,new Ii([is(e.sel.primary(),t,i,r)],0),n)}function Es(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)n[s]=is(e.sel.ranges[s],t[s],null,r);var l=rr(e.cm,n,e.sel.primIndex);Ti(e,l,i)}function rs(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Ti(e,rr(e.cm,r,e.sel.primIndex),n)}function Ss(e,t,i,n){Ti(e,Er(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(r){this.ranges=[];for(var s=0;s<r.length;s++)this.ranges[s]=new wn(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return je(e,"beforeSelectionChange",e,n),e.cm&&je(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?rr(e.cm,n.ranges,n.ranges.length-1):t}function ks(e,t,i){var n=e.history.done,r=et(n);r&&r.ranges?(n[n.length-1]=t,Pa(e,t,i)):Ti(e,t,i)}function Ti(e,t,i){Pa(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Pa(e,t,i){(Z(e,"beforeSelectionChange")||e.cm&&Z(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Ft(t.primary().head,e.sel.primary().head)<0?-1:1);_s(e,Ms(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Qr(e.cm)}function _s(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ae(e.cm)),xn(e,"cursorActivity",e)}function Os(e){_s(e,Ms(e,e.sel,null,!1))}function Ms(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],d=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],f=Na(e,l.anchor,d&&d.anchor,i,n),v=Na(e,l.head,d&&d.head,i,n);(r||f!=l.anchor||v!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new wn(f,v))}return r?rr(e.cm,r,t.primIndex):t}function Ro(e,t,i,n,r){var s=_t(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var d=s.markedSpans[l],f=d.marker,v="selectLeft"in f?!f.selectLeft:f.inclusiveLeft,U="selectRight"in f?!f.selectRight:f.inclusiveRight;if((d.from==null||(v?d.from<=t.ch:d.from<t.ch))&&(d.to==null||(U?d.to>=t.ch:d.to>t.ch))){if(r&&(je(f,"beforeCursorEnter"),f.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!f.atomic)continue;if(i){var Y=f.find(n<0?1:-1),Ce=void 0;if((n<0?U:v)&&(Y=Ts(e,Y,-n,Y&&Y.line==t.line?s:null)),Y&&Y.line==t.line&&(Ce=Ft(Y,i))&&(n<0?Ce<0:Ce>0))return Ro(e,Y,t,n,r)}var me=f.find(n<0?-1:1);return(n<0?v:U)&&(me=Ts(e,me,n,me.line==t.line?s:null)),me?Ro(e,me,t,n,r):null}}return t}function Na(e,t,i,n,r){var s=n||1,l=Ro(e,t,i,s,r)||!r&&Ro(e,t,i,s,!0)||Ro(e,t,i,-s,r)||!r&&Ro(e,t,i,-s,!0);return l||(e.cantEdit=!0,Qe(e.first,0))}function Ts(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Qe(t.line-1)):null:i>0&&t.ch==(n||_t(e,t.line)).text.length?t.line<e.first+e.size-1?Qe(t.line+1,0):null:new Qe(t.line,t.ch+i)}function As(e){e.setSelection(Qe(e.firstLine(),0),Qe(e.lastLine()),Ue)}function Rs(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(r,s,l,d){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),d!==void 0&&(n.origin=d)}),je(e,"beforeChange",e,n),e.cm&&je(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 Lo(e,t,i){if(e.cm){if(!e.cm.curOp)return ni(e.cm,Lo)(e,t,i);if(e.cm.state.suppressEdits)return}if((Z(e,"beforeChange")||e.cm&&Z(e.cm,"beforeChange"))&&(t=Rs(e,t,!0),!t))return;var n=Gr&&!i&&_r(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Ls(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&Ft(t.from,t.to)==0)return;var i=To(e,t);Cs(e,t,i,e.cm?e.cm.curOp.id:NaN),oa(e,t,i,Li(e,t));var n=[];io(e,function(r,s){!s&&Te(n,r.history)==-1&&(js(r.history,t),n.push(r.history)),oa(r,t,null,Li(r,t))})}function ja(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,d=t=="undo"?r.done:r.undone,f=t=="undo"?r.undone:r.done,v=0;v<d.length&&!(s=d[v],i?s.ranges&&!s.equals(e.sel):!s.ranges);v++);if(v==d.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=d.pop(),s.ranges){if(La(s,f),i&&!s.equals(e.sel)){Ti(e,s,{clearRedo:!1});return}l=s}else if(n){d.push(s);return}else break;var U=[];La(l,f),f.push({changes:U,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var Y=Z(e,"beforeChange")||e.cm&&Z(e.cm,"beforeChange"),Ce=function(Ye){var at=s.changes[Ye];if(at.origin=t,Y&&!Rs(e,at,!1))return d.length=0,{};U.push(ns(e,at));var dt=Ye?To(e,at):et(d);oa(e,at,dt,ws(e,at)),!Ye&&e.cm&&e.cm.scrollIntoView({from:at.from,to:Sr(at)});var yt=[];io(e,function(ft,Et){!Et&&Te(yt,ft.history)==-1&&(js(ft.history,at),yt.push(ft.history)),oa(ft,at,null,ws(ft,at))})},me=s.changes.length-1;me>=0;--me){var Fe=Ce(me);if(Fe)return Fe.v}}function Ds(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ii(Ct(e.sel.ranges,function(r){return new wn(Qe(r.anchor.line+t,r.anchor.ch),Qe(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Dn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Kn(e.cm,n,"gutter")}}function oa(e,t,i,n){if(e.cm&&!e.cm.curOp)return ni(e.cm,oa)(e,t,i,n);if(t.to.line<e.first){Ds(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 r=t.text.length-1-(e.first-t.from.line);Ds(e,r),t={from:Qe(e.first,0),to:Qe(t.to.line+r,t.to.ch),text:[et(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Qe(s,_t(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Fi(e,t.from,t.to),i||(i=To(e,t)),e.cm?Cl(e.cm,t,n):ts(e,t,n),Pa(e,i,Ue),e.cantEdit&&Na(e,Qe(e.firstLine(),0))&&(e.cantEdit=!1)}function Cl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,d=!1,f=s.line;e.options.lineWrapping||(f=ln(Zn(_t(n,s.line))),n.iter(f,l.line+1,function(me){if(me==r.maxLine)return d=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ae(e),ts(n,t,i,er(e)),e.options.lineWrapping||(n.iter(f,s.line+t.text.length,function(me){var Fe=Yr(me);Fe>r.maxLineLength&&(r.maxLine=me,r.maxLineLength=Fe,r.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),Zi(n,s.line),fo(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?Dn(e):s.line==l.line&&t.text.length==1&&!gs(e.doc,t)?Kn(e,s.line,"text"):Dn(e,s.line,l.line+1,v);var U=Z(e,"changes"),Y=Z(e,"change");if(Y||U){var Ce={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};Y&&xn(e,"change",e,Ce),U&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ce)}e.display.selForContextMenu=null}function Do(e,t,i,n,r){var s;n||(n=i),Ft(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),Lo(e,{from:i,to:n,text:t,origin:r})}function Ps(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ns(e,t,i,n){for(var r=0;r<e.length;++r){var s=e[r],l=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var d=0;d<s.ranges.length;d++)Ps(s.ranges[d].anchor,t,i,n),Ps(s.ranges[d].head,t,i,n);continue}for(var f=0;f<s.changes.length;++f){var v=s.changes[f];if(i<v.from.line)v.from=Qe(v.from.line+n,v.from.ch),v.to=Qe(v.to.line+n,v.to.ch);else if(t<=v.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function js(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;Ns(e.done,i,n,r),Ns(e.undone,i,n,r)}function aa(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=_t(e,h(e,t)):r=ln(t),r==null?null:(n(s,r)&&e.cm&&Kn(e.cm,r,i),s)}function sa(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}sa.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,yo(r),xn(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function la(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var r=e[n];t+=r.chunkSize(),i+=r.height,r.parent=this}this.size=t,this.height=i,this.parent=null}la.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof sa))){var d=[];this.collapse(d),this.children=[new sa(d)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,i),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,d=l;d<r.lines.length;){var f=new sa(r.lines.slice(d,d+=25));r.height-=f.height,this.children.splice(++n,0,f),f.parent=this}r.lines=r.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new la(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=Te(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new la(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var ua=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};ua.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=ln(i);if(n==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var s=Jr(this);ki(i,Math.max(0,i.height-s)),e&&(Ni(e,function(){Is(e,i,-s),Kn(e,n,"widget")}),xn(e,"lineWidgetCleared",e,this,n))},ua.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=Jr(this)-t;if(!r)return;Di(this.doc,n)||ki(n,n.height+r),i&&Ni(i,function(){i.curOp.forceUpdate=!0,Is(i,n,r),xn(i,"lineWidgetChanged",i,e,ln(n))})},re(ua);function Is(e,t,i){Oi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Zo(e,i)}function xl(e,t,i,n){var r=new ua(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),aa(e,t,"widget",function(l){var d=l.widgets||(l.widgets=[]);if(r.insertAt==null?d.push(r):d.splice(Math.min(d.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Di(e,l)){var f=Oi(l)<e.scrollTop;ki(l,l.height+Jr(r)),f&&Zo(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&xn(s,"lineWidgetAdded",s,r,typeof t=="number"?t:ln(t)),r}var Us=0,ro=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};ro.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Pr(e),Z(this,"clear")){var i=this.find();i&&xn(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],d=zi(l.markedSpans,this);e&&!this.collapsed?Kn(e,ln(l),"text"):e&&(d.to!=null&&(r=ln(l)),d.from!=null&&(n=ln(l))),l.markedSpans=lr(l.markedSpans,d),d.from==null&&this.collapsed&&!Di(this.doc,l)&&e&&ki(l,Qn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var v=Zn(this.lines[f]),U=Yr(v);U>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=U,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Dn(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&xn(e,"markerCleared",e,this,n,r),t&&Fr(e),this.parent&&this.parent.clear()},ro.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var s=this.lines[r],l=zi(s.markedSpans,this);if(l.from!=null&&(i=Qe(t?s:ln(s),l.from),e==-1))return i;if(l.to!=null&&(n=Qe(t?s:ln(s),l.to),e==1))return n}return i&&{from:i,to:n}},ro.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Ni(n,function(){var r=t.line,s=ln(t.line),l=le(n,s);if(l&&(Qt(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Di(i.doc,r)&&i.height!=null){var d=i.height;i.height=null;var f=Jr(i)-d;f&&ki(r,r.height+f)}xn(n,"markerChanged",n,e)})},ro.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Te(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ro.prototype.detachLine=function(e){if(this.lines.splice(Te(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},re(ro);function Po(e,t,i,n,r){if(n&&n.shared)return wl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return ni(e.cm,Po)(e,t,i,n,r);var s=new ro(e,r),l=Ft(t,i);if(n&&g(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=Ee("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(ti(e,t.line,t,i,s)||t.line!=i.line&&ti(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");sr()}s.addToHistory&&Cs(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var d=t.line,f=e.cm,v;if(e.iter(d,i.line+1,function(Y){f&&s.collapsed&&!f.options.lineWrapping&&Zn(Y)==f.display.maxLine&&(v=!0),s.collapsed&&d!=t.line&&ki(Y,0),Wi(Y,new vr(s,d==t.line?t.ch:null,d==i.line?i.ch:null)),++d}),s.collapsed&&e.iter(t.line,i.line+1,function(Y){Di(e,Y)&&ki(Y,0)}),s.clearOnEnter&&De(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(_i(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++Us,s.atomic=!0),f){if(v&&(f.curOp.updateMaxLine=!0),s.collapsed)Dn(f,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var U=t.line;U<=i.line;U++)Kn(f,U,"text");s.atomic&&Os(f.doc),xn(f,"markerAdded",f,s)}return s}var ca=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};ca.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();xn(this,"clear")},ca.prototype.find=function(e,t){return this.primary.find(e,t)},re(ca);function wl(e,t,i,n,r){n=g(n),n.shared=!1;var s=[Po(e,t,i,n,r)],l=s[0],d=n.widgetNode;return io(e,function(f){d&&(n.widgetNode=d.cloneNode(!0)),s.push(Po(f,o(f,t),o(f,i),n,r));for(var v=0;v<f.linked.length;++v)if(f.linked[v].isParent)return;l=et(s)}),new ca(s,l)}function Bs(e){return e.findMarks(Qe(e.first,0),e.clipPos(Qe(e.lastLine())),function(t){return t.parent})}function El(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(Ft(s,l)){var d=Po(e,s,l,n.primary,n.primary.type);n.markers.push(d),d.parent=n}}}function Sl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];io(r.primary.doc,function(f){return s.push(f)});for(var l=0;l<r.markers.length;l++){var d=r.markers[l];Te(s,d.doc)==-1&&(d.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var kl=0,Gi=function(e,t,i,n,r){if(!(this instanceof Gi))return new Gi(e,t,i,n,r);i==null&&(i=0),la.call(this,[new sa([new Mr("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=Qe(i,0);this.sel=Er(s),this.history=new Ra(null),this.id=++kl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:s,to:s,text:e}),Ti(this,Er(s),Ue)};Gi.prototype=pt(la.prototype,{constructor:Gi,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=dr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ii(function(e){var t=Qe(this.first,0),i=this.first+this.size-1;Lo(this,{from:t,to:Qe(i,_t(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&qr(this.cm,0,0),Ti(this,Er(t),Ue)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,Do(this,e,t,i,n)},getRange:function(e,t,i){var n=Fi(this,o(this,e),o(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(fr(this,e))return _t(this,e)},getLineNumber:function(e){return ln(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=_t(this,e)),Zn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ii(function(e,t,i){Ss(this,o(this,typeof e=="number"?Qe(e,t||0):e),null,i)}),setSelection:ii(function(e,t,i){Ss(this,o(this,e),o(this,t||e),i)}),extendSelection:ii(function(e,t,i){Da(this,o(this,e),t&&o(this,t),i)}),extendSelections:ii(function(e,t){Es(this,u(this,e),t)}),extendSelectionsBy:ii(function(e,t){var i=Ct(this.sel.ranges,e);Es(this,u(this,i),t)}),setSelections:ii(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new wn(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ti(this,rr(this.cm,n,t),i)}),addSelection:ii(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new wn(o(this,e),o(this,t||e))),Ti(this,rr(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var r=Fi(this,t[n].from(),t[n].to());i=i?i.concat(r):r}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var r=Fi(this,i[n].from(),i[n].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[n]=r}return t},replaceSelection:function(e,t,i){for(var n=[],r=0;r<this.sel.ranges.length;r++)n[r]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:ii(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var d=t&&t!="end"&&Aa(this,n,t),f=n.length-1;f>=0;f--)Lo(this,n[f]);d?ks(this,d):this.cm&&Qr(this.cm)}),undo:ii(function(){ja(this,"undo")}),redo:ii(function(){ja(this,"redo")}),undoSelection:ii(function(){ja(this,"undo",!0)}),redoSelection:ii(function(){ja(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Ra(this.history.maxGeneration),io(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:Ao(this.history.done),undone:Ao(this.history.undone)}},setHistory:function(e){var t=this.history=new Ra(this.history.maxGeneration);t.done=Ao(e.done.slice(0),null,!0),t.undone=Ao(e.undone.slice(0),null,!0)},setGutterMarker:ii(function(e,t,i){return aa(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Se(r)&&(n.gutterMarkers=null),!0})}),clearGutter:ii(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&aa(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Se(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!fr(this,e))return null;if(t=e,e=_t(this,e),!e)return null}else if(t=ln(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:ii(function(e,t,i){return aa(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[r])n[r]=i;else{if(_e(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:ii(function(e,t,i){return aa(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[r];if(s)if(i==null)n[r]=null;else{var l=s.match(_e(i));if(!l)return!1;var d=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||d==s.length?"":" ")+s.slice(d)||null}else return!1;return!0})}),addLineWidget:ii(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Po(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=o(this,e),Po(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=_t(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var d=0;d<l.length;d++){var f=l[d];!(f.to!=null&&r==e.line&&e.ch>=f.to||f.from==null&&r!=e.line||f.from!=null&&r==t.line&&f.from>=t.ch)&&(!i||i(f.marker))&&n.push(f.marker.parent||f.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,Qe(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new Gi(dr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new Gi(dr(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],El(n,Bs(this)),n},unlinkDoc:function(e){if(e instanceof Xn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Sl(Bs(this));break}if(e.history==this.history){var n=[e.id];io(e,function(r){return n.push(r.id)},!0),e.history=new Ra(null),e.history.done=Ao(this.history.done,n),e.history.undone=Ao(this.history.undone,n)}},iterLinkedDocs:function(e){io(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Lt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:ii(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Gi.prototype.eachLine=Gi.prototype.iter;var Fs=0;function _l(e){var t=this;if(Hs(t),qe(t,e)||xr(t.display,e))return;x(e),E&&(Fs=+new Date);var i=pi(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var r=n.length,s=Array(r),l=0,d=function(){++l==r&&ni(t,function(){i=o(t.doc,i);var me={from:i,to:i,text:t.doc.splitLines(s.filter(function(Fe){return Fe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Lo(t.doc,me),ks(t.doc,Er(o(t.doc,i),o(t.doc,Sr(me))))})()},f=function(me,Fe){if(t.options.allowDropFileTypes&&Te(t.options.allowDropFileTypes,me.type)==-1){d();return}var Ye=new FileReader;Ye.onerror=function(){return d()},Ye.onload=function(){var at=Ye.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(at)){d();return}s[Fe]=at,d()},Ye.readAsText(me)},v=0;v<n.length;v++)f(n[v],v);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var U=e.dataTransfer.getData("Text");if(U){var Y;if(t.state.draggingText&&!t.state.draggingText.copy&&(Y=t.listSelections()),Pa(t.doc,Er(i,i)),Y)for(var Ce=0;Ce<Y.length;++Ce)Do(t.doc,"",Y[Ce].anchor,Y[Ce].head,"drag");t.replaceSelection(U,"around","paste"),t.display.input.focus()}}catch(me){}}}function Ol(e,t){if(E&&(!e.state.draggingText||+new Date-Fs<100)){L(t);return}if(qe(e,t)||xr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!te){var i=N("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",O&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),O&&i.parentNode.removeChild(i)}}function Ml(e,t){var i=pi(e,t);if(!i)return;var n=document.createDocumentFragment();Rr(e,i,n),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),we(e.display.dragCursor,n)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function zs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&i.push(r)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var Ws=!1;function Tl(){if(Ws)return;Al(),Ws=!0}function Al(){var e;De(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,zs(Rl)},100))}),De(window,"blur",function(){return zs(Zr)})}function Rl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var oo={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"},ha=0;ha<10;ha++)oo[ha+48]=oo[ha+96]=String(ha);for(var Ia=65;Ia<=90;Ia++)oo[Ia]=String.fromCharCode(Ia);for(var da=1;da<=12;da++)oo[da+111]=oo[da+63235]="F"+da;var Wr={};Wr.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"},Wr.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"},Wr.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"},Wr.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"]},Wr.default=se?Wr.macDefault:Wr.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var d=t[l];if(/^(cmd|meta|m)$/i.test(d))s=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))n=!0;else if(/^s(hift)?$/i.test(d))r=!0;else throw new Error("Unrecognized modifier name: "+d)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Dl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var r=Ct(i.split(" "),Ll),s=0;s<r.length;s++){var l=void 0,d=void 0;s==r.length-1?(d=r.join(" "),l=n):(d=r.slice(0,s+1).join(" "),l="...");var f=t[d];if(!f)t[d]=l;else if(f!=l)throw new Error("Inconsistent bindings for "+d)}delete e[i]}for(var v in t)e[v]=t[v];return e}function No(e,t,i,n){t=Ua(t);var r=t.call?t.call(e,n):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&i(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return No(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=No(e,t.fallthrough[s],i,n);if(l)return l}}}function Vs(e){var t=typeof e=="string"?e:oo[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(Me?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(Me?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Ks(e,t){if(O&&e.keyCode==34&&e.char)return!1;var i=oo[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Gs(i,e,t))}function Ua(e){return typeof e=="string"?Wr[e]:e}function jo(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&Ft(s.from,et(n).to)<=0;){var l=n.pop();if(Ft(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}Ni(e,function(){for(var d=n.length-1;d>=0;d--)Do(e.doc,"",n[d].from,n[d].to,"+delete");Qr(e)})}function os(e,t,i){var n=lt(e.text,t+i,i);return n<0||n>e.text.length?null:n}function as(e,t,i){var n=os(e,t.ch,i);return n==null?null:new Qe(t.line,n,i<0?"after":"before")}function ss(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=xt(i,t.doc.direction);if(s){var l=r<0?et(s):s[0],d=r<0==(l.level==1),f=d?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var U=ne(t,i);v=r<0?i.text.length-1:0;var Y=ve(t,U,v).top;v=It(function(Ce){return ve(t,U,Ce).top==Y},r<0==(l.level==1)?l.from:l.to-1,v),f=="before"&&(v=os(i,v,1))}else v=r<0?l.to:l.from;return new Qe(n,v,f)}}return new Qe(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=xt(t,e.doc.direction);if(!r)return as(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=ut(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from<i.ch))return as(t,i,n);var d=function(dt,yt){return os(t,dt instanceof Qe?dt.ch:dt,yt)},f,v=function(dt){return e.options.lineWrapping?(f=f||ne(e,t),At(e,t,f,dt)):{begin:0,end:t.text.length}},U=v(i.sticky=="before"?d(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var Y=l.level==1==n<0,Ce=d(i,Y?1:-1);if(Ce!=null&&(Y?Ce<=l.to&&Ce<=U.end:Ce>=l.from&&Ce>=U.begin)){var me=Y?"before":"after";return new Qe(i.line,Ce,me)}}var Fe=function(dt,yt,ft){for(var Et=function(In,bi){return bi?new Qe(i.line,d(In,1),"before"):new Qe(i.line,In,"after")};dt>=0&&dt<r.length;dt+=yt){var Vt=r[dt],jt=yt>0==(Vt.level!=1),en=jt?ft.begin:d(ft.end,-1);if(Vt.from<=en&&en<Vt.to)return Et(en,jt);if(en=jt?Vt.from:d(Vt.to,-1),ft.begin<=en&&en<ft.end)return Et(en,jt)}},Ye=Fe(s+n,n,U);if(Ye)return Ye;var at=n>0?U.end:d(U.begin,-1);return at!=null&&!(n>0&&at==t.text.length)&&(Ye=Fe(n>0?0:r.length-1,n,v(at)),Ye)?Ye:null}var fa={selectAll:As,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ue)},killLine:function(e){return jo(e,function(t){if(t.empty()){var i=_t(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Qe(t.head.line+1,0)}:{from:t.head,to:Qe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return jo(e,function(t){return{from:Qe(t.from().line,0),to:o(e.doc,Qe(t.to().line+1,0))}})},delLineLeft:function(e){return jo(e,function(t){return{from:Qe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return jo(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return jo(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Qe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Qe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return $s(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 i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Le)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Le)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?$s(e,t.head):n},Le)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var s=i[r].from(),l=ue(e.getLine(s.line),s.ch,n);t.push(j(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ni(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var r=t[n].head,s=_t(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Qe(r.line,r.ch-1)),r.ch>0)r=new Qe(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Qe(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=_t(e.doc,r.line-1).text;l&&(r=new Qe(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Qe(r.line-1,l.length-1),r,"+transpose"))}}i.push(new wn(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return Ni(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Qr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,t){var i=_t(e.doc,t),n=Zn(i);return n!=i&&(t=ln(n)),ss(!0,e,n,t,1)}function Nl(e,t){var i=_t(e.doc,t),n=ur(i);return n!=i&&(t=ln(n)),ss(!0,e,i,t,-1)}function $s(e,t){var i=Xs(e,t.line),n=_t(e.doc,i.line),r=xt(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return Qe(i.line,l?0:s,i.sticky)}return i}function Ba(e,t,i){if(typeof t=="string"&&(t=fa[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),r=t(e)!=st}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function jl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=No(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&No(t,e.options.extraKeys,i,e)||No(t,e.options.keyMap,i,e)}var Il=new Ie;function pa(e,t,i,n){var r=e.state.keySeq;if(r){if(Vs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Il.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),Ys(e,r+" "+t,i,n))return!0}return Ys(e,t,i,n)}function Ys(e,t,i,n){var r=jl(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&xn(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(x(i),mi(e)),!!r}function Js(e,t){var i=Ks(t,!0);return i?t.shiftKey&&!e.state.keySeq?pa(e,"Shift-"+i,t,function(n){return Ba(e,n,!0)})||pa(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Ba(e,n)}):pa(e,i,t,function(n){return Ba(e,n)}):!1}function Ul(e,t,i){return pa(e,"'"+i+"'",t,function(n){return Ba(e,n,!0)})}var ls=null;function Zs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=K(),qe(t,e))return;E&&R<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Js(t,e);O&&(ls=n?i:null,!n&&i==88&&!on&&(se?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),G&&!se&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;he(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(be(t,"CodeMirror-crosshair"),vt(document,"keyup",i),vt(document,"mouseover",i))}De(document,"keyup",i),De(document,"mouseover",i)}function Qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),qe(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(xr(t.display,e)||qe(t,e)||e.ctrlKey&&!e.altKey||se&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(O&&i==ls){ls=null,x(e);return}if(O&&(!e.which||e.which<10)&&Js(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Ul(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,us=function(e,t,i){this.time=e,this.pos=t,this.button=i};us.prototype.compare=function(e,t,i){return this.time+Fl>e&&Ft(t,this.pos)==0&&i==this.button};var ma,ga;function Hl(e,t){var i=+new Date;return ga&&ga.compare(i,e,t)?(ma=ga=null,"triple"):ma&&ma.compare(i,e,t)?(ga=new us(i,e,t),ma=null,"double"):(ma=new us(i,e,t),ga=null,"single")}function el(e){var t=this,i=t.display;if(qe(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,xr(i,e)){B||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(cs(t,e))return;var n=pi(t,e),r=ke(e),s=n?Hl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&zl(t,r,n,s,e))return;r==1?n?Vl(t,n,s,e):pe(e)==i.scroller&&x(e):r==2?(n&&Da(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Ve?t.display.input.onContextMenu(e):$o(t))}function zl(e,t,i,n,r){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,pa(e,Gs(s,r),r,function(l){if(typeof l=="string"&&(l=fa[l]),!l)return!1;var d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d=l(e,i)!=st}finally{e.state.suppressEdits=!1}return d})}function Wl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=Oe?i.shiftKey&&i.metaKey:i.altKey;r.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(r.extend==null||e.doc.extend)&&(r.extend=e.doc.extend||i.shiftKey),r.addNew==null&&(r.addNew=se?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(se?i.altKey:i.ctrlKey)),r}function Vl(e,t,i,n){E?setTimeout(M(wa,e),0):e.curOp.focus=K();var r=Wl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Je&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(Ft((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(Ft(l.to(),t)>0||t.xRel<0)?Gl(e,n,t,r):Kl(e,n,t,r)}function Gl(e,t,i,n){var r=e.display,s=!1,l=ni(e,function(v){B&&(r.scroller.draggable=!1),e.state.draggingText=!1,vt(r.wrapper.ownerDocument,"mouseup",l),vt(r.wrapper.ownerDocument,"mousemove",d),vt(r.scroller,"dragstart",f),vt(r.scroller,"drop",l),s||(x(v),n.addNew||Da(e.doc,i,null,null,n.extend),B&&!te||E&&R==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),d=function(v){s=s||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},f=function(){return s=!0};B&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),De(r.wrapper.ownerDocument,"mouseup",l),De(r.wrapper.ownerDocument,"mousemove",d),De(r.scroller,"dragstart",f),De(r.scroller,"drop",l),$o(e),setTimeout(function(){return r.input.focus()},20)}function tl(e,t,i){if(i=="char")return new wn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new wn(Qe(t.line,0),o(e.doc,Qe(t.line+1,0)));var n=i(e,t);return new wn(n.from,n.to)}function Kl(e,t,i,n){var r=e.display,s=e.doc;x(t);var l,d,f=s.sel,v=f.ranges;if(n.addNew&&!n.extend?(d=s.sel.contains(i),d>-1?l=v[d]:l=new wn(i,i)):(l=s.sel.primary(),d=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new wn(i,i)),i=pi(e,t,!0,!0),d=-1;else{var U=tl(e,i,n.unit);n.extend?l=is(l,U.anchor,U.head,n.extend):l=U}n.addNew?d==-1?(d=v.length,Ti(s,rr(e,v.concat([l]),d),{scroll:!1,origin:"*mouse"})):v.length>1&&v[d].empty()&&n.unit=="char"&&!n.extend?(Ti(s,rr(e,v.slice(0,d).concat(v.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),f=s.sel):rs(s,d,l,He):(d=0,Ti(s,new Ii([l],0),He),f=s.sel);var Y=i;function Ce(ft){if(Ft(Y,ft)==0)return;if(Y=ft,n.unit=="rectangle"){for(var Et=[],Vt=e.options.tabSize,jt=ue(_t(s,i.line).text,i.ch,Vt),en=ue(_t(s,ft.line).text,ft.ch,Vt),In=Math.min(jt,en),bi=Math.max(jt,en),Yn=Math.min(i.line,ft.line),Qi=Math.min(e.lastLine(),Math.max(i.line,ft.line));Yn<=Qi;Yn++){var Ki=_t(s,Yn).text,ci=Be(Ki,In,Vt);In==bi?Et.push(new wn(Qe(Yn,ci),Qe(Yn,ci))):Ki.length>ci&&Et.push(new wn(Qe(Yn,ci),Qe(Yn,Be(Ki,bi,Vt))))}Et.length||Et.push(new wn(i,i)),Ti(s,rr(e,f.ranges.slice(0,d).concat(Et),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ft)}else{var Xi=l,Ei=tl(e,ft,n.unit),yi=Xi.anchor,hi;Ft(Ei.anchor,yi)>0?(hi=Ei.head,yi=gr(Xi.from(),Ei.anchor)):(hi=Ei.anchor,yi=mr(Xi.to(),Ei.head));var qn=f.ranges.slice(0);qn[d]=Xl(e,new wn(o(s,yi),hi)),Ti(s,rr(e,qn,d),He)}}var me=r.wrapper.getBoundingClientRect(),Fe=0;function Ye(ft){var Et=++Fe,Vt=pi(e,ft,!0,n.unit=="rectangle");if(!Vt)return;if(Ft(Vt,Y)!=0){e.curOp.focus=K(),Ce(Vt);var jt=wo(r,s);(Vt.line>=jt.to||Vt.line<jt.from)&&setTimeout(ni(e,function(){Fe==Et&&Ye(ft)}),150)}else{var en=ft.clientY<me.top?-20:ft.clientY>me.bottom?20:0;en&&setTimeout(ni(e,function(){if(Fe!=Et)return;r.scroller.scrollTop+=en,Ye(ft)}),50)}}function at(ft){e.state.selectingText=!1,Fe=Infinity,ft&&(x(ft),r.input.focus()),vt(r.wrapper.ownerDocument,"mousemove",dt),vt(r.wrapper.ownerDocument,"mouseup",yt),s.history.lastSelOrigin=null}var dt=ni(e,function(ft){ft.buttons===0||!ke(ft)?at(ft):Ye(ft)}),yt=ni(e,at);e.state.selectingText=yt,De(r.wrapper.ownerDocument,"mousemove",dt),De(r.wrapper.ownerDocument,"mouseup",yt)}function Xl(e,t){var i=t.anchor,n=t.head,r=_t(e.doc,i.line);if(Ft(i,n)==0&&i.sticky==n.sticky)return t;var s=xt(r);if(!s)return t;var l=ut(s,i.ch,i.sticky),d=s[l];if(d.from!=i.ch&&d.to!=i.ch)return t;var f=l+(d.from==i.ch==(d.level!=1)?0:1);if(f==0||f==s.length)return t;var v;if(n.line!=i.line)v=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var U=ut(s,n.ch,n.sticky),Y=U-l||(n.ch-i.ch)*(d.level==1?-1:1);U==f-1||U==f?v=Y<0:v=Y>0}var Ce=s[f+(v?-1:0)],me=v==(Ce.level==1),Fe=me?Ce.from:Ce.to,Ye=me?"after":"before";return i.ch==Fe&&i.sticky==Ye?t:new wn(new Qe(i.line,Fe,Ye),n)}function nl(e,t,i,n){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(Ce){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&x(t);var l=e.display,d=l.lineDiv.getBoundingClientRect();if(s>d.bottom||!Z(e,i))return T(t);s-=d.top-l.viewOffset;for(var f=0;f<e.display.gutterSpecs.length;++f){var v=l.gutters.childNodes[f];if(v&&v.getBoundingClientRect().right>=r){var U=Yi(e.doc,s),Y=e.display.gutterSpecs[f];return je(e,i,e,U,Y.className,t),T(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if(xr(e.display,t)||$l(e,t))return;if(qe(e,t,"contextmenu"))return;Ve||e.display.input.onContextMenu(t)}function $l(e,t){return Z(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),$t(e)}var Io={toString:function(){return"CodeMirror.Init"}},ol={},Fa={};function Yl(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(d,f,v){v!=Io&&s(d,f,v)}:s)}e.defineOption=i,e.Init=Io,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,zr(n)},!0),i("indentUnit",2,zr,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){ra(n),$t(n),Dn(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(f){for(var v=0;;){var U=f.text.indexOf(r,v);if(U==-1)break;v=U+r.length,s.push(Qe(l,U))}l++});for(var d=s.length-1;d>=0;d--)Do(n.doc,r,s[d],Qe(s[d].line,s[d].ch+r.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,r,s){n.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=Io&&n.refresh()}),i("specialCharPlaceholder",Ot,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",ie?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,r){return n.getInputField().spellcheck=r},!0),i("autocorrect",!1,function(n,r){return n.getInputField().autocorrect=r},!0),i("autocapitalize",!1,function(n,r){return n.getInputField().autocapitalize=r},!0),i("rtlMoveVisually",!Ke),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){rl(n),wr(n)},!0),i("keyMap","default",function(n,r,s){var l=Ua(r),d=s!=Io&&Ua(s);d&&d.detach&&d.detach(n,l),l.attach&&l.attach(n,d||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=ji(r,n.options.lineNumbers),wr(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?Mi(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Br(n)},!0),i("scrollbarStyle","native",function(n){ko(n),Br(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,r){n.display.gutterSpecs=ji(n.options.gutters,r),wr(n)},!0),i("firstLineNumber",1,wr,!0),i("lineNumberFormatter",function(n){return n},wr,!0),i("showCursorWhenSelecting",!1,An,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(Zr(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,An,!0),i("singleCursorHeightPerLine",!0,An,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,ra,!0),i("addModeClass",!1,ra,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,ra,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=Io;if(!t!=!n){var r=e.display.dragFunctions,s=t?De:vt;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function Zl(e){e.options.lineWrapping?(he(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(be(e.display.wrapper,"CodeMirror-wrap"),cr(e)),Pi(e),Dn(e),$t(e),setTimeout(function(){return Br(e)},100)}function Xn(e,t){var i=this;if(!(this instanceof Xn))return new Xn(e,t);this.options=t=t?g(t):{},g(ol,t,!1);var n=t.value;typeof n=="string"?n=new Gi(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new Xn.inputStyles[t.inputStyle](this),s=this.display=new mo(e,n,r,t);s.wrapper.CodeMirror=this,rl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ko(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 Ie,keySeq:null,specialChars:null},t.autofocus&&!ie&&s.input.focus(),E&&R<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Tl(),Pr(this),this.curOp.forceUpdate=!0,vs(this,n),t.autofocus&&!ie||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Lr(i)},20):Zr(this);for(var l in Fa)Fa.hasOwnProperty(l)&&Fa[l](this,t[l],Io);gi(this),t.finishInit&&t.finishInit(this);for(var d=0;d<hs.length;++d)hs[d](this);Fr(this),B&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Xn.defaults=ol,Xn.optionHandlers=Fa;function Ql(e){var t=e.display;De(t.scroller,"mousedown",ni(e,el)),E&&R<11?De(t.scroller,"dblclick",ni(e,function(f){if(qe(e,f))return;var v=pi(e,f);if(!v||cs(e,f)||xr(e.display,f))return;x(f);var U=e.findWordAt(v);Da(e.doc,U.anchor,U.head)})):De(t.scroller,"dblclick",function(f){return qe(e,f)||x(f)}),De(t.scroller,"contextmenu",function(f){return il(e,f)}),De(t.input.getField(),"contextmenu",function(f){t.scroller.contains(f.target)||il(e,f)});var i,n={end:0};function r(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(f){if(f.touches.length!=1)return!1;var v=f.touches[0];return v.radiusX<=1&&v.radiusY<=1}function l(f,v){if(v.left==null)return!0;var U=v.left-f.left,Y=v.top-f.top;return U*U+Y*Y>20*20}De(t.scroller,"touchstart",function(f){if(!qe(e,f)&&!s(f)&&!cs(e,f)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},f.touches.length==1&&(t.activeTouch.left=f.touches[0].pageX,t.activeTouch.top=f.touches[0].pageY)}}),De(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),De(t.scroller,"touchend",function(f){var v=t.activeTouch;if(v&&!xr(t,f)&&v.left!=null&&!v.moved&&new Date-v.start<300){var U=e.coordsChar(t.activeTouch,"page"),Y;!v.prev||l(v,v.prev)?Y=new wn(U,U):!v.prev.prev||l(v,v.prev.prev)?Y=e.findWordAt(U):Y=new wn(Qe(U.line,0),o(e.doc,Qe(U.line+1,0))),e.setSelection(Y.anchor,Y.head),e.focus(),x(f)}r()}),De(t.scroller,"touchcancel",r),De(t.scroller,"scroll",function(){t.scroller.clientHeight&&(eo(e,t.scroller.scrollTop),nr(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),De(t.scroller,"mousewheel",function(f){return na(e,f)}),De(t.scroller,"DOMMouseScroll",function(f){return na(e,f)}),De(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(f){qe(e,f)||L(f)},over:function(f){qe(e,f)||(Ml(e,f),L(f))},start:function(f){return Ol(e,f)},drop:ni(e,_l),leave:function(f){qe(e,f)||Hs(e)}};var d=t.input.getField();De(d,"keyup",function(f){return Qs.call(e,f)}),De(d,"keydown",ni(e,Zs)),De(d,"keypress",ni(e,qs)),De(d,"focus",function(f){return Lr(e,f)}),De(d,"blur",function(f){return Zr(e,f)})}var hs=[];Xn.defineInitHook=function(e){return hs.push(e)};function va(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=xe(e,t).state:i="prev");var l=e.options.tabSize,d=_t(r,t),f=ue(d.text,null,l);d.stateAfter&&(d.stateAfter=null);var v=d.text.match(/^\s*/)[0],U;if(!n&&!/\S/.test(d.text))U=0,i="not";else if(i=="smart"&&(U=r.mode.indent(s,d.text.slice(v.length),d.text),U==st||U>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?U=ue(_t(r,t-1).text,null,l):U=0:i=="add"?U=f+e.options.indentUnit:i=="subtract"?U=f-e.options.indentUnit:typeof i=="number"&&(U=f+i),U=Math.max(0,U);var Y="",Ce=0;if(e.options.indentWithTabs)for(var me=Math.floor(U/l);me;--me)Ce+=l,Y+=" ";if(Ce<U&&(Y+=j(U-Ce)),Y!=v)return Do(r,Y,Qe(t,0),Qe(t,v.length),"+input"),d.stateAfter=null,!0;for(var Fe=0;Fe<r.sel.ranges.length;Fe++){var Ye=r.sel.ranges[Fe];if(Ye.head.line==t&&Ye.head.ch<v.length){var at=Qe(t,v.length);rs(r,Fe,new wn(at,at));break}}}var kr=null;function Ha(e){kr=e}function ds(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,d=r=="paste"||e.state.pasteIncoming>l,f=Lt(t),v=null;if(d&&n.ranges.length>1)if(kr&&kr.text.join(`
|
|
`)==t){if(n.ranges.length%kr.text.length==0){v=[];for(var U=0;U<kr.text.length;U++)v.push(s.splitLines(kr.text[U]))}}else f.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(v=Ct(f,function(dt){return[dt]}));for(var Y=e.curOp.updateInput,Ce=n.ranges.length-1;Ce>=0;Ce--){var me=n.ranges[Ce],Fe=me.from(),Ye=me.to();me.empty()&&(i&&i>0?Fe=Qe(Fe.line,Fe.ch-i):e.state.overwrite&&!d?Ye=Qe(Ye.line,Math.min(_t(s,Ye.line).text.length,Ye.ch+et(f).length)):d&&kr&&kr.lineWise&&kr.text.join(`
|
|
`)==f.join(`
|
|
`)&&(Fe=Ye=Qe(Fe.line,0)));var at={from:Fe,to:Ye,text:v?v[Ce%v.length]:f,origin:r||(d?"paste":e.state.cutIncoming>l?"cut":"+input")};Lo(e.doc,at),xn(e,"inputRead",e,at)}t&&!d&&sl(e,t),Qr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Y),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function al(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ni(t,function(){return ds(t,i,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var r=i.ranges[n];if(r.head.ch>100||n&&i.ranges[n-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var d=0;d<s.electricChars.length;d++)if(t.indexOf(s.electricChars.charAt(d))>-1){l=va(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(_t(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=va(e,r.head.line,"smart")));l&&xn(e,"electricInput",e,r.head.line)}}function ll(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,s={anchor:Qe(r,0),head:Qe(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function ul(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return B?e.style.width="1000px":e.setAttribute("wrap","off"),H&&(e.style.border="1px solid black"),ul(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&ni(this,t[n])(this,r,l),je(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,r){this.state.keyMaps[r?"push":"unshift"](Ua(n))},removeKeyMap:function(n){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==n||r[s].name==n)return r.splice(s,1),!0},addOverlay:wi(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");St(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Dn(this)}),removeOverlay:wi(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){r.splice(s,1),this.state.modeGen++,Dn(this);return}}}),indentLine:wi(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),fr(this.doc,n)&&va(this,n,r,s)}),indentSelection:wi(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var d=r[l];if(d.empty())d.head.line>s&&(va(this,d.head.line,n,!0),s=d.head.line,l==this.doc.sel.primIndex&&Qr(this));else{var f=d.from(),v=d.to(),U=Math.max(s,f.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var Y=U;Y<s;++Y)va(this,Y,n);var Ce=this.doc.sel.ranges;f.ch==0&&r.length==Ce.length&&Ce[l].from().ch>0&&rs(this.doc,l,new wn(f,Ce[l].to()),Ue)}}}),getTokenAt:function(n,r){return Sn(this,n,r)},getLineTokens:function(n,r){return Sn(this,Qe(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=We(this,_t(this.doc,n.line)),s=0,l=(r.length-1)/2,d=n.ch,f;if(d==0)f=r[2];else for(;;){var v=s+l>>1;if((v?r[v*2-1]:0)>=d)l=v;else if(r[v*2+1]<d)s=v+1;else{f=r[v*2+2];break}}var U=f?f.indexOf("overlay "):-1;return U<0?f:U==0?null:f.slice(0,U-1)},getModeAt:function(n){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(n).state).mode:r},getHelper:function(n,r){return this.getHelpers(n,r)[0]},getHelpers:function(n,r){var s=[];if(!i.hasOwnProperty(r))return s;var l=i[r],d=this.getModeAt(n);if(typeof d[r]=="string")l[d[r]]&&s.push(l[d[r]]);else if(d[r])for(var f=0;f<d[r].length;f++){var v=l[d[r][f]];v&&s.push(v)}else d.helperType&&l[d.helperType]?s.push(l[d.helperType]):l[d.name]&&s.push(l[d.name]);for(var U=0;U<l._global.length;U++){var Y=l._global[U];Y.pred(d,this)&&Te(s,Y.val)==-1&&s.push(Y.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=h(s,n==null?s.first+s.size-1:n),xe(this,n+1,r).state},cursorCoords:function(n,r){var s,l=this.doc.sel.primary();return n==null?s=l.head:typeof n=="object"?s=o(this.doc,n):s=n?l.from():l.to(),rn(this,s,r||"page")},charCoords:function(n,r){return Fn(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=nn(this,n,r||"page"),sn(this,n.left,n.top)},lineAtHeight:function(n,r){return n=nn(this,{top:n,left:0},r||"page").top,Yi(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,d;if(typeof n=="number"){var f=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>f&&(n=f,l=!0),d=_t(this.doc,n)}else d=n;return dn(this,d,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-Oi(d):0)},defaultTextHeight:function(){return Qn(this.display)},defaultCharWidth:function(){return fi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,d){var f=this.display;n=rn(this,o(this.doc,n));var v=n.bottom,U=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),f.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var Y=Math.max(f.wrapper.clientHeight,this.doc.height),Ce=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>Y)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=Y&&(v=n.bottom),U+r.offsetWidth>Ce&&(U=Ce-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",d=="right"?(U=f.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(d=="left"?U=0:d=="middle"&&(U=(f.sizer.clientWidth-r.offsetWidth)/2),r.style.left=U+"px"),s&&Ea(this,{left:U,top:v,right:U+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:wi(Zs),triggerOnKeyPress:wi(qs),triggerOnKeyUp:Qs,triggerOnMouseDown:wi(el),execCommand:function(n){if(fa.hasOwnProperty(n))return fa[n].call(null,this)},triggerElectric:wi(function(n){sl(this,n)}),findPosH:function(n,r,s,l){var d=1;r<0&&(d=-1,r=-r);for(var f=o(this.doc,n),v=0;v<r&&!(f=fs(this.doc,f,d,s,l),f.hitSide);++v);return f},moveH:wi(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?fs(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},Le)}),deleteH:wi(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):jo(this,function(d){var f=fs(l,d.head,n,r,!1);return n<0?{from:f,to:d.head}:{from:d.head,to:f}})}),findPosV:function(n,r,s,l){var d=1,f=l;r<0&&(d=-1,r=-r);for(var v=o(this.doc,n),U=0;U<r;++U){var Y=rn(this,v,"div");if(f==null?f=Y.left:Y.left=f,v=hl(this,Y,d,s),v.hitSide)break}return v},moveV:wi(function(n,r){var s=this,l=this.doc,d=[],f=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(U){if(f)return n<0?U.from():U.to();var Y=rn(s,U.head,"div");U.goalColumn!=null&&(Y.left=U.goalColumn),d.push(Y.left);var Ce=hl(s,Y,n,r);return r=="page"&&U==l.sel.primary()&&Zo(s,Fn(s,Ce,"div").top-Y.top),Ce},Le),d.length)for(var v=0;v<l.sel.ranges.length;v++)l.sel.ranges[v].goalColumn=d[v]}),findWordAt:function(n){var r=this.doc,s=_t(r,n.line).text,l=n.ch,d=n.ch;if(s){var f=this.getHelper(n,"wordChars");(n.sticky=="before"||d==s.length)&&l?--l:++d;for(var v=s.charAt(l),U=Ge(v,f)?function(Y){return Ge(Y,f)}:/\s/.test(v)?function(Y){return/\s/.test(Y)}:function(Y){return!/\s/.test(Y)&&!Ge(Y)};l>0&&U(s.charAt(l-1));)--l;for(;d<s.length&&U(s.charAt(d));)++d}return new wn(Qe(n.line,l),Qe(n.line,d))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?he(this.display.cursorDiv,"CodeMirror-overwrite"):be(this.display.cursorDiv,"CodeMirror-overwrite"),je(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==K()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:wi(function(n,r){qr(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-oe(this)-this.display.barHeight,width:n.scrollWidth-oe(this)-this.display.barWidth,clientHeight:m(this),clientWidth:I(this)}},scrollIntoView:wi(function(n,r){n==null?(n={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Qe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=r||0,n.from.line!=null?Ya(this,n):co(this,n.from,n.to,n.margin)}),setSize:wi(function(n,r){var s=this,l=function(f){return typeof f=="number"||/^\d+$/.test(String(f))?f+"px":f};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&Kt(this);var d=this.display.viewFrom;this.doc.iter(d,this.display.viewTo,function(f){if(f.widgets){for(var v=0;v<f.widgets.length;v++)if(f.widgets[v].noHScroll){Kn(s,d,"widget");break}}++d}),this.curOp.forceUpdate=!0,je(this,"refresh",this)}),operation:function(n){return Ni(this,n)},startOperation:function(){return Pr(this)},endOperation:function(){return Fr(this)},refresh:wi(function(){var n=this.display.cachedTextHeight;Dn(this),this.curOp.forceUpdate=!0,$t(this),qr(this,this.doc.scrollLeft,this.doc.scrollTop),Oo(this.display),(n==null||Math.abs(n-Qn(this.display))>.5||this.options.lineWrapping)&&Pi(this),je(this,"refresh",this)}),swapDoc:wi(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,n),$t(this),this.display.input.reset(),qr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,xn(this,"swapDoc",this,r),r}),phrase:function(n){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,n)?r[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}},re(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function fs(e,t,i,n,r){var s=t,l=i,d=_t(e,t.line),f=r&&e.direction=="rtl"?-i:i;function v(){var yt=t.line+f;return yt<e.first||yt>=e.first+e.size?!1:(t=new Qe(yt,t.ch,t.sticky),d=_t(e,yt))}function U(yt){var ft;if(n=="codepoint"){var Et=d.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Et)?ft=null:ft=new Qe(t.line,Math.max(0,Math.min(d.text.length,t.ch+i*(Et>=55296&&Et<56320?2:1))),-i)}else r?ft=Pl(e.cm,d,t,i):ft=as(d,t,i);if(ft==null)if(!yt&&v())t=ss(r,e.cm,d,t.line,f);else return!1;else t=ft;return!0}if(n=="char"||n=="codepoint")U();else if(n=="column")U(!0);else if(n=="word"||n=="group")for(var Y=null,Ce=n=="group",me=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(i<0&&!U(!Fe));Fe=!1){var Ye=d.text.charAt(t.ch)||`
|
|
`,at=Ge(Ye,me)?"w":Ce&&Ye==`
|
|
`?"n":!Ce||/\s/.test(Ye)?null:"p";if(Ce&&!Fe&&!at&&(at="s"),Y&&Y!=at){i<0&&(i=1,U(),t.sticky="after");break}if(at&&(Y=at),i>0&&!U(!Fe))break}var dt=Na(e,t,s,l,!0);return Ji(s,dt)&&(dt.hitSide=!0),dt}function hl(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var d=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),f=Math.max(d-.5*Qn(e.display),3);l=(i>0?t.bottom:t.top)+i*f}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var v;!(v=sn(e,s,l),!v.outside);){if(i<0?l<=0:l>=r.height){v.hitSide=!0;break}l+=i*5}return v}var Pn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ie,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Pn.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;ul(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(d){for(var f=d.target;f;f=f.parentNode){if(f==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(f.className))break}return!1}De(r,"paste",function(d){if(!s(d)||qe(n,d)||al(d,n))return;R<=11&&setTimeout(ni(n,function(){return t.updateFromDOM()}),20)}),De(r,"compositionstart",function(d){t.composing={data:d.data,done:!1}}),De(r,"compositionupdate",function(d){t.composing||(t.composing={data:d.data,done:!1})}),De(r,"compositionend",function(d){t.composing&&(d.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),De(r,"touchstart",function(){return i.forceCompositionEnd()}),De(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(d){if(!s(d)||qe(n,d))return;if(n.somethingSelected())Ha({lineWise:!1,text:n.getSelections()}),d.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var f=ll(n);Ha({lineWise:!0,text:f.text}),d.type=="cut"&&n.operation(function(){n.setSelections(f.ranges,0,Ue),n.replaceSelection("",null,"cut")})}else return;if(d.clipboardData){d.clipboardData.clearData();var v=kr.text.join(`
|
|
`);if(d.clipboardData.setData("Text",v),d.clipboardData.getData("Text")==v){d.preventDefault();return}}var U=cl(),Y=U.firstChild;n.display.lineSpace.insertBefore(U,n.display.lineSpace.firstChild),Y.value=kr.text.join(`
|
|
`);var Ce=document.activeElement;Re(Y),setTimeout(function(){n.display.lineSpace.removeChild(U),Ce.focus(),Ce==r&&i.showPrimarySelection()},50)}De(r,"copy",l),De(r,"cut",l)},Pn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Pn.prototype.prepareSelection=function(){var e=hr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Pn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Pn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Pn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),r=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||r.line<t.display.viewFrom){e.removeAllRanges();return}var s=za(t,e.anchorNode,e.anchorOffset),l=za(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&Ft(gr(s,l),n)==0&&Ft(mr(s,l),r)==0)return;var d=t.display.view,f=n.line>=t.display.viewFrom&&dl(t,n)||{node:d[0].measure.map[2],offset:0},v=r.line<t.display.viewTo&&dl(t,r);if(!v){var U=d[d.length-1].measure,Y=U.maps?U.maps[U.maps.length-1]:U.map;v={node:Y[Y.length-1],offset:Y[Y.length-2]-Y[Y.length-3]}}if(!f||!v){e.removeAllRanges();return}var Ce=e.rangeCount&&e.getRangeAt(0),me;try{me=ye(f.node,f.offset,v.offset,v.node)}catch(Fe){}me&&(!G&&t.state.focused?(e.collapse(f.node,f.offset),me.collapsed||(e.removeAllRanges(),e.addRange(me))):(e.removeAllRanges(),e.addRange(me)),Ce&&e.anchorNode==null?e.addRange(Ce):G&&this.startGracePeriod()),this.rememberSelection()},Pn.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)},Pn.prototype.showMultipleSelections=function(e){we(this.cm.display.cursorDiv,e.cursors),we(this.cm.display.selectionDiv,e.selection)},Pn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Pn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return k(this.div,t)},Pn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Pn.prototype.blur=function(){this.div.blur()},Pn.prototype.getField=function(){return this.div},Pn.prototype.supportsTouch=function(){return!0},Pn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ni(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)},Pn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Pn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(P&&D&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=za(t,e.anchorNode,e.anchorOffset),n=za(t,e.focusNode,e.focusOffset);i&&n&&Ni(t,function(){Ti(t.doc,Er(i,n),Ue),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Pn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),r=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Qe(n.line-1,_t(e.doc,n.line-1).length)),r.ch==_t(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Qe(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,d;n.line==t.viewFrom||(s=jn(e,n.line))==0?(l=ln(t.view[0].line),d=t.view[0].node):(l=ln(t.view[s].line),d=t.view[s-1].node.nextSibling);var f=jn(e,r.line),v,U;if(f==t.view.length-1?(v=t.viewTo-1,U=t.lineDiv.lastChild):(v=ln(t.view[f+1].line)-1,U=t.view[f+1].node.previousSibling),!d)return!1;for(var Y=e.doc.splitLines(tu(e,d,U,l,v)),Ce=Fi(e.doc,Qe(l,0),Qe(v,_t(e.doc,v).text.length));Y.length>1&&Ce.length>1;)if(et(Y)==et(Ce))Y.pop(),Ce.pop(),v--;else if(Y[0]==Ce[0])Y.shift(),Ce.shift(),l++;else break;for(var me=0,Fe=0,Ye=Y[0],at=Ce[0],dt=Math.min(Ye.length,at.length);me<dt&&Ye.charCodeAt(me)==at.charCodeAt(me);)++me;for(var yt=et(Y),ft=et(Ce),Et=Math.min(yt.length-(Y.length==1?me:0),ft.length-(Ce.length==1?me:0));Fe<Et&&yt.charCodeAt(yt.length-Fe-1)==ft.charCodeAt(ft.length-Fe-1);)++Fe;if(Y.length==1&&Ce.length==1&&l==n.line)for(;me&&me>n.ch&&yt.charCodeAt(yt.length-Fe-1)==ft.charCodeAt(ft.length-Fe-1);)me--,Fe++;Y[Y.length-1]=yt.slice(0,yt.length-Fe).replace(/^\u200b+/,""),Y[0]=Y[0].slice(me).replace(/\u200b+$/,"");var Vt=Qe(l,me),jt=Qe(v,Ce.length?et(Ce).length-Fe:0);if(Y.length>1||Y[0]||Ft(Vt,jt))return Do(e.doc,Y,Vt,jt,"+input"),!0},Pn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Pn.prototype.reset=function(){this.forceCompositionEnd()},Pn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Pn.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)},Pn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ni(this.cm,function(){return Dn(e.cm)})},Pn.prototype.setUneditable=function(e){e.contentEditable="false"},Pn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ni(this.cm,ds)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Pn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Pn.prototype.onContextMenu=function(){},Pn.prototype.resetPosition=function(){},Pn.prototype.needsContentAttribute=!0;function dl(e,t){var i=le(e,t.line);if(!i||i.hidden)return null;var n=_t(e.doc,t.line),r=b(i,n,t.line),s=xt(n,e.doc.direction),l="left";if(s){var d=ut(s,t.ch);l=d%2?"right":"left"}var f=ot(r.map,t.ch,l);return f.offset=f.collapse=="right"?f.end:f.start,f}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Uo(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,d=e.doc.lineSeparator(),f=!1;function v(me){return function(Fe){return Fe.id==me}}function U(){l&&(s+=d,f&&(s+=d),l=f=!1)}function Y(me){me&&(U(),s+=me)}function Ce(me){if(me.nodeType==1){var Fe=me.getAttribute("cm-text");if(Fe){Y(Fe);return}var Ye=me.getAttribute("cm-marker"),at;if(Ye){var dt=e.findMarks(Qe(n,0),Qe(r+1,0),v(+Ye));dt.length&&(at=dt[0].find(0))&&Y(Fi(e.doc,at.from,at.to).join(d));return}if(me.getAttribute("contenteditable")=="false")return;var yt=/^(pre|div|p|li|table|br)$/i.test(me.nodeName);if(!/^br$/i.test(me.nodeName)&&me.textContent.length==0)return;yt&&U();for(var ft=0;ft<me.childNodes.length;ft++)Ce(me.childNodes[ft]);/^(pre|p)$/i.test(me.nodeName)&&(f=!0),yt&&(l=!0)}else me.nodeType==3&&Y(me.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ce(t),t==i);)t=t.nextSibling,f=!1;return s}function za(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return Uo(e.clipPos(Qe(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,r=!1;if(!t||!k(n,t))return Uo(Qe(ln(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?et(e.rest):e.line;return Uo(Qe(ln(s),s.text.length),r)}var l=t.nodeType==3?t:null,d=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));d.parentNode!=n;)d=d.parentNode;var f=e.measure,v=f.maps;function U(at,dt,yt){for(var ft=-1;ft<(v?v.length:0);ft++)for(var Et=ft<0?f.map:v[ft],Vt=0;Vt<Et.length;Vt+=3){var jt=Et[Vt+2];if(jt==at||jt==dt){var en=ln(ft<0?e.line:e.rest[ft]),In=Et[Vt]+yt;return(yt<0||jt!=at)&&(In=Et[Vt+(yt?1:0)]),Qe(en,In)}}}var Y=U(l,d,i);if(Y)return Uo(Y,r);for(var Ce=d.nextSibling,me=l?l.nodeValue.length-i:0;Ce;Ce=Ce.nextSibling){if(Y=U(Ce,Ce.firstChild,0),Y)return Uo(Qe(Y.line,Y.ch-me),r);me+=Ce.textContent.length}for(var Fe=d.previousSibling,Ye=i;Fe;Fe=Fe.previousSibling){if(Y=U(Fe,Fe.firstChild,-1),Y)return Uo(Qe(Y.line,Y.ch+Ye),r);Ye+=Fe.textContent.length}}var ri=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ie,this.hasSelection=!1,this.composing=null};ri.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var r=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),H&&(r.style.width="0px"),De(r,"input",function(){E&&R>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),De(r,"paste",function(l){if(qe(n,l)||al(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(qe(n,l))return;if(n.somethingSelected())Ha({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var d=ll(n);Ha({lineWise:!0,text:d.text}),l.type=="cut"?n.setSelections(d.ranges,null,Ue):(i.prevInput="",r.value=d.text.join(`
|
|
`),Re(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}De(r,"cut",s),De(r,"copy",s),De(e.scroller,"paste",function(l){if(xr(e,l)||qe(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var d=new Event("paste");d.clipboardData=l.clipboardData,r.dispatchEvent(d)}),De(e.lineSpace,"selectstart",function(l){xr(e,l)||x(l)}),De(r,"compositionstart",function(){var l=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),De(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ri.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},ri.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ri.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=hr(e);if(e.options.moveInputWithCursor){var r=rn(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return n},ri.prototype.showSelection=function(e){var t=this.cm,i=t.display;we(i.cursorDiv,e.cursors),we(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ri.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Re(this.textarea),E&&R>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",E&&R>=9&&(this.hasSelection=null))},ri.prototype.getField=function(){return this.textarea},ri.prototype.supportsTouch=function(){return!1},ri.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ie||K()!=this.textarea))try{this.textarea.focus()}catch(e){}},ri.prototype.blur=function(){this.textarea.blur()},ri.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ri.prototype.receivedFocus=function(){this.slowPoll()},ri.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()})},ri.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},ri.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ht(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=i.value;if(r==n&&!t.somethingSelected())return!1;if(E&&R>=9&&this.hasSelection===r||se&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,d=Math.min(n.length,r.length);l<d&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return Ni(t,function(){ds(t,r.slice(l),n.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ri.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ri.prototype.onKeyPress=function(){E&&R>=9&&(this.hasSelection=null),this.fastPoll()},ri.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=pi(i,e),l=n.scroller.scrollTop;if(!s||O)return;var d=i.options.resetSelectionOnContextMenu;d&&i.doc.sel.contains(s)==-1&&ni(i,Ti)(i.doc,Er(s),Ue);var f=r.style.cssText,v=t.wrapper.style.cssText,U=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-U.top-5)+"px; left: "+(e.clientX-U.left-5)+`px;
|
|
z-index: 1000; background: `+(E?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Y;B&&(Y=window.scrollY),n.input.focus(),B&&window.scrollTo(null,Y),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=me,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Ce(){if(r.selectionStart!=null){var Ye=i.somethingSelected(),at="\u200B"+(Ye?r.value:"");r.value="\u21DA",r.value=at,t.prevInput=Ye?"":"\u200B",r.selectionStart=1,r.selectionEnd=at.length,n.selForContextMenu=i.doc.sel}}function me(){if(t.contextMenuPending!=me)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=f,E&&R<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!E||E&&R<9)&&Ce();var Ye=0,at=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?ni(i,As)(i):Ye++<10?n.detectingSelectAll=setTimeout(at,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(at,200)}}if(E&&R>=9&&Ce(),Ve){L(e);var Fe=function(){vt(window,"mouseup",Fe),setTimeout(me,20)};De(window,"mouseup",Fe)}else setTimeout(me,50)},ri.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ri.prototype.setUneditable=function(){},ri.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?g(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=K();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=d.getValue()}var r;if(e.form&&(De(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(f){}}t.finishInit=function(f){f.save=n,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,n(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(vt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var d=Xn(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return d}function ru(e){e.off=vt,e.on=De,e.wheelEventPixels=ta,e.Doc=Gi,e.splitLines=Lt,e.countColumn=ue,e.findColumn=Be,e.isWordChar=Ae,e.Pass=st,e.signal=je,e.Line=Mr,e.changeEnd=Sr,e.scrollbarModel=Qo,e.Pos=Qe,e.cmpPos=Ft,e.modes=vn,e.mimeModes=Bt,e.resolveMode=Tt,e.getMode=di,e.modeExtensions=oi,e.extendMode=ai,e.copyState=Si,e.startState=Bi,e.innerMode=or,e.commands=fa,e.keyMap=Wr,e.keyName=Ks,e.isModifierKey=Vs,e.lookupKey=No,e.normalizeKeyMap=Dl,e.StringStream=pn,e.SharedTextMarker=ca,e.TextMarker=ro,e.LineWidget=ua,e.e_preventDefault=x,e.e_stopPropagation=w,e.e_stop=L,e.addClass=he,e.contains=k,e.rmClass=be,e.keyNames=oo}Yl(Xn),ql(Xn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Wa in Gi.prototype)Gi.prototype.hasOwnProperty(Wa)&&Te(ou,Wa)<0&&(Xn.prototype[Wa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Gi.prototype[Wa]));return re(Gi),Xn.inputStyles={textarea:ri,contenteditable:Pn},Xn.defineMode=function(e){!Xn.defaults.mode&&e!="null"&&(Xn.defaults.mode=e),Wn.apply(this,arguments)},Xn.defineMIME=Bn,Xn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Xn.defineMIME("text/plain","null"),Xn.defineExtension=function(e,t){Xn.prototype[e]=t},Xn.defineDocExtension=function(e,t){Gi.prototype[e]=t},Xn.fromTextArea=iu,ru(Xn),Xn.version="5.58.2",Xn})},Y1PL:function(mt,Ze,y){"use strict";y.r(Ze),y.d(Ze,"ResizableTextArea",function(){return Te});var S=y("wx14"),de=y("1OyB"),G=y("vuIU"),z=y("Ji7U"),C=y("LK+K"),ee=y("q1tI"),E=y("VTBJ"),R=y("rePB"),B=y("Zm9Q"),X=y("Kwbf"),D=y("c+Xe"),O=y("m+aA"),te=y("bdgK"),Q=new Map;function W(Ue){Ue.forEach(function(He){var Le,Be=He.target;(Le=Q.get(Be))===null||Le===void 0||Le.forEach(function(ce){return ce(Be)})})}var H=new te.default(W),P=null,ie=null;function se(Ue,He){Q.has(Ue)||(Q.set(Ue,new Set),H.observe(Ue)),Q.get(Ue).add(He)}function Oe(Ue,He){Q.has(Ue)&&(Q.get(Ue).delete(He),Q.get(Ue).size||(H.unobserve(Ue),Q.delete(Ue)))}var Ke=function(Ue){Object(z.a)(Le,Ue);var He=Object(C.a)(Le);function Le(){return Object(de.a)(this,Le),He.apply(this,arguments)}return Object(G.a)(Le,[{key:"render",value:function(){return this.props.children}}]),Le}(ee.Component),ge=ee.createContext(null);function Me(Ue){var He=Ue.children,Le=Ue.onBatchResize,Be=ee.useRef(0),ce=ee.useRef([]),j=ee.useContext(ge),et=ee.useCallback(function(Ct,St,ze){Be.current+=1;var pt=Be.current;ce.current.push({size:Ct,element:St,data:ze}),Promise.resolve().then(function(){pt===Be.current&&(Le==null||Le(ce.current),ce.current=[])}),j==null||j(Ct,St,ze)},[Le,j]);return ee.createElement(ge.Provider,{value:et},He)}function Ve(Ue){var He=Ue.children,Le=Ue.disabled,Be=ee.useRef(null),ce=ee.useRef(null),j=ee.useContext(ge),et=ee.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ct=ee.isValidElement(He)&&Object(D.c)(He),St=Ct?He.ref:null,ze=ee.useMemo(function(){return Object(D.a)(St,Be)},[St,Be]),pt=ee.useRef(Ue);pt.current=Ue;var fe=ee.useCallback(function(Ae){var Ge=pt.current,Se=Ge.onResize,rt=Ge.data,tt=Ae.getBoundingClientRect(),lt=tt.width,It=tt.height,wt=Ae.offsetWidth,bt=Ae.offsetHeight,ut=Math.floor(lt),Rt=Math.floor(It);if(et.current.width!==ut||et.current.height!==Rt||et.current.offsetWidth!==wt||et.current.offsetHeight!==bt){var xt={width:ut,height:Rt,offsetWidth:wt,offsetHeight:bt};et.current=xt;var gt=wt===Math.round(lt)?lt:wt,De=bt===Math.round(It)?It:bt,Dt=Object(E.a)(Object(E.a)({},xt),{},{offsetWidth:gt,offsetHeight:De});j==null||j(Dt,Ae,rt),Se&&Promise.resolve().then(function(){Se(Dt,Ae)})}},[]);return ee.useEffect(function(){var Ae=Object(O.a)(Be.current)||Object(O.a)(ce.current);return Ae&&!Le&&se(Ae,fe),function(){return Oe(Ae,fe)}},[Be.current,Le]),ee.createElement(Ke,{ref:ce},Ct?ee.cloneElement(He,{ref:ze}):He)}var _e="rc-observer-key";function be(Ue){var He=Ue.children,Le=Object(B.a)(He);return Le.map(function(Be,ce){var j=(Be==null?void 0:Be.key)||"".concat(_e,"-").concat(ce);return ee.createElement(Ve,Object(S.a)({},Ue,{key:j}),Be)})}be.Collection=Me;var Ne=be,we=y("bT9E"),N=y("TSYQ"),Ee=y.n(N),ye=`
|
|
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
|
|
`,k=["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"],K={},he;function $(Ue){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=Ue.getAttribute("id")||Ue.getAttribute("data-reactid")||Ue.getAttribute("name");if(He&&K[Le])return K[Le];var Be=window.getComputedStyle(Ue),ce=Be.getPropertyValue("box-sizing")||Be.getPropertyValue("-moz-box-sizing")||Be.getPropertyValue("-webkit-box-sizing"),j=parseFloat(Be.getPropertyValue("padding-bottom"))+parseFloat(Be.getPropertyValue("padding-top")),et=parseFloat(Be.getPropertyValue("border-bottom-width"))+parseFloat(Be.getPropertyValue("border-top-width")),Ct=k.map(function(ze){return"".concat(ze,":").concat(Be.getPropertyValue(ze))}).join(";"),St={sizingStyle:Ct,paddingSize:j,borderSize:et,boxSizing:ce};return He&&Le&&(K[Le]=St),St}function Re(Ue){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Be=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;he||(he=document.createElement("textarea"),he.setAttribute("tab-index","-1"),he.setAttribute("aria-hidden","true"),document.body.appendChild(he)),Ue.getAttribute("wrap")?he.setAttribute("wrap",Ue.getAttribute("wrap")):he.removeAttribute("wrap");var ce=$(Ue,He),j=ce.paddingSize,et=ce.borderSize,Ct=ce.boxSizing,St=ce.sizingStyle;he.setAttribute("style","".concat(St,";").concat(ye)),he.value=Ue.value||Ue.placeholder||"";var ze=Number.MIN_SAFE_INTEGER,pt=Number.MAX_SAFE_INTEGER,fe=he.scrollHeight,Ae;if(Ct==="border-box"?fe+=et:Ct==="content-box"&&(fe-=j),Le!==null||Be!==null){he.value=" ";var Ge=he.scrollHeight-j;Le!==null&&(ze=Ge*Le,Ct==="border-box"&&(ze=ze+j+et),fe=Math.max(ze,fe)),Be!==null&&(pt=Ge*Be,Ct==="border-box"&&(pt=pt+j+et),Ae=fe>pt?"":"hidden",fe=Math.min(pt,fe))}return{height:fe,minHeight:ze,maxHeight:pt,overflowY:Ae,resize:"none"}}var M=y("Gytx"),g=y.n(M),ue;(function(Ue){Ue[Ue.NONE=0]="NONE",Ue[Ue.RESIZING=1]="RESIZING",Ue[Ue.RESIZED=2]="RESIZED"})(ue||(ue={}));var Ie=function(Ue){Object(z.a)(Le,Ue);var He=Object(C.a)(Le);function Le(Be){var ce;return Object(de.a)(this,Le),ce=He.call(this,Be),ce.nextFrameActionId=void 0,ce.resizeFrameId=void 0,ce.textArea=void 0,ce.saveTextArea=function(j){ce.textArea=j},ce.handleResize=function(j){var et=ce.state.resizeStatus,Ct=ce.props,St=Ct.autoSize,ze=Ct.onResize;if(et!==ue.NONE)return;typeof ze=="function"&&ze(j),St&&ce.resizeOnNextFrame()},ce.resizeOnNextFrame=function(){cancelAnimationFrame(ce.nextFrameActionId),ce.nextFrameActionId=requestAnimationFrame(ce.resizeTextarea)},ce.resizeTextarea=function(){var j=ce.props.autoSize;if(!j||!ce.textArea)return;var et=j.minRows,Ct=j.maxRows,St=Re(ce.textArea,!1,et,Ct);ce.setState({textareaStyles:St,resizeStatus:ue.RESIZING},function(){cancelAnimationFrame(ce.resizeFrameId),ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:ue.RESIZED},function(){ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:ue.NONE}),ce.fixFirefoxAutoScroll()})})})})},ce.renderTextArea=function(){var j=ce.props,et=j.prefixCls,Ct=et===void 0?"rc-textarea":et,St=j.autoSize,ze=j.onResize,pt=j.className,fe=j.disabled,Ae=ce.state,Ge=Ae.textareaStyles,Se=Ae.resizeStatus,rt=Object(we.a)(ce.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),tt=Ee()(Ct,pt,Object(R.a)({},"".concat(Ct,"-disabled"),fe));"value"in rt&&(rt.value=rt.value||"");var lt=Object(E.a)(Object(E.a)(Object(E.a)({},ce.props.style),Ge),Se===ue.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return ee.createElement(Ne,{onResize:ce.handleResize,disabled:!(St||ze)},ee.createElement("textarea",Object(S.a)({},rt,{className:tt,style:lt,ref:ce.saveTextArea})))},ce.state={textareaStyles:{},resizeStatus:ue.NONE},ce}return Object(G.a)(Le,[{key:"componentDidUpdate",value:function(ce){(ce.value!==this.props.value||!g()(ce.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 ce=this.textArea.selectionStart,j=this.textArea.selectionEnd;this.textArea.setSelectionRange(ce,j)}}catch(et){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Le}(ee.Component),Te=Ie,nt=function(Ue){Object(z.a)(Le,Ue);var He=Object(C.a)(Le);function Le(Be){var ce;Object(de.a)(this,Le),ce=He.call(this,Be),ce.resizableTextArea=void 0,ce.focus=function(){ce.resizableTextArea.textArea.focus()},ce.saveTextArea=function(et){ce.resizableTextArea=et},ce.handleChange=function(et){var Ct=ce.props.onChange;ce.setValue(et.target.value,function(){ce.resizableTextArea.resizeTextarea()}),Ct&&Ct(et)},ce.handleKeyDown=function(et){var Ct=ce.props,St=Ct.onPressEnter,ze=Ct.onKeyDown;et.keyCode===13&&St&&St(et),ze&&ze(et)};var j=typeof Be.value=="undefined"||Be.value===null?Be.defaultValue:Be.value;return ce.state={value:j},ce}return Object(G.a)(Le,[{key:"setValue",value:function(ce,j){"value"in this.props||this.setState({value:ce},j)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return ee.createElement(Te,Object(S.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ce){return"value"in ce?{value:ce.value}:null}}]),Le}(ee.Component),st=Ze.default=nt},ZW9T:function(mt,Ze,y){"use strict";y.d(Ze,"a",function(){return Ke});var S=y("k1fw"),de=y("miYZ"),G=y("tsqr"),z=y("rAM+"),C=y("tJVT"),ee=y("PpiC"),E=y("q1tI"),R=y.n(E),B=y("bdgK");function X(ge,Me,Ve,_e,be){var Ne=Me.getWordUntilPosition(Ve),we={startLineNumber:Ve.lineNumber,endLineNumber:Ve.lineNumber,startColumn:Ne.startColumn,endColumn:Ne.endColumn},N=_e.map(function(Ee){return{label:Ee,kind:ge.languages.CompletionItemKind.Keyword,insertText:Ee,insertTextRules:ge.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}});return be.map(function(Ee){N.push(Object(S.a)(Object(S.a)({},Ee),{},{range:we}))}),N}var D=function(ge){var Me={label:"ifelse",kind:ge.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:ge.languages.CompletionItemInsertTextRule.InsertAsSnippet},Ve=["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"];ge.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(we,N){var Ee=X(ge,we,N,Ve,[Me]);return{suggestions:Ee}}});var _e=["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"];ge.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(we,N){var Ee=[{label:"print",kind:ge.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:ge.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ye=X(ge,we,N,_e,Ee);return{suggestions:ye}}});var be=["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"];ge.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(we,N){var Ee=[Me,{label:"main",kind:ge.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:ge.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:ge.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:ge.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ye=X(ge,we,N,be,Ee);return{suggestions:ye}}})},O="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",te=y("LvDl");function Q(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}function W(){}var H=!1,P={"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 ie(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Me=ge;if(Array.isArray(ge)){for(var Ve=0;Ve<ge.length;Ve++){var _e=P[ge[Ve]];if(_e)return _e}return Me[0]}return P[Me]||Me}var se=null,Oe=Ze.b=function(ge){var Me=ge.width,Ve=Me===void 0?"100%":Me,_e=ge.height,be=_e===void 0?"100%":_e,Ne=ge.value,we=ge.language,N=we===void 0?"javascript":we,Ee=ge.style,ye=Ee===void 0?{}:Ee,k=ge.options,K=k===void 0?{}:k,he=ge.overrideServices,$=he===void 0?{}:he,Re=ge.theme,M=Re===void 0?"vs-dark":Re,g=ge.onEditBlur,ue=ge.onSave,Ie=ge.autoHeight,Te=Ie===void 0?!1:Ie,nt=ge.forbidCopy,st=nt===void 0?!1:nt,Ue=ge.onChange,He=Ue===void 0?W:Ue,Le=ge.editorDidMount,Be=Le===void 0?W:Le,ce=ge.onFocus,j=ce===void 0?W:ce,et=ge.filename,Ct=et===void 0?"educoder.txt":et,St=Object(ee.a)(ge,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ze=Object(E.useRef)(),pt=Object(E.useRef)({}),fe=Object(E.useRef)(),Ae=Object(E.useRef)(!1),Ge=Object(E.useRef)(),Se=Object(E.useState)(!1),rt=Object(C.a)(Se,2),tt=rt[0],lt=rt[1];function It(){var T;return ze.current&&(T=new B.default(function(L){var pe=Object(z.a)(L),ke;try{for(pe.s();!(ke=pe.n()).done;){var Je=ke.value;(Je.target.offsetHeight>0||Je.target.offsetWidth>0)&&pt.current.instance.layout()}}catch(Mt){pe.e(Mt)}finally{pe.f()}}),T.observe(ze.current)),T}function wt(){G.b.warn(decodeURIComponent(O))}var bt=function(){var L=pt.current.instance;if(Ne!=null&&L&&tt){var pe=L.getModel();pe&&Ne!==pe.getValue()&&(H=!0,pe.setValue(Ne),L.layout(),H=!1)}};Object(E.useEffect)(function(){fe.current&&clearTimeout(fe.current),fe.current=setTimeout(function(){bt()},500)},[Ne,tt,pt.current]);function ut(){var T=pt.current.instance;if(T){var L=T.getSelection(),pe=pt.current.pastePos||{},ke=new se.Range(pe.startLineNumber||L.endLineNumber,pe.startColumn||L.endColumn,pe.endLineNumber||L.endLineNumber,pe.endColumn||L.endColumn);setTimeout(function(){T.executeEdits("",[{range:ke,text:""}])},300)}}function Rt(T){(window.navigator.platform.match("Mac")?T.metaKey:T.ctrlKey)&&T.keyCode==83&&(T.preventDefault(),ue())}var xt=function(){if(Te&&pt.current.instance){var L=pt.current.instance.getContentHeight();x(L<be?be:L)}else x(be)};function gt(T){var L=document.createEvent("MouseEvents");L.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),T.dispatchEvent(L)}function De(T,L){var pe=window.URL||window.webkitURL||window,ke=new Blob([L]),Je=document.createElementNS("http://www.w3.org/1999/xhtml","a");Je.href=pe.createObjectURL(ke),Je.download=T,gt(Je)}Object(E.useEffect)(function(){xt()},[xt]),Object(E.useEffect)(function(){ze.current&&!tt&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(T){try{se=T,pt.current.instance=se.editor.create(ze.current,{value:Ne,language:ie(N),theme:M,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},$);var L=pt.current.instance;if(Be(L,se),setTimeout(function(){xt(),pt.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){De(Ct||"educoder.txt",L.getValue())}})},500),pt.current.subscription=L.onDidChangeModelContent(function(ke){Ae.current?clearTimeout(Ge.current):(xt(),He(L.getValue(),ke)),Ge.current=setTimeout(function(){Ae.current=!1},500)}),window.Monaco||D(se),st&&(L.addCommand(se.KeyMod.CtrlCmd|se.KeyMod.Shift|se.KeyCode.KEY_V,function(){return wt(),null}),L.addCommand(se.KeyMod.CtrlCmd|se.KeyCode.KEY_C,function(){return wt(),null})),window.Monaco=se,g&&L.onDidBlurEditorWidget(function(){g(L.getValue())}),j&&L.onDidFocusEditorText(function(){j(L.getValue())}),st){L.addCommand(se.KeyMod.CtrlCmd|se.KeyCode.KEY_V,function(){return wt(),null}),L.onDidPaste(function(ke){pt.current.pastePos=ke});try{window.addEventListener("paste",ut)}catch(ke){}}var pe=It();return lt(!0),function(){var ke=pt.current.instance;ke.dispose();var Je=ke.getModel();Je&&Je.dispose(),pt.current.subscription&&pt.current.subscription.dispose(),st&&window.removeEventListener("paste",ut),pe.unobserve(ze.current)}}catch(ke){}})},[]),Object(E.useEffect)(function(){var T=pt.current.instance;if(T&&tt)return document.addEventListener("keydown",Rt,!1),function(){document.removeEventListener("keydown",Rt)}},[ue,tt]),Object(E.useEffect)(function(){var T=pt.current.instance;if(T&&tt){var L=ie(N);se.editor.setModelLanguage(T.getModel(),L),console.log("language:",N,T.getModel(),L)}},[N,tt]),Object(E.useEffect)(function(){var T=pt.current.instance;T&&tt&&se.editor.setTheme(M)},[M,tt]),Object(E.useEffect)(function(){var T=pt.current.instance;T&&tt&&(T.updateOptions(Object(S.a)({},K)),setTimeout(function(){T.getModel().updateOptions(Object(S.a)({},K))},200))},[JSON.stringify(K),tt]),Object(E.useEffect)(function(){var T=pt.current.instance;T&&tt&&T.layout()},[Ve,be,tt]);var Dt=Object(E.useState)(Q(Ve)),vt=Object(C.a)(Dt,2),je=vt[0],qe=vt[1],ae=Object(E.useState)(Q(be)),Z=Object(C.a)(ae,2),re=Z[0],x=Z[1],w=Object(S.a)(Object(S.a)({},ye),{},{width:je,height:re});return R.a.createElement("div",{className:"my-monaco-editor",ref:ze,style:w})};function Ke(ge){var Me=ge.width,Ve=Me===void 0?"100%":Me,_e=ge.height,be=_e===void 0?"100%":_e,Ne=ge.original,we=ge.modified,N=ge.language,Ee=ge.options,ye=Ee===void 0?{}:Ee,k=Object(E.useRef)(),K=Object(E.useState)(null),he=Object(C.a)(K,2),$=he[0],Re=he[1];function M(Te){var nt;return k.current&&(nt=new B.default(function(st){var Ue=Object(z.a)(st),He;try{for(Ue.s();!(He=Ue.n()).done;){var Le=He.value;(Le.target.offsetHeight>0||Le.target.offsetWidth>0)&&Te.layout()}}catch(Be){Ue.e(Be)}finally{Ue.f()}}),nt.observe(k.current)),nt}Object(E.useEffect)(function(){k.current&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(Te){se=Te;var nt=se.editor.createDiffEditor(k.current,Object(S.a)(Object(S.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},ye),{},{wordWrap:!0}));Re(nt);var st=M(nt);return function(){nt.dispose();var Ue=nt.getModel();Ue&&Ue.dispose(),st.unobserve(k.current)}})},[]),Object(E.useEffect)(function(){$&&$.setModel({original:se.editor.createModel(Ne,N),modified:se.editor.createModel(we,N)})},[Ne,we,N,$]);var g=Q(Ve),ue=Q(be),Ie={width:g,height:ue};return R.a.createElement("div",{className:"my-diff-editor",ref:k,style:Ie})}},ZpRC:function(mt,Ze,y){"use strict";function S(D){return typeof D=="object"&&D!=null&&D.nodeType===1}function de(D,O){return(!O||D!=="hidden")&&D!=="visible"&&D!=="clip"}function G(D,O){if(D.clientHeight<D.scrollHeight||D.clientWidth<D.scrollWidth){var te=getComputedStyle(D,null);return de(te.overflowY,O)||de(te.overflowX,O)||function(Q){var W=function(H){if(!H.ownerDocument||!H.ownerDocument.defaultView)return null;try{return H.ownerDocument.defaultView.frameElement}catch(P){return null}}(Q);return!!W&&(W.clientHeight<Q.scrollHeight||W.clientWidth<Q.scrollWidth)}(D)}return!1}function z(D,O,te,Q,W,H,P,ie){return H<D&&P>O||H>D&&P<O?0:H<=D&&ie<=te||P>=O&&ie>=te?H-D-Q:P>O&&ie<te||H<D&&ie>te?P-O+W:0}var C=function(D,O){var te=window,Q=O.scrollMode,W=O.block,H=O.inline,P=O.boundary,ie=O.skipOverflowHiddenElements,se=typeof P=="function"?P:function(Ge){return Ge!==P};if(!S(D))throw new TypeError("Invalid target");for(var Oe=document.scrollingElement||document.documentElement,Ke=[],ge=D;S(ge)&&se(ge);){if((ge=ge.parentElement)===Oe){Ke.push(ge);break}ge!=null&&ge===document.body&&G(ge)&&!G(document.documentElement)||ge!=null&&G(ge,ie)&&Ke.push(ge)}for(var Me=te.visualViewport?te.visualViewport.width:innerWidth,Ve=te.visualViewport?te.visualViewport.height:innerHeight,_e=window.scrollX||pageXOffset,be=window.scrollY||pageYOffset,Ne=D.getBoundingClientRect(),we=Ne.height,N=Ne.width,Ee=Ne.top,ye=Ne.right,k=Ne.bottom,K=Ne.left,he=W==="start"||W==="nearest"?Ee:W==="end"?k:Ee+we/2,$=H==="center"?K+N/2:H==="end"?ye:K,Re=[],M=0;M<Ke.length;M++){var g=Ke[M],ue=g.getBoundingClientRect(),Ie=ue.height,Te=ue.width,nt=ue.top,st=ue.right,Ue=ue.bottom,He=ue.left;if(Q==="if-needed"&&Ee>=0&&K>=0&&k<=Ve&&ye<=Me&&Ee>=nt&&k<=Ue&&K>=He&&ye<=st)return Re;var Le=getComputedStyle(g),Be=parseInt(Le.borderLeftWidth,10),ce=parseInt(Le.borderTopWidth,10),j=parseInt(Le.borderRightWidth,10),et=parseInt(Le.borderBottomWidth,10),Ct=0,St=0,ze="offsetWidth"in g?g.offsetWidth-g.clientWidth-Be-j:0,pt="offsetHeight"in g?g.offsetHeight-g.clientHeight-ce-et:0;if(Oe===g)Ct=W==="start"?he:W==="end"?he-Ve:W==="nearest"?z(be,be+Ve,Ve,ce,et,be+he,be+he+we,we):he-Ve/2,St=H==="start"?$:H==="center"?$-Me/2:H==="end"?$-Me:z(_e,_e+Me,Me,Be,j,_e+$,_e+$+N,N),Ct=Math.max(0,Ct+be),St=Math.max(0,St+_e);else{Ct=W==="start"?he-nt-ce:W==="end"?he-Ue+et+pt:W==="nearest"?z(nt,Ue,Ie,ce,et+pt,he,he+we,we):he-(nt+Ie/2)+pt/2,St=H==="start"?$-He-Be:H==="center"?$-(He+Te/2)+ze/2:H==="end"?$-st+j+ze:z(He,st,Te,Be,j+ze,$,$+N,N);var fe=g.scrollLeft,Ae=g.scrollTop;he+=Ae-(Ct=Math.max(0,Math.min(Ae+Ct,g.scrollHeight-Ie+pt))),$+=fe-(St=Math.max(0,Math.min(fe+St,g.scrollWidth-Te+ze)))}Re.push({el:g,top:Ct,left:St})}return Re};function ee(D){return D===Object(D)&&Object.keys(D).length!==0}function E(D,O){O===void 0&&(O="auto");var te="scrollBehavior"in document.body.style;D.forEach(function(Q){var W=Q.el,H=Q.top,P=Q.left;W.scroll&&te?W.scroll({top:H,left:P,behavior:O}):(W.scrollTop=H,W.scrollLeft=P)})}function R(D){return D===!1?{block:"end",inline:"nearest"}:ee(D)?D:{block:"start",inline:"nearest"}}function B(D,O){var te=!D.ownerDocument.documentElement.contains(D);if(ee(O)&&typeof O.behavior=="function")return O.behavior(te?[]:C(D,O));if(te)return;var Q=R(O);return E(C(D,Q),Q.behavior)}var X=Ze.a=B},aRTE:function(mt,Ze){mt.exports={L:1,M:0,Q:3,H:2}},bT9E:function(mt,Ze,y){"use strict";y.d(Ze,"a",function(){return de});var S=y("VTBJ");function de(G,z){var C=Object(S.a)({},G);return Array.isArray(z)&&z.forEach(function(ee){delete C[ee]}),C}},c5Ni:function(mt,Ze,y){},dQei:function(mt,Ze){for(var y={glog:function(de){if(de<1)throw new Error("glog("+de+")");return y.LOG_TABLE[de]},gexp:function(de){for(;de<0;)de+=255;for(;de>=256;)de-=255;return y.EXP_TABLE[de]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},S=0;S<8;S++)y.EXP_TABLE[S]=1<<S;for(var S=8;S<256;S++)y.EXP_TABLE[S]=y.EXP_TABLE[S-4]^y.EXP_TABLE[S-5]^y.EXP_TABLE[S-6]^y.EXP_TABLE[S-8];for(var S=0;S<255;S++)y.LOG_TABLE[y.EXP_TABLE[S]]=S;mt.exports=y},dWSS:function(mt,Ze,y){var S=y("dQei");function de(G,z){if(G.length==null)throw new Error(G.length+"/"+z);for(var C=0;C<G.length&&G[C]==0;)C++;this.num=new Array(G.length-C+z);for(var ee=0;ee<G.length-C;ee++)this.num[ee]=G[ee+C]}de.prototype={get:function(G){return this.num[G]},getLength:function(){return this.num.length},multiply:function(G){for(var z=new Array(this.getLength()+G.getLength()-1),C=0;C<this.getLength();C++)for(var ee=0;ee<G.getLength();ee++)z[C+ee]^=S.gexp(S.glog(this.get(C))+S.glog(G.get(ee)));return new de(z,0)},mod:function(G){if(this.getLength()-G.getLength()<0)return this;for(var z=S.glog(this.get(0))-S.glog(G.get(0)),C=new Array(this.getLength()),ee=0;ee<this.getLength();ee++)C[ee]=this.get(ee);for(var ee=0;ee<G.getLength();ee++)C[ee]^=S.gexp(S.glog(G.get(ee))+z);return new de(C,0).mod(G)}},mt.exports=de},dejd:function(mt,Ze,y){},dmUQ:function(mt,Ze,y){"use strict";var S=y("Ff2n"),de=y("rePB"),G=y("1OyB"),z=y("vuIU"),C=y("Ji7U"),ee=y("md7G"),E=y("foSv"),R=y("q1tI"),B=y.n(R),X=y("TSYQ"),D=y.n(X),O=y("4IlW");function te(we,N){var Ee=Object.keys(we);if(Object.getOwnPropertySymbols){var ye=Object.getOwnPropertySymbols(we);N&&(ye=ye.filter(function(k){return Object.getOwnPropertyDescriptor(we,k).enumerable})),Ee.push.apply(Ee,ye)}return Ee}function Q(we){for(var N=1;N<arguments.length;N++){var Ee=arguments[N]!=null?arguments[N]:{};N%2?te(Object(Ee),!0).forEach(function(ye){Object(de.a)(we,ye,Ee[ye])}):Object.getOwnPropertyDescriptors?Object.defineProperties(we,Object.getOwnPropertyDescriptors(Ee)):te(Object(Ee)).forEach(function(ye){Object.defineProperty(we,ye,Object.getOwnPropertyDescriptor(Ee,ye))})}return we}function W(we){var N=H();return function(){var ye=Object(E.a)(we),k;if(N){var K=Object(E.a)(this).constructor;k=Reflect.construct(ye,arguments,K)}else k=ye.apply(this,arguments);return Object(ee.a)(this,k)}}function H(){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(we){return!1}}function P(){}function ie(we){we.preventDefault()}var se=function(N){return N.replace(/[^\w.-]+/g,"")},Oe=200,Ke=600,ge=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,Me=function(N){return N!=null},Ve=function(N,Ee){return Ee===N||typeof Ee=="number"&&typeof N=="number"&&isNaN(Ee)&&isNaN(N)},_e=function(we){Object(C.a)(Ee,we);var N=W(Ee);function Ee(ye){var k;Object(G.a)(this,Ee),k=N.call(this,ye),k.onKeyDown=function($){var Re=k.props,M=Re.onKeyDown,g=Re.onPressEnter;if($.keyCode===O.a.UP){var ue=k.getRatio($);k.up($,ue,null),k.stop()}else if($.keyCode===O.a.DOWN){var Ie=k.getRatio($);k.down($,Ie,null),k.stop()}else $.keyCode===O.a.ENTER&&g&&g($);if(k.recordCursorPosition(),k.lastKeyCode=$.keyCode,M){for(var Te=arguments.length,nt=new Array(Te>1?Te-1:0),st=1;st<Te;st++)nt[st-1]=arguments[st];M.apply(void 0,[$].concat(nt))}},k.onKeyUp=function($){var Re=k.props.onKeyUp;if(k.stop(),k.recordCursorPosition(),Re){for(var M=arguments.length,g=new Array(M>1?M-1:0),ue=1;ue<M;ue++)g[ue-1]=arguments[ue];Re.apply(void 0,[$].concat(g))}},k.onChange=function($){var Re=k.props.onChange;k.state.focused&&(k.inputting=!0),k.rawInput=k.props.parser(k.getValueFromEvent($)),k.setState({inputValue:k.rawInput}),Re(k.toNumber(k.rawInput))},k.onMouseUp=function(){var $=k.props.onMouseUp;k.recordCursorPosition(),$&&$.apply(void 0,arguments)},k.onFocus=function(){var $;k.setState({focused:!0}),($=k.props).onFocus.apply($,arguments)},k.onBlur=function(){var $=k.props.onBlur;k.inputting=!1,k.setState({focused:!1});var Re=k.getCurrentValidValue(k.state.inputValue),M=k.setValue(Re,P);if($){var g=k.input.value,ue=k.getInputDisplayValue({focus:!1,value:M});k.input.value=ue&&Number(ue),$.apply(void 0,arguments),k.input.value=g}},k.getRatio=function($){var Re=1;return $.metaKey||$.ctrlKey?Re=.1:$.shiftKey&&(Re=10),Re},k.getFullNum=function($){return isNaN($)?$:/e/i.test(String($))?Number($).toFixed(18).replace(/\.?0+$/,""):$},k.getPrecision=function($){if(Me(k.props.precision))return k.props.precision;var Re=String($);if(Re.indexOf("e-")>=0)return parseInt(Re.slice(Re.indexOf("e-")+2),10);var M=0;return Re.indexOf(".")>=0&&(M=Re.length-Re.indexOf(".")-1),M},k.getInputDisplayValue=function($){var Re=$||k.state,M=Re.focused,g=Re.inputValue,ue=Re.value,Ie;M?Ie=g:Ie=k.toPrecisionAsStep(ue),Ie==null&&(Ie="");var Te=k.formatWrapper(Ie);return Me(k.props.decimalSeparator)&&(Te=Te.toString().replace(".",k.props.decimalSeparator)),Te},k.recordCursorPosition=function(){try{k.cursorStart=k.input.selectionStart,k.cursorEnd=k.input.selectionEnd,k.currentValue=k.input.value,k.cursorBefore=k.input.value.substring(0,k.cursorStart),k.cursorAfter=k.input.value.substring(k.cursorEnd)}catch($){}},k.restoreByAfter=function($){if($===void 0)return!1;var Re=k.input.value,M=Re.lastIndexOf($);if(M===-1)return!1;var g=k.cursorBefore.length;return k.lastKeyCode===O.a.DELETE&&k.cursorBefore.charAt(g-1)===$[0]?(k.fixCaret(g,g),!0):M+$.length===Re.length?(k.fixCaret(M,M),!0):!1},k.partRestoreByAfter=function($){return $===void 0?!1:Array.prototype.some.call($,function(Re,M){var g=$.substring(M);return k.restoreByAfter(g)})},k.isNotCompleteNumber=function($){return isNaN($)||$===""||$===null||$&&$.toString().indexOf(".")===$.toString().length-1},k.stop=function(){k.autoStepTimer&&clearTimeout(k.autoStepTimer)},k.down=function($,Re,M){k.pressingUpOrDown=!0,k.step("down",$,Re,M)},k.up=function($,Re,M){k.pressingUpOrDown=!0,k.step("up",$,Re,M)},k.saveInput=function($){k.input=$};var K=ye.value;K===void 0&&(K=ye.defaultValue),k.state={focused:ye.autoFocus};var he=k.getValidValue(k.toNumber(K));return k.state=Q(Q({},k.state),{},{inputValue:k.toPrecisionAsStep(he),value:he}),k}return Object(z.a)(Ee,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(k){var K=this.props,he=K.value,$=K.onChange,Re=K.max,M=K.min,g=this.state.focused;if(k){if(!Ve(k.value,he)||!Ve(k.max,Re)||!Ve(k.min,M)){var ue=g?he:this.getValidValue(he),Ie;this.pressingUpOrDown?Ie=ue:this.inputting?Ie=this.rawInput:Ie=this.toPrecisionAsStep(ue),this.setState({value:ue,inputValue:Ie})}var Te="value"in this.props?he:this.state.value;"max"in this.props&&k.max!==Re&&typeof Te=="number"&&Te>Re&&$&&$(Re),"min"in this.props&&k.min!==M&&typeof Te=="number"&&Te<M&&$&&$(M)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var nt=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===O.a.BACKSPACE?nt=this.cursorStart-1:this.lastKeyCode===O.a.DELETE&&(nt=this.cursorStart):nt=this.input.value.length,this.fixCaret(nt,nt)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case O.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case O.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(st){}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(k){var K=k;return K===""?K="":this.isNotCompleteNumber(parseFloat(K))?K=this.state.value:K=this.getValidValue(K),this.toNumber(K)}},{key:"getValueFromEvent",value:function(k){var K=k.target.value.trim().replace(/。/g,".");return Me(this.props.decimalSeparator)&&(K=K.replace(this.props.decimalSeparator,".")),K}},{key:"getValidValue",value:function(k){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,$=parseFloat(k);return isNaN($)?k:($<K&&($=K),$>he&&($=he),$)}},{key:"setValue",value:function(k,K){var he=this.props.precision,$=this.isNotCompleteNumber(parseFloat(k))?null:parseFloat(k),Re=this.state.value,M=Re===void 0?null:Re,g=this.state.inputValue,ue=g===void 0?null:g,Ie=typeof $=="number"?$.toFixed(he):"".concat($),Te=$!==M||Ie!=="".concat(ue);return"value"in this.props?(ue=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:ue},K)):this.setState({value:$,inputValue:this.toPrecisionAsStep(k)},K),Te&&this.props.onChange($),$}},{key:"getMaxPrecision",value:function(k){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,he=this.props,$=he.precision,Re=he.step;if(Me($))return $;var M=this.getPrecision(K),g=this.getPrecision(Re),ue=this.getPrecision(k);return k?Math.max(ue,M+g):M+g}},{key:"getPrecisionFactor",value:function(k){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,he=this.getMaxPrecision(k,K);return Math.pow(10,he)}},{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(k){return this.props.formatter?this.props.formatter(k):k}},{key:"toPrecisionAsStep",value:function(k){if(this.isNotCompleteNumber(k)||k==="")return k;var K=Math.abs(this.getMaxPrecision(k));return isNaN(K)?k.toString():Number(k).toFixed(K)}},{key:"toNumber",value:function(k){var K=this.props.precision,he=this.state.focused,$=k&&k.length>16&&he;return this.isNotCompleteNumber(k)||$?k:Me(K)?Math.round(k*Math.pow(10,K))/Math.pow(10,K):Number(k)}},{key:"upStep",value:function(k,K){var he=this.props.step,$=this.getPrecisionFactor(k,K),Re=Math.abs(this.getMaxPrecision(k,K)),M=(($*k+$*he*K)/$).toFixed(Re);return this.toNumber(M)}},{key:"downStep",value:function(k,K){var he=this.props.step,$=this.getPrecisionFactor(k,K),Re=Math.abs(this.getMaxPrecision(k,K)),M=(($*k-$*he*K)/$).toFixed(Re);return this.toNumber(M)}},{key:"step",value:function(k,K){var he=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Re=arguments.length>3?arguments[3]:void 0;this.stop(),K&&(K.persist(),K.preventDefault());var M=this.props;if(M.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var ue=this["".concat(k,"Step")](g,$),Ie=ue>M.max||ue<M.min;if(ue>M.max?ue=M.max:ue<M.min&&(ue=M.min),this.setValue(ue,null),this.setState({focused:!0},function(){he.pressingUpOrDown=!1}),Ie)return;this.autoStepTimer=setTimeout(function(){he[k](K,$,!0)},Re?Oe:Ke)}},{key:"fixCaret",value:function(k,K){if(k===void 0||K===void 0||!this.input||!this.input.value)return;try{var he=this.input.selectionStart,$=this.input.selectionEnd;(k!==he||K!==$)&&this.input.setSelectionRange(k,K)}catch(Re){}}},{key:"render",value:function(){var k,K=this.props,he=K.prefixCls,$=K.disabled,Re=K.readOnly,M=K.useTouch,g=K.autoComplete,ue=K.upHandler,Ie=K.downHandler,Te=K.className,nt=K.max,st=K.min,Ue=K.style,He=K.title,Le=K.onMouseEnter,Be=K.onMouseLeave,ce=K.onMouseOver,j=K.onMouseOut,et=K.required,Ct=K.onClick,St=K.tabIndex,ze=K.type,pt=K.placeholder,fe=K.id,Ae=K.inputMode,Ge=K.pattern,Se=K.step,rt=K.maxLength,tt=K.autoFocus,lt=K.name,It=K.onPaste,wt=K.onInput,bt=Object(S.a)(K,["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"]),ut=this.state,Rt=ut.value,xt=ut.focused,gt=D()(he,(k={},Object(de.a)(k,Te,!!Te),Object(de.a)(k,"".concat(he,"-disabled"),$),Object(de.a)(k,"".concat(he,"-focused"),xt),k)),De={};Object.keys(bt).forEach(function(L){(L.substr(0,5)==="data-"||L.substr(0,5)==="aria-"||L==="role")&&(De[L]=bt[L])});var Dt=!Re&&!$,vt=this.getInputDisplayValue(null),je=(Rt||Rt===0)&&(isNaN(Rt)||Number(Rt)>=nt),qe=(Rt||Rt===0)&&(isNaN(Rt)||Number(Rt)<=st),ae=je||$||Re,Z=qe||$||Re,re=D()("".concat(he,"-handler"),"".concat(he,"-handler-up"),Object(de.a)({},"".concat(he,"-handler-up-disabled"),ae)),x=D()("".concat(he,"-handler"),"".concat(he,"-handler-down"),Object(de.a)({},"".concat(he,"-handler-down-disabled"),Z)),w=M?{onTouchStart:ae?P:this.up,onTouchEnd:this.stop}:{onMouseDown:ae?P:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},T=M?{onTouchStart:Z?P:this.down,onTouchEnd:this.stop}:{onMouseDown:Z?P:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return B.a.createElement("div",{className:gt,style:Ue,title:He,onMouseEnter:Le,onMouseLeave:Be,onMouseOver:ce,onMouseOut:j,onFocus:function(){return null},onBlur:function(){return null}},B.a.createElement("div",{className:"".concat(he,"-handler-wrap")},B.a.createElement("span",Object.assign({unselectable:"on"},w,{role:"button","aria-label":"Increase Value","aria-disabled":ae,className:re}),ue||B.a.createElement("span",{unselectable:"on",className:"".concat(he,"-handler-up-inner"),onClick:ie})),B.a.createElement("span",Object.assign({unselectable:"on"},T,{role:"button","aria-label":"Decrease Value","aria-disabled":Z,className:x}),Ie||B.a.createElement("span",{unselectable:"on",className:"".concat(he,"-handler-down-inner"),onClick:ie}))),B.a.createElement("div",{className:"".concat(he,"-input-wrap")},B.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":st,"aria-valuemax":nt,"aria-valuenow":Rt,required:et,type:ze,placeholder:pt,onPaste:It,onClick:Ct,onMouseUp:this.onMouseUp,className:"".concat(he,"-input"),tabIndex:St,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Dt?this.onKeyDown:P,onKeyUp:Dt?this.onKeyUp:P,autoFocus:tt,maxLength:rt,readOnly:Re,disabled:$,max:nt,min:st,step:Se,name:lt,title:He,id:fe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(vt),pattern:Ge,inputMode:Ae,onInput:wt},De))))}}]),Ee}(B.a.Component);_e.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:ge,min:-ge,step:1,style:{},onChange:P,onKeyDown:P,onPressEnter:P,onFocus:P,onBlur:P,parser:se,required:!1,autoComplete:"off"};var be=_e,Ne=Ze.a=be},f4xo:function(mt,Ze,y){var S=y("nVVt");function de(G){this.mode=S.MODE_8BIT_BYTE,this.data=G}de.prototype={getLength:function(G){return this.data.length},write:function(G){for(var z=0;z<this.data.length;z++)G.put(this.data.charCodeAt(z),8)}},mt.exports=de},fr4D:function(mt,Ze,y){"use strict";y.d(Ze,"d",function(){return C}),y.d(Ze,"i",function(){return E}),y.d(Ze,"o",function(){return B}),y.d(Ze,"r",function(){return D}),y.d(Ze,"g",function(){return te}),y.d(Ze,"q",function(){return W}),y.d(Ze,"m",function(){return P}),y.d(Ze,"u",function(){return Ke}),y.d(Ze,"j",function(){return Me}),y.d(Ze,"p",function(){return _e}),y.d(Ze,"t",function(){return Ne}),y.d(Ze,"l",function(){return N}),y.d(Ze,"w",function(){return ye}),y.d(Ze,"n",function(){return K}),y.d(Ze,"a",function(){return $}),y.d(Ze,"h",function(){return M}),y.d(Ze,"e",function(){return Te}),y.d(Ze,"s",function(){return st}),y.d(Ze,"f",function(){return He}),y.d(Ze,"v",function(){return Be}),y.d(Ze,"c",function(){return j}),y.d(Ze,"b",function(){return Ct}),y.d(Ze,"k",function(){return ze});var S=y("9og8"),de=y("WmNS"),G=y.n(de),z=y("ErOA");function C(fe){return ee.apply(this,arguments)}function ee(){return ee=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects.json",{method:"post",body:Ae}));case 1:case"end":return Se.stop()}},fe)})),ee.apply(this,arguments)}function E(fe,Ae){return R.apply(this,arguments)}function R(){return R=Object(S.a)(G.a.mark(function fe(Ae,Ge){return G.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return rt.abrupt("return",Object(z.a)("/api/sci/projects/".concat(Ge,".json"),{method:"put",body:Ae}));case 1:case"end":return rt.stop()}},fe)})),R.apply(this,arguments)}function B(fe){return X.apply(this,arguments)}function X(){return X=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/sci_mirror_repositories.json",{method:"get",params:Ae}));case 1:case"end":return Se.stop()}},fe)})),X.apply(this,arguments)}function D(fe){return O.apply(this,arguments)}function O(){return O=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects.json",{method:"get",params:Ae}));case 1:case"end":return Se.stop()}},fe)})),O.apply(this,arguments)}function te(fe,Ae){return Q.apply(this,arguments)}function Q(){return Q=Object(S.a)(G.a.mark(function fe(Ae,Ge){return G.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return rt.abrupt("return",Object(z.a)("/api/sci/projects/".concat(Ae,".json"),{method:"delete",body:Ge}));case 1:case"end":return rt.stop()}},fe)})),Q.apply(this,arguments)}function W(fe){return H.apply(this,arguments)}function H(){return H=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/".concat(Ae,".json"),{method:"get"}));case 1:case"end":return Se.stop()}},fe)})),H.apply(this,arguments)}function P(fe){return ie.apply(this,arguments)}function ie(){return ie=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/data_sets.json",{method:"get",params:Ae}));case 1:case"end":return Se.stop()}},fe)})),ie.apply(this,arguments)}function se(fe){return Oe.apply(this,arguments)}function Oe(){return Oe=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/".concat(Ae,"/remove_data_sets.json"),{method:"get"}));case 1:case"end":return Se.stop()}},fe)})),Oe.apply(this,arguments)}function Ke(fe){return ge.apply(this,arguments)}function ge(){return ge=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/".concat(Ae,"/start_environment.json"),{method:"post"}));case 1:case"end":return Se.stop()}},fe)})),ge.apply(this,arguments)}function Me(fe,Ae){return Ve.apply(this,arguments)}function Ve(){return Ve=Object(S.a)(G.a.mark(function fe(Ae,Ge){return G.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return rt.abrupt("return",Object(z.a)("/api/sci/projects/".concat(Ae,"/fork_sci_project.json"),{method:"post",body:Ge}));case 1:case"end":return rt.stop()}},fe)})),Ve.apply(this,arguments)}function _e(fe,Ae){return be.apply(this,arguments)}function be(){return be=Object(S.a)(G.a.mark(function fe(Ae,Ge){return G.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return rt.abrupt("return",Object(z.a)("/api/sci/projects/".concat(Ae,"/get_data_sets.json"),{method:"get",params:Ge}));case 1:case"end":return rt.stop()}},fe)})),be.apply(this,arguments)}function Ne(fe){return we.apply(this,arguments)}function we(){return we=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/".concat(Ae,"/running_logs.json"),{method:"get"}));case 1:case"end":return Se.stop()}},fe)})),we.apply(this,arguments)}function N(fe){return Ee.apply(this,arguments)}function Ee(){return Ee=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/attachment_detail.json",{method:"get",params:Ae}));case 1:case"end":return Se.stop()}},fe)})),Ee.apply(this,arguments)}function ye(fe){return k.apply(this,arguments)}function k(){return k=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/update_attachment_introduce.json",{method:"PUT",body:Ae}));case 1:case"end":return Se.stop()}},fe)})),k.apply(this,arguments)}function K(fe){return he.apply(this,arguments)}function he(){return he=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/jupyter_host_list.json",{method:"get",params:Ae}));case 1:case"end":return Se.stop()}},fe)})),he.apply(this,arguments)}function $(fe){return Re.apply(this,arguments)}function Re(){return Re=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/add_jupyter_host.json",{method:"post",body:Ae}));case 1:case"end":return Se.stop()}},fe)})),Re.apply(this,arguments)}function M(fe){return g.apply(this,arguments)}function g(){return g=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/edit_jupyter_host.json",{method:"put",body:Ae}));case 1:case"end":return Se.stop()}},fe)})),g.apply(this,arguments)}function ue(fe){return Ie.apply(this,arguments)}function Ie(){return Ie=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/jupyter_host_detail.json",{method:"get",params:Ae}));case 1:case"end":return Se.stop()}},fe)})),Ie.apply(this,arguments)}function Te(fe){return nt.apply(this,arguments)}function nt(){return nt=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/delete_jupyter_host.json",{method:"delete",body:Ae}));case 1:case"end":return Se.stop()}},fe)})),nt.apply(this,arguments)}function st(){return Ue.apply(this,arguments)}function Ue(){return Ue=Object(S.a)(G.a.mark(function fe(){return G.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:return Ge.abrupt("return",Object(z.a)("/api/sci/projects/get_running_list.json",{method:"get"}));case 1:case"end":return Ge.stop()}},fe)})),Ue.apply(this,arguments)}function He(fe){return Le.apply(this,arguments)}function Le(){return Le=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/".concat(Ae,"/delete_pod.json"),{method:"post"}));case 1:case"end":return Se.stop()}},fe)})),Le.apply(this,arguments)}function Be(fe){return ce.apply(this,arguments)}function ce(){return ce=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/sci/projects/update_data_set.json",{method:"PUT",body:Ae}));case 1:case"end":return Se.stop()}},fe)})),ce.apply(this,arguments)}function j(fe){return et.apply(this,arguments)}function et(){return et=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/collections.json",{method:"POST",body:Ae}));case 1:case"end":return Se.stop()}},fe)})),et.apply(this,arguments)}function Ct(fe){return St.apply(this,arguments)}function St(){return St=Object(S.a)(G.a.mark(function fe(Ae){return G.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(z.a)("/api/collections/cancel.json",{method:"DELETE",body:Ae}));case 1:case"end":return Se.stop()}},fe)})),St.apply(this,arguments)}function ze(){return pt.apply(this,arguments)}function pt(){return pt=Object(S.a)(G.a.mark(function fe(){return G.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:return Ge.abrupt("return",Object(z.a)("/api/sci/projects/data_set_tags.json",{method:"GET"}));case 1:case"end":return Ge.stop()}},fe)})),pt.apply(this,arguments)}},k3GJ:function(mt,Ze,y){"use strict";y.d(Ze,"a",function(){return Ca});var S=y("rePB"),de=y("ODXe"),G=y("Ff2n"),z=y("VTBJ"),C=y("q1tI"),ee=y("TSYQ"),E=y.n(ee),R=y("Zm9Q"),B=y("6cGi"),X=y("KQm4"),D=y("xEkU"),O=y.n(D),te=y("t23M");function Q(A){var q=Object(C.useRef)(),oe=Object(C.useRef)(!1);function I(){for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];oe.current||(O.a.cancel(q.current),q.current=O()(function(){A.apply(void 0,_)}))}return Object(C.useEffect)(function(){return function(){oe.current=!0,O.a.cancel(q.current)}},[]),I}function W(A){var q=Object(C.useRef)([]),oe=Object(C.useState)({}),I=Object(de.a)(oe,2),m=I[1],_=Object(C.useRef)(typeof A=="function"?A():A),b=Q(function(){var V=_.current;q.current.forEach(function(le){V=le(V)}),q.current=[],_.current=V,m({})});function F(V){q.current.push(V),b()}return[_.current,F]}var H=y("4IlW");function P(A,q){var oe,I=A.prefixCls,m=A.id,_=A.active,b=A.rtl,F=A.tab,V=F.key,le=F.tab,ne=F.disabled,ve=F.closeIcon,Pe=A.tabBarGutter,ot=A.tabPosition,it=A.closable,ct=A.renderWrapper,Wt=A.removeAriaLabel,Qt=A.editable,Kt=A.onClick,$t=A.onRemove,qt=A.onFocus,Jt="".concat(I,"-tab");C.useEffect(function(){return $t},[]);var Yt={};ot==="top"||ot==="bottom"?Yt[b?"marginLeft":"marginRight"]=Pe:Yt.marginBottom=Pe;var dn=Qt&&it!==!1&&!ne;function nn(Ut){if(ne)return;Kt(Ut)}function Fn(Ut){Ut.preventDefault(),Ut.stopPropagation(),Qt.onEdit("remove",{key:V,event:Ut})}var rn=C.createElement("div",{key:V,ref:q,className:E()(Jt,(oe={},Object(S.a)(oe,"".concat(Jt,"-with-remove"),dn),Object(S.a)(oe,"".concat(Jt,"-active"),_),Object(S.a)(oe,"".concat(Jt,"-disabled"),ne),oe)),style:Yt,onClick:nn},C.createElement("div",{role:"tab","aria-selected":_,id:m&&"".concat(m,"-tab-").concat(V),className:"".concat(Jt,"-btn"),"aria-controls":m&&"".concat(m,"-panel-").concat(V),"aria-disabled":ne,tabIndex:ne?null:0,onClick:function(Nt){Nt.stopPropagation(),nn(Nt)},onKeyDown:function(Nt){[H.a.SPACE,H.a.ENTER].includes(Nt.which)&&(Nt.preventDefault(),nn(Nt))},onFocus:qt},le),dn&&C.createElement("button",{type:"button","aria-label":Wt||"remove",tabIndex:0,className:"".concat(Jt,"-remove"),onClick:function(Nt){Nt.stopPropagation(),Fn(Nt)}},ve||Qt.removeIcon||"\xD7"));return ct&&(rn=ct(rn)),rn}var ie=C.forwardRef(P),se={width:0,height:0,left:0,top:0};function Oe(A,q,oe){return Object(C.useMemo)(function(){for(var I,m=new Map,_=q.get((I=A[0])===null||I===void 0?void 0:I.key)||se,b=_.left+_.width,F=0;F<A.length;F+=1){var V=A[F].key,le=q.get(V);if(!le){var ne;le=q.get((ne=A[F-1])===null||ne===void 0?void 0:ne.key)||se}var ve=m.get(V)||Object(z.a)({},le);ve.right=b-ve.left-ve.width,m.set(V,ve)}return m},[A.map(function(I){return I.key}).join("_"),q,oe])}var Ke={width:0,height:0,left:0,top:0,right:0};function ge(A,q,oe,I,m){var _=m.tabs,b=m.tabPosition,F=m.rtl,V,le,ne;["top","bottom"].includes(b)?(V="width",le=F?"right":"left",ne=Math.abs(q.left)):(V="height",le="top",ne=-q.top);var ve=q[V],Pe=oe[V],ot=I[V],it=ve;return Pe+ot>ve&&(it=ve-ot),Object(C.useMemo)(function(){if(!_.length)return[0,0];for(var ct=_.length,Wt=ct,Qt=0;Qt<ct;Qt+=1){var Kt=A.get(_[Qt].key)||Ke;if(Kt[le]+Kt[V]>ne+it){Wt=Qt-1;break}}for(var $t=0,qt=ct-1;qt>=0;qt-=1){var Jt=A.get(_[qt].key)||Ke;if(Jt[le]<ne){$t=qt+1;break}}return[$t,Wt]},[A,ne,it,b,_.map(function(ct){return ct.key}).join("_"),F])}var Me=y("wx14"),Ve=y("1OyB"),_e=y("vuIU"),be=y("JX7q"),Ne=y("Ji7U"),we=y("LK+K"),N=y("I8Z2"),Ee=y("bT9E"),ye=y("2GS6"),k=y("Gytx"),K=y.n(k),he=y("U8pU"),$=/iPhone/i,Re=/iPod/i,M=/iPad/i,g=/\bAndroid(?:.+)Mobile\b/i,ue=/Android/i,Ie=/\bAndroid(?:.+)SD4930UR\b/i,Te=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,nt=/Windows Phone/i,st=/\bWindows(?:.+)ARM\b/i,Ue=/BlackBerry/i,He=/BB10/i,Le=/Opera Mini/i,Be=/\b(CriOS|Chrome)(?:.+)Mobile/i,ce=/Mobile(?:.+)Firefox\b/i;function j(A,q){return A.test(q)}function et(A){var q=A||(typeof navigator!="undefined"?navigator.userAgent:""),oe=(q||"").split("[FBAN");if(typeof oe[1]!="undefined"){var I=oe,m=Object(de.a)(I,1);q=m[0]}if(oe=q.split("Twitter"),typeof oe[1]!="undefined"){var _=oe,b=Object(de.a)(_,1);q=b[0]}var F={apple:{phone:j($,q)&&!j(nt,q),ipod:j(Re,q),tablet:!j($,q)&&j(M,q)&&!j(nt,q),device:(j($,q)||j(Re,q)||j(M,q))&&!j(nt,q)},amazon:{phone:j(Ie,q),tablet:!j(Ie,q)&&j(Te,q),device:j(Ie,q)||j(Te,q)},android:{phone:!j(nt,q)&&j(Ie,q)||!j(nt,q)&&j(g,q),tablet:!j(nt,q)&&!j(Ie,q)&&!j(g,q)&&(j(Te,q)||j(ue,q)),device:!j(nt,q)&&(j(Ie,q)||j(Te,q)||j(g,q)||j(ue,q))||j(/\bokhttp\b/i,q)},windows:{phone:j(nt,q),tablet:j(st,q),device:j(nt,q)||j(st,q)},other:{blackberry:j(Ue,q),blackberry10:j(He,q),opera:j(Le,q),firefox:j(ce,q),chrome:j(Be,q),device:j(Ue,q)||j(He,q)||j(Le,q)||j(ce,q)||j(Be,q)},any:null,phone:null,tablet:null};return F.any=F.apple.device||F.android.device||F.windows.device||F.other.device,F.phone=F.apple.phone||F.android.phone||F.windows.phone,F.tablet=F.apple.tablet||F.android.tablet||F.windows.tablet,F}var Ct=Object(z.a)(Object(z.a)({},et()),{},{isMobile:et}),St=Ct;function ze(){}function pt(A,q,oe){var I=q||"";return A.key||"".concat(I,"item_").concat(oe)}function fe(A){return"".concat(A,"-menu-")}function Ae(A,q){var oe=-1;C.Children.forEach(A,function(I){oe+=1,I&&I.type&&I.type.isMenuItemGroup?C.Children.forEach(I.props.children,function(m){oe+=1,q(m,oe)}):q(I,oe)})}function Ge(A,q,oe){if(!A||oe.find)return;C.Children.forEach(A,function(I){if(I){var m=I.type;if(!m||!(m.isSubMenu||m.isMenuItem||m.isMenuItemGroup))return;q.indexOf(I.key)!==-1?oe.find=!0:I.props.children&&Ge(I.props.children,q,oe)}})}var Se=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],rt=function(q){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,I=q&&typeof q.getBoundingClientRect=="function"&&q.getBoundingClientRect().width;if(I){if(oe){var m=getComputedStyle(q),_=m.marginLeft,b=m.marginRight;I+=+_.replace("px","")+ +b.replace("px","")}I=+I.toFixed(6)}return I||0},tt=function(q,oe,I){q&&Object(he.a)(q.style)==="object"&&(q.style[oe]=I)},lt=function(){return St.any},It=y("bdgK"),wt=y("i8i4"),bt=y.n(wt),ut=y("wgJM"),Rt=y("l4aY"),xt=y("m+aA"),gt=y("c+Xe"),De=y("zT1h"),Dt=y("QC+M");function vt(A,q,oe){return oe?A[0]===q[0]:A[0]===q[0]&&A[1]===q[1]}function je(A,q,oe){var I=A[q]||{};return Object(z.a)(Object(z.a)({},I),oe)}function qe(A,q,oe,I){for(var m=oe.points,_=Object.keys(A),b=0;b<_.length;b+=1){var F=_[b];if(vt(A[F].points,m,I))return"".concat(q,"-placement-").concat(F)}return""}var ae=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var A=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(A)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(A==null?void 0:A.substr(0,4)))},Z=y("MNnm");function re(A,q){var oe={};return oe[A.toLowerCase()]=q.toLowerCase(),oe["Webkit".concat(A)]="webkit".concat(q),oe["Moz".concat(A)]="moz".concat(q),oe["ms".concat(A)]="MS".concat(q),oe["O".concat(A)]="o".concat(q.toLowerCase()),oe}function x(A,q){var oe={animationend:re("Animation","AnimationEnd"),transitionend:re("Transition","TransitionEnd")};return A&&("AnimationEvent"in q||delete oe.animationend.animation,"TransitionEvent"in q||delete oe.transitionend.transition),oe}var w=x(Object(Z.a)(),typeof window!="undefined"?window:{}),T={};if(Object(Z.a)()){var L=document.createElement("div");T=L.style}var pe={};function ke(A){if(pe[A])return pe[A];var q=w[A];if(q)for(var oe=Object.keys(q),I=oe.length,m=0;m<I;m+=1){var _=oe[m];if(Object.prototype.hasOwnProperty.call(q,_)&&_ in T)return pe[A]=q[_],pe[A]}return""}var Je=ke("animationend"),Mt=ke("transitionend"),Xt=!!(Je&&Mt),$e=Je||"animationend",zt=Mt||"transitionend";function Lt(A,q){if(!A)return null;if(Object(he.a)(A)==="object"){var oe=q.replace(/-\w/g,function(I){return I[1].toUpperCase()});return A[oe]}return"".concat(A,"-").concat(q)}var ht="none",on="appear",Zt="enter",En="leave",vn="none",Bt="prepare",Wn="start",Bn="active",Tt="end";function di(A){var q=Object(C.useRef)(!1),oe=Object(C.useState)(A),I=Object(de.a)(oe,2),m=I[0],_=I[1];function b(F){q.current||_(F)}return Object(C.useEffect)(function(){return function(){q.current=!0}},[]),[m,b]}var oi=Object(Z.a)()?C.useLayoutEffect:C.useEffect,ai=oi,Si=function(){var A=C.useRef(null);function q(){ut.a.cancel(A.current)}function oe(I){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;q();var _=Object(ut.a)(function(){m<=1?I({isCanceled:function(){return _!==A.current}}):oe(I,m-1)});A.current=_}return C.useEffect(function(){return function(){q()}},[]),[oe,q]},or=[Bt,Wn,Bn,Tt],Bi=!1,pn=!0;function _t(A){return A===Bn||A===Tt}var Fi=function(A,q){var oe=C.useState(vn),I=Object(de.a)(oe,2),m=I[0],_=I[1],b=Si(),F=Object(de.a)(b,2),V=F[0],le=F[1];function ne(){_(Bt)}return ai(function(){if(m!==vn&&m!==Tt){var ve=or.indexOf(m),Pe=or[ve+1],ot=q(m);ot===Bi?_(Pe):V(function(it){function ct(){if(it.isCanceled())return;_(Pe)}ot===!0?ct():Promise.resolve(ot).then(ct)})}},[A,m]),C.useEffect(function(){return function(){le()}},[]),[ne,m]},dr=function(A){var q=Object(C.useRef)(),oe=Object(C.useRef)(A);oe.current=A;var I=C.useCallback(function(b){oe.current(b)},[]);function m(b){b&&(b.removeEventListener(zt,I),b.removeEventListener($e,I))}function _(b){q.current&&q.current!==b&&m(q.current),b&&b!==q.current&&(b.addEventListener(zt,I),b.addEventListener($e,I),q.current=b)}return C.useEffect(function(){return function(){m(q.current)}},[]),[_,m]};function ki(A,q,oe,I){var m=I.motionEnter,_=m===void 0?!0:m,b=I.motionAppear,F=b===void 0?!0:b,V=I.motionLeave,le=V===void 0?!0:V,ne=I.motionDeadline,ve=I.motionLeaveImmediately,Pe=I.onAppearPrepare,ot=I.onEnterPrepare,it=I.onLeavePrepare,ct=I.onAppearStart,Wt=I.onEnterStart,Qt=I.onLeaveStart,Kt=I.onAppearActive,$t=I.onEnterActive,qt=I.onLeaveActive,Jt=I.onAppearEnd,Yt=I.onEnterEnd,dn=I.onLeaveEnd,nn=I.onVisibleChanged,Fn=di(),rn=Object(de.a)(Fn,2),Ut=rn[0],Nt=rn[1],sn=di(ht),fn=Object(de.a)(sn,2),At=fn[0],gn=fn[1],Hn=di(null),Cn=Object(de.a)(Hn,2),Ln=Cn[0],Tn=Cn[1],Qn=Object(C.useRef)(!1),fi=Object(C.useRef)(null),Gn=Object(C.useRef)(!1),Mi=Object(C.useRef)(null);function er(){var Nn=oe();return Nn||Mi.current}var Pi=Object(C.useRef)(!1);function pi(Nn){var Mn=er();if(Nn&&!Nn.deadline&&Nn.target!==Mn)return;var mi;At===on&&Pi.current?mi=Jt==null?void 0:Jt(Mn,Nn):At===Zt&&Pi.current?mi=Yt==null?void 0:Yt(Mn,Nn):At===En&&Pi.current&&(mi=dn==null?void 0:dn(Mn,Nn)),mi!==!1&&!Gn.current&&(gn(ht),Tn(null))}var jn=dr(pi),Dn=Object(de.a)(jn,1),Kn=Dn[0],zn=C.useMemo(function(){var Nn,Mn,mi;switch(At){case"appear":return Nn={},Object(S.a)(Nn,Bt,Pe),Object(S.a)(Nn,Wn,ct),Object(S.a)(Nn,Bn,Kt),Nn;case"enter":return Mn={},Object(S.a)(Mn,Bt,ot),Object(S.a)(Mn,Wn,Wt),Object(S.a)(Mn,Bn,$t),Mn;case"leave":return mi={},Object(S.a)(mi,Bt,it),Object(S.a)(mi,Wn,Qt),Object(S.a)(mi,Bn,qt),mi;default:return{}}},[At]),tr=Fi(At,function(Nn){if(Nn===Bt){var Mn=zn[Bt];return Mn?Mn(er()):Bi}if(An in zn){var mi;Tn(((mi=zn[An])===null||mi===void 0?void 0:mi.call(zn,er(),null))||null)}return An===Bn&&(Kn(er()),ne>0&&(clearTimeout(fi.current),fi.current=setTimeout(function(){pi({deadline:!0})},ne))),pn}),Tr=Object(de.a)(tr,2),Ar=Tr[0],An=Tr[1],hr=_t(An);Pi.current=hr,ai(function(){Nt(q);var Nn=Qn.current;if(Qn.current=!0,!A)return;var Mn;!Nn&&q&&F&&(Mn=on),Nn&&q&&_&&(Mn=Zt),(Nn&&!q&&le||!Nn&&ve&&!q&&le)&&(Mn=En),Mn&&(gn(Mn),Ar())},[q]),Object(C.useEffect)(function(){(At===on&&!F||At===Zt&&!_||At===En&&!le)&&gn(ht)},[F,_,le]),Object(C.useEffect)(function(){return function(){clearTimeout(fi.current),Gn.current=!0}},[]),Object(C.useEffect)(function(){Ut!==void 0&&At===ht&&(nn==null||nn(Ut))},[Ut,At]);var Rr=Ln;return zn[Bt]&&An===Wn&&(Rr=Object(z.a)({transition:"none"},Rr)),[At,An,Rr,Ut!=null?Ut:q]}var ln=function(A){Object(Ne.a)(oe,A);var q=Object(we.a)(oe);function oe(){return Object(Ve.a)(this,oe),q.apply(this,arguments)}return Object(_e.a)(oe,[{key:"render",value:function(){return this.props.children}}]),oe}(C.Component),Yi=ln;function fr(A){var q=A;Object(he.a)(A)==="object"&&(q=A.transitionSupport);function oe(m){return!!(m.motionName&&q)}var I=C.forwardRef(function(m,_){var b=m.visible,F=b===void 0?!0:b,V=m.removeOnLeave,le=V===void 0?!0:V,ne=m.forceRender,ve=m.children,Pe=m.motionName,ot=m.leavedClassName,it=m.eventProps,ct=oe(m),Wt=Object(C.useRef)(),Qt=Object(C.useRef)();function Kt(){try{return Object(xt.a)(Wt.current||Qt.current)}catch(gn){return null}}var $t=ki(ct,F,Kt,m),qt=Object(de.a)($t,4),Jt=qt[0],Yt=qt[1],dn=qt[2],nn=qt[3],Fn=C.useRef(nn);nn&&(Fn.current=!0);var rn=Object(C.useRef)(_);rn.current=_;var Ut=C.useCallback(function(gn){Wt.current=gn,Object(gt.b)(rn.current,gn)},[]),Nt,sn=Object(z.a)(Object(z.a)({},it),{},{visible:F});if(!ve)Nt=null;else if(Jt===ht||!oe(m))nn?Nt=ve(Object(z.a)({},sn),Ut):!le&&Fn.current?Nt=ve(Object(z.a)(Object(z.a)({},sn),{},{className:ot}),Ut):ne?Nt=ve(Object(z.a)(Object(z.a)({},sn),{},{style:{display:"none"}}),Ut):Nt=null;else{var fn,At;Yt===Bt?At="prepare":_t(Yt)?At="active":Yt===Wn&&(At="start"),Nt=ve(Object(z.a)(Object(z.a)({},sn),{},{className:E()(Lt(Pe,Jt),(fn={},Object(S.a)(fn,Lt(Pe,"".concat(Jt,"-").concat(At)),At),Object(S.a)(fn,Pe,typeof Pe=="string"),fn)),style:dn}),Ut)}return C.createElement(Yi,{ref:Qt},Nt)});return I.displayName="CSSMotion",I}var pr=fr(Xt),Qe="add",Ft="keep",Ji="remove",ar="removed";function mr(A){var q;return A&&Object(he.a)(A)==="object"&&"key"in A?q=A:q={key:A},Object(z.a)(Object(z.a)({},q),{},{key:String(q.key)})}function gr(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return A.map(mr)}function h(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],oe=[],I=0,m=q.length,_=gr(A),b=gr(q);_.forEach(function(le){for(var ne=!1,ve=I;ve<m;ve+=1){var Pe=b[ve];if(Pe.key===le.key){I<ve&&(oe=oe.concat(b.slice(I,ve).map(function(ot){return Object(z.a)(Object(z.a)({},ot),{},{status:Qe})})),I=ve),oe.push(Object(z.a)(Object(z.a)({},Pe),{},{status:Ft})),I+=1,ne=!0;break}}ne||oe.push(Object(z.a)(Object(z.a)({},le),{},{status:Ji}))}),I<m&&(oe=oe.concat(b.slice(I).map(function(le){return Object(z.a)(Object(z.a)({},le),{},{status:Qe})})));var F={};oe.forEach(function(le){var ne=le.key;F[ne]=(F[ne]||0)+1});var V=Object.keys(F).filter(function(le){return F[le]>1});return V.forEach(function(le){oe=oe.filter(function(ne){var ve=ne.key,Pe=ne.status;return ve!==le||Pe!==Ji}),oe.forEach(function(ne){ne.key===le&&(ne.status=Ft)})}),oe}var o=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function a(A){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pr,oe=function(I){Object(Ne.a)(_,I);var m=Object(we.a)(_);function _(){var b;return Object(Ve.a)(this,_),b=m.apply(this,arguments),b.state={keyEntities:[]},b.removeKey=function(F){b.setState(function(V){var le=V.keyEntities;return{keyEntities:le.map(function(ne){return ne.key!==F?ne:Object(z.a)(Object(z.a)({},ne),{},{status:ar})})}})},b}return Object(_e.a)(_,[{key:"render",value:function(){var F=this,V=this.state.keyEntities,le=this.props,ne=le.component,ve=le.children,Pe=le.onVisibleChanged,ot=Object(G.a)(le,["component","children","onVisibleChanged"]),it=ne||C.Fragment,ct={};return o.forEach(function(Wt){ct[Wt]=ot[Wt],delete ot[Wt]}),delete ot.keys,C.createElement(it,ot,V.map(function(Wt){var Qt=Wt.status,Kt=Object(G.a)(Wt,["status"]),$t=Qt===Qe||Qt===Ft;return C.createElement(q,Object(Me.a)({},ct,{key:Kt.key,visible:$t,eventProps:Kt,onVisibleChanged:function(Jt){Pe==null||Pe(Jt,{key:Kt.key}),Jt||F.removeKey(Kt.key)}}),ve)}))}}],[{key:"getDerivedStateFromProps",value:function(F,V){var le=F.keys,ne=V.keyEntities,ve=gr(le),Pe=h(ne,ve);return{keyEntities:Pe.filter(function(ot){var it=ne.find(function(ct){var Wt=ct.key;return ot.key===Wt});return!(it&&it.status===ar&&ot.status===Ji)})}}}]),_}(C.Component);return oe.defaultProps={component:"div"},oe}var u=a(Xt),p=pr;function c(A){var q=A.prefixCls,oe=A.motion,I=A.animation,m=A.transitionName;return oe||(I?{motionName:"".concat(q,"-").concat(I)}:m?{motionName:m}:null)}function J(A){var q=A.prefixCls,oe=A.visible,I=A.zIndex,m=A.mask,_=A.maskMotion,b=A.maskAnimation,F=A.maskTransitionName;if(!m)return null;var V={};return(_||F||b)&&(V=Object(z.a)({motionAppear:!0},c({motion:_,prefixCls:q,transitionName:F,animation:b}))),C.createElement(p,Object(Me.a)({},V,{visible:oe,removeOnLeave:!0}),function(le){var ne=le.className;return C.createElement("div",{style:{zIndex:I},className:E()("".concat(q,"-mask"),ne)})})}var We=y("9mu1"),xe=y("o0o1"),kt=y.n(xe),Xe=y("HaE+"),Ht=["measure","align",null,"motion"],hn=function(A,q){var oe=Object(C.useState)(null),I=Object(de.a)(oe,2),m=I[0],_=I[1],b=Object(C.useRef)(),F=Object(C.useRef)(!1);function V(ve){F.current||_(ve)}function le(){ut.a.cancel(b.current)}function ne(ve){le(),b.current=Object(ut.a)(function(){V(function(Pe){switch(m){case"align":return"motion";case"motion":return"stable";default:}return Pe}),ve==null||ve()})}return Object(C.useEffect)(function(){V("measure")},[A]),Object(C.useEffect)(function(){switch(m){case"measure":q();break;default:}m&&(b.current=Object(ut.a)(Object(Xe.a)(kt.a.mark(function ve(){var Pe,ot;return kt.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:Pe=Ht.indexOf(m),ot=Ht[Pe+1],ot&&Pe!==-1&&V(ot);case 3:case"end":return ct.stop()}},ve)}))))},[m]),Object(C.useEffect)(function(){return function(){F.current=!0,le()}},[]),[m,ne]},Sn=function(A){var q=C.useState({width:0,height:0}),oe=Object(de.a)(q,2),I=oe[0],m=oe[1];function _(F){m({width:F.offsetWidth,height:F.offsetHeight})}var b=C.useMemo(function(){var F={};if(A){var V=I.width,le=I.height;A.indexOf("height")!==-1&&le?F.height=le:A.indexOf("minHeight")!==-1&&le&&(F.minHeight=le),A.indexOf("width")!==-1&&V?F.width=V:A.indexOf("minWidth")!==-1&&V&&(F.minWidth=V)}return F},[A,I]);return[b,_]},Ri=C.forwardRef(function(A,q){var oe=A.visible,I=A.prefixCls,m=A.className,_=A.style,b=A.children,F=A.zIndex,V=A.stretch,le=A.destroyPopupOnHide,ne=A.forceRender,ve=A.align,Pe=A.point,ot=A.getRootDomNode,it=A.getClassNameFromAlign,ct=A.onAlign,Wt=A.onMouseEnter,Qt=A.onMouseLeave,Kt=A.onMouseDown,$t=A.onTouchStart,qt=Object(C.useRef)(),Jt=Object(C.useRef)(),Yt=Object(C.useState)(),dn=Object(de.a)(Yt,2),nn=dn[0],Fn=dn[1],rn=Sn(V),Ut=Object(de.a)(rn,2),Nt=Ut[0],sn=Ut[1];function fn(){V&&sn(ot())}var At=hn(oe,fn),gn=Object(de.a)(At,2),Hn=gn[0],Cn=gn[1],Ln=Object(C.useRef)();function Tn(){return Pe||ot}function Qn(){var jn;(jn=qt.current)===null||jn===void 0||jn.forceAlign()}function fi(jn,Dn){var Kn=it(Dn);nn!==Kn&&Fn(Kn),Hn==="align"&&(nn!==Kn?Promise.resolve().then(function(){Qn()}):Cn(function(){var zn;(zn=Ln.current)===null||zn===void 0||zn.call(Ln)}),ct==null||ct(jn,Dn))}var Gn=Object(z.a)({},c(A));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(jn){var Dn=Gn[jn];Gn[jn]=function(Kn,zn){return Cn(),Dn==null?void 0:Dn(Kn,zn)}});function Mi(){return new Promise(function(jn){Ln.current=jn})}C.useEffect(function(){!Gn.motionName&&Hn==="motion"&&Cn()},[Gn.motionName,Hn]),C.useImperativeHandle(q,function(){return{forceAlign:Qn,getElement:function(){return Jt.current}}});var er=Object(z.a)(Object(z.a)({},Nt),{},{zIndex:F,opacity:Hn==="motion"||Hn==="stable"||!oe?void 0:0,pointerEvents:Hn==="stable"?void 0:"none"},_),Pi=!0;(ve==null?void 0:ve.points)&&(Hn==="align"||Hn==="stable")&&(Pi=!1);var pi=b;return C.Children.count(b)>1&&(pi=C.createElement("div",{className:"".concat(I,"-content")},b)),C.createElement(p,Object(Me.a)({visible:oe,ref:Jt,leavedClassName:"".concat(I,"-hidden")},Gn,{onAppearPrepare:Mi,onEnterPrepare:Mi,removeOnLeave:le,forceRender:ne}),function(jn,Dn){var Kn=jn.className,zn=jn.style,tr=E()(I,m,nn,Kn);return C.createElement(We.a,{target:Tn(),key:"popup",ref:qt,monitorWindowResize:!0,disabled:Pi,align:ve,onAlign:fi},C.createElement("div",{ref:Dn,className:tr,onMouseEnter:Wt,onMouseLeave:Qt,onMouseDownCapture:Kt,onTouchStartCapture:$t,style:Object(z.a)(Object(z.a)({},zn),er)},pi))})});Ri.displayName="PopupInner";var Hi=Ri,ei=C.forwardRef(function(A,q){var oe=A.prefixCls,I=A.visible,m=A.zIndex,_=A.children,b=A.mobile;b=b===void 0?{}:b;var F=b.popupClassName,V=b.popupStyle,le=b.popupMotion,ne=le===void 0?{}:le,ve=b.popupRender,Pe=C.useRef();C.useImperativeHandle(q,function(){return{forceAlign:function(){},getElement:function(){return Pe.current}}});var ot=Object(z.a)({zIndex:m},V),it=_;return C.Children.count(_)>1&&(it=C.createElement("div",{className:"".concat(oe,"-content")},_)),ve&&(it=ve(it)),C.createElement(p,Object(Me.a)({visible:I,ref:Pe,removeOnLeave:!0},ne),function(ct,Wt){var Qt=ct.className,Kt=ct.style,$t=E()(oe,F,Qt);return C.createElement("div",{ref:Wt,className:$t,style:Object(z.a)(Object(z.a)({},Kt),ot)},it)})});ei.displayName="MobilePopupInner";var Zi=ei,Gr=["visible","mobile"],xi=C.forwardRef(function(A,q){var oe=A.visible,I=A.mobile,m=Object(G.a)(A,Gr),_=Object(C.useState)(oe),b=Object(de.a)(_,2),F=b[0],V=b[1],le=Object(C.useState)(!1),ne=Object(de.a)(le,2),ve=ne[0],Pe=ne[1],ot=Object(z.a)(Object(z.a)({},m),{},{visible:F});Object(C.useEffect)(function(){V(oe),oe&&I&&Pe(ae())},[oe,I]);var it=ve?C.createElement(Zi,Object(Me.a)({},ot,{mobile:I,ref:q})):C.createElement(Hi,Object(Me.a)({},ot,{ref:q}));return C.createElement("div",null,C.createElement(J,ot),it)});xi.displayName="Popup";var _i=xi,sr=C.createContext(null),vr=sr;function zi(){}function lr(){return""}function Wi(A){return A?A.ownerDocument:window.document}var so=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Kr(A){var q=function(oe){Object(Ne.a)(m,oe);var I=Object(we.a)(m);function m(_){var b;Object(Ve.a)(this,m),b=I.call(this,_),b.popupRef=C.createRef(),b.triggerRef=C.createRef(),b.attachId=void 0,b.clickOutsideHandler=void 0,b.touchOutsideHandler=void 0,b.contextMenuOutsideHandler1=void 0,b.contextMenuOutsideHandler2=void 0,b.mouseDownTimeout=void 0,b.focusTime=void 0,b.preClickTime=void 0,b.preTouchTime=void 0,b.delayTimer=void 0,b.hasPopupMouseDown=void 0,b.onMouseEnter=function(V){var le=b.props.mouseEnterDelay;b.fireEvents("onMouseEnter",V),b.delaySetPopupVisible(!0,le,le?null:V)},b.onMouseMove=function(V){b.fireEvents("onMouseMove",V),b.setPoint(V)},b.onMouseLeave=function(V){b.fireEvents("onMouseLeave",V),b.delaySetPopupVisible(!1,b.props.mouseLeaveDelay)},b.onPopupMouseEnter=function(){b.clearDelayTimer()},b.onPopupMouseLeave=function(V){var le;if(V.relatedTarget&&!V.relatedTarget.setTimeout&&Object(Rt.a)((le=b.popupRef.current)===null||le===void 0?void 0:le.getElement(),V.relatedTarget))return;b.delaySetPopupVisible(!1,b.props.mouseLeaveDelay)},b.onFocus=function(V){b.fireEvents("onFocus",V),b.clearDelayTimer(),b.isFocusToShow()&&(b.focusTime=Date.now(),b.delaySetPopupVisible(!0,b.props.focusDelay))},b.onMouseDown=function(V){b.fireEvents("onMouseDown",V),b.preClickTime=Date.now()},b.onTouchStart=function(V){b.fireEvents("onTouchStart",V),b.preTouchTime=Date.now()},b.onBlur=function(V){b.fireEvents("onBlur",V),b.clearDelayTimer(),b.isBlurToHide()&&b.delaySetPopupVisible(!1,b.props.blurDelay)},b.onContextMenu=function(V){V.preventDefault(),b.fireEvents("onContextMenu",V),b.setPopupVisible(!0,V)},b.onContextMenuClose=function(){b.isContextMenuToShow()&&b.close()},b.onClick=function(V){if(b.fireEvents("onClick",V),b.focusTime){var le;if(b.preClickTime&&b.preTouchTime?le=Math.min(b.preClickTime,b.preTouchTime):b.preClickTime?le=b.preClickTime:b.preTouchTime&&(le=b.preTouchTime),Math.abs(le-b.focusTime)<20)return;b.focusTime=0}b.preClickTime=0,b.preTouchTime=0,b.isClickToShow()&&(b.isClickToHide()||b.isBlurToHide())&&V&&V.preventDefault&&V.preventDefault();var ne=!b.state.popupVisible;(b.isClickToHide()&&!ne||ne&&b.isClickToShow())&&b.setPopupVisible(!b.state.popupVisible,V)},b.onPopupMouseDown=function(){if(b.hasPopupMouseDown=!0,clearTimeout(b.mouseDownTimeout),b.mouseDownTimeout=window.setTimeout(function(){b.hasPopupMouseDown=!1},0),b.context){var V;(V=b.context).onPopupMouseDown.apply(V,arguments)}},b.onDocumentClick=function(V){if(b.props.mask&&!b.props.maskClosable)return;var le=V.target,ne=b.getRootDomNode(),ve=b.getPopupDomNode();(!Object(Rt.a)(ne,le)||b.isContextMenuOnly())&&!Object(Rt.a)(ve,le)&&!b.hasPopupMouseDown&&b.close()},b.getRootDomNode=function(){var V=b.props.getTriggerDOMNode;if(V)return V(b.triggerRef.current);try{var le=Object(xt.a)(b.triggerRef.current);if(le)return le}catch(ne){}return bt.a.findDOMNode(Object(be.a)(b))},b.getPopupClassNameFromAlign=function(V){var le=[],ne=b.props,ve=ne.popupPlacement,Pe=ne.builtinPlacements,ot=ne.prefixCls,it=ne.alignPoint,ct=ne.getPopupClassNameFromAlign;return ve&&Pe&&le.push(qe(Pe,ot,V,it)),ct&&le.push(ct(V)),le.join(" ")},b.getComponent=function(){var V=b.props,le=V.prefixCls,ne=V.destroyPopupOnHide,ve=V.popupClassName,Pe=V.onPopupAlign,ot=V.popupMotion,it=V.popupAnimation,ct=V.popupTransitionName,Wt=V.popupStyle,Qt=V.mask,Kt=V.maskAnimation,$t=V.maskTransitionName,qt=V.maskMotion,Jt=V.zIndex,Yt=V.popup,dn=V.stretch,nn=V.alignPoint,Fn=V.mobile,rn=V.forceRender,Ut=b.state,Nt=Ut.popupVisible,sn=Ut.point,fn=b.getPopupAlign(),At={};return b.isMouseEnterToShow()&&(At.onMouseEnter=b.onPopupMouseEnter),b.isMouseLeaveToHide()&&(At.onMouseLeave=b.onPopupMouseLeave),At.onMouseDown=b.onPopupMouseDown,At.onTouchStart=b.onPopupMouseDown,C.createElement(_i,Object(Me.a)({prefixCls:le,destroyPopupOnHide:ne,visible:Nt,point:nn&&sn,className:ve,align:fn,onAlign:Pe,animation:it,getClassNameFromAlign:b.getPopupClassNameFromAlign},At,{stretch:dn,getRootDomNode:b.getRootDomNode,style:Wt,mask:Qt,zIndex:Jt,transitionName:ct,maskAnimation:Kt,maskTransitionName:$t,maskMotion:qt,ref:b.popupRef,motion:ot,mobile:Fn,forceRender:rn}),typeof Yt=="function"?Yt():Yt)},b.attachParent=function(V){ut.a.cancel(b.attachId);var le=b.props,ne=le.getPopupContainer,ve=le.getDocument,Pe=b.getRootDomNode(),ot;ne?(Pe||ne.length===0)&&(ot=ne(Pe)):ot=ve(b.getRootDomNode()).body,ot?ot.appendChild(V):b.attachId=Object(ut.a)(function(){b.attachParent(V)})},b.getContainer=function(){var V=b.props.getDocument,le=V(b.getRootDomNode()).createElement("div");return le.style.position="absolute",le.style.top="0",le.style.left="0",le.style.width="100%",b.attachParent(le),le},b.setPoint=function(V){var le=b.props.alignPoint;if(!le||!V)return;b.setState({point:{pageX:V.pageX,pageY:V.pageY}})},b.handlePortalUpdate=function(){b.state.prevPopupVisible!==b.state.popupVisible&&b.props.afterPopupVisibleChange(b.state.popupVisible)},b.triggerContextValue={onPopupMouseDown:b.onPopupMouseDown};var F;return"popupVisible"in _?F=!!_.popupVisible:F=!!_.defaultPopupVisible,b.state={prevPopupVisible:F,popupVisible:F},so.forEach(function(V){b["fire".concat(V)]=function(le){b.fireEvents(V,le)}}),b}return Object(_e.a)(m,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var b=this.props,F=this.state;if(F.popupVisible){var V;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(V=b.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(De.a)(V,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(V=V||b.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(De.a)(V,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(V=V||b.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(De.a)(V,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(De.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),ut.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var b;return((b=this.popupRef.current)===null||b===void 0?void 0:b.getElement())||null}},{key:"getPopupAlign",value:function(){var b=this.props,F=b.popupPlacement,V=b.popupAlign,le=b.builtinPlacements;return F&&le?je(le,F,V):V}},{key:"setPopupVisible",value:function(b,F){var V=this.props.alignPoint,le=this.state.popupVisible;this.clearDelayTimer(),le!==b&&("popupVisible"in this.props||this.setState({popupVisible:b,prevPopupVisible:le}),this.props.onPopupVisibleChange(b)),V&&F&&b&&this.setPoint(F)}},{key:"delaySetPopupVisible",value:function(b,F,V){var le=this,ne=F*1e3;if(this.clearDelayTimer(),ne){var ve=V?{pageX:V.pageX,pageY:V.pageY}:null;this.delayTimer=window.setTimeout(function(){le.setPopupVisible(b,ve),le.clearDelayTimer()},ne)}else this.setPopupVisible(b,V)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(b){var F=this.props.children.props,V=this.props;return F[b]&&V[b]?this["fire".concat(b)]:F[b]||V[b]}},{key:"isClickToShow",value:function(){var b=this.props,F=b.action,V=b.showAction;return F.indexOf("click")!==-1||V.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var b=this.props.action;return b==="contextMenu"||b.length===1&&b[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var b=this.props,F=b.action,V=b.showAction;return F.indexOf("contextMenu")!==-1||V.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var b=this.props,F=b.action,V=b.hideAction;return F.indexOf("click")!==-1||V.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var b=this.props,F=b.action,V=b.showAction;return F.indexOf("hover")!==-1||V.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var b=this.props,F=b.action,V=b.hideAction;return F.indexOf("hover")!==-1||V.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var b=this.props,F=b.action,V=b.showAction;return F.indexOf("focus")!==-1||V.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var b=this.props,F=b.action,V=b.hideAction;return F.indexOf("focus")!==-1||V.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var b;(b=this.popupRef.current)===null||b===void 0||b.forceAlign()}}},{key:"fireEvents",value:function(b,F){var V=this.props.children.props[b];V&&V(F);var le=this.props[b];le&&le(F)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var b=this.state.popupVisible,F=this.props,V=F.children,le=F.forceRender,ne=F.alignPoint,ve=F.className,Pe=F.autoDestroy,ot=C.Children.only(V),it={key:"trigger"};this.isContextMenuToShow()?it.onContextMenu=this.onContextMenu:it.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(it.onClick=this.onClick,it.onMouseDown=this.onMouseDown,it.onTouchStart=this.onTouchStart):(it.onClick=this.createTwoChains("onClick"),it.onMouseDown=this.createTwoChains("onMouseDown"),it.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(it.onMouseEnter=this.onMouseEnter,ne&&(it.onMouseMove=this.onMouseMove)):it.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?it.onMouseLeave=this.onMouseLeave:it.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(it.onFocus=this.onFocus,it.onBlur=this.onBlur):(it.onFocus=this.createTwoChains("onFocus"),it.onBlur=this.createTwoChains("onBlur"));var ct=E()(ot&&ot.props&&ot.props.className,ve);ct&&(it.className=ct);var Wt=Object(z.a)({},it);Object(gt.c)(ot)&&(Wt.ref=Object(gt.a)(this.triggerRef,ot.ref));var Qt=C.cloneElement(ot,Wt),Kt;return(b||this.popupRef.current||le)&&(Kt=C.createElement(A,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!b&&Pe&&(Kt=null),C.createElement(vr.Provider,{value:this.triggerContextValue},Qt,Kt)}}],[{key:"getDerivedStateFromProps",value:function(b,F){var V=b.popupVisible,le={};return V!==void 0&&F.popupVisible!==V&&(le.popupVisible=V,le.prevPopupVisible=F.popupVisible),le}}]),m}(C.Component);return q.contextType=vr,q.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:lr,getDocument:Wi,onPopupVisibleChange:zi,afterPopupVisibleChange:zi,onPopupAlign:zi,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},q}var Li=Kr(Dt.a),Jn={adjustX:1,adjustY:1},_r={topLeft:{points:["bl","tl"],overflow:Jn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Jn,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Jn,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Jn,offset:[4,0]}},Ir={topLeft:{points:["bl","tl"],overflow:Jn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Jn,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Jn,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Jn,offset:[4,0]}},Xr=_r,Vn=0,bn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},$n=function(q,oe,I){var m=fe(oe),_=q.getState();q.setState({defaultActiveFirst:Object(z.a)(Object(z.a)({},_.defaultActiveFirst),{},Object(S.a)({},m,I))})},yn=function(A){Object(Ne.a)(oe,A);var q=Object(we.a)(oe);function oe(I){var m;Object(Ve.a)(this,oe),m=q.call(this,I),m.onDestroy=function(ne){m.props.onDestroy(ne)},m.onKeyDown=function(ne){var ve=ne.keyCode,Pe=m.menuInstance,ot=m.props.store,it=m.getVisible();if(ve===H.a.ENTER)return m.onTitleClick(ne),$n(ot,m.props.eventKey,!0),!0;if(ve===H.a.RIGHT)return it?Pe.onKeyDown(ne):(m.triggerOpenChange(!0),$n(ot,m.props.eventKey,!0)),!0;if(ve===H.a.LEFT){var ct;if(it)ct=Pe.onKeyDown(ne);else return;return ct||(m.triggerOpenChange(!1),ct=!0),ct}return it&&(ve===H.a.UP||ve===H.a.DOWN)?Pe.onKeyDown(ne):void 0},m.onOpenChange=function(ne){m.props.onOpenChange(ne)},m.onPopupVisibleChange=function(ne){m.triggerOpenChange(ne,ne?"mouseenter":"mouseleave")},m.onMouseEnter=function(ne){var ve=m.props,Pe=ve.eventKey,ot=ve.onMouseEnter,it=ve.store;$n(it,m.props.eventKey,!1),ot({key:Pe,domEvent:ne})},m.onMouseLeave=function(ne){var ve=m.props,Pe=ve.parentMenu,ot=ve.eventKey,it=ve.onMouseLeave;Pe.subMenuInstance=Object(be.a)(m),it({key:ot,domEvent:ne})},m.onTitleMouseEnter=function(ne){var ve=m.props,Pe=ve.eventKey,ot=ve.onItemHover,it=ve.onTitleMouseEnter;ot({key:Pe,hover:!0}),it({key:Pe,domEvent:ne})},m.onTitleMouseLeave=function(ne){var ve=m.props,Pe=ve.parentMenu,ot=ve.eventKey,it=ve.onItemHover,ct=ve.onTitleMouseLeave;Pe.subMenuInstance=Object(be.a)(m),it({key:ot,hover:!1}),ct({key:ot,domEvent:ne})},m.onTitleClick=function(ne){var ve=Object(be.a)(m),Pe=ve.props;if(Pe.onTitleClick({key:Pe.eventKey,domEvent:ne}),Pe.triggerSubMenuAction==="hover")return;m.triggerOpenChange(!m.getVisible(),"click"),$n(Pe.store,m.props.eventKey,!1)},m.onSubMenuClick=function(ne){typeof m.props.onClick=="function"&&m.props.onClick(m.addKeyPath(ne))},m.onSelect=function(ne){m.props.onSelect(ne)},m.onDeselect=function(ne){m.props.onDeselect(ne)},m.getPrefixCls=function(){return"".concat(m.props.rootPrefixCls,"-submenu")},m.getActiveClassName=function(){return"".concat(m.getPrefixCls(),"-active")},m.getDisabledClassName=function(){return"".concat(m.getPrefixCls(),"-disabled")},m.getSelectedClassName=function(){return"".concat(m.getPrefixCls(),"-selected")},m.getOpenClassName=function(){return"".concat(m.props.rootPrefixCls,"-submenu-open")},m.getVisible=function(){return m.state.isOpen},m.getMode=function(){return m.state.mode},m.saveMenuInstance=function(ne){m.menuInstance=ne},m.addKeyPath=function(ne){return Object(z.a)(Object(z.a)({},ne),{},{keyPath:(ne.keyPath||[]).concat(m.props.eventKey)})},m.triggerOpenChange=function(ne,ve){var Pe=m.props.eventKey,ot=function(){m.onOpenChange({key:Pe,item:Object(be.a)(m),trigger:ve,open:ne})};ve==="mouseenter"?m.mouseenterTimeout=setTimeout(function(){ot()},0):ot()},m.isChildrenSelected=function(){var ne={find:!1};return Ge(m.props.children,m.props.selectedKeys,ne),ne.find},m.isInlineMode=function(){return m.getMode()==="inline"},m.adjustWidth=function(){if(!m.subMenuTitle||!m.menuInstance)return;var ne=wt.findDOMNode(m.menuInstance);if(ne.offsetWidth>=m.subMenuTitle.offsetWidth)return;ne.style.minWidth="".concat(m.subMenuTitle.offsetWidth,"px")},m.saveSubMenuTitle=function(ne){m.subMenuTitle=ne},m.getBaseProps=function(){var ne=Object(be.a)(m),ve=ne.props,Pe=m.getMode();return{mode:Pe==="horizontal"?"vertical":Pe,visible:m.getVisible(),level:ve.level+1,inlineIndent:ve.inlineIndent,focusable:!1,onClick:m.onSubMenuClick,onSelect:m.onSelect,onDeselect:m.onDeselect,onDestroy:m.onDestroy,selectedKeys:ve.selectedKeys,eventKey:"".concat(ve.eventKey,"-menu-"),openKeys:ve.openKeys,motion:ve.motion,onOpenChange:m.onOpenChange,subMenuOpenDelay:ve.subMenuOpenDelay,parentMenu:Object(be.a)(m),subMenuCloseDelay:ve.subMenuCloseDelay,forceSubMenuRender:ve.forceSubMenuRender,triggerSubMenuAction:ve.triggerSubMenuAction,builtinPlacements:ve.builtinPlacements,defaultActiveFirst:ve.store.getState().defaultActiveFirst[fe(ve.eventKey)],multiple:ve.multiple,prefixCls:ve.rootPrefixCls,id:m.internalMenuId,manualRef:m.saveMenuInstance,itemIcon:ve.itemIcon,expandIcon:ve.expandIcon,direction:ve.direction}},m.getMotion=function(ne,ve){var Pe=Object(be.a)(m),ot=Pe.haveRendered,it=m.props,ct=it.motion,Wt=it.rootPrefixCls,Qt=Object(z.a)(Object(z.a)({},ct),{},{leavedClassName:"".concat(Wt,"-hidden"),removeOnLeave:!1,motionAppear:ot||!ve||ne!=="inline"});return Qt};var _=I.store,b=I.eventKey,F=_.getState(),V=F.defaultActiveFirst;m.isRootMenu=!1;var le=!1;return V&&(le=V[b]),$n(_,b,le),m.state={mode:I.mode,isOpen:I.isOpen},m}return Object(_e.a)(oe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var m=this,_=this.props,b=_.mode,F=_.parentMenu,V=_.manualRef,le=_.isOpen,ne=function(){m.setState({mode:b,isOpen:le})},ve=le!==this.state.isOpen,Pe=b!==this.state.mode;if((Pe||ve)&&(ut.a.cancel(this.updateStateRaf),Pe?this.updateStateRaf=Object(ut.a)(ne):ne()),V&&V(this),b!=="horizontal"||!(F==null?void 0:F.isRootMenu)||!le)return;this.minWidthTimeout=setTimeout(function(){return m.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var m=this.props,_=m.onDestroy,b=m.eventKey;_&&_(b),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),ut.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(m,_){var b=this.getBaseProps();return C.createElement(cr,Object(Me.a)({},b,{id:this.internalMenuId,className:m,style:_}),this.props.children)}},{key:"renderChildren",value:function(){var m=this,_=this.getBaseProps(),b=_.mode,F=_.visible,V=_.forceSubMenuRender,le=_.direction,ne=this.getMotion(b,F);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||F||V,!this.haveOpened)return C.createElement("div",null);var ve=E()("".concat(_.prefixCls,"-sub"),Object(S.a)({},"".concat(_.prefixCls,"-rtl"),le==="rtl"));return this.isInlineMode()?C.createElement(p,Object(Me.a)({visible:_.visible,forceRender:V},ne),function(Pe){var ot=Pe.className,it=Pe.style,ct=E()(ve,ot);return m.renderPopupMenu(ct,it)}):this.renderPopupMenu(ve)}},{key:"render",value:function(){var m,_,b,F=Object(z.a)({},this.props),V=this.getVisible(),le=this.getPrefixCls(),ne=this.isInlineMode(),ve=this.getMode(),Pe=E()(le,"".concat(le,"-").concat(ve),(m={},Object(S.a)(m,F.className,!!F.className),Object(S.a)(m,this.getOpenClassName(),V),Object(S.a)(m,this.getActiveClassName(),F.active||V&&!ne),Object(S.a)(m,this.getDisabledClassName(),F.disabled),Object(S.a)(m,this.getSelectedClassName(),this.isChildrenSelected()),m));this.internalMenuId||(F.eventKey?this.internalMenuId="".concat(F.eventKey,"$Menu"):(Vn+=1,this.internalMenuId="$__$".concat(Vn,"$Menu")));var ot={},it={},ct={};F.disabled||(ot={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},it={onClick:this.onTitleClick},ct={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Wt={},Qt=F.direction,Kt=Qt==="rtl";ne&&(Kt?Wt.paddingRight=F.inlineIndent*F.level:Wt.paddingLeft=F.inlineIndent*F.level);var $t={};this.getVisible()&&($t={"aria-owns":this.internalMenuId});var qt=null;ve!=="horizontal"&&(qt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(qt=C.createElement(this.props.expandIcon,Object(z.a)({},this.props))));var Jt=C.createElement("div",Object(Me.a)({ref:this.saveSubMenuTitle,style:Wt,className:"".concat(le,"-title"),role:"button"},ct,it,{"aria-expanded":V},$t,{"aria-haspopup":"true",title:typeof F.title=="string"?F.title:void 0}),F.title,qt||C.createElement("i",{className:"".concat(le,"-arrow")})),Yt=this.renderChildren(),dn=((_=F.parentMenu)===null||_===void 0?void 0:_.isRootMenu)?F.parentMenu.props.getPopupContainer:function(Tn){return Tn.parentNode},nn=bn[ve],Fn=F.popupOffset?{offset:F.popupOffset}:{},rn=E()((b={},Object(S.a)(b,F.popupClassName,F.popupClassName&&!ne),Object(S.a)(b,"".concat(le,"-rtl"),Kt),b)),Ut=F.disabled,Nt=F.triggerSubMenuAction,sn=F.subMenuOpenDelay,fn=F.forceSubMenuRender,At=F.subMenuCloseDelay,gn=F.builtinPlacements;Se.forEach(function(Tn){return delete F[Tn]}),delete F.onClick;var Hn=Kt?Object(z.a)(Object(z.a)({},Ir),gn):Object(z.a)(Object(z.a)({},_r),gn);delete F.direction;var Cn=this.getBaseProps(),Ln=ne?null:this.getMotion(Cn.mode,Cn.visible);return C.createElement("li",Object(Me.a)({},F,ot,{className:Pe,role:"menuitem"}),C.createElement(Li,{prefixCls:le,popupClassName:E()("".concat(le,"-popup"),rn),getPopupContainer:dn,builtinPlacements:Hn,popupPlacement:nn,popupVisible:ne?!1:V,popupAlign:Fn,popup:ne?null:Yt,action:Ut||ne?[]:[Nt],mouseEnterDelay:sn,mouseLeaveDelay:At,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:fn,popupMotion:Ln},Jt),ne?Yt:null)}}]),oe}(C.Component);yn.defaultProps={onMouseEnter:ze,onMouseLeave:ze,onTitleMouseEnter:ze,onTitleMouseLeave:ze,onTitleClick:ze,manualRef:ze,mode:"vertical",title:""};var si=Object(N.b)(function(A,q){var oe=A.openKeys,I=A.activeKey,m=A.selectedKeys,_=q.eventKey,b=q.subMenuKey;return{isOpen:oe.indexOf(_)>-1,active:I[b]===_,selectedKeys:m}})(yn);si.isSubMenu=!0;var Rn=si,yr="menuitem-overflowed",ti=.5,Zn=function(A){Object(Ne.a)(oe,A);var q=Object(we.a)(oe);function oe(){var I;return Object(Ve.a)(this,oe),I=q.apply(this,arguments),I.resizeObserver=null,I.mutationObserver=null,I.originalTotalWidth=0,I.overflowedItems=[],I.menuItemSizes=[],I.cancelFrameId=null,I.state={lastVisibleIndex:void 0},I.childRef=C.createRef(),I.getMenuItemNodes=function(){var m=I.props.prefixCls,_=I.childRef.current;return _?[].slice.call(_.children).filter(function(b){return b.className.split(" ").indexOf("".concat(m,"-overflowed-submenu"))<0}):[]},I.getOverflowedSubMenuItem=function(m,_,b){var F=I.props,V=F.overflowedIndicator,le=F.level,ne=F.mode,ve=F.prefixCls,Pe=F.theme;if(le!==1||ne!=="horizontal")return null;var ot=I.props.children[0],it=ot.props,ct=it.children,Wt=it.title,Qt=it.style,Kt=Object(G.a)(it,["children","title","style"]),$t=Object(z.a)({},Qt),qt="".concat(m,"-overflowed-indicator"),Jt="".concat(m,"-overflowed-indicator");_.length===0&&b!==!0?$t=Object(z.a)(Object(z.a)({},$t),{},{display:"none"}):b&&($t=Object(z.a)(Object(z.a)({},$t),{},{visibility:"hidden",position:"absolute"}),qt="".concat(qt,"-placeholder"),Jt="".concat(Jt,"-placeholder"));var Yt=Pe?"".concat(ve,"-").concat(Pe):"",dn={};return Se.forEach(function(nn){Kt[nn]!==void 0&&(dn[nn]=Kt[nn])}),C.createElement(Rn,Object(Me.a)({title:V,className:"".concat(ve,"-overflowed-submenu"),popupClassName:Yt},dn,{key:qt,eventKey:Jt,disabled:!1,style:$t}),_)},I.setChildrenWidthAndResize=function(){if(I.props.mode!=="horizontal")return;var m=I.childRef.current;if(!m)return;var _=m.children;if(!_||_.length===0)return;var b=m.children[_.length-1];tt(b,"display","inline-block");var F=I.getMenuItemNodes(),V=F.filter(function(le){return le.className.split(" ").indexOf(yr)>=0});V.forEach(function(le){tt(le,"display","inline-block")}),I.menuItemSizes=F.map(function(le){return rt(le,!0)}),V.forEach(function(le){tt(le,"display","none")}),I.overflowedIndicatorWidth=rt(m.children[m.children.length-1],!0),I.originalTotalWidth=I.menuItemSizes.reduce(function(le,ne){return le+ne},0),I.handleResize(),tt(b,"display","none")},I.handleResize=function(){if(I.props.mode!=="horizontal")return;var m=I.childRef.current;if(!m)return;var _=rt(m);I.overflowedItems=[];var b=0,F;I.originalTotalWidth>_+ti&&(F=-1,I.menuItemSizes.forEach(function(V){b+=V,b+I.overflowedIndicatorWidth<=_&&(F+=1)})),I.setState({lastVisibleIndex:F})},I}return Object(_e.a)(oe,[{key:"componentDidMount",value:function(){var m=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var _=this.childRef.current;if(!_)return;this.resizeObserver=new It.default(function(b){b.forEach(function(){var F=m.cancelFrameId;cancelAnimationFrame(F),m.cancelFrameId=requestAnimationFrame(m.setChildrenWidthAndResize)})}),[].slice.call(_.children).concat(_).forEach(function(b){m.resizeObserver.observe(b)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){m.resizeObserver.disconnect(),[].slice.call(_.children).concat(_).forEach(function(b){m.resizeObserver.observe(b)}),m.setChildrenWidthAndResize()}),this.mutationObserver.observe(_,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(m){var _=this,b=this.state.lastVisibleIndex;return(m||[]).reduce(function(F,V,le){var ne=V;if(_.props.mode==="horizontal"){var ve=_.getOverflowedSubMenuItem(V.props.eventKey,[]);b!==void 0&&_.props.className.indexOf("".concat(_.props.prefixCls,"-root"))!==-1&&(le>b&&(ne=C.cloneElement(V,{style:{display:"none"},eventKey:"".concat(V.props.eventKey,"-hidden"),className:"".concat(yr)})),le===b+1&&(_.overflowedItems=m.slice(b+1).map(function(ot){return C.cloneElement(ot,{key:ot.props.eventKey,mode:"vertical-left"})}),ve=_.getOverflowedSubMenuItem(V.props.eventKey,_.overflowedItems)));var Pe=[].concat(Object(X.a)(F),[ve,ne]);return le===m.length-1&&Pe.push(_.getOverflowedSubMenuItem(V.props.eventKey,[],!0)),Pe}return[].concat(Object(X.a)(F),[ne])},[])}},{key:"render",value:function(){var m=this.props,_=m.visible,b=m.prefixCls,F=m.overflowedIndicator,V=m.mode,le=m.level,ne=m.tag,ve=m.children,Pe=m.theme,ot=Object(G.a)(m,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),it=ne;return C.createElement(it,Object(Me.a)({ref:this.childRef},ot),this.renderChildren(ve))}}]),oe}(C.Component);Zn.defaultProps={tag:"div",className:""};var ur=Zn;function Or(A){return A.length?A.every(function(q){return!!q.props.disabled}):!0}function qi(A,q,oe){var I=A.getState();A.setState({activeKey:Object(z.a)(Object(z.a)({},I.activeKey),{},Object(S.a)({},q,oe))})}function br(A){return A.eventKey||"0-menu-"}function Di(A,q){var oe=q,I=A.children,m=A.eventKey;if(oe){var _;if(Ae(I,function(b,F){b&&b.props&&!b.props.disabled&&oe===pt(b,m,F)&&(_=!0)}),_)return oe}return oe=null,A.defaultActiveFirst&&Ae(I,function(b,F){!oe&&b&&!b.props.disabled&&(oe=pt(b,m,F))}),oe}function $r(A){if(!A)return;var q=this.instanceArray.indexOf(A);q!==-1?this.instanceArray[q]=A:this.instanceArray.push(A)}var Oi=function(A){Object(Ne.a)(oe,A);var q=Object(we.a)(oe);function oe(I){var m;return Object(Ve.a)(this,oe),m=q.call(this,I),m.onKeyDown=function(_,b){var F=_.keyCode,V;if(m.getFlatInstanceArray().forEach(function(ne){ne&&ne.props.active&&ne.onKeyDown&&(V=ne.onKeyDown(_))}),V)return 1;var le=null;return(F===H.a.UP||F===H.a.DOWN)&&(le=m.step(F===H.a.UP?-1:1)),le?(_.preventDefault(),qi(m.props.store,br(m.props),le.props.eventKey),typeof b=="function"&&b(le),1):void 0},m.onItemHover=function(_){var b=_.key,F=_.hover;qi(m.props.store,br(m.props),F?b:null)},m.onDeselect=function(_){m.props.onDeselect(_)},m.onSelect=function(_){m.props.onSelect(_)},m.onClick=function(_){m.props.onClick(_)},m.onOpenChange=function(_){m.props.onOpenChange(_)},m.onDestroy=function(_){m.props.onDestroy(_)},m.getFlatInstanceArray=function(){return m.instanceArray},m.step=function(_){var b=m.getFlatInstanceArray(),F=m.props.store.getState().activeKey[br(m.props)],V=b.length;if(!V)return null;_<0&&(b=b.concat().reverse());var le=-1;if(b.every(function(ot,it){return ot&&ot.props.eventKey===F?(le=it,!1):!0}),!m.props.defaultActiveFirst&&le!==-1&&Or(b.slice(le,V-1)))return;var ne=(le+1)%V,ve=ne;do{var Pe=b[ve];if(!Pe||Pe.props.disabled)ve=(ve+1)%V;else return Pe}while(ve!==ne);return null},m.renderCommonMenuItem=function(_,b,F){var V=m.props.store.getState(),le=Object(be.a)(m),ne=le.props,ve=pt(_,ne.eventKey,b),Pe=_.props;if(!Pe||typeof _.type=="string")return _;var ot=ve===V.activeKey,it=Object(z.a)(Object(z.a)({mode:Pe.mode||ne.mode,level:ne.level,inlineIndent:ne.inlineIndent,renderMenuItem:m.renderMenuItem,rootPrefixCls:ne.prefixCls,index:b,parentMenu:ne.parentMenu,manualRef:Pe.disabled?void 0:Object(ye.a)(_.ref,$r.bind(Object(be.a)(m))),eventKey:ve,active:!Pe.disabled&&ot,multiple:ne.multiple,onClick:function(Wt){(Pe.onClick||ze)(Wt),m.onClick(Wt)},onItemHover:m.onItemHover,motion:ne.motion,subMenuOpenDelay:ne.subMenuOpenDelay,subMenuCloseDelay:ne.subMenuCloseDelay,forceSubMenuRender:ne.forceSubMenuRender,onOpenChange:m.onOpenChange,onDeselect:m.onDeselect,onSelect:m.onSelect,builtinPlacements:ne.builtinPlacements,itemIcon:Pe.itemIcon||m.props.itemIcon,expandIcon:Pe.expandIcon||m.props.expandIcon},F),{},{direction:ne.direction});return(ne.mode==="inline"||lt())&&(it.triggerSubMenuAction="click"),C.cloneElement(_,Object(z.a)(Object(z.a)({},it),{},{key:ve||b}))},m.renderMenuItem=function(_,b,F){if(!_)return null;var V=m.props.store.getState(),le={openKeys:V.openKeys,selectedKeys:V.selectedKeys,triggerSubMenuAction:m.props.triggerSubMenuAction,subMenuKey:F};return m.renderCommonMenuItem(_,b,le)},I.store.setState({activeKey:Object(z.a)(Object(z.a)({},I.store.getState().activeKey),{},Object(S.a)({},I.eventKey,Di(I,I.activeKey)))}),m.instanceArray=[],m}return Object(_e.a)(oe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(m){return this.props.visible||m.visible||this.props.className!==m.className||!K()(this.props.style,m.style)}},{key:"componentDidUpdate",value:function(m){var _=this.props,b="activeKey"in _?_.activeKey:_.store.getState().activeKey[br(_)],F=Di(_,b);if(F!==b)qi(_.store,br(_),F);else if("activeKey"in m){var V=Di(m,m.activeKey);F!==V&&qi(_.store,br(_),F)}}},{key:"render",value:function(){var m=this,_=Object(Me.a)({},this.props);this.instanceArray=[];var b=E()(_.prefixCls,_.className,"".concat(_.prefixCls,"-").concat(_.mode)),F={className:b,role:_.role||"menu"};_.id&&(F.id=_.id),_.focusable&&(F.tabIndex=0,F.onKeyDown=this.onKeyDown);var V=_.prefixCls,le=_.eventKey,ne=_.visible,ve=_.level,Pe=_.mode,ot=_.overflowedIndicator,it=_.theme;return Se.forEach(function(ct){return delete _[ct]}),delete _.onClick,C.createElement(ur,Object(Me.a)({},_,{prefixCls:V,mode:Pe,tag:"ul",level:ve,theme:it,visible:ne,overflowedIndicator:ot},F),Object(R.a)(_.children).map(function(ct,Wt){return m.renderMenuItem(ct,Wt,le||"0-menu-")}))}}]),oe}(C.Component);Oi.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:ze};var Yr=Object(N.b)()(Oi),cr=Yr,Mr=y("Kwbf");function Ho(A,q,oe){var I=A.prefixCls,m=A.motion,_=A.defaultMotions,b=_===void 0?{}:_,F=A.openAnimation,V=A.openTransitionName,le=q.switchingModeFromInline;if(m)return m;if(Object(he.a)(F)==="object"&&F)Object(Mr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof F=="string")return{motionName:"".concat(I,"-open-").concat(F)};if(V)return{motionName:V};var ne=b[oe];return ne||(le?null:b.other)}var yo=function(A){Object(Ne.a)(oe,A);var q=Object(we.a)(oe);function oe(I){var m;Object(Ve.a)(this,oe),m=q.call(this,I),m.onSelect=function(F){var V=Object(be.a)(m),le=V.props;if(le.selectable){var ne=m.store.getState(),ve=ne.selectedKeys,Pe=F.key;le.multiple?ve=ve.concat([Pe]):ve=[Pe],"selectedKeys"in le||m.store.setState({selectedKeys:ve}),le.onSelect(Object(z.a)(Object(z.a)({},F),{},{selectedKeys:ve}))}},m.onClick=function(F){var V=m.getRealMenuMode(),le=Object(be.a)(m),ne=le.store,ve=le.props.onOpenChange;V!=="inline"&&!("openKeys"in m.props)&&(ne.setState({openKeys:[]}),ve([])),m.props.onClick(F)},m.onKeyDown=function(F,V){m.innerMenu.getWrappedInstance().onKeyDown(F,V)},m.onOpenChange=function(F){var V=Object(be.a)(m),le=V.props,ne=m.store.getState().openKeys.concat(),ve=!1,Pe=function(it){var ct=!1;if(it.open)ct=ne.indexOf(it.key)===-1,ct&&ne.push(it.key);else{var Wt=ne.indexOf(it.key);ct=Wt!==-1,ct&&ne.splice(Wt,1)}ve=ve||ct};Array.isArray(F)?F.forEach(Pe):Pe(F),ve&&("openKeys"in m.props||m.store.setState({openKeys:ne}),le.onOpenChange(ne))},m.onDeselect=function(F){var V=Object(be.a)(m),le=V.props;if(le.selectable){var ne=m.store.getState().selectedKeys.concat(),ve=F.key,Pe=ne.indexOf(ve);Pe!==-1&&ne.splice(Pe,1),"selectedKeys"in le||m.store.setState({selectedKeys:ne}),le.onDeselect(Object(z.a)(Object(z.a)({},F),{},{selectedKeys:ne}))}},m.onMouseEnter=function(F){m.restoreModeVerticalFromInline();var V=m.props.onMouseEnter;V&&V(F)},m.onTransitionEnd=function(F){var V=F.propertyName==="width"&&F.target===F.currentTarget,le=F.target.className,ne=Object.prototype.toString.call(le)==="[object SVGAnimatedString]"?le.animVal:le,ve=F.propertyName==="font-size"&&ne.indexOf("anticon")>=0;(V||ve)&&m.restoreModeVerticalFromInline()},m.setInnerMenu=function(F){m.innerMenu=F},m.isRootMenu=!0;var _=I.defaultSelectedKeys,b=I.defaultOpenKeys;return"selectedKeys"in I&&(_=I.selectedKeys||[]),"openKeys"in I&&(b=I.openKeys||[]),m.store=Object(N.c)({selectedKeys:_,openKeys:b,activeKey:{"0-menu-":Di(I,I.activeKey)}}),m.state={switchingModeFromInline:!1,prevProps:I,inlineOpenKeys:[],store:m.store},m}return Object(_e.a)(oe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(m){var _=this.props,b=_.siderCollapsed,F=_.inlineCollapsed,V=_.onOpenChange;(!m.inlineCollapsed&&F||!m.siderCollapsed&&b)&&V([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var m=this.props.collapsedWidth,_=this.store,b=this.prevOpenKeys,F=this.getInlineCollapsed()&&(m===0||m==="0"||m==="0px");F?(this.prevOpenKeys=_.getState().openKeys.concat(),this.store.setState({openKeys:[]})):b&&(this.store.setState({openKeys:b}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var m=this.props.mode,_=this.state.switchingModeFromInline,b=this.getInlineCollapsed();return _&&b?"inline":b?"vertical":m}},{key:"getInlineCollapsed",value:function(){var m=this.props,_=m.inlineCollapsed,b=m.siderCollapsed;return b!==void 0?b:_}},{key:"restoreModeVerticalFromInline",value:function(){var m=this.state.switchingModeFromInline;m&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var m=Object(z.a)({},Object(Ee.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),_=this.getRealMenuMode();return m.className+=" ".concat(m.prefixCls,"-root"),m.direction==="rtl"&&(m.className+=" ".concat(m.prefixCls,"-rtl")),m=Object(z.a)(Object(z.a)({},m),{},{mode:_,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ho(this.props,this.state,_)}),delete m.openAnimation,delete m.openTransitionName,C.createElement(N.a,{store:this.store},C.createElement(cr,Object(Me.a)({},m,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(m,_){var b=_.prevProps,F=_.store,V=F.getState(),le={},ne={prevProps:m};return b.mode==="inline"&&m.mode!=="inline"&&(ne.switchingModeFromInline=!0),"openKeys"in m?le.openKeys=m.openKeys||[]:((m.inlineCollapsed&&!b.inlineCollapsed||m.siderCollapsed&&!b.siderCollapsed)&&(ne.switchingModeFromInline=!0,ne.inlineOpenKeys=V.openKeys,le.openKeys=[]),(!m.inlineCollapsed&&b.inlineCollapsed||!m.siderCollapsed&&b.siderCollapsed)&&(le.openKeys=_.inlineOpenKeys,ne.inlineOpenKeys=[])),Object.keys(le).length&&F.setState(le),ne}}]),oe}(C.Component);yo.defaultProps={selectable:!0,onClick:ze,onSelect:ze,onOpenChange:ze,onDeselect:ze,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:C.createElement("span",null,"\xB7\xB7\xB7")};var ya=yo,bo=function(A){Object(Ne.a)(oe,A);var q=Object(we.a)(oe);function oe(){var I;return Object(Ve.a)(this,oe),I=q.apply(this,arguments),I.onKeyDown=function(m){var _=m.keyCode;return _===H.a.ENTER?(I.onClick(m),!0):void 0},I.onMouseLeave=function(m){var _=I.props,b=_.eventKey,F=_.onItemHover,V=_.onMouseLeave;F({key:b,hover:!1}),V({key:b,domEvent:m})},I.onMouseEnter=function(m){var _=I.props,b=_.eventKey,F=_.onItemHover,V=_.onMouseEnter;F({key:b,hover:!0}),V({key:b,domEvent:m})},I.onClick=function(m){var _=I.props,b=_.eventKey,F=_.multiple,V=_.onClick,le=_.onSelect,ne=_.onDeselect,ve=_.isSelected,Pe={key:b,keyPath:[b],item:Object(be.a)(I),domEvent:m};V(Pe),F?ve?ne(Pe):le(Pe):ve||le(Pe)},I.saveNode=function(m){I.node=m},I}return Object(_e.a)(oe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var m=this.props;m.onDestroy&&m.onDestroy(m.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var m,_=Object(z.a)({},this.props),b=E()(this.getPrefixCls(),_.className,(m={},Object(S.a)(m,this.getActiveClassName(),!_.disabled&&_.active),Object(S.a)(m,this.getSelectedClassName(),_.isSelected),Object(S.a)(m,this.getDisabledClassName(),_.disabled),m)),F=Object(z.a)(Object(z.a)({},_.attribute),{},{title:typeof _.title=="string"?_.title:void 0,className:b,role:_.role||"menuitem","aria-disabled":_.disabled});_.role==="option"?F=Object(z.a)(Object(z.a)({},F),{},{role:"option","aria-selected":_.isSelected}):(_.role===null||_.role==="none")&&(F.role="none");var V={onClick:_.disabled?null:this.onClick,onMouseLeave:_.disabled?null:this.onMouseLeave,onMouseEnter:_.disabled?null:this.onMouseEnter},le=Object(z.a)({},_.style);_.mode==="inline"&&(_.direction==="rtl"?le.paddingRight=_.inlineIndent*_.level:le.paddingLeft=_.inlineIndent*_.level),Se.forEach(function(ve){return delete _[ve]}),delete _.direction;var ne=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(ne=C.createElement(this.props.itemIcon,this.props)),C.createElement("li",Object(Me.a)({},Object(Ee.a)(_,["onClick","onMouseEnter","onMouseLeave","onSelect"]),F,V,{style:le,ref:this.saveNode}),_.children,ne)}}]),oe}(C.Component);bo.isMenuItem=!0,bo.defaultProps={onSelect:ze,onMouseEnter:ze,onMouseLeave:ze,manualRef:ze};var zo=Object(N.b)(function(A,q){var oe=A.activeKey,I=A.selectedKeys,m=q.eventKey,_=q.subMenuKey;return{active:oe[_]===m,isSelected:Array.isArray(I)?I.indexOf(m)!==-1:I===m}})(bo),Co=zo,Ot=function(A){Object(Ne.a)(oe,A);var q=Object(we.a)(oe);function oe(){var I;return Object(Ve.a)(this,oe),I=q.apply(this,arguments),I.renderInnerMenuItem=function(m){var _=I.props,b=_.renderMenuItem,F=_.index;return b(m,F,I.props.subMenuKey)},I}return Object(_e.a)(oe,[{key:"render",value:function(){var m=Object(Me.a)({},this.props),_=m.className,b=_===void 0?"":_,F=m.rootPrefixCls,V="".concat(F,"-item-group-title"),le="".concat(F,"-item-group-list"),ne=m.title,ve=m.children;return Se.forEach(function(Pe){return delete m[Pe]}),delete m.direction,C.createElement("li",Object(Me.a)({},m,{onClick:function(ot){return ot.stopPropagation()},className:"".concat(b," ").concat(F,"-item-group")}),C.createElement("div",{className:V,title:typeof ne=="string"?ne:void 0},ne),C.createElement("ul",{className:le},C.Children.map(ve,this.renderInnerMenuItem)))}}]),oe}(C.Component);Ot.isMenuItemGroup=!0,Ot.defaultProps={disabled:!0};var Gt=Ot,Pt=function(q){var oe=q.className,I=q.rootPrefixCls,m=q.style;return C.createElement("li",{className:"".concat(oe," ").concat(I,"-item-divider"),style:m})};Pt.defaultProps={disabled:!0,className:"",style:{}};var an=Pt,mn=ya,kn=y("eDIo");function un(A,q){var oe=A.prefixCls,I=A.editable,m=A.locale,_=A.style;return!I||I.showAdd===!1?null:C.createElement("button",{ref:q,type:"button",className:"".concat(oe,"-nav-add"),style:_,"aria-label":(m==null?void 0:m.addAriaLabel)||"Add tab",onClick:function(F){I.onEdit("add",{event:F})}},I.addIcon||"+")}var Un=C.forwardRef(un);function li(A,q){var oe=A.prefixCls,I=A.id,m=A.tabs,_=A.locale,b=A.mobile,F=A.moreIcon,V=F===void 0?"More":F,le=A.moreTransitionName,ne=A.style,ve=A.className,Pe=A.editable,ot=A.tabBarGutter,it=A.rtl,ct=A.onTabClick,Wt=Object(C.useState)(!1),Qt=Object(de.a)(Wt,2),Kt=Qt[0],$t=Qt[1],qt=Object(C.useState)(null),Jt=Object(de.a)(qt,2),Yt=Jt[0],dn=Jt[1],nn="".concat(I,"-more-popup"),Fn="".concat(oe,"-dropdown"),rn=Yt!==null?"".concat(nn,"-").concat(Yt):null,Ut=_==null?void 0:_.dropdownAriaLabel,Nt=C.createElement(mn,{onClick:function(Ln){var Tn=Ln.key,Qn=Ln.domEvent;ct(Tn,Qn),$t(!1)},id:nn,tabIndex:-1,role:"listbox","aria-activedescendant":rn,selectedKeys:[Yt],"aria-label":Ut!==void 0?Ut:"expanded dropdown"},m.map(function(Cn){return C.createElement(Co,{key:Cn.key,id:"".concat(nn,"-").concat(Cn.key),role:"option","aria-controls":I&&"".concat(I,"-panel-").concat(Cn.key),disabled:Cn.disabled},Cn.tab)}));function sn(Cn){for(var Ln=m.filter(function(Mi){return!Mi.disabled}),Tn=Ln.findIndex(function(Mi){return Mi.key===Yt})||0,Qn=Ln.length,fi=0;fi<Qn;fi+=1){Tn=(Tn+Cn+Qn)%Qn;var Gn=Ln[Tn];if(!Gn.disabled){dn(Gn.key);return}}}function fn(Cn){var Ln=Cn.which;if(!Kt){[H.a.DOWN,H.a.SPACE,H.a.ENTER].includes(Ln)&&($t(!0),Cn.preventDefault());return}switch(Ln){case H.a.UP:sn(-1),Cn.preventDefault();break;case H.a.DOWN:sn(1),Cn.preventDefault();break;case H.a.ESC:$t(!1);break;case H.a.SPACE:case H.a.ENTER:Yt!==null&&ct(Yt,Cn);break}}Object(C.useEffect)(function(){var Cn=document.getElementById(rn);Cn&&Cn.scrollIntoView&&Cn.scrollIntoView(!1)},[Yt]),Object(C.useEffect)(function(){Kt||dn(null)},[Kt]);var At=Object(S.a)({},it?"marginLeft":"marginRight",ot);m.length||(At.visibility="hidden",At.order=1);var gn=E()(Object(S.a)({},"".concat(Fn,"-rtl"),it)),Hn=b?null:C.createElement(kn.a,{prefixCls:Fn,overlay:Nt,trigger:["hover"],visible:Kt,transitionName:le,onVisibleChange:$t,overlayClassName:gn,mouseEnterDelay:.1,mouseLeaveDelay:.1},C.createElement("button",{type:"button",className:"".concat(oe,"-nav-more"),style:At,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":nn,id:"".concat(I,"-more"),"aria-expanded":Kt,onKeyDown:fn},V));return C.createElement("div",{className:E()("".concat(oe,"-nav-operations"),ve),style:ne,ref:q},Hn,C.createElement(Un,{prefixCls:oe,locale:_,editable:Pe}))}var tn=C.forwardRef(li),Cr=Object(C.createContext)(null),On=.1,ui=.01,xn=20,Vi=Math.pow(.995,xn);function lo(){var A=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(A)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(A.substr(0,4)))}function uo(A,q){var oe=Object(C.useState)(),I=Object(de.a)(oe,2),m=I[0],_=I[1],b=Object(C.useState)(0),F=Object(de.a)(b,2),V=F[0],le=F[1],ne=Object(C.useState)(0),ve=Object(de.a)(ne,2),Pe=ve[0],ot=ve[1],it=Object(C.useState)(),ct=Object(de.a)(it,2),Wt=ct[0],Qt=ct[1],Kt=Object(C.useRef)();function $t(Ut){var Nt=Ut.touches[0],sn=Nt.screenX,fn=Nt.screenY;_({x:sn,y:fn}),window.clearInterval(Kt.current)}function qt(Ut){if(!m)return;Ut.preventDefault();var Nt=Ut.touches[0],sn=Nt.screenX,fn=Nt.screenY;_({x:sn,y:fn});var At=sn-m.x,gn=fn-m.y;q(At,gn);var Hn=Date.now();le(Hn),ot(Hn-V),Qt({x:At,y:gn})}function Jt(){if(!m)return;if(_(null),Qt(null),Wt){var Ut=Wt.x/Pe,Nt=Wt.y/Pe,sn=Math.abs(Ut),fn=Math.abs(Nt);if(Math.max(sn,fn)<On)return;var At=Ut,gn=Nt;Kt.current=window.setInterval(function(){if(Math.abs(At)<ui&&Math.abs(gn)<ui){window.clearInterval(Kt.current);return}At*=Vi,gn*=Vi,q(At*xn,gn*xn)},xn)}}var Yt=Object(C.useRef)(0),dn=Object(C.useRef)(!1),nn=Object(C.useRef)();function Fn(Ut){var Nt=Ut.deltaX,sn=Ut.deltaY,fn=0,At=Math.abs(Nt),gn=Math.abs(sn);At===gn?fn=nn.current==="x"?Nt:sn:At>gn?(fn=Nt,nn.current="x"):(fn=sn,nn.current="y");var Hn=Date.now();Hn-Yt.current>100&&(dn.current=!1),(q(-fn,-fn)||dn.current)&&(Ut.preventDefault(),dn.current=!0),Yt.current=Hn}var rn=Object(C.useRef)(null);rn.current={onTouchStart:$t,onTouchMove:qt,onTouchEnd:Jt,onWheel:Fn},C.useEffect(function(){function Ut(At){rn.current.onTouchStart(At)}function Nt(At){rn.current.onTouchMove(At)}function sn(At){rn.current.onTouchEnd(At)}function fn(At){rn.current.onWheel(At)}return document.addEventListener("touchmove",Nt,{passive:!1}),document.addEventListener("touchend",sn,{passive:!1}),A.current.addEventListener("touchstart",Ut,{passive:!1}),A.current.addEventListener("wheel",fn),function(){document.removeEventListener("touchmove",Nt),document.removeEventListener("touchend",sn)}},[])}function Va(){var A=Object(C.useRef)(new Map);function q(I){return A.current.has(I)||A.current.set(I,C.createRef()),A.current.get(I)}function oe(I){A.current.delete(I)}return[q,oe]}function Wo(A,q){var oe=C.useRef(A),I=C.useState({}),m=Object(de.a)(I,2),_=m[1];function b(F){var V=typeof F=="function"?F(oe.current):F;V!==oe.current&&q(V,oe.current),oe.current=V,_({})}return[oe.current,b]}var ba=function(q){var oe=q.position,I=q.prefixCls,m=q.extra;if(!m)return null;var _,b=m;return oe==="right"&&(_=b.right||!b.left&&b||null),oe==="left"&&(_=b.left||null),_?C.createElement("div",{className:"".concat(I,"-extra-content")},_):null};function Vo(A,q){var oe,I=C.useContext(Cr),m=I.prefixCls,_=I.tabs,b=A.className,F=A.style,V=A.id,le=A.animated,ne=A.activeKey,ve=A.rtl,Pe=A.extra,ot=A.editable,it=A.locale,ct=A.tabPosition,Wt=A.tabBarGutter,Qt=A.children,Kt=A.onTabClick,$t=A.onTabScroll,qt=Object(C.useRef)(),Jt=Object(C.useRef)(),Yt=Object(C.useRef)(),dn=Object(C.useRef)(),nn=Va(),Fn=Object(de.a)(nn,2),rn=Fn[0],Ut=Fn[1],Nt=ct==="top"||ct==="bottom",sn=Wo(0,function(_n,cn){Nt&&$t&&$t({direction:_n>cn?"left":"right"})}),fn=Object(de.a)(sn,2),At=fn[0],gn=fn[1],Hn=Wo(0,function(_n,cn){!Nt&&$t&&$t({direction:_n>cn?"top":"bottom"})}),Cn=Object(de.a)(Hn,2),Ln=Cn[0],Tn=Cn[1],Qn=Object(C.useState)(0),fi=Object(de.a)(Qn,2),Gn=fi[0],Mi=fi[1],er=Object(C.useState)(0),Pi=Object(de.a)(er,2),pi=Pi[0],jn=Pi[1],Dn=Object(C.useState)(0),Kn=Object(de.a)(Dn,2),zn=Kn[0],tr=Kn[1],Tr=Object(C.useState)(0),Ar=Object(de.a)(Tr,2),An=Ar[0],hr=Ar[1],Rr=Object(C.useState)(null),Nn=Object(de.a)(Rr,2),Mn=Nn[0],mi=Nn[1],wa=Object(C.useState)(null),$o=Object(de.a)(wa,2),Lr=$o[0],Zr=$o[1],xo=Object(C.useState)(0),Yo=Object(de.a)(xo,2),wo=Yo[0],Xa=Yo[1],$a=Object(C.useState)(0),Ea=Object(de.a)($a,2),Jo=Ea[0],Zo=Ea[1],Qr=W(new Map),qr=Object(de.a)(Qr,2),Ya=qr[0],Eo=qr[1],co=Oe(_,Ya,Gn),eo="".concat(m,"-nav-operations-hidden"),to=0,nr=0;Nt?ve?(to=0,nr=Math.max(0,Gn-Mn)):(to=Math.min(0,Mn-Gn),nr=0):(to=Math.min(0,Lr-pi),nr=0);function Ur(_n){return _n<to?[to,!1]:_n>nr?[nr,!1]:[_n,!0]}var Dr=Object(C.useRef)(),ho=Object(C.useState)(),Br=Object(de.a)(ho,2),So=Br[0],Qo=Br[1];function ko(){Qo(Date.now())}function qo(){window.clearTimeout(Dr.current)}uo(qt,function(_n,cn){var gi=!1;function ji(no,wr){no(function(mo){var Nr=Ur(mo+wr),vi=Object(de.a)(Nr,2),Mo=vi[0],ta=vi[1];return gi=ta,Mo})}if(Nt){if(Mn>=Gn)return gi;ji(gn,_n)}else{if(Lr>=pi)return gi;ji(Tn,cn)}return qo(),ko(),gi}),Object(C.useEffect)(function(){return qo(),So&&(Dr.current=window.setTimeout(function(){Qo(0)},100)),qo},[So]);function Pr(){var _n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ne,cn=co.get(_n);if(!cn)return;if(Nt){var gi=At;ve?cn.right<At?gi=cn.right:cn.right+cn.width>At+Mn&&(gi=cn.right+cn.width-Mn):cn.left<-At?gi=-cn.left:cn.left+cn.width>-At+Mn&&(gi=-(cn.left+cn.width-Mn)),Tn(0),gn(Ur(gi)[0])}else{var ji=Ln;cn.top<-Ln?ji=-cn.top:cn.top+cn.height>-Ln+Lr&&(ji=-(cn.top+cn.height-Lr)),gn(0),Tn(Ur(ji)[0])}}var Fr=ge(co,{width:Mn,height:Lr,left:At,top:Ln},{width:zn,height:An},{width:wo,height:Jo},Object(z.a)(Object(z.a)({},A),{},{tabs:_})),Sa=Object(de.a)(Fr,2),Ja=Sa[0],Za=Sa[1],Qa=_.map(function(_n){var cn=_n.key;return C.createElement(ie,{id:V,prefixCls:m,key:cn,rtl:ve,tab:_n,closable:_n.closable,editable:ot,active:cn===ne,tabPosition:ct,tabBarGutter:Wt,renderWrapper:Qt,removeAriaLabel:it==null?void 0:it.removeAriaLabel,ref:rn(cn),onClick:function(ji){Kt(cn,ji)},onRemove:function(){Ut(cn)},onFocus:function(){Pr(cn),ko(),ve||(qt.current.scrollLeft=0),qt.current.scrollTop=0}})}),ea=Q(function(){var _n,cn,gi,ji,no,wr,mo,Nr,vi,Mo=((_n=qt.current)===null||_n===void 0?void 0:_n.offsetWidth)||0,ta=((cn=qt.current)===null||cn===void 0?void 0:cn.offsetHeight)||0,na=((gi=dn.current)===null||gi===void 0?void 0:gi.offsetWidth)||0,Ii=((ji=dn.current)===null||ji===void 0?void 0:ji.offsetHeight)||0,wn=((no=Yt.current)===null||no===void 0?void 0:no.offsetWidth)||0,rr=((wr=Yt.current)===null||wr===void 0?void 0:wr.offsetHeight)||0;mi(Mo),Zr(ta),Xa(na),Zo(Ii);var Er=(((mo=Jt.current)===null||mo===void 0?void 0:mo.offsetWidth)||0)-na,Sr=(((Nr=Jt.current)===null||Nr===void 0?void 0:Nr.offsetHeight)||0)-Ii;Mi(Er),jn(Sr);var ia=(vi=Yt.current)===null||vi===void 0?void 0:vi.className.includes(eo);tr(Er-(ia?0:wn)),hr(Sr-(ia?0:rr)),Eo(function(){var To=new Map;return _.forEach(function(Ta){var Aa=Ta.key,zr=rn(Aa).current;zr&&To.set(Aa,{width:zr.offsetWidth,height:zr.offsetHeight,left:zr.offsetLeft,top:zr.offsetTop})}),To})}),qa=_.slice(0,Ja),Ni=_.slice(Za+1),ni=[].concat(Object(X.a)(qa),Object(X.a)(Ni)),wi=Object(C.useState)(),ii=Object(de.a)(wi,2),fo=ii[0],es=ii[1],ir=co.get(ne),ka=Object(C.useRef)();function _a(){O.a.cancel(ka.current)}Object(C.useEffect)(function(){var _n={};return ir&&(Nt?(ve?_n.right=ir.right:_n.left=ir.left,_n.width=ir.width):(_n.top=ir.top,_n.height=ir.height)),_a(),ka.current=O()(function(){es(_n)}),_a},[ir,Nt,ve]),Object(C.useEffect)(function(){Pr()},[ne,ir,co,Nt]),Object(C.useEffect)(function(){ea()},[ve,Wt,ne,_.map(function(_n){return _n.key}).join("_")]);var Oa=!!ni.length,Hr="".concat(m,"-nav-wrap"),_o,po,Ma,Oo;return Nt?ve?(po=At>0,_o=At+Mn<Gn):(_o=At<0,po=-At+Mn<Gn):(Ma=Ln<0,Oo=-Ln+Lr<pi),C.createElement("div",{ref:q,role:"tablist",className:E()("".concat(m,"-nav"),b),style:F,onKeyDown:function(){ko()}},C.createElement(ba,{position:"left",extra:Pe,prefixCls:m}),C.createElement(te.a,{onResize:ea},C.createElement("div",{className:E()(Hr,(oe={},Object(S.a)(oe,"".concat(Hr,"-ping-left"),_o),Object(S.a)(oe,"".concat(Hr,"-ping-right"),po),Object(S.a)(oe,"".concat(Hr,"-ping-top"),Ma),Object(S.a)(oe,"".concat(Hr,"-ping-bottom"),Oo),oe)),ref:qt},C.createElement(te.a,{onResize:ea},C.createElement("div",{ref:Jt,className:"".concat(m,"-nav-list"),style:{transform:"translate(".concat(At,"px, ").concat(Ln,"px)"),transition:So?"none":void 0}},Qa,C.createElement(Un,{ref:dn,prefixCls:m,locale:it,editable:ot,style:{visibility:Oa?"hidden":null}}),C.createElement("div",{className:E()("".concat(m,"-ink-bar"),Object(S.a)({},"".concat(m,"-ink-bar-animated"),le.inkBar)),style:fo}))))),C.createElement(tn,Object.assign({},A,{ref:Yt,prefixCls:m,tabs:ni,className:!Oa&&eo})),C.createElement(ba,{position:"right",extra:Pe,prefixCls:m}))}var Go=C.forwardRef(Vo);function Ga(A){var q=A.id,oe=A.activeKey,I=A.animated,m=A.tabPosition,_=A.rtl,b=A.destroyInactiveTabPane,F=C.useContext(Cr),V=F.prefixCls,le=F.tabs,ne=I.tabPane,ve=le.findIndex(function(Pe){return Pe.key===oe});return C.createElement("div",{className:E()("".concat(V,"-content-holder"))},C.createElement("div",{className:E()("".concat(V,"-content"),"".concat(V,"-content-").concat(m),Object(S.a)({},"".concat(V,"-content-animated"),ne)),style:ve&&ne?Object(S.a)({},_?"marginRight":"marginLeft","-".concat(ve,"00%")):null},le.map(function(Pe){return C.cloneElement(Pe.node,{key:Pe.key,prefixCls:V,tabKey:Pe.key,id:q,animated:ne,active:Pe.key===oe,destroyInactiveTabPane:b})})))}function Ca(A){var q=A.prefixCls,oe=A.forceRender,I=A.className,m=A.style,_=A.id,b=A.active,F=A.animated,V=A.destroyInactiveTabPane,le=A.tabKey,ne=A.children,ve=C.useState(oe),Pe=Object(de.a)(ve,2),ot=Pe[0],it=Pe[1];C.useEffect(function(){b?it(!0):V&&it(!1)},[b,V]);var ct={};return b||(F?(ct.visibility="hidden",ct.height=0,ct.overflowY="hidden"):ct.display="none"),C.createElement("div",{id:_&&"".concat(_,"-panel-").concat(le),role:"tabpanel",tabIndex:b?0:-1,"aria-labelledby":_&&"".concat(_,"-tab-").concat(le),"aria-hidden":!b,style:Object(z.a)(Object(z.a)({},ct),m),className:E()("".concat(q,"-tabpane"),b&&"".concat(q,"-tabpane-active"),I)},(b||ot||oe)&&ne)}var Ko=0;function xa(A){return Object(R.a)(A).map(function(q){if(C.isValidElement(q)){var oe=q.key!==void 0?String(q.key):void 0;return Object(z.a)(Object(z.a)({key:oe},q.props),{},{node:q})}return null}).filter(function(q){return q})}function Ka(A,q){var oe,I=A.id,m=A.prefixCls,_=m===void 0?"rc-tabs":m,b=A.className,F=A.children,V=A.direction,le=A.activeKey,ne=A.defaultActiveKey,ve=A.editable,Pe=A.animated,ot=A.tabPosition,it=ot===void 0?"top":ot,ct=A.tabBarGutter,Wt=A.tabBarStyle,Qt=A.tabBarExtraContent,Kt=A.locale,$t=A.moreIcon,qt=A.moreTransitionName,Jt=A.destroyInactiveTabPane,Yt=A.renderTabBar,dn=A.onChange,nn=A.onTabClick,Fn=A.onTabScroll,rn=Object(G.a)(A,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Ut=xa(F),Nt=V==="rtl",sn;Pe===!1?sn={inkBar:!1,tabPane:!1}:sn=Object(z.a)({inkBar:!0,tabPane:!1},Pe!==!0?Pe:null);var fn=Object(C.useState)(!1),At=Object(de.a)(fn,2),gn=At[0],Hn=At[1];Object(C.useEffect)(function(){Hn(lo())},[]);var Cn=Object(B.a)(function(){var An;return(An=Ut[0])===null||An===void 0?void 0:An.key},{value:le,defaultValue:ne}),Ln=Object(de.a)(Cn,2),Tn=Ln[0],Qn=Ln[1],fi=Object(C.useState)(function(){return Ut.findIndex(function(An){return An.key===Tn})}),Gn=Object(de.a)(fi,2),Mi=Gn[0],er=Gn[1];Object(C.useEffect)(function(){var An=Ut.findIndex(function(Rr){return Rr.key===Tn});if(An===-1){var hr;An=Math.max(0,Math.min(Mi,Ut.length-1)),Qn((hr=Ut[An])===null||hr===void 0?void 0:hr.key)}er(An)},[Ut.map(function(An){return An.key}).join("_"),Tn,Mi]);var Pi=Object(B.a)(null,{value:I}),pi=Object(de.a)(Pi,2),jn=pi[0],Dn=pi[1],Kn=it;gn&&!["left","right"].includes(it)&&(Kn="top"),Object(C.useEffect)(function(){I||(Dn("rc-tabs-".concat(Ko)),Ko+=1)},[]);function zn(An,hr){nn==null||nn(An,hr),Qn(An),dn==null||dn(An)}var tr={id:jn,activeKey:Tn,animated:sn,tabPosition:Kn,rtl:Nt,mobile:gn},Tr,Ar=Object(z.a)(Object(z.a)({},tr),{},{editable:ve,locale:Kt,moreIcon:$t,moreTransitionName:qt,tabBarGutter:ct,onTabClick:zn,onTabScroll:Fn,extra:Qt,style:Wt,panes:F});return Yt?Tr=Yt(Ar,Go):Tr=C.createElement(Go,Object.assign({},Ar)),C.createElement(Cr.Provider,{value:{tabs:Ut,prefixCls:_}},C.createElement("div",Object.assign({ref:q,id:I,className:E()(_,"".concat(_,"-").concat(Kn),(oe={},Object(S.a)(oe,"".concat(_,"-mobile"),gn),Object(S.a)(oe,"".concat(_,"-editable"),ve),Object(S.a)(oe,"".concat(_,"-rtl"),Nt),oe),b)},rn),Tr,C.createElement(Ga,Object.assign({destroyInactiveTabPane:Jt},tr,{animated:sn}))))}var Jr=C.forwardRef(Ka);Jr.TabPane=Ca;var xr=Jr,Xo=Ze.b=xr},kSUc:function(mt,Ze,y){},lZu9:function(mt,Ze,y){(function(S){S(y("VrN/"),y("1eCo"),y("8EBN"))})(function(S){"use strict";S.defineMode("markdown",function(de,G){var z=S.getMode(de,"text/html"),C=z.name=="null";function ee(M){if(S.findModeByName){var g=S.findModeByName(M);g&&(M=g.mime||g.mimes[0])}var ue=S.getMode(de,M);return ue.name=="null"?null:ue}G.highlightFormatting===void 0&&(G.highlightFormatting=!1),G.maxBlockquoteDepth===void 0&&(G.maxBlockquoteDepth=0),G.taskLists===void 0&&(G.taskLists=!1),G.strikethrough===void 0&&(G.strikethrough=!1),G.emoji===void 0&&(G.emoji=!1),G.fencedCodeBlockHighlighting===void 0&&(G.fencedCodeBlockHighlighting=!0),G.fencedCodeBlockDefaultMode===void 0&&(G.fencedCodeBlockDefaultMode="text/plain"),G.xml===void 0&&(G.xml=!0),G.tokenTypeOverrides===void 0&&(G.tokenTypeOverrides={});var E={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 R in E)E.hasOwnProperty(R)&&G.tokenTypeOverrides[R]&&(E[R]=G.tokenTypeOverrides[R]);var B=/^([*\-_])(?:\s*\1){2,}\s*$/,X=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,D=/^\[(x| )\](?=\s)/i,O=G.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,te=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Q=/^[^#!\[\]*_\\<>` "'(~:]+/,W=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,H=/^\s*\[[^\]]+?\]:.*$/,P=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,ie=" ";function se(M,g,ue){return g.f=g.inline=ue,ue(M,g)}function Oe(M,g,ue){return g.f=g.block=ue,ue(M,g)}function Ke(M){return!M||!/\S/.test(M.string)}function ge(M){if(M.linkTitle=!1,M.linkHref=!1,M.linkText=!1,M.em=!1,M.strong=!1,M.strikethrough=!1,M.quote=0,M.indentedCode=!1,M.f==Ve){var g=C;if(!g){var ue=S.innerMode(z,M.htmlState);g=ue.mode.name=="xml"&&ue.state.tagStart===null&&!ue.state.context&&ue.state.tokenize.isInText}g&&(M.f=we,M.block=Me,M.htmlState=null)}return M.trailingSpace=0,M.trailingSpaceNewLine=!1,M.prevLine=M.thisLine,M.thisLine={stream:null},null}function Me(M,g){var ue=M.column()===g.indentation,Ie=Ke(g.prevLine.stream),Te=g.indentedCode,nt=g.prevLine.hr,st=g.list!==!1,Ue=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var He=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,st)){for(g.list=null;He<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=He-g.listStack[g.listStack.length-1])}var Le=!Ie&&!nt&&!g.prevLine.header&&(!st||!Te)&&!g.prevLine.fencedCodeEnd,Be=(g.list===!1||nt||Ie)&&g.indentation<=Ue&&M.match(B),ce=null;if(g.indentationDiff>=4&&(Te||g.prevLine.fencedCodeEnd||g.prevLine.header||Ie))return M.skipToEnd(),g.indentedCode=!0,E.code;if(M.eatSpace())return null;if(ue&&g.indentation<=Ue&&(ce=M.match(O))&&ce[1].length<=6)return g.quote=0,g.header=ce[1].length,g.thisLine.header=!0,G.highlightFormatting&&(g.formatting="header"),g.f=g.inline,be(g);if(g.indentation<=Ue&&M.eat(">"))return g.quote=ue?1:g.quote+1,G.highlightFormatting&&(g.formatting="quote"),M.eatSpace(),be(g);if(!Be&&!g.setext&&ue&&g.indentation<=Ue&&(ce=M.match(X))){var j=ce[1]?"ol":"ul";return g.indentation=He+M.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,G.taskLists&&M.match(D,!1)&&(g.taskList=!0),g.f=g.inline,G.highlightFormatting&&(g.formatting=["list","list-"+j]),be(g)}else{if(ue&&g.indentation<=Ue&&(ce=M.match(W,!0)))return g.quote=0,g.fencedEndRE=new RegExp(ce[1]+"+ *$"),g.localMode=G.fencedCodeBlockHighlighting&&ee(ce[2]||G.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=S.startState(g.localMode)),g.f=g.block=_e,G.highlightFormatting&&(g.formatting="code-block"),g.code=-1,be(g);if(g.setext||(!Le||!st)&&!g.quote&&g.list===!1&&!g.code&&!Be&&!H.test(M.string)&&(ce=M.lookAhead(1))&&(ce=ce.match(te)))return g.setext?(g.header=g.setext,g.setext=0,M.skipToEnd(),G.highlightFormatting&&(g.formatting="header")):(g.header=ce[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,be(g);if(Be)return M.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,E.hr;if(M.peek()==="[")return se(M,g,K)}return se(M,g,g.inline)}function Ve(M,g){var ue=z.token(M,g.htmlState);if(!C){var Ie=S.innerMode(z,g.htmlState);(Ie.mode.name=="xml"&&Ie.state.tagStart===null&&!Ie.state.context&&Ie.state.tokenize.isInText||g.md_inside&&M.current().indexOf(">")>-1)&&(g.f=we,g.block=Me,g.htmlState=null)}return ue}function _e(M,g){var ue=g.listStack[g.listStack.length-1]||0,Ie=g.indentation<ue,Te=ue+3;if(g.fencedEndRE&&g.indentation<=Te&&(Ie||M.match(g.fencedEndRE))){G.highlightFormatting&&(g.formatting="code-block");var nt;return Ie||(nt=be(g)),g.localMode=g.localState=null,g.block=Me,g.f=we,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,Ie?Oe(M,g,g.block):nt}else return g.localMode?g.localMode.token(M,g.localState):(M.skipToEnd(),E.code)}function be(M){var g=[];if(M.formatting){g.push(E.formatting),typeof M.formatting=="string"&&(M.formatting=[M.formatting]);for(var ue=0;ue<M.formatting.length;ue++)g.push(E.formatting+"-"+M.formatting[ue]),M.formatting[ue]==="header"&&g.push(E.formatting+"-"+M.formatting[ue]+"-"+M.header),M.formatting[ue]==="quote"&&(!G.maxBlockquoteDepth||G.maxBlockquoteDepth>=M.quote?g.push(E.formatting+"-"+M.formatting[ue]+"-"+M.quote):g.push("error"))}if(M.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(M.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(M.linkHref?g.push(E.linkHref,"url"):(M.strong&&g.push(E.strong),M.em&&g.push(E.em),M.strikethrough&&g.push(E.strikethrough),M.emoji&&g.push(E.emoji),M.linkText&&g.push(E.linkText),M.code&&g.push(E.code),M.image&&g.push(E.image),M.imageAltText&&g.push(E.imageAltText,"link"),M.imageMarker&&g.push(E.imageMarker)),M.header&&g.push(E.header,E.header+"-"+M.header),M.quote&&(g.push(E.quote),!G.maxBlockquoteDepth||G.maxBlockquoteDepth>=M.quote?g.push(E.quote+"-"+M.quote):g.push(E.quote+"-"+G.maxBlockquoteDepth)),M.list!==!1){var Ie=(M.listStack.length-1)%3;Ie?Ie===1?g.push(E.list2):g.push(E.list3):g.push(E.list1)}return M.trailingSpaceNewLine?g.push("trailing-space-new-line"):M.trailingSpace&&g.push("trailing-space-"+(M.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function Ne(M,g){return M.match(Q,!0)?be(g):void 0}function we(M,g){var ue=g.text(M,g);if(typeof ue!="undefined")return ue;if(g.list)return g.list=null,be(g);if(g.taskList){var Ie=M.match(D,!0)[1]===" ";return Ie?g.taskOpen=!0:g.taskClosed=!0,G.highlightFormatting&&(g.formatting="task"),g.taskList=!1,be(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&M.match(/^#+$/,!0))return G.highlightFormatting&&(g.formatting="header"),be(g);var Te=M.next();if(g.linkTitle){g.linkTitle=!1;var nt=Te;Te==="("&&(nt=")"),nt=(nt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var st="^\\s*(?:[^"+nt+"\\\\]+|\\\\\\\\|\\\\.)"+nt;if(M.match(new RegExp(st),!0))return E.linkHref}if(Te==="`"){var Ue=g.formatting;G.highlightFormatting&&(g.formatting="code"),M.eatWhile("`");var He=M.current().length;if(g.code==0&&(!g.quote||He==1))return g.code=He,be(g);if(He==g.code){var Le=be(g);return g.code=0,Le}else return g.formatting=Ue,be(g)}else if(g.code)return be(g);if(Te==="\\"&&(M.next(),G.highlightFormatting)){var Be=be(g),ce=E.formatting+"-escape";return Be?Be+" "+ce:ce}if(Te==="!"&&M.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,G.highlightFormatting&&(g.formatting="image"),be(g);if(Te==="["&&g.imageMarker&&M.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,G.highlightFormatting&&(g.formatting="image"),be(g);if(Te==="]"&&g.imageAltText){G.highlightFormatting&&(g.formatting="image");var Be=be(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=Ee,Be}if(Te==="["&&!g.image)return g.linkText&&M.match(/^.*?\]/)||(g.linkText=!0,G.highlightFormatting&&(g.formatting="link")),be(g);if(Te==="]"&&g.linkText){G.highlightFormatting&&(g.formatting="link");var Be=be(g);return g.linkText=!1,g.inline=g.f=M.match(/\(.*?\)| ?\[.*?\]/,!1)?Ee:we,Be}if(Te==="<"&&M.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=N,G.highlightFormatting&&(g.formatting="link");var Be=be(g);return Be?Be+=" ":Be="",Be+E.linkInline}if(Te==="<"&&M.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=N,G.highlightFormatting&&(g.formatting="link");var Be=be(g);return Be?Be+=" ":Be="",Be+E.linkEmail}if(G.xml&&Te==="<"&&M.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var j=M.string.indexOf(">",M.pos);if(j!=-1){var et=M.string.substring(M.start,j);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(et)&&(g.md_inside=!0)}return M.backUp(1),g.htmlState=S.startState(z),Oe(M,g,Ve)}if(G.xml&&Te==="<"&&M.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(Te==="*"||Te==="_"){for(var Ct=1,St=M.pos==1?" ":M.string.charAt(M.pos-2);Ct<3&&M.eat(Te);)Ct++;var ze=M.peek()||" ",pt=!/\s/.test(ze)&&(!P.test(ze)||/\s/.test(St)||P.test(St)),fe=!/\s/.test(St)&&(!P.test(St)||/\s/.test(ze)||P.test(ze)),Ae=null,Ge=null;if(Ct%2&&(!g.em&&pt&&(Te==="*"||!fe||P.test(St))?Ae=!0:g.em==Te&&fe&&(Te==="*"||!pt||P.test(ze))&&(Ae=!1)),Ct>1&&(!g.strong&&pt&&(Te==="*"||!fe||P.test(St))?Ge=!0:g.strong==Te&&fe&&(Te==="*"||!pt||P.test(ze))&&(Ge=!1)),Ge!=null||Ae!=null){G.highlightFormatting&&(g.formatting=Ae==null?"strong":Ge==null?"em":"strong em"),Ae===!0&&(g.em=Te),Ge===!0&&(g.strong=Te);var Le=be(g);return Ae===!1&&(g.em=!1),Ge===!1&&(g.strong=!1),Le}}else if(Te===" "&&(M.eat("*")||M.eat("_"))){if(M.peek()===" ")return be(g);M.backUp(1)}if(G.strikethrough){if(Te==="~"&&M.eatWhile(Te)){if(g.strikethrough){G.highlightFormatting&&(g.formatting="strikethrough");var Le=be(g);return g.strikethrough=!1,Le}else if(M.match(/^[^\s]/,!1))return g.strikethrough=!0,G.highlightFormatting&&(g.formatting="strikethrough"),be(g)}else if(Te===" "&&M.match(/^~~/,!0)){if(M.peek()===" ")return be(g);M.backUp(2)}}if(G.emoji&&Te===":"&&M.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,G.highlightFormatting&&(g.formatting="emoji");var Se=be(g);return g.emoji=!1,Se}return Te===" "&&(M.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),be(g)}function N(M,g){var ue=M.next();if(ue===">"){g.f=g.inline=we,G.highlightFormatting&&(g.formatting="link");var Ie=be(g);return Ie?Ie+=" ":Ie="",Ie+E.linkInline}return M.match(/^[^>]+/,!0),E.linkInline}function Ee(M,g){if(M.eatSpace())return null;var ue=M.next();return ue==="("||ue==="["?(g.f=g.inline=k(ue==="("?")":"]"),G.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,be(g)):"error"}var ye={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function k(M){return function(g,ue){var Ie=g.next();if(Ie===M){ue.f=ue.inline=we,G.highlightFormatting&&(ue.formatting="link-string");var Te=be(ue);return ue.linkHref=!1,Te}return g.match(ye[M]),ue.linkHref=!0,be(ue)}}function K(M,g){return M.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=he,M.next(),G.highlightFormatting&&(g.formatting="link"),g.linkText=!0,be(g)):se(M,g,we)}function he(M,g){if(M.match(/^\]:/,!0)){g.f=g.inline=$,G.highlightFormatting&&(g.formatting="link");var ue=be(g);return g.linkText=!1,ue}return M.match(/^([^\]\\]|\\.)+/,!0),E.linkText}function $(M,g){return M.eatSpace()?null:(M.match(/^[^\s]+/,!0),M.peek()===void 0?g.linkTitle=!0:M.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=we,E.linkHref+" url")}var Re={startState:function(){return{f:Me,prevLine:{stream:null},thisLine:{stream:null},block:Me,htmlState:null,indentation:0,inline:we,text:Ne,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(M){return{f:M.f,prevLine:M.prevLine,thisLine:M.thisLine,block:M.block,htmlState:M.htmlState&&S.copyState(z,M.htmlState),indentation:M.indentation,localMode:M.localMode,localState:M.localMode?S.copyState(M.localMode,M.localState):null,inline:M.inline,text:M.text,formatting:!1,linkText:M.linkText,linkTitle:M.linkTitle,linkHref:M.linkHref,code:M.code,em:M.em,strong:M.strong,strikethrough:M.strikethrough,emoji:M.emoji,header:M.header,setext:M.setext,hr:M.hr,taskList:M.taskList,list:M.list,listStack:M.listStack.slice(0),quote:M.quote,indentedCode:M.indentedCode,trailingSpace:M.trailingSpace,trailingSpaceNewLine:M.trailingSpaceNewLine,md_inside:M.md_inside,fencedEndRE:M.fencedEndRE}},token:function(M,g){if(g.formatting=!1,M!=g.thisLine.stream){if(g.header=0,g.hr=!1,M.match(/^\s*$/,!0))return ge(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:M},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=Ve)){var ue=M.match(/^\s*/,!0)[0].replace(/\t/g,ie).length;if(g.indentation=ue,g.indentationDiff=null,ue>0)return null}}return g.f(M,g)},innerMode:function(M){return M.block==Ve?{state:M.htmlState,mode:z}:M.localState?{state:M.localState,mode:M.localMode}:{state:M,mode:Re}},indent:function(M,g,ue){return M.block==Ve&&z.indent?z.indent(M.htmlState,g,ue):M.localState&&M.localMode.indent?M.localMode.indent(M.localState,g,ue):S.Pass},blankLine:ge,getType:be,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Re},"xml"),S.defineMIME("text/markdown","markdown"),S.defineMIME("text/x-markdown","markdown")})},nVVt:function(mt,Ze){mt.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(mt,Ze,y){(function(S){S(y("VrN/"))})(function(S){"use strict";var de=S.Pos;function G(P,ie){return P.line-ie.line||P.ch-ie.ch}var z="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",C=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ee=new RegExp("<(/?)(["+z+"]["+C+"]*)","g");function E(P,ie,se,Oe){this.line=ie,this.ch=se,this.cm=P,this.text=P.getLine(ie),this.min=Oe?Math.max(Oe.from,P.firstLine()):P.firstLine(),this.max=Oe?Math.min(Oe.to-1,P.lastLine()):P.lastLine()}function R(P,ie){var se=P.cm.getTokenTypeAt(de(P.line,ie));return se&&/\btag\b/.test(se)}function B(P){return P.line>=P.max?void 0:(P.ch=0,P.text=P.cm.getLine(++P.line),!0)}function X(P){return P.line<=P.min?void 0:(P.text=P.cm.getLine(--P.line),P.ch=P.text.length,!0)}function D(P){for(;;){var ie=P.text.indexOf(">",P.ch);if(ie==-1){if(B(P))continue;return}if(!R(P,ie+1)){P.ch=ie+1;continue}var se=P.text.lastIndexOf("/",ie),Oe=se>-1&&!/\S/.test(P.text.slice(se+1,ie));return P.ch=ie+1,Oe?"selfClose":"regular"}}function O(P){for(;;){var ie=P.ch?P.text.lastIndexOf("<",P.ch-1):-1;if(ie==-1){if(X(P))continue;return}if(!R(P,ie+1)){P.ch=ie;continue}ee.lastIndex=ie,P.ch=ie;var se=ee.exec(P.text);if(se&&se.index==ie)return se}}function te(P){for(;;){ee.lastIndex=P.ch;var ie=ee.exec(P.text);if(!ie){if(B(P))continue;return}if(!R(P,ie.index+1)){P.ch=ie.index+1;continue}return P.ch=ie.index+ie[0].length,ie}}function Q(P){for(;;){var ie=P.ch?P.text.lastIndexOf(">",P.ch-1):-1;if(ie==-1){if(X(P))continue;return}if(!R(P,ie+1)){P.ch=ie;continue}var se=P.text.lastIndexOf("/",ie),Oe=se>-1&&!/\S/.test(P.text.slice(se+1,ie));return P.ch=ie+1,Oe?"selfClose":"regular"}}function W(P,ie){for(var se=[];;){var Oe=te(P),Ke,ge=P.line,Me=P.ch-(Oe?Oe[0].length:0);if(!Oe||!(Ke=D(P)))return;if(Ke=="selfClose")continue;if(Oe[1]){for(var Ve=se.length-1;Ve>=0;--Ve)if(se[Ve]==Oe[2]){se.length=Ve;break}if(Ve<0&&(!ie||ie==Oe[2]))return{tag:Oe[2],from:de(ge,Me),to:de(P.line,P.ch)}}else se.push(Oe[2])}}function H(P,ie){for(var se=[];;){var Oe=Q(P);if(!Oe)return;if(Oe=="selfClose"){O(P);continue}var Ke=P.line,ge=P.ch,Me=O(P);if(!Me)return;if(Me[1])se.push(Me[2]);else{for(var Ve=se.length-1;Ve>=0;--Ve)if(se[Ve]==Me[2]){se.length=Ve;break}if(Ve<0&&(!ie||ie==Me[2]))return{tag:Me[2],from:de(P.line,P.ch),to:de(Ke,ge)}}}}S.registerHelper("fold","xml",function(P,ie){for(var se=new E(P,ie.line,0);;){var Oe=te(se);if(!Oe||se.line!=ie.line)return;var Ke=D(se);if(!Ke)return;if(!Oe[1]&&Ke!="selfClose"){var ge=de(se.line,se.ch),Me=W(se,Oe[2]);return Me&&G(Me.from,ge)>0?{from:ge,to:Me.from}:null}}}),S.findMatchingTag=function(P,ie,se){var Oe=new E(P,ie.line,ie.ch,se);if(Oe.text.indexOf(">")==-1&&Oe.text.indexOf("<")==-1)return;var Ke=D(Oe),ge=Ke&&de(Oe.line,Oe.ch),Me=Ke&&O(Oe);if(!Ke||!Me||G(Oe,ie)>0)return;var Ve={from:de(Oe.line,Oe.ch),to:ge,tag:Me[2]};return Ke=="selfClose"?{open:Ve,close:null,at:"open"}:Me[1]?{open:H(Oe,Me[2]),close:Ve,at:"close"}:(Oe=new E(P,ge.line,ge.ch,se),{open:Ve,close:W(Oe,Me[2]),at:"open"})},S.findEnclosingTag=function(P,ie,se,Oe){for(var Ke=new E(P,ie.line,ie.ch,se);;){var ge=H(Ke,Oe);if(!ge)break;var Me=new E(P,ie.line,ie.ch,se),Ve=W(Me,ge.tag);if(Ve)return{open:ge,close:Ve}}},S.scanForClosingTag=function(P,ie,se,Oe){var Ke=new E(P,ie.line,ie.ch,Oe?{from:0,to:Oe}:null);return W(Ke,se)}})},p5ED:function(mt,Ze,y){"use strict";var S=y("+L6B"),de=y("2/Rp"),G=y("5Dmo"),z=y("3S7+"),C=y("k1fw"),ee=y("tJVT"),E=y("q1tI"),R=y.n(E),B=y("vHTk"),X=y.n(B),D=y("yEEn"),O=y("ZW9T"),te=y("1vsH"),Q=y("m3rI");Ze.a=function(W){var H=W.name,P=W.data,ie=W.theme,se=W.type,Oe=W.filename,Ke=W.monacoEditor,ge=W.className,Me=W.style,Ve=W.close,_e=W.onClose,be=W.hasMask,Ne=W.otherData,we=Object(E.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),N=Object(ee.a)(we,2),Ee=N[0],ye=N[1],k=Object(E.useState)(""),K=Object(ee.a)(k,2),he=K[0],$=K[1],Re,M=1024*1024,g=10*M,ue=Object(E.useRef)();se==="office"&&(Re=Object(te.R)(P).filesize,Re>g&&(se="other")),Oe&&(Ke.filename=Oe),Object(E.useEffect)(function(){var nt,st,Ue=(nt=document.cookie)===null||nt===void 0||((st=nt.replace(/\s/g,""))===null||st===void 0)?void 0:st.split(";");Ue==null||Ue.map(function(He){var Le=He.split("=");Le[0]==="_educoder_session"&&$(Le[1])})},[]);var Ie=function(){if(P.startsWith("http")||P.startsWith("blob:")){Te();return}Object(te.x)(Oe||"educoder",P,Oe)},Te=function(){Object(te.v)(Oe||"educoder",decodeURIComponent(P))};return R.a.createElement("div",{style:Object(C.a)({},Me||{}),className:"".concat(be&&X.a.bgBlack," ").concat(se?X.a.wrp:"hide")},Ve&&R.a.createElement("div",{className:X.a.close,ref:ue},R.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ue.current}},R.a.createElement("span",{onClick:Te},R.a.createElement("i",{className:"icon-quxiaozhiding"}))),R.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ue.current}},R.a.createElement("span",{className:"",onClick:_e},R.a.createElement("i",{className:"icon-guanbi1"})))),R.a.createElement("div",{className:"".concat(X.a[ge]," ").concat(ge," ").concat(X.a.monaco," ").concat(se==="txt"?"show":"hide")},se==="txt"&&R.a.createElement(O.b,Ke)),se==="audio"&&R.a.createElement("audio",{src:"".concat((P==null?void 0:P.indexOf("http://"))>-1||(P==null?void 0:P.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(P),autoPlay:!0}),se==="video"&&R.a.createElement(R.a.Fragment,null,(P==null?void 0:P.indexOf("http"))>-1?R.a.createElement("video",{controls:!0,src:"".concat(P),autoPlay:!0}):R.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(P),autoPlay:!0})),se==="office"&&R.a.createElement("iframe",{src:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(P,"?").concat(encodeURIComponent("disposition=office&token=".concat(he)))}),(se==="xlsx"||se==="doc"||se==="pptx"||se==="docx")&&R.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(Ne.key,"&url=").concat(Q.a.API_SERVER+Ne.url,"&callbackUrl=").concat(Q.a.API_SERVER+Ne.callbackUrl,"&fileType=").concat(Ne.fileType,"&title=").concat(Ne.title,"&model=").concat(Ne.model)}),se==="html"&&R.a.createElement("iframe",{src:P+"&disposition=inline"}),se==="pdf"&&R.a.createElement("embed",{className:X.a.embed,src:P,type:"application/pdf"}),se==="image"&&R.a.createElement("img",{src:"".concat((P==null?void 0:P.indexOf("http://"))>-1||(P==null?void 0:P.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(P)}),se==="other"&&R.a.createElement("div",null,R.a.createElement(de.a,{type:"primary",size:"large",onClick:Ie},R.a.createElement(D.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),se==="download"&&R.a.createElement(de.a,{type:"primary",size:"large",onClick:Ie},R.a.createElement(D.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(mt,Ze,y){},"rAM+":function(mt,Ze,y){"use strict";y.d(Ze,"a",function(){return de});var S=y("Qw5x");function de(G,z){var C;if(typeof Symbol=="undefined"||G[Symbol.iterator]==null){if(Array.isArray(G)||(C=Object(S.a)(G))||z&&G&&typeof G.length=="number"){C&&(G=C);var ee=0,E=function(){};return{s:E,n:function(){return ee>=G.length?{done:!0}:{done:!1,value:G[ee++]}},e:function(O){throw O},f:E}}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 R=!0,B=!1,X;return{s:function(){C=G[Symbol.iterator]()},n:function(){var O=C.next();return R=O.done,O},e:function(O){B=!0,X=O},f:function(){try{!R&&C.return!=null&&C.return()}finally{if(B)throw X}}}}},rUJ1:function(mt,Ze){const y=/[&<>"']/,S=/[&<>"']/g,de=/[<>"']|&(?!#?\w+;)/,G=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},C=_e=>z[_e];function ee(_e,be){if(be){if(y.test(_e))return _e.replace(S,C)}else if(de.test(_e))return _e.replace(G,C);return _e}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function R(_e){return _e.replace(E,(be,Ne)=>(Ne=Ne.toLowerCase(),Ne==="colon"?":":Ne.charAt(0)==="#"?Ne.charAt(1)==="x"?String.fromCharCode(parseInt(Ne.substring(2),16)):String.fromCharCode(+Ne.substring(1)):""))}const B=/(^|[^\[])\^/g;function X(_e,be){_e=_e.source||_e,be=be||"";const Ne={replace:(we,N)=>(N=N.source||N,N=N.replace(B,"$1"),_e=_e.replace(we,N),Ne),getRegex:()=>new RegExp(_e,be)};return Ne}const D=/[^\w:]/g,O=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function te(_e,be,Ne){if(_e){let we;try{we=decodeURIComponent(R(Ne)).replace(D,"").toLowerCase()}catch(N){return null}if(we.indexOf("javascript:")===0||we.indexOf("vbscript:")===0||we.indexOf("data:")===0)return null}be&&!O.test(Ne)&&(Ne=ie(be,Ne));try{Ne=encodeURI(Ne).replace(/%25/g,"%")}catch(we){return null}return Ne}const Q={},W=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,P=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ie(_e,be){Q[" "+_e]||(W.test(_e)?Q[" "+_e]=_e+"/":Q[" "+_e]=ge(_e,"/",!0)),_e=Q[" "+_e];const Ne=_e.indexOf(":")===-1;return be.substring(0,2)==="//"?Ne?be:_e.replace(H,"$1")+be:be.charAt(0)==="/"?Ne?be:_e.replace(P,"$1")+be:_e+be}const se={exec:function(){}};function Oe(_e){let be=1,Ne,we;for(;be<arguments.length;be++){Ne=arguments[be];for(we in Ne)Object.prototype.hasOwnProperty.call(Ne,we)&&(_e[we]=Ne[we])}return _e}function Ke(_e,be){const Ne=_e.replace(/\|/g,(Ee,ye,k)=>{let K=!1,he=ye;for(;--he>=0&&k[he]==="\\";)K=!K;return K?"|":" |"}),we=Ne.split(/ \|/);let N=0;if(we.length>be)we.splice(be);else for(;we.length<be;)we.push("");for(;N<we.length;N++)we[N]=we[N].trim().replace(/\\\|/g,"|");return we}function ge(_e,be,Ne){const we=_e.length;if(we===0)return"";let N=0;for(;N<we;){const Ee=_e.charAt(we-N-1);if(Ee===be&&!Ne)N++;else if(Ee!==be&&Ne)N++;else break}return _e.substr(0,we-N)}function Me(_e,be){if(_e.indexOf(be[1])===-1)return-1;const Ne=_e.length;let we=0,N=0;for(;N<Ne;N++)if(_e[N]==="\\")N++;else if(_e[N]===be[0])we++;else if(_e[N]===be[1]&&(we--,we<0))return N;return-1}function Ve(_e){_e&&_e.sanitize&&!_e.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")}mt.exports={escape:ee,unescape:R,edit:X,cleanUrl:te,resolveUrl:ie,noopTest:se,merge:Oe,splitCells:Ke,rtrim:ge,findClosingBracket:Me,checkSanitizeDeprecation:Ve}},rcnY:function(mt,Ze,y){var S=y("aRTE");function de(G,z){this.totalCount=G,this.dataCount=z}de.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],de.getRSBlocks=function(G,z){var C=de.getRsBlockTable(G,z);if(C==null)throw new Error("bad rs block @ typeNumber:"+G+"/errorCorrectLevel:"+z);for(var ee=C.length/3,E=new Array,R=0;R<ee;R++)for(var B=C[R*3+0],X=C[R*3+1],D=C[R*3+2],O=0;O<B;O++)E.push(new de(X,D));return E},de.getRsBlockTable=function(G,z){switch(z){case S.L:return de.RS_BLOCK_TABLE[(G-1)*4+0];case S.M:return de.RS_BLOCK_TABLE[(G-1)*4+1];case S.Q:return de.RS_BLOCK_TABLE[(G-1)*4+2];case S.H:return de.RS_BLOCK_TABLE[(G-1)*4+3];default:return}},mt.exports=de},t23M:function(mt,Ze,y){"use strict";var S=y("VTBJ"),de=y("1OyB"),G=y("vuIU"),z=y("Ji7U"),C=y("LK+K"),ee=y("q1tI"),E=y.n(ee),R=y("m+aA"),B=y("Zm9Q"),X=y("Kwbf"),D=y("c+Xe"),O=y("bdgK"),te="rc-observer-key",Q=function(W){Object(z.a)(P,W);var H=Object(C.a)(P);function P(){var ie;return Object(de.a)(this,P),ie=H.apply(this,arguments),ie.resizeObserver=null,ie.childNode=null,ie.currentElement=null,ie.state={width:0,height:0,offsetHeight:0,offsetWidth:0},ie.onResize=function(se){var Oe=ie.props.onResize,Ke=se[0].target,ge=Ke.getBoundingClientRect(),Me=ge.width,Ve=ge.height,_e=Ke.offsetWidth,be=Ke.offsetHeight,Ne=Math.floor(Me),we=Math.floor(Ve);if(ie.state.width!==Ne||ie.state.height!==we||ie.state.offsetWidth!==_e||ie.state.offsetHeight!==be){var N={width:Ne,height:we,offsetWidth:_e,offsetHeight:be};ie.setState(N),Oe&&Promise.resolve().then(function(){Oe(Object(S.a)(Object(S.a)({},N),{},{offsetWidth:_e,offsetHeight:be}))})}},ie.setChildNode=function(se){ie.childNode=se},ie}return Object(G.a)(P,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var se=this.props.disabled;if(se){this.destroyObserver();return}var Oe=Object(R.a)(this.childNode||this),Ke=Oe!==this.currentElement;Ke&&(this.destroyObserver(),this.currentElement=Oe),!this.resizeObserver&&Oe&&(this.resizeObserver=new O.default(this.onResize),this.resizeObserver.observe(Oe))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var se=this.props.children,Oe=Object(B.a)(se);if(Oe.length>1)Object(X.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(Oe.length===0)return Object(X.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var Ke=Oe[0];if(ee.isValidElement(Ke)&&Object(D.c)(Ke)){var ge=Ke.ref;Oe[0]=ee.cloneElement(Ke,{ref:Object(D.a)(ge,this.setChildNode)})}return Oe.length===1?Oe[0]:Oe.map(function(Me,Ve){return!ee.isValidElement(Me)||"key"in Me&&Me.key!==null?Me:ee.cloneElement(Me,{key:"".concat(te,"-").concat(Ve)})})}}]),P}(ee.Component);Q.displayName="ResizeObserver",Ze.a=Q},vHTk:function(mt,Ze,y){mt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(mt,Ze){function y(){this.buffer=new Array,this.length=0}y.prototype={get:function(S){var de=Math.floor(S/8);return(this.buffer[de]>>>7-S%8&1)==1},put:function(S,de){for(var G=0;G<de;G++)this.putBit((S>>>de-G-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(S){var de=Math.floor(this.length/8);this.buffer.length<=de&&this.buffer.push(0),S&&(this.buffer[de]|=128>>>this.length%8),this.length++}},mt.exports=y},xz5A:function(mt,Ze,y){mt.exports={wrapper:"wrapper___12wjq",cover:"cover___1GkB-",title:"title___3YAzg",desc:"desc___S4YrB",info:"info___3i5kz",create_time:"create_time___3X1Dr",btnWrapper:"btnWrapper___3JhOM",btn:"btn___1VL7l",fileWrapper:"fileWrapper___3yI82",fileSize:"fileSize___3672L",download:"download___2tlkv",mainInfo:"mainInfo___133l4",mainText:"mainText___32dN7"}}}]);
|